From: K.Kosako Date: Wed, 22 Aug 2018 01:34:53 +0000 (+0900) Subject: unicode_lookup_property_name() to be static X-Git-Tag: v6.9.0~40 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b7e0e9cd02ad2ce187bf6526f4f8dd56a050a567;p=onig unicode_lookup_property_name() to be static --- diff --git a/src/make_unicode_property.sh b/src/make_unicode_property.sh index 206b8cf..48466f4 100755 --- a/src/make_unicode_property.sh +++ b/src/make_unicode_property.sh @@ -7,14 +7,15 @@ GPERF=/usr/bin/gperf GPERF_OPT='-T -C -c -t -j1 -L ANSI-C --ignore-case --pic -Q unicode_prop_name_pool' POOL_CAST='s/\(int *\)\(size_t *\)&\(\(struct +unicode_prop_name_pool_t *\* *\) *0\)->unicode_prop_name_pool_str([^,]+)/pool_offset(\1)/g' +ADD_STATIC='s/(const +struct +PoolPropertyNameCtype +\*)/static \1/' ./make_unicode_property_data.py > ${NAME}.gperf ./make_unicode_property_data.py -posix > ${NAME}_posix.gperf ${GPERF} ${GPERF_OPT} -N unicode_lookup_property_name --output-file ${TMP1} ${NAME}.gperf -sed -e 's/^#line.*$//g' ${TMP1} | sed -r "${POOL_CAST}" > ${NAME}.c +sed -e 's/^#line.*$//g' ${TMP1} | sed -r "${POOL_CAST}" | sed -r "${ADD_STATIC}"> ${NAME}.c ${GPERF} ${GPERF_OPT} -N unicode_lookup_property_name --output-file ${TMP2} ${NAME}_posix.gperf -sed -e 's/^#line.*$//g' ${TMP2} | sed -r "${POOL_CAST}" > ${NAME}_posix.c +sed -e 's/^#line.*$//g' ${TMP2} | sed -r "${POOL_CAST}" | sed -r "${ADD_STATIC}" > ${NAME}_posix.c rm -f ${NAME}.gperf ${NAME}_posix.gperf ${TMP1} ${TMP2} diff --git a/src/regenc.h b/src/regenc.h index 31c6c6a..1ed5f72 100644 --- a/src/regenc.h +++ b/src/regenc.h @@ -160,7 +160,6 @@ extern int onigenc_mb4_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, UCh extern int onigenc_mb4_is_code_ctype P_((OnigEncoding enc, OnigCodePoint code, unsigned int ctype)); extern struct PropertyNameCtype* euc_jp_lookup_property_name P_((register const char *str, register unsigned int len)); extern struct PropertyNameCtype* sjis_lookup_property_name P_((register const char *str, register unsigned int len)); -/* extern const struct PropertyNameCtype* unicode_lookup_property_name P_((register const char *str, register size_t len)); */ /* in enc/unicode.c */ extern int onigenc_unicode_is_code_ctype P_((OnigCodePoint code, unsigned int ctype)); diff --git a/src/unicode_property_data.c b/src/unicode_property_data.c index 0fb2df1..ac02b1a 100644 --- a/src/unicode_property_data.c +++ b/src/unicode_property_data.c @@ -24470,7 +24470,7 @@ static const struct unicode_prop_name_pool_t unicode_prop_name_pool_contents = "graphemelink" }; #define unicode_prop_name_pool ((const char *) &unicode_prop_name_pool_contents) -const struct PoolPropertyNameCtype * +static const struct PoolPropertyNameCtype * unicode_lookup_property_name (register const char *str, register size_t len) { static const struct PoolPropertyNameCtype wordlist[] = diff --git a/src/unicode_property_data_posix.c b/src/unicode_property_data_posix.c index 2b98bfb..e2b80a5 100644 --- a/src/unicode_property_data_posix.c +++ b/src/unicode_property_data_posix.c @@ -4919,7 +4919,7 @@ static const struct unicode_prop_name_pool_t unicode_prop_name_pool_contents = "blank" }; #define unicode_prop_name_pool ((const char *) &unicode_prop_name_pool_contents) -const struct PoolPropertyNameCtype * +static const struct PoolPropertyNameCtype * unicode_lookup_property_name (register const char *str, register size_t len) { static const struct PoolPropertyNameCtype wordlist[] =