summaryrefslogtreecommitdiff
path: root/enc/euc_kr.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_kr.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_kr.c')
-rw-r--r--enc/euc_kr.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/enc/euc_kr.c b/enc/euc_kr.c
index a9acd5f..0b42f99 100644
--- a/enc/euc_kr.c
+++ b/enc/euc_kr.c
@@ -29,8 +29,6 @@
#include "regenc.h"
-OnigEncodingDeclare(EUC_KR);
-
static const int EncLen_EUCKR[] = {
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 @@ euckr_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc)
static OnigCodePoint
euckr_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
{
- return onigenc_mbn_mbc_to_code(&OnigEncodingName(EUC_KR), p, end);
+ return onigenc_mbn_mbc_to_code(enc, p, end);
}
static int
euckr_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
{
- return onigenc_mb2_code_to_mbc(&OnigEncodingName(EUC_KR), code, buf);
+ return onigenc_mb2_code_to_mbc(enc, code, buf);
}
static int
euckr_mbc_case_fold(OnigCaseFoldType flag, const UChar** pp, const UChar* end,
UChar* lower, OnigEncoding enc)
{
- return onigenc_mbn_mbc_case_fold(&OnigEncodingName(EUC_KR), flag,
+ return onigenc_mbn_mbc_case_fold(enc, flag,
pp, end, lower);
}
@@ -81,14 +79,14 @@ static int
euckr_is_mbc_ambiguous(OnigCaseFoldType flag,
const UChar** pp, const UChar* end, OnigEncoding enc)
{
- return onigenc_mbn_is_mbc_ambiguous(&OnigEncodingName(EUC_KR), flag, pp, end);
+ return onigenc_mbn_is_mbc_ambiguous(enc, flag, pp, end);
}
#endif
static int
euckr_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
{
- return onigenc_mb2_is_code_ctype(&OnigEncodingName(EUC_KR), code, ctype);
+ return onigenc_mb2_is_code_ctype(enc, code, ctype);
}
#define euckr_islead(c) ((c) < 0xa1 || (c) == 0xff)
@@ -106,7 +104,7 @@ euckr_left_adjust_char_head(const UChar* start, const UChar* s, OnigEncoding enc
p = s;
while (!euckr_islead(*p) && p > start) p--;
- len = enclen(&OnigEncodingName(EUC_KR), p, s);
+ len = enclen(enc, p, s);
if (p + len > s) return (UChar* )p;
p += len;
return (UChar* )(p + ((s - p) & ~1));