Blame lib/regex.c

Packit 709fb3
/* Extended regular expression matching and search library.
Packit 709fb3
   Copyright (C) 2002-2017 Free Software Foundation, Inc.
Packit 709fb3
   This file is part of the GNU C Library.
Packit 709fb3
   Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
Packit 709fb3
Packit 709fb3
   The GNU C Library is free software; you can redistribute it and/or
Packit 709fb3
   modify it under the terms of the GNU General Public
Packit 709fb3
   License as published by the Free Software Foundation; either
Packit 709fb3
   version 3 of the License, or (at your option) any later version.
Packit 709fb3
Packit 709fb3
   The GNU C Library is distributed in the hope that it will be useful,
Packit 709fb3
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 709fb3
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 709fb3
   General Public License for more details.
Packit 709fb3
Packit 709fb3
   You should have received a copy of the GNU General Public
Packit 709fb3
   License along with the GNU C Library; if not, see
Packit 709fb3
   <http://www.gnu.org/licenses/>.  */
Packit 709fb3
Packit 709fb3
#ifndef _LIBC
Packit 709fb3
# include <config.h>
Packit 709fb3
Packit 709fb3
# if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__
Packit 709fb3
#  pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
Packit 709fb3
# endif
Packit 709fb3
# if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__
Packit 709fb3
#  pragma GCC diagnostic ignored "-Wold-style-definition"
Packit 709fb3
#  pragma GCC diagnostic ignored "-Wtype-limits"
Packit 709fb3
# endif
Packit 709fb3
#endif
Packit 709fb3
Packit 709fb3
/* Make sure no one compiles this code with a C++ compiler.  */
Packit 709fb3
#if defined __cplusplus && defined _LIBC
Packit 709fb3
# error "This is C code, use a C compiler"
Packit 709fb3
#endif
Packit 709fb3
Packit 709fb3
#ifdef _LIBC
Packit 709fb3
/* We have to keep the namespace clean.  */
Packit 709fb3
# define regfree(preg) __regfree (preg)
Packit 709fb3
# define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef)
Packit 709fb3
# define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags)
Packit 709fb3
# define regerror(errcode, preg, errbuf, errbuf_size) \
Packit 709fb3
	__regerror(errcode, preg, errbuf, errbuf_size)
Packit 709fb3
# define re_set_registers(bu, re, nu, st, en) \
Packit 709fb3
	__re_set_registers (bu, re, nu, st, en)
Packit 709fb3
# define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \
Packit 709fb3
	__re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
Packit 709fb3
# define re_match(bufp, string, size, pos, regs) \
Packit 709fb3
	__re_match (bufp, string, size, pos, regs)
Packit 709fb3
# define re_search(bufp, string, size, startpos, range, regs) \
Packit 709fb3
	__re_search (bufp, string, size, startpos, range, regs)
Packit 709fb3
# define re_compile_pattern(pattern, length, bufp) \
Packit 709fb3
	__re_compile_pattern (pattern, length, bufp)
Packit 709fb3
# define re_set_syntax(syntax) __re_set_syntax (syntax)
Packit 709fb3
# define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \
Packit 709fb3
	__re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
Packit 709fb3
# define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
Packit 709fb3
Packit 709fb3
# include "../locale/localeinfo.h"
Packit 709fb3
#endif
Packit 709fb3
Packit 709fb3
/* On some systems, limits.h sets RE_DUP_MAX to a lower value than
Packit 709fb3
   GNU regex allows.  Include it before <regex.h>, which correctly
Packit 709fb3
   #undefs RE_DUP_MAX and sets it to the right value.  */
Packit 709fb3
#include <limits.h>
Packit 709fb3
Packit 709fb3
#include <regex.h>
Packit 709fb3
#include "regex_internal.h"
Packit 709fb3
Packit 709fb3
#include "regex_internal.c"
Packit 709fb3
#include "regcomp.c"
Packit 709fb3
#include "regexec.c"
Packit 709fb3
Packit 709fb3
/* Binary backward compatibility.  */
Packit 709fb3
#if _LIBC
Packit 709fb3
# include <shlib-compat.h>
Packit 709fb3
# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3)
Packit 709fb3
link_warning (re_max_failures, "the 're_max_failures' variable is obsolete and will go away.")
Packit 709fb3
int re_max_failures = 2000;
Packit 709fb3
# endif
Packit 709fb3
#endif