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

/CS/branches/feature/newparticles/libs/csutil/generic/regex.c

#
C | 63 lines | 35 code | 5 blank | 23 comment | 1 complexity | f6fac9f71e5fb6ff74d85c72b37caa97 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. /* POSIX says that <sys/types.h> must be included (by the caller) before
  40. <regex.h>. */
  41. #include <stdlib.h>
  42. #include <sys/types.h>
  43. #include "../regex_wrapper.h"
  44. #include "regex_internal.h"
  45. #include "regex_internal.c"
  46. #include "regcomp.c"
  47. #include "regexec.c"
  48. /* Binary backward compatibility. */
  49. #if _LIBC
  50. # include <shlib-compat.h>
  51. # if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3)
  52. link_warning (re_max_failures, "the 're_max_failures' variable is obsolete and will go away.")
  53. int re_max_failures = 2000;
  54. # endif
  55. #endif