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, 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. /* TODO: having _LIBC *off* is very confusing - the rest of uclibc
  20. * has it *on*. Fix it. */
  21. # undef _LIBC
  22. # define _REGEX_RE_COMP
  23. # define HAVE_LANGINFO
  24. # define HAVE_LANGINFO_CODESET
  25. # include <stdbool.h>
  26. # include <stdint.h>
  27. # include <string.h>
  28. # include <stdlib.h>
  29. # ifdef __UCLIBC_HAS_WCHAR__
  30. # define RE_ENABLE_I18N
  31. # include <wchar.h>
  32. # include <wctype.h>
  33. # define __iswctype iswctype
  34. # define __wcrtomb wcrtomb
  35. # define __btowc btowc
  36. # define __wctype wctype
  37. # endif
  38. # include <ctype.h>
  39. # ifdef __UCLIBC_HAS_CTYPE_TABLES__
  40. # define __toupper toupper
  41. # define __tolower tolower
  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"