Home | History | Annotate | Line # | Download | only in include
regex.h revision 1.1
      1 #ifndef _REGEX_H_
      2 #define	_REGEX_H_	/* never again */
      3 /* ========= begin header generated by ./mkh ========= */
      4 #ifdef __cplusplus
      5 extern "C" {
      6 #endif
      7 
      8 /* === regex2.h === */
      9 typedef off_t regoff_t;
     10 typedef struct {
     11 	int re_magic;
     12 	size_t re_nsub;		/* number of parenthesized subexpressions */
     13 const char *re_endp;	/* end pointer for REG_PEND */
     14 	struct re_guts *re_g;	/* none of your business :-) */
     15 } regex_t;
     16 typedef struct {
     17 	regoff_t rm_so;		/* start of match */
     18 	regoff_t rm_eo;		/* end of match */
     19 } regmatch_t;
     20 
     21 
     22 /* === regcomp.c === */
     23 extern int regcomp __P((regex_t *preg, const char *pattern, int cflags));
     24 #define	REG_BASIC	0000
     25 #define	REG_EXTENDED	0001
     26 #define	REG_ICASE	0002
     27 #define	REG_NOSUB	0004
     28 #define	REG_NEWLINE	0010
     29 #define	REG_NOSPEC	0020
     30 #define	REG_PEND	0040
     31 #define	REG_DUMP	0200
     32 
     33 
     34 /* === regerror.c === */
     35 #define	REG_NOMATCH	 1
     36 #define	REG_BADPAT	 2
     37 #define	REG_ECOLLATE	 3
     38 #define	REG_ECTYPE	 4
     39 #define	REG_EESCAPE	 5
     40 #define	REG_ESUBREG	 6
     41 #define	REG_EBRACK	 7
     42 #define	REG_EPAREN	 8
     43 #define	REG_EBRACE	 9
     44 #define	REG_BADBR	10
     45 #define	REG_ERANGE	11
     46 #define	REG_ESPACE	12
     47 #define	REG_BADRPT	13
     48 #define	REG_EMPTY	14
     49 #define	REG_ASSERT	15
     50 #define	REG_INVARG	16
     51 #define	REG_ATOI	255	/* convert name to number (!) */
     52 #define	REG_ITOA	0400	/* convert number to name (!) */
     53 extern size_t regerror __P((int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size));
     54 static char *regatoi __P((const regex_t *preg, char *localbuf));
     55 
     56 
     57 /* === regexec.c === */
     58 extern int regexec __P((const regex_t *preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags));
     59 #define	REG_NOTBOL	00001
     60 #define	REG_NOTEOL	00002
     61 #define	REG_STARTEND	00004
     62 #define	REG_TRACE	00400	/* tracing of execution */
     63 #define	REG_LARGE	01000	/* force large representation */
     64 #define	REG_BACKR	02000	/* force use of backref code */
     65 
     66 
     67 /* === regfree.c === */
     68 extern void regfree __P((regex_t *preg));
     69 
     70 #ifdef __cplusplus
     71 }
     72 #endif
     73 /* ========= end header generated by ./mkh ========= */
     74 #endif
     75