Reorganized the directory structure
This commit is contained in:
		
							
								
								
									
										5
									
								
								tools/Makefile.am
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								tools/Makefile.am
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,5 @@ | ||||
|  | ||||
| AUTOMAKE_OPTIONS = no-dependencies | ||||
|  | ||||
| EXTRA_DIST = gencp.sh gencp0.awk gencp1.awk testcp.c uni-case.c uni-trait.c | ||||
|  | ||||
							
								
								
									
										486
									
								
								tools/Makefile.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										486
									
								
								tools/Makefile.in
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,486 @@ | ||||
| # Makefile.in generated by automake 1.16.2 from Makefile.am. | ||||
| # @configure_input@ | ||||
|  | ||||
| # Copyright (C) 1994-2020 Free Software Foundation, Inc. | ||||
|  | ||||
| # This Makefile.in is free software; the Free Software Foundation | ||||
| # gives unlimited permission to copy and/or distribute it, | ||||
| # with or without modifications, as long as this notice is preserved. | ||||
|  | ||||
| # This program is distributed in the hope that it will be useful, | ||||
| # but WITHOUT ANY WARRANTY, to the extent permitted by law; without | ||||
| # even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||||
| # PARTICULAR PURPOSE. | ||||
|  | ||||
| @SET_MAKE@ | ||||
| VPATH = @srcdir@ | ||||
| am__is_gnu_make = { \ | ||||
|   if test -z '$(MAKELEVEL)'; then \ | ||||
|     false; \ | ||||
|   elif test -n '$(MAKE_HOST)'; then \ | ||||
|     true; \ | ||||
|   elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ | ||||
|     true; \ | ||||
|   else \ | ||||
|     false; \ | ||||
|   fi; \ | ||||
| } | ||||
| am__make_running_with_option = \ | ||||
|   case $${target_option-} in \ | ||||
|       ?) ;; \ | ||||
|       *) echo "am__make_running_with_option: internal error: invalid" \ | ||||
|               "target option '$${target_option-}' specified" >&2; \ | ||||
|          exit 1;; \ | ||||
|   esac; \ | ||||
|   has_opt=no; \ | ||||
|   sane_makeflags=$$MAKEFLAGS; \ | ||||
|   if $(am__is_gnu_make); then \ | ||||
|     sane_makeflags=$$MFLAGS; \ | ||||
|   else \ | ||||
|     case $$MAKEFLAGS in \ | ||||
|       *\\[\ \	]*) \ | ||||
|         bs=\\; \ | ||||
|         sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | ||||
|           | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \ | ||||
|     esac; \ | ||||
|   fi; \ | ||||
|   skip_next=no; \ | ||||
|   strip_trailopt () \ | ||||
|   { \ | ||||
|     flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ | ||||
|   }; \ | ||||
|   for flg in $$sane_makeflags; do \ | ||||
|     test $$skip_next = yes && { skip_next=no; continue; }; \ | ||||
|     case $$flg in \ | ||||
|       *=*|--*) continue;; \ | ||||
|         -*I) strip_trailopt 'I'; skip_next=yes;; \ | ||||
|       -*I?*) strip_trailopt 'I';; \ | ||||
|         -*O) strip_trailopt 'O'; skip_next=yes;; \ | ||||
|       -*O?*) strip_trailopt 'O';; \ | ||||
|         -*l) strip_trailopt 'l'; skip_next=yes;; \ | ||||
|       -*l?*) strip_trailopt 'l';; \ | ||||
|       -[dEDm]) skip_next=yes;; \ | ||||
|       -[JT]) skip_next=yes;; \ | ||||
|     esac; \ | ||||
|     case $$flg in \ | ||||
|       *$$target_option*) has_opt=yes; break;; \ | ||||
|     esac; \ | ||||
|   done; \ | ||||
|   test $$has_opt = yes | ||||
| am__make_dryrun = (target_option=n; $(am__make_running_with_option)) | ||||
| am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) | ||||
| pkgdatadir = $(datadir)/@PACKAGE@ | ||||
| pkgincludedir = $(includedir)/@PACKAGE@ | ||||
| pkglibdir = $(libdir)/@PACKAGE@ | ||||
| pkglibexecdir = $(libexecdir)/@PACKAGE@ | ||||
| am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd | ||||
| install_sh_DATA = $(install_sh) -c -m 644 | ||||
| install_sh_PROGRAM = $(install_sh) -c | ||||
| install_sh_SCRIPT = $(install_sh) -c | ||||
| INSTALL_HEADER = $(INSTALL_DATA) | ||||
| transform = $(program_transform_name) | ||||
| NORMAL_INSTALL = : | ||||
| PRE_INSTALL = : | ||||
| POST_INSTALL = : | ||||
| NORMAL_UNINSTALL = : | ||||
| PRE_UNINSTALL = : | ||||
| POST_UNINSTALL = : | ||||
| build_triplet = @build@ | ||||
| host_triplet = @host@ | ||||
| subdir = tools | ||||
| ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | ||||
| am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ | ||||
| 	$(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ | ||||
| 	$(top_srcdir)/m4/ax_cxx_namespace.m4 \ | ||||
| 	$(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/ax_numval.m4 \ | ||||
| 	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ | ||||
| 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ | ||||
| 	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ | ||||
| 	$(top_srcdir)/m4/lx_find_mpi.m4 \ | ||||
| 	$(top_srcdir)/m4/qse_try_cflags.m4 $(top_srcdir)/configure.ac | ||||
| am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ | ||||
| 	$(ACLOCAL_M4) | ||||
| DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) | ||||
| mkinstalldirs = $(install_sh) -d | ||||
| CONFIG_HEADER = $(top_builddir)/include/qse/config.h | ||||
| CONFIG_CLEAN_FILES = | ||||
| CONFIG_CLEAN_VPATH_FILES = | ||||
| AM_V_P = $(am__v_P_@AM_V@) | ||||
| am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) | ||||
| am__v_P_0 = false | ||||
| am__v_P_1 = : | ||||
| AM_V_GEN = $(am__v_GEN_@AM_V@) | ||||
| am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) | ||||
| am__v_GEN_0 = @echo "  GEN     " $@; | ||||
| am__v_GEN_1 =  | ||||
| AM_V_at = $(am__v_at_@AM_V@) | ||||
| am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) | ||||
| am__v_at_0 = @ | ||||
| am__v_at_1 =  | ||||
| depcomp = | ||||
| am__maybe_remake_depfiles = | ||||
| SOURCES = | ||||
| DIST_SOURCES = | ||||
| am__can_run_installinfo = \ | ||||
|   case $$AM_UPDATE_INFO_DIR in \ | ||||
|     n|no|NO) false;; \ | ||||
|     *) (install-info --version) >/dev/null 2>&1;; \ | ||||
|   esac | ||||
| am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) | ||||
| am__DIST_COMMON = $(srcdir)/Makefile.in | ||||
| DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||||
| ACLOCAL = @ACLOCAL@ | ||||
| AMTAR = @AMTAR@ | ||||
| AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ | ||||
| AR = @AR@ | ||||
| AUTOCONF = @AUTOCONF@ | ||||
| AUTOHEADER = @AUTOHEADER@ | ||||
| AUTOMAKE = @AUTOMAKE@ | ||||
| AWK = @AWK@ | ||||
| BUILD_MODE = @BUILD_MODE@ | ||||
| CC = @CC@ | ||||
| CCDEPMODE = @CCDEPMODE@ | ||||
| CFLAGS = @CFLAGS@ | ||||
| CPP = @CPP@ | ||||
| CPPFLAGS = @CPPFLAGS@ | ||||
| CXX = @CXX@ | ||||
| CXXCPP = @CXXCPP@ | ||||
| CXXDEPMODE = @CXXDEPMODE@ | ||||
| CXXFLAGS = @CXXFLAGS@ | ||||
| CYGPATH_W = @CYGPATH_W@ | ||||
| DEFS = @DEFS@ | ||||
| DEPDIR = @DEPDIR@ | ||||
| DLLTOOL = @DLLTOOL@ | ||||
| DL_LIBS = @DL_LIBS@ | ||||
| DSYMUTIL = @DSYMUTIL@ | ||||
| DUMPBIN = @DUMPBIN@ | ||||
| ECHO = @ECHO@ | ||||
| ECHO_C = @ECHO_C@ | ||||
| ECHO_N = @ECHO_N@ | ||||
| ECHO_T = @ECHO_T@ | ||||
| EGREP = @EGREP@ | ||||
| EXEEXT = @EXEEXT@ | ||||
| FGREP = @FGREP@ | ||||
| GREP = @GREP@ | ||||
| HAVE_CXX = @HAVE_CXX@ | ||||
| HAVE_CXX11 = @HAVE_CXX11@ | ||||
| INSTALL = @INSTALL@ | ||||
| INSTALL_DATA = @INSTALL_DATA@ | ||||
| INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||||
| INSTALL_SCRIPT = @INSTALL_SCRIPT@ | ||||
| INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ | ||||
| LD = @LD@ | ||||
| LDFLAGS = @LDFLAGS@ | ||||
| LIBM = @LIBM@ | ||||
| LIBOBJS = @LIBOBJS@ | ||||
| LIBS = @LIBS@ | ||||
| LIBTOOL = @LIBTOOL@ | ||||
| LIBTOOL_DEPS = @LIBTOOL_DEPS@ | ||||
| LIPO = @LIPO@ | ||||
| LN_S = @LN_S@ | ||||
| LTDL_LIBS = @LTDL_LIBS@ | ||||
| LTLIBOBJS = @LTLIBOBJS@ | ||||
| LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ | ||||
| MAKEINFO = @MAKEINFO@ | ||||
| MANIFEST_TOOL = @MANIFEST_TOOL@ | ||||
| MKDIR_P = @MKDIR_P@ | ||||
| MPICC = @MPICC@ | ||||
| MPI_CFLAGS = @MPI_CFLAGS@ | ||||
| MPI_CLDFLAGS = @MPI_CLDFLAGS@ | ||||
| MYSQL_CFLAGS = @MYSQL_CFLAGS@ | ||||
| MYSQL_CONFIG = @MYSQL_CONFIG@ | ||||
| MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ | ||||
| MYSQL_LIBS = @MYSQL_LIBS@ | ||||
| MYSQL_VERSION = @MYSQL_VERSION@ | ||||
| NM = @NM@ | ||||
| NMEDIT = @NMEDIT@ | ||||
| OBJDUMP = @OBJDUMP@ | ||||
| OBJEXT = @OBJEXT@ | ||||
| OTOOL = @OTOOL@ | ||||
| OTOOL64 = @OTOOL64@ | ||||
| PACKAGE = @PACKAGE@ | ||||
| PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | ||||
| PACKAGE_NAME = @PACKAGE_NAME@ | ||||
| PACKAGE_STRING = @PACKAGE_STRING@ | ||||
| PACKAGE_TARNAME = @PACKAGE_TARNAME@ | ||||
| PACKAGE_URL = @PACKAGE_URL@ | ||||
| PACKAGE_VERSION = @PACKAGE_VERSION@ | ||||
| PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ | ||||
| PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ | ||||
| PACKAGE_VERSION_PATCH = @PACKAGE_VERSION_PATCH@ | ||||
| PATH_SEPARATOR = @PATH_SEPARATOR@ | ||||
| PTHREAD_CC = @PTHREAD_CC@ | ||||
| PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ | ||||
| PTHREAD_LIBS = @PTHREAD_LIBS@ | ||||
| QSE_PROJECT_AUTHOR = @QSE_PROJECT_AUTHOR@ | ||||
| QSE_PROJECT_URL = @QSE_PROJECT_URL@ | ||||
| QUADMATH_LIBS = @QUADMATH_LIBS@ | ||||
| RANLIB = @RANLIB@ | ||||
| RM = @RM@ | ||||
| RMDIR = @RMDIR@ | ||||
| SED = @SED@ | ||||
| SENDFILE_LIBS = @SENDFILE_LIBS@ | ||||
| SET_MAKE = @SET_MAKE@ | ||||
| SHELL = @SHELL@ | ||||
| SOCKET_LIBS = @SOCKET_LIBS@ | ||||
| SSL_LIBS = @SSL_LIBS@ | ||||
| STRIP = @STRIP@ | ||||
| TRUE = @TRUE@ | ||||
| UCI_LIBS = @UCI_LIBS@ | ||||
| UNICOWS_LIBS = @UNICOWS_LIBS@ | ||||
| VERSION = @VERSION@ | ||||
| abs_builddir = @abs_builddir@ | ||||
| abs_srcdir = @abs_srcdir@ | ||||
| abs_top_builddir = @abs_top_builddir@ | ||||
| abs_top_srcdir = @abs_top_srcdir@ | ||||
| ac_ct_AR = @ac_ct_AR@ | ||||
| ac_ct_CC = @ac_ct_CC@ | ||||
| ac_ct_CXX = @ac_ct_CXX@ | ||||
| ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ | ||||
| am__include = @am__include@ | ||||
| am__leading_dot = @am__leading_dot@ | ||||
| am__quote = @am__quote@ | ||||
| am__tar = @am__tar@ | ||||
| am__untar = @am__untar@ | ||||
| ax_pthread_config = @ax_pthread_config@ | ||||
| bindir = @bindir@ | ||||
| build = @build@ | ||||
| build_alias = @build_alias@ | ||||
| build_cpu = @build_cpu@ | ||||
| build_os = @build_os@ | ||||
| build_vendor = @build_vendor@ | ||||
| builddir = @builddir@ | ||||
| datadir = @datadir@ | ||||
| datarootdir = @datarootdir@ | ||||
| docdir = @docdir@ | ||||
| dvidir = @dvidir@ | ||||
| exec_prefix = @exec_prefix@ | ||||
| host = @host@ | ||||
| host_alias = @host_alias@ | ||||
| host_cpu = @host_cpu@ | ||||
| host_os = @host_os@ | ||||
| host_vendor = @host_vendor@ | ||||
| htmldir = @htmldir@ | ||||
| includedir = @includedir@ | ||||
| infodir = @infodir@ | ||||
| install_sh = @install_sh@ | ||||
| libdir = @libdir@ | ||||
| libexecdir = @libexecdir@ | ||||
| localedir = @localedir@ | ||||
| localstatedir = @localstatedir@ | ||||
| mandir = @mandir@ | ||||
| mkdir_p = @mkdir_p@ | ||||
| oldincludedir = @oldincludedir@ | ||||
| pdfdir = @pdfdir@ | ||||
| prefix = @prefix@ | ||||
| program_transform_name = @program_transform_name@ | ||||
| psdir = @psdir@ | ||||
| runstatedir = @runstatedir@ | ||||
| sbindir = @sbindir@ | ||||
| sharedstatedir = @sharedstatedir@ | ||||
| srcdir = @srcdir@ | ||||
| sysconfdir = @sysconfdir@ | ||||
| target_alias = @target_alias@ | ||||
| top_build_prefix = @top_build_prefix@ | ||||
| top_builddir = @top_builddir@ | ||||
| top_srcdir = @top_srcdir@ | ||||
| AUTOMAKE_OPTIONS = no-dependencies | ||||
| EXTRA_DIST = gencp.sh gencp0.awk gencp1.awk testcp.c uni-case.c uni-trait.c | ||||
| all: all-am | ||||
|  | ||||
| .SUFFIXES: | ||||
| $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps) | ||||
| 	@for dep in $?; do \ | ||||
| 	  case '$(am__configure_deps)' in \ | ||||
| 	    *$$dep*) \ | ||||
| 	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ | ||||
| 	        && { if test -f $@; then exit 0; else break; fi; }; \ | ||||
| 	      exit 1;; \ | ||||
| 	  esac; \ | ||||
| 	done; \ | ||||
| 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/Makefile'; \ | ||||
| 	$(am__cd) $(top_srcdir) && \ | ||||
| 	  $(AUTOMAKE) --foreign tools/Makefile | ||||
| Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | ||||
| 	@case '$?' in \ | ||||
| 	  *config.status*) \ | ||||
| 	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ | ||||
| 	  *) \ | ||||
| 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ | ||||
| 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ | ||||
| 	esac; | ||||
|  | ||||
| $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) | ||||
| 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||||
|  | ||||
| $(top_srcdir)/configure:  $(am__configure_deps) | ||||
| 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||||
| $(ACLOCAL_M4):  $(am__aclocal_m4_deps) | ||||
| 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||||
| $(am__aclocal_m4_deps): | ||||
|  | ||||
| mostlyclean-libtool: | ||||
| 	-rm -f *.lo | ||||
|  | ||||
| clean-libtool: | ||||
| 	-rm -rf .libs _libs | ||||
| tags TAGS: | ||||
|  | ||||
| ctags CTAGS: | ||||
|  | ||||
| cscope cscopelist: | ||||
|  | ||||
|  | ||||
| distdir: $(BUILT_SOURCES) | ||||
| 	$(MAKE) $(AM_MAKEFLAGS) distdir-am | ||||
|  | ||||
| distdir-am: $(DISTFILES) | ||||
| 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||||
| 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||||
| 	list='$(DISTFILES)'; \ | ||||
| 	  dist_files=`for file in $$list; do echo $$file; done | \ | ||||
| 	  sed -e "s|^$$srcdirstrip/||;t" \ | ||||
| 	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ | ||||
| 	case $$dist_files in \ | ||||
| 	  */*) $(MKDIR_P) `echo "$$dist_files" | \ | ||||
| 			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ | ||||
| 			   sort -u` ;; \ | ||||
| 	esac; \ | ||||
| 	for file in $$dist_files; do \ | ||||
| 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ | ||||
| 	  if test -d $$d/$$file; then \ | ||||
| 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ | ||||
| 	    if test -d "$(distdir)/$$file"; then \ | ||||
| 	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||||
| 	    fi; \ | ||||
| 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ | ||||
| 	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ | ||||
| 	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||||
| 	    fi; \ | ||||
| 	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ | ||||
| 	  else \ | ||||
| 	    test -f "$(distdir)/$$file" \ | ||||
| 	    || cp -p $$d/$$file "$(distdir)/$$file" \ | ||||
| 	    || exit 1; \ | ||||
| 	  fi; \ | ||||
| 	done | ||||
| check-am: all-am | ||||
| check: check-am | ||||
| all-am: Makefile | ||||
| installdirs: | ||||
| install: install-am | ||||
| install-exec: install-exec-am | ||||
| install-data: install-data-am | ||||
| uninstall: uninstall-am | ||||
|  | ||||
| install-am: all-am | ||||
| 	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||||
|  | ||||
| installcheck: installcheck-am | ||||
| install-strip: | ||||
| 	if test -z '$(STRIP)'; then \ | ||||
| 	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||||
| 	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||||
| 	      install; \ | ||||
| 	else \ | ||||
| 	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||||
| 	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||||
| 	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ | ||||
| 	fi | ||||
| mostlyclean-generic: | ||||
|  | ||||
| clean-generic: | ||||
|  | ||||
| distclean-generic: | ||||
| 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | ||||
| 	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) | ||||
|  | ||||
| maintainer-clean-generic: | ||||
| 	@echo "This command is intended for maintainers to use" | ||||
| 	@echo "it deletes files that may require special tools to rebuild." | ||||
| clean: clean-am | ||||
|  | ||||
| clean-am: clean-generic clean-libtool mostlyclean-am | ||||
|  | ||||
| distclean: distclean-am | ||||
| 	-rm -f Makefile | ||||
| distclean-am: clean-am distclean-generic | ||||
|  | ||||
| dvi: dvi-am | ||||
|  | ||||
| dvi-am: | ||||
|  | ||||
| html: html-am | ||||
|  | ||||
| html-am: | ||||
|  | ||||
| info: info-am | ||||
|  | ||||
| info-am: | ||||
|  | ||||
| install-data-am: | ||||
|  | ||||
| install-dvi: install-dvi-am | ||||
|  | ||||
| install-dvi-am: | ||||
|  | ||||
| install-exec-am: | ||||
|  | ||||
| install-html: install-html-am | ||||
|  | ||||
| install-html-am: | ||||
|  | ||||
| install-info: install-info-am | ||||
|  | ||||
| install-info-am: | ||||
|  | ||||
| install-man: | ||||
|  | ||||
| install-pdf: install-pdf-am | ||||
|  | ||||
| install-pdf-am: | ||||
|  | ||||
| install-ps: install-ps-am | ||||
|  | ||||
| install-ps-am: | ||||
|  | ||||
| installcheck-am: | ||||
|  | ||||
| maintainer-clean: maintainer-clean-am | ||||
| 	-rm -f Makefile | ||||
| maintainer-clean-am: distclean-am maintainer-clean-generic | ||||
|  | ||||
| mostlyclean: mostlyclean-am | ||||
|  | ||||
| mostlyclean-am: mostlyclean-generic mostlyclean-libtool | ||||
|  | ||||
| pdf: pdf-am | ||||
|  | ||||
| pdf-am: | ||||
|  | ||||
| ps: ps-am | ||||
|  | ||||
| ps-am: | ||||
|  | ||||
| uninstall-am: | ||||
|  | ||||
| .MAKE: install-am install-strip | ||||
|  | ||||
| .PHONY: all all-am check check-am clean clean-generic clean-libtool \ | ||||
| 	cscopelist-am ctags-am distclean distclean-generic \ | ||||
| 	distclean-libtool distdir dvi dvi-am html html-am info info-am \ | ||||
| 	install install-am install-data install-data-am install-dvi \ | ||||
| 	install-dvi-am install-exec install-exec-am install-html \ | ||||
| 	install-html-am install-info install-info-am install-man \ | ||||
| 	install-pdf install-pdf-am install-ps install-ps-am \ | ||||
| 	install-strip installcheck installcheck-am installdirs \ | ||||
| 	maintainer-clean maintainer-clean-generic mostlyclean \ | ||||
| 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ | ||||
| 	tags-am uninstall uninstall-am | ||||
|  | ||||
| .PRECIOUS: Makefile | ||||
|  | ||||
|  | ||||
| # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||||
| # Otherwise a system limit (for SysV at least) may be exceeded. | ||||
| .NOEXPORT: | ||||
							
								
								
									
										23
									
								
								tools/gencp.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								tools/gencp.sh
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,23 @@ | ||||
|  | ||||
| # | ||||
| # get the following unicode mapping files  | ||||
| # from unicode.org before executing this script. | ||||
| #   CP932.TXT CP936.TXT CP949.TXT CP950.TXT | ||||
| # | ||||
|  | ||||
| gencp() { | ||||
| 	name="$1" | ||||
| 	max_gap="$2" | ||||
|  | ||||
| 	qseawk -vMAX_GAP="${max_gap}"  --extraops=on -f gencp1.awk "`echo $name | tr '[a-z]' '[A-Z]'`.TXT" > "${name}.h" 2>/dev/null | ||||
| 	ln -sf "${name}.h" x.h | ||||
| 	cc -o testcp testcp.c | ||||
| 	qseawk --extraops=on -f gencp0.awk "`echo $name | tr '[a-z]' '[A-Z]'`.TXT" > "${name}.0" 2>/dev/null | ||||
| 	./testcp > "${name}.1"  | ||||
| 	diff -q "${name}.0" "${name}.1" && echo "[$name] OK" || echo "[$name] NOT OK" | ||||
| } | ||||
|  | ||||
| gencp cp932 64  # ms shift-jis | ||||
| gencp cp936 96  # ms gbk | ||||
| gencp cp949 128 # ms euc-kr | ||||
| gencp cp950 64  # ms big5 | ||||
							
								
								
									
										54
									
								
								tools/gencp0.awk
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								tools/gencp0.awk
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,54 @@ | ||||
| #global mb_min, mb_max, wc_min, wc_max, mb, wc; | ||||
|  | ||||
| BEGIN { | ||||
| 	mb_min = 0xFFFFFFFF; | ||||
| 	mb_max = 0; | ||||
| 	wc_min = 0xFFFFFFFF; | ||||
| 	wc_max = 0; | ||||
| } | ||||
|  | ||||
| !/^[[:space:]]*#/ { | ||||
| 	if (!($1 ~ /^0x/ && $2 ~ /^0x/)) next; | ||||
|  | ||||
| 	mb = int($1); | ||||
| 	wc = int($2); | ||||
|  | ||||
| 	if (mb < 128)  | ||||
| 	{ | ||||
| 		if (mb != wc) | ||||
| 		{ | ||||
| 			print "ERROR: mb != wc where mb < 128. i can't handle this encoding map"; | ||||
| 			exit 1; | ||||
| 		} | ||||
| 		next; | ||||
| 	} | ||||
|  | ||||
| 	if (mb < mb_min) mb_min = mb; | ||||
| 	if (mb > mb_max) mb_max = mb; | ||||
| 	if (wc < wc_min) wc_min = wc; | ||||
| 	if (wc > mb_max) wc_max = wc; | ||||
|  | ||||
| #	print mb, wc; | ||||
| 	#mb_arr[mb] = wc; | ||||
| 	#wc_arr[wc] = mb; | ||||
| 	if (mb in mb_arr) | ||||
| 		printf ("WARNING: 0x%04X already in mb_arr. old value = 0x%04X, this value = 0x%04x\n", mb, mb_arr[mb], wc) >  "/dev/stderr"; | ||||
| 	else | ||||
| 		mb_arr[mb] = wc; | ||||
|  | ||||
| 	if (wc in wc_arr) | ||||
| 		printf ("WARNING: 0x%04X already in mb_arr. old value = 0x%04X, this value = 0x%04x\n", wc, wc_arr[wc], mb) > "/dev/stderr"; | ||||
| 	else | ||||
| 		wc_arr[wc] = mb; | ||||
| } | ||||
|  | ||||
| END { | ||||
| 	#for (i = mb_min; i <= mb_max; i++) | ||||
| 	for (mb = 0; mb < 0xffff; mb++) | ||||
| 	{ | ||||
| 		#wc = (i in mb_arr)? mb_arr[i]: 0xffff; | ||||
| 		if (mb <= 127) wc = mb; | ||||
| 		else wc = (mb in mb_arr)? mb_arr[mb]: 0xffff; | ||||
| 		printf ("0x%04x 0x%04x\n", mb, wc); | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										202
									
								
								tools/gencp1.awk
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										202
									
								
								tools/gencp1.awk
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,202 @@ | ||||
| #global mb_min, mb_max, wc_min, wc_max, mb, wc; | ||||
|  | ||||
| BEGIN { | ||||
| 	if (ARGC != 2) | ||||
| 	{ | ||||
| 		ERROR_CODE=1 | ||||
| 		exit 1;  | ||||
| 	} | ||||
|  | ||||
| 	mb_min = 0xFFFFFFFF; | ||||
| 	mb_max = 0; | ||||
| 	wc_min = 0xFFFFFFFF; | ||||
| 	wc_max = 0; | ||||
|  | ||||
| 	if (MAX_GAP <= 0) MAX_GAP=64 | ||||
| } | ||||
|  | ||||
| !/^[[:space:]]*#/ { | ||||
| 	if (!($1 ~ /^0x/ && $2 ~ /^0x/)) next; | ||||
|  | ||||
| 	mb = int($1); | ||||
| 	wc = int($2); | ||||
|  | ||||
| 	if (mb < 128)  | ||||
| 	{ | ||||
| 		if (mb != wc) | ||||
| 		{ | ||||
| 			ERROR_CODE = 2; | ||||
| 			exit 1; | ||||
| 		} | ||||
| 		next; | ||||
| 	} | ||||
|  | ||||
| 	if (mb < mb_min) mb_min = mb; | ||||
| 	if (mb > mb_max) mb_max = mb; | ||||
| 	if (wc < wc_min) wc_min = wc; | ||||
| 	if (wc > wc_max) wc_max = wc; | ||||
|  | ||||
| 	if (mb in mb_arr) | ||||
| 		printf ("WARNING: 0x%04X already in mb_arr. old value = 0x%04X, this value = 0x%04x\n", mb, mb_arr[mb], wc) >  "/dev/stderr"; | ||||
| 	else | ||||
| 		mb_arr[mb] = wc; | ||||
| 		 | ||||
| 	if (wc in wc_arr) | ||||
| 		printf ("WARNING: 0x%04X already in wc_arr. old value = 0x%04X, this value = 0x%04x\n", wc, wc_arr[wc], mb) > "/dev/stderr"; | ||||
| 	else | ||||
| 		wc_arr[wc] = mb; | ||||
| } | ||||
|  | ||||
| function emit_simple (name, min, max, arr) { | ||||
| 	printf ("static qse_uint16_t %s_tab[] =\n", name); | ||||
| 	printf ("{\n"); | ||||
| 	for (i = min; i <= max; i++) | ||||
| 	{ | ||||
| 		wc = (i in arr)? arr[i]: 0xffff; | ||||
|  | ||||
| 		printf ("\t0x%04xu", wc); | ||||
| 		if (i < max) printf (",\n"); | ||||
| 		else printf ("\n"); | ||||
| 	} | ||||
| 	printf ("};\n"); | ||||
|  | ||||
| 	printf ("static qse_uint16_t %s (qse_uint16_t c)\n{\n", name); | ||||
| 	#printf ("\tif (c >= 0 && c <= 127) return c;\n"); | ||||
| 	printf ("\tif (c >= 0x%04xu && c <= 0x%04xu) return %s_tab[c - 0x%04xu];\n", min, max, name, min); | ||||
| 	printf ("\treturn 0xffffu;\n"); | ||||
| 	printf ("};\n"); | ||||
| } | ||||
|  | ||||
| function emit_bsearch (name, min, max, arr) { | ||||
| 	prev_in_arr = 0; | ||||
| 	prev_no_in_arr = 0; | ||||
| 	seg_no = 0; | ||||
|  | ||||
| 	for (i = min; i <= max; i++) | ||||
| 	{ | ||||
| 		if (i in arr) | ||||
| 		{ | ||||
| 			if (prev_in_arr <= 0) | ||||
| 			{ | ||||
| 				if (prev_not_in_arr > 0 && prev_not_in_arr <= MAX_GAP) | ||||
| 				{ | ||||
| 					# if the segment whole is not large enough | ||||
| 					# combine two segments together | ||||
| 					for (j = 0; j < prev_not_in_arr; j++)  | ||||
| 						printf (",\n\t0xffffu"); | ||||
| 					seg_last[seg_no] = i; | ||||
| 					printf (",\n"); | ||||
| 				} | ||||
| 				else  | ||||
| 				{ | ||||
| 					if (prev_not_in_arr > 0) | ||||
| 					{ | ||||
| 						printf ("\n}; /* range 0x%x - 0x%x, total %d chars */\n",  | ||||
| 							seg_first[seg_no], seg_last[seg_no],  | ||||
| 							seg_last[seg_no] - seg_first[seg_no] + 1); | ||||
| 						seg_no++; | ||||
| 					} | ||||
|  | ||||
| 					printf ("static qse_uint16_t %s_seg_%d[] =\n{\n", name, seg_no); | ||||
| 					seg_first[seg_no] = i; | ||||
| 					seg_last[seg_no] = i; | ||||
| 				} | ||||
| 			} | ||||
| 			else | ||||
| 			{ | ||||
| 				seg_last[seg_no] = i; | ||||
| 				printf (",\n"); | ||||
| 			} | ||||
|  | ||||
| 			printf ("\t0x%04xu /* 0x%04x */", arr[i], i); | ||||
| 			prev_in_arr++; | ||||
| 			prev_not_in_arr = 0; | ||||
| 		} | ||||
| 		else | ||||
| 		{ | ||||
| 		#	if (prev_in_arr > 0)  | ||||
| 		#	{ | ||||
| 		#		printf ("\n}; /* range 0x%x - 0x%x, total %d chars */\n",  | ||||
| 		#			seg_first[seg_no], seg_last[seg_no],  | ||||
| 		#			seg_last[seg_no] - seg_first[seg_no] + 1); | ||||
| 		#		seg_no++; | ||||
| 		#	} | ||||
|  | ||||
| 			prev_in_arr = 0; | ||||
| 			prev_not_in_arr++; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if (prev_in_arr > 0)  | ||||
| 	{ | ||||
| 		printf ("\n}; /* range 0x%x - 0x%x, total %d chars */\n",  | ||||
| 			seg_first[seg_no], seg_last[seg_no],  | ||||
| 			seg_last[seg_no] - seg_first[seg_no] + 1); | ||||
| 	} | ||||
|  | ||||
| 	printf ("static struct %s_range_t\n{\n\tqse_uint16_t first, last;\n\tqse_uint16_t* seg;\n} %s_range[] =\n{\n", name, name);  | ||||
| 	printf ("\t{ 0x%04xu, 0x%04xu, %s_seg_0 }", seg_first[0], seg_last[0], name);  | ||||
| 	for (i = 1; i <= seg_no; i++) printf (",\n\t{ 0x%04xu, 0x%04xu, %s_seg_%d }", seg_first[i], seg_last[i], name, i);  | ||||
| 	printf ("\n};\n");  | ||||
|  | ||||
| 	printf ("static qse_uint16_t %s (qse_uint16_t c)\n{\n", name); | ||||
|  | ||||
| 	#printf ("\tif (c >= 0 && c <= 127) return c;\n"); | ||||
| 	printf ("\tif (c >= %s_range[0].first &&\n\t    c <= %s_range[QSE_COUNTOF(%s_range)-1].last)\n\t{\n", name, name, name); | ||||
|  | ||||
| 	printf ("\t\tint left = 0, right = QSE_COUNTOF(%s_range) - 1, mid; | ||||
| 		while (left <= right) | ||||
| 		{ | ||||
| 			mid = left + (right - left) / 2; | ||||
|  | ||||
| 			if (c >= %s_range[mid].first && c <= %s_range[mid].last)  | ||||
| 				return %s_range[mid].seg[c - %s_range[mid].first]; | ||||
| 			else if (c > %s_range[mid].last)  | ||||
| 				left = mid + 1;  | ||||
| 			else | ||||
| 				right = mid - 1; | ||||
| 		}\n", name, name, name, name, name, name); | ||||
|  | ||||
| 	printf ("\t}\n\treturn 0xffffu;\n"); | ||||
| 	printf ("}\n"); | ||||
| } | ||||
|  | ||||
| END { | ||||
|  | ||||
| 	if (ERROR_CODE == 1) | ||||
| 	{ | ||||
| 		print "USAGE: gencp.awk codepage-file" > "/dev/stderr"; | ||||
| 		exit 1 | ||||
| 	} | ||||
| 	else if (ERROR_CODE == 2) | ||||
| 	{ | ||||
| 		print "ERROR: mb != wc where mb < 128. i can't handle this encoding map" > "/dev/stderr"; | ||||
| 		exit 1; | ||||
| 	} | ||||
| 	else | ||||
| 	{ | ||||
| 		"date" | getline date; | ||||
| 		printf ("/* This is a privite file automatically generated\n"); | ||||
| 		printf (" * from %s on %s.\n", ARGV[1], date); | ||||
| 		printf (" * Never include this file directly into your source code.\n"); | ||||
| 		printf (" *   mode=%s \n", (SIMPLE_MODE? "simple": "bsearch")); | ||||
| 		printf (" *   mb_min=0x%04x \n", mb_min); | ||||
| 		printf (" *   mb_max=0x%04x \n", mb_max); | ||||
| 		printf (" *   wc_min=0x%04x \n", wc_min); | ||||
| 		printf (" *   wc_max=0x%04x \n", wc_max); | ||||
| 		printf (" */\n\n"); | ||||
|  | ||||
| 		if (SIMPLE_MODE) | ||||
| 		{ | ||||
| 			emit_simple ("mbtowc", mb_min, mb_max, mb_arr); | ||||
| 			printf ("\n/* ----------------------------------------- */\n\n"); | ||||
| 			emit_simple ("wctomb", wc_min, wc_max, wc_arr); | ||||
| 		} | ||||
| 		else | ||||
| 		{ | ||||
| 			emit_bsearch ("mbtowc", mb_min, mb_max, mb_arr); | ||||
| 			printf ("\n/* ----------------------------------------- */\n\n"); | ||||
| 			emit_bsearch ("wctomb", wc_min, wc_max, wc_arr); | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										29
									
								
								tools/testcp.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								tools/testcp.c
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,29 @@ | ||||
| #include <stdio.h> | ||||
|  | ||||
| typedef unsigned short qse_uint16_t; | ||||
| #define QSE_COUNTOF(x) (sizeof(x) / sizeof(x[0])) | ||||
|  | ||||
| #include "x.h" | ||||
|  | ||||
| int main () | ||||
| { | ||||
| 	qse_uint16_t mb; | ||||
| 	for (mb = 0; mb <= 127; mb++) | ||||
| 	{ | ||||
| 		printf ("0x%04x 0x%04x\n", mb, mb); | ||||
| 	} | ||||
| 	for (mb = 128; mb < 0xFFFF; mb++) | ||||
| 	{ | ||||
| 		qse_uint16_t wc = mbtowc(mb); | ||||
| 		printf ("0x%04x 0x%04x", mb, wc); | ||||
| 		if (wc != 0xFFFF) | ||||
| 		{ | ||||
| 			qse_uint16_t xmb = wctomb(wc); | ||||
| 			if (xmb != mb) printf (" (ERROR xmb=0x%04x)", xmb); | ||||
| 			 | ||||
| 		} | ||||
| 		printf ("\n"); | ||||
| 		 | ||||
| 	} | ||||
| 	return 0; | ||||
| } | ||||
							
								
								
									
										177
									
								
								tools/uni-case.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										177
									
								
								tools/uni-case.c
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,177 @@ | ||||
| #include <qse/types.h> | ||||
| #include <locale.h> | ||||
| #include <wchar.h> | ||||
| #include <wctype.h> | ||||
| #include <stdio.h> | ||||
| #include <stddef.h> | ||||
| #include <stdlib.h> | ||||
| #include <string.h> | ||||
| #include <limits.h> | ||||
|  | ||||
| #if QSE_SIZEOF_WCHAR_T == QSE_SIZEOF_SHORT | ||||
|         #define MAX_CHAR 0xFFFF | ||||
| #else | ||||
|         /*#define MAX_CHAR 0xE01EF*/ | ||||
|         #define MAX_CHAR 0x10FFFF | ||||
| #endif | ||||
|  | ||||
| #define CASE_PAGE_SIZE 512 | ||||
| #define MAX_CASE_PAGE_COUNT ((MAX_CHAR + CASE_PAGE_SIZE) / CASE_PAGE_SIZE) | ||||
|  | ||||
| /*  | ||||
|  * short is enough as the diff does not exceed | ||||
|  * the maixmum value of the short type. | ||||
|  */ | ||||
| typedef long int wcdiff_t; | ||||
|  | ||||
| typedef struct case_page_t case_page_t; | ||||
| struct case_page_t | ||||
| { | ||||
| 	size_t no; | ||||
| 	wcdiff_t upper[CASE_PAGE_SIZE]; | ||||
| 	wcdiff_t lower[CASE_PAGE_SIZE];  | ||||
| 	case_page_t* next; | ||||
| }; | ||||
|  | ||||
| size_t case_page_count = 0; | ||||
| case_page_t* case_pages = NULL; | ||||
|  | ||||
| size_t case_map_count = 0; | ||||
| case_page_t* case_maps[MAX_CASE_PAGE_COUNT]; | ||||
|  | ||||
| void make_case_page (qse_wcint_t start, qse_wcint_t end) | ||||
| { | ||||
| 	qse_wcint_t code, c; | ||||
| 	size_t i; | ||||
| 	wcdiff_t upper[CASE_PAGE_SIZE]; | ||||
| 	wcdiff_t lower[CASE_PAGE_SIZE]; | ||||
| 	case_page_t* page; | ||||
|  | ||||
| 	memset (upper, 0, sizeof(upper)); | ||||
| 	memset (lower, 0, sizeof(lower)); | ||||
| 	for (code = start; code <= end; code++)  | ||||
| 	{ | ||||
| 		c = code - start; | ||||
| 		upper[c] = (wcdiff_t)code - (wcdiff_t)towupper(code); | ||||
| 		lower[c] = (wcdiff_t)towlower(code) - (wcdiff_t)code; | ||||
| 	} | ||||
|  | ||||
| 	for (page = case_pages; page != NULL; page = page->next)  | ||||
| 	{ | ||||
| 		if (memcmp (upper, page->upper, sizeof(upper)) == 0 && | ||||
| 		    memcmp (lower, page->lower, sizeof(lower)) == 0)  | ||||
| 		{ | ||||
| 			case_maps[case_map_count++] = page; | ||||
| 			return; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	page = (case_page_t*)malloc (sizeof(case_page_t)); | ||||
| 	page->no = case_page_count++; | ||||
| 	memcpy (page->upper, upper, sizeof(upper)); | ||||
| 	memcpy (page->lower, lower, sizeof(lower)); | ||||
| 	page->next = case_pages; | ||||
|  | ||||
| 	case_pages = page; | ||||
| 	case_maps[case_map_count++] = page; | ||||
| } | ||||
|  | ||||
| void emit_case_page (case_page_t* page, int page_seq) | ||||
| { | ||||
| 	size_t i; | ||||
| 	wcdiff_t upper, lower;  | ||||
| 	int need_or; | ||||
| 	qse_wcint_t c; | ||||
|  | ||||
| 	printf ("static case_page_t case_page_%04X[%u] =\n{\n",  | ||||
| 		(unsigned int)page->no, (unsigned int)CASE_PAGE_SIZE); | ||||
|  | ||||
| 	for (i = 0; i < CASE_PAGE_SIZE; i++)  | ||||
| 	{ | ||||
| 		need_or = 0; | ||||
| 		upper = page->upper[i]; | ||||
| 		lower = page->lower[i]; | ||||
|  | ||||
| 		if (i != 0) printf (",\n"); | ||||
| 		printf ("\t"); | ||||
|  | ||||
| 		if (upper >  SHRT_MAX || upper < SHRT_MIN || | ||||
| 		    lower > SHRT_MAX || lower < SHRT_MIN)  | ||||
| 		{ | ||||
| 			fprintf (stderr, "WARNING: page %u, index %u: value out of range - upper %ld lower %ld\n",  | ||||
| 				(unsigned int)page->no, (unsigned int)i, (long int)upper, (long int)lower); | ||||
| 		} | ||||
|  | ||||
| 		printf ("{%ld, %ld}", (long int)upper, (long int)lower); | ||||
| 	} | ||||
|  | ||||
| 	printf ("\n};\n"); | ||||
| } | ||||
|  | ||||
| void emit_case_map () | ||||
| { | ||||
| 	size_t i; | ||||
|  | ||||
|  | ||||
| 	printf ("static case_page_t* case_map[%u] =\n{\n", (unsigned int)case_map_count); | ||||
|  | ||||
| 	for (i = 0; i < case_map_count; i++) { | ||||
| 		if (i != 0) printf (",\n"); | ||||
| 		printf ("\t /* 0x%X-0x%X */ ",  | ||||
| 			i * CASE_PAGE_SIZE, (i + 1) * CASE_PAGE_SIZE - 1); | ||||
| 		printf ("case_page_%04X", case_maps[i]->no); | ||||
| 	} | ||||
|  | ||||
| 	printf ("\n};\n"); | ||||
| } | ||||
|  | ||||
| static void emit_case_macros (void) | ||||
| { | ||||
| 	printf ("/* generated by tools/uni-case.c */\n\n"); | ||||
| 	printf ("#define CASE_MAX 0x%lX\n\n", (unsigned long)MAX_CHAR); | ||||
| 	printf ("typedef struct case_page_t case_page_t;\n\n"); | ||||
| 	printf ("struct case_page_t {\n"); | ||||
|  | ||||
| 	/* use a 16-bit integer to use less memory.  */ | ||||
| 	printf ("	qse_int16_t upper;\n");  | ||||
| 	printf ("	qse_int16_t lower;\n"); | ||||
| 	printf ("};\n\n"); | ||||
| 	printf ("\n"); | ||||
| } | ||||
|  | ||||
| int main () | ||||
| { | ||||
| 	qse_wcint_t code; | ||||
| 	case_page_t* page; | ||||
| 	char* locale; | ||||
| 	int page_seq = 0; | ||||
|  | ||||
| 	locale = setlocale (LC_ALL, ""); | ||||
| 	if (locale == NULL || | ||||
| 	    (strstr(locale, ".utf8") == NULL && strstr(locale, ".UTF8") == NULL && | ||||
| 	     strstr(locale, ".utf-8") == NULL && strstr(locale, ".UTF-8") == NULL))  | ||||
| 	{ | ||||
| 		fprintf (stderr, "error: the locale should be utf-8 compatible\n"); | ||||
| 		return -1; | ||||
| 	} | ||||
|  | ||||
|  | ||||
| 	for (code = 0; code < MAX_CHAR; code += CASE_PAGE_SIZE)  | ||||
| 	{ | ||||
| 		make_case_page (code, code + CASE_PAGE_SIZE - 1); | ||||
| 	} | ||||
|  | ||||
| 	emit_case_macros (); | ||||
|  | ||||
| 	for (page = case_pages; page != NULL; page = page->next)  | ||||
| 	{ | ||||
| 		emit_case_page (page, page_seq);	 | ||||
| 		printf ("\n"); | ||||
| 		page_seq++; | ||||
| 	} | ||||
|  | ||||
| 	emit_case_map (); | ||||
|  | ||||
| 	return 0; | ||||
| } | ||||
|  | ||||
							
								
								
									
										282
									
								
								tools/uni-trait.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										282
									
								
								tools/uni-trait.c
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,282 @@ | ||||
| #include <qse/types.h> | ||||
| #include <locale.h> | ||||
| #include <wchar.h> | ||||
| #include <wctype.h> | ||||
| #include <stdio.h> | ||||
| #include <stddef.h> | ||||
| #include <stdlib.h> | ||||
| #include <string.h> | ||||
|  | ||||
| #if QSE_SIZEOF_WCHAR_T == QSE_SIZEOF_SHORT | ||||
| 	#define MAX_CHAR 0xFFFF | ||||
| #else | ||||
| 	/*#define MAX_CHAR 0xE01EF*/ | ||||
| 	#define MAX_CHAR 0x10FFFF | ||||
| #endif | ||||
|  | ||||
| #define TRAIT_PAGE_SIZE 256 | ||||
| #define MAX_TRAIT_PAGE_COUNT ((MAX_CHAR + TRAIT_PAGE_SIZE) / TRAIT_PAGE_SIZE) | ||||
|  | ||||
| typedef struct trait_page_t trait_page_t; | ||||
| struct trait_page_t | ||||
| { | ||||
| 	size_t no; | ||||
| 	short traits[TRAIT_PAGE_SIZE]; | ||||
| 	trait_page_t* next; | ||||
| }; | ||||
|  | ||||
| size_t trait_page_count = 0; | ||||
| trait_page_t* trait_pages = NULL; | ||||
|  | ||||
| size_t trait_map_count = 0; | ||||
| trait_page_t* trait_maps[MAX_TRAIT_PAGE_COUNT]; | ||||
|  | ||||
| enum | ||||
| { | ||||
| 	TRAIT_UPPER  = (1 << 0), | ||||
| 	TRAIT_LOWER  = (1 << 1), | ||||
| 	TRAIT_ALPHA  = (1 << 2), | ||||
| 	TRAIT_DIGIT  = (1 << 3), | ||||
| 	TRAIT_XDIGIT = (1 << 4), | ||||
| 	TRAIT_ALNUM  = (1 << 5), | ||||
| 	TRAIT_SPACE  = (1 << 6), | ||||
| 	TRAIT_PRINT  = (1 << 8), | ||||
| 	TRAIT_GRAPH  = (1 << 9), | ||||
| 	TRAIT_CNTRL  = (1 << 10), | ||||
| 	TRAIT_PUNCT  = (1 << 11), | ||||
| 	TRAIT_BLANK  = (1 << 12) | ||||
| }; | ||||
|  | ||||
| int get_trait (qse_wcint_t code) | ||||
| { | ||||
| 	int trait = 0; | ||||
|  | ||||
| 	if (iswupper(code))    trait |= TRAIT_UPPER; | ||||
| 	if (iswlower(code))    trait |= TRAIT_LOWER; | ||||
| 	if (iswalpha(code))    trait |= TRAIT_ALPHA; | ||||
| 	if (iswdigit(code))    trait |= TRAIT_DIGIT; | ||||
| 	if (iswxdigit(code))   trait |= TRAIT_XDIGIT; | ||||
| 	if (iswalnum(code))    trait |= TRAIT_ALNUM; | ||||
| 	if (iswspace(code))    trait |= TRAIT_SPACE; | ||||
| 	if (iswprint(code))    trait |= TRAIT_PRINT; | ||||
| 	if (iswgraph(code))    trait |= TRAIT_GRAPH; | ||||
| 	if (iswcntrl(code))    trait |= TRAIT_CNTRL; | ||||
| 	if (iswpunct(code))    trait |= TRAIT_PUNCT; | ||||
| 	if (iswblank(code))    trait |= TRAIT_BLANK; | ||||
| 	/* | ||||
| 	if (iswascii(code))    trait |= TRAIT_ASCII; | ||||
| 	if (isphonogram(code)) trait |= TRAIT_PHONO; | ||||
| 	if (isideogram(code))  trait |= TRAIT_IDEOG; | ||||
| 	if (isenglish(code))   trait |= TRAIT_ENGLI; | ||||
| 	*/ | ||||
|  | ||||
| 	return trait; | ||||
| } | ||||
|  | ||||
| void make_trait_page (qse_wcint_t start, qse_wcint_t end) | ||||
| { | ||||
| 	qse_wcint_t code; | ||||
| 	size_t i; | ||||
| 	short traits[TRAIT_PAGE_SIZE]; | ||||
| 	trait_page_t* page; | ||||
|  | ||||
| 	memset (traits, 0, sizeof(traits)); | ||||
| 	for (code = start; code <= end; code++) { | ||||
| 		traits[code - start] = get_trait(code); | ||||
| 	} | ||||
|  | ||||
| 	for (page = trait_pages; page != NULL; page = page->next) { | ||||
| 		if (memcmp (traits, page->traits, sizeof(traits)) == 0) { | ||||
| 			trait_maps[trait_map_count++] = page; | ||||
| 			return; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	page = (trait_page_t*)malloc (sizeof(trait_page_t)); | ||||
| 	page->no = trait_page_count++; | ||||
| 	memcpy (page->traits, traits, sizeof(traits)); | ||||
| 	page->next = trait_pages; | ||||
|  | ||||
| 	trait_pages = page; | ||||
| 	trait_maps[trait_map_count++] = page; | ||||
| } | ||||
|  | ||||
| void emit_trait_page (trait_page_t* page) | ||||
| { | ||||
| 	size_t i; | ||||
| 	int trait, need_or; | ||||
|  | ||||
| 	printf ("static qse_uint16_t trait_page_%04X[%u] =\n{\n",  | ||||
| 		(unsigned int)page->no, (unsigned int)TRAIT_PAGE_SIZE); | ||||
|  | ||||
| 	for (i = 0; i < TRAIT_PAGE_SIZE; i++) { | ||||
|  | ||||
| 		need_or = 0; | ||||
| 		trait = page->traits[i]; | ||||
|  | ||||
| 		if (i != 0) printf (",\n"); | ||||
| 		printf ("\t"); | ||||
|  | ||||
| 		if (trait == 0) { | ||||
| 			printf ("0"); | ||||
| 			continue; | ||||
| 		} | ||||
|  | ||||
| 		if (trait & TRAIT_UPPER) { | ||||
| 			if (need_or) printf (" | "); | ||||
| 			printf ("TRAIT_UPPER"); | ||||
| 			need_or = 1; | ||||
| 		} | ||||
|  | ||||
| 		if (trait & TRAIT_LOWER) { | ||||
| 			if (need_or) printf (" | "); | ||||
| 			printf ("TRAIT_LOWER"); | ||||
| 			need_or = 1; | ||||
| 		} | ||||
|  | ||||
| 		if (trait & TRAIT_ALPHA) { | ||||
| 			if (need_or) printf (" | "); | ||||
| 			printf ("TRAIT_ALPHA"); | ||||
| 			need_or = 1; | ||||
| 		} | ||||
|  | ||||
| 		if (trait & TRAIT_DIGIT) { | ||||
| 			if (need_or) printf (" | "); | ||||
| 			printf ("TRAIT_DIGIT"); | ||||
| 			need_or = 1; | ||||
| 		} | ||||
|  | ||||
| 		if (trait & TRAIT_XDIGIT) { | ||||
| 			if (need_or) printf (" | "); | ||||
| 			printf ("TRAIT_XDIGIT"); | ||||
| 			need_or = 1; | ||||
| 		} | ||||
|  | ||||
| 		if (trait & TRAIT_ALNUM) { | ||||
| 			if (need_or) printf (" | "); | ||||
| 			printf ("TRAIT_ALNUM"); | ||||
| 			need_or = 1; | ||||
| 		} | ||||
|  | ||||
| 		if (trait & TRAIT_SPACE) { | ||||
| 			if (need_or) printf (" | "); | ||||
| 			printf ("TRAIT_SPACE"); | ||||
| 			need_or = 1; | ||||
| 		} | ||||
|  | ||||
| 		if (trait & TRAIT_PRINT) { | ||||
| 			if (need_or) printf (" | "); | ||||
| 			printf ("TRAIT_PRINT"); | ||||
| 			need_or = 1; | ||||
| 		} | ||||
|  | ||||
| 		if (trait & TRAIT_GRAPH) { | ||||
| 			if (need_or) printf (" | "); | ||||
| 			printf ("TRAIT_GRAPH"); | ||||
| 			need_or = 1; | ||||
| 		} | ||||
|  | ||||
| 		if (trait & TRAIT_CNTRL) { | ||||
| 			if (need_or) printf (" | "); | ||||
| 			printf ("TRAIT_CNTRL"); | ||||
| 			need_or = 1; | ||||
| 		} | ||||
|  | ||||
| 		if (trait & TRAIT_PUNCT) { | ||||
| 			if (need_or) printf (" | "); | ||||
| 			printf ("TRAIT_PUNCT"); | ||||
| 			need_or = 1; | ||||
| 		} | ||||
|  | ||||
| 		if (trait & TRAIT_BLANK) { | ||||
| 			if (need_or) printf (" | "); | ||||
| 			printf ("TRAIT_BLANK"); | ||||
| 			need_or = 1; | ||||
| 		} | ||||
|  | ||||
|  | ||||
| 		/* | ||||
| 		if (trait & TRAIT_ASCII) { | ||||
| 			if (need_or) printf (" | "); | ||||
| 			printf ("TRAIT_ASCII"); | ||||
| 			need_or = 1; | ||||
| 		} | ||||
|  | ||||
| 		if (trait & TRAIT_IDEOG) { | ||||
| 			if (need_or) printf (" | "); | ||||
| 			printf ("TRAIT_IDEOG"); | ||||
| 			need_or = 1; | ||||
| 		} | ||||
|  | ||||
| 		if (trait & TRAIT_PHONO) { | ||||
| 			if (need_or) printf (" | "); | ||||
| 			printf ("TRAIT_PHONO"); | ||||
| 			need_or = 1; | ||||
| 		} | ||||
|  | ||||
| 		if (trait & TRAIT_ENGLI) { | ||||
| 			if (need_or) printf (" | "); | ||||
| 			printf ("TRAIT_ENGLI"); | ||||
| 			need_or = 1; | ||||
| 		} | ||||
| 		*/ | ||||
|  | ||||
| 	} | ||||
|  | ||||
| 	printf ("\n};\n"); | ||||
| } | ||||
|  | ||||
| void emit_trait_map () | ||||
| { | ||||
| 	size_t i; | ||||
|  | ||||
| 	printf ("static qse_uint16_t* trait_map[%u] =\n{\n", (unsigned int)trait_map_count); | ||||
|  | ||||
| 	for (i = 0; i < trait_map_count; i++) { | ||||
| 		if (i != 0) printf (",\n"); | ||||
| 		printf ("\t /* 0x%X-0x%X */ ",  | ||||
| 			i * TRAIT_PAGE_SIZE, (i + 1) * TRAIT_PAGE_SIZE - 1); | ||||
| 		printf ("trait_page_%04X", trait_maps[i]->no); | ||||
| 	} | ||||
|  | ||||
| 	printf ("\n};\n"); | ||||
| } | ||||
|  | ||||
| static void emit_trait_macros (void) | ||||
| { | ||||
| 	printf ("/* generated by tools/uni-trait.c */\n\n"); | ||||
| 	printf ("#define TRAIT_MAX 0x%lX\n", (unsigned long)MAX_CHAR); | ||||
| 	printf ("\n"); | ||||
| } | ||||
|  | ||||
| int main () | ||||
| { | ||||
| 	qse_wcint_t code; | ||||
| 	trait_page_t* page; | ||||
| 	char* locale; | ||||
|  | ||||
| 	locale = setlocale (LC_ALL, ""); | ||||
| 	if (locale == NULL || | ||||
| 	    (strstr(locale, ".utf8") == NULL && strstr(locale, ".UTF8") == NULL && | ||||
| 	     strstr(locale, ".utf-8") == NULL && strstr(locale, ".UTF-8") == NULL)) { | ||||
| 		fprintf (stderr, "error: the locale should be utf-8 compatible\n"); | ||||
| 		return -1; | ||||
| 	} | ||||
|  | ||||
|  | ||||
| 	for (code = 0; code < MAX_CHAR; code += TRAIT_PAGE_SIZE) { | ||||
| 		make_trait_page (code, code + TRAIT_PAGE_SIZE - 1); | ||||
| 	} | ||||
|  | ||||
| 	emit_trait_macros (); | ||||
|  | ||||
| 	for (page = trait_pages; page != NULL; page = page->next) { | ||||
| 		emit_trait_page (page);	 | ||||
| 		printf ("\n"); | ||||
| 	} | ||||
|  | ||||
| 	emit_trait_map (); | ||||
|  | ||||
| 	return 0; | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user