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