Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4973 right-hear 1
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
2
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
3
#ifndef __dj_include_regex_h_
4
#define __dj_include_regex_h_
5
 
6
#ifdef __cplusplus
7
extern "C" {
8
#endif
9
 
10
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
11
 
12
#ifndef __STRICT_ANSI__
13
 
14
#define _POSIX2_RE_DUP_MAX 256
15
 
16
 
17
typedef off_t regoff_t;
18
typedef struct {
19
	int re_magic;
20
	size_t re_nsub;		/* number of parenthesized subexpressions */
21
	const char *re_endp;	/* end pointer for REG_PEND */
22
	struct re_guts *re_g;	/* none of your business :-) */
23
} regex_t;
24
typedef struct {
25
	regoff_t rm_so;		/* start of match */
26
	regoff_t rm_eo;		/* end of match */
27
} regmatch_t;
28
 
29
 
30
 
31
extern int regcomp(regex_t *, const char *, int);
32
#define	REG_BASIC	0000
33
#define	REG_EXTENDED	0001
34
#define	REG_ICASE	0002
35
#define	REG_NOSUB	0004
36
#define	REG_NEWLINE	0010
37
#define	REG_NOSPEC	0020
38
#define	REG_PEND	0040
39
#define	REG_DUMP	0200
40
 
41
 
42
 
43
#define	REG_OKAY	 0
44
#define	REG_NOMATCH	 1
45
#define	REG_BADPAT	 2
46
#define	REG_ECOLLATE	 3
47
#define	REG_ECTYPE	 4
48
#define	REG_EESCAPE	 5
49
#define	REG_ESUBREG	 6
50
#define	REG_EBRACK	 7
51
#define	REG_EPAREN	 8
52
#define	REG_EBRACE	 9
53
#define	REG_BADBR	10
54
#define	REG_ERANGE	11
55
#define	REG_ESPACE	12
56
#define	REG_BADRPT	13
57
#define	REG_EMPTY	14
58
#define	REG_ASSERT	15
59
#define	REG_INVARG	16
60
#define	REG_ATOI	255	/* convert name to number (!) */
61
#define	REG_ITOA	0400	/* convert number to name (!) */
62
extern size_t regerror(int, const regex_t *, char *, size_t);
63
 
64
 
65
 
66
extern int regexec(const regex_t *, const char *, size_t, regmatch_t [], int);
67
#define	REG_NOTBOL	00001
68
#define	REG_NOTEOL	00002
69
#define	REG_STARTEND	00004
70
#define	REG_TRACE	00400	/* tracing of execution */
71
#define	REG_LARGE	01000	/* force large representation */
72
#define	REG_BACKR	02000	/* force use of backref code */
73
 
74
 
75
 
76
extern void regfree(regex_t *);
77
 
78
#ifndef _POSIX_SOURCE
79
 
80
#endif /* !_POSIX_SOURCE */
81
#endif /* !__STRICT_ANSI__ */
82
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
83
 
84
#ifndef __dj_ENFORCE_FUNCTION_CALLS
85
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
86
 
87
#ifdef __cplusplus
88
}
89
#endif
90
 
91
#endif /* !__dj_include_regex_h_ */