1146040Stjr/* Extended regular expression matching and search library. 2250724Sjkim Copyright (C) 2002-2012 Free Software Foundation, Inc. 3146040Stjr This file is part of the GNU C Library. 4146040Stjr Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>. 5218Sconklin 6126209Sache The GNU C Library is free software; you can redistribute it and/or 7146040Stjr modify it under the terms of the GNU Lesser General Public 8146040Stjr License as published by the Free Software Foundation; either 9146040Stjr version 2.1 of the License, or (at your option) any later version. 10218Sconklin 11126209Sache The GNU C Library is distributed in the hope that it will be useful, 12218Sconklin but WITHOUT ANY WARRANTY; without even the implied warranty of 13126209Sache MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14146040Stjr Lesser General Public License for more details. 15218Sconklin 16146040Stjr You should have received a copy of the GNU Lesser General Public 17250724Sjkim License along with the GNU C Library; if not, see 18250724Sjkim <http://www.gnu.org/licenses/>. */ 19218Sconklin 20218Sconklin#ifdef HAVE_CONFIG_H 21146040Stjr#include "config.h" 22218Sconklin#endif 23218Sconklin 24250724Sjkim/* Make sure noone compiles this code with a C++ compiler. */ 25250724Sjkim#ifdef __cplusplus 26250724Sjkim# error "This is C code, use a C compiler" 27218Sconklin#endif 28218Sconklin 29126209Sache#ifdef _LIBC 30126209Sache/* We have to keep the namespace clean. */ 31126209Sache# define regfree(preg) __regfree (preg) 32126209Sache# define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef) 33126209Sache# define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags) 34126209Sache# define regerror(errcode, preg, errbuf, errbuf_size) \ 35126209Sache __regerror(errcode, preg, errbuf, errbuf_size) 36126209Sache# define re_set_registers(bu, re, nu, st, en) \ 37126209Sache __re_set_registers (bu, re, nu, st, en) 38126209Sache# define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \ 39126209Sache __re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) 40126209Sache# define re_match(bufp, string, size, pos, regs) \ 41126209Sache __re_match (bufp, string, size, pos, regs) 42126209Sache# define re_search(bufp, string, size, startpos, range, regs) \ 43126209Sache __re_search (bufp, string, size, startpos, range, regs) 44126209Sache# define re_compile_pattern(pattern, length, bufp) \ 45126209Sache __re_compile_pattern (pattern, length, bufp) 46126209Sache# define re_set_syntax(syntax) __re_set_syntax (syntax) 47126209Sache# define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \ 48126209Sache __re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop) 49126209Sache# define re_compile_fastmap(bufp) __re_compile_fastmap (bufp) 50218Sconklin 51146040Stjr# include "../locale/localeinfo.h" 52218Sconklin#endif 53218Sconklin 54146040Stjr/* On some systems, limits.h sets RE_DUP_MAX to a lower value than 55146040Stjr GNU regex allows. Include it before <regex.h>, which correctly 56146040Stjr #undefs RE_DUP_MAX and sets it to the right value. */ 57146040Stjr#include <limits.h> 58131543Stjr 59250724Sjkim/* This header defines the MIN and MAX macros. */ 60250724Sjkim#include <sys/param.h> 61250724Sjkim 62126209Sache#include <regex.h> 63146040Stjr#include "regex_internal.h" 64218Sconklin 65146040Stjr#include "regex_internal.c" 66146040Stjr#include "regcomp.c" 67146040Stjr#include "regexec.c" 68218Sconklin 69146040Stjr/* Binary backward compatibility. */ 70146040Stjr#if _LIBC 71146040Stjr# include <shlib-compat.h> 72146040Stjr# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3) 73146040Stjrlink_warning (re_max_failures, "the 're_max_failures' variable is obsolete and will go away.") 74126209Sacheint re_max_failures = 2000; 75126209Sache# endif 76126209Sache#endif 77