regex.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. # define HAVE_WCHAR_H 1
  29. # define HAVE_WCRTOMB 1
  30. # define HAVE_MBRTOWC 1
  31. # define HAVE_WCSCOLL 1
  32. # include <wchar.h>
  33. # define HAVE_WCTYPE_H 1
  34. # include <wctype.h>
  35. # define __iswctype iswctype
  36. # define __wcrtomb wcrtomb
  37. # define __btowc btowc
  38. # define __wctype wctype
  39. # endif
  40. # include <ctype.h>
  41. # ifdef __UCLIBC_HAS_LOCALE__
  42. # define HAVE_LOCALE_H 1
  43. # endif
  44. #endif
  45. /* Make sure noone compiles this code with a C++ compiler. */
  46. #ifdef __cplusplus
  47. # error "This is C code, use a C compiler"
  48. #endif
  49. /* On some systems, limits.h sets RE_DUP_MAX to a lower value than
  50. GNU regex allows. Include it before <regex.h>, which correctly
  51. #undefs RE_DUP_MAX and sets it to the right value. */
  52. #include <limits.h>
  53. #include <regex.h>
  54. #include "regex_internal.h"
  55. #include "regex_internal.c"
  56. #include "regcomp.c"
  57. #include "regexec.c"