Home | History | Annotate | Line # | Download | only in dist
      1  1.4  simonb /*	$NetBSD: regexp.h,v 1.4 2023/10/06 05:49:49 simonb Exp $	*/
      2  1.1    tron 
      3  1.1    tron /*
      4  1.1    tron  * Definitions etc. for regexp(3) routines.
      5  1.1    tron  *
      6  1.1    tron  * Caveat:  this is V8 regexp(3) [actually, a reimplementation thereof],
      7  1.1    tron  * not the System V one.
      8  1.1    tron  */
      9  1.1    tron 
     10  1.1    tron #ifndef _REGEXP
     11  1.1    tron #define _REGEXP 1
     12  1.1    tron 
     13  1.1    tron #define NSUBEXP  10
     14  1.1    tron typedef struct regexp {
     15  1.4  simonb         char *startp[NSUBEXP];
     16  1.4  simonb         char *endp[NSUBEXP];
     17  1.4  simonb         char regstart;          /* Internal use only. */
     18  1.4  simonb         char reganch;           /* Internal use only. */
     19  1.4  simonb         char *regmust;          /* Internal use only. */
     20  1.4  simonb         int regmlen;            /* Internal use only. */
     21  1.4  simonb         char program[1];        /* Unwarranted chumminess with compiler. */
     22  1.1    tron } regexp;
     23  1.1    tron 
     24  1.1    tron #if defined(__STDC__) || defined(__cplusplus)
     25  1.1    tron #   define _ANSI_ARGS_(x)       x
     26  1.1    tron #else
     27  1.1    tron #   define _ANSI_ARGS_(x)       ()
     28  1.1    tron #endif
     29  1.1    tron 
     30  1.1    tron extern regexp *regcomp _ANSI_ARGS_((char *exp));
     31  1.1    tron extern int regexec _ANSI_ARGS_((regexp *prog, char *string));
     32  1.1    tron extern int regexec2 _ANSI_ARGS_((regexp *prog, char *string, int notbol));
     33  1.1    tron extern void regsub _ANSI_ARGS_((regexp *prog, char *source, char *dest));
     34  1.1    tron extern void regerror _ANSI_ARGS_((char *msg));
     35  1.1    tron 
     36  1.1    tron #endif /* REGEXP */
     37