1995-10-13 23:34:21 -04:00
|
|
|
/*
|
|
|
|
* Definitions etc. for regexp(3) routines.
|
|
|
|
*
|
|
|
|
* Caveat: this is V8 regexp(3) [actually, a reimplementation thereof],
|
|
|
|
* not the System V one.
|
|
|
|
*/
|
|
|
|
#define NSUBEXP 10
|
|
|
|
typedef struct regexp {
|
1996-09-23 21:29:51 -04:00
|
|
|
const char *startp[NSUBEXP];
|
|
|
|
const char *endp[NSUBEXP];
|
1995-10-13 23:34:21 -04:00
|
|
|
char regstart; /* Internal use only. */
|
|
|
|
char reganch; /* Internal use only. */
|
1996-09-23 21:29:51 -04:00
|
|
|
int regmust; /* Internal use only. */
|
1995-10-13 23:34:21 -04:00
|
|
|
int regmlen; /* Internal use only. */
|
|
|
|
char program[1]; /* Unwarranted chumminess with compiler. */
|
|
|
|
} regexp;
|
1996-09-23 21:29:51 -04:00
|
|
|
|
|
|
|
extern regexp *regcomp(const char *re);
|
|
|
|
extern int regexec(regexp *rp, const char *s);
|
|
|
|
extern void regsub(const regexp *rp, const char *src, char *dst);
|
|
|
|
extern void regnsub(const regexp *rp, const char *src, char *dst, size_t len);
|
|
|
|
extern size_t regsublen(const regexp *rp, const char *src);
|
|
|
|
|
|
|
|
extern void regerror(char *message);
|
|
|
|
extern size_t regcomp_len(const char *exp);
|
|
|
|
extern regexp *regcomp_comp(const char *exp, struct regexp *r, size_t len);
|
|
|
|
|