Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add USE_CASE_MAP_API config #125

Merged
merged 1 commit into from
Jan 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions enc/ascii.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ OnigEncodingDefine(ascii, ASCII) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
#ifdef USE_CASE_MAP_API
onigenc_single_byte_ascii_only_case_map,
#else
NULL,
#endif
ENCINDEX_ASCII,
ONIGENC_FLAG_NONE,
};
Expand Down
12 changes: 12 additions & 0 deletions enc/big5.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,11 @@ OnigEncodingDefine(big5, BIG5) = {
onigenc_not_support_get_ctype_code_range,
big5_left_adjust_char_head,
big5_is_allowed_reverse_match,
#ifdef USE_CASE_MAP_API
onigenc_ascii_only_case_map,
#else
NULL,
#endif
0,
ONIGENC_FLAG_NONE,
};
Expand Down Expand Up @@ -335,7 +339,11 @@ OnigEncodingDefine(big5_hkscs, BIG5_HKSCS) = {
onigenc_not_support_get_ctype_code_range,
big5_left_adjust_char_head,
big5_is_allowed_reverse_match,
#ifdef USE_CASE_MAP_API
onigenc_ascii_only_case_map,
#else
NULL,
#endif
0,
ONIGENC_FLAG_NONE,
};
Expand Down Expand Up @@ -370,7 +378,11 @@ OnigEncodingDefine(big5_uao, BIG5_UAO) = {
onigenc_not_support_get_ctype_code_range,
big5_left_adjust_char_head,
big5_is_allowed_reverse_match,
#ifdef USE_CASE_MAP_API
onigenc_ascii_only_case_map,
#else
NULL,
#endif
0,
ONIGENC_FLAG_NONE,
};
4 changes: 4 additions & 0 deletions enc/cp949.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,11 @@ OnigEncodingDefine(cp949, CP949) = {
onigenc_not_support_get_ctype_code_range,
cp949_left_adjust_char_head,
cp949_is_allowed_reverse_match,
#ifdef USE_CASE_MAP_API
onigenc_ascii_only_case_map,
#else
NULL,
#endif
0,
ONIGENC_FLAG_NONE,
};
Expand Down
4 changes: 4 additions & 0 deletions enc/emacs_mule.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,11 @@ OnigEncodingDefine(emacs_mule, Emacs_Mule) = {
onigenc_not_support_get_ctype_code_range,
left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
#ifdef USE_CASE_MAP_API
onigenc_ascii_only_case_map,
#else
NULL,
#endif
0,
ONIGENC_FLAG_NONE,
};
Expand Down
4 changes: 4 additions & 0 deletions enc/euc_jp.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,11 @@ OnigEncodingDefine(euc_jp, EUC_JP) = {
get_ctype_code_range,
left_adjust_char_head,
is_allowed_reverse_match,
#ifdef USE_CASE_MAP_API
onigenc_ascii_only_case_map,
#else
NULL,
#endif
0,
ONIGENC_FLAG_NONE,
};
Expand Down
8 changes: 8 additions & 0 deletions enc/euc_kr.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,11 @@ OnigEncodingDefine(euc_kr, EUC_KR) = {
onigenc_not_support_get_ctype_code_range,
euckr_left_adjust_char_head,
euckr_is_allowed_reverse_match,
#ifdef USE_CASE_MAP_API
onigenc_ascii_only_case_map,
#else
NULL,
#endif
0,
ONIGENC_FLAG_NONE,
};
Expand All @@ -213,7 +217,11 @@ OnigEncodingDefine(euc_cn, EUC_CN) = {
onigenc_not_support_get_ctype_code_range,
euckr_left_adjust_char_head,
euckr_is_allowed_reverse_match,
#ifdef USE_CASE_MAP_API
onigenc_ascii_only_case_map,
#else
NULL,
#endif
0,
ONIGENC_FLAG_NONE,
};
Expand Down
4 changes: 4 additions & 0 deletions enc/euc_tw.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,11 @@ OnigEncodingDefine(euc_tw, EUC_TW) = {
onigenc_not_support_get_ctype_code_range,
euctw_left_adjust_char_head,
euctw_is_allowed_reverse_match,
#ifdef USE_CASE_MAP_API
onigenc_ascii_only_case_map,
#else
NULL,
#endif
0,
ONIGENC_FLAG_NONE,
};
Expand Down
4 changes: 4 additions & 0 deletions enc/gb18030.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,11 @@ OnigEncodingDefine(gb18030, GB18030) = {
onigenc_not_support_get_ctype_code_range,
gb18030_left_adjust_char_head,
gb18030_is_allowed_reverse_match,
#ifdef USE_CASE_MAP_API
onigenc_ascii_only_case_map,
#else
NULL,
#endif
0,
ONIGENC_FLAG_NONE,
};
4 changes: 4 additions & 0 deletions enc/gbk.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,11 @@ OnigEncodingDefine(gbk, GBK) = {
onigenc_not_support_get_ctype_code_range,
gbk_left_adjust_char_head,
gbk_is_allowed_reverse_match,
#ifdef USE_CASE_MAP_API
onigenc_ascii_only_case_map,
#else
NULL,
#endif
0,
ONIGENC_FLAG_NONE,
};
Expand Down
6 changes: 6 additions & 0 deletions enc/iso_8859_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSE
return FALSE;
}

