PageRenderTime 44ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

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

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