compiler/clib/include/regex.h: Bring include in sync with code that switched to NetBS...
[AROS.git] / compiler / clib / include / regex.h
blob51473acbf4e7223207f02870a6ad1c9f516adbde
1 /* $NetBSD: regex.h,v 1.13 2005/09/13 01:44:32 christos Exp $ */
3 /*-
4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved.
7 * This code is derived from software contributed to Berkeley by
8 * Henry Spencer of the University of Toronto.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. Neither the name of the University nor the names of its contributors
19 * may be used to endorse or promote products derived from this software
20 * without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
34 * @(#)regex.h 8.2 (Berkeley) 1/3/94
37 /*-
38 * Copyright (c) 1992 Henry Spencer.
40 * This code is derived from software contributed to Berkeley by
41 * Henry Spencer of the University of Toronto.
43 * Redistribution and use in source and binary forms, with or without
44 * modification, are permitted provided that the following conditions
45 * are met:
46 * 1. Redistributions of source code must retain the above copyright
47 * notice, this list of conditions and the following disclaimer.
48 * 2. Redistributions in binary form must reproduce the above copyright
49 * notice, this list of conditions and the following disclaimer in the
50 * documentation and/or other materials provided with the distribution.
51 * 3. All advertising materials mentioning features or use of this software
52 * must display the following acknowledgement:
53 * This product includes software developed by the University of
54 * California, Berkeley and its contributors.
55 * 4. Neither the name of the University nor the names of its contributors
56 * may be used to endorse or promote products derived from this software
57 * without specific prior written permission.
59 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
60 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
61 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
62 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
63 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
64 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
65 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
66 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
67 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
68 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
69 * SUCH DAMAGE.
71 * @(#)regex.h 8.2 (Berkeley) 1/3/94
74 #ifndef _REGEX_H_
75 #define _REGEX_H_
77 #include <aros/system.h>
79 #include <aros/types/regoff_t.h>
80 #include <aros/types/size_t.h>
82 typedef struct {
83 int re_magic;
84 size_t re_nsub; /* number of parenthesized subexpressions */
85 const char *re_endp; /* end pointer for REG_PEND */
86 struct re_guts *re_g; /* none of your business :-) */
87 } regex_t;
89 typedef struct {
90 regoff_t rm_so; /* start of match */
91 regoff_t rm_eo; /* end of match */
92 } regmatch_t;
94 /* regcomp() flags */
95 #define REG_BASIC 0000
96 #define REG_EXTENDED 0001
97 #define REG_ICASE 0002
98 #define REG_NOSUB 0004
99 #define REG_NEWLINE 0010
100 #define REG_NOSPEC 0020
101 #define REG_PEND 0040
102 #define REG_DUMP 0200
104 /* regerror() flags */
105 #define REG_NOMATCH 1
106 #define REG_BADPAT 2
107 #define REG_ECOLLATE 3
108 #define REG_ECTYPE 4
109 #define REG_EESCAPE 5
110 #define REG_ESUBREG 6
111 #define REG_EBRACK 7
112 #define REG_EPAREN 8
113 #define REG_EBRACE 9
114 #define REG_BADBR 10
115 #define REG_ERANGE 11
116 #define REG_ESPACE 12
117 #define REG_BADRPT 13
118 #define REG_EMPTY 14
119 #define REG_ASSERT 15
120 #define REG_INVARG 16
121 #define REG_ENOSYS 17
122 #define REG_ATOI 255 /* convert name to number (!) */
123 #define REG_ITOA 0400 /* convert number to name (!) */
125 /* regexec() flags */
126 #define REG_NOTBOL 00001
127 #define REG_NOTEOL 00002
128 #define REG_STARTEND 00004
129 #define REG_TRACE 00400 /* tracing of execution */
130 #define REG_LARGE 01000 /* force large representation */
131 #define REG_BACKR 02000 /* force use of backref code */
133 __BEGIN_DECLS
134 int regcomp(regex_t * restrict, const char * restrict, int);
135 size_t regerror(int, const regex_t * restrict, char * restrict, size_t);
136 int regexec(const regex_t * restrict,
137 const char * restrict, size_t, regmatch_t [], int);
138 void regfree(regex_t *);
139 __END_DECLS
141 #endif /* !_REGEX_H_ */