Blame support/regex.c

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