]> granicus.if.org Git - onig/commitdiff
changes for gperf 3.0.4 => 3.1
authorK.Kosako <kosako@sofnec.co.jp>
Tue, 21 Aug 2018 09:28:35 +0000 (18:28 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Tue, 21 Aug 2018 09:28:35 +0000 (18:28 +0900)
src/gperf_fold_key_conv.py
src/gperf_unfold_key_conv.py
src/make_unicode_fold.sh
src/make_unicode_property.sh
src/regenc.h

index 59c5de9549f51caf7e04328b1a6b68f18155fe0f..376d343113fb0d1d5f9b907f48fa6803f90ce9d1 100755 (executable)
@@ -1,16 +1,16 @@
 #!/usr/bin/python
 # -*- coding: utf-8 -*-
 # gperf_fold_key_conv.py
-# Copyright (c) 2016-2017  K.Kosako
+# Copyright (c) 2016-2018  K.Kosako
 
 import sys
 import re
 
 REG_LINE_GPERF = re.compile('#line .+gperf"')
-REG_HASH_FUNC = re.compile('hash\s*\(register\s+const\s+char\s*\*\s*str,\s*register\s+unsigned\s+int\s+len\s*\)')
+REG_HASH_FUNC = re.compile('hash\s*\(register\s+const\s+char\s*\*\s*str,\s*register\s+size_t\s+len\s*\)')
 REG_STR_AT = re.compile('str\[(\d+)\]')
 REG_RETURN_TYPE = re.compile('^const\s+short\s+int\s*\*')
-REG_FOLD_KEY = re.compile('unicode_fold(\d)_key\s*\(register\s+const\s+char\s*\*\s*str,\s*register\s+unsigned\s+int\s+len\)')
+REG_FOLD_KEY = re.compile('unicode_fold(\d)_key\s*\(register\s+const\s+char\s*\*\s*str,\s*register\s+size_t\s+len\)')
 REG_ENTRY = re.compile('\{".*?",\s*(-?\d+)\s*\}')
 REG_IF_LEN = re.compile('if\s*\(\s*len\s*<=\s*MAX_WORD_LENGTH.+')
 REG_GET_HASH = re.compile('(?:register\s+)?(?:unsigned\s+)?int\s+key\s*=\s*hash\s*\(str,\s*len\);')
index 6f3ccb48ef12d4b5a44c6cf2770323197c1c6523..1d38bf4597da0c0cffeef87e8751d29b8a942b03 100755 (executable)
@@ -1,15 +1,15 @@
 #!/usr/bin/python
 # -*- coding: utf-8 -*-
 # gperf_unfold_key_conv.py
-# Copyright (c) 2016-2017  K.Kosako
+# Copyright (c) 2016-2018  K.Kosako
 
 import sys
 import re
 
 REG_LINE_GPERF = re.compile('#line .+gperf"')
-REG_HASH_FUNC = re.compile('hash\s*\(register\s+const\s+char\s*\*\s*str,\s*register\s+unsigned\s+int\s+len\s*\)')
+REG_HASH_FUNC = re.compile('hash\s*\(register\s+const\s+char\s*\*\s*str,\s*register\s+size_t\s+len\s*\)')
 REG_STR_AT = re.compile('str\[(\d+)\]')
-REG_UNFOLD_KEY = re.compile('unicode_unfold_key\s*\(register\s+const\s+char\s*\*\s*str,\s*register\s+unsigned\s+int\s+len\)')
+REG_UNFOLD_KEY = re.compile('unicode_unfold_key\s*\(register\s+const\s+char\s*\*\s*str,\s*register\s+size_t\s+len\)')
 REG_ENTRY = re.compile('\{".+?",\s*/\*(.+?)\*/\s*(-?\d+),\s*(\d)\}')
 REG_EMPTY_ENTRY = re.compile('\{"",\s*(-?\d+),\s*(\d)\}')
 REG_IF_LEN = re.compile('if\s*\(\s*len\s*<=\s*MAX_WORD_LENGTH.+')
index ddf1dd4de37a48195fc1bae24ca6a80eea297ecc..d92077c33314636482148379b75a9a56b2ccd5d0 100755 (executable)
@@ -1,22 +1,29 @@
 #!/bin/sh
 
-TMP=gperf.tmp
+GPERF=/usr/bin/gperf
+
+TMP0=gperf0.tmp
+TMP1=gperf1.tmp
+TMP2=gperf2.tmp
+TMP3=gperf3.tmp
+
 GPERF_OPT='-n -C -T -c -t -j1 -L ANSI-C '
 
 ./make_unicode_fold_data.py > unicode_fold_data.c
 
-gperf ${GPERF_OPT} -F,-1,0 -N unicode_unfold_key unicode_unfold_key.gperf > ${TMP}
-./gperf_unfold_key_conv.py < ${TMP} > unicode_unfold_key.c
+${GPERF} ${GPERF_OPT} -F,-1,0 -N unicode_unfold_key unicode_unfold_key.gperf > ${TMP0}
+./gperf_unfold_key_conv.py < ${TMP0} > unicode_unfold_key.c
 
-gperf ${GPERF_OPT} -F,-1 -N unicode_fold1_key unicode_fold1_key.gperf > ${TMP}
-./gperf_fold_key_conv.py 1 < ${TMP} > unicode_fold1_key.c
+${GPERF} ${GPERF_OPT} -F,-1 -N unicode_fold1_key unicode_fold1_key.gperf > ${TMP1}
+./gperf_fold_key_conv.py 1 < ${TMP1} > unicode_fold1_key.c
 
-gperf ${GPERF_OPT} -F,-1 -N unicode_fold2_key unicode_fold2_key.gperf > ${TMP}
-./gperf_fold_key_conv.py 2 < ${TMP} > unicode_fold2_key.c
+${GPERF} ${GPERF_OPT} -F,-1 -N unicode_fold2_key unicode_fold2_key.gperf > ${TMP2}
+./gperf_fold_key_conv.py 2 < ${TMP2} > unicode_fold2_key.c
 
-gperf ${GPERF_OPT} -F,-1 -N unicode_fold3_key unicode_fold3_key.gperf > ${TMP}
-./gperf_fold_key_conv.py 3 < ${TMP} > unicode_fold3_key.c
+${GPERF} ${GPERF_OPT} -F,-1 -N unicode_fold3_key unicode_fold3_key.gperf > ${TMP3}
+./gperf_fold_key_conv.py 3 < ${TMP3} > unicode_fold3_key.c
 
-rm -f ${TMP}
+rm -f ${TMP0} ${TMP1} ${TMP2} ${TMP3}
+rm -f unicode_unfold_key.gperf unicode_fold1_key.gperf unicode_fold2_key.gperf unicode_fold3_key.gperf
 
 exit 0
index 1e57674bee1b7fb12bb1cc44504b91ef1016a273..206b8cf6aceb95dab6318e8cc46d2156ca51da21 100755 (executable)
@@ -1,19 +1,21 @@
 #!/bin/sh
 
 NAME=unicode_property_data
-TMP=gperf.tmp
-#GPERF_OPT='-P -Q prop_name_pool -C -c -t -j1 -L ANSI-C --ignore-case'
+TMP1=gperf1.tmp
+TMP2=gperf2.tmp
+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 *\)\(long *\)&\(\(struct +unicode_prop_name_pool_t *\* *\) *0\)->unicode_prop_name_pool_str([^,]+)/pool_offset(\1)/g'
+POOL_CAST='s/\(int *\)\(size_t *\)&\(\(struct +unicode_prop_name_pool_t *\* *\) *0\)->unicode_prop_name_pool_str([^,]+)/pool_offset(\1)/g'
 
 ./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 ${TMP} ${NAME}.gperf
-sed -e 's/^#line.*$//g' ${TMP} | sed -r "${POOL_CAST}" > ${NAME}.c
-gperf ${GPERF_OPT} -N unicode_lookup_property_name --output-file ${TMP} ${NAME}_posix.gperf
-sed -e 's/^#line.*$//g' ${TMP} | sed -r "${POOL_CAST}" > ${NAME}_posix.c
+${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
+${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
 
-rm -f ${NAME}.gperf ${NAME}_posix.gperf ${TMP}
+rm -f ${NAME}.gperf ${NAME}_posix.gperf ${TMP1} ${TMP2}
 
 exit 0
index ae7a7740374a1a2c8a029d4c54b80d766ec0d044..31c6c6a78deaaac48db6f5182d99bd1d8c35fb31 100644 (file)
@@ -160,7 +160,7 @@ 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 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));