2014-05-22 09:02:15 +04:00
|
|
|
%{/* -*- c -*- */
|
|
|
|
#define GPERF_DOWNCASE 1
|
|
|
|
#define GPERF_CASE_STRNCMP 1
|
|
|
|
|
|
|
|
static inline int
|
2017-12-08 08:51:19 +03:00
|
|
|
gperf_case_strncmp(const char *s1, const char *s2, size_t n)
|
2014-05-22 09:02:15 +04:00
|
|
|
{
|
|
|
|
const UChar *str = (const UChar *)s1;
|
|
|
|
const UChar *s = (const UChar *)s2;
|
2017-12-08 08:51:19 +03:00
|
|
|
return onigenc_with_ascii_strnicmp(ONIG_ENCODING_ASCII, str, str + n, s, (int)n);
|
2014-05-22 09:02:15 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
enum onigenc_jis_ctype {
|
|
|
|
onigenc_jis_min = ONIGENC_MAX_STD_CTYPE,
|
|
|
|
onigenc_jis_hiragana,
|
|
|
|
onigenc_jis_katakana,
|
|
|
|
onigenc_jis_han,
|
|
|
|
onigenc_jis_latin,
|
|
|
|
onigenc_jis_greek,
|
|
|
|
onigenc_jis_cyrillic,
|
|
|
|
onigenc_jis_max
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {PropertyListNum = onigenc_jis_max - onigenc_jis_min - 1};
|
|
|
|
|
2014-05-22 18:34:58 +04:00
|
|
|
static const OnigCodePoint* const PropertyList[PropertyListNum] = {
|
2014-05-22 09:02:15 +04:00
|
|
|
CR_Hiragana,
|
|
|
|
CR_Katakana,
|
|
|
|
CR_Han,
|
|
|
|
CR_Latin,
|
|
|
|
CR_Greek,
|
|
|
|
CR_Cyrillic,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct enc_property {
|
|
|
|
signed char name;
|
|
|
|
unsigned char ctype;
|
|
|
|
};
|
|
|
|
|
2017-12-15 17:42:43 +03:00
|
|
|
static const struct enc_property *onig_jis_property(/*!ANSI{*/const char *str, unsigned int len/*}!ANSI*/);
|
2014-05-22 09:02:15 +04:00
|
|
|
%}
|
|
|
|
|
|
|
|
struct enc_property;
|
|
|
|
|
|
|
|
%%
|
|
|
|
hiragana, onigenc_jis_hiragana
|
|
|
|
katakana, onigenc_jis_katakana
|
|
|
|
han, onigenc_jis_han
|
|
|
|
latin, onigenc_jis_latin
|
|
|
|
greek, onigenc_jis_greek
|
|
|
|
cyrillic, onigenc_jis_cyrillic
|
|
|
|
%%
|