* enc/utf{16,32}_{be,le}.c: use &OnigEncodingName(*) instead of

ONIG_ENCODING_*.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2008-01-08 06:48:49 +00:00
Родитель dca4de6838
Коммит ecf8b1c807
5 изменённых файлов: 24 добавлений и 11 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Tue Jan 8 15:47:43 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* enc/utf{16,32}_{be,le}.c: use &OnigEncodingName(*) instead of
ONIG_ENCODING_*.
Tue Jan 8 15:40:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> Tue Jan 8 15:40:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* regenc.c (onigenc_strlen_null, onigenc_str_bytelen_null): suppressed * regenc.c (onigenc_strlen_null, onigenc_str_bytelen_null): suppressed

Просмотреть файл

@ -29,6 +29,8 @@
#include "regenc.h" #include "regenc.h"
OnigEncodingDeclare(UTF16_BE);
#define UTF16_IS_SURROGATE_FIRST(c) (c >= 0xd8 && c <= 0xdb) #define UTF16_IS_SURROGATE_FIRST(c) (c >= 0xd8 && c <= 0xdb)
#define UTF16_IS_SURROGATE_SECOND(c) (c >= 0xdc && c <= 0xdf) #define UTF16_IS_SURROGATE_SECOND(c) (c >= 0xdc && c <= 0xdf)
@ -153,7 +155,7 @@ utf16be_mbc_case_fold(OnigCaseFoldType flag,
return 2; return 2;
} }
else 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); pp, end, fold);
} }
@ -213,7 +215,7 @@ utf16be_get_case_fold_codes_by_str(OnigCaseFoldType flag,
OnigCaseFoldCodeItem items[], OnigCaseFoldCodeItem items[],
struct OnigEncodingTypeST* enc ARG_UNUSED) 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); flag, p, end, items);
} }

Просмотреть файл

@ -29,6 +29,8 @@
#include "regenc.h" #include "regenc.h"
OnigEncodingDeclare(UTF16_LE);
#define UTF16_IS_SURROGATE_FIRST(c) (c >= 0xd8 && c <= 0xdb) #define UTF16_IS_SURROGATE_FIRST(c) (c >= 0xd8 && c <= 0xdb)
#define UTF16_IS_SURROGATE_SECOND(c) (c >= 0xdc && c <= 0xdf) #define UTF16_IS_SURROGATE_SECOND(c) (c >= 0xdc && c <= 0xdf)
@ -155,8 +157,8 @@ utf16le_mbc_case_fold(OnigCaseFoldType flag,
return 2; return 2;
} }
else else
return onigenc_unicode_mbc_case_fold(ONIG_ENCODING_UTF16_LE, flag, pp, end, return onigenc_unicode_mbc_case_fold(&OnigEncodingName(UTF16_LE), flag, pp,
fold); end, fold);
} }
#if 0 #if 0
@ -214,7 +216,7 @@ utf16le_get_case_fold_codes_by_str(OnigCaseFoldType flag,
OnigCaseFoldCodeItem items[], OnigCaseFoldCodeItem items[],
struct OnigEncodingTypeST* enc ARG_UNUSED) 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); flag, p, end, items);
} }

Просмотреть файл

@ -29,6 +29,8 @@
#include "regenc.h" #include "regenc.h"
OnigEncodingDeclare(UTF32_BE);
static int static int
utf32be_mbc_enc_len(const UChar* p ARG_UNUSED, const OnigUChar* e ARG_UNUSED, utf32be_mbc_enc_len(const UChar* p ARG_UNUSED, const OnigUChar* e ARG_UNUSED,
struct OnigEncodingTypeST* enc ARG_UNUSED) struct OnigEncodingTypeST* enc ARG_UNUSED)
@ -114,8 +116,8 @@ utf32be_mbc_case_fold(OnigCaseFoldType flag,
return 4; return 4;
} }
else else
return onigenc_unicode_mbc_case_fold(ONIG_ENCODING_UTF32_BE, flag, pp, end, return onigenc_unicode_mbc_case_fold(&OnigEncodingName(UTF32_BE), flag, pp,
fold); end, fold);
} }
#if 0 #if 0
@ -169,7 +171,7 @@ utf32be_get_case_fold_codes_by_str(OnigCaseFoldType flag,
OnigCaseFoldCodeItem items[], OnigCaseFoldCodeItem items[],
struct OnigEncodingTypeST* enc ARG_UNUSED) 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); flag, p, end, items);
} }

Просмотреть файл

@ -29,6 +29,8 @@
#include "regenc.h" #include "regenc.h"
OnigEncodingDeclare(UTF32_LE);
static int static int
utf32le_mbc_enc_len(const UChar* p ARG_UNUSED, const OnigUChar* e ARG_UNUSED, utf32le_mbc_enc_len(const UChar* p ARG_UNUSED, const OnigUChar* e ARG_UNUSED,
struct OnigEncodingTypeST* enc ARG_UNUSED) struct OnigEncodingTypeST* enc ARG_UNUSED)
@ -115,8 +117,8 @@ utf32le_mbc_case_fold(OnigCaseFoldType flag,
return 4; return 4;
} }
else else
return onigenc_unicode_mbc_case_fold(ONIG_ENCODING_UTF32_LE, flag, pp, end, return onigenc_unicode_mbc_case_fold(&OnigEncodingName(UTF32_LE), flag, pp,
fold); end, fold);
} }
#if 0 #if 0
@ -169,7 +171,7 @@ utf32le_get_case_fold_codes_by_str(OnigCaseFoldType flag,
OnigCaseFoldCodeItem items[], OnigCaseFoldCodeItem items[],
struct OnigEncodingTypeST* enc ARG_UNUSED) 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); flag, p, end, items);
} }