regex.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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, see
  15. <http://www.gnu.org/licenses/>. */
  16. #include <features.h>
  17. #ifdef __UCLIBC__
  18. # define _REGEX_RE_COMP
  19. # define HAVE_LANGINFO
  20. # define HAVE_LANGINFO_CODESET
  21. # include <stdbool.h>
  22. # include <stdint.h>
  23. # include <string.h>
  24. # include <stdlib.h>
  25. # ifdef __UCLIBC_HAS_WCHAR__
  26. # define RE_ENABLE_I18N
  27. # define HAVE_WCHAR_H 1
  28. # define HAVE_WCRTOMB 1
  29. # define HAVE_MBRTOWC 1
  30. # define HAVE_WCSCOLL 1
  31. # include <wchar.h>
  32. # define HAVE_WCTYPE_H 1
  33. # include <wctype.h>
  34. # define __iswctype iswctype
  35. # define __wcrtomb wcrtomb
  36. # define __btowc btowc
  37. # define __wctype wctype
  38. # endif
  39. # include <ctype.h>
  40. # ifdef __UCLIBC_HAS_LOCALE__
  41. # define HAVE_LOCALE_H 1
  42. # endif
  43. #endif
  44. /* Make sure noone compiles this code with a C++ compiler. */
  45. #ifdef __cplusplus
  46. # error "This is C code, use a C compiler"
  47. #endif
  48. /* On some systems, limits.h sets RE_DUP_MAX to a lower value than
  49. GNU regex allows. Include it before <regex.h>, which correctly
  50. #undefs RE_DUP_MAX and sets it to the right value. */
  51. #include <limits.h>
  52. #include <regex.h>
  53. #include "regex_internal.h"
  54. #include "regex_internal.c"
  55. #include "regcomp.c"
  56. #include "regexec.c"