@port-labs/jq-node-bindings 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/binding.gyp +3 -3
- package/configure +8 -6
- package/deps/jq/.travis.yml +184 -35
- package/deps/jq/AUTHORS +31 -30
- package/deps/jq/COPYING +2 -2
- package/deps/jq/KEYS +8 -0
- package/deps/jq/Makefile.am +85 -70
- package/deps/jq/NEWS +5 -4
- package/deps/jq/README.md +18 -9
- package/deps/jq/appveyor.yml +53 -0
- package/deps/jq/compile-ios.sh +5 -5
- package/deps/jq/config/m4/check-math-func.m4 +7 -2
- package/deps/jq/configure.ac +130 -68
- package/deps/jq/docs/Rakefile +14 -135
- package/deps/jq/docs/Rakefile.manual +49 -0
- package/deps/jq/docs/Rakefile.website +76 -0
- package/deps/jq/docs/content/2.download/default.yml +115 -39
- package/deps/jq/docs/content/3.manual/manual.yml +641 -231
- package/deps/jq/docs/content/3.manual/v1.3/manual.yml +130 -130
- package/deps/jq/docs/content/3.manual/v1.4/manual.yml +160 -160
- package/deps/jq/docs/content/3.manual/v1.5/manual.yml +2878 -0
- package/deps/jq/docs/content/3.manual/v1.6/manual.yml +3287 -0
- package/deps/jq/docs/content/index/index.yml +28 -6
- package/deps/jq/docs/public/.htaccess +2 -2
- package/deps/jq/docs/public/css/base.scss +141 -59
- package/deps/jq/docs/public/js/manual-search.js +52 -0
- package/deps/jq/docs/site.yml +1 -10
- package/deps/jq/docs/templates/default.liquid +10 -10
- package/deps/jq/docs/templates/index.liquid +45 -32
- package/deps/jq/docs/templates/manual.liquid +67 -90
- package/deps/jq/docs/templates/shared/_footer.liquid +10 -5
- package/deps/jq/docs/templates/shared/_head.liquid +17 -12
- package/deps/jq/docs/templates/shared/_navbar.liquid +27 -0
- package/deps/jq/jq.1.prebuilt +523 -139
- package/deps/jq/modules/oniguruma/AUTHORS +1 -0
- package/deps/jq/modules/oniguruma/CMakeLists.txt +86 -0
- package/deps/jq/modules/oniguruma/COPYING +28 -0
- package/deps/jq/modules/oniguruma/ChangeLog +0 -0
- package/deps/jq/modules/oniguruma/HISTORY +2138 -0
- package/deps/jq/modules/oniguruma/Makefile.am +33 -0
- package/deps/jq/modules/oniguruma/NEWS +0 -0
- package/deps/jq/modules/oniguruma/README +189 -0
- package/deps/jq/modules/oniguruma/README.ja +195 -0
- package/deps/jq/modules/oniguruma/README.md +203 -0
- package/deps/jq/modules/oniguruma/cmake/dist.cmake +321 -0
- package/deps/jq/modules/oniguruma/compile +348 -0
- package/deps/jq/modules/oniguruma/config.guess +1754 -0
- package/deps/jq/modules/oniguruma/config.sub +1890 -0
- package/deps/jq/modules/oniguruma/configure.ac +87 -0
- package/deps/jq/modules/oniguruma/contributed/libfuzzer-onig.cpp +31 -0
- package/deps/jq/modules/oniguruma/depcomp +791 -0
- package/deps/jq/modules/oniguruma/dist.info +10 -0
- package/deps/jq/modules/oniguruma/doc/API +660 -0
- package/deps/jq/modules/oniguruma/doc/API.ja +667 -0
- package/deps/jq/modules/oniguruma/doc/FAQ +12 -0
- package/deps/jq/modules/oniguruma/doc/FAQ.ja +22 -0
- package/deps/jq/modules/oniguruma/doc/RE +436 -0
- package/deps/jq/modules/oniguruma/doc/RE.ja +448 -0
- package/deps/jq/modules/oniguruma/doc/UNICODE_PROPERTIES +698 -0
- package/deps/jq/modules/oniguruma/index.html +181 -0
- package/deps/jq/modules/oniguruma/index_ja.html +184 -0
- package/deps/jq/modules/oniguruma/install-sh +541 -0
- package/deps/jq/modules/oniguruma/m4/.whatever +0 -0
- package/deps/jq/modules/oniguruma/make_win32.bat +3 -0
- package/deps/jq/modules/oniguruma/make_win64.bat +3 -0
- package/deps/jq/modules/oniguruma/missing +215 -0
- package/deps/jq/modules/oniguruma/onig-config.in +78 -0
- package/deps/jq/modules/oniguruma/oniguruma.pc.cmake.in +13 -0
- package/deps/jq/modules/oniguruma/oniguruma.pc.in +14 -0
- package/deps/jq/modules/oniguruma/sample/CMakeLists.txt +28 -0
- package/deps/jq/modules/oniguruma/sample/Makefile.am +34 -0
- package/deps/jq/modules/oniguruma/sample/bug_fix.c +131 -0
- package/deps/jq/modules/oniguruma/sample/crnl.c +127 -0
- package/deps/jq/modules/oniguruma/sample/encode.c +308 -0
- package/deps/jq/modules/oniguruma/sample/listcap.c +110 -0
- package/deps/jq/modules/oniguruma/sample/names.c +75 -0
- package/deps/jq/modules/oniguruma/sample/posix.c +96 -0
- package/deps/jq/modules/oniguruma/sample/scan.c +88 -0
- package/deps/jq/modules/oniguruma/sample/simple.c +59 -0
- package/deps/jq/modules/oniguruma/sample/sql.c +76 -0
- package/deps/jq/modules/oniguruma/sample/syntax.c +76 -0
- package/deps/jq/modules/oniguruma/sample/user_property.c +87 -0
- package/deps/jq/modules/oniguruma/src/Makefile.am +58 -0
- package/deps/jq/modules/oniguruma/src/Makefile.windows +183 -0
- package/deps/jq/modules/oniguruma/src/ascii.c +61 -0
- package/deps/jq/modules/oniguruma/src/big5.c +190 -0
- package/deps/jq/modules/oniguruma/src/config.h.cmake.in +71 -0
- package/deps/jq/modules/oniguruma/src/config.h.win32 +84 -0
- package/deps/jq/modules/oniguruma/src/config.h.win64 +84 -0
- package/deps/jq/modules/oniguruma/src/cp1251.c +203 -0
- package/deps/jq/modules/oniguruma/src/euc_jp.c +310 -0
- package/deps/jq/modules/oniguruma/src/euc_jp_prop.c +158 -0
- package/deps/jq/modules/oniguruma/src/euc_jp_prop.gperf +27 -0
- package/deps/jq/modules/oniguruma/src/euc_kr.c +188 -0
- package/deps/jq/modules/oniguruma/src/euc_tw.c +171 -0
- package/deps/jq/modules/oniguruma/src/gb18030.c +538 -0
- package/deps/jq/modules/oniguruma/src/gperf_fold_key_conv.py +67 -0
- package/deps/jq/modules/oniguruma/src/gperf_unfold_key_conv.py +55 -0
- package/deps/jq/modules/oniguruma/src/iso8859_1.c +275 -0
- package/deps/jq/modules/oniguruma/src/iso8859_10.c +242 -0
- package/deps/jq/modules/oniguruma/src/iso8859_11.c +99 -0
- package/deps/jq/modules/oniguruma/src/iso8859_13.c +231 -0
- package/deps/jq/modules/oniguruma/src/iso8859_14.c +244 -0
- package/deps/jq/modules/oniguruma/src/iso8859_15.c +238 -0
- package/deps/jq/modules/oniguruma/src/iso8859_16.c +240 -0
- package/deps/jq/modules/oniguruma/src/iso8859_2.c +238 -0
- package/deps/jq/modules/oniguruma/src/iso8859_3.c +238 -0
- package/deps/jq/modules/oniguruma/src/iso8859_4.c +240 -0
- package/deps/jq/modules/oniguruma/src/iso8859_5.c +229 -0
- package/deps/jq/modules/oniguruma/src/iso8859_6.c +99 -0
- package/deps/jq/modules/oniguruma/src/iso8859_7.c +225 -0
- package/deps/jq/modules/oniguruma/src/iso8859_8.c +99 -0
- package/deps/jq/modules/oniguruma/src/iso8859_9.c +231 -0
- package/deps/jq/modules/oniguruma/src/koi8.c +253 -0
- package/deps/jq/modules/oniguruma/src/koi8_r.c +215 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_fold.sh +22 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_fold_data.py +306 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_property.sh +18 -0
- package/deps/jq/modules/oniguruma/src/make_unicode_property_data.py +545 -0
- package/deps/jq/modules/oniguruma/src/mktable.c +1184 -0
- package/deps/jq/modules/oniguruma/src/onig_init.c +45 -0
- package/deps/jq/modules/oniguruma/src/oniggnu.h +85 -0
- package/deps/jq/modules/oniguruma/src/onigposix.h +169 -0
- package/deps/jq/modules/oniguruma/src/oniguruma.h +841 -0
- package/deps/jq/modules/oniguruma/src/regcomp.c +6300 -0
- package/deps/jq/modules/oniguruma/src/regenc.c +917 -0
- package/deps/jq/modules/oniguruma/src/regenc.h +243 -0
- package/deps/jq/modules/oniguruma/src/regerror.c +393 -0
- package/deps/jq/modules/oniguruma/src/regexec.c +3856 -0
- package/deps/jq/modules/oniguruma/src/regext.c +202 -0
- package/deps/jq/modules/oniguruma/src/reggnu.c +147 -0
- package/deps/jq/modules/oniguruma/src/regint.h +779 -0
- package/deps/jq/modules/oniguruma/src/regparse.c +5403 -0
- package/deps/jq/modules/oniguruma/src/regparse.h +351 -0
- package/deps/jq/modules/oniguruma/src/regposerr.c +105 -0
- package/deps/jq/modules/oniguruma/src/regposix.c +306 -0
- package/deps/jq/modules/oniguruma/src/regsyntax.c +315 -0
- package/deps/jq/modules/oniguruma/src/regtrav.c +76 -0
- package/deps/jq/modules/oniguruma/src/regversion.c +57 -0
- package/deps/jq/modules/oniguruma/src/sjis.c +341 -0
- package/deps/jq/modules/oniguruma/src/sjis_prop.c +158 -0
- package/deps/jq/modules/oniguruma/src/sjis_prop.gperf +27 -0
- package/deps/jq/modules/oniguruma/src/st.c +589 -0
- package/deps/jq/modules/oniguruma/src/st.h +68 -0
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold1_key.c +2250 -0
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold2_key.c +203 -0
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold3_key.c +113 -0
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_fold_data.c +1225 -0
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_property_data.c +24742 -0
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_property_data_posix.c +4846 -0
- package/deps/jq/modules/oniguruma/src/unicode-7.0/unicode_unfold_key.c +2571 -0
- package/deps/jq/modules/oniguruma/src/unicode.c +664 -0
- package/deps/jq/modules/oniguruma/src/unicode_fold1_key.c +2548 -0
- package/deps/jq/modules/oniguruma/src/unicode_fold2_key.c +203 -0
- package/deps/jq/modules/oniguruma/src/unicode_fold3_key.c +113 -0
- package/deps/jq/modules/oniguruma/src/unicode_fold_data.c +1366 -0
- package/deps/jq/modules/oniguruma/src/unicode_property_data.c +25306 -0
- package/deps/jq/modules/oniguruma/src/unicode_property_data_posix.c +4940 -0
- package/deps/jq/modules/oniguruma/src/unicode_unfold_key.c +2854 -0
- package/deps/jq/modules/oniguruma/src/utf16_be.c +235 -0
- package/deps/jq/modules/oniguruma/src/utf16_le.c +245 -0
- package/deps/jq/modules/oniguruma/src/utf32_be.c +194 -0
- package/deps/jq/modules/oniguruma/src/utf32_le.c +194 -0
- package/deps/jq/modules/oniguruma/src/utf8.c +335 -0
- package/deps/jq/modules/oniguruma/test/Makefile.am +28 -0
- package/deps/jq/modules/oniguruma/test/testc.c +874 -0
- package/deps/jq/modules/oniguruma/test/testu.c +916 -0
- package/deps/jq/modules/oniguruma/test-driver +153 -0
- package/deps/jq/modules/oniguruma/windows/testc.c +869 -0
- package/deps/jq/scripts/crosscompile +2 -1
- package/deps/jq/scripts/gen_utf8_tables.py +2 -3
- package/deps/jq/scripts/update-website +29 -0
- package/deps/jq/scripts/version +7 -2
- package/deps/jq/sig/jq-release.key +41 -0
- package/deps/jq/sig/v1.3/jq-linux-x86.asc +17 -0
- package/deps/jq/sig/v1.3/jq-linux-x86_64.asc +17 -0
- package/deps/jq/sig/v1.3/jq-osx-x86.asc +17 -0
- package/deps/jq/sig/v1.3/jq-osx-x86_64.asc +17 -0
- package/deps/jq/sig/v1.3/jq-win32.exe.asc +17 -0
- package/deps/jq/sig/v1.3/jq-win64.exe.asc +17 -0
- package/deps/jq/sig/v1.3/sha256sum.txt +6 -0
- package/deps/jq/sig/v1.4/jq-linux-x86.asc +17 -0
- package/deps/jq/sig/v1.4/jq-linux-x86_64.asc +17 -0
- package/deps/jq/sig/v1.4/jq-osx-x86.asc +17 -0
- package/deps/jq/sig/v1.4/jq-osx-x86_64.asc +17 -0
- package/deps/jq/sig/v1.4/jq-solaris11-32.asc +17 -0
- package/deps/jq/sig/v1.4/jq-solaris11-64.asc +17 -0
- package/deps/jq/sig/v1.4/jq-win32.exe.asc +17 -0
- package/deps/jq/sig/v1.4/jq-win64.exe.asc +17 -0
- package/deps/jq/sig/v1.4/sha256sum.txt +8 -0
- package/deps/jq/sig/v1.5/jq-linux32-no-oniguruma.asc +17 -0
- package/deps/jq/sig/v1.5/jq-linux32.asc +17 -0
- package/deps/jq/sig/v1.5/jq-linux64.asc +17 -0
- package/deps/jq/sig/v1.5/jq-osx-amd64.asc +17 -0
- package/deps/jq/sig/v1.5/jq-win32.exe.asc +17 -0
- package/deps/jq/sig/v1.5/jq-win64.exe.asc +17 -0
- package/deps/jq/sig/v1.5/sha256sum.txt +5 -0
- package/deps/jq/sig/v1.5rc1/jq-linux-x86_64-static.asc +17 -0
- package/deps/jq/sig/v1.5rc1/jq-win32.exe.asc +17 -0
- package/deps/jq/sig/v1.5rc1/jq-win64.exe.asc +17 -0
- package/deps/jq/sig/v1.5rc1/sha256sum.txt +3 -0
- package/deps/jq/sig/v1.5rc2/jq-linux-x86.asc +17 -0
- package/deps/jq/sig/v1.5rc2/jq-linux-x86_64.asc +17 -0
- package/deps/jq/sig/v1.5rc2/jq-osx-x86_64.asc +17 -0
- package/deps/jq/sig/v1.5rc2/jq-win32.exe.asc +17 -0
- package/deps/jq/sig/v1.5rc2/jq-win64.exe.asc +17 -0
- package/deps/jq/sig/v1.5rc2/sha256sum.txt +5 -0
- package/deps/jq/sig/v1.6/jq-linux32.asc +16 -0
- package/deps/jq/sig/v1.6/jq-linux64.asc +16 -0
- package/deps/jq/sig/v1.6/jq-osx-amd64.asc +16 -0
- package/deps/jq/sig/v1.6/jq-win32.exe.asc +16 -0
- package/deps/jq/sig/v1.6/jq-win64.exe.asc +16 -0
- package/deps/jq/sig/v1.6/sha256sum.txt +5 -0
- package/deps/jq/{builtin.c → src/builtin.c} +449 -344
- package/deps/jq/{builtin.h → src/builtin.h} +0 -0
- package/deps/jq/src/builtin.jq +311 -0
- package/deps/jq/{bytecode.c → src/bytecode.c} +0 -0
- package/deps/jq/{bytecode.h → src/bytecode.h} +0 -0
- package/deps/jq/{compile.c → src/compile.c} +213 -37
- package/deps/jq/{compile.h → src/compile.h} +7 -2
- package/deps/jq/{exec_stack.h → src/exec_stack.h} +0 -0
- package/deps/jq/{execute.c → src/execute.c} +127 -24
- package/deps/jq/{inject_errors.c → src/inject_errors.c} +0 -0
- package/deps/jq/{jq.h → src/jq.h} +13 -2
- package/deps/jq/{jq_parser.h → src/jq_parser.h} +0 -0
- package/deps/jq/{jq_test.c → src/jq_test.c} +1 -1
- package/deps/jq/{jv.c → src/jv.c} +24 -5
- package/deps/jq/{jv.h → src/jv.h} +46 -11
- package/deps/jq/{jv_alloc.c → src/jv_alloc.c} +0 -0
- package/deps/jq/{jv_alloc.h → src/jv_alloc.h} +0 -0
- package/deps/jq/{jv_aux.c → src/jv_aux.c} +38 -14
- package/deps/jq/{jv_dtoa.c → src/jv_dtoa.c} +4 -5
- package/deps/jq/{jv_dtoa.h → src/jv_dtoa.h} +0 -0
- package/deps/jq/src/jv_file.c +81 -0
- package/deps/jq/{jv_parse.c → src/jv_parse.c} +8 -2
- package/deps/jq/{jv_print.c → src/jv_print.c} +80 -27
- package/deps/jq/{jv_unicode.c → src/jv_unicode.c} +28 -4
- package/deps/jq/{jv_unicode.h → src/jv_unicode.h} +1 -0
- package/deps/jq/{jv_utf8_tables.h → src/jv_utf8_tables.h} +0 -0
- package/deps/jq/{lexer.c → src/lexer.c} +317 -292
- package/deps/jq/{lexer.h → src/lexer.h} +16 -12
- package/deps/jq/{lexer.l → src/lexer.l} +5 -4
- package/deps/jq/src/libm.h +291 -0
- package/deps/jq/{linker.c → src/linker.c} +5 -3
- package/deps/jq/{linker.h → src/linker.h} +0 -0
- package/deps/jq/{locfile.c → src/locfile.c} +1 -1
- package/deps/jq/{locfile.h → src/locfile.h} +0 -0
- package/deps/jq/{main.c → src/main.c} +202 -100
- package/deps/jq/{opcode_list.h → src/opcode_list.h} +4 -0
- package/deps/jq/{parser.c → src/parser.c} +1149 -1069
- package/deps/jq/{parser.h → src/parser.h} +28 -24
- package/deps/jq/{parser.y → src/parser.y} +108 -52
- package/deps/jq/{util.c → src/util.c} +12 -9
- package/deps/jq/{util.h → src/util.h} +0 -0
- package/deps/jq/tests/base64.test +35 -0
- package/deps/jq/tests/base64test +5 -0
- package/deps/jq/tests/jq-f-test.sh +4 -0
- package/deps/jq/tests/jq.test +305 -21
- package/deps/jq/tests/jqtest +1 -1
- package/deps/jq/tests/mantest +1 -1
- package/deps/jq/tests/onig.test +13 -0
- package/deps/jq/tests/onigtest +1 -1
- package/deps/jq/tests/optional.test +20 -0
- package/deps/jq/tests/optionaltest +5 -0
- package/deps/jq/tests/setup +7 -1
- package/deps/jq/tests/shtest +133 -29
- package/deps/jq/tests/utf8-truncate.jq +3 -0
- package/deps/jq/tests/utf8test +10 -0
- package/lib/index.js +7 -1
- package/package.json +3 -3
- package/test/santiy.test.js +24 -0
- package/deps/jq/docs/default_manpage.md +0 -22
- package/deps/jq/docs/public/bootstrap/css/bootstrap-responsive.css +0 -1058
- package/deps/jq/docs/public/bootstrap/css/bootstrap-responsive.min.css +0 -9
- package/deps/jq/docs/public/bootstrap/css/bootstrap.css +0 -5224
- package/deps/jq/docs/public/bootstrap/css/bootstrap.min.css +0 -9
- package/deps/jq/docs/public/bootstrap/img/glyphicons-halflings-white.png +0 -0
- package/deps/jq/docs/public/bootstrap/img/glyphicons-halflings.png +0 -0
- package/deps/jq/docs/public/bootstrap/js/bootstrap.js +0 -2027
- package/deps/jq/docs/public/bootstrap/js/bootstrap.min.js +0 -6
- package/deps/jq/docs/templates/shared/_header.liquid +0 -26
- package/deps/jq/jq.1.default +0 -39
- package/deps/jq/jv_file.c +0 -49
- package/deps/jq/libm.h +0 -160
- package/deps/jq/setup.sh +0 -33
- package/reports/jest-port-api.xml +0 -35
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**********************************************************************
|
|
2
|
+
regversion.c - Oniguruma (regular expression library)
|
|
3
|
+
**********************************************************************/
|
|
4
|
+
/*-
|
|
5
|
+
* Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
|
6
|
+
* All rights reserved.
|
|
7
|
+
*
|
|
8
|
+
* Redistribution and use in source and binary forms, with or without
|
|
9
|
+
* modification, are permitted provided that the following conditions
|
|
10
|
+
* are met:
|
|
11
|
+
* 1. Redistributions of source code must retain the above copyright
|
|
12
|
+
* notice, this list of conditions and the following disclaimer.
|
|
13
|
+
* 2. Redistributions in binary form must reproduce the above copyright
|
|
14
|
+
* notice, this list of conditions and the following disclaimer in the
|
|
15
|
+
* documentation and/or other materials provided with the distribution.
|
|
16
|
+
*
|
|
17
|
+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
18
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
19
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
20
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
21
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
22
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
23
|
+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
24
|
+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
25
|
+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
26
|
+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
27
|
+
* SUCH DAMAGE.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
#include "config.h"
|
|
31
|
+
#include "regint.h"
|
|
32
|
+
#include <stdio.h>
|
|
33
|
+
|
|
34
|
+
extern const char*
|
|
35
|
+
onig_version(void)
|
|
36
|
+
{
|
|
37
|
+
static char s[12];
|
|
38
|
+
|
|
39
|
+
xsnprintf(s, sizeof(s), "%d.%d.%d",
|
|
40
|
+
ONIGURUMA_VERSION_MAJOR,
|
|
41
|
+
ONIGURUMA_VERSION_MINOR,
|
|
42
|
+
ONIGURUMA_VERSION_TEENY);
|
|
43
|
+
return s;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
extern const char*
|
|
47
|
+
onig_copyright(void)
|
|
48
|
+
{
|
|
49
|
+
static char s[58];
|
|
50
|
+
|
|
51
|
+
xsnprintf(s, sizeof(s),
|
|
52
|
+
"Oniguruma %d.%d.%d : Copyright (C) 2002-2016 K.Kosako",
|
|
53
|
+
ONIGURUMA_VERSION_MAJOR,
|
|
54
|
+
ONIGURUMA_VERSION_MINOR,
|
|
55
|
+
ONIGURUMA_VERSION_TEENY);
|
|
56
|
+
return s;
|
|
57
|
+
}
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
/**********************************************************************
|
|
2
|
+
sjis.c - Oniguruma (regular expression library)
|
|
3
|
+
**********************************************************************/
|
|
4
|
+
/*-
|
|
5
|
+
* Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
|
6
|
+
* All rights reserved.
|
|
7
|
+
*
|
|
8
|
+
* Redistribution and use in source and binary forms, with or without
|
|
9
|
+
* modification, are permitted provided that the following conditions
|
|
10
|
+
* are met:
|
|
11
|
+
* 1. Redistributions of source code must retain the above copyright
|
|
12
|
+
* notice, this list of conditions and the following disclaimer.
|
|
13
|
+
* 2. Redistributions in binary form must reproduce the above copyright
|
|
14
|
+
* notice, this list of conditions and the following disclaimer in the
|
|
15
|
+
* documentation and/or other materials provided with the distribution.
|
|
16
|
+
*
|
|
17
|
+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
18
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
19
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
20
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
21
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
22
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
23
|
+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
24
|
+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
25
|
+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
26
|
+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
27
|
+
* SUCH DAMAGE.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
#include "regint.h"
|
|
31
|
+
|
|
32
|
+
static const int EncLen_SJIS[] = {
|
|
33
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
34
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
35
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
36
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
37
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
38
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
39
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
40
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
41
|
+
1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
|
42
|
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
|
43
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
44
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
45
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
46
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
47
|
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
|
48
|
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
static const char SJIS_CAN_BE_TRAIL_TABLE[256] = {
|
|
52
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
53
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
54
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
55
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
56
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
57
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
58
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
59
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
|
|
60
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
61
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
62
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
63
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
64
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
65
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
66
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
67
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
#define SJIS_ISMB_FIRST(byte) (EncLen_SJIS[byte] > 1)
|
|
71
|
+
#define SJIS_ISMB_TRAIL(byte) SJIS_CAN_BE_TRAIL_TABLE[(byte)]
|
|
72
|
+
|
|
73
|
+
static int
|
|
74
|
+
mbc_enc_len(const UChar* p)
|
|
75
|
+
{
|
|
76
|
+
return EncLen_SJIS[*p];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
static int
|
|
80
|
+
is_valid_mbc_string(const UChar* p, const UChar* end)
|
|
81
|
+
{
|
|
82
|
+
while (p < end) {
|
|
83
|
+
if (*p < 0x80) {
|
|
84
|
+
p++;
|
|
85
|
+
}
|
|
86
|
+
else if (*p < 0xa1) {
|
|
87
|
+
if (*p == 0xa0 || *p == 0x80)
|
|
88
|
+
return FALSE;
|
|
89
|
+
p++;
|
|
90
|
+
if (p >= end) return FALSE;
|
|
91
|
+
if (*p < 0x40 || *p > 0xfc || *p == 0x7f)
|
|
92
|
+
return FALSE;
|
|
93
|
+
p++;
|
|
94
|
+
}
|
|
95
|
+
else if (*p < 0xe0) {
|
|
96
|
+
p++;
|
|
97
|
+
}
|
|
98
|
+
else if (*p < 0xfd) {
|
|
99
|
+
p++;
|
|
100
|
+
if (p >= end) return FALSE;
|
|
101
|
+
if (*p < 0x40 || *p > 0xfc || *p == 0x7f)
|
|
102
|
+
return FALSE;
|
|
103
|
+
p++;
|
|
104
|
+
}
|
|
105
|
+
else
|
|
106
|
+
return FALSE;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return TRUE;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
static int
|
|
113
|
+
code_to_mbclen(OnigCodePoint code)
|
|
114
|
+
{
|
|
115
|
+
if (code < 256) {
|
|
116
|
+
if (EncLen_SJIS[(int )code] == 1)
|
|
117
|
+
return 1;
|
|
118
|
+
else
|
|
119
|
+
return 0;
|
|
120
|
+
}
|
|
121
|
+
else if (code <= 0xffff) {
|
|
122
|
+
return 2;
|
|
123
|
+
}
|
|
124
|
+
else
|
|
125
|
+
return ONIGERR_INVALID_CODE_POINT_VALUE;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
static OnigCodePoint
|
|
129
|
+
mbc_to_code(const UChar* p, const UChar* end)
|
|
130
|
+
{
|
|
131
|
+
int c, i, len;
|
|
132
|
+
OnigCodePoint n;
|
|
133
|
+
|
|
134
|
+
len = enclen(ONIG_ENCODING_SJIS, p);
|
|
135
|
+
c = *p++;
|
|
136
|
+
n = c;
|
|
137
|
+
if (len == 1) return n;
|
|
138
|
+
|
|
139
|
+
for (i = 1; i < len; i++) {
|
|
140
|
+
if (p >= end) break;
|
|
141
|
+
c = *p++;
|
|
142
|
+
n <<= 8; n += c;
|
|
143
|
+
}
|
|
144
|
+
return n;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
static int
|
|
148
|
+
code_to_mbc(OnigCodePoint code, UChar *buf)
|
|
149
|
+
{
|
|
150
|
+
UChar *p = buf;
|
|
151
|
+
|
|
152
|
+
if ((code & 0xff00) != 0) *p++ = (UChar )(((code >> 8) & 0xff));
|
|
153
|
+
*p++ = (UChar )(code & 0xff);
|
|
154
|
+
|
|
155
|
+
#if 0
|
|
156
|
+
if (enclen(ONIG_ENCODING_SJIS, buf) != (p - buf))
|
|
157
|
+
return REGERR_INVALID_CODE_POINT_VALUE;
|
|
158
|
+
#endif
|
|
159
|
+
return p - buf;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
static int
|
|
163
|
+
mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED,
|
|
164
|
+
const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower)
|
|
165
|
+
{
|
|
166
|
+
const UChar* p = *pp;
|
|
167
|
+
|
|
168
|
+
if (ONIGENC_IS_MBC_ASCII(p)) {
|
|
169
|
+
*lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);
|
|
170
|
+
(*pp)++;
|
|
171
|
+
return 1;
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
int i;
|
|
175
|
+
int len = enclen(ONIG_ENCODING_SJIS, p);
|
|
176
|
+
|
|
177
|
+
for (i = 0; i < len; i++) {
|
|
178
|
+
*lower++ = *p++;
|
|
179
|
+
}
|
|
180
|
+
(*pp) += len;
|
|
181
|
+
return len; /* return byte length of converted char to lower */
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
#if 0
|
|
186
|
+
static int
|
|
187
|
+
is_mbc_ambiguous(OnigCaseFoldType flag,
|
|
188
|
+
const UChar** pp, const UChar* end)
|
|
189
|
+
{
|
|
190
|
+
return onigenc_mbn_is_mbc_ambiguous(ONIG_ENCODING_SJIS, flag, pp, end);
|
|
191
|
+
|
|
192
|
+
}
|
|
193
|
+
#endif
|
|
194
|
+
|
|
195
|
+
#if 0
|
|
196
|
+
static int
|
|
197
|
+
is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
|
198
|
+
{
|
|
199
|
+
if (code < 128)
|
|
200
|
+
return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);
|
|
201
|
+
else {
|
|
202
|
+
if (CTYPE_IS_WORD_GRAPH_PRINT(ctype)) {
|
|
203
|
+
return (code_to_mbclen(code) > 1 ? TRUE : FALSE);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return FALSE;
|
|
208
|
+
}
|
|
209
|
+
#endif
|
|
210
|
+
|
|
211
|
+
static UChar*
|
|
212
|
+
left_adjust_char_head(const UChar* start, const UChar* s)
|
|
213
|
+
{
|
|
214
|
+
const UChar *p;
|
|
215
|
+
int len;
|
|
216
|
+
|
|
217
|
+
if (s <= start) return (UChar* )s;
|
|
218
|
+
p = s;
|
|
219
|
+
|
|
220
|
+
if (SJIS_ISMB_TRAIL(*p)) {
|
|
221
|
+
while (p > start) {
|
|
222
|
+
if (! SJIS_ISMB_FIRST(*--p)) {
|
|
223
|
+
p++;
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
len = enclen(ONIG_ENCODING_SJIS, p);
|
|
229
|
+
if (p + len > s) return (UChar* )p;
|
|
230
|
+
p += len;
|
|
231
|
+
return (UChar* )(p + ((s - p) & ~1));
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
static int
|
|
235
|
+
is_allowed_reverse_match(const UChar* s, const UChar* end ARG_UNUSED)
|
|
236
|
+
{
|
|
237
|
+
const UChar c = *s;
|
|
238
|
+
return (SJIS_ISMB_TRAIL(c) ? FALSE : TRUE);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
static const OnigCodePoint CR_Hiragana[] = {
|
|
243
|
+
1,
|
|
244
|
+
0x829f, 0x82f1
|
|
245
|
+
}; /* CR_Hiragana */
|
|
246
|
+
|
|
247
|
+
static const OnigCodePoint CR_Katakana[] = {
|
|
248
|
+
4,
|
|
249
|
+
0x00a6, 0x00af,
|
|
250
|
+
0x00b1, 0x00dd,
|
|
251
|
+
0x8340, 0x837e,
|
|
252
|
+
0x8380, 0x8396,
|
|
253
|
+
}; /* CR_Katakana */
|
|
254
|
+
|
|
255
|
+
static const OnigCodePoint* PropertyList[] = {
|
|
256
|
+
CR_Hiragana,
|
|
257
|
+
CR_Katakana
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
static int
|
|
262
|
+
property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end)
|
|
263
|
+
{
|
|
264
|
+
struct PropertyNameCtype* pc;
|
|
265
|
+
int len = end - p;
|
|
266
|
+
char q[32];
|
|
267
|
+
|
|
268
|
+
if (len < sizeof(q) - 1) {
|
|
269
|
+
xmemcpy(q, p, (size_t )len);
|
|
270
|
+
q[len] = '\0';
|
|
271
|
+
pc = euc_jp_lookup_property_name(q, len);
|
|
272
|
+
if (pc != 0)
|
|
273
|
+
return pc->ctype;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
return ONIGERR_INVALID_CHAR_PROPERTY_NAME;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
static int
|
|
280
|
+
is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
|
281
|
+
{
|
|
282
|
+
if (ctype <= ONIGENC_MAX_STD_CTYPE) {
|
|
283
|
+
if (code < 128)
|
|
284
|
+
return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);
|
|
285
|
+
else {
|
|
286
|
+
if (CTYPE_IS_WORD_GRAPH_PRINT(ctype)) {
|
|
287
|
+
return (code_to_mbclen(code) > 1 ? TRUE : FALSE);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
ctype -= (ONIGENC_MAX_STD_CTYPE + 1);
|
|
293
|
+
if (ctype >= (unsigned int )(sizeof(PropertyList)/sizeof(PropertyList[0])))
|
|
294
|
+
return ONIGERR_TYPE_BUG;
|
|
295
|
+
|
|
296
|
+
return onig_is_in_code_range((UChar* )PropertyList[ctype], code);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
return FALSE;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
static int
|
|
303
|
+
get_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out,
|
|
304
|
+
const OnigCodePoint* ranges[])
|
|
305
|
+
{
|
|
306
|
+
if (ctype <= ONIGENC_MAX_STD_CTYPE) {
|
|
307
|
+
return ONIG_NO_SUPPORT_CONFIG;
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
*sb_out = 0x80;
|
|
311
|
+
|
|
312
|
+
ctype -= (ONIGENC_MAX_STD_CTYPE + 1);
|
|
313
|
+
if (ctype >= (OnigCtype )(sizeof(PropertyList)/sizeof(PropertyList[0])))
|
|
314
|
+
return ONIGERR_TYPE_BUG;
|
|
315
|
+
|
|
316
|
+
*ranges = PropertyList[ctype];
|
|
317
|
+
return 0;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
OnigEncodingType OnigEncodingSJIS = {
|
|
322
|
+
mbc_enc_len,
|
|
323
|
+
"Shift_JIS", /* name */
|
|
324
|
+
2, /* max byte length */
|
|
325
|
+
1, /* min byte length */
|
|
326
|
+
onigenc_is_mbc_newline_0x0a,
|
|
327
|
+
mbc_to_code,
|
|
328
|
+
code_to_mbclen,
|
|
329
|
+
code_to_mbc,
|
|
330
|
+
mbc_case_fold,
|
|
331
|
+
onigenc_ascii_apply_all_case_fold,
|
|
332
|
+
onigenc_ascii_get_case_fold_codes_by_str,
|
|
333
|
+
property_name_to_ctype,
|
|
334
|
+
is_code_ctype,
|
|
335
|
+
get_ctype_code_range,
|
|
336
|
+
left_adjust_char_head,
|
|
337
|
+
is_allowed_reverse_match,
|
|
338
|
+
NULL, /* init */
|
|
339
|
+
NULL, /* is_initialized */
|
|
340
|
+
is_valid_mbc_string
|
|
341
|
+
};
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/* ANSI-C code produced by gperf version 3.0.4 */
|
|
2
|
+
/* Command-line: gperf -pt -T -L ANSI-C -N sjis_lookup_property_name --output-file sjis_prop.c sjis_prop.gperf */
|
|
3
|
+
/* Computed positions: -k'1,3' */
|
|
4
|
+
|
|
5
|
+
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
|
|
6
|
+
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
|
|
7
|
+
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
|
|
8
|
+
&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
|
|
9
|
+
&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
|
|
10
|
+
&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
|
|
11
|
+
&& ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
|
|
12
|
+
&& ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
|
|
13
|
+
&& ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
|
|
14
|
+
&& ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
|
|
15
|
+
&& ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
|
|
16
|
+
&& ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
|
|
17
|
+
&& ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
|
|
18
|
+
&& ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
|
|
19
|
+
&& ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
|
|
20
|
+
&& ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
|
|
21
|
+
&& ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
|
|
22
|
+
&& ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
|
|
23
|
+
&& ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
|
|
24
|
+
&& ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
|
|
25
|
+
&& ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
|
|
26
|
+
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
|
|
27
|
+
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
|
|
28
|
+
/* The character set is not based on ISO-646. */
|
|
29
|
+
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
|
|
30
|
+
#endif
|
|
31
|
+
|
|
32
|
+
#line 1 "sjis_prop.gperf"
|
|
33
|
+
|
|
34
|
+
#include <string.h>
|
|
35
|
+
#include "regenc.h"
|
|
36
|
+
|
|
37
|
+
#define TOTAL_KEYWORDS 16
|
|
38
|
+
#define MIN_WORD_LENGTH 4
|
|
39
|
+
#define MAX_WORD_LENGTH 8
|
|
40
|
+
#define MIN_HASH_VALUE 4
|
|
41
|
+
#define MAX_HASH_VALUE 55
|
|
42
|
+
/* maximum key range = 52, duplicates = 0 */
|
|
43
|
+
|
|
44
|
+
#ifdef __GNUC__
|
|
45
|
+
__inline
|
|
46
|
+
#else
|
|
47
|
+
#ifdef __cplusplus
|
|
48
|
+
inline
|
|
49
|
+
#endif
|
|
50
|
+
#endif
|
|
51
|
+
static unsigned int
|
|
52
|
+
hash (register const char *str, register unsigned int len)
|
|
53
|
+
{
|
|
54
|
+
static unsigned char asso_values[] =
|
|
55
|
+
{
|
|
56
|
+
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
|
57
|
+
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
|
58
|
+
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
|
59
|
+
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
|
60
|
+
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
|
61
|
+
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
|
62
|
+
56, 56, 56, 56, 56, 0, 3, 10, 25, 56,
|
|
63
|
+
56, 30, 0, 56, 56, 0, 20, 56, 56, 56,
|
|
64
|
+
15, 56, 56, 20, 56, 30, 56, 0, 0, 56,
|
|
65
|
+
56, 56, 56, 56, 56, 56, 56, 15, 56, 56,
|
|
66
|
+
56, 56, 56, 25, 56, 10, 56, 56, 56, 56,
|
|
67
|
+
5, 56, 0, 56, 0, 56, 5, 56, 56, 20,
|
|
68
|
+
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
|
69
|
+
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
|
70
|
+
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
|
71
|
+
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
|
72
|
+
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
|
73
|
+
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
|
74
|
+
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
|
75
|
+
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
|
76
|
+
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
|
77
|
+
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
|
78
|
+
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
|
79
|
+
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
|
80
|
+
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
|
|
81
|
+
56, 56, 56, 56, 56, 56
|
|
82
|
+
};
|
|
83
|
+
return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
#ifdef __GNUC__
|
|
87
|
+
__inline
|
|
88
|
+
#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
|
|
89
|
+
__attribute__ ((__gnu_inline__))
|
|
90
|
+
#endif
|
|
91
|
+
#endif
|
|
92
|
+
struct PropertyNameCtype *
|
|
93
|
+
sjis_lookup_property_name (register const char *str, register unsigned int len)
|
|
94
|
+
{
|
|
95
|
+
static struct PropertyNameCtype wordlist[] =
|
|
96
|
+
{
|
|
97
|
+
{""}, {""}, {""}, {""},
|
|
98
|
+
#line 23 "sjis_prop.gperf"
|
|
99
|
+
{"Word", 12},
|
|
100
|
+
#line 12 "sjis_prop.gperf"
|
|
101
|
+
{"Alpha", 1},
|
|
102
|
+
{""}, {""},
|
|
103
|
+
#line 26 "sjis_prop.gperf"
|
|
104
|
+
{"Hiragana", 15},
|
|
105
|
+
{""},
|
|
106
|
+
#line 24 "sjis_prop.gperf"
|
|
107
|
+
{"Alnum", 13},
|
|
108
|
+
{""}, {""},
|
|
109
|
+
#line 27 "sjis_prop.gperf"
|
|
110
|
+
{"Katakana", 16},
|
|
111
|
+
{""},
|
|
112
|
+
#line 25 "sjis_prop.gperf"
|
|
113
|
+
{"ASCII", 14},
|
|
114
|
+
#line 22 "sjis_prop.gperf"
|
|
115
|
+
{"XDigit", 11},
|
|
116
|
+
{""}, {""}, {""},
|
|
117
|
+
#line 14 "sjis_prop.gperf"
|
|
118
|
+
{"Cntrl", 3},
|
|
119
|
+
{""}, {""},
|
|
120
|
+
#line 13 "sjis_prop.gperf"
|
|
121
|
+
{"Blank", 2},
|
|
122
|
+
{""},
|
|
123
|
+
#line 19 "sjis_prop.gperf"
|
|
124
|
+
{"Punct", 8},
|
|
125
|
+
{""}, {""}, {""}, {""},
|
|
126
|
+
#line 18 "sjis_prop.gperf"
|
|
127
|
+
{"Print", 7},
|
|
128
|
+
{""}, {""}, {""}, {""},
|
|
129
|
+
#line 21 "sjis_prop.gperf"
|
|
130
|
+
{"Upper", 10},
|
|
131
|
+
{""}, {""}, {""}, {""},
|
|
132
|
+
#line 20 "sjis_prop.gperf"
|
|
133
|
+
{"Space", 9},
|
|
134
|
+
{""}, {""}, {""}, {""},
|
|
135
|
+
#line 17 "sjis_prop.gperf"
|
|
136
|
+
{"Lower", 6},
|
|
137
|
+
{""}, {""}, {""}, {""},
|
|
138
|
+
#line 16 "sjis_prop.gperf"
|
|
139
|
+
{"Graph", 5},
|
|
140
|
+
{""}, {""}, {""}, {""},
|
|
141
|
+
#line 15 "sjis_prop.gperf"
|
|
142
|
+
{"Digit", 4}
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
|
|
146
|
+
{
|
|
147
|
+
register int key = hash (str, len);
|
|
148
|
+
|
|
149
|
+
if (key <= MAX_HASH_VALUE && key >= 0)
|
|
150
|
+
{
|
|
151
|
+
register const char *s = wordlist[key].name;
|
|
152
|
+
|
|
153
|
+
if (*str == *s && !strcmp (str + 1, s + 1))
|
|
154
|
+
return &wordlist[key];
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return 0;
|
|
158
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
%{
|
|
2
|
+
#include <string.h>
|
|
3
|
+
#include "regenc.h"
|
|
4
|
+
%}
|
|
5
|
+
|
|
6
|
+
struct PropertyNameCtype {
|
|
7
|
+
char *name;
|
|
8
|
+
int ctype;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
%%
|
|
12
|
+
Alpha, 1
|
|
13
|
+
Blank, 2
|
|
14
|
+
Cntrl, 3
|
|
15
|
+
Digit, 4
|
|
16
|
+
Graph, 5
|
|
17
|
+
Lower, 6
|
|
18
|
+
Print, 7
|
|
19
|
+
Punct, 8
|
|
20
|
+
Space, 9
|
|
21
|
+
Upper, 10
|
|
22
|
+
XDigit, 11
|
|
23
|
+
Word, 12
|
|
24
|
+
Alnum, 13
|
|
25
|
+
ASCII, 14
|
|
26
|
+
Hiragana, 15
|
|
27
|
+
Katakana, 16
|