summaryrefslogtreecommitdiff
path: root/enc/euc_tw.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-15 13:36:18 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-15 13:36:18 +0000
commitedc61cf4c19c089d210c7774994ee6d57bff65ad (patch)
treee7ed05f4840d0eb293ad4420c212debca496a2b0 /enc/euc_tw.c
parentd2a377d747c707bed4c2fb880fe4147807801e08 (diff)
* encoding.c (ENC_REGISTER): use &OnigEncoding*.
(ENCINDEX_UTF_8): renamed from ENCINDEX_UTF8. (rb_enc_init): use ENC_REGISTER. * include/ruby/oniguruma.h (OnigEncodingUTF8, ONIG_ENCODING_UTF8): removed. * enc/*.c: remove use of &encoding_*; use enc argument instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc/euc_tw.c')
-rw-r--r--enc/euc_tw.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/enc/euc_tw.c b/enc/euc_tw.c
index ef9d2f1..395f1e9 100644
--- a/enc/euc_tw.c
+++ b/enc/euc_tw.c
@@ -29,8 +29,6 @@
#include "regenc.h"
-OnigEncodingDeclare(EUC_TW);
-
static const int EncLen_EUCTW[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -59,20 +57,20 @@ euctw_mbc_enc_len(const UChar* p, const UChar* end, OnigEncoding enc)
static OnigCodePoint
euctw_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
{
- return onigenc_mbn_mbc_to_code(&OnigEncodingName(EUC_TW), p, end);
+ return onigenc_mbn_mbc_to_code(enc, p, end);
}
static int
euctw_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
{
- return onigenc_mb4_code_to_mbc(&OnigEncodingName(EUC_TW), code, buf);
+ return onigenc_mb4_code_to_mbc(enc, code, buf);
}
static int
euctw_mbc_case_fold(OnigCaseFoldType flag, const UChar** pp, const UChar* end,
UChar* lower, OnigEncoding enc)
{
- return onigenc_mbn_mbc_case_fold(&OnigEncodingName(EUC_TW), flag,
+ return onigenc_mbn_mbc_case_fold(enc, flag,
pp, end, lower);
}
@@ -81,14 +79,14 @@ static int
euctw_is_mbc_ambiguous(OnigCaseFoldType flag,
const UChar** pp, const UChar* end, OnigEncoding enc)
{
- return onigenc_mbn_is_mbc_ambiguous(&OnigEncodingName(EUC_TW), flag, pp, end);
+ return onigenc_mbn_is_mbc_ambiguous(enc, flag, pp, end);
}
#endif
static int
euctw_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
{
- return onigenc_mb4_is_code_ctype(&OnigEncodingName(EUC_TW), code, ctype);
+ return onigenc_mb4_is_code_ctype(enc, code, ctype);
}
#define euctw_islead(c) (((c) < 0xa1 && (c) != 0x8e) || (c) == 0xff)
@@ -106,7 +104,7 @@ euctw_left_adjust_char_head(const UChar* start, const UChar* s, OnigEncoding enc
p = s;
while (!euctw_islead(*p) && p > start) p--;
- len = enclen(&OnigEncodingName(EUC_TW), p, s);
+ len = enclen(enc, p, s);
if (p + len > s) return (UChar* )p;
p += len;
return (UChar* )(p + ((s - p) & ~1));