2002-02-28 14:40:08 +08:00
|
|
|
/* Extended regular expression matching and search library.
|
2003-02-21 09:52:32 +08:00
|
|
|
Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
2001-07-06 12:58:11 +08:00
|
|
|
This file is part of the GNU C Library.
|
2002-02-28 14:40:08 +08:00
|
|
|
Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
|
1995-05-18 17:00:09 +08:00
|
|
|
|
1997-02-15 12:31:36 +08:00
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
2001-07-06 12:58:11 +08:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
1995-05-18 17:00:09 +08:00
|
|
|
|
1997-02-15 12:31:36 +08:00
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2001-07-06 12:58:11 +08:00
|
|
|
Lesser General Public License for more details.
|
1995-05-18 17:00:09 +08:00
|
|
|
|
2001-07-06 12:58:11 +08:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with the GNU C Library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
|
|
|
02111-1307 USA. */
|
1995-05-18 17:00:09 +08:00
|
|
|
|
2002-02-28 14:40:08 +08:00
|
|
|
#ifdef _LIBC
|
1998-04-09 04:27:31 +08:00
|
|
|
/* We have to keep the namespace clean. */
|
2001-06-19 08:43:55 +08:00
|
|
|
# define regfree(preg) __regfree (preg)
|
|
|
|
# define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef)
|
|
|
|
# define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags)
|
|
|
|
# define regerror(errcode, preg, errbuf, errbuf_size) \
|
1998-04-09 04:27:31 +08:00
|
|
|
__regerror(errcode, preg, errbuf, errbuf_size)
|
2001-06-19 08:43:55 +08:00
|
|
|
# define re_set_registers(bu, re, nu, st, en) \
|
1998-04-09 04:27:31 +08:00
|
|
|
__re_set_registers (bu, re, nu, st, en)
|
2001-06-19 08:43:55 +08:00
|
|
|
# define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \
|
1998-04-09 04:27:31 +08:00
|
|
|
__re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
|
2001-06-19 08:43:55 +08:00
|
|
|
# define re_match(bufp, string, size, pos, regs) \
|
1998-04-09 04:27:31 +08:00
|
|
|
__re_match (bufp, string, size, pos, regs)
|
2001-06-19 08:43:55 +08:00
|
|
|
# define re_search(bufp, string, size, startpos, range, regs) \
|
1998-04-09 04:27:31 +08:00
|
|
|
__re_search (bufp, string, size, startpos, range, regs)
|
2001-06-19 08:43:55 +08:00
|
|
|
# define re_compile_pattern(pattern, length, bufp) \
|
1998-04-09 04:27:31 +08:00
|
|
|
__re_compile_pattern (pattern, length, bufp)
|
2001-06-19 08:43:55 +08:00
|
|
|
# define re_set_syntax(syntax) __re_set_syntax (syntax)
|
|
|
|
# define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \
|
1998-04-09 04:27:31 +08:00
|
|
|
__re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
|
2001-06-19 08:43:55 +08:00
|
|
|
# define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
|
|
|
|
#endif
|
|
|
|
|
2003-02-21 09:52:32 +08:00
|
|
|
/* POSIX says that <sys/types.h> must be included (by the caller) before
|
|
|
|
<regex.h>. */
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <regex.h>
|
|
|
|
#include "regex_internal.h"
|
2002-03-12 10:04:08 +08:00
|
|
|
|
2003-02-21 09:52:32 +08:00
|
|
|
#include "regex_internal.c"
|
2002-02-28 14:40:08 +08:00
|
|
|
#include "regcomp.c"
|
|
|
|
#include "regexec.c"
|
2002-04-25 06:02:03 +08:00
|
|
|
|
|
|
|
/* Binary backward compatibility. */
|
|
|
|
#if _LIBC
|
|
|
|
# include <shlib-compat.h>
|
|
|
|
# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3)
|
|
|
|
link_warning (re_max_failures, "the 're_max_failures' variable is obsolete and will go away.")
|
|
|
|
int re_max_failures = 2000;
|
|
|
|
# endif
|
|
|
|
#endif
|