2 /* Extended regular expression matching and search library.
3 Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
5 Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
7 The GNU C Library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
12 The GNU C Library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public
18 License along with the GNU C Library; if not, write to the Free
19 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
29 # ifndef allocax /* predefined by HP cc +Olibcalls */
31 # define alloca(size) __builtin_alloca (size)
39 # if !defined __OS2__ && !defined WIN32
42 # include <malloc.h> /* OS/2 defines alloca in here */
51 /* We have to keep the namespace clean. */
52 # define regfree(preg) __regfree (preg)
53 # define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef)
54 # define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags)
55 # define regerror(errcode, preg, errbuf, errbuf_size) \
56 __regerror(errcode, preg, errbuf, errbuf_size)
57 # define re_set_registers(bu, re, nu, st, en) \
58 __re_set_registers (bu, re, nu, st, en)
59 # define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \
60 __re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
61 # define re_match(bufp, string, size, pos, regs) \
62 __re_match (bufp, string, size, pos, regs)
63 # define re_search(bufp, string, size, startpos, range, regs) \
64 __re_search (bufp, string, size, startpos, range, regs)
65 # define re_compile_pattern(pattern, length, bufp) \
66 __re_compile_pattern (pattern, length, bufp)
67 # define re_set_syntax(syntax) __re_set_syntax (syntax)
68 # define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \
69 __re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
70 # define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
72 # include "../locale/localeinfo.h"
75 /* POSIX says that <sys/types.h> must be included (by the caller) before
77 #include <sys/types.h>
79 /* On some systems, limits.h sets RE_DUP_MAX to a lower value than
80 GNU regex allows. Include it before <regex.h>, which correctly
81 #undefs RE_DUP_MAX and sets it to the right value. */
85 #include "regex_internal.h"
87 #include "regex_internal.c"
91 /* Binary backward compatibility. */
93 # include <shlib-compat.h>
94 # if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3)
95 link_warning (re_max_failures, "the 're_max_failures' variable is obsolete and will go away.")
96 int re_max_failures = 2000;