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