diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-03-09 07:57:00 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-03-09 07:57:00 +0000 |
commit | 2b6ab941234426b8891f1bad036fd75611038312 (patch) | |
tree | 22ae6172fcc75cb8073529cb7f2719b11f0cf036 /regex.h | |
parent | 6a3fdf70f18a7b67808f23ddbd28e9631f7f905a (diff) |
1.1b9_00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regex.h')
-rw-r--r-- | regex.h | 44 |
1 files changed, 9 insertions, 35 deletions
@@ -165,43 +165,17 @@ extern long re_syntax_options; | RE_NO_HYPHEN_RANGE_END) /* For multi-byte char support */ -#define RE_MBCTYPE_EUC (1L << 20) -#define RE_MBCTYPE_SJIS (1L << 21) -#define RE_MBCTYPE_MASK (RE_MBCTYPE_EUC | RE_MBCTYPE_SJIS) - -#ifdef EUC -#define DEFAULT_MBCTYPE RE_MBCTYPE_EUC -#else -#ifdef SJIS -#define DEFAULT_MBCTYPE RE_MBCTYPE_SJIS -#else -#define DEFAULT_MBCTYPE 0 -#endif -#endif +#define MBCTYPE_ASCII 0 +#define MBCTYPE_EUC 1 +#define MBCTYPE_SJIS 2 + +extern const unsigned char *mbctab; +extern int current_mbctype; + +void mbcinit (int); #undef ismbchar -#define ismbchar(c) \ - (re_syntax_options & RE_MBCTYPE_EUC \ - ? ( 0xa1 <= (unsigned char) (c) \ - && (unsigned char) (c) <= 0xfe) \ - : (re_syntax_options & RE_MBCTYPE_SJIS \ - ? (( 0x81 <= (unsigned char) (c) \ - && (unsigned char) (c) <= 0x9f) \ - || ((0xe0 <= (unsigned char) (c)) \ - && (unsigned char) (c) <= 0xef)) \ - : 0)) - -#undef ismbchar2 -#define ismbchar2(c) \ - (re_syntax_options & RE_MBCTYPE_EUC \ - ? ( 0xa1 <= (unsigned char) (c) \ - && (unsigned char) (c) <= 0xfe) \ - : (re_syntax_options & RE_MBCTYPE_SJIS \ - ? (( 0x40 <= (unsigned char) (c) \ - && (unsigned char) (c) <= 0x7e) \ - || ((0x80 <= (unsigned char) (c)) \ - && (unsigned char) (c) <= 0xfc)) \ - : 0)) +#define ismbchar(c) mbctab[(unsigned char)(c)] /* This data structure is used to represent a compiled pattern. */ |