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