diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-11-25 17:23:51 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-11-28 12:47:53 +0100 |
commit | 2e4b3c63bf2108d1e4afbb9d5852f47c860be24f (patch) | |
tree | 86acf52d7fcd22a1b2a6190ba9e24b37f059a1bb | |
parent | 80dbcdc0ce282244a69e93e14020da78d1585f4d (diff) | |
download | gnutls-2e4b3c63bf2108d1e4afbb9d5852f47c860be24f.tar.gz |
unistring: added NFKC normalization
-rw-r--r-- | cfg.mk | 2 | ||||
-rw-r--r-- | lib/unistring/Makefile.am | 484 | ||||
-rw-r--r-- | lib/unistring/m4/gnulib-cache.m4 | 6 | ||||
-rw-r--r-- | lib/unistring/m4/gnulib-comp.m4 | 188 | ||||
-rw-r--r-- | lib/unistring/uninorm/compat-decomposition.c | 41 | ||||
-rw-r--r-- | lib/unistring/uninorm/decomposition.c | 112 | ||||
-rw-r--r-- | lib/unistring/uninorm/nfkc.c | 42 | ||||
-rw-r--r-- | lib/unistring/uninorm/nfkd.c | 42 |
8 files changed, 912 insertions, 5 deletions
@@ -86,7 +86,7 @@ config: bootstrap: autoreconf .submodule.stamp UNISTRING_MODULES = "unistr/u8-check unistr/u8-to-u16 unistr/u8-to-u32 unistr/u32-to-u8 \ - unistr/u16-to-u8 uninorm/nfc uninorm/u8-normalize uninorm/u16-normalize \ + unistr/u16-to-u8 uninorm/nfc uninorm/nfkc uninorm/u8-normalize uninorm/u16-normalize \ uninorm/u32-normalize unictype/category-all" unistringimport: diff --git a/lib/unistring/Makefile.am b/lib/unistring/Makefile.am index 0e69e3e05d..cafa1b2284 100644 --- a/lib/unistring/Makefile.am +++ b/lib/unistring/Makefile.am @@ -21,7 +21,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --local-dir=lib/unistring/override --lib=libunistring --source-base=lib/unistring --m4-base=lib/unistring/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3orGPLv2 --no-conditional-dependencies --libtool --macro-prefix=unistring unictype/category-Zs unictype/category-test uninorm/nfc uninorm/u16-normalize uninorm/u32-normalize uninorm/u8-normalize unistr/u16-to-u8 unistr/u32-to-u8 unistr/u8-check unistr/u8-to-u16 unistr/u8-to-u32 +# Reproduce by: gnulib-tool --import --local-dir=lib/unistring/override --lib=libunistring --source-base=lib/unistring --m4-base=lib/unistring/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3orGPLv2 --no-conditional-dependencies --libtool --macro-prefix=unistring unictype/category-all uninorm/nfc uninorm/nfkc uninorm/u16-normalize uninorm/u32-normalize uninorm/u8-normalize unistr/u16-to-u8 unistr/u32-to-u8 unistr/u8-check unistr/u8-to-u16 unistr/u8-to-u32 AUTOMAKE_OPTIONS = 1.9.6 gnits subdir-objects @@ -244,6 +244,376 @@ EXTRA_DIST += unictype.in.h ## end gnulib module unictype/base +## begin gnulib module unictype/category-C + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_C +libunistring_la_SOURCES += unictype/categ_C.c +endif + +EXTRA_DIST += unictype/categ_C.h + +## end gnulib module unictype/category-C + +## begin gnulib module unictype/category-Cc + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_CC +libunistring_la_SOURCES += unictype/categ_Cc.c +endif + +EXTRA_DIST += unictype/categ_Cc.h + +## end gnulib module unictype/category-Cc + +## begin gnulib module unictype/category-Cf + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_CF +libunistring_la_SOURCES += unictype/categ_Cf.c +endif + +EXTRA_DIST += unictype/categ_Cf.h + +## end gnulib module unictype/category-Cf + +## begin gnulib module unictype/category-Cn + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_CN +libunistring_la_SOURCES += unictype/categ_Cn.c +endif + +EXTRA_DIST += unictype/categ_Cn.h + +## end gnulib module unictype/category-Cn + +## begin gnulib module unictype/category-Co + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_CO +libunistring_la_SOURCES += unictype/categ_Co.c +endif + +EXTRA_DIST += unictype/categ_Co.h + +## end gnulib module unictype/category-Co + +## begin gnulib module unictype/category-Cs + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_CS +libunistring_la_SOURCES += unictype/categ_Cs.c +endif + +EXTRA_DIST += unictype/categ_Cs.h + +## end gnulib module unictype/category-Cs + +## begin gnulib module unictype/category-L + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_L +libunistring_la_SOURCES += unictype/categ_L.c +endif + +EXTRA_DIST += unictype/categ_L.h + +## end gnulib module unictype/category-L + +## begin gnulib module unictype/category-LC + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_LC +libunistring_la_SOURCES += unictype/categ_LC.c +endif + +EXTRA_DIST += unictype/categ_LC.h + +## end gnulib module unictype/category-LC + +## begin gnulib module unictype/category-Ll + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_LL +libunistring_la_SOURCES += unictype/categ_Ll.c +endif + +EXTRA_DIST += unictype/categ_Ll.h + +## end gnulib module unictype/category-Ll + +## begin gnulib module unictype/category-Lm + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_LM +libunistring_la_SOURCES += unictype/categ_Lm.c +endif + +EXTRA_DIST += unictype/categ_Lm.h + +## end gnulib module unictype/category-Lm + +## begin gnulib module unictype/category-Lo + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_LO +libunistring_la_SOURCES += unictype/categ_Lo.c +endif + +EXTRA_DIST += unictype/categ_Lo.h + +## end gnulib module unictype/category-Lo + +## begin gnulib module unictype/category-Lt + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_LT +libunistring_la_SOURCES += unictype/categ_Lt.c +endif + +EXTRA_DIST += unictype/categ_Lt.h + +## end gnulib module unictype/category-Lt + +## begin gnulib module unictype/category-Lu + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_LU +libunistring_la_SOURCES += unictype/categ_Lu.c +endif + +EXTRA_DIST += unictype/categ_Lu.h + +## end gnulib module unictype/category-Lu + +## begin gnulib module unictype/category-M + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_M +libunistring_la_SOURCES += unictype/categ_M.c +endif + +EXTRA_DIST += unictype/categ_M.h + +## end gnulib module unictype/category-M + +## begin gnulib module unictype/category-Mc + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_MC +libunistring_la_SOURCES += unictype/categ_Mc.c +endif + +EXTRA_DIST += unictype/categ_Mc.h + +## end gnulib module unictype/category-Mc + +## begin gnulib module unictype/category-Me + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_ME +libunistring_la_SOURCES += unictype/categ_Me.c +endif + +EXTRA_DIST += unictype/categ_Me.h + +## end gnulib module unictype/category-Me + +## begin gnulib module unictype/category-Mn + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_MN +libunistring_la_SOURCES += unictype/categ_Mn.c +endif + +EXTRA_DIST += unictype/categ_Mn.h + +## end gnulib module unictype/category-Mn + +## begin gnulib module unictype/category-N + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_N +libunistring_la_SOURCES += unictype/categ_N.c +endif + +EXTRA_DIST += unictype/categ_N.h + +## end gnulib module unictype/category-N + +## begin gnulib module unictype/category-Nd + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_ND +libunistring_la_SOURCES += unictype/categ_Nd.c +endif + +EXTRA_DIST += unictype/categ_Nd.h + +## end gnulib module unictype/category-Nd + +## begin gnulib module unictype/category-Nl + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_NL +libunistring_la_SOURCES += unictype/categ_Nl.c +endif + +EXTRA_DIST += unictype/categ_Nl.h + +## end gnulib module unictype/category-Nl + +## begin gnulib module unictype/category-No + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_NO +libunistring_la_SOURCES += unictype/categ_No.c +endif + +EXTRA_DIST += unictype/categ_No.h + +## end gnulib module unictype/category-No + +## begin gnulib module unictype/category-P + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_P +libunistring_la_SOURCES += unictype/categ_P.c +endif + +EXTRA_DIST += unictype/categ_P.h + +## end gnulib module unictype/category-P + +## begin gnulib module unictype/category-Pc + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_PC +libunistring_la_SOURCES += unictype/categ_Pc.c +endif + +EXTRA_DIST += unictype/categ_Pc.h + +## end gnulib module unictype/category-Pc + +## begin gnulib module unictype/category-Pd + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_PD +libunistring_la_SOURCES += unictype/categ_Pd.c +endif + +EXTRA_DIST += unictype/categ_Pd.h + +## end gnulib module unictype/category-Pd + +## begin gnulib module unictype/category-Pe + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_PE +libunistring_la_SOURCES += unictype/categ_Pe.c +endif + +EXTRA_DIST += unictype/categ_Pe.h + +## end gnulib module unictype/category-Pe + +## begin gnulib module unictype/category-Pf + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_PF +libunistring_la_SOURCES += unictype/categ_Pf.c +endif + +EXTRA_DIST += unictype/categ_Pf.h + +## end gnulib module unictype/category-Pf + +## begin gnulib module unictype/category-Pi + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_PI +libunistring_la_SOURCES += unictype/categ_Pi.c +endif + +EXTRA_DIST += unictype/categ_Pi.h + +## end gnulib module unictype/category-Pi + +## begin gnulib module unictype/category-Po + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_PO +libunistring_la_SOURCES += unictype/categ_Po.c +endif + +EXTRA_DIST += unictype/categ_Po.h + +## end gnulib module unictype/category-Po + +## begin gnulib module unictype/category-Ps + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_PS +libunistring_la_SOURCES += unictype/categ_Ps.c +endif + +EXTRA_DIST += unictype/categ_Ps.h + +## end gnulib module unictype/category-Ps + +## begin gnulib module unictype/category-S + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_S +libunistring_la_SOURCES += unictype/categ_S.c +endif + +EXTRA_DIST += unictype/categ_S.h + +## end gnulib module unictype/category-S + +## begin gnulib module unictype/category-Sc + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_SC +libunistring_la_SOURCES += unictype/categ_Sc.c +endif + +EXTRA_DIST += unictype/categ_Sc.h + +## end gnulib module unictype/category-Sc + +## begin gnulib module unictype/category-Sk + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_SK +libunistring_la_SOURCES += unictype/categ_Sk.c +endif + +EXTRA_DIST += unictype/categ_Sk.h + +## end gnulib module unictype/category-Sk + +## begin gnulib module unictype/category-Sm + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_SM +libunistring_la_SOURCES += unictype/categ_Sm.c +endif + +EXTRA_DIST += unictype/categ_Sm.h + +## end gnulib module unictype/category-Sm + +## begin gnulib module unictype/category-So + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_SO +libunistring_la_SOURCES += unictype/categ_So.c +endif + +EXTRA_DIST += unictype/categ_So.h + +## end gnulib module unictype/category-So + +## begin gnulib module unictype/category-Z + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_Z +libunistring_la_SOURCES += unictype/categ_Z.c +endif + +EXTRA_DIST += unictype/categ_Z.h + +## end gnulib module unictype/category-Z + +## begin gnulib module unictype/category-Zl + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_ZL +libunistring_la_SOURCES += unictype/categ_Zl.c +endif + +EXTRA_DIST += unictype/categ_Zl.h + +## end gnulib module unictype/category-Zl + +## begin gnulib module unictype/category-Zp + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_ZP +libunistring_la_SOURCES += unictype/categ_Zp.c +endif + +EXTRA_DIST += unictype/categ_Zp.h + +## end gnulib module unictype/category-Zp + ## begin gnulib module unictype/category-Zs if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_ZS @@ -254,6 +624,82 @@ EXTRA_DIST += unictype/categ_Zs.h ## end gnulib module unictype/category-Zs +## begin gnulib module unictype/category-and + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_AND +libunistring_la_SOURCES += unictype/categ_and.c +endif + +## end gnulib module unictype/category-and + +## begin gnulib module unictype/category-and-not + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_AND_NOT +libunistring_la_SOURCES += unictype/categ_and_not.c +endif + +## end gnulib module unictype/category-and-not + +## begin gnulib module unictype/category-byname + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_BYNAME +libunistring_la_SOURCES += unictype/categ_byname.c +endif + +unictype/categ_byname.h: unictype/categ_byname.gperf + $(V_GPERF)$(GPERF) -m 10 $(srcdir)/unictype/categ_byname.gperf > $(srcdir)/unictype/categ_byname.h-t && \ + mv $(srcdir)/unictype/categ_byname.h-t $(srcdir)/unictype/categ_byname.h +BUILT_SOURCES += unictype/categ_byname.h +MOSTLYCLEANFILES += unictype/categ_byname.h-t +MAINTAINERCLEANFILES += unictype/categ_byname.h +EXTRA_DIST += unictype/categ_byname.h + +EXTRA_DIST += unictype/categ_byname.gperf + +## end gnulib module unictype/category-byname + +## begin gnulib module unictype/category-longname + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_LONGNAME +libunistring_la_SOURCES += unictype/categ_longname.c +endif + +## end gnulib module unictype/category-longname + +## begin gnulib module unictype/category-name + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_NAME +libunistring_la_SOURCES += unictype/categ_name.c +endif + +## end gnulib module unictype/category-name + +## begin gnulib module unictype/category-none + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_NONE +libunistring_la_SOURCES += unictype/categ_none.c +endif + +## end gnulib module unictype/category-none + +## begin gnulib module unictype/category-of + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_OF +libunistring_la_SOURCES += unictype/categ_of.c +endif + +EXTRA_DIST += unictype/categ_of.h + +## end gnulib module unictype/category-of + +## begin gnulib module unictype/category-or + +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_OR +libunistring_la_SOURCES += unictype/categ_or.c +endif + +## end gnulib module unictype/category-or + ## begin gnulib module unictype/category-test if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_TEST @@ -298,6 +744,14 @@ endif ## end gnulib module uninorm/canonical-decomposition +## begin gnulib module uninorm/compat-decomposition + +libunistring_la_SOURCES += uninorm/compat-decomposition.c + +EXTRA_DIST += uninorm/decompose-internal.h + +## end gnulib module uninorm/compat-decomposition + ## begin gnulib module uninorm/composition if LIBUNISTRING_COMPILE_UNINORM_COMPOSITION @@ -324,6 +778,14 @@ EXTRA_DIST += uninorm/decompose-internal.h ## end gnulib module uninorm/decompose-internal +## begin gnulib module uninorm/decomposition + +if LIBUNISTRING_COMPILE_UNINORM_DECOMPOSITION +libunistring_la_SOURCES += uninorm/decomposition.c +endif + +## end gnulib module uninorm/decomposition + ## begin gnulib module uninorm/decomposition-table libunistring_la_SOURCES += uninorm/decomposition-table.c @@ -352,6 +814,26 @@ EXTRA_DIST += uninorm/normalize-internal.h ## end gnulib module uninorm/nfd +## begin gnulib module uninorm/nfkc + +if LIBUNISTRING_COMPILE_UNINORM_NFKC +libunistring_la_SOURCES += uninorm/nfkc.c +endif + +EXTRA_DIST += uninorm/normalize-internal.h + +## end gnulib module uninorm/nfkc + +## begin gnulib module uninorm/nfkd + +if LIBUNISTRING_COMPILE_UNINORM_NFKD +libunistring_la_SOURCES += uninorm/nfkd.c +endif + +EXTRA_DIST += uninorm/normalize-internal.h + +## end gnulib module uninorm/nfkd + ## begin gnulib module uninorm/u16-normalize if LIBUNISTRING_COMPILE_UNINORM_U16_NORMALIZE diff --git a/lib/unistring/m4/gnulib-cache.m4 b/lib/unistring/m4/gnulib-cache.m4 index 884ef505bb..00592ebc01 100644 --- a/lib/unistring/m4/gnulib-cache.m4 +++ b/lib/unistring/m4/gnulib-cache.m4 @@ -27,14 +27,14 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --local-dir=lib/unistring/override --lib=libunistring --source-base=lib/unistring --m4-base=lib/unistring/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3orGPLv2 --no-conditional-dependencies --libtool --macro-prefix=unistring unictype/category-Zs unictype/category-test uninorm/nfc uninorm/u16-normalize uninorm/u32-normalize uninorm/u8-normalize unistr/u16-to-u8 unistr/u32-to-u8 unistr/u8-check unistr/u8-to-u16 unistr/u8-to-u32 +# gnulib-tool --import --local-dir=lib/unistring/override --lib=libunistring --source-base=lib/unistring --m4-base=lib/unistring/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3orGPLv2 --no-conditional-dependencies --libtool --macro-prefix=unistring unictype/category-all uninorm/nfc uninorm/nfkc uninorm/u16-normalize uninorm/u32-normalize uninorm/u8-normalize unistr/u16-to-u8 unistr/u32-to-u8 unistr/u8-check unistr/u8-to-u16 unistr/u8-to-u32 # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([lib/unistring/override]) gl_MODULES([ - unictype/category-Zs - unictype/category-test + unictype/category-all uninorm/nfc + uninorm/nfkc uninorm/u16-normalize uninorm/u32-normalize uninorm/u8-normalize diff --git a/lib/unistring/m4/gnulib-comp.m4 b/lib/unistring/m4/gnulib-comp.m4 index c09cd417e3..9619a05e8c 100644 --- a/lib/unistring/m4/gnulib-comp.m4 +++ b/lib/unistring/m4/gnulib-comp.m4 @@ -55,16 +55,67 @@ AC_DEFUN([unistring_EARLY], # Code from module stdint: # Code from module sys_types: # Code from module unictype/base: + # Code from module unictype/category-C: + # Code from module unictype/category-Cc: + # Code from module unictype/category-Cf: + # Code from module unictype/category-Cn: + # Code from module unictype/category-Co: + # Code from module unictype/category-Cs: + # Code from module unictype/category-L: + # Code from module unictype/category-LC: + # Code from module unictype/category-Ll: + # Code from module unictype/category-Lm: + # Code from module unictype/category-Lo: + # Code from module unictype/category-Lt: + # Code from module unictype/category-Lu: + # Code from module unictype/category-M: + # Code from module unictype/category-Mc: + # Code from module unictype/category-Me: + # Code from module unictype/category-Mn: + # Code from module unictype/category-N: + # Code from module unictype/category-Nd: + # Code from module unictype/category-Nl: + # Code from module unictype/category-No: + # Code from module unictype/category-P: + # Code from module unictype/category-Pc: + # Code from module unictype/category-Pd: + # Code from module unictype/category-Pe: + # Code from module unictype/category-Pf: + # Code from module unictype/category-Pi: + # Code from module unictype/category-Po: + # Code from module unictype/category-Ps: + # Code from module unictype/category-S: + # Code from module unictype/category-Sc: + # Code from module unictype/category-Sk: + # Code from module unictype/category-Sm: + # Code from module unictype/category-So: + # Code from module unictype/category-Z: + # Code from module unictype/category-Zl: + # Code from module unictype/category-Zp: # Code from module unictype/category-Zs: + # Code from module unictype/category-all: + # Code from module unictype/category-and: + # Code from module unictype/category-and-not: + # Code from module unictype/category-byname: + # Code from module unictype/category-longname: + # Code from module unictype/category-name: + # Code from module unictype/category-none: + # Code from module unictype/category-of: + # Code from module unictype/category-or: # Code from module unictype/category-test: + # Code from module unictype/category-test-withtable: # Code from module unictype/combining-class: # Code from module uninorm/base: # Code from module uninorm/canonical-decomposition: + # Code from module uninorm/compat-decomposition: # Code from module uninorm/composition: # Code from module uninorm/decompose-internal: + # Code from module uninorm/decomposition: # Code from module uninorm/decomposition-table: # Code from module uninorm/nfc: # Code from module uninorm/nfd: + # Code from module uninorm/nfkc: + # Code from module uninorm/nfkd: # Code from module uninorm/u16-normalize: # Code from module uninorm/u32-normalize: # Code from module uninorm/u8-normalize: @@ -111,16 +162,65 @@ AC_DEFUN([unistring_INIT], gl_SYS_TYPES_H AC_PROG_MKDIR_P gl_LIBUNISTRING_LIBHEADER([0.9.4], [unictype.h]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-C]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Cc]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Cf]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Cn]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Co]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Cs]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-L]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-LC]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Ll]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Lm]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Lo]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Lt]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Lu]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-M]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Mc]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Me]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Mn]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-N]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Nd]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Nl]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-No]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-P]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Pc]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Pd]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Pe]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Pf]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Pi]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Po]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Ps]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-S]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Sc]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Sk]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Sm]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-So]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Z]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Zl]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Zp]) gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-Zs]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-and]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-and-not]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-byname]) + gl_LIBUNISTRING_MODULE([0.9.5], [unictype/category-longname]) + gl_LIBUNISTRING_MODULE([0.9], [unictype/category-name]) + gl_LIBUNISTRING_MODULE([0.9.5], [unictype/category-none]) + AC_REQUIRE([AC_C_INLINE]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-of]) + gl_LIBUNISTRING_MODULE([0.9.6], [unictype/category-or]) AC_REQUIRE([AC_C_INLINE]) gl_LIBUNISTRING_MODULE([0.9.5], [unictype/category-test]) gl_LIBUNISTRING_MODULE([0.9.6], [unictype/combining-class]) gl_LIBUNISTRING_LIBHEADER([0.9.4], [uninorm.h]) gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/canonical-decomposition]) gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/composition]) + gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/decomposition]) AC_REQUIRE([AC_C_INLINE]) gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/nfc]) gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/nfd]) + gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/nfkc]) + gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/nfkd]) gl_MODULE_INDICATOR_FOR_TESTS([uninorm/u16-normalize]) gl_LIBUNISTRING_MODULE([0.9.6], [uninorm/u16-normalize]) gl_MODULE_INDICATOR_FOR_TESTS([uninorm/u32-normalize]) @@ -297,13 +397,98 @@ AC_DEFUN([unistring_FILE_LIST], [ lib/sys_types.in.h lib/unictype.in.h lib/unictype/bitmap.h + lib/unictype/categ_C.c + lib/unictype/categ_C.h + lib/unictype/categ_Cc.c + lib/unictype/categ_Cc.h + lib/unictype/categ_Cf.c + lib/unictype/categ_Cf.h + lib/unictype/categ_Cn.c + lib/unictype/categ_Cn.h + lib/unictype/categ_Co.c + lib/unictype/categ_Co.h + lib/unictype/categ_Cs.c + lib/unictype/categ_Cs.h + lib/unictype/categ_L.c + lib/unictype/categ_L.h + lib/unictype/categ_LC.c + lib/unictype/categ_LC.h + lib/unictype/categ_Ll.c + lib/unictype/categ_Ll.h + lib/unictype/categ_Lm.c + lib/unictype/categ_Lm.h + lib/unictype/categ_Lo.c + lib/unictype/categ_Lo.h + lib/unictype/categ_Lt.c + lib/unictype/categ_Lt.h + lib/unictype/categ_Lu.c + lib/unictype/categ_Lu.h + lib/unictype/categ_M.c + lib/unictype/categ_M.h + lib/unictype/categ_Mc.c + lib/unictype/categ_Mc.h + lib/unictype/categ_Me.c + lib/unictype/categ_Me.h + lib/unictype/categ_Mn.c + lib/unictype/categ_Mn.h + lib/unictype/categ_N.c + lib/unictype/categ_N.h + lib/unictype/categ_Nd.c + lib/unictype/categ_Nd.h + lib/unictype/categ_Nl.c + lib/unictype/categ_Nl.h + lib/unictype/categ_No.c + lib/unictype/categ_No.h + lib/unictype/categ_P.c + lib/unictype/categ_P.h + lib/unictype/categ_Pc.c + lib/unictype/categ_Pc.h + lib/unictype/categ_Pd.c + lib/unictype/categ_Pd.h + lib/unictype/categ_Pe.c + lib/unictype/categ_Pe.h + lib/unictype/categ_Pf.c + lib/unictype/categ_Pf.h + lib/unictype/categ_Pi.c + lib/unictype/categ_Pi.h + lib/unictype/categ_Po.c + lib/unictype/categ_Po.h + lib/unictype/categ_Ps.c + lib/unictype/categ_Ps.h + lib/unictype/categ_S.c + lib/unictype/categ_S.h + lib/unictype/categ_Sc.c + lib/unictype/categ_Sc.h + lib/unictype/categ_Sk.c + lib/unictype/categ_Sk.h + lib/unictype/categ_Sm.c + lib/unictype/categ_Sm.h + lib/unictype/categ_So.c + lib/unictype/categ_So.h + lib/unictype/categ_Z.c + lib/unictype/categ_Z.h + lib/unictype/categ_Zl.c + lib/unictype/categ_Zl.h + lib/unictype/categ_Zp.c + lib/unictype/categ_Zp.h lib/unictype/categ_Zs.c lib/unictype/categ_Zs.h + lib/unictype/categ_and.c + lib/unictype/categ_and_not.c + lib/unictype/categ_byname.c + lib/unictype/categ_byname.gperf + lib/unictype/categ_longname.c + lib/unictype/categ_name.c + lib/unictype/categ_none.c + lib/unictype/categ_of.c + lib/unictype/categ_of.h + lib/unictype/categ_or.c lib/unictype/categ_test.c lib/unictype/combiningclass.c lib/unictype/combiningclass.h lib/uninorm.in.h lib/uninorm/canonical-decomposition.c + lib/uninorm/compat-decomposition.c lib/uninorm/composition-table.gperf lib/uninorm/composition.c lib/uninorm/decompose-internal.c @@ -312,8 +497,11 @@ AC_DEFUN([unistring_FILE_LIST], [ lib/uninorm/decomposition-table.h lib/uninorm/decomposition-table1.h lib/uninorm/decomposition-table2.h + lib/uninorm/decomposition.c lib/uninorm/nfc.c lib/uninorm/nfd.c + lib/uninorm/nfkc.c + lib/uninorm/nfkd.c lib/uninorm/normalize-internal.h lib/uninorm/u-normalize-internal.h lib/uninorm/u16-normalize.c diff --git a/lib/unistring/uninorm/compat-decomposition.c b/lib/unistring/uninorm/compat-decomposition.c new file mode 100644 index 0000000000..d3637b92db --- /dev/null +++ b/lib/unistring/uninorm/compat-decomposition.c @@ -0,0 +1,41 @@ +/* Compatibility decomposition of Unicode characters. + Copyright (C) 2009-2016 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2009. + + This program is free software: you can redistribute it and/or modify it + under the terms of either: + + * the GNU Lesser General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + or + + * the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or + (at your option) any later version. + + or both in parallel, as here. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "decompose-internal.h" + +#include "uninorm.h" + +int +uc_compat_decomposition (ucs4_t uc, ucs4_t *decomposition) +{ + int tag; + + return uc_decomposition (uc, &tag, decomposition); +} diff --git a/lib/unistring/uninorm/decomposition.c b/lib/unistring/uninorm/decomposition.c new file mode 100644 index 0000000000..daf6113537 --- /dev/null +++ b/lib/unistring/uninorm/decomposition.c @@ -0,0 +1,112 @@ +/* Decomposition of Unicode characters. + Copyright (C) 2009-2016 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2009. + + This program is free software: you can redistribute it and/or modify it + under the terms of either: + + * the GNU Lesser General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + or + + * the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or + (at your option) any later version. + + or both in parallel, as here. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "uninorm.h" + +#include "decomposition-table.h" + +int +uc_decomposition (ucs4_t uc, int *decomp_tag, ucs4_t *decomposition) +{ + if (uc >= 0xAC00 && uc < 0xD7A4) + { + /* Hangul syllable. See Unicode standard, chapter 3, section + "Hangul Syllable Decomposition", See also the clarification at + <http://www.unicode.org/versions/Unicode5.1.0/>, section + "Clarification of Hangul Jamo Handling". */ + unsigned int t; + + uc -= 0xAC00; + t = uc % 28; + + *decomp_tag = UC_DECOMP_CANONICAL; + if (t == 0) + { + unsigned int v, l; + + uc = uc / 28; + v = uc % 21; + l = uc / 21; + + decomposition[0] = 0x1100 + l; + decomposition[1] = 0x1161 + v; + return 2; + } + else + { +#if 1 /* Return the pairwise decomposition, not the full decomposition. */ + decomposition[0] = 0xAC00 + uc - t; /* = 0xAC00 + (l * 21 + v) * 28; */ + decomposition[1] = 0x11A7 + t; + return 2; +#else + unsigned int v, l; + + uc = uc / 28; + v = uc % 21; + l = uc / 21; + + decomposition[0] = 0x1100 + l; + decomposition[1] = 0x1161 + v; + decomposition[2] = 0x11A7 + t; + return 3; +#endif + } + } + else if (uc < 0x110000) + { + unsigned short entry = decomp_index (uc); + if (entry != (unsigned short)(-1)) + { + const unsigned char *p; + unsigned int element; + unsigned int length; + + p = &gl_uninorm_decomp_chars_table[3 * (entry & 0x7FFF)]; + element = (p[0] << 16) | (p[1] << 8) | p[2]; + /* The first element has 5 bits for the decomposition type. */ + *decomp_tag = (element >> 18) & 0x1f; + length = 1; + for (;;) + { + /* Every element has an 18 bits wide Unicode code point. */ + *decomposition = element & 0x3ffff; + /* Bit 23 tells whether there are more elements, */ + if ((element & (1 << 23)) == 0) + break; + p += 3; + element = (p[0] << 16) | (p[1] << 8) | p[2]; + decomposition++; + length++; + } + return length; + } + } + return -1; +} diff --git a/lib/unistring/uninorm/nfkc.c b/lib/unistring/uninorm/nfkc.c new file mode 100644 index 0000000000..c4a07e389c --- /dev/null +++ b/lib/unistring/uninorm/nfkc.c @@ -0,0 +1,42 @@ +/* Unicode Normalization Form KC. + Copyright (C) 2009-2016 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2009. + + This program is free software: you can redistribute it and/or modify it + under the terms of either: + + * the GNU Lesser General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + or + + * the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or + (at your option) any later version. + + or both in parallel, as here. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "uninorm.h" + +#include "normalize-internal.h" +#include "decompose-internal.h" + +const struct unicode_normalization_form uninorm_nfkc = + { + NF_IS_COMPAT_DECOMPOSING | NF_IS_COMPOSING, + uc_compat_decomposition, + uc_composition, + &uninorm_nfkd + }; diff --git a/lib/unistring/uninorm/nfkd.c b/lib/unistring/uninorm/nfkd.c new file mode 100644 index 0000000000..28e167786b --- /dev/null +++ b/lib/unistring/uninorm/nfkd.c @@ -0,0 +1,42 @@ +/* Unicode Normalization Form KD. + Copyright (C) 2009-2016 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2009. + + This program is free software: you can redistribute it and/or modify it + under the terms of either: + + * the GNU Lesser General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + or + + * the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or + (at your option) any later version. + + or both in parallel, as here. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "uninorm.h" + +#include "normalize-internal.h" +#include "decompose-internal.h" + +const struct unicode_normalization_form uninorm_nfkd = + { + NF_IS_COMPAT_DECOMPOSING, + uc_compat_decomposition, + NULL, + &uninorm_nfkd + }; |