PageRenderTime 47ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/amanda/tags/3_1_0_mac01/gnulib/regex.c

#
C | 71 lines | 39 code | 8 blank | 24 comment | 2 complexity | 93b79faf47652f5ae4df63b8acc92656 MD5 | raw file
  1. /* Extended regular expression matching and search library.
  2. Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2, or (at your option)
  8. any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License along
  14. with this program; if not, write to the Free Software Foundation,
  15. Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
  16. #include <config.h>
  17. /* Make sure noone compiles this code with a C++ compiler. */
  18. #if defined __cplusplus && defined _LIBC
  19. # error "This is C code, use a C compiler"
  20. #endif
  21. #ifdef _LIBC
  22. /* We have to keep the namespace clean. */
  23. # define regfree(preg) __regfree (preg)
  24. # define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef)
  25. # define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags)
  26. # define regerror(errcode, preg, errbuf, errbuf_size) \
  27. __regerror(errcode, preg, errbuf, errbuf_size)
  28. # define re_set_registers(bu, re, nu, st, en) \
  29. __re_set_registers (bu, re, nu, st, en)
  30. # define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \
  31. __re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
  32. # define re_match(bufp, string, size, pos, regs) \
  33. __re_match (bufp, string, size, pos, regs)
  34. # define re_search(bufp, string, size, startpos, range, regs) \
  35. __re_search (bufp, string, size, startpos, range, regs)
  36. # define re_compile_pattern(pattern, length, bufp) \
  37. __re_compile_pattern (pattern, length, bufp)
  38. # define re_set_syntax(syntax) __re_set_syntax (syntax)
  39. # define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \
  40. __re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
  41. # define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
  42. # include "../locale/localeinfo.h"
  43. #endif
  44. /* On some systems, limits.h sets RE_DUP_MAX to a lower value than
  45. GNU regex allows. Include it before <regex.h>, which correctly
  46. #undefs RE_DUP_MAX and sets it to the right value. */
  47. #include <limits.h>
  48. #include <regex.h>
  49. #include "regex_internal.h"
  50. #include "regex_internal.c"
  51. #include "regcomp.c"
  52. #include "regexec.c"
  53. /* Binary backward compatibility. */
  54. #if _LIBC
  55. # include <shlib-compat.h>
  56. # if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3)
  57. link_warning (re_max_failures, "the 're_max_failures' variable is obsolete and will go away.")
  58. int re_max_failures = 2000;
  59. # endif
  60. #endif