diff --git a/ChangeLog b/ChangeLog index d3608c06ac..333777ed4a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Jan 8 15:47:43 2008 NAKAMURA Usaku + + * enc/utf{16,32}_{be,le}.c: use &OnigEncodingName(*) instead of + ONIG_ENCODING_*. + Tue Jan 8 15:40:31 2008 Nobuyoshi Nakada * regenc.c (onigenc_strlen_null, onigenc_str_bytelen_null): suppressed diff --git a/enc/utf16_be.c b/enc/utf16_be.c index 0c64a46468..a069142322 100644 --- a/enc/utf16_be.c +++ b/enc/utf16_be.c @@ -29,6 +29,8 @@ #include "regenc.h" +OnigEncodingDeclare(UTF16_BE); + #define UTF16_IS_SURROGATE_FIRST(c) (c >= 0xd8 && c <= 0xdb) #define UTF16_IS_SURROGATE_SECOND(c) (c >= 0xdc && c <= 0xdf) @@ -153,7 +155,7 @@ utf16be_mbc_case_fold(OnigCaseFoldType flag, return 2; } else - return onigenc_unicode_mbc_case_fold(ONIG_ENCODING_UTF16_BE, flag, + return onigenc_unicode_mbc_case_fold(&OnigEncodingName(UTF16_BE), flag, pp, end, fold); } @@ -213,7 +215,7 @@ utf16be_get_case_fold_codes_by_str(OnigCaseFoldType flag, OnigCaseFoldCodeItem items[], struct OnigEncodingTypeST* enc ARG_UNUSED) { - return onigenc_unicode_get_case_fold_codes_by_str(ONIG_ENCODING_UTF16_BE, + return onigenc_unicode_get_case_fold_codes_by_str(&OnigEncodingName(UTF16_BE), flag, p, end, items); } diff --git a/enc/utf16_le.c b/enc/utf16_le.c index f16a7cdca5..e059b52abe 100644 --- a/enc/utf16_le.c +++ b/enc/utf16_le.c @@ -29,6 +29,8 @@ #include "regenc.h" +OnigEncodingDeclare(UTF16_LE); + #define UTF16_IS_SURROGATE_FIRST(c) (c >= 0xd8 && c <= 0xdb) #define UTF16_IS_SURROGATE_SECOND(c) (c >= 0xdc && c <= 0xdf) @@ -155,8 +157,8 @@ utf16le_mbc_case_fold(OnigCaseFoldType flag, return 2; } else - return onigenc_unicode_mbc_case_fold(ONIG_ENCODING_UTF16_LE, flag, pp, end, - fold); + return onigenc_unicode_mbc_case_fold(&OnigEncodingName(UTF16_LE), flag, pp, + end, fold); } #if 0 @@ -214,7 +216,7 @@ utf16le_get_case_fold_codes_by_str(OnigCaseFoldType flag, OnigCaseFoldCodeItem items[], struct OnigEncodingTypeST* enc ARG_UNUSED) { - return onigenc_unicode_get_case_fold_codes_by_str(ONIG_ENCODING_UTF16_LE, + return onigenc_unicode_get_case_fold_codes_by_str(&OnigEncodingName(UTF16_LE), flag, p, end, items); } diff --git a/enc/utf32_be.c b/enc/utf32_be.c index c50e3871d4..1cf8d99954 100644 --- a/enc/utf32_be.c +++ b/enc/utf32_be.c @@ -29,6 +29,8 @@ #include "regenc.h" +OnigEncodingDeclare(UTF32_BE); + static int utf32be_mbc_enc_len(const UChar* p ARG_UNUSED, const OnigUChar* e ARG_UNUSED, struct OnigEncodingTypeST* enc ARG_UNUSED) @@ -114,8 +116,8 @@ utf32be_mbc_case_fold(OnigCaseFoldType flag, return 4; } else - return onigenc_unicode_mbc_case_fold(ONIG_ENCODING_UTF32_BE, flag, pp, end, - fold); + return onigenc_unicode_mbc_case_fold(&OnigEncodingName(UTF32_BE), flag, pp, + end, fold); } #if 0 @@ -169,7 +171,7 @@ utf32be_get_case_fold_codes_by_str(OnigCaseFoldType flag, OnigCaseFoldCodeItem items[], struct OnigEncodingTypeST* enc ARG_UNUSED) { - return onigenc_unicode_get_case_fold_codes_by_str(ONIG_ENCODING_UTF32_BE, + return onigenc_unicode_get_case_fold_codes_by_str(&OnigEncodingName(UTF32_BE), flag, p, end, items); } diff --git a/enc/utf32_le.c b/enc/utf32_le.c index 9aaff4926d..85daf43e47 100644 --- a/enc/utf32_le.c +++ b/enc/utf32_le.c @@ -29,6 +29,8 @@ #include "regenc.h" +OnigEncodingDeclare(UTF32_LE); + static int utf32le_mbc_enc_len(const UChar* p ARG_UNUSED, const OnigUChar* e ARG_UNUSED, struct OnigEncodingTypeST* enc ARG_UNUSED) @@ -115,8 +117,8 @@ utf32le_mbc_case_fold(OnigCaseFoldType flag, return 4; } else - return onigenc_unicode_mbc_case_fold(ONIG_ENCODING_UTF32_LE, flag, pp, end, - fold); + return onigenc_unicode_mbc_case_fold(&OnigEncodingName(UTF32_LE), flag, pp, + end, fold); } #if 0 @@ -169,7 +171,7 @@ utf32le_get_case_fold_codes_by_str(OnigCaseFoldType flag, OnigCaseFoldCodeItem items[], struct OnigEncodingTypeST* enc ARG_UNUSED) { - return onigenc_unicode_get_case_fold_codes_by_str(ONIG_ENCODING_UTF32_LE, + return onigenc_unicode_get_case_fold_codes_by_str(&OnigEncodingName(UTF32_LE), flag, p, end, items); }