diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/regex.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/regex.h b/src/regex.h index 1818d5f9681..f969c9c5e74 100644 --- a/src/regex.h +++ b/src/regex.h | |||
| @@ -562,6 +562,49 @@ extern void regfree _RE_ARGS ((regex_t *__preg)); | |||
| 562 | } | 562 | } |
| 563 | #endif /* C++ */ | 563 | #endif /* C++ */ |
| 564 | 564 | ||
| 565 | /* For platform which support the ISO C amendement 1 functionality we | ||
| 566 | support user defined character classes. */ | ||
| 567 | #if WIDE_CHAR_SUPPORT | ||
| 568 | /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */ | ||
| 569 | # include <wchar.h> | ||
| 570 | # include <wctype.h> | ||
| 571 | #endif | ||
| 572 | |||
| 573 | #if WIDE_CHAR_SUPPORT | ||
| 574 | /* The GNU C library provides support for user-defined character classes | ||
| 575 | and the functions from ISO C amendement 1. */ | ||
| 576 | # ifdef CHARCLASS_NAME_MAX | ||
| 577 | # define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX | ||
| 578 | # else | ||
| 579 | /* This shouldn't happen but some implementation might still have this | ||
| 580 | problem. Use a reasonable default value. */ | ||
| 581 | # define CHAR_CLASS_MAX_LENGTH 256 | ||
| 582 | # endif | ||
| 583 | typedef wctype_t re_wctype_t; | ||
| 584 | typedef wchar_t re_wchar_t; | ||
| 585 | # define re_wctype wctype | ||
| 586 | # define re_iswctype iswctype | ||
| 587 | # define re_wctype_to_bit(cc) 0 | ||
| 588 | #else | ||
| 589 | # define CHAR_CLASS_MAX_LENGTH 9 /* Namely, `multibyte'. */ | ||
| 590 | # define btowc(c) c | ||
| 591 | |||
| 592 | /* Character classes. */ | ||
| 593 | typedef enum { RECC_ERROR = 0, | ||
| 594 | RECC_ALNUM, RECC_ALPHA, RECC_WORD, | ||
| 595 | RECC_GRAPH, RECC_PRINT, | ||
| 596 | RECC_LOWER, RECC_UPPER, | ||
| 597 | RECC_PUNCT, RECC_CNTRL, | ||
| 598 | RECC_DIGIT, RECC_XDIGIT, | ||
| 599 | RECC_BLANK, RECC_SPACE, | ||
| 600 | RECC_MULTIBYTE, RECC_NONASCII, | ||
| 601 | RECC_ASCII, RECC_UNIBYTE | ||
| 602 | } re_wctype_t; | ||
| 603 | |||
| 604 | typedef int re_wchar_t; | ||
| 605 | |||
| 606 | #endif /* not WIDE_CHAR_SUPPORT */ | ||
| 607 | |||
| 565 | #endif /* regex.h */ | 608 | #endif /* regex.h */ |
| 566 | 609 | ||
| 567 | /* | 610 | /* |