#ifdef USE_CASE_MAP_API
static int
case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
Expand Down Expand Up @@ -297,6 +298,7 @@ case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
*flagP = flags;
return (int )(to - to_start);
}
#endif

OnigEncodingDefine(iso_8859_1, ISO_8859_1) = {
onigenc_single_byte_mbc_enc_len,
Expand All @@ -315,7 +317,11 @@ OnigEncodingDefine(iso_8859_1, ISO_8859_1) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
#ifdef USE_CASE_MAP_API
case_map,
#else
NULL,
#endif
0,
ONIGENC_FLAG_NONE,
};
Expand Down
6 changes: 6 additions & 0 deletions enc/iso_8859_10.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}

#ifdef USE_CASE_MAP_API
static int
case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
Expand Down Expand Up @@ -269,6 +270,7 @@ case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
*flagP = flags;
return (int )(to - to_start);
}
#endif

OnigEncodingDefine(iso_8859_10, ISO_8859_10) = {
onigenc_single_byte_mbc_enc_len,
Expand All @@ -287,7 +289,11 @@ OnigEncodingDefine(iso_8859_10, ISO_8859_10) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
#ifdef USE_CASE_MAP_API
case_map,
#else
NULL,
#endif
0,
ONIGENC_FLAG_NONE,
};
Expand Down
4 changes: 4 additions & 0 deletions enc/iso_8859_11.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ OnigEncodingDefine(iso_8859_11, ISO_8859_11) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
#ifdef USE_CASE_MAP_API
onigenc_single_byte_ascii_only_case_map,
#else
NULL,
#endif
0,
ONIGENC_FLAG_NONE,
};
Expand Down
6 changes: 6 additions & 0 deletions enc/iso_8859_13.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}

#ifdef USE_CASE_MAP_API
static int
case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
Expand Down Expand Up @@ -264,6 +265,7 @@ case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
*flagP = flags;
return (int )(to - to_start);
}
#endif

OnigEncodingDefine(iso_8859_13, ISO_8859_13) = {
onigenc_single_byte_mbc_enc_len,
Expand All @@ -282,7 +284,11 @@ OnigEncodingDefine(iso_8859_13, ISO_8859_13) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
#ifdef USE_CASE_MAP_API
case_map,
#else
NULL,
#endif
0,
ONIGENC_FLAG_NONE,
};
Expand Down
6 changes: 6 additions & 0 deletions enc/iso_8859_14.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}

