mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
a4804fbdf5
* tool/gperf.sed: extracted sed commands to a script. ANSI-C code produced by gperf 3.1 declares length arguments as `size_t`. it causes conflict with existing declarations, and needs casts for a local variable and return statements. [Feature #13883] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
52 lines
1.1 KiB
C
52 lines
1.1 KiB
C
%{/* -*- c -*- */
|
|
#define GPERF_DOWNCASE 1
|
|
#define GPERF_CASE_STRNCMP 1
|
|
|
|
static inline int
|
|
gperf_case_strncmp(const char *s1, const char *s2, size_t n)
|
|
{
|
|
const UChar *str = (const UChar *)s1;
|
|
const UChar *s = (const UChar *)s2;
|
|
return onigenc_with_ascii_strnicmp(ONIG_ENCODING_ASCII, str, str + n, s, (int)n);
|
|
}
|
|
|
|
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};
|
|
|
|
static const OnigCodePoint* const PropertyList[PropertyListNum] = {
|
|
CR_Hiragana,
|
|
CR_Katakana,
|
|
CR_Han,
|
|
CR_Latin,
|
|
CR_Greek,
|
|
CR_Cyrillic,
|
|
};
|
|
|
|
struct enc_property {
|
|
signed char name;
|
|
unsigned char ctype;
|
|
};
|
|
|
|
/*!ANSI*/static const struct enc_property *onig_jis_property(const char *str, unsigned int len);
|
|
%}
|
|
|
|
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
|
|
%%
|