regex.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* Extended regular expression matching and search library.
  2. Copyright (C) 2002, 2003, 2005 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. #include <features.h>
  18. #ifdef __UCLIBC__
  19. # define _REGEX_RE_COMP
  20. # define HAVE_LANGINFO
  21. # define HAVE_LANGINFO_CODESET
  22. # include <stdbool.h>
  23. # include <stdint.h>
  24. # include <string.h>
  25. # include <stdlib.h>
  26. # ifdef __UCLIBC_HAS_WCHAR__
  27. # define RE_ENABLE_I18N
  28. # include <wchar.h>
  29. # include <wctype.h>
  30. # define __iswctype iswctype
  31. # define __wcrtomb wcrtomb
  32. # define __btowc btowc
  33. # define __wctype wctype
  34. # endif
  35. # include <ctype.h>
  36. #endif
  37. /* Make sure noone compiles this code with a C++ compiler. */
  38. #ifdef __cplusplus
  39. # error "This is C code, use a C compiler"
  40. #endif
  41. /* On some systems, limits.h sets RE_DUP_MAX to a lower value than
  42. GNU regex allows. Include it before <regex.h>, which correctly
  43. #undefs RE_DUP_MAX and sets it to the right value. */
  44. #include <limits.h>
  45. #include <regex.h>
  46. #include "regex_internal.h"
  47. #include "regex_internal.c"
  48. #include "regcomp.c"
  49. #include "regexec.c"