xref: /netbsd-src/include/regex.h (revision 448e711c7835101c94f75b7ebddf58046df58290)
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 *, const char *, int));
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, const regex_t *, char *, size_t));
54 
55 
56 /* === regexec.c === */
57 extern int regexec __P((const regex_t *, const char *, size_t, regmatch_t [], int));
58 #define	REG_NOTBOL	00001
59 #define	REG_NOTEOL	00002
60 #define	REG_STARTEND	00004
61 #define	REG_TRACE	00400	/* tracing of execution */
62 #define	REG_LARGE	01000	/* force large representation */
63 #define	REG_BACKR	02000	/* force use of backref code */
64 
65 
66 /* === regfree.c === */
67 extern void regfree __P((regex_t *));
68 
69 #ifdef __cplusplus
70 }
71 #endif
72 /* ========= end header generated by ./mkh ========= */
73 #endif
74