* enc/utf_8.c: remove use of ONIG_ENCODING_UTF8 altogether; use

enc argument instead.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-01-15 09:47:58 +00:00
Родитель 648c0f7c80
Коммит d2a377d747
2 изменённых файлов: 8 добавлений и 41 удалений

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

@ -1,3 +1,8 @@
Tue Jan 15 18:44:46 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* enc/utf_8.c: remove use of ONIG_ENCODING_UTF8 altogether; use
enc argument instead.
Tue Jan 15 18:05:26 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* enc/utf_8.c (ONIG_ENCODING_UTF8): reverted.

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

@ -272,7 +272,7 @@ mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
int c, len;
OnigCodePoint n;
len = enclen(ONIG_ENCODING_UTF8, p, end);
len = enclen(enc, p, end);
c = *p++;
if (len > 1) {
len--;
@ -390,47 +390,10 @@ mbc_case_fold(OnigCaseFoldType flag, const UChar** pp,
return 1; /* return byte length of converted char to lower */
}
else {
return onigenc_unicode_mbc_case_fold(ONIG_ENCODING_UTF8, flag,
pp, end, fold);
return onigenc_unicode_mbc_case_fold(enc, flag, pp, end, fold);
}
}
#if 0
static int
is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
{
const UChar* p = *pp;
if (ONIGENC_IS_MBC_ASCII(p)) {
(*pp)++;
return ONIGENC_IS_ASCII_CODE_CASE_AMBIG(*p);
}
else {
(*pp) += enclen(ONIG_ENCODING_UTF8, p);
if (*p == 0xc3) {
int c = *(p + 1);
if (c >= 0x80) {
if (c <= (UChar )0x9e) { /* upper */
if (c == (UChar )0x97) return FALSE;
return TRUE;
}
else if (c >= (UChar )0xa0 && c <= (UChar )0xbe) { /* lower */
if (c == (UChar )'\267') return FALSE;
return TRUE;
}
else if (c == (UChar )0x9f &&
(flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
return TRUE;
}
}
}
}
return FALSE;
}
#endif
static int
get_ctype_code_range(OnigCtype ctype, OnigCodePoint *sb_out,
@ -458,8 +421,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[],
OnigEncoding enc)
{
return onigenc_unicode_get_case_fold_codes_by_str(ONIG_ENCODING_UTF8,
flag, p, end, items);
return onigenc_unicode_get_case_fold_codes_by_str(enc, flag, p, end, items);
}
OnigEncodingDefine(utf8, UTF8) = {