Sync usage with man page.
[netbsd-mini2440.git] / external / gpl2 / xcvs / dist / lib / regex.c
blob82e76c0911a976b5ecf94c0a6394d223c89227b0
1 /* Extended regular expression matching and search library.
2 Copyright (C) 2002, 2003 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation,
18 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
20 #ifdef HAVE_CONFIG_H
21 # include <config.h>
22 #endif
24 #ifdef _LIBC
25 /* We have to keep the namespace clean. */
26 # define regfree(preg) __regfree (preg)
27 # define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef)
28 # define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags)
29 # define regerror(errcode, preg, errbuf, errbuf_size) \
30 __regerror(errcode, preg, errbuf, errbuf_size)
31 # define re_set_registers(bu, re, nu, st, en) \
32 __re_set_registers (bu, re, nu, st, en)
33 # define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \
34 __re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
35 # define re_match(bufp, string, size, pos, regs) \
36 __re_match (bufp, string, size, pos, regs)
37 # define re_search(bufp, string, size, startpos, range, regs) \
38 __re_search (bufp, string, size, startpos, range, regs)
39 # define re_compile_pattern(pattern, length, bufp) \
40 __re_compile_pattern (pattern, length, bufp)
41 # define re_set_syntax(syntax) __re_set_syntax (syntax)
42 # define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \
43 __re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
44 # define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
46 # include "../locale/localeinfo.h"
47 #endif
49 /* On some systems, limits.h sets RE_DUP_MAX to a lower value than
50 GNU regex allows. Include it before <regex.h>, which correctly
51 #undefs RE_DUP_MAX and sets it to the right value. */
52 #include <limits.h>
54 #include <regex.h>
55 #include "regex_internal.h"
57 #include "regex_internal.c"
58 #include "regcomp.c"
59 #include "regexec.c"
61 /* Binary backward compatibility. */
62 #if _LIBC
63 # include <shlib-compat.h>
64 # if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3)
65 link_warning (re_max_failures, "the 're_max_failures' variable is obsolete and will go away.")
66 int re_max_failures = 2000;
67 # endif
68 #endif