Back to index

glibc  2.9
regex.c
Go to the documentation of this file.
00001 /* Extended regular expression matching and search library.
00002    Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
00005 
00006    The GNU C Library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Lesser General Public
00008    License as published by the Free Software Foundation; either
00009    version 2.1 of the License, or (at your option) any later version.
00010 
00011    The GNU C Library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Lesser General Public License for more details.
00015 
00016    You should have received a copy of the GNU Lesser General Public
00017    License along with the GNU C Library; if not, write to the Free
00018    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019    02111-1307 USA.  */
00020 
00021 #ifdef HAVE_CONFIG_H
00022 #include "config.h"
00023 #endif
00024 
00025 /* Make sure noone compiles this code with a C++ compiler.  */
00026 #ifdef __cplusplus
00027 # error "This is C code, use a C compiler"
00028 #endif
00029 
00030 #ifdef _LIBC
00031 /* We have to keep the namespace clean.  */
00032 # define regfree(preg) __regfree (preg)
00033 # define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef)
00034 # define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags)
00035 # define regerror(errcode, preg, errbuf, errbuf_size) \
00036        __regerror(errcode, preg, errbuf, errbuf_size)
00037 # define re_set_registers(bu, re, nu, st, en) \
00038        __re_set_registers (bu, re, nu, st, en)
00039 # define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \
00040        __re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
00041 # define re_match(bufp, string, size, pos, regs) \
00042        __re_match (bufp, string, size, pos, regs)
00043 # define re_search(bufp, string, size, startpos, range, regs) \
00044        __re_search (bufp, string, size, startpos, range, regs)
00045 # define re_compile_pattern(pattern, length, bufp) \
00046        __re_compile_pattern (pattern, length, bufp)
00047 # define re_set_syntax(syntax) __re_set_syntax (syntax)
00048 # define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \
00049        __re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
00050 # define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
00051 
00052 # include "../locale/localeinfo.h"
00053 #endif
00054 
00055 /* On some systems, limits.h sets RE_DUP_MAX to a lower value than
00056    GNU regex allows.  Include it before <regex.h>, which correctly
00057    #undefs RE_DUP_MAX and sets it to the right value.  */
00058 #include <limits.h>
00059 
00060 #include <regex.h>
00061 #include "regex_internal.h"
00062 
00063 #include "regex_internal.c"
00064 #include "regcomp.c"
00065 #include "regexec.c"
00066 
00067 /* Binary backward compatibility.  */
00068 #if _LIBC
00069 # include <shlib-compat.h>
00070 # if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3)
00071 link_warning (re_max_failures, "the 're_max_failures' variable is obsolete and will go away.")
00072 int re_max_failures = 2000;
00073 # endif
00074 #endif