3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 /*
28 * Copyright 1989, 1994 by Mortice Kern Systems Inc.
29 * All rights reserved.
30 */
31 /*
32 * Copyright 2010 Nexenta Systems, Inc. All rights reserved.
33 * Use is subject to license terms.
34 */
35
36 #ifndef _REGEX_H
37 #define _REGEX_H
38
39 #include <sys/feature_tests.h>
40 #include <sys/types.h>
41
42 #ifdef __cplusplus
125 #define _REG_BACKREF_MAX 9 /* Max # of subexp. backreference */
126
127 typedef struct { /* regcomp() data saved for regexec() */
128 size_t re_nsub; /* # of subexpressions in RE pattern */
129
130 /*
131 * Internal use only. Note that any changes to this structure
132 * have to preserve sizing, as it is baked into applications.
133 */
134 struct re_guts *re_g;
135 int re_magic;
136 const char *re_endp;
137
138 /* here for compat */
139 size_t re_len; /* # wchar_t chars in compiled pattern */
140 struct _regex_ext_t *re_sc; /* for binary compatibility */
141 } regex_t;
142
143 /* subexpression positions */
144 typedef struct {
145 #ifdef __STDC__
146 const char *rm_sp, *rm_ep; /* Start pointer, end pointer */
147 #else
148 char *rm_sp, *rm_ep; /* Start pointer, end pointer */
149 #endif
150 regoff_t rm_so, rm_eo; /* Start offset, end offset */
151 int rm_ss, rm_es; /* Used internally */
152 } regmatch_t;
153
154
155 /*
156 * Additional API and structs to support regular expression manipulations
157 * on wide characters.
158 */
159
160 #if defined(__STDC__)
161
162 extern int regcomp(regex_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, int);
163 extern int regexec(const regex_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
164 size_t, regmatch_t *_RESTRICT_KYWD, int);
165 extern size_t regerror(int, const regex_t *_RESTRICT_KYWD,
166 char *_RESTRICT_KYWD, size_t);
167 extern void regfree(regex_t *);
168
169 #else /* defined(__STDC__) */
170
171 extern int regcomp();
172 extern int regexec();
173 extern size_t regerror();
174 extern void regfree();
175
176 #endif /* defined(__STDC__) */
177
178 #ifdef __cplusplus
179 }
180 #endif
181
182 #endif /* _REGEX_H */
|
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 *
25 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29 /*
30 * Copyright 1989, 1994 by Mortice Kern Systems Inc.
31 * All rights reserved.
32 */
33 /*
34 * Copyright 2010 Nexenta Systems, Inc. All rights reserved.
35 * Use is subject to license terms.
36 */
37
38 #ifndef _REGEX_H
39 #define _REGEX_H
40
41 #include <sys/feature_tests.h>
42 #include <sys/types.h>
43
44 #ifdef __cplusplus
127 #define _REG_BACKREF_MAX 9 /* Max # of subexp. backreference */
128
129 typedef struct { /* regcomp() data saved for regexec() */
130 size_t re_nsub; /* # of subexpressions in RE pattern */
131
132 /*
133 * Internal use only. Note that any changes to this structure
134 * have to preserve sizing, as it is baked into applications.
135 */
136 struct re_guts *re_g;
137 int re_magic;
138 const char *re_endp;
139
140 /* here for compat */
141 size_t re_len; /* # wchar_t chars in compiled pattern */
142 struct _regex_ext_t *re_sc; /* for binary compatibility */
143 } regex_t;
144
145 /* subexpression positions */
146 typedef struct {
147 const char *rm_sp, *rm_ep; /* Start pointer, end pointer */
148 regoff_t rm_so, rm_eo; /* Start offset, end offset */
149 int rm_ss, rm_es; /* Used internally */
150 } regmatch_t;
151
152
153 /*
154 * Additional API and structs to support regular expression manipulations
155 * on wide characters.
156 */
157
158 extern int regcomp(regex_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, int);
159 extern int regexec(const regex_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
160 size_t, regmatch_t *_RESTRICT_KYWD, int);
161 extern size_t regerror(int, const regex_t *_RESTRICT_KYWD,
162 char *_RESTRICT_KYWD, size_t);
163 extern void regfree(regex_t *);
164
165 #ifdef __cplusplus
166 }
167 #endif
168
169 #endif /* _REGEX_H */
|