#ifdef USE_CASE_MAP_API
static int
case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
Expand Down Expand Up @@ -280,6 +281,7 @@ case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
*flagP = flags;
return (int )(to - to_start);
}
#endif

OnigEncodingDefine(iso_8859_14, ISO_8859_14) = {
onigenc_single_byte_mbc_enc_len,
Expand All @@ -298,7 +300,11 @@ OnigEncodingDefine(iso_8859_14, ISO_8859_14) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
#ifdef USE_CASE_MAP_API
case_map,
#else
NULL,
#endif
0,
ONIGENC_FLAG_NONE,
};
Expand Down
6 changes: 6 additions & 0 deletions enc/iso_8859_15.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}

#ifdef USE_CASE_MAP_API
static int
case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
Expand Down Expand Up @@ -271,6 +272,7 @@ case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
*flagP = flags;
return (int )(to - to_start);
}
#endif

OnigEncodingDefine(iso_8859_15, ISO_8859_15) = {
onigenc_single_byte_mbc_enc_len,
Expand All @@ -289,7 +291,11 @@ OnigEncodingDefine(iso_8859_15, ISO_8859_15) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
#ifdef USE_CASE_MAP_API
case_map,
#else
NULL,
#endif
0,
ONIGENC_FLAG_NONE,
};
Expand Down
6 changes: 6 additions & 0 deletions enc/iso_8859_16.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}

#ifdef USE_CASE_MAP_API
static int
case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
Expand Down Expand Up @@ -275,6 +276,7 @@ case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
*flagP = flags;
return (int )(to - to_start);
}
#endif

OnigEncodingDefine(iso_8859_16, ISO_8859_16) = {
onigenc_single_byte_mbc_enc_len,
Expand All @@ -293,7 +295,11 @@ OnigEncodingDefine(iso_8859_16, ISO_8859_16) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
#ifdef USE_CASE_MAP_API
case_map,
#else
NULL,
#endif
0,
ONIGENC_FLAG_NONE,
};
Expand Down
6 changes: 6 additions & 0 deletions enc/iso_8859_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSE
return FALSE;
}

#ifdef USE_CASE_MAP_API
static int
case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
const OnigUChar* end, OnigUChar* to, OnigUChar* to_end,
Expand Down Expand Up @@ -266,6 +267,7 @@ case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
*flagP = flags;
return (int )(to - to_start);
}
#endif

OnigEncodingDefine(iso_8859_2, ISO_8859_2) = {
onigenc_single_byte_mbc_enc_len,
Expand All @@ -284,7 +286,11 @@ OnigEncodingDefine(iso_8859_2, ISO_8859_2) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
#ifdef USE_CASE_MAP_API
case_map,
#else
NULL,
#endif
0,
ONIGENC_FLAG_NONE,
};
Expand Down
6 changes: 6 additions & 0 deletions enc/iso_8859_3.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
flag, p, end, items);
}

#ifdef USE_CASE_MAP_API
#define DOTLESS_i (0xB9)
#define I_WITH_DOT_ABOVE (0xA9)
static int
Expand Down Expand Up @@ -276,6 +277,7 @@ case_map(OnigCaseFoldType* flagP, const OnigUChar** pp,
*flagP = flags;
return (int )(to - to_start);
}
#endif

OnigEncodingDefine(iso_8859_3, ISO_8859_3) = {
onigenc_single_byte_mbc_enc_len,
Expand All @@ -294,7 +296,11 @@ OnigEncodingDefine(iso_8859_3, ISO_8859_3) = {
onigenc_not_support_get_ctype_code_range,
onigenc_single_byte_left_adjust_char_head,
onigenc_always_true_is_allowed_reverse_match,
#ifdef USE_CASE_MAP_API
case_map,
#else
NULL,
#endif
0,
ONIGENC_FLAG_NONE,
};
Expand Down
Loading