xref: /minix3/include/regexp.h (revision 2fe8fb192fe7e8720e3e7a77f928da545e872a6a)
1*2fe8fb19SBen Gras /*	$NetBSD: regexp.h,v 1.7 2005/02/03 04:39:32 perry Exp $	*/
29865aeaaSBen Gras 
3*2fe8fb19SBen Gras /*
4*2fe8fb19SBen Gras  * Copyright (c) 1989, 1993
5*2fe8fb19SBen Gras  *	The Regents of the University of California.  All rights reserved.
6*2fe8fb19SBen Gras  *
7*2fe8fb19SBen Gras  * This code is derived from software contributed to Berkeley
8*2fe8fb19SBen Gras  * by Henry Spencer.
9*2fe8fb19SBen Gras  *
10*2fe8fb19SBen Gras  * Redistribution and use in source and binary forms, with or without
11*2fe8fb19SBen Gras  * modification, are permitted provided that the following conditions
12*2fe8fb19SBen Gras  * are met:
13*2fe8fb19SBen Gras  * 1. Redistributions of source code must retain the above copyright
14*2fe8fb19SBen Gras  *    notice, this list of conditions and the following disclaimer.
15*2fe8fb19SBen Gras  * 2. Redistributions in binary form must reproduce the above copyright
16*2fe8fb19SBen Gras  *    notice, this list of conditions and the following disclaimer in the
17*2fe8fb19SBen Gras  *    documentation and/or other materials provided with the distribution.
18*2fe8fb19SBen Gras  * 3. Neither the name of the University nor the names of its contributors
19*2fe8fb19SBen Gras  *    may be used to endorse or promote products derived from this software
20*2fe8fb19SBen Gras  *    without specific prior written permission.
21*2fe8fb19SBen Gras  *
22*2fe8fb19SBen Gras  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23*2fe8fb19SBen Gras  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24*2fe8fb19SBen Gras  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25*2fe8fb19SBen Gras  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26*2fe8fb19SBen Gras  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27*2fe8fb19SBen Gras  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28*2fe8fb19SBen Gras  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29*2fe8fb19SBen Gras  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30*2fe8fb19SBen Gras  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31*2fe8fb19SBen Gras  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32*2fe8fb19SBen Gras  * SUCH DAMAGE.
33*2fe8fb19SBen Gras  *
34*2fe8fb19SBen Gras  *	@(#)regexp.h	8.1 (Berkeley) 6/2/93
35*2fe8fb19SBen Gras  */
369865aeaaSBen Gras 
37*2fe8fb19SBen Gras /*
38*2fe8fb19SBen Gras  * Copyright (c) 1986 by University of Toronto.
39*2fe8fb19SBen Gras  *
40*2fe8fb19SBen Gras  * This code is derived from software contributed to Berkeley
41*2fe8fb19SBen Gras  * by Henry Spencer.
42*2fe8fb19SBen Gras  *
43*2fe8fb19SBen Gras  * Redistribution and use in source and binary forms, with or without
44*2fe8fb19SBen Gras  * modification, are permitted provided that the following conditions
45*2fe8fb19SBen Gras  * are met:
46*2fe8fb19SBen Gras  * 1. Redistributions of source code must retain the above copyright
47*2fe8fb19SBen Gras  *    notice, this list of conditions and the following disclaimer.
48*2fe8fb19SBen Gras  * 2. Redistributions in binary form must reproduce the above copyright
49*2fe8fb19SBen Gras  *    notice, this list of conditions and the following disclaimer in the
50*2fe8fb19SBen Gras  *    documentation and/or other materials provided with the distribution.
51*2fe8fb19SBen Gras  * 3. All advertising materials mentioning features or use of this software
52*2fe8fb19SBen Gras  *    must display the following acknowledgement:
53*2fe8fb19SBen Gras  *	This product includes software developed by the University of
54*2fe8fb19SBen Gras  *	California, Berkeley and its contributors.
55*2fe8fb19SBen Gras  * 4. Neither the name of the University nor the names of its contributors
56*2fe8fb19SBen Gras  *    may be used to endorse or promote products derived from this software
57*2fe8fb19SBen Gras  *    without specific prior written permission.
58*2fe8fb19SBen Gras  *
59*2fe8fb19SBen Gras  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
60*2fe8fb19SBen Gras  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
61*2fe8fb19SBen Gras  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
62*2fe8fb19SBen Gras  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
63*2fe8fb19SBen Gras  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
64*2fe8fb19SBen Gras  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
65*2fe8fb19SBen Gras  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
66*2fe8fb19SBen Gras  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
67*2fe8fb19SBen Gras  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
68*2fe8fb19SBen Gras  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
69*2fe8fb19SBen Gras  * SUCH DAMAGE.
70*2fe8fb19SBen Gras  *
71*2fe8fb19SBen Gras  *	@(#)regexp.h	8.1 (Berkeley) 6/2/93
72*2fe8fb19SBen Gras  */
739865aeaaSBen Gras 
74*2fe8fb19SBen Gras #ifndef	_REGEXP_H_
75*2fe8fb19SBen Gras #define	_REGEXP_H_
76*2fe8fb19SBen Gras 
77*2fe8fb19SBen Gras /*
78*2fe8fb19SBen Gras  * Definitions etc. for regexp(3) routines.
79*2fe8fb19SBen Gras  *
80*2fe8fb19SBen Gras  * Caveat:  this is V8 regexp(3) [actually, a reimplementation thereof],
81*2fe8fb19SBen Gras  * not the System V one.
82*2fe8fb19SBen Gras  */
839865aeaaSBen Gras #define NSUBEXP  10
849865aeaaSBen Gras typedef struct regexp {
85*2fe8fb19SBen Gras 	char *startp[NSUBEXP];
86*2fe8fb19SBen Gras 	char *endp[NSUBEXP];
879865aeaaSBen Gras 	char regstart;		/* Internal use only. */
889865aeaaSBen Gras 	char reganch;		/* Internal use only. */
899865aeaaSBen Gras 	char *regmust;		/* Internal use only. */
909865aeaaSBen Gras 	int regmlen;		/* Internal use only. */
919865aeaaSBen Gras 	char program[1];	/* Unwarranted chumminess with compiler. */
929865aeaaSBen Gras } regexp;
939865aeaaSBen Gras 
94*2fe8fb19SBen Gras #include <sys/cdefs.h>
959865aeaaSBen Gras 
96*2fe8fb19SBen Gras __BEGIN_DECLS
97*2fe8fb19SBen Gras #ifdef __LIBCOMPAT_SOURCE__
98*2fe8fb19SBen Gras regexp *__compat_regcomp(const char *);
99*2fe8fb19SBen Gras int __compat_regexec(const  regexp *, const char *);
100*2fe8fb19SBen Gras void __compat_regsub(const  regexp *, const char *, char *);
101*2fe8fb19SBen Gras void __compat_regerror(const char *);
102*2fe8fb19SBen Gras #endif
103*2fe8fb19SBen Gras regexp *regcomp(const char *) __RENAME(__compat_regcomp);
104*2fe8fb19SBen Gras int regexec(const  regexp *, const char *) __RENAME(__compat_regexec);
105*2fe8fb19SBen Gras void regsub(const  regexp *, const char *, char *) __RENAME(__compat_regsub);
106*2fe8fb19SBen Gras void regerror(const char *) __RENAME(__compat_regerror);
107*2fe8fb19SBen Gras __END_DECLS
1089865aeaaSBen Gras 
109*2fe8fb19SBen Gras #endif /* !_REGEXP_H_ */
110