1 /* Extended regular expression matching and search library.
2 Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library 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 GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, write to the Free
18 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
30 #define _REGEX_RE_COMP
35 #define HAVE_LANGINFO_CODESET
40 #ifdef __UCLIBC_HAS_WCHAR__
41 #define RE_ENABLE_I18N
45 #define __iswctype iswctype
46 #define __wcrtomb wcrtomb
48 #define __wctype wctype
49 libc_hidden_proto(wcscoll)
50 libc_hidden_proto(wcrtomb)
51 libc_hidden_proto(mbrtowc)
52 libc_hidden_proto(iswctype)
53 libc_hidden_proto(iswlower)
54 libc_hidden_proto(iswalnum)
55 libc_hidden_proto(towlower)
56 libc_hidden_proto(towupper)
57 libc_hidden_proto(mbsinit)
58 libc_hidden_proto(btowc)
59 libc_hidden_proto(wctype)
64 #ifdef __UCLIBC_HAS_CTYPE_TABLES__
65 #define __toupper toupper
66 #define __tolower tolower
68 #define __mempcpy mempcpy
69 #ifdef __UCLIBC_HAS_XLOCALE__
70 libc_hidden_proto(__ctype_b_loc)
71 libc_hidden_proto(__ctype_toupper_loc)
72 #elif defined __UCLIBC_HAS_CTYPE_TABLES__
73 libc_hidden_proto(__ctype_b)
74 libc_hidden_proto(__ctype_toupper)
76 libc_hidden_proto(isascii)
78 libc_hidden_proto(toupper)
79 libc_hidden_proto(tolower)
80 /* Experimentally off - libc_hidden_proto(memcmp) */
81 /* Experimentally off - libc_hidden_proto(memcpy) */
82 /* Experimentally off - libc_hidden_proto(memmove) */
83 /* Experimentally off - libc_hidden_proto(memset) */
84 /* Experimentally off - libc_hidden_proto(strchr) */
85 /* Experimentally off - libc_hidden_proto(strcmp) */
86 /* Experimentally off - libc_hidden_proto(strlen) */
87 /* Experimentally off - libc_hidden_proto(strncpy) */
88 libc_hidden_proto(getenv)
89 /* Experimentally off - libc_hidden_proto(strcasecmp) */
90 libc_hidden_proto(abort)
92 /* Experimentally off - libc_hidden_proto(mempcpy) */
97 /* Make sure noone compiles this code with a C++ compiler. */
99 # error "This is C code, use a C compiler"
102 #if defined _LIBC || defined __UCLIBC__
103 /* We have to keep the namespace clean. */
104 # define regfree(preg) __regfree (preg)
105 # define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef)
106 # define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags)
107 # define regerror(errcode, preg, errbuf, errbuf_size) \
108 __regerror(errcode, preg, errbuf, errbuf_size)
109 # define re_set_registers(bu, re, nu, st, en) \
110 __re_set_registers (bu, re, nu, st, en)
111 # define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \
112 __re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
113 # define re_match(bufp, string, size, pos, regs) \
114 __re_match (bufp, string, size, pos, regs)
115 # define re_search(bufp, string, size, startpos, range, regs) \
116 __re_search (bufp, string, size, startpos, range, regs)
117 # define re_compile_pattern(pattern, length, bufp) \
118 __re_compile_pattern (pattern, length, bufp)
119 # define re_set_syntax(syntax) __re_set_syntax (syntax)
120 # define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \
121 __re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
122 # define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
125 # include "../locale/localeinfo.h"
129 /* On some systems, limits.h sets RE_DUP_MAX to a lower value than
130 GNU regex allows. Include it before <regex.h>, which correctly
131 #undefs RE_DUP_MAX and sets it to the right value. */
139 #include "regex_internal.h"
141 #include "regex_internal.c"
145 /* Binary backward compatibility. */
147 # include <shlib-compat.h>
148 # if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3)
149 link_warning (re_max_failures, "the 're_max_failures' variable is obsolete and will go away.")
150 int re_max_failures = 2000;