1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* enc/us_ascii.c: add us_ascii_ prefix for functions to ease

setting breakpoint when debugging.

* enc/euc_jp.c: add eucjp_ prefix.

* enc/sjis.c: add sjis_ prefix.

* enc/iso_8859_1.c: add iso_8859_1_ prefix.

* enc/iso_8859_2.c: add iso_8859_2_ prefix.

* enc/iso_8859_3.c: add iso_8859_3_ prefix.

* enc/iso_8859_4.c: add iso_8859_4_ prefix.

* enc/iso_8859_5.c: add iso_8859_5_ prefix.

* enc/iso_8859_6.c: add iso_8859_6_ prefix.

* enc/iso_8859_7.c: add iso_8859_7_ prefix.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-01-02 20:06:58 +00:00
parent 9d52fda376
commit a13c1148a9
11 changed files with 119 additions and 96 deletions

View file

@ -1,3 +1,26 @@
Thu Jan 3 05:02:36 2008 Tanaka Akira <akr@fsij.org>
* enc/us_ascii.c: add us_ascii_ prefix for functions to ease
setting breakpoint when debugging.
* enc/euc_jp.c: add eucjp_ prefix.
* enc/sjis.c: add sjis_ prefix.
* enc/iso_8859_1.c: add iso_8859_1_ prefix.
* enc/iso_8859_2.c: add iso_8859_2_ prefix.
* enc/iso_8859_3.c: add iso_8859_3_ prefix.
* enc/iso_8859_4.c: add iso_8859_4_ prefix.
* enc/iso_8859_5.c: add iso_8859_5_ prefix.
* enc/iso_8859_6.c: add iso_8859_6_ prefix.
* enc/iso_8859_7.c: add iso_8859_7_ prefix.
Thu Jan 3 02:44:34 2008 Tanaka Akira <akr@fsij.org>
* bignum.c (conv_digit): use ISDIGIT, ISLOWER and ISUPPER.

View file

