regex.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. # ifdef __UCLIBC_HAS_CTYPE_TABLES__
  37. # define __toupper toupper
  38. # define __tolower tolower
  39. # endif
  40. #endif
  41. /* Make sure noone compiles this code with a C++ compiler. */
  42. #ifdef __cplusplus
  43. # error "This is C code, use a C compiler"
  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"