From 2b6ab941234426b8891f1bad036fd75611038312 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 9 Mar 1998 07:57:00 +0000 Subject: 1.1b9_00 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- regex.h | 44 +++++++++----------------------------------- 1 file changed, 9 insertions(+), 35 deletions(-) (limited to 'regex.h') diff --git a/regex.h b/regex.h index bf35589085..1bca032024 100644 --- a/regex.h +++ b/regex.h @@ -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. */ -- cgit v1.2.3