PageRenderTime 50ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/CS/tags/V1.4.0rc1/libs/csutil/generic/regex.c

#
C | 67 lines | 38 code | 6 blank | 23 comment | 3 complexity | 7478a0dd4838c3b00e7d9064eac5bbcc MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, LGPL-2.0
  1. /* Extended regular expression matching and search library.
  2. Copyright (C) 2002, 2003 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
  5. The GNU C Library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public
  7. License as published by the Free Software Foundation; either
  8. version 2.1 of the License, or (at your option) any later version.
  9. The GNU C Library 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 GNU
  12. Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public
  14. License along with the GNU C Library; if not, write to the Free
  15. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  16. 02111-1307 USA. */
  17. #ifdef _LIBC
  18. /* We have to keep the namespace clean. */
  19. # define regfree(preg) __regfree (preg)
  20. # define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef)
  21. # define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags)
  22. # define regerror(errcode, preg, errbuf, errbuf_size) \
  23. __regerror(errcode, preg, errbuf, errbuf_size)
  24. # define re_set_registers(bu, re, nu, st, en) \
  25. __re_set_registers (bu, re, nu, st, en)
  26. # define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \
  27. __re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
  28. # define re_match(bufp, string, size, pos, regs) \
  29. __re_match (bufp, string, size, pos, regs)
  30. # define re_search(bufp, string, size, startpos, range, regs) \
  31. __re_search (bufp, string, size, startpos, range, regs)
  32. # define re_compile_pattern(pattern, length, bufp) \
  33. __re_compile_pattern (pattern, length, bufp)
  34. # define re_set_syntax(syntax) __re_set_syntax (syntax)
  35. # define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \
  36. __re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
  37. # define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
  38. #endif
  39. #if !defined(__STDC__) && (defined(_MSC_VER) || defined(__BORLANDC__))
  40. #define __STDC__ 1
  41. #endif
  42. /* POSIX says that <sys/types.h> must be included (by the caller) before
  43. <regex.h>. */
  44. #include <stdlib.h>
  45. #include <sys/types.h>
  46. #include "csutil/generic/regex.h"
  47. #include "regex_internal.h"
  48. #include "regex_internal.c"
  49. #include "regcomp.c"
  50. #include "regexec.c"
  51. /* Binary backward compatibility. */
  52. #if _LIBC
  53. # include <shlib-compat.h>
  54. # if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3)
  55. link_warning (re_max_failures, "the 're_max_failures' variable is obsolete and will go away.")
  56. int re_max_failures = 2000;
  57. # endif
  58. #endif