1961 |
} \ |
} \ |
1962 |
} while (0) |
} while (0) |
1963 |
|
|
1964 |
#if WIDE_CHAR_SUPPORT |
#if ! WIDE_CHAR_SUPPORT |
|
/* The GNU C library provides support for user-defined character classes |
|
|
and the functions from ISO C amendement 1. */ |
|
|
# ifdef CHARCLASS_NAME_MAX |
|
|
# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX |
|
|
# else |
|
|
/* This shouldn't happen but some implementation might still have this |
|
|
problem. Use a reasonable default value. */ |
|
|
# define CHAR_CLASS_MAX_LENGTH 256 |
|
|
# endif |
|
|
typedef wctype_t re_wctype_t; |
|
|
typedef wchar_t re_wchar_t; |
|
|
# define re_wctype wctype |
|
|
# define re_iswctype iswctype |
|
|
# define re_wctype_to_bit(cc) 0 |
|
|
#else |
|
|
# define CHAR_CLASS_MAX_LENGTH 9 /* Namely, `multibyte'. */ |
|
|
# define btowc(c) c |
|
|
|
|
|
/* Character classes. */ |
|
|
typedef enum { RECC_ERROR = 0, |
|
|
RECC_ALNUM, RECC_ALPHA, RECC_WORD, |
|
|
RECC_GRAPH, RECC_PRINT, |
|
|
RECC_LOWER, RECC_UPPER, |
|
|
RECC_PUNCT, RECC_CNTRL, |
|
|
RECC_DIGIT, RECC_XDIGIT, |
|
|
RECC_BLANK, RECC_SPACE, |
|
|
RECC_MULTIBYTE, RECC_NONASCII, |
|
|
RECC_ASCII, RECC_UNIBYTE |
|
|
} re_wctype_t; |
|
|
|
|
|
typedef int re_wchar_t; |
|
1965 |
|
|
1966 |
/* Map a string to the char class it names (if any). */ |
/* Map a string to the char class it names (if any). */ |
1967 |
static re_wctype_t |
re_wctype_t |
1968 |
re_wctype (str) |
re_wctype (str) |
1969 |
re_char *str; |
re_char *str; |
1970 |
{ |
{ |
1990 |
} |
} |
1991 |
|
|
1992 |
/* True iff CH is in the char class CC. */ |
/* True iff CH is in the char class CC. */ |
1993 |
static boolean |
boolean |
1994 |
re_iswctype (ch, cc) |
re_iswctype (ch, cc) |
1995 |
int ch; |
int ch; |
1996 |
re_wctype_t cc; |
re_wctype_t cc; |