]> granicus.if.org Git - onig/commitdiff
add src/make_property.sh
authorK.Kosako <kosako@sofnec.co.jp>
Wed, 22 Aug 2018 05:50:49 +0000 (14:50 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Wed, 22 Aug 2018 05:50:49 +0000 (14:50 +0900)
src/Makefile.am
src/make_property.sh [new file with mode: 0755]

index c7a470566d789dcbaa474b7dfbf0597572ea7a12..24784e56bcee94a16d1da19e7d5e4bb462a9c422 100644 (file)
@@ -54,6 +54,7 @@ EXTRA_DIST = koi8.c mktable.c \
        make_unicode_egcb.sh make_unicode_egcb_data.py \
        make_unicode_fold.sh make_unicode_fold_data.py \
        make_unicode_property.sh make_unicode_property_data.py \
+       make_property.sh \
        gperf_fold_key_conv.py gperf_unfold_key_conv.py \
        unicode-7.0/unicode_fold1_key.c unicode-7.0/unicode_fold2_key.c \
        unicode-7.0/unicode_fold3_key.c unicode-7.0/unicode_fold_data.c \
diff --git a/src/make_property.sh b/src/make_property.sh
new file mode 100755 (executable)
index 0000000..071f3d0
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+TMP1=gperf1.tmp
+TMP2=gperf2.tmp
+GPERF=/usr/bin/gperf
+
+GPERF_OPT='-pt -T -L ANSI-C'
+
+ADD_CAST='s/return +len +\+ +asso_values/return (unsigned int )len + asso_values/'
+
+${GPERF} ${GPERF_OPT} -N onigenc_euc_jp_lookup_property_name --output-file ${TMP1} euc_jp_prop.gperf
+cat ${TMP1} | sed -r "${ADD_CAST}" > euc_jp_prop.c
+
+${GPERF} ${GPERF_OPT} -N onigenc_sjis_lookup_property_name --output-file ${TMP2} sjis_prop.gperf
+cat ${TMP2} | sed -r "${ADD_CAST}" > sjis_prop.c
+
+rm -f ${TMP1} ${TMP2}
+
+exit 0