@ -114,7 +114,7 @@ static const signed char trans[][0x100] = {
#undef F
static int
mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc)
eucjp_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc)
{
int firstbyte = *p++;
state_t s;
@ -132,7 +132,7 @@ mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc)
}
static OnigCodePoint
mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
eucjp_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
{
int c, i, len;
OnigCodePoint n;
@ -150,7 +150,7 @@ mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
}
static int
code_to_mbclen(OnigCodePoint code, OnigEncoding enc)
eucjp_code_to_mbclen(OnigCodePoint code, OnigEncoding enc)
{
if (ONIGENC_IS_CODE_ASCII(code)) return 1;
else if (code > 0xffffff) return 0;
@ -179,7 +179,7 @@ code_to_mbc_first(OnigCodePoint code)
#endif
static int
code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
eucjp_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
{
UChar *p = buf;
@ -195,7 +195,7 @@ code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
}
static int
mbc_case_fold(OnigCaseFoldType flag,
eucjp_mbc_case_fold(OnigCaseFoldType flag,
const UChar** pp, const UChar* end, UChar* lower,
OnigEncoding enc)
{
@ -220,7 +220,7 @@ mbc_case_fold(OnigCaseFoldType flag,
}
static UChar*
left_adjust_char_head(const UChar* start, const UChar* s, OnigEncoding enc)
eucjp_left_adjust_char_head(const UChar* start, const UChar* s, OnigEncoding enc)
{
/* In this encoding
mb-trail bytes doesn't mix with single bytes.
@ -239,7 +239,7 @@ left_adjust_char_head(const UChar* start, const UChar* s, OnigEncoding enc)
}
static int
is_allowed_reverse_match(const UChar* s, const UChar* end, OnigEncoding enc)
eucjp_is_allowed_reverse_match(const UChar* s, const UChar* end, OnigEncoding enc)
{
const UChar c = *s;
if (c <= 0x7e || c == 0x8e || c == 0x8f)
@ -281,7 +281,7 @@ init_property_list(void)
}
static int
property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end)
eucjp_property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end)
{
int ctype;
@ -295,14 +295,14 @@ property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end)
}
static int
is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
eucjp_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
{
if (ctype <= ONIGENC_MAX_STD_CTYPE) {
if (code < 128)
return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);
else {
if (CTYPE_IS_WORD_GRAPH_PRINT(ctype)) {
return (code_to_mbclen(code, enc) > 1 ? TRUE : FALSE);
return (eucjp_code_to_mbclen(code, enc) > 1 ? TRUE : FALSE);
}
}
}
@ -320,7 +320,7 @@ is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
}
static int
get_ctype_code_range(int ctype, OnigCodePoint* sb_out,
eucjp_get_ctype_code_range(int ctype, OnigCodePoint* sb_out,
const OnigCodePoint* ranges[], OnigEncoding enc)
{
if (ctype <= ONIGENC_MAX_STD_CTYPE) {
@ -342,21 +342,21 @@ get_ctype_code_range(int ctype, OnigCodePoint* sb_out,
OnigEncodingDefine(euc_jp, EUC_JP) = {
mbc_enc_len,
eucjp_mbc_enc_len,
"EUC-JP", /* name */
3, /* max enc length */
1, /* min enc length */
onigenc_is_mbc_newline_0x0a,
mbc_to_code,
code_to_mbclen,
code_to_mbc,
mbc_case_fold,
eucjp_mbc_to_code,
eucjp_code_to_mbclen,
eucjp_code_to_mbc,
eucjp_mbc_case_fold,
onigenc_ascii_apply_all_case_fold,
onigenc_ascii_get_case_fold_codes_by_str,
property_name_to_ctype,
is_code_ctype,
get_ctype_code_range,
left_adjust_char_head,
is_allowed_reverse_match,
eucjp_property_name_to_ctype,
eucjp_is_code_ctype,
eucjp_get_ctype_code_range,
eucjp_left_adjust_char_head,
eucjp_is_allowed_reverse_match,
0
};

View file

@ -102,7 +102,7 @@ static const OnigPairCaseFoldCodes CaseFoldMap[] = {
};
static int
apply_all_case_fold(OnigCaseFoldType flag,
iso_8859_1_apply_all_case_fold(OnigCaseFoldType flag,
OnigApplyAllCaseFoldFunc f, void* arg,
OnigEncoding enc)
{
@ -112,7 +112,7 @@ apply_all_case_fold(OnigCaseFoldType flag,
}
static int
get_case_fold_codes_by_str(OnigCaseFoldType flag,
iso_8859_1_get_case_fold_codes_by_str(OnigCaseFoldType flag,
const OnigUChar* p, const OnigUChar* end,
OnigCaseFoldCodeItem items[],
OnigEncoding enc)
@ -201,7 +201,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
}
static int
mbc_case_fold(OnigCaseFoldType flag, const UChar** pp, const UChar* end,
iso_8859_1_mbc_case_fold(OnigCaseFoldType flag, const UChar** pp, const UChar* end,
UChar* lower, OnigEncoding enc)
{
const UChar* p = *pp;
@ -246,7 +246,7 @@ is_mbc_ambiguous(OnigCaseFoldType flag,
#endif
static int
is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
iso_8859_1_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
{
if (code < 256)
return ENC_IS_ISO_8859_1_CTYPE(code, ctype);
@ -263,11 +263,11 @@ OnigEncodingDefine(iso_8859_1, ISO_8859_1) = {
onigenc_single_byte_mbc_to_code,
onigenc_single_byte_code_to_mbclen,
onigenc_single_byte_code_to_mbc,
mbc_case_fold,
apply_all_case_fold,
get_case_fold_codes_by_str,
iso_8859_1_mbc_case_fold,
iso_8859_1_apply_all_case_fold,
iso_8859_1_get_case_fold_codes_by_str,
onigenc_minimum_property_name_to_ctype,
is_code_ctype,
iso_8859_1_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match

View file

@ -104,7 +104,7 @@ static const unsigned short EncISO_8859_2_CtypeTable[256] = {
};
static int
mbc_case_fold(OnigCaseFoldType flag,
iso_8859_2_mbc_case_fold(OnigCaseFoldType flag,
const UChar** pp, const UChar* end, UChar* lower,
OnigEncoding enc)
{
@ -190,7 +190,7 @@ static const OnigPairCaseFoldCodes CaseFoldMap[] = {
};
static int
apply_all_case_fold(OnigCaseFoldType flag,
iso_8859_2_apply_all_case_fold(OnigCaseFoldType flag,
OnigApplyAllCaseFoldFunc f, void* arg,
OnigEncoding enc)
{
@ -200,7 +200,7 @@ apply_all_case_fold(OnigCaseFoldType flag,
}
static int
get_case_fold_codes_by_str(OnigCaseFoldType flag,
iso_8859_2_get_case_fold_codes_by_str(OnigCaseFoldType flag,
const OnigUChar* p, const OnigUChar* end,
OnigCaseFoldCodeItem items[],
OnigEncoding enc)
@ -211,7 +211,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
}
static int
is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
iso_8859_2_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
{
if (code < 256)
return ENC_IS_ISO_8859_2_CTYPE(code, ctype);
@ -228,11 +228,11 @@ OnigEncodingDefine(iso_8859_2, ISO_8859_2) = {
onigenc_single_byte_mbc_to_code,
onigenc_single_byte_code_to_mbclen,
onigenc_single_byte_code_to_mbc,
mbc_case_fold,
apply_all_case_fold,
get_case_fold_codes_by_str,
iso_8859_2_mbc_case_fold,
iso_8859_2_apply_all_case_fold,
iso_8859_2_get_case_fold_codes_by_str,
onigenc_minimum_property_name_to_ctype,
is_code_ctype,
iso_8859_2_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match

View file

@ -104,7 +104,7 @@ static const unsigned short EncISO_8859_3_CtypeTable[256] = {
};
static int
mbc_case_fold(OnigCaseFoldType flag,
iso_8859_3_mbc_case_fold(OnigCaseFoldType flag,
const UChar** pp, const UChar* end, UChar* lower,
OnigEncoding enc)
{
@ -149,7 +149,7 @@ is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
#endif
static int
is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
iso_8859_3_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
{
if (code < 256)
return ENC_IS_ISO_8859_3_CTYPE(code, ctype);
@ -199,7 +199,7 @@ static const OnigPairCaseFoldCodes CaseFoldMap[] = {
static int
apply_all_case_fold(OnigCaseFoldType flag,
iso_8859_3_apply_all_case_fold(OnigCaseFoldType flag,
OnigApplyAllCaseFoldFunc f, void* arg,
OnigEncoding enc)
{
@ -209,7 +209,7 @@ apply_all_case_fold(OnigCaseFoldType flag,
}
static int
get_case_fold_codes_by_str(OnigCaseFoldType flag,
iso_8859_3_get_case_fold_codes_by_str(OnigCaseFoldType flag,
const OnigUChar* p, const OnigUChar* end,
OnigCaseFoldCodeItem items[],
OnigEncoding enc)
@ -228,11 +228,11 @@ OnigEncodingDefine(iso_8859_3, ISO_8859_3) = {
onigenc_single_byte_mbc_to_code,
onigenc_single_byte_code_to_mbclen,
onigenc_single_byte_code_to_mbc,
mbc_case_fold,
apply_all_case_fold,
get_case_fold_codes_by_str,
iso_8859_3_mbc_case_fold,
iso_8859_3_apply_all_case_fold,
iso_8859_3_get_case_fold_codes_by_str,
onigenc_minimum_property_name_to_ctype,
is_code_ctype,
iso_8859_3_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match

View file

@ -104,7 +104,7 @@ static const unsigned short EncISO_8859_4_CtypeTable[256] = {
};
static int
mbc_case_fold(OnigCaseFoldType flag,
iso_8859_4_mbc_case_fold(OnigCaseFoldType flag,
const UChar** pp, const UChar* end, UChar* lower,
OnigEncoding enc)
{
@ -148,7 +148,7 @@ is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
#endif
static int
is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
iso_8859_4_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
{
if (code < 256)
return ENC_IS_ISO_8859_4_CTYPE(code, ctype);
@ -201,7 +201,7 @@ static const OnigPairCaseFoldCodes CaseFoldMap[] = {
};
static int
apply_all_case_fold(OnigCaseFoldType flag,
iso_8859_4_apply_all_case_fold(OnigCaseFoldType flag,
OnigApplyAllCaseFoldFunc f, void* arg,
OnigEncoding enc)
{
@ -211,7 +211,7 @@ apply_all_case_fold(OnigCaseFoldType flag,
}
static int
get_case_fold_codes_by_str(OnigCaseFoldType flag,
iso_8859_4_get_case_fold_codes_by_str(OnigCaseFoldType flag,
const OnigUChar* p, const OnigUChar* end,
OnigCaseFoldCodeItem items[],
OnigEncoding enc)
@ -230,11 +230,11 @@ OnigEncodingDefine(iso_8859_4, ISO_8859_4) = {
onigenc_single_byte_mbc_to_code,
onigenc_single_byte_code_to_mbclen,
onigenc_single_byte_code_to_mbc,
mbc_case_fold,
apply_all_case_fold,
get_case_fold_codes_by_str,
iso_8859_4_mbc_case_fold,
iso_8859_4_apply_all_case_fold,
iso_8859_4_get_case_fold_codes_by_str,
onigenc_minimum_property_name_to_ctype,
is_code_ctype,
iso_8859_4_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match

View file

@ -104,7 +104,7 @@ static const unsigned short EncISO_8859_5_CtypeTable[256] = {
};
static int
mbc_case_fold(OnigCaseFoldType flag,
iso_8859_5_mbc_case_fold(OnigCaseFoldType flag,
const UChar** pp, const UChar* end, UChar* lower,
OnigEncoding enc)
{
@ -129,7 +129,7 @@ is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end)
#endif
static int
is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
iso_8859_5_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
{
if (code < 256)
return ENC_IS_ISO_8859_5_CTYPE(code, ctype);
@ -189,7 +189,7 @@ static const OnigPairCaseFoldCodes CaseFoldMap[] = {
};
static int
apply_all_case_fold(OnigCaseFoldType flag,
iso_8859_5_apply_all_case_fold(OnigCaseFoldType flag,
OnigApplyAllCaseFoldFunc f, void* arg,
OnigEncoding enc)
{
@ -199,7 +199,7 @@ apply_all_case_fold(OnigCaseFoldType flag,
}
static int
get_case_fold_codes_by_str(OnigCaseFoldType flag,
iso_8859_5_get_case_fold_codes_by_str(OnigCaseFoldType flag,
const OnigUChar* p, const OnigUChar* end,
OnigCaseFoldCodeItem items[],
OnigEncoding enc)
@ -218,11 +218,11 @@ OnigEncodingDefine(iso_8859_5, ISO_8859_5) = {
onigenc_single_byte_mbc_to_code,
onigenc_single_byte_code_to_mbclen,
onigenc_single_byte_code_to_mbc,
mbc_case_fold,
apply_all_case_fold,
get_case_fold_codes_by_str,
iso_8859_5_mbc_case_fold,
iso_8859_5_apply_all_case_fold,
iso_8859_5_get_case_fold_codes_by_str,
onigenc_minimum_property_name_to_ctype,
is_code_ctype,
iso_8859_5_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match

View file

@ -68,7 +68,7 @@ static const unsigned short EncISO_8859_6_CtypeTable[256] = {
};
static int
is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
iso_8859_6_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
{
if (code < 256)
return ENC_IS_ISO_8859_6_CTYPE(code, ctype);
@ -89,7 +89,7 @@ OnigEncodingDefine(iso_8859_6, ISO_8859_6) = {
onigenc_ascii_apply_all_case_fold,
onigenc_ascii_get_case_fold_codes_by_str,
onigenc_minimum_property_name_to_ctype,
is_code_ctype,
iso_8859_6_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match

View file

@ -104,7 +104,7 @@ static const unsigned short EncISO_8859_7_CtypeTable[256] = {
};
static int
mbc_case_fold(OnigCaseFoldType flag,
iso_8859_7_mbc_case_fold(OnigCaseFoldType flag,
const UChar** pp, const UChar* end, UChar* lower,
OnigEncoding enc)
{
@ -137,7 +137,7 @@ is_mbc_ambiguous(OnigCaseFoldType flag,
#endif
static int
is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
iso_8859_7_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
{
if (code < 256)
return ENC_IS_ISO_8859_7_CTYPE(code, ctype);
@ -185,7 +185,7 @@ static const OnigPairCaseFoldCodes CaseFoldMap[] = {
};
static int
apply_all_case_fold(OnigCaseFoldType flag,
iso_8859_7_apply_all_case_fold(OnigCaseFoldType flag,
OnigApplyAllCaseFoldFunc f, void* arg,
OnigEncoding enc)
{
@ -195,7 +195,7 @@ apply_all_case_fold(OnigCaseFoldType flag,
}
static int
get_case_fold_codes_by_str(OnigCaseFoldType flag,
iso_8859_7_get_case_fold_codes_by_str(OnigCaseFoldType flag,
const OnigUChar* p, const OnigUChar* end,
OnigCaseFoldCodeItem items[],
OnigEncoding enc)
@ -215,11 +215,11 @@ OnigEncodingDefine(iso_8859_7, ISO_8859_7) = {
onigenc_single_byte_mbc_to_code,
onigenc_single_byte_code_to_mbclen,
onigenc_single_byte_code_to_mbc,
mbc_case_fold,
apply_all_case_fold,
get_case_fold_codes_by_str,
iso_8859_7_mbc_case_fold,
iso_8859_7_apply_all_case_fold,
iso_8859_7_get_case_fold_codes_by_str,
onigenc_minimum_property_name_to_ctype,
is_code_ctype,
iso_8859_7_is_code_ctype,
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match

View file

@ -115,7 +115,7 @@ static const signed char trans[][0x100] = {
#undef F
static int
mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc)
sjis_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc)
{
int firstbyte = *p++;
state_t s;
@ -129,7 +129,7 @@ mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc)
}
static int
code_to_mbclen(OnigCodePoint code, OnigEncoding enc)
sjis_code_to_mbclen(OnigCodePoint code, OnigEncoding enc)
{
if (code < 256) {
if (EncLen_SJIS[(int )code] == 1)
@ -145,7 +145,7 @@ code_to_mbclen(OnigCodePoint code, OnigEncoding enc)
}
static OnigCodePoint
mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
sjis_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
{
int c, i, len;
OnigCodePoint n;
@ -164,7 +164,7 @@ mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
}
static int
code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
sjis_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
{
UChar *p = buf;
@ -179,7 +179,7 @@ code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
}
static int
mbc_case_fold(OnigCaseFoldType flag,
sjis_mbc_case_fold(OnigCaseFoldType flag,
const UChar** pp, const UChar* end, UChar* lower,
OnigEncoding enc)
{
@ -214,13 +214,13 @@ is_mbc_ambiguous(OnigCaseFoldType flag,
#if 0
static int
is_code_ctype(OnigCodePoint code, unsigned int ctype)
sjis_is_code_ctype(OnigCodePoint code, unsigned int ctype)
{
if (code < 128)
return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);
else {
if (CTYPE_IS_WORD_GRAPH_PRINT(ctype)) {
return (code_to_mbclen(code) > 1 ? TRUE : FALSE);
return (sjis_code_to_mbclen(code) > 1 ? TRUE : FALSE);
}
}
@ -229,7 +229,7 @@ is_code_ctype(OnigCodePoint code, unsigned int ctype)
#endif
static UChar*
left_adjust_char_head(const UChar* start, const UChar* s, OnigEncoding enc)
sjis_left_adjust_char_head(const UChar* start, const UChar* s, OnigEncoding enc)
{
const UChar *p;
int len;
@ -252,7 +252,7 @@ left_adjust_char_head(const UChar* start, const UChar* s, OnigEncoding enc)
}
static int
is_allowed_reverse_match(const UChar* s, const UChar* end, OnigEncoding enc)
sjis_is_allowed_reverse_match(const UChar* s, const UChar* end, OnigEncoding enc)
{
const UChar c = *s;
return (SJIS_ISMB_TRAIL(c) ? FALSE : TRUE);
@ -292,7 +292,7 @@ init_property_list(void)
}
static int
property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end)
sjis_property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end)
{
int ctype;
@ -306,14 +306,14 @@ property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end)
}
static int
is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
sjis_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
{
if (ctype <= ONIGENC_MAX_STD_CTYPE) {
if (code < 128)
return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);
else {
if (CTYPE_IS_WORD_GRAPH_PRINT(ctype)) {
return (code_to_mbclen(code, enc) > 1 ? TRUE : FALSE);
return (sjis_code_to_mbclen(code, enc) > 1 ? TRUE : FALSE);
}
}
}
@ -331,7 +331,7 @@ is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc)
}
static int
get_ctype_code_range(int ctype, OnigCodePoint* sb_out,
sjis_get_ctype_code_range(int ctype, OnigCodePoint* sb_out,
const OnigCodePoint* ranges[], OnigEncoding enc)
{
if (ctype <= ONIGENC_MAX_STD_CTYPE) {
@ -352,21 +352,21 @@ get_ctype_code_range(int ctype, OnigCodePoint* sb_out,
}
OnigEncodingDefine(sjis, SJIS) = {
mbc_enc_len,
sjis_mbc_enc_len,
"Shift_JIS", /* name */
2, /* max byte length */
1, /* min byte length */
onigenc_is_mbc_newline_0x0a,
mbc_to_code,
code_to_mbclen,
code_to_mbc,
mbc_case_fold,
sjis_mbc_to_code,
sjis_code_to_mbclen,
sjis_code_to_mbc,
sjis_mbc_case_fold,
onigenc_ascii_apply_all_case_fold,
onigenc_ascii_get_case_fold_codes_by_str,
property_name_to_ctype,
is_code_ctype,
get_ctype_code_range,
left_adjust_char_head,
is_allowed_reverse_match,
sjis_property_name_to_ctype,
sjis_is_code_ctype,
sjis_get_ctype_code_range,
sjis_left_adjust_char_head,
sjis_is_allowed_reverse_match,
0
};

View file

@ -1,7 +1,7 @@
#include "regenc.h"
extern int
mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc)
us_ascii_mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc)
{
if (*p & 0x80)
return ONIGENC_CONSTRUCT_MBCLEN_INVALID();
@ -9,7 +9,7 @@ mbc_enc_len(const UChar* p, const UChar* e, OnigEncoding enc)
}
OnigEncodingDefine(us_ascii, US_ASCII) = {
mbc_enc_len,
us_ascii_mbc_enc_len,
"US-ASCII",/* name */
1, /* max byte length */
1, /* min byte length */