Back to index

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