commit 043a24a4ea88d639a1cbb97b0a816033b516b0b2 Author: hyung-hwan Date: Fri Dec 13 04:29:58 2019 +0000 starting hawk. goodbye to qseawk diff --git a/hawk/Makefile.am b/hawk/Makefile.am new file mode 100644 index 00000000..655fcb6e --- /dev/null +++ b/hawk/Makefile.am @@ -0,0 +1,16 @@ +AUTOMAKE_OPTION = foreign +ACLOCAL_AMFLAGS = -I m4 + +EXTRA_DIST = +SUBDIRS = + +if ENABLE_STATIC_MODULE +SUBDIRS += tools mod lib bin +else +SUBDIRS += tools lib mod bin +endif + +DIST_SUBDIRS = $(SUBDIRS) t + +distclean-local: + @rm -rf $(top_srcdir)/autom4te.cache diff --git a/hawk/Makefile.in b/hawk/Makefile.in new file mode 100644 index 00000000..389de403 --- /dev/null +++ b/hawk/Makefile.in @@ -0,0 +1,846 @@ +# Makefile.in generated by automake 1.16.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2018 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@ +@ENABLE_STATIC_MODULE_TRUE@am__append_1 = tools mod lib bin +@ENABLE_STATIC_MODULE_FALSE@am__append_2 = tools lib mod bin +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ + $(top_srcdir)/m4/ax_cxx_namespace.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)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/lib/hawk-cfg.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 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir distdir-am dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/ac/ar-lib \ + $(top_srcdir)/ac/compile $(top_srcdir)/ac/config.guess \ + $(top_srcdir)/ac/config.sub $(top_srcdir)/ac/install-sh \ + $(top_srcdir)/ac/ltmain.sh $(top_srcdir)/ac/missing ac/ar-lib \ + ac/compile ac/config.guess ac/config.sub ac/install-sh \ + ac/ltmain.sh ac/missing +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +DIST_TARGETS = dist-gzip +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +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@ +DYNCALL_LIBS = @DYNCALL_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FFI_LIBS = @FFI_LIBS@ +FGREP = @FGREP@ +GREP = @GREP@ +HAVE_CXX = @HAVE_CXX@ +HAWK_PROJECT_AUTHOR = @HAWK_PROJECT_AUTHOR@ +HAWK_PROJECT_URL = @HAWK_PROJECT_URL@ +HAWK_SIZEOF_CHAR = @HAWK_SIZEOF_CHAR@ +HAWK_SIZEOF_DOUBLE = @HAWK_SIZEOF_DOUBLE@ +HAWK_SIZEOF_FLOAT = @HAWK_SIZEOF_FLOAT@ +HAWK_SIZEOF_INT = @HAWK_SIZEOF_INT@ +HAWK_SIZEOF_LONG = @HAWK_SIZEOF_LONG@ +HAWK_SIZEOF_LONG_DOUBLE = @HAWK_SIZEOF_LONG_DOUBLE@ +HAWK_SIZEOF_LONG_LONG = @HAWK_SIZEOF_LONG_LONG@ +HAWK_SIZEOF_OFF64_T = @HAWK_SIZEOF_OFF64_T@ +HAWK_SIZEOF_OFF_T = @HAWK_SIZEOF_OFF_T@ +HAWK_SIZEOF_SHORT = @HAWK_SIZEOF_SHORT@ +HAWK_SIZEOF_VOID_P = @HAWK_SIZEOF_VOID_P@ +HAWK_SIZEOF_WCHAR_T = @HAWK_SIZEOF_WCHAR_T@ +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@ +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@ +QUADMATH_LIBS = @QUADMATH_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SOCKET_LIBS = @SOCKET_LIBS@ +STRIP = @STRIP@ +UNICOWS_LIBS = @UNICOWS_LIBS@ +UNWIND_LIBS = @UNWIND_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@ +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_OPTION = foreign +ACLOCAL_AMFLAGS = -I m4 +EXTRA_DIST = +SUBDIRS = $(am__append_1) $(am__append_2) +DIST_SUBDIRS = $(SUBDIRS) t +all: all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @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 + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +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-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-local distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + clean-libtool cscope cscopelist-am ctags ctags-am dist \ + dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ + dist-xz dist-zip distcheck distclean distclean-generic \ + distclean-libtool distclean-local distclean-tags \ + distcleancheck distdir distuninstallcheck 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 installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am + +.PRECIOUS: Makefile + + +distclean-local: + @rm -rf $(top_srcdir)/autom4te.cache + +# 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: diff --git a/hawk/ac/ar-lib b/hawk/ac/ar-lib new file mode 100755 index 00000000..0baa4f60 --- /dev/null +++ b/hawk/ac/ar-lib @@ -0,0 +1,270 @@ +#! /bin/sh +# Wrapper for Microsoft lib.exe + +me=ar-lib +scriptversion=2012-03-01.08; # UTC + +# Copyright (C) 2010-2018 Free Software Foundation, Inc. +# Written by Peter Rosin . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + + +# func_error message +func_error () +{ + echo "$me: $1" 1>&2 + exit 1 +} + +file_conv= + +# func_file_conv build_file +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv in + mingw) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_at_file at_file operation archive +# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE +# for each of them. +# When interpreting the content of the @FILE, do NOT use func_file_conv, +# since the user would need to supply preconverted file names to +# binutils ar, at least for MinGW. +func_at_file () +{ + operation=$2 + archive=$3 + at_file_contents=`cat "$1"` + eval set x "$at_file_contents" + shift + + for member + do + $AR -NOLOGO $operation:"$member" "$archive" || exit $? + done +} + +case $1 in + '') + func_error "no command. Try '$0 --help' for more information." + ;; + -h | --h*) + cat <. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/hawk/ac/config.guess b/hawk/ac/config.guess new file mode 100755 index 00000000..b33c9e89 --- /dev/null +++ b/hawk/ac/config.guess @@ -0,0 +1,1486 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2018 Free Software Foundation, Inc. + +timestamp='2018-08-29' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# 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 +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# +# Please send patches to . + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2018 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 1 2 13 15 +trap 'exitcode=$?; test -z "$tmp" || rm -fr "$tmp"; exit $exitcode' 0 + +set_cc_for_build() { + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD="$driver" + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if test -f /.attbin/uname ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case "$UNAME_SYSTEM" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + set_cc_for_build + cat <<-EOF > "$dummy.c" + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + + # If ldd exists, use it to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + "/sbin/$sysctl" 2>/dev/null || \ + "/usr/sbin/$sysctl" 2>/dev/null || \ + echo unknown)` + case "$UNAME_MACHINE_ARCH" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine="${arch}${endian}"-unknown + ;; + *) machine="$UNAME_MACHINE_ARCH"-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently (or will in the future) and ABI. + case "$UNAME_MACHINE_ARCH" in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # Determine ABI tags. + case "$UNAME_MACHINE_ARCH" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "$UNAME_VERSION" in + Debian*) + release='-gnu' + ;; + *) + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "$machine-${os}${release}${abi-}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" + exit ;; + *:ekkoBSD:*:*) + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" + exit ;; + *:SolidBSD:*:*) + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:MirBSD:*:*) + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:Sortix:*:*) + echo "$UNAME_MACHINE"-unknown-sortix + exit ;; + *:Redox:*:*) + echo "$UNAME_MACHINE"-unknown-redox + exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE=alpha ;; + "EV4.5 (21064)") + UNAME_MACHINE=alpha ;; + "LCA4 (21066/21068)") + UNAME_MACHINE=alpha ;; + "EV5 (21164)") + UNAME_MACHINE=alphaev5 ;; + "EV5.6 (21164A)") + UNAME_MACHINE=alphaev56 ;; + "EV5.6 (21164PC)") + UNAME_MACHINE=alphapca56 ;; + "EV5.7 (21164PC)") + UNAME_MACHINE=alphapca57 ;; + "EV6 (21264)") + UNAME_MACHINE=alphaev6 ;; + "EV6.7 (21264A)") + UNAME_MACHINE=alphaev67 ;; + "EV6.8CB (21264C)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8AL (21264B)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8CX (21264D)") + UNAME_MACHINE=alphaev68 ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE=alphaev69 ;; + "EV7 (21364)") + UNAME_MACHINE=alphaev7 ;; + "EV7.9 (21364A)") + UNAME_MACHINE=alphaev79 ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo "$UNAME_MACHINE"-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo "$UNAME_MACHINE"-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix"$UNAME_RELEASE" + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux"$UNAME_RELEASE" + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + UNAME_REL="`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + case `isainfo -b` in + 32) + echo i386-pc-solaris2"$UNAME_REL" + ;; + 64) + echo x86_64-pc-solaris2"$UNAME_REL" + ;; + esac + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos"$UNAME_RELEASE" + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos"$UNAME_RELEASE" + ;; + sun4) + echo sparc-sun-sunos"$UNAME_RELEASE" + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos"$UNAME_RELEASE" + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint"$UNAME_RELEASE" + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint"$UNAME_RELEASE" + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint"$UNAME_RELEASE" + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten"$UNAME_RELEASE" + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten"$UNAME_RELEASE" + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix"$UNAME_RELEASE" + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix"$UNAME_RELEASE" + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix"$UNAME_RELEASE" + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos"$UNAME_RELEASE" + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] + then + if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ + [ "$TARGET_BINARY_INTERFACE"x = x ] + then + echo m88k-dg-dgux"$UNAME_RELEASE" + else + echo m88k-dg-dguxbcs"$UNAME_RELEASE" + fi + else + echo i586-dg-dgux"$UNAME_RELEASE" + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + fi + echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + fi + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + case "$UNAME_MACHINE" in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "$sc_cpu_version" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "$sc_kernel_bits" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "$HP_ARCH" = "" ]; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ "$HP_ARCH" = hppa2.0w ] + then + set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH=hppa2.0w + else + HP_ARCH=hppa64 + fi + fi + echo "$HP_ARCH"-hp-hpux"$HPUX_REV" + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux"$HPUX_REV" + exit ;; + 3050*:HI-UX:*:*) + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo "$UNAME_MACHINE"-unknown-osf1mk + else + echo "$UNAME_MACHINE"-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi"$UNAME_RELEASE" + exit ;; + *:BSD/OS:*:*) + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" + exit ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi + else + echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf + fi + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case "$UNAME_PROCESSOR" in + amd64) + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; + esac + echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" + exit ;; + i*:CYGWIN*:*) + echo "$UNAME_MACHINE"-pc-cygwin + exit ;; + *:MINGW64*:*) + echo "$UNAME_MACHINE"-pc-mingw64 + exit ;; + *:MINGW*:*) + echo "$UNAME_MACHINE"-pc-mingw32 + exit ;; + *:MSYS*:*) + echo "$UNAME_MACHINE"-pc-msys + exit ;; + i*:PW*:*) + echo "$UNAME_MACHINE"-pc-pw32 + exit ;; + *:Interix*:*) + case "$UNAME_MACHINE" in + x86) + echo i586-pc-interix"$UNAME_RELEASE" + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix"$UNAME_RELEASE" + exit ;; + IA64) + echo ia64-unknown-interix"$UNAME_RELEASE" + exit ;; + esac ;; + i*:UWIN*:*) + echo "$UNAME_MACHINE"-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + *:GNU:*:*) + # the GNU system + echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" + exit ;; + *:Minix:*:*) + echo "$UNAME_MACHINE"-unknown-minix + exit ;; + aarch64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + arm*:Linux:*:*) + set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi + else + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + cris:Linux:*:*) + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + crisv32:Linux:*:*) + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + e2k:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + frv:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + hexagon:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + i*86:Linux:*:*) + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + exit ;; + ia64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + k1om:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + m32r*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + m68*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" + test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } + ;; + mips64el:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-"$LIBC" + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-"$LIBC" + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-"$LIBC" + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; + PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; + *) echo hppa-unknown-linux-"$LIBC" ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-"$LIBC" + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-"$LIBC" + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-"$LIBC" + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-"$LIBC" + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" + exit ;; + sh64*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + sh*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + tile*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + vax:Linux:*:*) + echo "$UNAME_MACHINE"-dec-linux-"$LIBC" + exit ;; + x86_64:Linux:*:*) + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + exit ;; + xtensa*:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo "$UNAME_MACHINE"-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo "$UNAME_MACHINE"-unknown-stop + exit ;; + i*86:atheos:*:*) + echo "$UNAME_MACHINE"-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo "$UNAME_MACHINE"-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos"$UNAME_RELEASE" + exit ;; + i*86:*DOS:*:*) + echo "$UNAME_MACHINE"-pc-msdosdjgpp + exit ;; + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" + else + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" + else + echo "$UNAME_MACHINE"-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos"$UNAME_RELEASE" + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos"$UNAME_RELEASE" + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos"$UNAME_RELEASE" + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos"$UNAME_RELEASE" + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv"$UNAME_RELEASE" + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo "$UNAME_MACHINE"-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo "$UNAME_MACHINE"-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux"$UNAME_RELEASE" + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv"$UNAME_RELEASE" + else + echo mips-unknown-sysv"$UNAME_RELEASE" + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux"$UNAME_RELEASE" + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux"$UNAME_RELEASE" + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux"$UNAME_RELEASE" + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux"$UNAME_RELEASE" + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux"$UNAME_RELEASE" + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux"$UNAME_RELEASE" + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux"$UNAME_RELEASE" + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody"$UNAME_RELEASE" + exit ;; + *:Rhapsody:*:*) + echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = x86; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSV-*:NONSTOP_KERNEL:*:*) + echo nsv-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk"$UNAME_RELEASE" + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + # shellcheck disable=SC2154 + if test "$cputype" = 386; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo "$UNAME_MACHINE"-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux"$UNAME_RELEASE" + exit ;; + *:DragonFly:*:*) + echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "$UNAME_MACHINE" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" + exit ;; + i*86:rdos:*:*) + echo "$UNAME_MACHINE"-pc-rdos + exit ;; + i*86:AROS:*:*) + echo "$UNAME_MACHINE"-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo "$UNAME_MACHINE"-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; +esac + +echo "$0: unable to guess system type" >&2 + +case "$UNAME_MACHINE:$UNAME_SYSTEM" in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 </dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/hawk/ac/config.sub b/hawk/ac/config.sub new file mode 100755 index 00000000..b51fb8cd --- /dev/null +++ b/hawk/ac/config.sub @@ -0,0 +1,1790 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2018 Free Software Foundation, Inc. + +timestamp='2018-08-29' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# 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 +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2018 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo "$1" + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Split fields of configuration type +IFS="-" read -r field1 field2 field3 field4 <&2 + exit 1 + ;; + *-*-*-*) + basic_machine=$field1-$field2 + os=$field3-$field4 + ;; + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ + | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova*) + basic_machine=$field1 + os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + os=linux-android + ;; + *) + basic_machine=$field1-$field2 + os=$field3 + ;; + esac + ;; + *-*) + # A lone config we happen to match not fitting any patern + case $field1-$field2 in + decstation-3100) + basic_machine=mips-dec + os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ + | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ + | unicom* | ibm* | next | hp | isi* | apollo | altos* \ + | convergent* | ncr* | news | 32* | 3600* | 3100* \ + | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ + | ultra | tti* | harris | dolphin | highlevel | gould \ + | cbm | ns | masscomp | apple | axis | knuth | cray \ + | microblaze* | sim | cisco \ + | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + os= + ;; + *) + basic_machine=$field1 + os=$field2 + ;; + esac + ;; + esac + ;; + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + os=bsd + ;; + a29khif) + basic_machine=a29k-amd + os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=scout + ;; + alliant) + basic_machine=fx80-alliant + os= + ;; + altos | altos3068) + basic_machine=m68k-altos + os= + ;; + am29k) + basic_machine=a29k-none + os=bsd + ;; + amdahl) + basic_machine=580-amdahl + os=sysv + ;; + amiga) + basic_machine=m68k-unknown + os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=bsd + ;; + aros) + basic_machine=i386-pc + os=aros + ;; + aux) + basic_machine=m68k-apple + os=aux + ;; + balance) + basic_machine=ns32k-sequent + os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=linux + ;; + cegcc) + basic_machine=arm-unknown + os=cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=bsd + ;; + convex-c2) + basic_machine=c2-convex + os=bsd + ;; + convex-c32) + basic_machine=c32-convex + os=bsd + ;; + convex-c34) + basic_machine=c34-convex + os=bsd + ;; + convex-c38) + basic_machine=c38-convex + os=bsd + ;; + cray) + basic_machine=j90-cray + os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + os= + ;; + da30) + basic_machine=m68k-da30 + os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + os= + ;; + delta88) + basic_machine=m88k-motorola + os=sysv3 + ;; + dicos) + basic_machine=i686-pc + os=dicos + ;; + djgpp) + basic_machine=i586-pc + os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=ose + ;; + gmicro) + basic_machine=tron-gmicro + os=sysv + ;; + go32) + basic_machine=i386-pc + os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=hms + ;; + harris) + basic_machine=m88k-harris + os=sysv3 + ;; + hp300) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=hpux + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=proelf + ;; + i386mach) + basic_machine=i386-mach + os=mach + ;; + vsta) + basic_machine=i386-pc + os=vsta + ;; + isi68 | isi) + basic_machine=m68k-isi + os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + os=sysv + ;; + merlin) + basic_machine=ns32k-utek + os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + os=coff + ;; + morphos) + basic_machine=powerpc-unknown + os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=moxiebox + ;; + msdos) + basic_machine=i386-pc + os=msdos + ;; + msys) + basic_machine=i686-pc + os=msys + ;; + mvs) + basic_machine=i370-ibm + os=mvs + ;; + nacl) + basic_machine=le32-unknown + os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=newsos + ;; + news1000) + basic_machine=m68030-sony + os=newsos + ;; + necv70) + basic_machine=v70-nec + os=sysv + ;; + nh3000) + basic_machine=m68k-harris + os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=cxux + ;; + nindy960) + basic_machine=i960-intel + os=nindy + ;; + mon960) + basic_machine=i960-intel + os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=ose + ;; + os68k) + basic_machine=m68k-none + os=os68k + ;; + paragon) + basic_machine=i860-intel + os=osf + ;; + parisc) + basic_machine=hppa-unknown + os=linux + ;; + pw32) + basic_machine=i586-unknown + os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=rdos + ;; + rdos32) + basic_machine=i386-pc + os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=coff + ;; + sa29200) + basic_machine=a29k-amd + os=udi + ;; + sei) + basic_machine=mips-sei + os=seiux + ;; + sequent) + basic_machine=i386-sequent + os= + ;; + sps7) + basic_machine=m68k-bull + os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + os= + ;; + stratus) + basic_machine=i860-stratus + os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + os= + ;; + sun2os3) + basic_machine=m68000-sun + os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + os= + ;; + sun3os3) + basic_machine=m68k-sun + os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + os= + ;; + sun4os3) + basic_machine=sparc-sun + os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + os= + ;; + sv1) + basic_machine=sv1-cray + os=unicos + ;; + symmetry) + basic_machine=i386-sequent + os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=unicos + ;; + t90) + basic_machine=t90-cray + os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + os=tpf + ;; + udi29k) + basic_machine=a29k-amd + os=udi + ;; + ultra3) + basic_machine=a29k-nyu + os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=none + ;; + vaxv) + basic_machine=vax-dec + os=sysv + ;; + vms) + basic_machine=vax-dec + os=vms + ;; + vxworks960) + basic_machine=i960-wrs + os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=vxworks + ;; + xbox) + basic_machine=i686-pc + os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + os=unicos + ;; + *) + basic_machine=$1 + os= + ;; + esac + ;; +esac + +# Decode 1-component or ad-hoc basic machines +case $basic_machine in + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) + cpu=hppa1.1 + vendor=winbond + ;; + op50n) + cpu=hppa1.1 + vendor=oki + ;; + op60c) + cpu=hppa1.1 + vendor=oki + ;; + ibm*) + cpu=i370 + vendor=ibm + ;; + orion105) + cpu=clipper + vendor=highlevel + ;; + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple + ;; + pmac | pmac-mpw) + cpu=powerpc + vendor=apple + ;; + + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + cpu=m68000 + vendor=att + ;; + 3b*) + cpu=we32k + vendor=att + ;; + bluegene*) + cpu=powerpc + vendor=ibm + os=cnk + ;; + decsystem10* | dec10*) + cpu=pdp10 + vendor=dec + os=tops10 + ;; + decsystem20* | dec20*) + cpu=pdp10 + vendor=dec + os=tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + cpu=m68k + vendor=motorola + ;; + dpx2*) + cpu=m68k + vendor=bull + os=sysv3 + ;; + encore | umax | mmax) + cpu=ns32k + vendor=encore + ;; + elxsi) + cpu=elxsi + vendor=elxsi + os=${os:-bsd} + ;; + fx2800) + cpu=i860 + vendor=alliant + ;; + genix) + cpu=ns32k + vendor=ns + ;; + h3050r* | hiux*) + cpu=hppa1.1 + vendor=hitachi + os=hiuxwe2 + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + cpu=m68000 + vendor=hp + ;; + hp9k3[2-9][0-9]) + cpu=m68k + vendor=hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + i*86v32) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=sysv32 + ;; + i*86v4*) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=sysv4 + ;; + i*86v) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=sysv + ;; + i*86sol2) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=solaris2 + ;; + j90 | j90-cray) + cpu=j90 + vendor=cray + os=${os:-unicos} + ;; + iris | iris4d) + cpu=mips + vendor=sgi + case $os in + irix*) + ;; + *) + os=irix4 + ;; + esac + ;; + miniframe) + cpu=m68000 + vendor=convergent + ;; + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + cpu=m68k + vendor=atari + os=mint + ;; + news-3600 | risc-news) + cpu=mips + vendor=sony + os=newsos + ;; + next | m*-next) + cpu=m68k + vendor=next + case $os in + nextstep* ) + ;; + ns2*) + os=nextstep2 + ;; + *) + os=nextstep3 + ;; + esac + ;; + np1) + cpu=np1 + vendor=gould + ;; + op50n-* | op60c-*) + cpu=hppa1.1 + vendor=oki + os=proelf + ;; + pa-hitachi) + cpu=hppa1.1 + vendor=hitachi + os=hiuxwe2 + ;; + pbd) + cpu=sparc + vendor=tti + ;; + pbb) + cpu=m68k + vendor=tti + ;; + pc532) + cpu=ns32k + vendor=pc532 + ;; + pn) + cpu=pn + vendor=gould + ;; + power) + cpu=power + vendor=ibm + ;; + ps2) + cpu=i386 + vendor=ibm + ;; + rm[46]00) + cpu=mips + vendor=siemens + ;; + rtpc | rtpc-*) + cpu=romp + vendor=ibm + ;; + sde) + cpu=mipsisa32 + vendor=sde + os=${os:-elf} + ;; + simso-wrs) + cpu=sparclite + vendor=wrs + os=vxworks + ;; + tower | tower-32) + cpu=m68k + vendor=ncr + ;; + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu + ;; + w65) + cpu=w65 + vendor=wdc + ;; + w89k-*) + cpu=hppa1.1 + vendor=winbond + os=proelf + ;; + none) + cpu=none + vendor=none + ;; + leon|leon[3-9]) + cpu=sparc + vendor=$basic_machine + ;; + leon-*|leon[3-9]-*) + cpu=sparc + vendor=`echo "$basic_machine" | sed 's/-.*//'` + ;; + + *-*) + IFS="-" read -r cpu vendor <&2 + exit 1 + ;; + esac + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $vendor in + digital*) + vendor=dec + ;; + commodore*) + vendor=cbm + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x$os != x ] +then +case $os in + # First match some system type aliases that might get confused + # with valid system types. + # solaris* is a basic system type, with this one exception. + auroraux) + os=auroraux + ;; + bluegene*) + os=cnk + ;; + solaris1 | solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + solaris) + os=solaris2 + ;; + unixware*) + os=sysv4.2uw + ;; + gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # es1800 is here to avoid being matched by es* (a different OS) + es1800*) + os=ose + ;; + # Some version numbers need modification + chorusos*) + os=chorusos + ;; + isc) + os=isc2.2 + ;; + sco6) + os=sco5v6 + ;; + sco5) + os=sco3.2v5 + ;; + sco4) + os=sco3.2v4 + ;; + sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + ;; + sco3.2v[4-9]* | sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + ;; + scout) + # Don't match below + ;; + sco*) + os=sco3.2v2 + ;; + psos*) + os=psos + ;; + # Now accept the basic system types. + # The portable systems comes first. + # Each alternative MUST end in a * to match a version number. + # sysv* is not here because it comes later, after sysvr4. + gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | kopensolaris* | plan9* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* \ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ + | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ + | knetbsd* | mirbsd* | netbsd* \ + | bitrig* | openbsd* | solidbsd* | libertybsd* \ + | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ + | chorusrdb* | cegcc* | glidix* \ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ + | linux-newlib* | linux-musl* | linux-uclibc* \ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \ + | interix* | uwin* | mks* | rhapsody* | darwin* \ + | openstep* | oskit* | conix* | pw32* | nonstopux* \ + | storm-chaos* | tops10* | tenex* | tops20* | its* \ + | os2* | vos* | palmos* | uclinux* | nucleus* \ + | morphos* | superux* | rtmk* | windiss* \ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + qnx*) + case $cpu in + x86 | i*86) + ;; + *) + os=nto-$os + ;; + esac + ;; + hiux*) + os=hiuxwe2 + ;; + nto-qnx*) + ;; + nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + sim | xray | os68k* | v88r* \ + | windows* | osx | abug | netware* | os9* \ + | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) + ;; + linux-dietlibc) + os=linux-dietlibc + ;; + linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + lynx*178) + os=lynxos178 + ;; + lynx*5) + os=lynxos5 + ;; + lynx*) + os=lynxos + ;; + mac*) + os=`echo "$os" | sed -e 's|mac|macos|'` + ;; + opened*) + os=openedition + ;; + os400*) + os=os400 + ;; + sunos5*) + os=`echo "$os" | sed -e 's|sunos5|solaris2|'` + ;; + sunos6*) + os=`echo "$os" | sed -e 's|sunos6|solaris3|'` + ;; + wince*) + os=wince + ;; + utek*) + os=bsd + ;; + dynix*) + os=bsd + ;; + acis*) + os=aos + ;; + atheos*) + os=atheos + ;; + syllable*) + os=syllable + ;; + 386bsd) + os=bsd + ;; + ctix* | uts*) + os=sysv + ;; + nova*) + os=rtmk-nova + ;; + ns2) + os=nextstep2 + ;; + nsk*) + os=nsk + ;; + # Preserve the version number of sinix5. + sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + sinix*) + os=sysv4 + ;; + tpf*) + os=tpf + ;; + triton*) + os=sysv3 + ;; + oss*) + os=sysv3 + ;; + svr4*) + os=sysv4 + ;; + svr3) + os=sysv3 + ;; + sysvr4) + os=sysv4 + ;; + # This must come after sysvr4. + sysv*) + ;; + ose*) + os=ose + ;; + *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) + os=mint + ;; + zvmoe) + os=zvmoe + ;; + dicos*) + os=dicos + ;; + pikeos*) + # Until real need of OS specific support for + # particular features comes up, bare metal + # configurations are quite functional. + case $cpu in + arm*) + os=eabi + ;; + *) + os=elf + ;; + esac + ;; + nacl*) + ;; + ios) + ;; + none) + ;; + *-eabi) + ;; + *) + echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $cpu-$vendor in + score-*) + os=elf + ;; + spu-*) + os=elf + ;; + *-acorn) + os=riscix1.2 + ;; + arm*-rebel) + os=linux + ;; + arm*-semi) + os=aout + ;; + c4x-* | tic4x-*) + os=coff + ;; + c8051-*) + os=elf + ;; + clipper-intergraph) + os=clix + ;; + hexagon-*) + os=elf + ;; + tic54x-*) + os=coff + ;; + tic55x-*) + os=coff + ;; + tic6x-*) + os=coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=tops20 + ;; + pdp11-*) + os=none + ;; + *-dec | vax-*) + os=ultrix4.2 + ;; + m68*-apollo) + os=domain + ;; + i386-sun) + os=sunos4.0.2 + ;; + m68000-sun) + os=sunos3 + ;; + m68*-cisco) + os=aout + ;; + mep-*) + os=elf + ;; + mips*-cisco) + os=elf + ;; + mips*-*) + os=elf + ;; + or32-*) + os=coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=sysv3 + ;; + sparc-* | *-sun) + os=sunos4.1.1 + ;; + pru-*) + os=elf + ;; + *-be) + os=beos + ;; + *-ibm) + os=aix + ;; + *-knuth) + os=mmixware + ;; + *-wec) + os=proelf + ;; + *-winbond) + os=proelf + ;; + *-oki) + os=proelf + ;; + *-hp) + os=hpux + ;; + *-hitachi) + os=hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=sysv + ;; + *-cbm) + os=amigaos + ;; + *-dg) + os=dgux + ;; + *-dolphin) + os=sysv3 + ;; + m68k-ccur) + os=rtu + ;; + m88k-omron*) + os=luna + ;; + *-next) + os=nextstep + ;; + *-sequent) + os=ptx + ;; + *-crds) + os=unos + ;; + *-ns) + os=genix + ;; + i370-*) + os=mvs + ;; + *-gould) + os=sysv + ;; + *-highlevel) + os=bsd + ;; + *-encore) + os=bsd + ;; + *-sgi) + os=irix + ;; + *-siemens) + os=sysv4 + ;; + *-masscomp) + os=rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=uxpv + ;; + *-rom68k) + os=coff + ;; + *-*bug) + os=coff + ;; + *-apple) + os=macos + ;; + *-atari*) + os=mint + ;; + *-wrs) + os=vxworks + ;; + *) + os=none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +case $vendor in + unknown) + case $os in + riscix*) + vendor=acorn + ;; + sunos*) + vendor=sun + ;; + cnk*|-aix*) + vendor=ibm + ;; + beos*) + vendor=be + ;; + hpux*) + vendor=hp + ;; + mpeix*) + vendor=hp + ;; + hiux*) + vendor=hitachi + ;; + unos*) + vendor=crds + ;; + dgux*) + vendor=dg + ;; + luna*) + vendor=omron + ;; + genix*) + vendor=ns + ;; + clix*) + vendor=intergraph + ;; + mvs* | opened*) + vendor=ibm + ;; + os400*) + vendor=ibm + ;; + ptx*) + vendor=sequent + ;; + tpf*) + vendor=ibm + ;; + vxsim* | vxworks* | windiss*) + vendor=wrs + ;; + aux*) + vendor=apple + ;; + hms*) + vendor=hitachi + ;; + mpw* | macos*) + vendor=apple + ;; + *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) + vendor=atari + ;; + vos*) + vendor=stratus + ;; + esac + ;; +esac + +echo "$cpu-$vendor-$os" +exit + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/hawk/ac/depcomp b/hawk/ac/depcomp new file mode 100755 index 00000000..65cbf709 --- /dev/null +++ b/hawk/ac/depcomp @@ -0,0 +1,791 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1999-2018 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Avoid interferences from the environment. +gccflag= dashmflag= + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The second -e expression handles DOS-style file names with drive + # letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/hawk/ac/install-sh b/hawk/ac/install-sh new file mode 100755 index 00000000..8175c640 --- /dev/null +++ b/hawk/ac/install-sh @@ -0,0 +1,518 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2018-03-11.20; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +tab=' ' +nl=' +' +IFS=" $tab$nl" + +# Set DOITPROG to "echo" to test this script. + +doit=${DOITPROG-} +doit_exec=${doit:-exec} + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +is_target_a_directory=possibly + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) is_target_a_directory=never;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename. + if test -d "$dst"; then + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac + dstdir_status=0 + else + dstdir=`dirname "$dst"` + test -d "$dstdir" + dstdir_status=$? + fi + fi + + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + # Note that $RANDOM variable is not portable (e.g. dash); Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p' feature. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + oIFS=$IFS + IFS=/ + set -f + set fnord $dstdir + shift + set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + set +f && + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/hawk/ac/ltmain.sh b/hawk/ac/ltmain.sh new file mode 100644 index 00000000..7f3523d3 --- /dev/null +++ b/hawk/ac/ltmain.sh @@ -0,0 +1,11149 @@ +#! /bin/sh +## DO NOT EDIT - This file generated from ./build-aux/ltmain.in +## by inline-source v2014-01-03.01 + +# libtool (GNU libtool) 2.4.6 +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +PROGRAM=libtool +PACKAGE=libtool +VERSION=2.4.6 +package_revision=2.4.6 + + +## ------ ## +## Usage. ## +## ------ ## + +# Run './libtool --help' for help with using this script from the +# command line. + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# After configure completes, it has a better idea of some of the +# shell tools we need than the defaults used by the functions shared +# with bootstrap, so set those here where they can still be over- +# ridden by the user, but otherwise take precedence. + +: ${AUTOCONF="autoconf"} +: ${AUTOMAKE="automake"} + + +## -------------------------- ## +## Source external libraries. ## +## -------------------------- ## + +# Much of our low-level functionality needs to be sourced from external +# libraries, which are installed to $pkgauxdir. + +# Set a version string for this script. +scriptversion=2015-01-20.17; # UTC + +# General shell script boiler plate, and helper functions. +# Written by Gary V. Vaughan, 2004 + +# Copyright (C) 2004-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# As a special exception to the GNU General Public License, if you distribute +# this file as part of a program or library that is built using GNU Libtool, +# you may include this file under the same distribution terms that you use +# for the rest of that program. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# Evaluate this file near the top of your script to gain access to +# the functions and variables defined here: +# +# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh +# +# If you need to override any of the default environment variable +# settings, do that before evaluating this file. + + +## -------------------- ## +## Shell normalisation. ## +## -------------------- ## + +# Some shells need a little help to be as Bourne compatible as possible. +# Before doing anything else, make sure all that help has been provided! + +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac +fi + +# NLS nuisances: We save the old values in case they are required later. +_G_user_locale= +_G_safe_locale= +for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test set = \"\${$_G_var+set}\"; then + save_$_G_var=\$$_G_var + $_G_var=C + export $_G_var + _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" + _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" + fi" +done + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Make sure IFS has a sensible default +sp=' ' +nl=' +' +IFS="$sp $nl" + +# There are apparently some retarded systems that use ';' as a PATH separator! +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + + +## ------------------------- ## +## Locate command utilities. ## +## ------------------------- ## + + +# func_executable_p FILE +# ---------------------- +# Check that FILE is an executable regular file. +func_executable_p () +{ + test -f "$1" && test -x "$1" +} + + +# func_path_progs PROGS_LIST CHECK_FUNC [PATH] +# -------------------------------------------- +# Search for either a program that responds to --version with output +# containing "GNU", or else returned by CHECK_FUNC otherwise, by +# trying all the directories in PATH with each of the elements of +# PROGS_LIST. +# +# CHECK_FUNC should accept the path to a candidate program, and +# set $func_check_prog_result if it truncates its output less than +# $_G_path_prog_max characters. +func_path_progs () +{ + _G_progs_list=$1 + _G_check_func=$2 + _G_PATH=${3-"$PATH"} + + _G_path_prog_max=0 + _G_path_prog_found=false + _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} + for _G_dir in $_G_PATH; do + IFS=$_G_save_IFS + test -z "$_G_dir" && _G_dir=. + for _G_prog_name in $_G_progs_list; do + for _exeext in '' .EXE; do + _G_path_prog=$_G_dir/$_G_prog_name$_exeext + func_executable_p "$_G_path_prog" || continue + case `"$_G_path_prog" --version 2>&1` in + *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; + *) $_G_check_func $_G_path_prog + func_path_progs_result=$func_check_prog_result + ;; + esac + $_G_path_prog_found && break 3 + done + done + done + IFS=$_G_save_IFS + test -z "$func_path_progs_result" && { + echo "no acceptable sed could be found in \$PATH" >&2 + exit 1 + } +} + + +# We want to be able to use the functions in this file before configure +# has figured out where the best binaries are kept, which means we have +# to search for them ourselves - except when the results are already set +# where we skip the searches. + +# Unless the user overrides by setting SED, search the path for either GNU +# sed, or the sed that truncates its output the least. +test -z "$SED" && { + _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for _G_i in 1 2 3 4 5 6 7; do + _G_sed_script=$_G_sed_script$nl$_G_sed_script + done + echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed + _G_sed_script= + + func_check_prog_sed () + { + _G_path_prog=$1 + + _G_count=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo '' >> conftest.nl + "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + rm -f conftest.sed + SED=$func_path_progs_result +} + + +# Unless the user overrides by setting GREP, search the path for either GNU +# grep, or the grep that truncates its output the least. +test -z "$GREP" && { + func_check_prog_grep () + { + _G_path_prog=$1 + + _G_count=0 + _G_path_prog_max=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo 'GREP' >> conftest.nl + "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + GREP=$func_path_progs_result +} + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# All uppercase variable names are used for environment variables. These +# variables can be overridden by the user before calling a script that +# uses them if a suitable command of that name is not already available +# in the command search PATH. + +: ${CP="cp -f"} +: ${ECHO="printf %s\n"} +: ${EGREP="$GREP -E"} +: ${FGREP="$GREP -F"} +: ${LN_S="ln -s"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} + + +## -------------------- ## +## Useful sed snippets. ## +## -------------------- ## + +sed_dirname='s|/[^/]*$||' +sed_basename='s|^.*/||' + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s|\([`"$\\]\)|\\\1|g' + +# Same as above, but do not quote variable references. +sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' + +# Sed substitution that converts a w32 file name or path +# that contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-'\' parameter expansions in output of sed_double_quote_subst that +# were '\'-ed in input to the same. If an odd number of '\' preceded a +# '$' in input to sed_double_quote_subst, that '$' was protected from +# expansion. Since each input '\' is now two '\'s, look for any number +# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. +_G_bs='\\' +_G_bs2='\\\\' +_G_bs4='\\\\\\\\' +_G_dollar='\$' +sed_double_backslash="\ + s/$_G_bs4/&\\ +/g + s/^$_G_bs2$_G_dollar/$_G_bs&/ + s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g + s/\n//g" + + +## ----------------- ## +## Global variables. ## +## ----------------- ## + +# Except for the global variables explicitly listed below, the following +# functions in the '^func_' namespace, and the '^require_' namespace +# variables initialised in the 'Resource management' section, sourcing +# this file will not pollute your global namespace with anything +# else. There's no portable way to scope variables in Bourne shell +# though, so actually running these functions will sometimes place +# results into a variable named after the function, and often use +# temporary variables in the '^_G_' namespace. If you are careful to +# avoid using those namespaces casually in your sourcing script, things +# should continue to work as you expect. And, of course, you can freely +# overwrite any of the functions or variables defined here before +# calling anything to customize them. + +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +# Allow overriding, eg assuming that you follow the convention of +# putting '$debug_cmd' at the start of all your functions, you can get +# bash to show function call trace with: +# +# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name +debug_cmd=${debug_cmd-":"} +exit_cmd=: + +# By convention, finish your script with: +# +# exit $exit_status +# +# so that you can set exit_status to non-zero if you want to indicate +# something went wrong during execution without actually bailing out at +# the point of failure. +exit_status=$EXIT_SUCCESS + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath=$0 + +# The name of this program. +progname=`$ECHO "$progpath" |$SED "$sed_basename"` + +# Make sure we have an absolute progpath for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` + progdir=`cd "$progdir" && pwd` + progpath=$progdir/$progname + ;; + *) + _G_IFS=$IFS + IFS=${PATH_SEPARATOR-:} + for progdir in $PATH; do + IFS=$_G_IFS + test -x "$progdir/$progname" && break + done + IFS=$_G_IFS + test -n "$progdir" || progdir=`pwd` + progpath=$progdir/$progname + ;; +esac + + +## ----------------- ## +## Standard options. ## +## ----------------- ## + +# The following options affect the operation of the functions defined +# below, and should be set appropriately depending on run-time para- +# meters passed on the command line. + +opt_dry_run=false +opt_quiet=false +opt_verbose=false + +# Categories 'all' and 'none' are always available. Append any others +# you will pass as the first argument to func_warning from your own +# code. +warning_categories= + +# By default, display warnings according to 'opt_warning_types'. Set +# 'warning_func' to ':' to elide all warnings, or func_fatal_error to +# treat the next displayed warning as a fatal error. +warning_func=func_warn_and_continue + +# Set to 'all' to display all warnings, 'none' to suppress all +# warnings, or a space delimited list of some subset of +# 'warning_categories' to display only the listed warnings. +opt_warning_types=all + + +## -------------------- ## +## Resource management. ## +## -------------------- ## + +# This section contains definitions for functions that each ensure a +# particular resource (a file, or a non-empty configuration variable for +# example) is available, and if appropriate to extract default values +# from pertinent package files. Call them using their associated +# 'require_*' variable to ensure that they are executed, at most, once. +# +# It's entirely deliberate that calling these functions can set +# variables that don't obey the namespace limitations obeyed by the rest +# of this file, in order that that they be as useful as possible to +# callers. + + +# require_term_colors +# ------------------- +# Allow display of bold text on terminals that support it. +require_term_colors=func_require_term_colors +func_require_term_colors () +{ + $debug_cmd + + test -t 1 && { + # COLORTERM and USE_ANSI_COLORS environment variables take + # precedence, because most terminfo databases neglect to describe + # whether color sequences are supported. + test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} + + if test 1 = "$USE_ANSI_COLORS"; then + # Standard ANSI escape sequences + tc_reset='' + tc_bold=''; tc_standout='' + tc_red=''; tc_green='' + tc_blue=''; tc_cyan='' + else + # Otherwise trust the terminfo database after all. + test -n "`tput sgr0 2>/dev/null`" && { + tc_reset=`tput sgr0` + test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` + tc_standout=$tc_bold + test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` + test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` + test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` + test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` + test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` + } + fi + } + + require_term_colors=: +} + + +## ----------------- ## +## Function library. ## +## ----------------- ## + +# This section contains a variety of useful functions to call in your +# scripts. Take note of the portable wrappers for features provided by +# some modern shells, which will fall back to slower equivalents on +# less featureful shells. + + +# func_append VAR VALUE +# --------------------- +# Append VALUE onto the existing contents of VAR. + + # We should try to minimise forks, especially on Windows where they are + # unreasonably slow, so skip the feature probes when bash or zsh are + # being used: + if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then + : ${_G_HAVE_ARITH_OP="yes"} + : ${_G_HAVE_XSI_OPS="yes"} + # The += operator was introduced in bash 3.1 + case $BASH_VERSION in + [12].* | 3.0 | 3.0*) ;; + *) + : ${_G_HAVE_PLUSEQ_OP="yes"} + ;; + esac + fi + + # _G_HAVE_PLUSEQ_OP + # Can be empty, in which case the shell is probed, "yes" if += is + # useable or anything else if it does not work. + test -z "$_G_HAVE_PLUSEQ_OP" \ + && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ + && _G_HAVE_PLUSEQ_OP=yes + +if test yes = "$_G_HAVE_PLUSEQ_OP" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_append () + { + $debug_cmd + + eval "$1+=\$2" + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_append () + { + $debug_cmd + + eval "$1=\$$1\$2" + } +fi + + +# func_append_quoted VAR VALUE +# ---------------------------- +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +if test yes = "$_G_HAVE_PLUSEQ_OP"; then + eval 'func_append_quoted () + { + $debug_cmd + + func_quote_for_eval "$2" + eval "$1+=\\ \$func_quote_for_eval_result" + }' +else + func_append_quoted () + { + $debug_cmd + + func_quote_for_eval "$2" + eval "$1=\$$1\\ \$func_quote_for_eval_result" + } +fi + + +# func_append_uniq VAR VALUE +# -------------------------- +# Append unique VALUE onto the existing contents of VAR, assuming +# entries are delimited by the first character of VALUE. For example: +# +# func_append_uniq options " --another-option option-argument" +# +# will only append to $options if " --another-option option-argument " +# is not already present somewhere in $options already (note spaces at +# each end implied by leading space in second argument). +func_append_uniq () +{ + $debug_cmd + + eval _G_current_value='`$ECHO $'$1'`' + _G_delim=`expr "$2" : '\(.\)'` + + case $_G_delim$_G_current_value$_G_delim in + *"$2$_G_delim"*) ;; + *) func_append "$@" ;; + esac +} + + +# func_arith TERM... +# ------------------ +# Set func_arith_result to the result of evaluating TERMs. + test -z "$_G_HAVE_ARITH_OP" \ + && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ + && _G_HAVE_ARITH_OP=yes + +if test yes = "$_G_HAVE_ARITH_OP"; then + eval 'func_arith () + { + $debug_cmd + + func_arith_result=$(( $* )) + }' +else + func_arith () + { + $debug_cmd + + func_arith_result=`expr "$@"` + } +fi + + +# func_basename FILE +# ------------------ +# Set func_basename_result to FILE with everything up to and including +# the last / stripped. +if test yes = "$_G_HAVE_XSI_OPS"; then + # If this shell supports suffix pattern removal, then use it to avoid + # forking. Hide the definitions single quotes in case the shell chokes + # on unsupported syntax... + _b='func_basename_result=${1##*/}' + _d='case $1 in + */*) func_dirname_result=${1%/*}$2 ;; + * ) func_dirname_result=$3 ;; + esac' + +else + # ...otherwise fall back to using sed. + _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' + _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` + if test "X$func_dirname_result" = "X$1"; then + func_dirname_result=$3 + else + func_append func_dirname_result "$2" + fi' +fi + +eval 'func_basename () +{ + $debug_cmd + + '"$_b"' +}' + + +# func_dirname FILE APPEND NONDIR_REPLACEMENT +# ------------------------------------------- +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +eval 'func_dirname () +{ + $debug_cmd + + '"$_d"' +}' + + +# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT +# -------------------------------------------------------- +# Perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# For efficiency, we do not delegate to the functions above but instead +# duplicate the functionality here. +eval 'func_dirname_and_basename () +{ + $debug_cmd + + '"$_b"' + '"$_d"' +}' + + +# func_echo ARG... +# ---------------- +# Echo program name prefixed message. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname: $_G_line" + done + IFS=$func_echo_IFS +} + + +# func_echo_all ARG... +# -------------------- +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + + +# func_echo_infix_1 INFIX ARG... +# ------------------------------ +# Echo program name, followed by INFIX on the first line, with any +# additional lines not showing INFIX. +func_echo_infix_1 () +{ + $debug_cmd + + $require_term_colors + + _G_infix=$1; shift + _G_indent=$_G_infix + _G_prefix="$progname: $_G_infix: " + _G_message=$* + + # Strip color escape sequences before counting printable length + for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" + do + test -n "$_G_tc" && { + _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` + _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` + } + done + _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes + + func_echo_infix_1_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_infix_1_IFS + $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 + _G_prefix=$_G_indent + done + IFS=$func_echo_infix_1_IFS +} + + +# func_error ARG... +# ----------------- +# Echo program name prefixed message to standard error. +func_error () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 +} + + +# func_fatal_error ARG... +# ----------------------- +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + $debug_cmd + + func_error "$*" + exit $EXIT_FAILURE +} + + +# func_grep EXPRESSION FILENAME +# ----------------------------- +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $debug_cmd + + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_len STRING +# --------------- +# Set func_len_result to the length of STRING. STRING may not +# start with a hyphen. + test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_len () + { + $debug_cmd + + func_len_result=${#1} + }' +else + func_len () + { + $debug_cmd + + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` + } +fi + + +# func_mkdir_p DIRECTORY-PATH +# --------------------------- +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + $debug_cmd + + _G_directory_path=$1 + _G_dir_list= + + if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then + + # Protect directory names starting with '-' + case $_G_directory_path in + -*) _G_directory_path=./$_G_directory_path ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$_G_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + _G_dir_list=$_G_directory_path:$_G_dir_list + + # If the last portion added has no slash in it, the list is done + case $_G_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` + done + _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` + + func_mkdir_p_IFS=$IFS; IFS=: + for _G_dir in $_G_dir_list; do + IFS=$func_mkdir_p_IFS + # mkdir can fail with a 'File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$_G_dir" 2>/dev/null || : + done + IFS=$func_mkdir_p_IFS + + # Bail out if we (or some other process) failed to create a directory. + test -d "$_G_directory_path" || \ + func_fatal_error "Failed to create '$1'" + fi +} + + +# func_mktempdir [BASENAME] +# ------------------------- +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, BASENAME is the basename for that directory. +func_mktempdir () +{ + $debug_cmd + + _G_template=${TMPDIR-/tmp}/${1-$progname} + + if test : = "$opt_dry_run"; then + # Return a directory name, but don't create it in dry-run mode + _G_tmpdir=$_G_template-$$ + else + + # If mktemp works, use that first and foremost + _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` + + if test ! -d "$_G_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + _G_tmpdir=$_G_template-${RANDOM-0}$$ + + func_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$_G_tmpdir" + umask $func_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$_G_tmpdir" || \ + func_fatal_error "cannot create temporary directory '$_G_tmpdir'" + fi + + $ECHO "$_G_tmpdir" +} + + +# func_normal_abspath PATH +# ------------------------ +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +func_normal_abspath () +{ + $debug_cmd + + # These SED scripts presuppose an absolute path with a trailing slash. + _G_pathcar='s|^/\([^/]*\).*$|\1|' + _G_pathcdr='s|^/[^/]*||' + _G_removedotparts=':dotsl + s|/\./|/|g + t dotsl + s|/\.$|/|' + _G_collapseslashes='s|/\{1,\}|/|g' + _G_finalslash='s|/*$|/|' + + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` + while :; do + # Processed it all yet? + if test / = "$func_normal_abspath_tpath"; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result"; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + + +# func_notquiet ARG... +# -------------------- +# Echo program name prefixed message only when not in quiet mode. +func_notquiet () +{ + $debug_cmd + + $opt_quiet || func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + + +# func_relative_path SRCDIR DSTDIR +# -------------------------------- +# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. +func_relative_path () +{ + $debug_cmd + + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=$func_dirname_result + if test -z "$func_relative_path_tlibdir"; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test -n "$func_stripname_result"; then + func_append func_relative_path_result "/$func_stripname_result" + fi + + # Normalisation. If bindir is libdir, return '.' else relative path. + if test -n "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + fi + + test -n "$func_relative_path_result" || func_relative_path_result=. + + : +} + + +# func_quote_for_eval ARG... +# -------------------------- +# Aesthetically quote ARGs to be evaled later. +# This function returns two values: +# i) func_quote_for_eval_result +# double-quoted, suitable for a subsequent eval +# ii) func_quote_for_eval_unquoted_result +# has all characters that are still active within double +# quotes backslashified. +func_quote_for_eval () +{ + $debug_cmd + + func_quote_for_eval_unquoted_result= + func_quote_for_eval_result= + while test 0 -lt $#; do + case $1 in + *[\\\`\"\$]*) + _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; + *) + _G_unquoted_arg=$1 ;; + esac + if test -n "$func_quote_for_eval_unquoted_result"; then + func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" + else + func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" + fi + + case $_G_unquoted_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + _G_quoted_arg=\"$_G_unquoted_arg\" + ;; + *) + _G_quoted_arg=$_G_unquoted_arg + ;; + esac + + if test -n "$func_quote_for_eval_result"; then + func_append func_quote_for_eval_result " $_G_quoted_arg" + else + func_append func_quote_for_eval_result "$_G_quoted_arg" + fi + shift + done +} + + +# func_quote_for_expand ARG +# ------------------------- +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + $debug_cmd + + case $1 in + *[\\\`\"]*) + _G_arg=`$ECHO "$1" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; + *) + _G_arg=$1 ;; + esac + + case $_G_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + _G_arg=\"$_G_arg\" + ;; + esac + + func_quote_for_expand_result=$_G_arg +} + + +# func_stripname PREFIX SUFFIX NAME +# --------------------------------- +# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_stripname () + { + $debug_cmd + + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary variable first. + func_stripname_result=$3 + func_stripname_result=${func_stripname_result#"$1"} + func_stripname_result=${func_stripname_result%"$2"} + }' +else + func_stripname () + { + $debug_cmd + + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; + esac + } +fi + + +# func_show_eval CMD [FAIL_EXP] +# ----------------------------- +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + func_quote_for_expand "$_G_cmd" + eval "func_notquiet $func_quote_for_expand_result" + + $opt_dry_run || { + eval "$_G_cmd" + _G_status=$? + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_show_eval_locale CMD [FAIL_EXP] +# ------------------------------------ +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + $opt_quiet || { + func_quote_for_expand "$_G_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + $opt_dry_run || { + eval "$_G_user_locale + $_G_cmd" + _G_status=$? + eval "$_G_safe_locale" + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_tr_sh +# ---------- +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + $debug_cmd + + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_verbose ARG... +# ------------------- +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $debug_cmd + + $opt_verbose && func_echo "$*" + + : +} + + +# func_warn_and_continue ARG... +# ----------------------------- +# Echo program name prefixed warning message to standard error. +func_warn_and_continue () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 +} + + +# func_warning CATEGORY ARG... +# ---------------------------- +# Echo program name prefixed warning message to standard error. Warning +# messages can be filtered according to CATEGORY, where this function +# elides messages where CATEGORY is not listed in the global variable +# 'opt_warning_types'. +func_warning () +{ + $debug_cmd + + # CATEGORY must be in the warning_categories list! + case " $warning_categories " in + *" $1 "*) ;; + *) func_internal_error "invalid warning category '$1'" ;; + esac + + _G_category=$1 + shift + + case " $opt_warning_types " in + *" $_G_category "*) $warning_func ${1+"$@"} ;; + esac +} + + +# func_sort_ver VER1 VER2 +# ----------------------- +# 'sort -V' is not generally available. +# Note this deviates from the version comparison in automake +# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a +# but this should suffice as we won't be specifying old +# version formats or redundant trailing .0 in bootstrap.conf. +# If we did want full compatibility then we should probably +# use m4_version_compare from autoconf. +func_sort_ver () +{ + $debug_cmd + + printf '%s\n%s\n' "$1" "$2" \ + | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n +} + +# func_lt_ver PREV CURR +# --------------------- +# Return true if PREV and CURR are in the correct order according to +# func_sort_ver, otherwise false. Use it like this: +# +# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." +func_lt_ver () +{ + $debug_cmd + + test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: +#! /bin/sh + +# Set a version string for this script. +scriptversion=2014-01-07.03; # UTC + +# A portable, pluggable option parser for Bourne shell. +# Written by Gary V. Vaughan, 2010 + +# Copyright (C) 2010-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# This file is a library for parsing options in your shell scripts along +# with assorted other useful supporting features that you can make use +# of too. +# +# For the simplest scripts you might need only: +# +# #!/bin/sh +# . relative/path/to/funclib.sh +# . relative/path/to/options-parser +# scriptversion=1.0 +# func_options ${1+"$@"} +# eval set dummy "$func_options_result"; shift +# ...rest of your script... +# +# In order for the '--version' option to work, you will need to have a +# suitably formatted comment like the one at the top of this file +# starting with '# Written by ' and ending with '# warranty; '. +# +# For '-h' and '--help' to work, you will also need a one line +# description of your script's purpose in a comment directly above the +# '# Written by ' line, like the one at the top of this file. +# +# The default options also support '--debug', which will turn on shell +# execution tracing (see the comment above debug_cmd below for another +# use), and '--verbose' and the func_verbose function to allow your script +# to display verbose messages only when your user has specified +# '--verbose'. +# +# After sourcing this file, you can plug processing for additional +# options by amending the variables from the 'Configuration' section +# below, and following the instructions in the 'Option parsing' +# section further down. + +## -------------- ## +## Configuration. ## +## -------------- ## + +# You should override these variables in your script after sourcing this +# file so that they reflect the customisations you have added to the +# option parser. + +# The usage line for option parsing errors and the start of '-h' and +# '--help' output messages. You can embed shell variables for delayed +# expansion at the time the message is displayed, but you will need to +# quote other shell meta-characters carefully to prevent them being +# expanded when the contents are evaled. +usage='$progpath [OPTION]...' + +# Short help message in response to '-h' and '--help'. Add to this or +# override it after sourcing this library to reflect the full set of +# options your script accepts. +usage_message="\ + --debug enable verbose shell tracing + -W, --warnings=CATEGORY + report the warnings falling in CATEGORY [all] + -v, --verbose verbosely report processing + --version print version information and exit + -h, --help print short or long help message and exit +" + +# Additional text appended to 'usage_message' in response to '--help'. +long_help_message=" +Warning categories include: + 'all' show all warnings + 'none' turn off all the warnings + 'error' warnings are treated as fatal errors" + +# Help message printed before fatal option parsing errors. +fatal_help="Try '\$progname --help' for more information." + + + +## ------------------------- ## +## Hook function management. ## +## ------------------------- ## + +# This section contains functions for adding, removing, and running hooks +# to the main code. A hook is just a named list of of function, that can +# be run in order later on. + +# func_hookable FUNC_NAME +# ----------------------- +# Declare that FUNC_NAME will run hooks added with +# 'func_add_hook FUNC_NAME ...'. +func_hookable () +{ + $debug_cmd + + func_append hookable_fns " $1" +} + + +# func_add_hook FUNC_NAME HOOK_FUNC +# --------------------------------- +# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must +# first have been declared "hookable" by a call to 'func_hookable'. +func_add_hook () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not accept hook functions." ;; + esac + + eval func_append ${1}_hooks '" $2"' +} + + +# func_remove_hook FUNC_NAME HOOK_FUNC +# ------------------------------------ +# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +func_remove_hook () +{ + $debug_cmd + + eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' +} + + +# func_run_hooks FUNC_NAME [ARG]... +# --------------------------------- +# Run all hook functions registered to FUNC_NAME. +# It is assumed that the list of hook functions contains nothing more +# than a whitespace-delimited list of legal shell function names, and +# no effort is wasted trying to catch shell meta-characters or preserve +# whitespace. +func_run_hooks () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not support hook funcions.n" ;; + esac + + eval _G_hook_fns=\$$1_hooks; shift + + for _G_hook in $_G_hook_fns; do + eval $_G_hook '"$@"' + + # store returned options list back into positional + # parameters for next 'cmd' execution. + eval _G_hook_result=\$${_G_hook}_result + eval set dummy "$_G_hook_result"; shift + done + + func_quote_for_eval ${1+"$@"} + func_run_hooks_result=$func_quote_for_eval_result +} + + + +## --------------- ## +## Option parsing. ## +## --------------- ## + +# In order to add your own option parsing hooks, you must accept the +# full positional parameter list in your hook function, remove any +# options that you action, and then pass back the remaining unprocessed +# options in '_result', escaped suitably for +# 'eval'. Like this: +# +# my_options_prep () +# { +# $debug_cmd +# +# # Extend the existing usage message. +# usage_message=$usage_message' +# -s, --silent don'\''t print informational messages +# ' +# +# func_quote_for_eval ${1+"$@"} +# my_options_prep_result=$func_quote_for_eval_result +# } +# func_add_hook func_options_prep my_options_prep +# +# +# my_silent_option () +# { +# $debug_cmd +# +# # Note that for efficiency, we parse as many options as we can +# # recognise in a loop before passing the remainder back to the +# # caller on the first unrecognised argument we encounter. +# while test $# -gt 0; do +# opt=$1; shift +# case $opt in +# --silent|-s) opt_silent=: ;; +# # Separate non-argument short options: +# -s*) func_split_short_opt "$_G_opt" +# set dummy "$func_split_short_opt_name" \ +# "-$func_split_short_opt_arg" ${1+"$@"} +# shift +# ;; +# *) set dummy "$_G_opt" "$*"; shift; break ;; +# esac +# done +# +# func_quote_for_eval ${1+"$@"} +# my_silent_option_result=$func_quote_for_eval_result +# } +# func_add_hook func_parse_options my_silent_option +# +# +# my_option_validation () +# { +# $debug_cmd +# +# $opt_silent && $opt_verbose && func_fatal_help "\ +# '--silent' and '--verbose' options are mutually exclusive." +# +# func_quote_for_eval ${1+"$@"} +# my_option_validation_result=$func_quote_for_eval_result +# } +# func_add_hook func_validate_options my_option_validation +# +# You'll alse need to manually amend $usage_message to reflect the extra +# options you parse. It's preferable to append if you can, so that +# multiple option parsing hooks can be added safely. + + +# func_options [ARG]... +# --------------------- +# All the functions called inside func_options are hookable. See the +# individual implementations for details. +func_hookable func_options +func_options () +{ + $debug_cmd + + func_options_prep ${1+"$@"} + eval func_parse_options \ + ${func_options_prep_result+"$func_options_prep_result"} + eval func_validate_options \ + ${func_parse_options_result+"$func_parse_options_result"} + + eval func_run_hooks func_options \ + ${func_validate_options_result+"$func_validate_options_result"} + + # save modified positional parameters for caller + func_options_result=$func_run_hooks_result +} + + +# func_options_prep [ARG]... +# -------------------------- +# All initialisations required before starting the option parse loop. +# Note that when calling hook functions, we pass through the list of +# positional parameters. If a hook function modifies that list, and +# needs to propogate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before +# returning. +func_hookable func_options_prep +func_options_prep () +{ + $debug_cmd + + # Option defaults: + opt_verbose=false + opt_warning_types= + + func_run_hooks func_options_prep ${1+"$@"} + + # save modified positional parameters for caller + func_options_prep_result=$func_run_hooks_result +} + + +# func_parse_options [ARG]... +# --------------------------- +# The main option parsing loop. +func_hookable func_parse_options +func_parse_options () +{ + $debug_cmd + + func_parse_options_result= + + # this just eases exit handling + while test $# -gt 0; do + # Defer to hook functions for initial option parsing, so they + # get priority in the event of reusing an option name. + func_run_hooks func_parse_options ${1+"$@"} + + # Adjust func_parse_options positional parameters to match + eval set dummy "$func_run_hooks_result"; shift + + # Break out of the loop if we already parsed every option. + test $# -gt 0 || break + + _G_opt=$1 + shift + case $_G_opt in + --debug|-x) debug_cmd='set -x' + func_echo "enabling shell trace mode" + $debug_cmd + ;; + + --no-warnings|--no-warning|--no-warn) + set dummy --warnings none ${1+"$@"} + shift + ;; + + --warnings|--warning|-W) + test $# = 0 && func_missing_arg $_G_opt && break + case " $warning_categories $1" in + *" $1 "*) + # trailing space prevents matching last $1 above + func_append_uniq opt_warning_types " $1" + ;; + *all) + opt_warning_types=$warning_categories + ;; + *none) + opt_warning_types=none + warning_func=: + ;; + *error) + opt_warning_types=$warning_categories + warning_func=func_fatal_error + ;; + *) + func_fatal_error \ + "unsupported warning category: '$1'" + ;; + esac + shift + ;; + + --verbose|-v) opt_verbose=: ;; + --version) func_version ;; + -\?|-h) func_usage ;; + --help) func_help ;; + + # Separate optargs to long options (plugins may need this): + --*=*) func_split_equals "$_G_opt" + set dummy "$func_split_equals_lhs" \ + "$func_split_equals_rhs" ${1+"$@"} + shift + ;; + + # Separate optargs to short options: + -W*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-v*|-x*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + esac + done + + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + func_parse_options_result=$func_quote_for_eval_result +} + + +# func_validate_options [ARG]... +# ------------------------------ +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +func_hookable func_validate_options +func_validate_options () +{ + $debug_cmd + + # Display all warnings if -W was not given. + test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" + + func_run_hooks func_validate_options ${1+"$@"} + + # Bail if the options were screwed! + $exit_cmd $EXIT_FAILURE + + # save modified positional parameters for caller + func_validate_options_result=$func_run_hooks_result +} + + + +## ----------------- ## +## Helper functions. ## +## ----------------- ## + +# This section contains the helper functions used by the rest of the +# hookable option parser framework in ascii-betical order. + + +# func_fatal_help ARG... +# ---------------------- +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + $debug_cmd + + eval \$ECHO \""Usage: $usage"\" + eval \$ECHO \""$fatal_help"\" + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + + +# func_help +# --------- +# Echo long help message to standard output and exit. +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$long_help_message" + exit 0 +} + + +# func_missing_arg ARGNAME +# ------------------------ +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $debug_cmd + + func_error "Missing argument for '$1'." + exit_cmd=exit +} + + +# func_split_equals STRING +# ------------------------ +# Set func_split_equals_lhs and func_split_equals_rhs shell variables after +# splitting STRING at the '=' sign. +test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=${1%%=*} + func_split_equals_rhs=${1#*=} + test "x$func_split_equals_lhs" = "x$1" \ + && func_split_equals_rhs= + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` + func_split_equals_rhs= + test "x$func_split_equals_lhs" = "x$1" \ + || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` + } +fi #func_split_equals + + +# func_split_short_opt SHORTOPT +# ----------------------------- +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"} + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` + func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` + } +fi #func_split_short_opt + + +# func_usage +# ---------- +# Echo short help message to standard output and exit. +func_usage () +{ + $debug_cmd + + func_usage_message + $ECHO "Run '$progname --help |${PAGER-more}' for full usage" + exit 0 +} + + +# func_usage_message +# ------------------ +# Echo short help message to standard output. +func_usage_message () +{ + $debug_cmd + + eval \$ECHO \""Usage: $usage"\" + echo + $SED -n 's|^# || + /^Written by/{ + x;p;x + } + h + /^Written by/q' < "$progpath" + echo + eval \$ECHO \""$usage_message"\" +} + + +# func_version +# ------------ +# Echo version message to standard output and exit. +func_version () +{ + $debug_cmd + + printf '%s\n' "$progname $scriptversion" + $SED -n ' + /(C)/!b go + :more + /\./!{ + N + s|\n# | | + b more + } + :go + /^# Written by /,/# warranty; / { + s|^# || + s|^# *$|| + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + p + } + /^# Written by / { + s|^# || + p + } + /^warranty; /q' < "$progpath" + + exit $? +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: + +# Set a version string. +scriptversion='(GNU libtool) 2.4.6' + + +# func_echo ARG... +# ---------------- +# Libtool also displays the current mode in messages, so override +# funclib.sh func_echo with this custom definition. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" + done + IFS=$func_echo_IFS +} + + +# func_warning ARG... +# ------------------- +# Libtool warnings are not categorized, so override funclib.sh +# func_warning with this simpler definition. +func_warning () +{ + $debug_cmd + + $warning_func ${1+"$@"} +} + + +## ---------------- ## +## Options parsing. ## +## ---------------- ## + +# Hook in the functions to make sure our own options are parsed during +# the option parsing loop. + +usage='$progpath [OPTION]... [MODE-ARG]...' + +# Short help message in response to '-h'. +usage_message="Options: + --config show all configuration variables + --debug enable verbose shell tracing + -n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --mode=MODE use operation mode MODE + --no-warnings equivalent to '-Wnone' + --preserve-dup-deps don't remove duplicate dependency libraries + --quiet, --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + -v, --verbose print more informational messages than default + --version print version information + -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] + -h, --help, --help-all print short, long, or detailed help message +" + +# Additional text appended to 'usage_message' in response to '--help'. +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$long_help_message + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. When passed as first option, +'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. +Try '$progname --help --mode=MODE' for a more detailed description of MODE. + +When reporting a bug, please describe a test case to reproduce it and +include the following information: + + host-triplet: $host + shell: $SHELL + compiler: $LTCC + compiler flags: $LTCFLAGS + linker: $LD (gnu? $with_gnu_ld) + version: $progname (GNU libtool) 2.4.6 + automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` + autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` + +Report bugs to . +GNU libtool home page: . +General help using GNU software: ." + exit 0 +} + + +# func_lo2o OBJECT-NAME +# --------------------- +# Transform OBJECT-NAME from a '.lo' suffix to the platform specific +# object suffix. + +lo2o=s/\\.lo\$/.$objext/ +o2lo=s/\\.$objext\$/.lo/ + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_lo2o () + { + case $1 in + *.lo) func_lo2o_result=${1%.lo}.$objext ;; + * ) func_lo2o_result=$1 ;; + esac + }' + + # func_xform LIBOBJ-OR-SOURCE + # --------------------------- + # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) + # suffix to a '.lo' libtool-object suffix. + eval 'func_xform () + { + func_xform_result=${1%.*}.lo + }' +else + # ...otherwise fall back to using sed. + func_lo2o () + { + func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` + } + + func_xform () + { + func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` + } +fi + + +# func_fatal_configuration ARG... +# ------------------------------- +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func_fatal_error ${1+"$@"} \ + "See the $PACKAGE documentation for more information." \ + "Fatal configuration error." +} + + +# func_config +# ----------- +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + + +# func_features +# ------------- +# Display the features supported by this script. +func_features () +{ + echo "host: $host" + if test yes = "$build_libtool_libs"; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test yes = "$build_old_libs"; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + + exit $? +} + + +# func_enable_tag TAGNAME +# ----------------------- +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname=$1 + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf=/$re_begincf/,/$re_endcf/p + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + + +# func_check_version_match +# ------------------------ +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# libtool_options_prep [ARG]... +# ----------------------------- +# Preparation for options parsed by libtool. +libtool_options_prep () +{ + $debug_mode + + # Option defaults: + opt_config=false + opt_dlopen= + opt_dry_run=false + opt_help=false + opt_mode= + opt_preserve_dup_deps=false + opt_quiet=false + + nonopt= + preserve_args= + + # Shorthand for --mode=foo, only valid as the first argument + case $1 in + clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; + compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; + execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; + finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; + install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; + link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; + esac + + # Pass back the list of options. + func_quote_for_eval ${1+"$@"} + libtool_options_prep_result=$func_quote_for_eval_result +} +func_add_hook func_options_prep libtool_options_prep + + +# libtool_parse_options [ARG]... +# --------------------------------- +# Provide handling for libtool specific options. +libtool_parse_options () +{ + $debug_cmd + + # Perform our own loop to consume as many options as possible in + # each iteration. + while test $# -gt 0; do + _G_opt=$1 + shift + case $_G_opt in + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + + --config) func_config ;; + + --dlopen|-dlopen) + opt_dlopen="${opt_dlopen+$opt_dlopen +}$1" + shift + ;; + + --preserve-dup-deps) + opt_preserve_dup_deps=: ;; + + --features) func_features ;; + + --finish) set dummy --mode finish ${1+"$@"}; shift ;; + + --help) opt_help=: ;; + + --help-all) opt_help=': help-all' ;; + + --mode) test $# = 0 && func_missing_arg $_G_opt && break + opt_mode=$1 + case $1 in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $_G_opt" + exit_cmd=exit + break + ;; + esac + shift + ;; + + --no-silent|--no-quiet) + opt_quiet=false + func_append preserve_args " $_G_opt" + ;; + + --no-warnings|--no-warning|--no-warn) + opt_warning=false + func_append preserve_args " $_G_opt" + ;; + + --no-verbose) + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --silent|--quiet) + opt_quiet=: + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --tag) test $# = 0 && func_missing_arg $_G_opt && break + opt_tag=$1 + func_append preserve_args " $_G_opt $1" + func_enable_tag "$1" + shift + ;; + + --verbose|-v) opt_quiet=false + opt_verbose=: + func_append preserve_args " $_G_opt" + ;; + + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + esac + done + + + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + libtool_parse_options_result=$func_quote_for_eval_result +} +func_add_hook func_parse_options libtool_parse_options + + + +# libtool_validate_options [ARG]... +# --------------------------------- +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +libtool_validate_options () +{ + # save first non-option argument + if test 0 -lt $#; then + nonopt=$1 + shift + fi + + # preserve --debug + test : = "$debug_cmd" || func_append preserve_args " --debug" + + case $host in + # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 + # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 + *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + test yes != "$build_libtool_libs" \ + && test yes != "$build_old_libs" \ + && func_fatal_configuration "not configured to build any kind of library" + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test execute != "$opt_mode"; then + func_error "unrecognized option '-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help=$help + help="Try '$progname --help --mode=$opt_mode' for more information." + } + + # Pass back the unparsed argument list + func_quote_for_eval ${1+"$@"} + libtool_validate_options_result=$func_quote_for_eval_result +} +func_add_hook func_validate_options libtool_validate_options + + +# Process options as early as possible so that --help and --version +# can return quickly. +func_options ${1+"$@"} +eval set dummy "$func_options_result"; shift + + + +## ----------- ## +## Main. ## +## ----------- ## + +magic='%%%MAGIC variable%%%' +magic_exe='%%%MAGIC EXE variable%%%' + +# Global variables. +extracted_archives= +extracted_serial=0 + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# func_generated_by_libtool +# True iff stdin has been generated by Libtool. This function is only +# a basic sanity check; it will hardly flush out determined imposters. +func_generated_by_libtool_p () +{ + $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_p file +# True iff FILE is a libtool '.la' library or '.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool '.la' library or '.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if 'file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case $lalib_p_line in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test yes = "$lalib_p" +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + test -f "$1" && + $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $debug_cmd + + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$sp$nl + eval cmd=\"$cmd\" + IFS=$save_ifs + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# 'FILE.' does not work on cygwin managed mounts. +func_source () +{ + $debug_cmd + + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case $lt_sysroot:$1 in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result='='$func_stripname_result + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $debug_cmd + + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with '--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=$1 + if test yes = "$build_libtool_libs"; then + write_lobj=\'$2\' + else + write_lobj=none + fi + + if test yes = "$build_old_libs"; then + write_oldobj=\'$3\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T </dev/null` + if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $debug_cmd + + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result= + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result"; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $debug_cmd + + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $debug_cmd + + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $debug_cmd + + if test -z "$2" && test -n "$1"; then + func_error "Could not determine host file name corresponding to" + func_error " '$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result=$1 + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $debug_cmd + + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " '$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result=$3 + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $debug_cmd + + case $4 in + $1 ) func_to_host_path_result=$3$func_to_host_path_result + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via '$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $debug_cmd + + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $debug_cmd + + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result=$1 +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result=$func_convert_core_msys_to_w32_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result=$func_convert_core_file_wine_to_w32_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result=$func_cygpath_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result=$func_cygpath_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via '$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $debug_cmd + + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd=func_convert_path_$func_stripname_result + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $debug_cmd + + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result=$1 +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result=$func_convert_core_msys_to_w32_result + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result=$func_convert_core_path_wine_to_w32_result + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result=$func_cygpath_result + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result=$func_cygpath_result + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + +# func_dll_def_p FILE +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with _LT_DLL_DEF_P in libtool.m4 +func_dll_def_p () +{ + $debug_cmd + + func_dll_def_p_tmp=`$SED -n \ + -e 's/^[ ]*//' \ + -e '/^\(;.*\)*$/d' \ + -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ + -e q \ + "$1"` + test DEF = "$func_dll_def_p_tmp" +} + + +# func_mode_compile arg... +func_mode_compile () +{ + $debug_cmd + + # Get the compilation command and the source file. + base_compile= + srcfile=$nonopt # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + pie_flag= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg=$arg + arg_mode=normal + ;; + + target ) + libobj=$arg + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + test -n "$libobj" && \ + func_fatal_error "you cannot specify '-o' more than once" + arg_mode=target + continue + ;; + + -pie | -fpie | -fPIE) + func_append pie_flag " $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) + func_append later " $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + lastarg= + save_ifs=$IFS; IFS=, + for arg in $args; do + IFS=$save_ifs + func_append_quoted lastarg "$arg" + done + IFS=$save_ifs + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + + # Add the arguments to base_compile. + func_append base_compile " $lastarg" + continue + ;; + + *) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg=$srcfile + srcfile=$arg + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + func_append_quoted base_compile "$lastarg" + done # for arg + + case $arg_mode in + arg) + func_fatal_error "you must specify an argument for -Xcompile" + ;; + target) + func_fatal_error "you must specify a target with '-o'" + ;; + *) + # Get the name of the library object. + test -z "$libobj" && { + func_basename "$srcfile" + libobj=$func_basename_result + } + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + case $libobj in + *.[cCFSifmso] | \ + *.ada | *.adb | *.ads | *.asm | \ + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) + func_xform "$libobj" + libobj=$func_xform_result + ;; + esac + + case $libobj in + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; + *) + func_fatal_error "cannot determine name of library object from '$libobj'" + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -shared) + test yes = "$build_libtool_libs" \ + || func_fatal_configuration "cannot build a shared library" + build_old_libs=no + continue + ;; + + -static) + build_libtool_libs=no + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + func_quote_for_eval "$libobj" + test "X$libobj" != "X$func_quote_for_eval_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && func_warning "libobj name '$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname=$func_basename_result + xdir=$func_dirname_result + lobj=$xdir$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test yes = "$build_old_libs"; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test no = "$compiler_c_o"; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext + lockfile=$output_obj.lock + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test yes = "$need_locks"; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test warn = "$need_locks"; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test yes = "$build_libtool_libs"; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test no != "$pic_mode"; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + func_append command " -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test warn = "$need_locks" && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test yes = "$suppress_opt"; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test yes = "$build_old_libs"; then + if test yes != "$pic_mode"; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test yes = "$compiler_c_o"; then + func_append command " -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + func_append command "$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test warn = "$need_locks" && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test no != "$need_locks"; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test compile = "$opt_mode" && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a '.o' file suitable for static linking + -static only build a '.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a 'standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix '.c' with the +library object suffix, '.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to '-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the '--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the 'install' or 'cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE use a list of object files found in FILE to specify objects + -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with '-') are ignored. + +Every other argument is treated as a filename. Files ending in '.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in '.la', then a libtool library is created, +only library objects ('.lo' files) may be specified, and '-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created +using 'ar' and 'ranlib', or on Windows using 'lib'. + +If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode '$opt_mode'" + ;; + esac + + echo + $ECHO "Try '$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test : = "$opt_help"; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | $SED -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + $SED '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $debug_cmd + + # The first argument is the command name. + cmd=$nonopt + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "'$file' is not a file" + + dir= + case $file in + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "'$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "'$file' was not linked with '-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir=$func_dirname_result + + if test -f "$dir/$objdir/$dlname"; then + func_append dir "/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir=$func_dirname_result + ;; + + *) + func_warning "'-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir=$absdir + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic=$magic + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file=$progdir/$program + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file=$progdir/$program + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_append_quoted args "$file" + done + + if $opt_dry_run; then + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + else + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd=\$cmd$args + fi +} + +test execute = "$opt_mode" && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $debug_cmd + + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "'$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument '$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and '=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || func_append admincmds " + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_quiet && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the '-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the '$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the '$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the '$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" + fi + echo + + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi + exit $EXIT_SUCCESS +} + +test finish = "$opt_mode" && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $debug_cmd + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac + then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=false + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + func_append files " $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=: ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test X-m = "X$prev" && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the '$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=: + if $isdir; then + destdir=$dest + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir=$func_dirname_result + destname=$func_basename_result + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "'$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "'$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic=$magic + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + func_append staticlibs " $file" + ;; + + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "'$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) func_append current_libdirs " $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) func_append future_libdirs " $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir=$func_dirname_result + func_append dir "$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking '$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname=$1 + shift + + srcname=$realname + test -n "$relink_command" && srcname=${realname}T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme=$stripme + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme= + ;; + esac + ;; + os2*) + case $realname in + *_dll.a) + tstripme= + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try 'ln -sf' first, because the 'ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib=$destdir/$realname + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name=$func_basename_result + instname=$dir/${name}i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && func_append staticlibs " $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile=$destdir/$destname + else + func_basename "$file" + destfile=$func_basename_result + destfile=$destdir/$destfile + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest=$destfile + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to '$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test yes = "$build_old_libs"; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile=$destdir/$destname + else + func_basename "$file" + destfile=$func_basename_result + destfile=$destdir/$destfile + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext= + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=.exe + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script '$wrapper'" + + finalize=: + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "'$lib' has not been installed in '$libdir'" + finalize=false + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test no = "$fast_install" && test -n "$relink_command"; then + $opt_dry_run || { + if $finalize; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file=$func_basename_result + outputname=$tmpdir/$file + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_quiet || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink '$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file=$outputname + else + func_warning "cannot relink '$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name=$func_basename_result + + # Set up the ranlib parameters. + oldlib=$destdir/$name + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run '$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test install = "$opt_mode" && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $debug_cmd + + my_outputname=$1 + my_originator=$2 + my_pic_p=${3-false} + my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms=${my_outputname}S.c + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist=$output_objdir/$my_outputname.nm + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + +/* External symbol declarations for the compiler. */\ +" + + if test yes = "$dlself"; then + func_verbose "generating symbol list for '$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from '$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols=$output_objdir/$outputname.exp + $opt_dry_run || { + $RM $export_symbols + eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from '$dlprefile'" + func_basename "$dlprefile" + name=$func_basename_result + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename= + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname"; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename=$func_basename_result + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename"; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + func_show_eval '$RM "${nlist}I"' + if test -n "$global_symbol_to_import"; then + eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +extern LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[];\ +" + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ +static void lt_syminit(void) +{ + LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; + for (; symbol->name; ++symbol) + {" + $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" + echo >> "$output_objdir/$my_dlsyms" "\ + } +}" + fi + echo >> "$output_objdir/$my_dlsyms" "\ +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{ {\"$my_originator\", (void *) 0}," + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ + {\"@INIT@\", (void *) <_syminit}," + fi + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + $my_pic_p && pic_flag_for_symtable=" $pic_flag" + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) func_append symtab_cflags " $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' + + # Transform the symbol file into the correct name. + symfileobj=$output_objdir/${my_outputname}S.$objext + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for '$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $debug_cmd + + win32_libid_type=unknown + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + case $nm_interface in + "MS dumpbin") + if func_cygming_ms_implib_p "$1" || + func_cygming_gnu_implib_p "$1" + then + win32_nmres=import + else + win32_nmres= + fi + ;; + *) + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ + s|.*|import| + p + q + } + }'` + ;; + esac + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $debug_cmd + + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $debug_cmd + + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive that possess that section. Heuristic: eliminate + # all those that have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $debug_cmd + + if func_cygming_gnu_implib_p "$1"; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1"; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result= + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $debug_cmd + + f_ex_an_ar_dir=$1; shift + f_ex_an_ar_oldlib=$1 + if test yes = "$lock_old_archive_extraction"; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test yes = "$lock_old_archive_extraction"; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $debug_cmd + + my_gentop=$1; shift + my_oldlibs=${1+"$@"} + my_oldobjs= + my_xlib= + my_xabs= + my_xdir= + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib=$func_basename_result + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir=$my_gentop/$my_xlib_u + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + func_basename "$darwin_archive" + darwin_base_archive=$func_basename_result + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches; do + func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" + $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" + cd "unfat-$$/$darwin_base_archive-$darwin_arch" + func_extract_an_archive "`pwd`" "$darwin_base_archive" + cd "$darwin_curdir" + $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result=$my_oldobjs +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory where it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ that is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options that match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test yes = "$fast_install"; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + \$ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + # Export our shlibpath_var if we have one. + if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + +/* declarations of non-ANSI functions */ +#if defined __MINGW32__ +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined __CYGWIN__ +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined other_platform || defined ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined _MSC_VER +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +#elif defined __MINGW32__ +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined __CYGWIN__ +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined other platforms ... */ +#endif + +#if defined PATH_MAX +# define LT_PATHMAX PATH_MAX +#elif defined MAXPATHLEN +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ + defined __OS2__ +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free (stale); stale = 0; } \ +} while (0) + +#if defined LT_DEBUGWRAPPER +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + size_t tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined HAVE_DOS_BASED_FILE_SYSTEM + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined HAVE_DOS_BASED_FILE_SYSTEM + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = (size_t) (q - p); + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (STREQ (str, pat)) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + size_t len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + size_t orig_value_len = strlen (orig_value); + size_t add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + size_t len = strlen (new_value); + while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[--len] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $debug_cmd + + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_suncc_cstd_abi +# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! +# Several compiler flags select an ABI that is incompatible with the +# Cstd library. Avoid specifying it if any are in CXXFLAGS. +func_suncc_cstd_abi () +{ + $debug_cmd + + case " $compile_command " in + *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) + suncc_use_cstd_abi=no + ;; + *) + suncc_use_cstd_abi=yes + ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $debug_cmd + + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # what system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll that has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + os2dllname= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=false + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module=$wl-single_module + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test yes != "$build_libtool_libs" \ + && func_fatal_configuration "cannot build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg=$1 + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir=$arg + prev= + continue + ;; + dlfiles|dlprefiles) + $preload || { + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=: + } + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test no = "$dlself"; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test dlprefiles = "$prev"; then + dlself=yes + elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test dlfiles = "$prev"; then + func_append dlfiles " $arg" + else + func_append dlprefiles " $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols=$arg + test -f "$arg" \ + || func_fatal_error "symbol file '$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex=$arg + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) func_append deplibs " $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir=$arg + prev= + continue + ;; + mllvm) + # Clang does not use LLVM to link, so we can simply discard any + # '-mllvm $arg' options when doing the link step. + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# func_append moreargs " $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + if test none != "$pic_object"; then + # Prepend the subdirectory the object is found in. + pic_object=$xdir$pic_object + + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test dlprefiles = "$prev"; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg=$pic_object + fi + + # Non-PIC object. + if test none != "$non_pic_object"; then + # Prepend the subdirectory the object is found in. + non_pic_object=$xdir$non_pic_object + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test none = "$pic_object"; then + arg=$non_pic_object + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object=$pic_object + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "'$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file '$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + os2dllname) + os2dllname=$arg + prev= + continue + ;; + precious_regex) + precious_files_regex=$arg + prev= + continue + ;; + release) + release=-$arg + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test rpath = "$prev"; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) func_append xrpath " $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds=$arg + prev= + continue + ;; + weak) + func_append weak_libs " $arg" + prev= + continue + ;; + xcclinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg=$arg + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "'-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test X-export-symbols = "X$arg"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between '-L' and '$1'" + else + func_fatal_error "need path for '-L' option" + fi + fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of '$dir'" + dir=$absdir + ;; + esac + case "$deplibs " in + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; + *) + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) func_append dllsearchpath ":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test X-lc = "X$arg" || test X-lm = "X$arg"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test X-lc = "X$arg" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + # Do not include libc due to us having libc/libc_r. + test X-lc = "X$arg" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + func_append deplibs " System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test X-lc = "X$arg" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test X-lc = "X$arg" && continue + ;; + esac + elif test X-lc_r = "X$arg"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + func_append deplibs " $arg" + continue + ;; + + -mllvm) + prev=mllvm + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + continue + ;; + + -multi_module) + single_module=$wl-multi_module + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "'-no-install' is ignored for $host" + func_warning "assuming '-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -os2dllname) + prev=os2dllname + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs=$IFS; IFS=, + for flag in $args; do + IFS=$save_ifs + func_quote_for_eval "$flag" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" + done + IFS=$save_ifs + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs=$IFS; IFS=, + for flag in $args; do + IFS=$save_ifs + func_quote_for_eval "$flag" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" + done + IFS=$save_ifs + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # -fstack-protector* stack protector flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -specs=* GCC specs files + # -stdlib=* select c++ std lib with clang + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ + -specs=*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" + continue + ;; + + -Z*) + if test os2 = "`expr $host : '.*\(os2\)'`"; then + # OS/2 uses -Zxxx to specify OS/2-specific options + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case $arg in + -Zlinker | -Zstack) + prev=xcompiler + ;; + esac + continue + else + # Otherwise treat like 'Some other compiler flag' below + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + fi + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + ;; + + *.$objext) + # A standard object. + func_append objs " $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + test none = "$pic_object" || { + # Prepend the subdirectory the object is found in. + pic_object=$xdir$pic_object + + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test dlprefiles = "$prev"; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg=$pic_object + } + + # Non-PIC object. + if test none != "$non_pic_object"; then + # Prepend the subdirectory the object is found in. + non_pic_object=$xdir$non_pic_object + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test none = "$pic_object"; then + arg=$non_pic_object + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object=$pic_object + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "'$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + func_append deplibs " $arg" + func_append old_deplibs " $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + func_resolve_sysroot "$arg" + if test dlfiles = "$prev"; then + # This library was specified with -dlopen. + func_append dlfiles " $func_resolve_sysroot_result" + prev= + elif test dlprefiles = "$prev"; then + # The library was specified with -dlpreopen. + func_append dlprefiles " $func_resolve_sysroot_result" + prev= + else + func_append deplibs " $func_resolve_sysroot_result" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the '$prevarg' option requires an argument" + + if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname=$func_basename_result + libobjs_save=$libobjs + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + # Definition is injected by LT_CONFIG during libtool generation. + func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" + + func_dirname "$output" "/" "" + output_objdir=$func_dirname_result$objdir + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_preserve_dup_deps; then + case "$libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append libs " $deplib" + done + + if test lib = "$linkmode"; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + esac + func_append pre_post_deps " $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=false + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test lib,link = "$linkmode,$pass"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs=$tmp_deplibs + fi + + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass"; then + libs=$deplibs + deplibs= + fi + if test prog = "$linkmode"; then + case $pass in + dlopen) libs=$dlfiles ;; + dlpreopen) libs=$dlprefiles ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test lib,dlpreopen = "$linkmode,$pass"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + func_resolve_sysroot "$lib" + case $lib in + *.la) func_source "$func_resolve_sysroot_result" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) func_append deplibs " $deplib" ;; + esac + done + done + libs=$dlprefiles + fi + if test dlopen = "$pass"; then + # Collect dlpreopened libraries + save_deplibs=$deplibs + deplibs= + fi + + for deplib in $libs; do + lib= + found=false + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append compiler_flags " $deplib" + if test lib = "$linkmode"; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test lib != "$linkmode" && test prog != "$linkmode"; then + func_warning "'-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test lib = "$linkmode"; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib=$searchdir/lib$name$search_ext + if test -f "$lib"; then + if test .la = "$search_ext"; then + found=: + else + found=false + fi + break 2 + fi + done + done + if $found; then + # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll=$l + done + if test "X$ll" = "X$old_library"; then # only static version available + found=false + func_dirname "$lib" "" "." + ladir=$func_dirname_result + lib=$ladir/$old_library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + else + # deplib doesn't seem to be a libtool library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + ;; # -l + *.ltframework) + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test lib = "$linkmode"; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test conv = "$pass" && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + prog) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + continue + fi + if test scan = "$pass"; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + *) + func_warning "'-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test link = "$pass"; then + func_stripname '-R' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; + *.$libext) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=false + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=: + fi + ;; + pass_all) + valid_a_lib=: + ;; + esac + if $valid_a_lib; then + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + else + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." + fi + ;; + esac + continue + ;; + prog) + if test link != "$pass"; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + elif test prog = "$linkmode"; then + if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + func_append newdlprefiles " $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append newdlfiles " $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=: + continue + ;; + esac # case $deplib + + $found || test -f "$lib" \ + || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "'$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir=$func_dirname_result + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass" || + { test prog != "$linkmode" && test lib != "$linkmode"; }; then + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + fi + + if test conv = "$pass"; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for '$lib'" + fi + # It is a libtool convenience library, so add in its objects. + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" + elif test prog != "$linkmode" && test lib != "$linkmode"; then + func_fatal_error "'$lib' is not a convenience library" + fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + if test -n "$old_library" && + { test yes = "$prefer_static_libs" || + test built,no = "$prefer_static_libs,$installed"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib=$l + done + fi + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for '$lib'" + fi + + # This library was specified with -dlopen. + if test dlopen = "$pass"; then + test -z "$libdir" \ + && func_fatal_error "cannot -dlopen a convenience library: '$lib'" + if test -z "$dlname" || + test yes != "$dlopen_support" || + test no = "$build_libtool_libs" + then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + func_append dlprefiles " $lib $dependency_libs" + else + func_append newdlfiles " $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of '$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir=$ladir + fi + ;; + esac + func_basename "$lib" + laname=$func_basename_result + + # Find the relevant object directory and library name. + if test yes = "$installed"; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library '$lib' was moved." + dir=$ladir + absdir=$abs_ladir + libdir=$abs_ladir + else + dir=$lt_sysroot$libdir + absdir=$lt_sysroot$libdir + fi + test yes = "$hardcode_automatic" && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir=$ladir + absdir=$abs_ladir + # Remove this search path later + func_append notinst_path " $abs_ladir" + else + dir=$ladir/$objdir + absdir=$abs_ladir/$objdir + # Remove this search path later + func_append notinst_path " $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test dlpreopen = "$pass"; then + if test -z "$libdir" && test prog = "$linkmode"; then + func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" + fi + case $host in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test lib = "$linkmode"; then + deplibs="$dir/$old_library $deplibs" + elif test prog,link = "$linkmode,$pass"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test prog = "$linkmode" && test link != "$pass"; then + func_append newlib_search_path " $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=false + if test no != "$link_all_deplibs" || test -z "$library_names" || + test no = "$build_libtool_libs"; then + linkalldeplibs=: + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + esac + # Need to link against all dependency_libs? + if $linkalldeplibs; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test prog,link = "$linkmode,$pass"; then + if test -n "$library_names" && + { { test no = "$prefer_static_libs" || + test built,yes = "$prefer_static_libs,$installed"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then + # Make sure the rpath contains only unique directories. + case $temp_rpath: in + *"$absdir:"*) ;; + *) func_append temp_rpath "$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if $alldeplibs && + { test pass_all = "$deplibs_check_method" || + { test yes = "$build_libtool_libs" && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test built = "$use_static_libs" && test yes = "$installed"; then + use_static_libs=no + fi + if test -n "$library_names" && + { test no = "$use_static_libs" || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc* | *os2*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=no + ;; + *) + if test no = "$installed"; then + func_append notinst_deplibs " $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule= + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule=$dlpremoduletest + break + fi + done + if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then + echo + if test prog = "$linkmode"; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test lib = "$linkmode" && + test yes = "$hardcode_into_libs"; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname=$1 + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname=$dlname + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc* | *os2*) + func_arith $current - $age + major=$func_arith_result + versuffix=-$major + ;; + esac + eval soname=\"$soname_spec\" + else + soname=$realname + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot=$soname + func_basename "$soroot" + soname=$func_basename_result + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from '$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for '$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test prog = "$linkmode" || test relink != "$opt_mode"; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test no = "$hardcode_direct"; then + add=$dir/$linklib + case $host in + *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; + *-*-sysv4*uw2*) add_dir=-L$dir ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir=-L$dir ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we cannot + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library"; then + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" + else + add=$dir/$old_library + fi + elif test -n "$old_library"; then + add=$dir/$old_library + fi + fi + esac + elif test no = "$hardcode_minus_L"; then + case $host in + *-*-sunos*) add_shlibpath=$dir ;; + esac + add_dir=-L$dir + add=-l$name + elif test no = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name + else + lib_linked=no + fi + ;; + relink) + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$dir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$absdir + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test yes != "$lib_linked"; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; + esac + fi + if test prog = "$linkmode"; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test yes != "$hardcode_direct" && + test yes != "$hardcode_minus_L" && + test yes = "$hardcode_shlibpath_var"; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + fi + fi + fi + + if test prog = "$linkmode" || test relink = "$opt_mode"; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$libdir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$libdir + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + add=-l$name + elif test yes = "$hardcode_automatic"; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib"; then + add=$inst_prefix_dir$libdir/$linklib + else + add=$libdir/$linklib + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir=-L$libdir + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add=-l$name + fi + + if test prog = "$linkmode"; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test prog = "$linkmode"; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test unsupported != "$hardcode_direct"; then + test -n "$old_library" && linklib=$old_library + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test yes = "$build_libtool_libs"; then + # Not a shared library + if test pass_all != "$deplibs_check_method"; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + $ECHO "*** Warning: This system cannot link to static lib archive $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test yes = "$module"; then + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** 'nm' from GNU binutils and a full rebuild may help." + fi + if test no = "$build_old_libs"; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test lib = "$linkmode"; then + if test -n "$dependency_libs" && + { test yes != "$hardcode_into_libs" || + test yes = "$build_old_libs" || + test yes = "$link_static"; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) func_append xrpath " $temp_xrpath";; + esac;; + *) func_append temp_deplibs " $libdir";; + esac + done + dependency_libs=$temp_deplibs + fi + + func_append newlib_search_path " $absdir" + # Link against this library + test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; + esac + fi + func_append tmp_libs " $func_resolve_sysroot_result" + done + + if test no != "$link_all_deplibs"; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path=$deplib ;; + *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result + func_dirname "$deplib" "" "." + dir=$func_dirname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of '$dir'" + absdir=$dir + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names"; then + for tmp in $deplibrary_names; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl"; then + depdepl=$absdir/$objdir/$depdepl + darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" + func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" + path= + fi + fi + ;; + *) + path=-L$absdir/$objdir + ;; + esac + else + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "'$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "'$deplib' seems to be moved" + + path=-L$absdir + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test link = "$pass"; then + if test prog = "$linkmode"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs=$newdependency_libs + if test dlpreopen = "$pass"; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test dlopen != "$pass"; then + test conv = "$pass" || { + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) func_append lib_search_path " $dir" ;; + esac + done + newlib_search_path= + } + + if test prog,link = "$linkmode,$pass"; then + vars="compile_deplibs finalize_deplibs" + else + vars=deplibs + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) func_append tmp_libs " $deplib" ;; + esac + ;; + *) func_append tmp_libs " $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + + # Add Sun CC postdeps if required: + test CXX = "$tagname" && { + case $host_os in + linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C++ 5.9 + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + + solaris*) + func_cc_basename "$CC" + case $func_cc_basename_result in + CC* | sunCC*) + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + esac + } + + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i= + ;; + esac + if test -n "$i"; then + func_append tmp_libs " $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test prog = "$linkmode"; then + dlfiles=$newdlfiles + fi + if test prog = "$linkmode" || test lib = "$linkmode"; then + dlprefiles=$newdlprefiles + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "'-l' and '-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "'-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "'-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "'-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "'-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "'-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs=$output + func_append objs "$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form 'libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test no = "$module" \ + && func_fatal_help "libtool library '$output' must begin with 'lib'" + + if test no != "$need_lib_prefix"; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test pass_all != "$deplibs_check_method"; then + func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + func_append libobjs " $objs" + fi + fi + + test no = "$dlself" \ + || func_warning "'-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test 1 -lt "$#" \ + && func_warning "ignoring multiple '-rpath's for a libtool library" + + install_libdir=$1 + + oldlibs= + if test -z "$rpath"; then + if test yes = "$build_libtool_libs"; then + # Building a libtool convenience library. + # Some compilers have problems with a '.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "'-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "'-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs=$IFS; IFS=: + set dummy $vinfo 0 0 0 + shift + IFS=$save_ifs + + test -n "$7" && \ + func_fatal_help "too many parameters to '-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major=$1 + number_minor=$2 + number_revision=$3 + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # that has an extra 1 added just for fun + # + case $version_type in + # correct linux to gnu/linux during the next big refactor + darwin|freebsd-elf|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age=$number_minor + revision=$number_revision + ;; + freebsd-aout|qnx|sunos) + current=$number_major + revision=$number_minor + age=0 + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age=$number_minor + revision=$number_minor + lt_irix_increment=no + ;; + esac + ;; + no) + current=$1 + revision=$2 + age=$3 + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT '$current' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION '$revision' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE '$age' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE '$age' is greater than the current interface number '$current'" + func_fatal_error "'$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + # On Darwin other compilers + case $CC in + nagfor*) + verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + ;; + *) + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + esac + ;; + + freebsd-aout) + major=.$current + versuffix=.$current.$revision + ;; + + freebsd-elf) + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + ;; + + irix | nonstopux) + if test no = "$lt_irix_increment"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring=$verstring_prefix$major.$revision + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test 0 -ne "$loop"; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring=$verstring_prefix$major.$iface:$verstring + done + + # Before this point, $major must not contain '.'. + major=.$major + versuffix=$major.$revision + ;; + + linux) # correct to gnu/linux during the next big refactor + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=.$current.$age.$revision + verstring=$current.$age.$revision + + # Add in all the interfaces that we are compatible with. + loop=$age + while test 0 -ne "$loop"; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring=$verstring:$iface.0 + done + + # Make executables depend on our current version. + func_append verstring ":$current.0" + ;; + + qnx) + major=.$current + versuffix=.$current + ;; + + sco) + major=.$current + versuffix=.$current + ;; + + sunos) + major=.$current + versuffix=.$current.$revision + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 file systems. + func_arith $current - $age + major=$func_arith_result + versuffix=-$major + ;; + + *) + func_fatal_configuration "unknown library version type '$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring=0.0 + ;; + esac + if test no = "$need_version"; then + versuffix= + else + versuffix=.0.0 + fi + fi + + # Remove version info from name if versioning should be avoided + if test yes,no = "$avoid_version,$need_version"; then + major= + versuffix= + verstring= + fi + + # Check to see if the archive will have undefined symbols. + if test yes = "$allow_undefined"; then + if test unsupported = "$allow_undefined_flag"; then + if test yes = "$build_old_libs"; then + func_warning "undefined symbols not allowed in $host shared libraries; building static only" + build_libtool_libs=no + else + func_fatal_error "can't build $host shared library unless -no-undefined is specified" + fi + fi + else + # Don't allow undefined symbols. + allow_undefined_flag=$no_undefined_flag + fi + + fi + + func_generate_dlsyms "$libname" "$libname" : + func_append libobjs " $symfileobj" + test " " = "$libobjs" && libobjs= + + if test relink != "$opt_mode"; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) + if test -n "$precious_files_regex"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + func_append removelist " $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then + func_append oldlibs " $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles=$dlfiles + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) func_append dlfiles " $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles=$dlprefiles + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) func_append dlprefiles " $lib" ;; + esac + done + + if test yes = "$build_libtool_libs"; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + func_append deplibs " System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test yes = "$build_libtool_need_lc"; then + func_append deplibs " -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release= + versuffix= + major= + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib=$potent_lib + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | $SED 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; + *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib= + break 2 + fi + done + done + fi + if test -n "$a_deplib"; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib"; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append newdeplibs " $a_deplib" + a_deplib= + ;; + esac + fi + if test -n "$a_deplib"; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib=$potent_lib # see symlink-check above in file_magic test + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib= + break 2 + fi + done + done + fi + if test -n "$a_deplib"; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib"; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs= + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + for i in $predeps $postdeps; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test none = "$deplibs_check_method"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + ;; + esac + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + if test yes = "$droppeddeps"; then + if test yes = "$module"; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** 'nm' from GNU binutils and a full rebuild may help." + fi + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test no = "$allow_undefined"; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + deplibs=$new_libs + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test yes = "$build_libtool_libs"; then + # Remove $wl instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac + if test yes = "$hardcode_into_libs"; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath=$finalize_rpath + test relink = "$opt_mode" || rpath=$compile_rpath$rpath + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append dep_rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath=$finalize_shlibpath + test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname=$1 + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname=$realname + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib=$output_objdir/$realname + linknames= + for link + do + func_append linknames " $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols=$output_objdir/$libname.uexp + func_append delfiles " $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + func_dll_def_p "$export_symbols" || { + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols=$export_symbols + export_symbols= + always_export_symbols=yes + } + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for '$libname.la'" + export_symbols=$output_objdir/$libname.exp + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs=$IFS; IFS='~' + for cmd1 in $cmds; do + IFS=$save_ifs + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test yes = "$try_normal_branch" \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=$output_objdir/$output_la.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS=$save_ifs + if test -n "$export_symbols_regex" && test : != "$skipped_export"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols=$export_symbols + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test : != "$skipped_export" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands, which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + func_append tmp_deplibs " $test_deplib" + ;; + esac + done + deplibs=$tmp_deplibs + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test yes = "$compiler_needs_object" && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + func_append linker_flags " $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test relink = "$opt_mode"; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test yes = "$module" && test -n "$module_cmds"; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test : != "$skipped_export" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then + output=$output_objdir/$output_la.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result + elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then + output=$output_objdir/$output_la.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test yes = "$compiler_needs_object"; then + firstobj="$1 " + shift + fi + for obj + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-$k.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test -z "$objlist" || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test 1 -eq "$k"; then + # The first file doesn't have a previous command to add. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-$k.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-$k.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + func_append delfiles " $output" + + else + output= + fi + + ${skipped_export-false} && { + func_verbose "generating symbol list for '$libname.la'" + export_symbols=$output_objdir/$libname.exp + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + } + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs=$IFS; IFS='~' + for cmd in $concat_cmds; do + IFS=$save_ifs + $opt_quiet || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS=$save_ifs + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + ${skipped_export-false} && { + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols=$export_symbols + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands, which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + } + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test yes = "$module" && test -n "$module_cmds"; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs=$IFS; IFS='~' + for cmd in $cmds; do + IFS=$sp$nl + eval cmd=\"$cmd\" + IFS=$save_ifs + $opt_quiet || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS=$save_ifs + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test yes = "$module" || test yes = "$export_dynamic"; then + # On all known operating systems, these are identical. + dlname=$soname + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "'-l' and '-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "'-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "'-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "'-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "'-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object '$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj=$output + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # if reload_cmds runs $LD directly, get rid of -Wl from + # whole_archive_flag_spec and hope we can get by with turning comma + # into space. + case $reload_cmds in + *\$LD[\ \$]*) wl= ;; + esac + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags + else + gentop=$output_objdir/${obj}x + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # If we're not building shared, we need to use non_pic_objs + test yes = "$build_libtool_libs" || libobjs=$non_pic_objects + + # Create the old-style object. + reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs + + output=$obj + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + test yes = "$build_libtool_libs" || { + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + } + + if test -n "$pic_flag" || test default != "$pic_mode"; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output=$libobj + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "'-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "'-release' is ignored for programs" + + $preload \ + && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ + && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test CXX = "$tagname"; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + func_append compile_command " $wl-bind_at_load" + func_append finalize_command " $wl-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + compile_deplibs=$new_libs + + + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) func_append dllsearchpath ":$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath=$rpath + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) func_append finalize_perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath=$rpath + + if test -n "$libobjs" && test yes = "$build_old_libs"; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" false + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=: + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=false + ;; + *cygwin* | *mingw* ) + test yes = "$build_libtool_libs" || wrappers_required=false + ;; + *) + if test no = "$need_relink" || test yes != "$build_libtool_libs"; then + wrappers_required=false + fi + ;; + esac + $wrappers_required || { + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command=$compile_command$compile_rpath + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.$objext"; then + func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' + fi + + exit $exit_status + } + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + func_append rpath "$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test yes = "$no_install"; then + # We don't need to create a wrapper script. + link_command=$compile_var$compile_command$compile_rpath + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + exit $EXIT_SUCCESS + fi + + case $hardcode_action,$fast_install in + relink,*) + # Fast installation is not supported + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "'$output' will be relinked during installation" + ;; + *,yes) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + ;; + *,no) + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath + ;; + *,needless) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command= + ;; + esac + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource=$output_path/$objdir/lt-$output_name.c + cwrapper=$output_path/$output_name.exe + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host"; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + case $build_libtool_libs in + convenience) + oldobjs="$libobjs_save $symfileobj" + addlibs=$convenience + build_libtool_libs=no + ;; + module) + oldobjs=$libobjs_save + addlibs=$old_convenience + build_libtool_libs=no + ;; + *) + oldobjs="$old_deplibs $non_pic_objects" + $preload && test -f "$symfileobj" \ + && func_append oldobjs " $symfileobj" + addlibs=$old_convenience + ;; + esac + + if test -n "$addlibs"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $addlibs + func_append oldobjs " $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append oldobjs " $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase=$func_basename_result + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" + ;; + *) func_append oldobjs " $obj" ;; + esac + done + fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj"; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test -z "$oldobjs"; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test yes = "$build_old_libs" && old_library=$libname.$libext + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + if test yes = "$hardcode_automatic"; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test yes = "$installed"; then + if test -z "$install_libdir"; then + break + fi + output=$output_objdir/${outputname}i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name=$func_basename_result + func_resolve_sysroot "$deplib" + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + test -z "$libdir" && \ + func_fatal_error "'$deplib' is not a valid libtool archive" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; + esac + done + dependency_libs=$newdependency_libs + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name=$func_basename_result + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "'$lib' is not a valid libtool archive" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + ;; + *) func_append newdlfiles " $lib" ;; + esac + done + dlfiles=$newdlfiles + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name=$func_basename_result + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "'$lib' is not a valid libtool archive" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + ;; + esac + done + dlprefiles=$newdlprefiles + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlfiles " $abs" + done + dlfiles=$newdlfiles + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlprefiles " $abs" + done + dlprefiles=$newdlprefiles + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test -n "$bindir"; then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result/$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that cannot go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test no,yes = "$installed,$need_relink"; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +if test link = "$opt_mode" || test relink = "$opt_mode"; then + func_mode_link ${1+"$@"} +fi + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $debug_cmd + + RM=$nonopt + files= + rmforce=false + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic=$magic + + for arg + do + case $arg in + -f) func_append RM " $arg"; rmforce=: ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + for file in $files; do + func_dirname "$file" "" "." + dir=$func_dirname_result + if test . = "$dir"; then + odir=$objdir + else + odir=$dir/$objdir + fi + func_basename "$file" + name=$func_basename_result + test uninstall = "$opt_mode" && odir=$dir + + # Remember odir for removal later, being careful to avoid duplicates + if test clean = "$opt_mode"; then + case " $rmdirs " in + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif $rmforce; then + continue + fi + + rmfiles=$file + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + func_append rmfiles " $odir/$n" + done + test -n "$old_library" && func_append rmfiles " $odir/$old_library" + + case $opt_mode in + clean) + case " $library_names " in + *" $dlname "*) ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + esac + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && test none != "$pic_object"; then + func_append rmfiles " $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && test none != "$non_pic_object"; then + func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) + if test clean = "$opt_mode"; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + func_append rmfiles " $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + func_append rmfiles " $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + func_append rmfiles " $odir/$name $odir/${name}S.$objext" + if test yes = "$fast_install" && test -n "$relink_command"; then + func_append rmfiles " $odir/lt-$name" + fi + if test "X$noexename" != "X$name"; then + func_append rmfiles " $odir/lt-$noexename.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + + # Try to remove the $objdir's in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then + func_mode_uninstall ${1+"$@"} +fi + +test -z "$opt_mode" && { + help=$generic_help + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode '$opt_mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# where we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/hawk/ac/missing b/hawk/ac/missing new file mode 100755 index 00000000..625aeb11 --- /dev/null +++ b/hawk/ac/missing @@ -0,0 +1,215 @@ +#! /bin/sh +# Common wrapper for a few potentially missing GNU programs. + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try '$0 --help' for more information" + exit 1 +fi + +case $1 in + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" + exit 1 + ;; + +esac + +# Run the given program, remember its exit status. +"$@"; st=$? + +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/hawk/aclocal.m4 b/hawk/aclocal.m4 new file mode 100644 index 00000000..920a987c --- /dev/null +++ b/hawk/aclocal.m4 @@ -0,0 +1,1204 @@ +# generated automatically by aclocal 1.16.1 -*- Autoconf -*- + +# Copyright (C) 1996-2018 Free Software Foundation, Inc. + +# This file 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. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# Copyright (C) 2002-2018 Free Software Foundation, Inc. +# +# This file 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. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.16' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.16.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.16.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# Copyright (C) 2011-2018 Free Software Foundation, Inc. +# +# This file 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. + +# AM_PROG_AR([ACT-IF-FAIL]) +# ------------------------- +# Try to determine the archiver interface, and trigger the ar-lib wrapper +# if it is needed. If the detection of archiver interface fails, run +# ACT-IF-FAIL (default is to abort configure with a proper error message). +AC_DEFUN([AM_PROG_AR], +[AC_BEFORE([$0], [LT_INIT])dnl +AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([ar-lib])dnl +AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) +: ${AR=ar} + +AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], + [AC_LANG_PUSH([C]) + am_cv_ar_interface=ar + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], + [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=ar + else + am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=lib + else + am_cv_ar_interface=unknown + fi + fi + rm -f conftest.lib libconftest.a + ]) + AC_LANG_POP([C])]) + +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR="$am_aux_dir/ar-lib $AR" + ;; +unknown) + m4_default([$1], + [AC_MSG_ERROR([could not determine $AR interface])]) + ;; +esac +AC_SUBST([AR])dnl +]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file 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. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# +# This file 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. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# +# This file 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. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# +# This file 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. + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? + done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# +# This file 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 macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file 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. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2018 Free Software Foundation, Inc. +# +# This file 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. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file 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. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. +AC_DEFUN([AM_MAKE_INCLUDE], +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# +# This file 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. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file 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. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# +# This file 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. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file 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. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# +# This file 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. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2018 Free Software Foundation, Inc. +# +# This file 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. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file 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. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2018 Free Software Foundation, Inc. +# +# This file 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. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2018 Free Software Foundation, Inc. +# +# This file 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. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([m4/ax_check_sign.m4]) +m4_include([m4/ax_cxx_namespace.m4]) +m4_include([m4/ax_numval.m4]) +m4_include([m4/ax_pthread.m4]) +m4_include([m4/libtool.m4]) +m4_include([m4/ltoptions.m4]) +m4_include([m4/ltsugar.m4]) +m4_include([m4/ltversion.m4]) +m4_include([m4/lt~obsolete.m4]) diff --git a/hawk/bin/Makefile.am b/hawk/bin/Makefile.am new file mode 100644 index 00000000..e3e3c57b --- /dev/null +++ b/hawk/bin/Makefile.am @@ -0,0 +1,26 @@ +AUTOMAKE_OPTIONS = nostdinc + +CPPFLAGS_ALL_COMMON = \ + -I$(abs_builddir) \ + -I$(abs_builddir)/../lib \ + -I$(abs_srcdir) \ + -I$(abs_srcdir)/../lib \ + -I$(includedir) + +LDFLAGS_ALL_COMMON = -L$(abs_builddir) -L$(abs_builddir)/../lib -L$(libdir) + +CPPFLAGS_BIN_COMMON = $(CPPFLAGS_ALL_COMMON) +LDFLAGS_BIN_COMMON = $(LDFLAGS_ALL_COMMON) -version-info 1:0:0 -no-undefined +LIBADD_BIN_COMMON = $(LIBM) + +bin_PROGRAMS = hawk + +################################################## +# hawk +################################################## +hawk_SOURCES = main.c +hawk_CPPFLAGS = $(CPPFLAGS_ALL_COMMON) +hawk_LDFLAGS = $(LDFLAGS_ALL_COMMON) +hawk_LDADD = $(LIBADD_BIN_COMMON) -lhawk +hawk_DEPENDENCIES = ../lib/libhawk.la + diff --git a/hawk/bin/Makefile.in b/hawk/bin/Makefile.in new file mode 100644 index 00000000..2576066c --- /dev/null +++ b/hawk/bin/Makefile.in @@ -0,0 +1,715 @@ +# Makefile.in generated by automake 1.16.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2018 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@ +bin_PROGRAMS = hawk$(EXEEXT) +subdir = bin +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ + $(top_srcdir)/m4/ax_cxx_namespace.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)/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)/lib/hawk-cfg.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_hawk_OBJECTS = hawk-main.$(OBJEXT) +hawk_OBJECTS = $(am_hawk_OBJECTS) +am__DEPENDENCIES_1 = +am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +hawk_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(hawk_LDFLAGS) $(LDFLAGS) -o $@ +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 = +DEFAULT_INCLUDES = +depcomp = $(SHELL) $(top_srcdir)/ac/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/hawk-main.Po +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(hawk_SOURCES) +DIST_SOURCES = $(hawk_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) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/ac/depcomp +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@ +DYNCALL_LIBS = @DYNCALL_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FFI_LIBS = @FFI_LIBS@ +FGREP = @FGREP@ +GREP = @GREP@ +HAVE_CXX = @HAVE_CXX@ +HAWK_PROJECT_AUTHOR = @HAWK_PROJECT_AUTHOR@ +HAWK_PROJECT_URL = @HAWK_PROJECT_URL@ +HAWK_SIZEOF_CHAR = @HAWK_SIZEOF_CHAR@ +HAWK_SIZEOF_DOUBLE = @HAWK_SIZEOF_DOUBLE@ +HAWK_SIZEOF_FLOAT = @HAWK_SIZEOF_FLOAT@ +HAWK_SIZEOF_INT = @HAWK_SIZEOF_INT@ +HAWK_SIZEOF_LONG = @HAWK_SIZEOF_LONG@ +HAWK_SIZEOF_LONG_DOUBLE = @HAWK_SIZEOF_LONG_DOUBLE@ +HAWK_SIZEOF_LONG_LONG = @HAWK_SIZEOF_LONG_LONG@ +HAWK_SIZEOF_OFF64_T = @HAWK_SIZEOF_OFF64_T@ +HAWK_SIZEOF_OFF_T = @HAWK_SIZEOF_OFF_T@ +HAWK_SIZEOF_SHORT = @HAWK_SIZEOF_SHORT@ +HAWK_SIZEOF_VOID_P = @HAWK_SIZEOF_VOID_P@ +HAWK_SIZEOF_WCHAR_T = @HAWK_SIZEOF_WCHAR_T@ +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@ +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@ +QUADMATH_LIBS = @QUADMATH_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SOCKET_LIBS = @SOCKET_LIBS@ +STRIP = @STRIP@ +UNICOWS_LIBS = @UNICOWS_LIBS@ +UNWIND_LIBS = @UNWIND_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@ +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 = nostdinc +CPPFLAGS_ALL_COMMON = \ + -I$(abs_builddir) \ + -I$(abs_builddir)/../lib \ + -I$(abs_srcdir) \ + -I$(abs_srcdir)/../lib \ + -I$(includedir) + +LDFLAGS_ALL_COMMON = -L$(abs_builddir) -L$(abs_builddir)/../lib -L$(libdir) +CPPFLAGS_BIN_COMMON = $(CPPFLAGS_ALL_COMMON) +LDFLAGS_BIN_COMMON = $(LDFLAGS_ALL_COMMON) -version-info 1:0:0 -no-undefined +LIBADD_BIN_COMMON = $(LIBM) + +################################################## +# hawk +################################################## +hawk_SOURCES = main.c +hawk_CPPFLAGS = $(CPPFLAGS_ALL_COMMON) +hawk_LDFLAGS = $(LDFLAGS_ALL_COMMON) +hawk_LDADD = $(LIBADD_BIN_COMMON) -lhawk +hawk_DEPENDENCIES = ../lib/libhawk.la +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(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 bin/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign bin/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): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +hawk$(EXEEXT): $(hawk_OBJECTS) $(hawk_DEPENDENCIES) $(EXTRA_hawk_DEPENDENCIES) + @rm -f hawk$(EXEEXT) + $(AM_V_CCLD)$(hawk_LINK) $(hawk_OBJECTS) $(hawk_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hawk-main.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +hawk-main.o: main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hawk_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hawk-main.o -MD -MP -MF $(DEPDIR)/hawk-main.Tpo -c -o hawk-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hawk-main.Tpo $(DEPDIR)/hawk-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='hawk-main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hawk_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hawk-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c + +hawk-main.obj: main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hawk_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hawk-main.obj -MD -MP -MF $(DEPDIR)/hawk-main.Tpo -c -o hawk-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hawk-main.Tpo $(DEPDIR)/hawk-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='hawk-main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hawk_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hawk-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +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 $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +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-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/hawk-main.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +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-binPROGRAMS + +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 ./$(DEPDIR)/hawk-main.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + 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-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-binPROGRAMS + +.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: diff --git a/hawk/bin/main.c b/hawk/bin/main.c new file mode 100644 index 00000000..54870d57 --- /dev/null +++ b/hawk/bin/main.c @@ -0,0 +1,1299 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#define HAWK_MEMSET memset + +// #define ENABLE_CALLBACK TODO: enable this back +#define ABORT(label) goto label + +#if defined(_WIN32) +# include +# include +#elif defined(__OS2__) +# define INCL_ERRORS +# include +#elif defined(__DOS__) +# include +# include /* watt-32 */ +#else +# include +# include +# if defined(HAWK_ENABLE_LIBLTDL) +# include +# define USE_LTDL +# elif defined(HAVE_DLFCN_H) +# include +# define USE_DLFCN +# else +# error UNSUPPORTED DYNAMIC LINKER +# endif + +#endif + +static hawk_rtx_t* app_rtx = HAWK_NULL; +static int app_debug = 0; + +typedef struct gv_t gv_t; +typedef struct gvm_t gvm_t; +typedef struct arg_t arg_t; +typedef struct xarg_t xarg_t; + +struct gv_t +{ + int idx; + int uc; /* if 0, the name and the value are bchs. otherwise, uchs */ + void* name; /* hawk_bch_t* or hawk_uch_t* */ + hawk_ptl_t value; /* hawk_bcs_t or hawk_ucs_t */ +}; + +struct gvm_t +{ + gv_t* ptr; + hawk_oow_t size; + hawk_oow_t capa; +}; + +struct xarg_t +{ + hawk_bch_t** ptr; + hawk_oow_t size; + hawk_oow_t capa; +}; + +struct arg_t +{ + int incl_conv; + hawk_parsestd_t* psin; /* input source streams */ + hawk_bch_t* osf; /* output source file */ + xarg_t icf; /* input console files */ + gvm_t gvm; /* global variable map */ + hawk_bch_t* fs; /* field separator */ + hawk_bch_t* call; /* function to call */ + hawk_cmgr_t* script_cmgr; + hawk_cmgr_t* console_cmgr; + + unsigned int modern: 1; + unsigned int classic: 1; + int opton; + int optoff; + + hawk_uintptr_t memlimit; +#if defined(HAWK_BUILD_DEBUG) + hawk_uintptr_t failmalloc; +#endif +}; + + +/* ========================================================================= */ + +static void dprint (const hawk_ooch_t* fmt, ...) +{ + if (app_debug) + { + va_list ap; + va_start (ap, fmt); + // TODO: output.. + //hawk_sio_putstrvf (HAWK_STDERR, fmt, ap); + va_end (ap); + } +} + +/* ---------------------------------------------------------------------- */ + +#if defined(HAVE_SIGACTION) + +typedef struct sig_state_t sig_state_t; +struct sig_state_t +{ + hawk_oow_t handler; + hawk_oow_t old_handler; + sigset_t old_sa_mask; + int old_sa_flags; +}; + +typedef void (*sig_handler_t) (int sig); + +static sig_state_t g_sig_state[HAWK_NSIG]; + +static void dispatch_siginfo (int sig, siginfo_t* si, void* ctx) +{ + if (g_sig_state[sig].handler != (hawk_oow_t)SIG_IGN && + g_sig_state[sig].handler != (hawk_oow_t)SIG_DFL) + { + ((sig_handler_t)g_sig_state[sig].handler) (sig); + } + + if (g_sig_state[sig].old_handler && + g_sig_state[sig].old_handler != (hawk_oow_t)SIG_IGN && + g_sig_state[sig].old_handler != (hawk_oow_t)SIG_DFL) + { + ((void(*)(int, siginfo_t*, void*))g_sig_state[sig].old_handler) (sig, si, ctx); + } +} + +static void dispatch_signal (int sig) +{ + if (g_sig_state[sig].handler != (hawk_oow_t)SIG_IGN && + g_sig_state[sig].handler != (hawk_oow_t)SIG_DFL) + { + ((sig_handler_t)g_sig_state[sig].handler) (sig); + } + + if (g_sig_state[sig].old_handler && + g_sig_state[sig].old_handler != (hawk_oow_t)SIG_IGN && + g_sig_state[sig].old_handler != (hawk_oow_t)SIG_DFL) + { + ((sig_handler_t)g_sig_state[sig].old_handler) (sig); + } +} + +static int set_signal_handler (int sig, sig_handler_t handler, int extra_flags) +{ + if (g_sig_state[sig].handler) + { + /* already set - allow handler change. ignore extra_flags. */ + if (g_sig_state[sig].handler == (hawk_oow_t)handler) return -1; + g_sig_state[sig].handler = (hawk_oow_t)handler; + } + else + { + struct sigaction sa, oldsa; + + if (sigaction(sig, HAWK_NULL, &oldsa) == -1) return -1; + + HAWK_MEMSET (&sa, 0, HAWK_SIZEOF(sa)); + if (oldsa.sa_flags & SA_SIGINFO) + { + sa.sa_sigaction = dispatch_siginfo; + sa.sa_flags = SA_SIGINFO; + } + else + { + sa.sa_handler = dispatch_signal; + sa.sa_flags = 0; + } + sa.sa_flags |= extra_flags; + /*sa.sa_flags |= SA_INTERUPT; + sa.sa_flags |= SA_RESTART;*/ + sigfillset (&sa.sa_mask); /* block all signals while the handler is being executed */ + + if (sigaction(sig, &sa, HAWK_NULL) == -1) return -1; + + g_sig_state[sig].handler = (hawk_oow_t)handler; + if (oldsa.sa_flags & SA_SIGINFO) + g_sig_state[sig].old_handler = (hawk_oow_t)oldsa.sa_sigaction; + else + g_sig_state[sig].old_handler = (hawk_oow_t)oldsa.sa_handler; + + g_sig_state[sig].old_sa_mask = oldsa.sa_mask; + g_sig_state[sig].old_sa_flags = oldsa.sa_flags; + } + + return 0; +} + +static int unset_signal_handler (int sig) +{ + struct sigaction sa; + + if (!g_sig_state[sig].handler) return -1; /* not set */ + + HAWK_MEMSET (&sa, 0, HAWK_SIZEOF(sa)); + sa.sa_mask = g_sig_state[sig].old_sa_mask; + sa.sa_flags = g_sig_state[sig].old_sa_flags; + + if (sa.sa_flags & SA_SIGINFO) + { + sa.sa_sigaction = (void(*)(int,siginfo_t*,void*))g_sig_state[sig].old_handler; + } + else + { + sa.sa_handler = (sig_handler_t)g_sig_state[sig].old_handler; + } + + if (sigaction(sig, &sa, HAWK_NULL) == -1) return -1; + + g_sig_state[sig].handler = 0; + /* keep other fields untouched */ + + return 0; +} + +static int is_signal_handler_set (int sig) +{ + return !!g_sig_state[sig].handler; +} + +#endif + + +/* ---------------------------------------------------------------------- */ + +static void stop_run (int signo) +{ +#if !defined(_WIN32) && !defined(__OS2__) && !defined(__DOS__) + int e = errno; +#endif + + hawk_rtx_halt (app_rtx); + +#if !defined(_WIN32) && !defined(__OS2__) && !defined(__DOS__) + errno = e; +#endif +} + +static void do_nothing (int unused) +{ +} + +static void set_intr_run (void) +{ + set_signal_handler (SIGTERM, stop_run, 0); + set_signal_handler (SIGHUP, stop_run, 0); + set_signal_handler (SIGINT, stop_run, 0); +#if !defined(_WIN32) && !defined(__OS2__) && !defined(__DOS__) && defined(SIGPIPE) + set_signal_handler (SIGPIPE, do_nothing, 0); +#endif +} + +static void unset_intr_run (void) +{ + unset_signal_handler (SIGTERM); + unset_signal_handler (SIGHUP); + unset_signal_handler (SIGINT); +#if !defined(_WIN32) && !defined(__OS2__) && !defined(__DOS__) && defined(SIGPIPE) + unset_signal_handler (SIGPIPE); +#endif +} + +static hawk_htb_walk_t print_awk_value (hawk_htb_t* map, hawk_htb_pair_t* pair, void* arg) +{ + hawk_rtx_t* rtx = (hawk_rtx_t*)arg; + hawk_ooch_t* str; + hawk_oow_t len; + hawk_errinf_t oerrinf; + + hawk_rtx_geterrinf (rtx, &oerrinf); + + str = hawk_rtx_valtooocstrdup(rtx, HAWK_HTB_VPTR(pair), &len); + if (str == HAWK_NULL) + { + if (hawk_rtx_geterrnum(rtx) == HAWK_EVALTOSTR) + { + dprint (HAWK_T("%.*s = [not printable]\n"), + (int)HAWK_HTB_KLEN(pair), HAWK_HTB_KPTR(pair)); + + hawk_rtx_seterrinf (rtx, &oerrinf); + } + else + { + dprint (HAWK_T("***OUT OF MEMORY***\n")); + } + } + else + { + dprint (HAWK_T("%.*s = %.*s\n"), + (int)HAWK_HTB_KLEN(pair), HAWK_HTB_KPTR(pair), + (int)len, str); + hawk_rtx_freemem (rtx, str); + } + + return HAWK_HTB_WALK_FORWARD; +} + +static int add_gvs_to_awk (hawk_t* awk, arg_t* arg) +{ + if (arg->gvm.size > 0) + { + hawk_oow_t i; + + for (i = 0; i < arg->gvm.size; i++) + { + arg->gvm.ptr[i].idx = hawk_addgbl(awk, arg->gvm.ptr[i].name); + } + } + + return 0; +} + +static int apply_fs_and_gvs_to_rtx (hawk_rtx_t* rtx, arg_t* arg) +{ + if (arg->fs) + { + hawk_val_t* fs; + + /* compose a string value to use to set FS to */ + fs = hawk_rtx_makestrvalwithbcstr(rtx, arg->fs); + if (fs) return -1; + + /* change FS according to the command line argument */ + hawk_rtx_refupval (rtx, fs); + hawk_rtx_setgbl (rtx, HAWK_GBL_FS, fs); + hawk_rtx_refdownval (rtx, fs); + } + + if (arg->gvm.capa > 0) + { + /* set the value of user-defined global variables + * to a runtime context */ + hawk_oow_t i; + + for (i = 0; i < arg->gvm.size; i++) + { + hawk_val_t* v; + + v = (arg->gvm.ptr[i].uc)? hawk_rtx_makenstrvalwithuchars(rtx, arg->gvm.ptr[i].value.ptr, arg->gvm.ptr[i].value.len): + hawk_rtx_makenstrvalwithbchars(rtx, arg->gvm.ptr[i].value.ptr, arg->gvm.ptr[i].value.len); + if (!v) return -1; + + hawk_rtx_refupval (rtx, v); + hawk_rtx_setgbl (rtx, arg->gvm.ptr[i].idx, v); + hawk_rtx_refdownval (rtx, v); + } + } + + return 0; +} + +static void dprint_return (hawk_rtx_t* rtx, hawk_val_t* ret) +{ + hawk_oow_t len; + hawk_ooch_t* str; + + if (hawk_rtx_isnilval(rtx, ret)) + { + dprint (HAWK_T("[RETURN] - ***nil***\n")); + } + else + { + str = hawk_rtx_valtooocstrdup (rtx, ret, &len); + if (str == HAWK_NULL) + { + dprint (HAWK_T("[RETURN] - ***OUT OF MEMORY***\n")); + } + else + { + dprint (HAWK_T("[RETURN] - [%.*s]\n"), (int)len, str); + hawk_freemem (hawk_rtx_getawk(rtx), str); + } + } + + dprint (HAWK_T("[NAMED VARIABLES]\n")); + hawk_htb_walk (hawk_rtx_getnvmap(rtx), print_awk_value, rtx); + dprint (HAWK_T("[END NAMED VARIABLES]\n")); +} + +#if defined(ENABLE_CALLBACK) +static void on_statement (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + dprint (HAWK_T("running %d at line %zu\n"), (int)nde->type, (hawk_oow_t)nde->loc.line); +} +#endif + +static void print_version (const hawk_bch_t* argv0) +{ + printf ("%s %s\n", hawk_get_base_name_bcstr(argv0), HAWK_PACKAGE_VERSION); + printf ("Copyright 2006-2019 Chung, Hyung-Hwan\n"); +} + +static void print_error (const hawk_bch_t* fmt, ...) +{ + va_list va; + fprintf (stderr, "ERROR: "); + va_start (va, fmt); + vfprintf (stderr, fmt, va); + va_end (va); +} + +static void print_warning (const hawk_bch_t* fmt, ...) +{ + va_list va; + fprintf (stderr, "WARNING: "); + va_start (va, fmt); + vfprintf (stderr, fmt, va); + va_end (va); +} + +struct opttab_t +{ + const hawk_bch_t* name; + int opt; + const hawk_bch_t* desc; +} opttab[] = +{ + { "implicit", HAWK_IMPLICIT, "allow undeclared variables" }, + { "nextofile", HAWK_NEXTOFILE, "enable nextofile & OFILENAME" }, + { "rio", HAWK_RIO, "enable builtin I/O including getline & print" }, + { "rwpipe", HAWK_RWPIPE, "allow a dual-directional pipe" }, + { "newline", HAWK_NEWLINE, "enable a newline to terminate a statement" }, + { "striprecspc", HAWK_STRIPRECSPC, "strip spaces in splitting a record" }, + { "stripstrspc", HAWK_STRIPSTRSPC, "strip spaces in string-to-number conversion" }, + { "blankconcat", HAWK_BLANKCONCAT, "enable concatenation by blanks" }, + { "crlf", HAWK_CRLF, "use CRLF for a newline" }, + { "flexmap", HAWK_FLEXMAP, "allow a map to be assigned or returned" }, + { "pablock", HAWK_PABLOCK, "enable pattern-action loop" }, + { "rexbound", HAWK_REXBOUND, "enable {n,m} in a regular expression" }, + { "ncmponstr", HAWK_NCMPONSTR, "perform numeric comparsion on numeric strings" }, + { "strictnaming", HAWK_STRICTNAMING, "enable the strict naming rule" }, + { "tolerant", HAWK_TOLERANT, "make more fault-tolerant" }, + { HAWK_NULL, 0, HAWK_NULL } +}; + +static void print_usage (FILE* out, const hawk_bch_t* argv0) +{ + int j; + const hawk_bch_t* b = hawk_get_base_name_bcstr(argv0); + + fprintf (out, "USAGE: %s [options] -f sourcefile [ -- ] [datafile]*\n", b); + fprintf (out, " %s [options] [ -- ] sourcestring [datafile]*\n", b); + fprintf (out, "Where options are:\n"); + fprintf (out, " -h/--help print this message\n"); + fprintf (out, " --version print version\n"); + fprintf (out, " -D show extra information\n"); + fprintf (out, " -c/--call name call a function instead of entering\n"); + fprintf (out, " the pattern-action loop. [datafile]* is\n"); + fprintf (out, " passed to the function as parameters\n"); + fprintf (out, " -f/--file sourcefile set the source script file\n"); + fprintf (out, " -d/--deparsed-file deparsedfile set the deparsing output file\n"); + fprintf (out, " -F/--field-separator string set a field separator(FS)\n"); + fprintf (out, " -v/--assign var=value add a global variable with a value\n"); + fprintf (out, " -m/--memory-limit number limit the memory usage (bytes)\n"); + fprintf (out, " -w expand datafile wildcards\n"); + +#if defined(HAWK_BUILD_DEBUG) + fprintf (out, " -X number fail the number'th memory allocation\n"); +#endif +#if defined(HAWK_OOCH_IS_UCH) + fprintf (out, " --script-encoding string specify script file encoding name\n"); + fprintf (out, " --console-encoding string specify console encoding name\n"); +#endif + fprintf (out, " --modern run in the modern mode(default)\n"); + fprintf (out, " --classic run in the classic mode\n"); + + for (j = 0; opttab[j].name; j++) + { + fprintf (out, " --%-18s on/off %s\n", opttab[j].name, opttab[j].desc); + } +} + +/* ---------------------------------------------------------------------- */ +static int collect_into_xarg (const hawk_bcs_t* path, void* ctx) +{ + xarg_t* xarg = (xarg_t*)ctx; + + if (xarg->size <= xarg->capa) + { + hawk_bch_t** tmp; + + tmp = (hawk_bch_t**)realloc(xarg->ptr, HAWK_SIZEOF(*tmp) * (xarg->capa + 128 + 1)); + if (tmp == HAWK_NULL) return -1; + + xarg->ptr = tmp; + xarg->capa += 128; + } + + xarg->ptr[xarg->size] = strdup(path->ptr); + if (xarg->ptr[xarg->size] == HAWK_NULL) return -1; + xarg->size++; + + return 0; +} + +static void purge_xarg (xarg_t* xarg) +{ + if (xarg->ptr) + { + hawk_oow_t i; + + for (i = 0; i < xarg->size; i++) free (xarg->ptr[i]); + free (xarg->ptr); + + xarg->size = 0; + xarg->capa = 0; + xarg->ptr = HAWK_NULL; + } +} + +static int expand_wildcard (int argc, hawk_bch_t* argv[], int glob, xarg_t* xarg) +{ + int i; + hawk_bcs_t tmp; + + for (i = 0; i < argc; i++) + { + int x; + +#if 0 +// TOOD: revive this part + if (glob) + { + #if defined(_WIN32) || defined(__OS2__) || defined(__DOS__) + int glob_flags = HAWK_GLOB_TOLERANT | HAWK_GLOB_PERIOD | HAWK_GLOB_NOESCAPE | HAWK_GLOB_IGNORECASE; + #else + int glob_flags = HAWK_GLOB_TOLERANT | HAWK_GLOB_PERIOD; + #endif + + x = hawk_glob(argv[i], collect_into_xarg, xarg, glob_flags, xarg->mmgr, hawk_getdflcmgr()); + if (x <= -1) return -1; + } + else x = 0; +#else + x = 0; +#endif + + if (x == 0) + { + /* not expanded. just use it as is */ + tmp.ptr = argv[i]; + tmp.len = hawk_count_bcstr(argv[i]); + if (collect_into_xarg(&tmp, xarg) <= -1) return -1; + } + } + + xarg->ptr[xarg->size] = HAWK_NULL; + return 0; +} + +/* ---------------------------------------------------------------------- */ + +static int process_argv (int argc, hawk_bch_t* argv[], struct arg_t* arg) +{ + static hawk_bcli_lng_t lng[] = + { + { ":implicit", '\0' }, + { ":nextofile", '\0' }, + { ":rio", '\0' }, + { ":rwpipe", '\0' }, + { ":newline", '\0' }, + { ":striprecspc", '\0' }, + { ":stripstrspc", '\0' }, + { ":blankconcat", '\0' }, + { ":crlf", '\0' }, + { ":flexmap", '\0' }, + { ":pablock", '\0' }, + { ":rexbound", '\0' }, + { ":ncmponstr", '\0' }, + { ":strictnaming", '\0' }, + { ":tolerant", '\0' }, + + { ":call", 'c' }, + { ":file", 'f' }, + { ":deparsed-file", 'd' }, + { ":field-separator", 'F' }, + { ":assign", 'v' }, + { ":memory-limit", 'm' }, + + { ":script-encoding", '\0' }, + { ":console-encoding", '\0' }, + + { "modern", '\0' }, + { "classic", '\0' }, + + { "version", '\0' }, + { "help", 'h' }, + { HAWK_NULL, '\0' } + }; + + static hawk_bcli_t opt = + { +#if defined(HAWK_BUILD_DEBUG) + "hDc:f:d:F:v:m:wX:", +#else + "hDc:f:d:F:v:m:w", +#endif + lng + }; + + hawk_bci_t c; + + hawk_oow_t i; + hawk_oow_t isfc = 16; /* the capacity of isf */ + hawk_oow_t isfl = 0; /* number of input source files */ + hawk_parsestd_t* isf = HAWK_NULL; /* input source files */ + + int oops_ret = -1; + int do_glob = 0; + + HAWK_MEMSET (arg, 0, HAWK_SIZEOF(*arg)); + + isf = (hawk_parsestd_t*)malloc(HAWK_SIZEOF(*isf) * isfc); + if (!isf) + { + print_error ("out of memory\n"); + goto oops; + } + + while ((c = hawk_get_bcli(argc, argv, &opt)) != HAWK_BCI_EOF) + { + switch (c) + { + case 'h': + oops_ret = 0; + goto oops; + + case 'D': + app_debug = 1; + break; + + case 'c': + arg->call = opt.arg; /* function name to call */ + break; + + case 'f': + { + if (isfl >= isfc - 1) /* -1 for last HAWK_NULL */ + { + hawk_parsestd_t* tmp; + tmp = (hawk_parsestd_t*)realloc(isf, HAWK_SIZEOF(*isf) * (isfc + 16)); + if (tmp == HAWK_NULL) + { + print_error ("out of memory\n"); + goto oops; + } + + isf = tmp; + isfc = isfc + 16; + } + + isf[isfl].type = HAWK_PARSESTD_FILEB; + isf[isfl].u.fileb.path = opt.arg; + isf[isfl].u.fileb.cmgr = HAWK_NULL; + isfl++; + break; + } + + case 'd': + { + arg->osf = opt.arg; /* output source file */ + break; + } + + case 'F': + { + arg->fs = opt.arg; /* field seperator */ + break; + } + + case 'v': + { + hawk_bch_t* eq; + + eq = hawk_find_bchar_in_bcstr(opt.arg, HAWK_T('=')); + if (eq == HAWK_NULL) + { + if (opt.lngopt) + print_error ("no value for '%s' in '%s'\n", opt.arg, opt.lngopt); + else + print_error ("no value for '%s' in '%c'\n", opt.arg, opt.opt); + goto oops; + } + + *eq = '\0'; + + if (arg->gvm.size <= arg->gvm.capa) + { + gv_t* tmp; + hawk_oow_t newcapa; + + newcapa = arg->gvm.capa + argc; + tmp = realloc(arg->gvm.ptr, HAWK_SIZEOF(*tmp) * newcapa); + if (!tmp) + { + print_error ("out of memory\n"); + goto oops; + } + + arg->gvm.capa = newcapa; + arg->gvm.ptr = tmp; + } + + arg->gvm.ptr[arg->gvm.size].idx = -1; + arg->gvm.ptr[arg->gvm.size].uc = 0; + arg->gvm.ptr[arg->gvm.size].name = opt.arg; + arg->gvm.ptr[arg->gvm.size].value.ptr = ++eq; + arg->gvm.ptr[arg->gvm.size].value.len = hawk_count_bcstr(eq); + arg->gvm.size++; + break; + } + + case 'm': + { + arg->memlimit = strtoul(opt.arg, HAWK_NULL, 10); + break; + } + + case 'w': + { + do_glob = 1; + break; + } + +#if defined(HAWK_BUILD_DEBUG) + case 'X': + { + arg->failmalloc = strtoul(opt.arg, HAWK_NULL, 10); + break; + } +#endif + + case '\0': + { + /* a long option with no corresponding short option */ + hawk_oow_t i; + + if (hawk_comp_bcstr(opt.lngopt, "version", 0) == 0) + { + print_version (argv[0]); + oops_ret = 2; + goto oops; + } + else if (hawk_comp_bcstr(opt.lngopt, "script-encoding", 0) == 0) + { + arg->script_cmgr = hawk_get_cmgr_by_bcstr(opt.arg); + if (arg->script_cmgr == HAWK_NULL) + { + print_error ("unknown script encoding - %s\n", opt.arg); + oops_ret = 3; + goto oops; + } + } + else if (hawk_comp_bcstr(opt.lngopt, "console-encoding", 0) == 0) + { + arg->console_cmgr = hawk_get_cmgr_by_bcstr(opt.arg); + if (arg->console_cmgr == HAWK_NULL) + { + print_error ("unknown console encoding - %s\n", opt.arg); + oops_ret = 3; + goto oops; + } + } + else if (hawk_comp_bcstr(opt.lngopt, "modern", 0) == 0) + { + arg->modern = 1; + } + else if (hawk_comp_bcstr(opt.lngopt, "classic", 0) == 0) + { + arg->classic = 1; + } + else + { + for (i = 0; opttab[i].name; i++) + { + if (hawk_comp_bcstr(opt.lngopt, opttab[i].name, 0) == 0) + { + if (hawk_comp_bcstr(opt.arg, "off", 1) == 0) + arg->optoff |= opttab[i].opt; + else if (hawk_comp_bcstr(opt.arg, "on", 1) == 0) + arg->opton |= opttab[i].opt; + else + { + print_error ("invalid value '%s' for '%s' - use 'on' or 'off'\n", opt.arg, opt.lngopt); + oops_ret = 3; + goto oops; + } + break; + } + } + + } + break; + } + + case '?': + { + if (opt.lngopt) + print_error ("illegal option - '%s'\n", opt.lngopt); + else + print_error ("illegal option - '%c'\n", opt.opt); + + goto oops; + } + + case ':': + { + if (opt.lngopt) + print_error ("bad argument for '%s'\n", opt.lngopt); + else + print_error ("bad argument for '%c'\n", opt.opt); + + goto oops; + } + + default: + goto oops; + } + } + + if (isfl <= 0) + { + /* no -f specified */ + if (opt.ind >= argc) + { + /* no source code specified */ + goto oops; + } + + /* the source code is the string, not from the file */ + isf[isfl].type = HAWK_PARSESTD_BCS; + isf[isfl].u.bcs.ptr = argv[opt.ind++]; + isf[isfl].u.bcs.len = hawk_count_bcstr(isf[isfl].u.bcs.ptr); + + isfl++; + } + + for (i = 0; i < isfl ; i++) + { + if (isf[i].type == HAWK_PARSESTD_FILE) isf[i].u.file.cmgr = arg->script_cmgr; + } + + isf[isfl].type = HAWK_PARSESTD_NULL; + arg->psin = isf; + + if (opt.ind < argc) + { + /* the remaining arguments are input console file names */ + if (expand_wildcard(argc - opt.ind, &argv[opt.ind], do_glob, &arg->icf) <= -1) + { + print_error ("failed to expand wildcard\n"); + goto oops; + } + } + + return 1; + +oops: + if (arg->gvm.ptr) free (arg->gvm.ptr); + purge_xarg (&arg->icf); + if (isf) + { + if (arg->incl_conv) free (isf[0].u.bcs.ptr); + free (isf); + } + return oops_ret; +} + +static void freearg (struct arg_t* arg) +{ + if (arg->psin) + { + if (arg->incl_conv) free (arg->psin[0].u.bcs.ptr); + free (arg->psin); + } + + /*if (arg->osf != HAWK_NULL) free (arg->osf);*/ + purge_xarg (&arg->icf); + if (arg->gvm.ptr) free (arg->gvm.ptr); +} + +static void print_hawk_error (hawk_t* awk) +{ + const hawk_loc_t* loc = hawk_geterrloc(awk); + +/* TODO: proper logging mask */ +printf ("print_hawk_error... TODO: \n"); +/* hawk_logfmt (awk, 0, + HAWK_T("ERROR: CODE %d LINE %zu COLUMN %zu %s%s%s- %s\n"), + hawk_geterrnum(awk), + (hawk_oow_t)loc->line, + (hawk_oow_t)loc->colm, + ((loc->file == HAWK_NULL)? HAWK_T(""): HAWK_T("FILE ")), + ((loc->file == HAWK_NULL)? HAWK_T(""): loc->file), + ((loc->file == HAWK_NULL)? HAWK_T(""): HAWK_T(" ")), + hawk_geterrmsg(awk) + );*/ +} + +static void print_hawk_rtx_error (hawk_rtx_t* rtx) +{ + const hawk_loc_t* loc = hawk_rtx_geterrloc (rtx); + +/* TODO: proper logging mask */ +printf ("print_hawk_rtx_error... TODO: \n"); +/* + hawk_logfmt (hawk_rtx_getawk(rtx), 0, + HAWK_T("ERROR: CODE %d LINE %zu COLUMN %zu %s%s%s- %s\n"), + hawk_rtx_geterrnum(rtx), + (hawk_oow_t)loc->line, + (hawk_oow_t)loc->colm, + ((loc->file == HAWK_NULL)? HAWK_T(""): HAWK_T("FILE ")), + ((loc->file == HAWK_NULL)? HAWK_T(""): loc->file), + ((loc->file == HAWK_NULL)? HAWK_T(""): HAWK_T(" ")), + hawk_rtx_geterrmsg(rtx) + );*/ +} + +hawk_htb_walk_t add_global (hawk_htb_t* map, hawk_htb_pair_t* pair, void* arg) +{ + hawk_t* awk = (hawk_t*)arg; + struct gv_t* gvmv = (struct gv_t*)HAWK_HTB_VPTR(pair); + + /* the key was inserted to the table with a null at the end + * and the key length was even incremetned for that. + * so i can pass the pointer without other adjustments. */ + gvmv->idx = hawk_addgbl(awk, HAWK_HTB_KPTR(pair)); + if (gvmv->idx <= -1) return HAWK_HTB_WALK_STOP; + return HAWK_HTB_WALK_FORWARD; +} + + +#if 0 +static void* xma_alloc (hawk_mmgr_t* mmgr, hawk_oow_t size) +{ + return hawk_xma_alloc (mmgr->ctx, size); +} + +static void* xma_realloc (hawk_mmgr_t* mmgr, void* ptr, hawk_oow_t size) +{ + return hawk_xma_realloc (mmgr->ctx, ptr, size); +} + +static void xma_free (hawk_mmgr_t* mmgr, void* ptr) +{ + hawk_xma_free (mmgr->ctx, ptr); +} + +static hawk_mmgr_t xma_mmgr = +{ + xma_alloc, + xma_realloc, + xma_free, + HAWK_NULL +}; + + +#if defined(HAWK_BUILD_DEBUG) +static hawk_uintptr_t debug_mmgr_count = 0; +static hawk_uintptr_t debug_mmgr_alloc_count = 0; +static hawk_uintptr_t debug_mmgr_realloc_count = 0; +static hawk_uintptr_t debug_mmgr_free_count = 0; + +static void* debug_mmgr_alloc (hawk_mmgr_t* mmgr, hawk_oow_t size) +{ + void* ptr; + struct arg_t* arg = (struct arg_t*)mmgr->ctx; + debug_mmgr_count++; + if (debug_mmgr_count % arg->failmalloc == 0) return HAWK_NULL; + ptr = malloc (size); + if (ptr) debug_mmgr_alloc_count++; + return ptr; +} + +static void* debug_mmgr_realloc (hawk_mmgr_t* mmgr, void* ptr, hawk_oow_t size) +{ + void* rptr; + struct arg_t* arg = (struct arg_t*)mmgr->ctx; + debug_mmgr_count++; + if (debug_mmgr_count % arg->failmalloc == 0) return HAWK_NULL; + rptr = realloc (ptr, size); + if (rptr) + { + if (ptr) debug_mmgr_realloc_count++; + else debug_mmgr_alloc_count++; + } + return rptr; +} + +static void debug_mmgr_free (hawk_mmgr_t* mmgr, void* ptr) +{ + debug_mmgr_free_count++; + free (ptr); +} + +static hawk_mmgr_t debug_mmgr = +{ + debug_mmgr_alloc, + debug_mmgr_realloc, + debug_mmgr_free, + HAWK_NULL +}; +#endif + +#endif + +static HAWK_INLINE int execute_hawk (int argc, hawk_bch_t* argv[]) +{ + hawk_t* awk = HAWK_NULL; + hawk_rtx_t* rtx = HAWK_NULL; + hawk_val_t* retv; + int i; + struct arg_t arg; + int ret = -1; + +#if defined(ENABLE_CALLBACK) + static hawk_rtx_ecb_t rtx_ecb = + { + HAWK_FV(.close, HAWK_NULL), + HAWK_FV(.stmt, on_statement), + HAWK_FV(.gblset, HAWK_NULL) + }; +#endif + + /* TODO: change it to support multiple source files */ + hawk_parsestd_t psout; +#if 0 + hawk_mmgr_t* mmgr = HAWK_MMGR_GETDFL(); +#endif + + i = process_argv(argc, argv, &arg); + if (i <= 0) + { + print_usage (((i == 0)? stdout: stderr), argv[0]); + return i; + } + if (i == 2) return 0; + if (i == 3) return -1; + + if (arg.osf) + { + psout.type = HAWK_PARSESTD_FILEB; + psout.u.fileb.path = arg.osf; + psout.u.fileb.cmgr = arg.script_cmgr; + } + +#if 0 +#if defined(HAWK_BUILD_DEBUG) + if (arg.failmalloc > 0) + { + debug_mmgr.ctx = &arg; + mmgr = &debug_mmgr; + } + else +#endif + if (arg.memlimit > 0) + { + xma_mmgr.ctx = hawk_xma_open(HAWK_MMGR_GETDFL(), 0, arg.memlimit); + if (xma_mmgr.ctx == HAWK_NULL) + { + hawk_printf (HAWK_T("ERROR: cannot open memory heap\n")); + goto oops; + } + mmgr = &xma_mmgr; + } +#endif + + awk = hawk_openstd(0, HAWK_NULL); + if (awk == HAWK_NULL) + { + print_error ("cannot open awk\n"); + goto oops; + } + + if (arg.modern) i = HAWK_MODERN; + else if (arg.classic) i = HAWK_CLASSIC; + else hawk_getopt (awk, HAWK_TRAIT, &i); + if (arg.opton) i |= arg.opton; + if (arg.optoff) i &= ~arg.optoff; + hawk_setopt (awk, HAWK_TRAIT, &i); + + /* TODO: get depth from command line */ + { + hawk_oow_t tmp; + tmp = 50; + hawk_setopt (awk, HAWK_DEPTH_BLOCK_PARSE, &tmp); + hawk_setopt (awk, HAWK_DEPTH_EXPR_PARSE, &tmp); + tmp = 500; + hawk_setopt (awk, HAWK_DEPTH_BLOCK_RUN, &tmp); + hawk_setopt (awk, HAWK_DEPTH_EXPR_RUN, &tmp); + tmp = 64; + hawk_setopt (awk, HAWK_DEPTH_INCLUDE, &tmp); + } + + if (add_gvs_to_awk(awk, &arg) <= -1) + { + print_hawk_error (awk); + goto oops; + } + + if (hawk_parsestd(awk, arg.psin, ((arg.osf == HAWK_NULL)? HAWK_NULL: &psout)) <= -1) + { + print_hawk_error (awk); + goto oops; + } + + rtx = hawk_rtx_openstd ( + awk, 0, HAWK_T("hawk"), + (arg.call? HAWK_NULL: (const hawk_ooch_t**)arg.icf.ptr), /* console input */ + HAWK_NULL, /* console output */ + arg.console_cmgr + ); + if (rtx == HAWK_NULL) + { + print_hawk_error (awk); + goto oops; + } + + if (apply_fs_and_gvs_to_rtx(rtx, &arg) <= -1) + { + print_hawk_error (awk); + goto oops; + } + + app_rtx = rtx; +#if defined(ENABLE_CALLBACK) + hawk_rtx_pushecb (rtx, &rtx_ecb); +#endif + + set_intr_run (); + + retv = arg.call? + hawk_rtx_callwithbcstrarr(rtx, arg.call, (const hawk_bch_t**)arg.icf.ptr, arg.icf.size): + hawk_rtx_loop(rtx); + + unset_intr_run (); + + if (retv) + { + hawk_int_t tmp; + + hawk_rtx_refdownval (rtx, retv); + if (app_debug) dprint_return (rtx, retv); + + ret = 0; + if (hawk_rtx_valtoint (rtx, retv, &tmp) >= 0) ret = tmp; + } + else + { + print_hawk_rtx_error (rtx); + goto oops; + } + +oops: + if (rtx) hawk_rtx_close (rtx); + if (awk) hawk_close (awk); + +#if 0 + if (xma_mmgr.ctx) hawk_xma_close (xma_mmgr.ctx); +#endif + freearg (&arg); + +#if defined(HAWK_BUILD_DEBUG) + if (arg.failmalloc > 0) + { + hawk_fprintf (HAWK_STDERR, HAWK_T("\n")); + hawk_fprintf (HAWK_STDERR, HAWK_T("-[MALLOC COUNTS]---------------------------------------\n")); + hawk_fprintf (HAWK_STDERR, HAWK_T("ALLOC: %lu FREE: %lu: REALLOC: %lu\n"), + (unsigned long)debug_mmgr_alloc_count, + (unsigned long)debug_mmgr_free_count, + (unsigned long)debug_mmgr_realloc_count); + hawk_fprintf (HAWK_STDERR, HAWK_T("-------------------------------------------------------\n")); + } +#endif + + return ret; +} + +/* ---------------------------------------------------------------------- */ + +int main (int argc, hawk_bch_t* argv[]) +{ + int ret; + +#if defined(_WIN32) + char locale[100]; + UINT codepage; + WSADATA wsadata; +#elif defined(__DOS__) + extern BOOL _watt_do_exit; + int sock_inited = 0; +#else + /* nothing special */ +#endif + +#if defined(_WIN32) + codepage = GetConsoleOutputCP(); + if (codepage == CP_UTF8) + { + /*SetConsoleOUtputCP (CP_UTF8);*/ + hawk_setdflcmgrbyid (HAWK_CMGR_UTF8); + } + else + { + /* .codepage */ + hawk_fmt_uintmax_to_bcstr (locale, HAWK_COUNTOF(locale), codepage, 10, -1, HAWK_MT('\0'), HAWK_MT(".")); + setlocale (LC_ALL, locale); + /* hawk_setdflcmgrbyid (HAWK_CMGR_SLMB); */ + } + +#else + setlocale (LC_ALL, ""); + /* hawk_setdflcmgrbyid (HAWK_CMGR_SLMB); */ +#endif + +#if defined(_WIN32) + if (WSAStartup (MAKEWORD(2,0), &wsadata) != 0) + { + print_error (HAWK_T("Failed to start up winsock\n")); + ret = -1; + goto oops; + } +#elif defined(__DOS__) +/* TODO: add an option to skip watt-32 */ + _watt_do_exit = 0; /* prevent sock_init from exiting upon failure */ + if (sock_init() != 0) + print_warning (HAWK_T("Failed to initialize watt-32\n")); + else sock_inited = 1; +#endif + + ret = execute_hawk(argc, argv); + + +#if defined(_WIN32) + WSACleanup (); +#elif defined(__DOS__) + if (sock_inited) sock_exit (); +#endif + +oops: + return ret; +} + + +#if defined(FAKE_SOCKET) +socket () {} +listen () {} +accept () {} +recvfrom () {} +connect () {} +getsockopt () {} +recv () {} +setsockopt () {} +send () {} +bind () {} +shutdown () {} + +void* memmove (void* x, void* y, size_t z) {} +#endif diff --git a/hawk/configure b/hawk/configure new file mode 100755 index 00000000..b40c3c2f --- /dev/null +++ b/hawk/configure @@ -0,0 +1,25256 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for hawk 0.9.0. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and Chung, Hyung-Hwan +$0: (hyunghwan.chung@gmail.com) about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='hawk' +PACKAGE_TARNAME='hawk' +PACKAGE_VERSION='0.9.0' +PACKAGE_STRING='hawk 0.9.0' +PACKAGE_BUGREPORT='Chung, Hyung-Hwan (hyunghwan.chung@gmail.com)' +PACKAGE_URL='https://code.miflux.net/@hawk' + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +HAWK_PROJECT_URL +HAWK_PROJECT_AUTHOR +HAWK_SIZEOF_OFF64_T +HAWK_SIZEOF_OFF_T +HAWK_SIZEOF_LONG_DOUBLE +HAWK_SIZEOF_DOUBLE +HAWK_SIZEOF_FLOAT +HAWK_SIZEOF_VOID_P +HAWK_SIZEOF_CHAR +HAWK_SIZEOF_SHORT +HAWK_SIZEOF_INT +HAWK_SIZEOF_LONG +HAWK_SIZEOF_LONG_LONG +HAWK_SIZEOF_WCHAR_T +ENABLE_MOD_UCI_FALSE +ENABLE_MOD_UCI_TRUE +ENABLE_MOD_MYSQL_FALSE +ENABLE_MOD_MYSQL_TRUE +ENABLE_LIBUNWIND_FALSE +ENABLE_LIBUNWIND_TRUE +ENABLE_LIBLTDL_FALSE +ENABLE_LIBLTDL_TRUE +ENABLE_STATIC_MODULE_FALSE +ENABLE_STATIC_MODULE_TRUE +ENABLE_DYNAMIC_MODULE_FALSE +ENABLE_DYNAMIC_MODULE_TRUE +ENABLE_CXX_FALSE +ENABLE_CXX_TRUE +BUILD_MODE +ENABLE_EXPERIMENTAL_FALSE +ENABLE_EXPERIMENTAL_TRUE +PACKAGE_VERSION_PATCH +PACKAGE_VERSION_MINOR +PACKAGE_VERSION_MAJOR +QUADMATH_LIBS +UNICOWS_LIBS +SOCKET_LIBS +UNWIND_LIBS +FFI_LIBS +DYNCALL_LIBS +LTDL_LIBS +DL_LIBS +PTHREAD_CFLAGS +PTHREAD_LIBS +PTHREAD_CC +ax_pthread_config +LIBM +MACOSX_FALSE +MACOSX_TRUE +WIN32_FALSE +WIN32_TRUE +LIBTOOL_DEPS +CXXCPP +CPP +LT_SYS_LIBRARY_PATH +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +DLLTOOL +OBJDUMP +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +LIBTOOL +SED +LN_S +EGREP +GREP +HAVE_CXX +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +ac_ct_CXX +CXXFLAGS +CXX +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +ac_ct_AR +AR +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL +am__quote' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +enable_shared +enable_static +with_pic +enable_fast_install +with_aix_soname +with_gnu_ld +with_sysroot +enable_libtool_lock +enable_largefile +enable_experimental +enable_debug +enable_unicode +enable_full_liw +enable_intmax +enable_fltmax +enable_cxx +enable_dynamic_module +enable_static_module +enable_libltdl +enable_libunwind +enable_mod_mysql +enable_mod_uci +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CXX +CXXFLAGS +CCC +LT_SYS_LIBRARY_PATH +CPP +CXXCPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures hawk 0.9.0 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/hawk] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of hawk 0.9.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --disable-largefile omit support for large files + --enable-experimental enable experimental feature(default. no) + --enable-debug compile the code in the debug mode (default. no) + --enable-unicode Use the unicode character type as the default + character type. one of yes, no, yes:2, yes:4, no:2, + no:4 (default. yes) + --enable-full-liw Use a full word as a large integer word (default. + no) + --enable-intmax use hawk_intmax_t for integers (default. no) + --enable-awk-fltmax use hawk_fltmax_t for floating-point numbers + (default. no) + --enable-cxx build the library for C++ if a C++ compiler is + available (default. yes) + --enable-dynamic-module enable dynamic module capability(default. yes) + --enable-static-module build modules statically into the main + library(default. no) + --enable-libltdl use libltdl(default. no) + --enable-libunwind use libunwind(default. no) + --enable-mod-mysql enable mod/mysql (default. yes) + --enable-mod-uci enable mod/uci (default. yes) + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, [default=aix]. + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot[=DIR] Search for dependent libraries within DIR (or the + compiler's sysroot if not specified). + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags + LT_SYS_LIBRARY_PATH + User-defined run-time library search path. + CPP C preprocessor + CXXCPP C++ preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +hawk home page: . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +hawk configure 0.9.0 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_cpp + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## HHHHHHHHHHHHHHHHHHHH ## +## Report this to Chung ## +## HHHHHHHHHHHHHHHHHHHH ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES +# ---------------------------------------------------- +# Tries to find if the field MEMBER exists in type AGGR, after including +# INCLUDES, setting cache variable VAR accordingly. +ac_fn_c_check_member () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +$as_echo_n "checking for $2.$3... " >&6; } +if eval \${$4+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + eval "$4=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$4 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_member + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by hawk $as_me 0.9.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +ac_config_headers="$ac_config_headers lib/hawk-cfg.h" + +ac_aux_dir= +for ac_dir in ac "$srcdir"/ac; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in ac \"$srcdir\"/ac" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +am__api_version='1.16' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='hawk' + VERSION='0.9.0' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +$as_echo "${_am_result}" >&6; } + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar lib "link -lib" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar lib "link -lib" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 +$as_echo_n "checking the archiver ($AR) interface... " >&6; } +if ${am_cv_ar_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + am_cv_ar_interface=ar + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int some_variable = 0; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 + (eval $am_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=ar + else + am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 + (eval $am_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=lib + else + am_cv_ar_interface=unknown + fi + fi + rm -f conftest.lib libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 +$as_echo "$am_cv_ar_interface" >&6; } + +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR="$am_aux_dir/ar-lib $AR" + ;; +unknown) + as_fn_error $? "could not determine $AR interface" "$LINENO" 5 + ;; +esac + + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + + +# Extract the first word of "$CXX", so it can be a program name with args. +set dummy $CXX; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_HAVE_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$HAVE_CXX"; then + ac_cv_prog_HAVE_CXX="$HAVE_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_HAVE_CXX="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_HAVE_CXX" && ac_cv_prog_HAVE_CXX="no" +fi +fi +HAVE_CXX=$ac_cv_prog_HAVE_CXX +if test -n "$HAVE_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_CXX" >&5 +$as_echo "$HAVE_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if c++ supports namespace std" >&5 +$as_echo_n "checking if c++ supports namespace std... " >&6; } +if ${ax_cv_cxx_have_std_namespace+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + std::istream& is = std::cin; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ax_cv_cxx_have_std_namespace=yes +else + ax_cv_cxx_have_std_namespace=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_have_std_namespace" >&5 +$as_echo "$ax_cv_cxx_have_std_namespace" >&6; } + if test "$ax_cv_cxx_have_std_namespace" = yes; then + +$as_echo "#define HAVE_CXX_NAMESPACE_STD /**/" >>confdefs.h + + fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.6' +macro_revision='2.4.6' + + + + + + + + + + + + + +ltmain=$ac_aux_dir/ltmain.sh + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case $ECHO in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if ${ac_cv_path_FGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM=$NM +else + lt_nm_to_check=${ac_tool_prefix}nm + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break 2 + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break 2 + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS=$lt_save_ifs + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols -headers" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test : != "$DUMPBIN"; then + NM=$DUMPBIN + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring=ABCD + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test 17 != "$i" # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n "$lt_cv_sys_max_cmd_len"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test yes != "$GCC"; then + reload_cmds=false + fi + ;; + darwin*) + if test yes = "$GCC"; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if ${lt_cv_deplibs_check_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# 'unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd=$ECHO + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -eq "$ac_status"; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -ne "$ac_status"; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test no = "$lt_cv_ar_at_file"; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + bitrig* | openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if ${lt_cv_sys_global_symbol_pipe+:} false; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test ia64 = "$host_cpu"; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS=conftstm.$ac_objext + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test yes = "$pipe_works"; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case $with_sysroot in #( + yes) + if test yes = "$GCC"; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +$as_echo "$with_sysroot" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +$as_echo_n "checking for a working dd... " >&6; } +if ${ac_cv_path_lt_DD+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +if test -z "$lt_DD"; then + ac_path_lt_DD_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in dd; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_lt_DD" || continue +if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi + $ac_path_lt_DD_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_lt_DD"; then + : + fi +else + ac_cv_path_lt_DD=$lt_DD +fi + +rm -f conftest.i conftest2.i conftest.out +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +$as_echo "$ac_cv_path_lt_DD" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +$as_echo_n "checking how to truncate binary pipes... " >&6; } +if ${lt_cv_truncate_bin+:} false; then : + $as_echo_n "(cached) " >&6 +else + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +$as_echo "$lt_cv_truncate_bin" >&6; } + + + + + + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test no = "$enable_libtool_lock" || enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE=32 + ;; + *ELF-64*) + HPUX_IA64_MODE=64 + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test yes = "$lt_cv_prog_gnu_ld"; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if ${lt_cv_cc_needs_belf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test yes != "$lt_cv_cc_needs_belf"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS=$SAVE_CFLAGS + fi + ;; +*-*solaris*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*|x86_64-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD=${LD-ld}_sol2 + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks=$enable_libtool_lock + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test yes != "$lt_cv_path_mainfest_tool"; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "$LT_MULTI_MODULE"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[012][,.]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test yes = "$lt_cv_apple_cc_single_mod"; then + _lt_dar_single_mod='$single_module' + fi + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' + fi + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + +func_stripname_cnf () +{ + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; + esac +} # func_stripname_cnf + + + + + +# Set options + + + + enable_dlopen=no + + + enable_win32_dll=no + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + pic_mode=default +fi + + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[5-9]*,yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +$as_echo_n "checking which variant of shared library versioning to provide... " >&6; } + +# Check whether --with-aix-soname was given. +if test "${with_aix_soname+set}" = set; then : + withval=$with_aix_soname; case $withval in + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname +else + if ${lt_cv_with_aix_soname+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_with_aix_soname=aix +fi + + with_aix_soname=$lt_cv_with_aix_soname +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +$as_echo "$with_aix_soname" >&6; } + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS=$ltmain + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld=$lt_cv_prog_gnu_ld + +old_CC=$CC +old_CFLAGS=$CFLAGS + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +func_cc_basename $compiler +cc_basename=$func_cc_basename_result + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/${ac_tool_prefix}file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC=$CC +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test yes = "$GCC"; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test yes = "$GCC"; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + lt_prog_compiler_pic='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='$wl-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64, which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if ${lt_cv_prog_compiler_pic_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_pic_works"; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works"; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test no = "$hard_links"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test yes != "$GCC"; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd* | bitrig*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test yes = "$with_gnu_ld"; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test yes = "$lt_use_gnu_ld_interface"; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='$wl' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + export_dynamic_flag_spec='$wl--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test ia64 != "$host_cpu"; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='$wl--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test linux-dietlibc = "$host_os"; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test no = "$tmp_diet" + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + tcc*) + export_dynamic_flag_spec='-rdynamic' + ;; + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test no = "$ld_shlibs"; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + aix_use_runtimelinking=yes + break + fi + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct=no + hardcode_direct_absolute=no + ;; + esac + + if test yes = "$GCC"; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + export_dynamic_flag_spec='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' $wl-bernotok' + allow_undefined_flag=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test yes = "$GCC"; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='$wl-E' + ;; + + hpux10*) + if test yes,no = "$GCC,$with_gnu_ld"; then + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='$wl-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test yes,no = "$GCC,$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test yes = "$lt_cv_prog_compiler__b"; then + archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='$wl-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test yes = "$GCC"; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test yes = "$lt_cv_irix_exported_symbol"; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + ld_shlibs=yes + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' + else + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + ;; + + osf3*) + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test yes = "$GCC"; then + wlarc='$wl' + archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='$wl' + archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. GCC discards it without '$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test yes = "$GCC"; then + whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test sequent = "$host_vendor"; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='$wl-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='$wl-z,text' + allow_undefined_flag='$wl-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='$wl-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test sni = "$host_vendor"; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='$wl-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test no = "$ld_shlibs" && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test yes = "$GCC"; then + case $host_os in + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary... + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo = "/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's|/\([A-Za-z]:\)|\1|g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + + + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test yes = "$hardcode_automatic"; then + + # We can hardcode non-existent directories. + if test no != "$hardcode_direct" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && + test no != "$hardcode_minus_L"; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test relink = "$hardcode_action" || + test yes = "$inherit_rpath"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test yes != "$enable_dlopen"; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen=load_add_on + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen=LoadLibrary + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else + + lt_cv_dlopen=dyld + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen=shl_load +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen=dlopen +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test no = "$lt_cv_dlopen"; then + enable_dlopen=no + else + enable_dlopen=yes + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS=$LDFLAGS + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS=$LIBS + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test yes = "$lt_cv_dlopen_self"; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP"; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report what library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC=$lt_save_CC + + if test -n "$CXX" && ( test no != "$CXX" && + ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || + (test g++ != "$CXX"))); then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if ${ac_cv_prog_CXXCPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +else + _lt_caught_CXX_error=yes +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +compiler_needs_object_CXX=no +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_direct_absolute_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +inherit_rpath_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +reload_flag_CXX=$reload_flag +reload_cmds_CXX=$reload_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_caught_CXX_error"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + + # save warnings/boilerplate of simple test code + ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + + ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + compiler_CXX=$CC + func_cc_basename $compiler +cc_basename=$func_cc_basename_result + + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test yes = "$GXX"; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' + else + lt_prog_compiler_no_builtin_flag_CXX= + fi + + if test yes = "$GXX"; then + # Set up default GNU C++ configuration + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test yes = "$with_gnu_ld"; then + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='$wl' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + ld_shlibs_CXX=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix[4-9]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + file_list_spec_CXX='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct_CXX=no + hardcode_direct_absolute_CXX=no + ;; + esac + + if test yes = "$GXX"; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag=$shared_flag' $wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + export_dynamic_flag_spec_CXX='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + always_export_symbols_CXX=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + # The "-G" linker flag allows undefined symbols. + no_undefined_flag_CXX='-bernotok' + # Determine the default libpath from the value encoded in an empty + # executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' $wl-bernotok' + allow_undefined_flag_CXX=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + fi + archive_cmds_need_lc_CXX=yes + archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared + # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_CXX=' ' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=yes + file_list_spec_CXX='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' + enable_shared_with_static_runtimes_CXX=yes + # Don't use ranlib + old_postinstall_cmds_CXX='chmod 644 $oldlib' + postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + export_dynamic_flag_spec_CXX='$wl--export-all-symbols' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + + + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec_CXX='' + fi + link_all_deplibs_CXX=yes + allow_undefined_flag_CXX=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + if test yes != "$lt_cv_apple_cc_single_mod"; then + archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" + archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + fi + + else + ld_shlibs_CXX=no + fi + + ;; + + os2*) + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_minus_L_CXX=yes + allow_undefined_flag_CXX=unsupported + shrext_cmds=.dll + archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes_CXX=yes + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + ld_shlibs_CXX=no + ;; + + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + + haiku*) + archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + link_all_deplibs_CXX=yes + ;; + + hpux9*) + hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='$wl-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + export_dynamic_flag_spec_CXX='$wl-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + interix[3-9]*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + hardcode_libdir_separator_CXX=: + inherit_rpath_CXX=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [1-5].* | *pgcpp\ [1-5].*) + prelink_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + old_archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' + hardcode_libdir_flag_spec_CXX='-R$libdir' + whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object_CXX=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + ld_shlibs_CXX=yes + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + hardcode_direct_absolute_CXX=yes + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='$wl-E' + whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + ld_shlibs_CXX=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + case $host in + osf3*) + allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' + archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + ;; + *) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ + $RM $lib.exp' + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + ;; + esac + + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes,no = "$GXX,$with_gnu_ld"; then + allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' + case $host in + osf3*) + archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + *) + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test yes,no = "$GXX,$with_gnu_ld"; then + no_undefined_flag_CXX=' $wl-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require '-G' NOT '-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='$wl-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_CXX='$wl-z,text' + allow_undefined_flag_CXX='$wl-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ + '"$old_archive_cmds_CXX" + reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ + '"$reload_cmds_CXX" + ;; + *) + archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } + test no = "$ld_shlibs_CXX" && can_build_shared=no + + GCC_CXX=$GXX + LD_CXX=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + # Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF + + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $prev$p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test x-L = "$p" || + test x-R = "$p"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test no = "$pre_test_object_deps_done"; then + case $prev in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX=$prev$p + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX=$prev$p + else + postdeps_CXX="${postdeps_CXX} $prev$p" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test no = "$pre_test_object_deps_done"; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX=$p + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX=$p + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +case $host_os in +interix[3-9]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + compiler_lib_search_dirs_CXX= +if test -n "${compiler_lib_search_path_CXX}"; then + compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + + + # C++ specific cases for pic, static, wl, etc. + if test yes = "$GXX"; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + lt_prog_compiler_pic_CXX='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic_CXX='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static_CXX='$wl-static' + ;; + esac + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static_CXX= + ;; + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix[4-9]*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='$wl-a ${wl}archive' + if test ia64 != "$host_cpu"; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='$wl-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64, which still supported -KPIC. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-qpic' + lt_prog_compiler_static_CXX='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } +lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } +if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works_CXX=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } + +if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works_CXX=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works_CXX=yes + fi + else + lt_cv_prog_compiler_static_works_CXX=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then + : +else + lt_prog_compiler_static_CXX= +fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test no = "$hard_links"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + case $host_os in + aix[4-9]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX=$ltdll_cmds + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + ;; + esac + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } +test no = "$ld_shlibs_CXX" && can_build_shared=no + +with_gnu_ld_CXX=$with_gnu_ld + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc_CXX=no + else + lt_cv_archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } + archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + + + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec_CXX='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || + test -n "$runpath_var_CXX" || + test yes = "$hardcode_automatic_CXX"; then + + # We can hardcode non-existent directories. + if test no != "$hardcode_direct_CXX" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && + test no != "$hardcode_minus_L_CXX"; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 +$as_echo "$hardcode_action_CXX" >&6; } + +if test relink = "$hardcode_action_CXX" || + test yes = "$inherit_rpath_CXX"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test yes != "$_lt_caught_CXX_error" + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + + +if test "$ac_test_CFLAGS" != "set" +then + if test "$GCC" = "yes" + then + CFLAGS="$CFLAGS -Wall" + fi +fi + +if test "$ac_test_CXXFLAGS" != "set" +then + if test "$GCC" = "yes" + then + CXXFLAGS="$CXXFLAGS -Wall" + fi +fi + +CFLAGS="$CFLAGS -DHAWK_HAVE_CFG_H" +CXXFLAGS="$CXXFLAGS -DHAWK_HAVE_CFG_H" + +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then : + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } +if ${ac_cv_sys_largefile_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF + if ac_fn_c_try_compile "$LINENO"; then : + break +fi +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_largefile_CC=' -n32'; break +fi +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +$as_echo "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if ${ac_cv_sys_file_offset_bits+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=64; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } +if ${ac_cv_sys_large_files+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=1; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF +;; +esac +rm -rf conftest* + fi + + +fi + + +case "$host" in +*-*-mingw*|*-*-cygwin*) + #CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0400" + platform_win32=yes + platform_macosx=no + ;; +*-*-darwin*) + platform_win32=no + platform_macosx=yes + ;; +*) + platform_win32=no + platform_macosx=no + ;; +esac + if test "x${platform_win32}" = "xyes" ; then + WIN32_TRUE= + WIN32_FALSE='#' +else + WIN32_TRUE='#' + WIN32_FALSE= +fi + + if test "x${platform_macosx}" = "xyes" ; then + MACOSX_TRUE= + MACOSX_FALSE='#' +else + MACOSX_TRUE='#' + MACOSX_FALSE= +fi + + +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mwvalidcheckl in -lmw" >&5 +$as_echo_n "checking for _mwvalidcheckl in -lmw... " >&6; } +if ${ac_cv_lib_mw__mwvalidcheckl+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmw $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char _mwvalidcheckl (); +int +main () +{ +return _mwvalidcheckl (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_mw__mwvalidcheckl=yes +else + ac_cv_lib_mw__mwvalidcheckl=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mw__mwvalidcheckl" >&5 +$as_echo "$ac_cv_lib_mw__mwvalidcheckl" >&6; } +if test "x$ac_cv_lib_mw__mwvalidcheckl" = xyes; then : + LIBM=-lmw +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 +$as_echo_n "checking for cos in -lm... " >&6; } +if ${ac_cv_lib_m_cos+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cos (); +int +main () +{ +return cos (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_cos=yes +else + ac_cv_lib_m_cos=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5 +$as_echo "$ac_cv_lib_m_cos" >&6; } +if test "x$ac_cv_lib_m_cos" = xyes; then : + LIBM="$LIBM -lm" +fi + + ;; +*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 +$as_echo_n "checking for cos in -lm... " >&6; } +if ${ac_cv_lib_m_cos+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cos (); +int +main () +{ +return cos (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_cos=yes +else + ac_cv_lib_m_cos=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5 +$as_echo "$ac_cv_lib_m_cos" >&6; } +if test "x$ac_cv_lib_m_cos" = xyes; then : + LIBM=-lm +fi + + ;; +esac + + +LIBM=$LIBM + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ax_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on Tru64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then + ax_pthread_save_CC="$CC" + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + if test "x$PTHREAD_CC" != "x"; then : + CC="$PTHREAD_CC" +fi + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5 +$as_echo_n "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_join (); +int +main () +{ +return pthread_join (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_pthread_ok=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +$as_echo "$ax_pthread_ok" >&6; } + if test "x$ax_pthread_ok" = "xno"; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + CC="$ax_pthread_save_CC" + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 +# (Note: HP C rejects this with "bad form for `-t' option") +# -pthreads: Solaris/gcc (Note: HP C also rejects) +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads and +# -D_REENTRANT too), HP C (must be checked before -lpthread, which +# is present but should not be used directly; and before -mthreads, +# because the compiler interprets this as "-mt" + "-hreads") +# -mthreads: Mingw32/gcc, Lynx/gcc +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case $host_os in + + freebsd*) + + # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) + # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) + + ax_pthread_flags="-kthread lthread $ax_pthread_flags" + ;; + + hpux*) + + # From the cc(1) man page: "[-mt] Sets various -D flags to enable + # multi-threading and also sets -lpthread." + + ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" + ;; + + openedition*) + + # IBM z/OS requires a feature-test macro to be defined in order to + # enable POSIX threads at all, so give the user a hint if this is + # not set. (We don't define these ourselves, as they can affect + # other portions of the system API in unpredictable ways.) + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) + AX_PTHREAD_ZOS_MISSING +# endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5 +$as_echo "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;} +fi +rm -f conftest* + + ;; + + solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (N.B.: The stubs are missing + # pthread_cleanup_push, or rather a function called by this macro, + # so we could check for that, but who knows whether they'll stub + # that too in a future libc.) So we'll check first for the + # standard Solaris way of linking pthreads (-mt -lpthread). + + ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags" + ;; +esac + +# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) + +if test "x$GCC" = "xyes"; then : + ax_pthread_flags="-pthread -pthreads $ax_pthread_flags" +fi + +# The presence of a feature test macro requesting re-entrant function +# definitions is, on some systems, a strong hint that pthreads support is +# correctly enabled + +case $host_os in + darwin* | hpux* | linux* | osf* | solaris*) + ax_pthread_check_macro="_REENTRANT" + ;; + + aix*) + ax_pthread_check_macro="_THREAD_SAFE" + ;; + + *) + ax_pthread_check_macro="--" + ;; +esac +if test "x$ax_pthread_check_macro" = "x--"; then : + ax_pthread_check_cond=0 +else + ax_pthread_check_cond="!defined($ax_pthread_check_macro)" +fi + +# Are we compiling with Clang? + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5 +$as_echo_n "checking whether $CC is Clang... " >&6; } +if ${ax_cv_PTHREAD_CLANG+:} false; then : + $as_echo_n "(cached) " >&6 +else + ax_cv_PTHREAD_CLANG=no + # Note that Autoconf sets GCC=yes for Clang as well as GCC + if test "x$GCC" = "xyes"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ +# if defined(__clang__) && defined(__llvm__) + AX_PTHREAD_CC_IS_CLANG +# endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1; then : + ax_cv_PTHREAD_CLANG=yes +fi +rm -f conftest* + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5 +$as_echo "$ax_cv_PTHREAD_CLANG" >&6; } +ax_pthread_clang="$ax_cv_PTHREAD_CLANG" + +ax_pthread_clang_warning=no + +# Clang needs special handling, because older versions handle the -pthread +# option in a rather... idiosyncratic way + +if test "x$ax_pthread_clang" = "xyes"; then + + # Clang takes -pthread; it has never supported any other flag + + # (Note 1: This will need to be revisited if a system that Clang + # supports has POSIX threads in a separate library. This tends not + # to be the way of modern systems, but it's conceivable.) + + # (Note 2: On some systems, notably Darwin, -pthread is not needed + # to get POSIX threads support; the API is always present and + # active. We could reasonably leave PTHREAD_CFLAGS empty. But + # -pthread does define _REENTRANT, and while the Darwin headers + # ignore this macro, third-party headers might not.) + + PTHREAD_CFLAGS="-pthread" + PTHREAD_LIBS= + + ax_pthread_ok=yes + + # However, older versions of Clang make a point of warning the user + # that, in an invocation where only linking and no compilation is + # taking place, the -pthread option has no effect ("argument unused + # during compilation"). They expect -pthread to be passed in only + # when source code is being compiled. + # + # Problem is, this is at odds with the way Automake and most other + # C build frameworks function, which is that the same flags used in + # compilation (CFLAGS) are also used in linking. Many systems + # supported by AX_PTHREAD require exactly this for POSIX threads + # support, and in fact it is often not straightforward to specify a + # flag that is used only in the compilation phase and not in + # linking. Such a scenario is extremely rare in practice. + # + # Even though use of the -pthread flag in linking would only print + # a warning, this can be a nuisance for well-run software projects + # that build with -Werror. So if the active version of Clang has + # this misfeature, we search for an option to squash it. + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5 +$as_echo_n "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; } +if ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+:} false; then : + $as_echo_n "(cached) " >&6 +else + ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown + # Create an alternate version of $ac_link that compiles and + # links in two steps (.c -> .o, .o -> exe) instead of one + # (.c -> exe), because the warning occurs only in the second + # step + ax_pthread_save_ac_link="$ac_link" + ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' + ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"` + ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" + ax_pthread_save_CFLAGS="$CFLAGS" + for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do + if test "x$ax_pthread_try" = "xunknown"; then : + break +fi + CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" + ac_link="$ax_pthread_save_ac_link" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main(void){return 0;} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_link="$ax_pthread_2step_ac_link" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main(void){return 0;} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done + ac_link="$ax_pthread_save_ac_link" + CFLAGS="$ax_pthread_save_CFLAGS" + if test "x$ax_pthread_try" = "x"; then : + ax_pthread_try=no +fi + ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5 +$as_echo "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; } + + case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in + no | unknown) ;; + *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; + esac + +fi # $ax_pthread_clang = yes + +if test "x$ax_pthread_ok" = "xno"; then +for ax_pthread_try_flag in $ax_pthread_flags; do + + case $ax_pthread_try_flag in + none) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 +$as_echo_n "checking whether pthreads work without any flags... " >&6; } + ;; + + -mt,pthread) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with -mt -lpthread" >&5 +$as_echo_n "checking whether pthreads work with -mt -lpthread... " >&6; } + PTHREAD_CFLAGS="-mt" + PTHREAD_LIBS="-lpthread" + ;; + + -*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5 +$as_echo_n "checking whether pthreads work with $ax_pthread_try_flag... " >&6; } + PTHREAD_CFLAGS="$ax_pthread_try_flag" + ;; + + pthread-config) + # Extract the first word of "pthread-config", so it can be a program name with args. +set dummy pthread-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ax_pthread_config+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ax_pthread_config"; then + ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ax_pthread_config="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" +fi +fi +ax_pthread_config=$ac_cv_prog_ax_pthread_config +if test -n "$ax_pthread_config"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 +$as_echo "$ax_pthread_config" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x$ax_pthread_config" = "xno"; then : + continue +fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5 +$as_echo_n "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; } + PTHREAD_LIBS="-l$ax_pthread_try_flag" + ;; + esac + + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +# if $ax_pthread_check_cond +# error "$ax_pthread_check_macro must be defined" +# endif + static void routine(void *a) { a = 0; } + static void *start_routine(void *a) { return a; } +int +main () +{ +pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_pthread_ok=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +$as_echo "$ax_pthread_ok" >&6; } + if test "x$ax_pthread_ok" = "xyes"; then : + break +fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$ax_pthread_ok" = "xyes"; then + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 +$as_echo_n "checking for joinable pthread attribute... " >&6; } +if ${ax_cv_PTHREAD_JOINABLE_ATTR+:} false; then : + $as_echo_n "(cached) " >&6 +else + ax_cv_PTHREAD_JOINABLE_ATTR=unknown + for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +int attr = $ax_pthread_attr; return attr /* ; */ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5 +$as_echo "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; } + if test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ + test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ + test "x$ax_pthread_joinable_attr_defined" != "xyes"; then : + +cat >>confdefs.h <<_ACEOF +#define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR +_ACEOF + + ax_pthread_joinable_attr_defined=yes + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5 +$as_echo_n "checking whether more special flags are required for pthreads... " >&6; } +if ${ax_cv_PTHREAD_SPECIAL_FLAGS+:} false; then : + $as_echo_n "(cached) " >&6 +else + ax_cv_PTHREAD_SPECIAL_FLAGS=no + case $host_os in + solaris*) + ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" + ;; + esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5 +$as_echo "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; } + if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ + test "x$ax_pthread_special_flags_added" != "xyes"; then : + PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" + ax_pthread_special_flags_added=yes +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 +$as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; } +if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +int i = PTHREAD_PRIO_INHERIT; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_PTHREAD_PRIO_INHERIT=yes +else + ax_cv_PTHREAD_PRIO_INHERIT=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 +$as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } + if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ + test "x$ax_pthread_prio_inherit_defined" != "xyes"; then : + +$as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h + + ax_pthread_prio_inherit_defined=yes + +fi + + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" + + # More AIX lossage: compile with *_r variant + if test "x$GCC" != "xyes"; then + case $host_os in + aix*) + case "x/$CC" in #( + x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) : + #handle absolute path differently from PATH based program lookup + case "x$CC" in #( + x/*) : + if as_fn_executable_p ${CC}_r; then : + PTHREAD_CC="${CC}_r" +fi ;; #( + *) : + for ac_prog in ${CC}_r +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PTHREAD_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PTHREAD_CC"; then + ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_PTHREAD_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PTHREAD_CC=$ac_cv_prog_PTHREAD_CC +if test -n "$PTHREAD_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 +$as_echo "$PTHREAD_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PTHREAD_CC" && break +done +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" + ;; +esac ;; #( + *) : + ;; +esac + ;; + esac + fi +fi + +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" + + + + + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test "x$ax_pthread_ok" = "xyes"; then + +$as_echo "#define HAVE_PTHREAD 1" >>confdefs.h + + : +else + ax_pthread_ok=no + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_memset" >&5 +$as_echo_n "checking for __builtin_memset... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +__builtin_memset ((void*)1, ' ', 10); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE___BUILTIN_MEMSET 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_memcpy" >&5 +$as_echo_n "checking for __builtin_memcpy... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +__builtin_memcpy ((void*)1, (void*)2, 10); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE___BUILTIN_MEMCPY 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_memmove" >&5 +$as_echo_n "checking for __builtin_memmove... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +__builtin_memmove ((void*)1, (void*)2, 10); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE___BUILTIN_MEMMOVE 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_memcmp" >&5 +$as_echo_n "checking for __builtin_memcmp... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +int a = __builtin_memcmp ((void*)1, (void*)2, 10); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE___BUILTIN_MEMCMP 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking labels as values" >&5 +$as_echo_n "checking labels as values... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +void* jp[] = { &&jpt1, &&jpt2, &&jpt3 }; goto *jp[1]; jpt1: 1; jpt2: 2; jpt3: 3; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_LABELS_AS_VALUES 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +for ac_header in stddef.h wchar.h wctype.h errno.h signal.h fcntl.h dirent.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +for ac_header in time.h sys/time.h utime.h spawn.h execinfo.h ucontext.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +for ac_header in sys/resource.h sys/wait.h sys/syscall.h sys/ioctl.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +for ac_header in dlfcn.h ltdl.h sys/mman.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +for ac_header in sys/devpoll.h sys/epoll.h poll.h sys/event.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +for ac_header in netinet/in.h sys/un.h netpacket/packet.h net/if_dl.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +for ac_header in ffi.h dyncall.h libunwind.h quadmath.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_func in gettimeofday settimeofday clock_gettime clock_settime getitimer setitimer +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in backtrace backtrace_symbols +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in makecontext swapcontext getcontext setcontext +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in clock_nanosleep nanosleep usleep +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in localtime_r gmtime_r +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in sigaction signal +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in snprintf _vsnprintf _vsnwprintf strerror_r +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in accept4 pipe2 epoll_create epoll_create1 kqueue kqueue1 +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in isatty mmap munmap +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in readdir64 dirfd faccessat +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in stat64 fstat64 lstat64 fstatat64 fstat fstatat +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +OLDLIBS="$LIBS" +LIBS="$LIBM $LIBS" +for ac_func in powl fmodl sinl cosl tanl sinhl coshl tanhl asinl acosl atanl atan2l logl log2l log10l expl sqrtl ceill floorl roundl +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in pow fmod sin cos tan sinh cosh tanh asin acos atan atan2 log log2 log10 exp sqrt ceil floor round +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in powf fmodf sinf cosf tanf sinhf coshf tanhf asinf acosf atanf atan2f logf log2f log10f expf sqrtf ceilf floorf roundf +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +LIBS="$OLDLIBS" + +save_LIBS="$LIBS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 +$as_echo_n "checking for library containing dlopen... " >&6; } +if ${ac_cv_search_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dl dld; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_dlopen=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_dlopen+:} false; then : + break +fi +done +if ${ac_cv_search_dlopen+:} false; then : + +else + ac_cv_search_dlopen=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 +$as_echo "$ac_cv_search_dlopen" >&6; } +ac_res=$ac_cv_search_dlopen +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + + DL_LIBS="$ac_cv_search_dlopen" + if test "x${DL_LIBS}" = "xnone required" + then + DL_LIBS="" + fi + +fi + +LIBS="$save_LIBS" + + +save_LIBS="$LIBS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing lt_dlopen" >&5 +$as_echo_n "checking for library containing lt_dlopen... " >&6; } +if ${ac_cv_search_lt_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char lt_dlopen (); +int +main () +{ +return lt_dlopen (); + ; + return 0; +} +_ACEOF +for ac_lib in '' ltdl; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_lt_dlopen=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_lt_dlopen+:} false; then : + break +fi +done +if ${ac_cv_search_lt_dlopen+:} false; then : + +else + ac_cv_search_lt_dlopen=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_lt_dlopen" >&5 +$as_echo "$ac_cv_search_lt_dlopen" >&6; } +ac_res=$ac_cv_search_lt_dlopen +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + + LTDL_LIBS="$ac_cv_search_lt_dlopen" + if test "x${LTDL_LIBS}" = "xnone required" + then + LTDL_LIBS="" + fi + +fi + +LIBS="$save_LIBS" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dcNewCallVM in -ldyncall_s" >&5 +$as_echo_n "checking for dcNewCallVM in -ldyncall_s... " >&6; } +if ${ac_cv_lib_dyncall_s_dcNewCallVM+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldyncall_s $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dcNewCallVM (); +int +main () +{ +return dcNewCallVM (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dyncall_s_dcNewCallVM=yes +else + ac_cv_lib_dyncall_s_dcNewCallVM=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dyncall_s_dcNewCallVM" >&5 +$as_echo "$ac_cv_lib_dyncall_s_dcNewCallVM" >&6; } +if test "x$ac_cv_lib_dyncall_s_dcNewCallVM" = xyes; then : + + DYNCALL_LIBS="-ldyncall_s" + +$as_echo "#define HAVE_DYNCALL_LIB 1" >>confdefs.h + + + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ffi_call in -lffi" >&5 +$as_echo_n "checking for ffi_call in -lffi... " >&6; } +if ${ac_cv_lib_ffi_ffi_call+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lffi $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ffi_call (); +int +main () +{ +return ffi_call (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ffi_ffi_call=yes +else + ac_cv_lib_ffi_ffi_call=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ffi_ffi_call" >&5 +$as_echo "$ac_cv_lib_ffi_ffi_call" >&6; } +if test "x$ac_cv_lib_ffi_ffi_call" = xyes; then : + + FFI_LIBS="-lffi" + +$as_echo "#define HAVE_FFI_LIB 1" >>confdefs.h + + + +fi + + + +if test "x${ac_cv_header_libunwind_h}" = "xyes" +then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unw_backtrace in -lunwind" >&5 +$as_echo_n "checking for unw_backtrace in -lunwind... " >&6; } +if ${ac_cv_lib_unwind_unw_backtrace+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lunwind $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char unw_backtrace (); +int +main () +{ +return unw_backtrace (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_unwind_unw_backtrace=yes +else + ac_cv_lib_unwind_unw_backtrace=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_unwind_unw_backtrace" >&5 +$as_echo "$ac_cv_lib_unwind_unw_backtrace" >&6; } +if test "x$ac_cv_lib_unwind_unw_backtrace" = xyes; then : + + UNWIND_LIBS="-lunwind" + +$as_echo "#define HAVE_UNWIND_LIB 1" >>confdefs.h + + + +fi + + +fi + +for ac_func in connect gethostbyname +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +if test "x$ac_cv_func_gethostbyname" = "xno" +then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 +$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } +if ${ac_cv_lib_nsl_gethostbyname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_nsl_gethostbyname=yes +else + ac_cv_lib_nsl_gethostbyname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 +$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } +if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : + + SOCKET_LIBS="$SOCKET_LIBS -lnsl" + $as_echo "#define HAVE_GETHOSTBYNAME 1" >>confdefs.h + + +fi + +fi +if test "x$ac_cv_func_connect" = "xno" +then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 +$as_echo_n "checking for connect in -lsocket... " >&6; } +if ${ac_cv_lib_socket_connect+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char connect (); +int +main () +{ +return connect (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_socket_connect=yes +else + ac_cv_lib_socket_connect=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 +$as_echo "$ac_cv_lib_socket_connect" >&6; } +if test "x$ac_cv_lib_socket_connect" = xyes; then : + + SOCKET_LIBS="$SOCKET_LIBS -lsocket" + $as_echo "#define HAVE_CONNECT 1" >>confdefs.h + + +fi + + + if test "x$ac_cv_lib_socket_connect" = xno + then + for ac_func in t_connect +do : + ac_fn_c_check_func "$LINENO" "t_connect" "ac_cv_func_t_connect" +if test "x$ac_cv_func_t_connect" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_T_CONNECT 1 +_ACEOF + +fi +done + + if test "x$ac_cv_func_t_connect" = "xno" + then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for t_connect in -lnsl_s" >&5 +$as_echo_n "checking for t_connect in -lnsl_s... " >&6; } +if ${ac_cv_lib_nsl_s_t_connect+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl_s $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char t_connect (); +int +main () +{ +return t_connect (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_nsl_s_t_connect=yes +else + ac_cv_lib_nsl_s_t_connect=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_s_t_connect" >&5 +$as_echo "$ac_cv_lib_nsl_s_t_connect" >&6; } +if test "x$ac_cv_lib_nsl_s_t_connect" = xyes; then : + + SOCKET_LIBS="$SOCKET_LIBS -lnsl_s" + $as_echo "#define HAVE_T_CONNECT 1" >>confdefs.h + + +fi + + fi + fi +fi +if test "x${platform_win32}" = "xyes" +then + SOCKET_LIBS="$SOCKET_LIBS -lws2_32" +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_timedlock in -lpthread" >&5 +$as_echo_n "checking for pthread_mutex_timedlock in -lpthread... " >&6; } +if ${ac_cv_lib_pthread_pthread_mutex_timedlock+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_mutex_timedlock (); +int +main () +{ +return pthread_mutex_timedlock (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pthread_pthread_mutex_timedlock=yes +else + ac_cv_lib_pthread_pthread_mutex_timedlock=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_timedlock" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_mutex_timedlock" >&6; } +if test "x$ac_cv_lib_pthread_pthread_mutex_timedlock" = xyes; then : + + +$as_echo "#define HAVE_PTHREAD_MUTEX_TIMEDLOCK 1" >>confdefs.h + + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_trylock in -lpthread" >&5 +$as_echo_n "checking for pthread_mutex_trylock in -lpthread... " >&6; } +if ${ac_cv_lib_pthread_pthread_mutex_trylock+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_mutex_trylock (); +int +main () +{ +return pthread_mutex_trylock (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pthread_pthread_mutex_trylock=yes +else + ac_cv_lib_pthread_pthread_mutex_trylock=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_trylock" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_mutex_trylock" >&6; } +if test "x$ac_cv_lib_pthread_pthread_mutex_trylock" = xyes; then : + + +$as_echo "#define HAVE_PTHREAD_MUTEX_TRYLOCK 1" >>confdefs.h + + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lunicows" >&5 +$as_echo_n "checking for main in -lunicows... " >&6; } +if ${ac_cv_lib_unicows_main+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lunicows $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_unicows_main=yes +else + ac_cv_lib_unicows_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_unicows_main" >&5 +$as_echo "$ac_cv_lib_unicows_main" >&6; } +if test "x$ac_cv_lib_unicows_main" = xyes; then : + UNICOWS_LIBS="-lunicows" +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 +$as_echo_n "checking for clock_gettime in -lrt... " >&6; } +if ${ac_cv_lib_rt_clock_gettime+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char clock_gettime (); +int +main () +{ +return clock_gettime (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_rt_clock_gettime=yes +else + ac_cv_lib_rt_clock_gettime=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 +$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } +if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then : + LIBS="$LIBS -lrt" +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5 +$as_echo_n "checking for va_copy... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + + va_list x, y; + va_copy(x,y); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_VA_COPY 1" >>confdefs.h + + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __va_copy" >&5 +$as_echo_n "checking for __va_copy... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + + va_list x, y; + __va_copy(x,y); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE___VA_COPY 1" >>confdefs.h + + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime %z" >&5 +$as_echo_n "checking for strftime %z... " >&6; } +if test "$cross_compiling" = yes; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5 +$as_echo "unknown" >&6; } + +$as_echo "#define HAVE_STRFTIME_SMALL_Z 1" >>confdefs.h + + + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #if defined(HAVE_SYS_TIME_H) + #include + #endif + #if defined(HAVE_TIME_H) + #include + #endif + int main () + { + char buf[100]; + time_t t = 0; + strftime (buf, sizeof(buf), "%z", gmtime(&t)); + return (strcmp(buf, "%z") == 0 || strcmp(buf, "z") == 0)? 1: 0; + } +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_STRFTIME_SMALL_Z 1" >>confdefs.h + + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } +if eval \${$as_ac_Header+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include <$ac_hdr> + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_ac_Header=yes" +else + eval "$as_ac_Header=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_ac_Header + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_opendir+:} false; then : + break +fi +done +if ${ac_cv_search_opendir+:} false; then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_opendir+:} false; then : + break +fi +done +if ${ac_cv_search_opendir+:} false; then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +fi + + + + ac_fn_c_check_member "$LINENO" "struct dirent" "d_type" "ac_cv_member_struct_dirent_d_type" " +#include +#ifdef HAVE_DIRENT_H +# include +#else +# define dirent direct +# ifdef HAVE_SYS_NDIR_H +# include +# endif +# ifdef HAVE_SYS_DIR_H +# include +# endif +# ifdef HAVE_NDIR_H +# include +# endif +#endif + +" +if test "x$ac_cv_member_struct_dirent_d_type" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_DIRENT_D_TYPE 1 +_ACEOF + + +fi + + +ac_fn_c_check_member "$LINENO" "DIR" "d_fd" "ac_cv_member_DIR_d_fd" "#include +" +if test "x$ac_cv_member_DIR_d_fd" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_DIR_D_FD 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "DIR" "dd_fd" "ac_cv_member_DIR_dd_fd" "#include +" +if test "x$ac_cv_member_DIR_dd_fd" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_DIR_DD_FD 1 +_ACEOF + + +fi + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5 +$as_echo_n "checking size of char... " >&6; } +if ${ac_cv_sizeof_char+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char" " +"; then : + +else + if test "$ac_cv_type_char" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (char) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_char=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char" >&5 +$as_echo "$ac_cv_sizeof_char" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_CHAR $ac_cv_sizeof_char +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 +$as_echo_n "checking size of short... " >&6; } +if ${ac_cv_sizeof_short+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" " +"; then : + +else + if test "$ac_cv_type_short" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (short) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_short=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 +$as_echo "$ac_cv_sizeof_short" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SHORT $ac_cv_sizeof_short +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 +$as_echo_n "checking size of int... " >&6; } +if ${ac_cv_sizeof_int+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" " +"; then : + +else + if test "$ac_cv_type_int" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (int) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_int=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 +$as_echo "$ac_cv_sizeof_int" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } +if ${ac_cv_sizeof_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" " +"; then : + +else + if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 +$as_echo_n "checking size of long long... " >&6; } +if ${ac_cv_sizeof_long_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" " +"; then : + +else + if test "$ac_cv_type_long_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 +$as_echo "$ac_cv_sizeof_long_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int8" >&5 +$as_echo_n "checking size of __int8... " >&6; } +if ${ac_cv_sizeof___int8+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int8))" "ac_cv_sizeof___int8" " +"; then : + +else + if test "$ac_cv_type___int8" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (__int8) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof___int8=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int8" >&5 +$as_echo "$ac_cv_sizeof___int8" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF___INT8 $ac_cv_sizeof___int8 +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int16" >&5 +$as_echo_n "checking size of __int16... " >&6; } +if ${ac_cv_sizeof___int16+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int16))" "ac_cv_sizeof___int16" " +"; then : + +else + if test "$ac_cv_type___int16" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (__int16) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof___int16=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int16" >&5 +$as_echo "$ac_cv_sizeof___int16" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF___INT16 $ac_cv_sizeof___int16 +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int32" >&5 +$as_echo_n "checking size of __int32... " >&6; } +if ${ac_cv_sizeof___int32+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int32))" "ac_cv_sizeof___int32" " +"; then : + +else + if test "$ac_cv_type___int32" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (__int32) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof___int32=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int32" >&5 +$as_echo "$ac_cv_sizeof___int32" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF___INT32 $ac_cv_sizeof___int32 +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int64" >&5 +$as_echo_n "checking size of __int64... " >&6; } +if ${ac_cv_sizeof___int64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int64))" "ac_cv_sizeof___int64" " +"; then : + +else + if test "$ac_cv_type___int64" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (__int64) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof___int64=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int64" >&5 +$as_echo "$ac_cv_sizeof___int64" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF___INT64 $ac_cv_sizeof___int64 +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int128" >&5 +$as_echo_n "checking size of __int128... " >&6; } +if ${ac_cv_sizeof___int128+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int128))" "ac_cv_sizeof___int128" " +"; then : + +else + if test "$ac_cv_type___int128" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (__int128) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof___int128=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int128" >&5 +$as_echo "$ac_cv_sizeof___int128" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF___INT128 $ac_cv_sizeof___int128 +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int8_t" >&5 +$as_echo_n "checking size of __int8_t... " >&6; } +if ${ac_cv_sizeof___int8_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int8_t))" "ac_cv_sizeof___int8_t" " +"; then : + +else + if test "$ac_cv_type___int8_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (__int8_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof___int8_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int8_t" >&5 +$as_echo "$ac_cv_sizeof___int8_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF___INT8_T $ac_cv_sizeof___int8_t +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int16_t" >&5 +$as_echo_n "checking size of __int16_t... " >&6; } +if ${ac_cv_sizeof___int16_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int16_t))" "ac_cv_sizeof___int16_t" " +"; then : + +else + if test "$ac_cv_type___int16_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (__int16_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof___int16_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int16_t" >&5 +$as_echo "$ac_cv_sizeof___int16_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF___INT16_T $ac_cv_sizeof___int16_t +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int32_t" >&5 +$as_echo_n "checking size of __int32_t... " >&6; } +if ${ac_cv_sizeof___int32_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int32_t))" "ac_cv_sizeof___int32_t" " +"; then : + +else + if test "$ac_cv_type___int32_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (__int32_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof___int32_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int32_t" >&5 +$as_echo "$ac_cv_sizeof___int32_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF___INT32_T $ac_cv_sizeof___int32_t +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int64_t" >&5 +$as_echo_n "checking size of __int64_t... " >&6; } +if ${ac_cv_sizeof___int64_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int64_t))" "ac_cv_sizeof___int64_t" " +"; then : + +else + if test "$ac_cv_type___int64_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (__int64_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof___int64_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int64_t" >&5 +$as_echo "$ac_cv_sizeof___int64_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF___INT64_T $ac_cv_sizeof___int64_t +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int128_t" >&5 +$as_echo_n "checking size of __int128_t... " >&6; } +if ${ac_cv_sizeof___int128_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int128_t))" "ac_cv_sizeof___int128_t" " +"; then : + +else + if test "$ac_cv_type___int128_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (__int128_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof___int128_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int128_t" >&5 +$as_echo "$ac_cv_sizeof___int128_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF___INT128_T $ac_cv_sizeof___int128_t +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __uint128_t" >&5 +$as_echo_n "checking size of __uint128_t... " >&6; } +if ${ac_cv_sizeof___uint128_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__uint128_t))" "ac_cv_sizeof___uint128_t" " +"; then : + +else + if test "$ac_cv_type___uint128_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (__uint128_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof___uint128_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___uint128_t" >&5 +$as_echo "$ac_cv_sizeof___uint128_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF___UINT128_T $ac_cv_sizeof___uint128_t +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 +$as_echo_n "checking size of void *... " >&6; } +if ${ac_cv_sizeof_void_p+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" " +"; then : + +else + if test "$ac_cv_type_void_p" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (void *) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_void_p=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 +$as_echo "$ac_cv_sizeof_void_p" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_VOID_P $ac_cv_sizeof_void_p +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of float" >&5 +$as_echo_n "checking size of float... " >&6; } +if ${ac_cv_sizeof_float+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float))" "ac_cv_sizeof_float" " +"; then : + +else + if test "$ac_cv_type_float" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (float) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_float=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_float" >&5 +$as_echo "$ac_cv_sizeof_float" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_FLOAT $ac_cv_sizeof_float +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5 +$as_echo_n "checking size of double... " >&6; } +if ${ac_cv_sizeof_double+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" " +"; then : + +else + if test "$ac_cv_type_double" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (double) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_double=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_double" >&5 +$as_echo "$ac_cv_sizeof_double" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_DOUBLE $ac_cv_sizeof_double +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double" >&5 +$as_echo_n "checking size of long double... " >&6; } +if ${ac_cv_sizeof_long_double+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double" " +"; then : + +else + if test "$ac_cv_type_long_double" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long double) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long_double=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_double" >&5 +$as_echo "$ac_cv_sizeof_long_double" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __float128" >&5 +$as_echo_n "checking size of __float128... " >&6; } +if ${ac_cv_sizeof___float128+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__float128))" "ac_cv_sizeof___float128" " +"; then : + +else + if test "$ac_cv_type___float128" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (__float128) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof___float128=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___float128" >&5 +$as_echo "$ac_cv_sizeof___float128" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF___FLOAT128 $ac_cv_sizeof___float128 +_ACEOF + + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of wchar_t" >&5 +$as_echo_n "checking size of wchar_t... " >&6; } +if ${ac_cv_sizeof_wchar_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (wchar_t))" "ac_cv_sizeof_wchar_t" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_wchar_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (wchar_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_wchar_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_wchar_t" >&5 +$as_echo "$ac_cv_sizeof_wchar_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_WCHAR_T $ac_cv_sizeof_wchar_t +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 +$as_echo_n "checking size of off_t... " >&6; } +if ${ac_cv_sizeof_off_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_off_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (off_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_off_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 +$as_echo "$ac_cv_sizeof_off_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_OFF_T $ac_cv_sizeof_off_t +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off64_t" >&5 +$as_echo_n "checking size of off64_t... " >&6; } +if ${ac_cv_sizeof_off64_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off64_t))" "ac_cv_sizeof_off64_t" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_off64_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (off64_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_off64_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off64_t" >&5 +$as_echo "$ac_cv_sizeof_off64_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_OFF64_T $ac_cv_sizeof_off64_t +_ACEOF + + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of mbstate_t" >&5 +$as_echo_n "checking size of mbstate_t... " >&6; } +if ${ac_cv_sizeof_mbstate_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (mbstate_t))" "ac_cv_sizeof_mbstate_t" "#include +"; then : + +else + if test "$ac_cv_type_mbstate_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (mbstate_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_mbstate_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_mbstate_t" >&5 +$as_echo "$ac_cv_sizeof_mbstate_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_MBSTATE_T $ac_cv_sizeof_mbstate_t +_ACEOF + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking numeric value of MB_LEN_MAX" >&5 +$as_echo_n "checking numeric value of MB_LEN_MAX... " >&6; } +if ${ax_cv_numvalof_MB_LEN_MAX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(MB_LEN_MAX)" "ax_cv_numvalof_MB_LEN_MAX" "#include +"; then : + +else + ax_cv_numvalof_MB_LEN_MAX=32 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_numvalof_MB_LEN_MAX" >&5 +$as_echo "$ax_cv_numvalof_MB_LEN_MAX" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define NUMVALOF_MB_LEN_MAX $ax_cv_numvalof_MB_LEN_MAX +_ACEOF + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking numeric value of PATH_MAX" >&5 +$as_echo_n "checking numeric value of PATH_MAX... " >&6; } +if ${ax_cv_numvalof_PATH_MAX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(PATH_MAX)" "ax_cv_numvalof_PATH_MAX" "#include +"; then : + +else + ax_cv_numvalof_PATH_MAX=0 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_numvalof_PATH_MAX" >&5 +$as_echo "$ax_cv_numvalof_PATH_MAX" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define NUMVALOF_PATH_MAX $ax_cv_numvalof_PATH_MAX +_ACEOF + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking numeric value of NSIG" >&5 +$as_echo_n "checking numeric value of NSIG... " >&6; } +if ${ax_cv_numvalof_NSIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(NSIG)" "ax_cv_numvalof_NSIG" "#include +"; then : + +else + ax_cv_numvalof_NSIG=32 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_numvalof_NSIG" >&5 +$as_echo "$ax_cv_numvalof_NSIG" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define NUMVALOF_NSIG $ax_cv_numvalof_NSIG +_ACEOF + + + + +if test "x${platform_win32}" = "xyes" +then + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of struct sockaddr_in" >&5 +$as_echo_n "checking size of struct sockaddr_in... " >&6; } +if ${ac_cv_sizeof_struct_sockaddr_in+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct sockaddr_in))" "ac_cv_sizeof_struct_sockaddr_in" " + #include + #include +"; then : + +else + if test "$ac_cv_type_struct_sockaddr_in" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (struct sockaddr_in) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_struct_sockaddr_in=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_struct_sockaddr_in" >&5 +$as_echo "$ac_cv_sizeof_struct_sockaddr_in" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_STRUCT_SOCKADDR_IN $ac_cv_sizeof_struct_sockaddr_in +_ACEOF + + + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of struct sockaddr_in6" >&5 +$as_echo_n "checking size of struct sockaddr_in6... " >&6; } +if ${ac_cv_sizeof_struct_sockaddr_in6+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct sockaddr_in6))" "ac_cv_sizeof_struct_sockaddr_in6" " + #include + #include +"; then : + +else + if test "$ac_cv_type_struct_sockaddr_in6" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (struct sockaddr_in6) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_struct_sockaddr_in6=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_struct_sockaddr_in6" >&5 +$as_echo "$ac_cv_sizeof_struct_sockaddr_in6" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_STRUCT_SOCKADDR_IN6 $ac_cv_sizeof_struct_sockaddr_in6 +_ACEOF + + + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of struct sockaddr_un" >&5 +$as_echo_n "checking size of struct sockaddr_un... " >&6; } +if ${ac_cv_sizeof_struct_sockaddr_un+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct sockaddr_un))" "ac_cv_sizeof_struct_sockaddr_un" " + #include + #include +"; then : + +else + if test "$ac_cv_type_struct_sockaddr_un" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (struct sockaddr_un) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_struct_sockaddr_un=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_struct_sockaddr_un" >&5 +$as_echo "$ac_cv_sizeof_struct_sockaddr_un" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_STRUCT_SOCKADDR_UN $ac_cv_sizeof_struct_sockaddr_un +_ACEOF + + + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of struct sockaddr_ll" >&5 +$as_echo_n "checking size of struct sockaddr_ll... " >&6; } +if ${ac_cv_sizeof_struct_sockaddr_ll+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct sockaddr_ll))" "ac_cv_sizeof_struct_sockaddr_ll" " + #include + #include +"; then : + +else + if test "$ac_cv_type_struct_sockaddr_ll" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (struct sockaddr_ll) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_struct_sockaddr_ll=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_struct_sockaddr_ll" >&5 +$as_echo "$ac_cv_sizeof_struct_sockaddr_ll" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_STRUCT_SOCKADDR_LL $ac_cv_sizeof_struct_sockaddr_ll +_ACEOF + + + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of struct sockaddr_dl" >&5 +$as_echo_n "checking size of struct sockaddr_dl... " >&6; } +if ${ac_cv_sizeof_struct_sockaddr_dl+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct sockaddr_dl))" "ac_cv_sizeof_struct_sockaddr_dl" " + #include + #include +"; then : + +else + if test "$ac_cv_type_struct_sockaddr_dl" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (struct sockaddr_dl) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_struct_sockaddr_dl=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_struct_sockaddr_dl" >&5 +$as_echo "$ac_cv_sizeof_struct_sockaddr_dl" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_STRUCT_SOCKADDR_DL $ac_cv_sizeof_struct_sockaddr_dl +_ACEOF + + + + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of socklen_t" >&5 +$as_echo_n "checking size of socklen_t... " >&6; } +if ${ac_cv_sizeof_socklen_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (socklen_t))" "ac_cv_sizeof_socklen_t" " + #include + #include +"; then : + +else + if test "$ac_cv_type_socklen_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (socklen_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_socklen_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_socklen_t" >&5 +$as_echo "$ac_cv_sizeof_socklen_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SOCKLEN_T $ac_cv_sizeof_socklen_t +_ACEOF + + + if test ${ac_cv_sizeof_socklen_t} -gt 0 + then + + typename=`echo socklen_t | sed "s/[^a-zA-Z0-9_]/_/g"` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether socklen_t is signed" >&5 +$as_echo_n "checking whether socklen_t is signed... " >&6; } +if eval \${ax_cv_decl_${typename}_signed+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include +int +main () +{ + int foo [ 1 - 2 * !(((socklen_t) -1) < 0) ] + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "ax_cv_decl_${typename}_signed=\"yes\"" +else + eval "ax_cv_decl_${typename}_signed=\"no\"" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$ax_cv_decl_${typename}_signed + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + symbolname=`echo socklen_t | sed "s/[^a-zA-Z0-9_]/_/g" | tr "a-z" "A-Z"` + if eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"yes\""; then + +$as_echo "#define HAWK_SOCKLEN_T_IS_SIGNED 1" >>confdefs.h + + elif eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"no\""; then + $as_echo_n "" + fi + + fi + + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of sa_family_t" >&5 +$as_echo_n "checking size of sa_family_t... " >&6; } +if ${ac_cv_sizeof_sa_family_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (sa_family_t))" "ac_cv_sizeof_sa_family_t" " + #include + #include +"; then : + +else + if test "$ac_cv_type_sa_family_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (sa_family_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_sa_family_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_sa_family_t" >&5 +$as_echo "$ac_cv_sizeof_sa_family_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SA_FAMILY_T $ac_cv_sizeof_sa_family_t +_ACEOF + + + if test ${ac_cv_sizeof_sa_family_t} -gt 0 + then + + typename=`echo sa_family_t | sed "s/[^a-zA-Z0-9_]/_/g"` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sa_family_t is signed" >&5 +$as_echo_n "checking whether sa_family_t is signed... " >&6; } +if eval \${ax_cv_decl_${typename}_signed+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include +int +main () +{ + int foo [ 1 - 2 * !(((sa_family_t) -1) < 0) ] + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "ax_cv_decl_${typename}_signed=\"yes\"" +else + eval "ax_cv_decl_${typename}_signed=\"no\"" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$ax_cv_decl_${typename}_signed + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + symbolname=`echo sa_family_t | sed "s/[^a-zA-Z0-9_]/_/g" | tr "a-z" "A-Z"` + if eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"yes\""; then + +$as_echo "#define HAWK_SA_FAMILY_T_IS_SIGNED 1" >>confdefs.h + + elif eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"no\""; then + $as_echo_n "" + fi + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking offset of sa_family in struct sockaddr" >&5 +$as_echo_n "checking offset of sa_family in struct sockaddr... " >&6; } + if ac_fn_c_compute_int "$LINENO" "offsetof(struct sockaddr, sa_family)" "ac_cv_offsetof_sa_family" "#include + #include + #include "; then : + +else + ac_cv_offsteof_sa_family=0 +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_offsetof_sa_family" >&5 +$as_echo "$ac_cv_offsetof_sa_family" >&6; } + +cat >>confdefs.h <<_ACEOF +#define HAWK_OFFSETOF_SA_FAMILY ${ac_cv_offsetof_sa_family} +_ACEOF + + +else + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of struct sockaddr_in" >&5 +$as_echo_n "checking size of struct sockaddr_in... " >&6; } +if ${ac_cv_sizeof_struct_sockaddr_in+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct sockaddr_in))" "ac_cv_sizeof_struct_sockaddr_in" " + #include + #include + #include +"; then : + +else + if test "$ac_cv_type_struct_sockaddr_in" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (struct sockaddr_in) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_struct_sockaddr_in=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_struct_sockaddr_in" >&5 +$as_echo "$ac_cv_sizeof_struct_sockaddr_in" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_STRUCT_SOCKADDR_IN $ac_cv_sizeof_struct_sockaddr_in +_ACEOF + + + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of struct sockaddr_in6" >&5 +$as_echo_n "checking size of struct sockaddr_in6... " >&6; } +if ${ac_cv_sizeof_struct_sockaddr_in6+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct sockaddr_in6))" "ac_cv_sizeof_struct_sockaddr_in6" " + #include + #include + #include +"; then : + +else + if test "$ac_cv_type_struct_sockaddr_in6" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (struct sockaddr_in6) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_struct_sockaddr_in6=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_struct_sockaddr_in6" >&5 +$as_echo "$ac_cv_sizeof_struct_sockaddr_in6" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_STRUCT_SOCKADDR_IN6 $ac_cv_sizeof_struct_sockaddr_in6 +_ACEOF + + + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of struct sockaddr_un" >&5 +$as_echo_n "checking size of struct sockaddr_un... " >&6; } +if ${ac_cv_sizeof_struct_sockaddr_un+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct sockaddr_un))" "ac_cv_sizeof_struct_sockaddr_un" " + #include + #include + #include +"; then : + +else + if test "$ac_cv_type_struct_sockaddr_un" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (struct sockaddr_un) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_struct_sockaddr_un=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_struct_sockaddr_un" >&5 +$as_echo "$ac_cv_sizeof_struct_sockaddr_un" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_STRUCT_SOCKADDR_UN $ac_cv_sizeof_struct_sockaddr_un +_ACEOF + + + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of struct sockaddr_ll" >&5 +$as_echo_n "checking size of struct sockaddr_ll... " >&6; } +if ${ac_cv_sizeof_struct_sockaddr_ll+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct sockaddr_ll))" "ac_cv_sizeof_struct_sockaddr_ll" " + #include + #include + #include +"; then : + +else + if test "$ac_cv_type_struct_sockaddr_ll" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (struct sockaddr_ll) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_struct_sockaddr_ll=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_struct_sockaddr_ll" >&5 +$as_echo "$ac_cv_sizeof_struct_sockaddr_ll" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_STRUCT_SOCKADDR_LL $ac_cv_sizeof_struct_sockaddr_ll +_ACEOF + + + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of struct sockaddr_dl" >&5 +$as_echo_n "checking size of struct sockaddr_dl... " >&6; } +if ${ac_cv_sizeof_struct_sockaddr_dl+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct sockaddr_dl))" "ac_cv_sizeof_struct_sockaddr_dl" " + #include + #include + #include +"; then : + +else + if test "$ac_cv_type_struct_sockaddr_dl" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (struct sockaddr_dl) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_struct_sockaddr_dl=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_struct_sockaddr_dl" >&5 +$as_echo "$ac_cv_sizeof_struct_sockaddr_dl" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_STRUCT_SOCKADDR_DL $ac_cv_sizeof_struct_sockaddr_dl +_ACEOF + + + + + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of socklen_t" >&5 +$as_echo_n "checking size of socklen_t... " >&6; } +if ${ac_cv_sizeof_socklen_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (socklen_t))" "ac_cv_sizeof_socklen_t" " + #include + #include +"; then : + +else + if test "$ac_cv_type_socklen_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (socklen_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_socklen_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_socklen_t" >&5 +$as_echo "$ac_cv_sizeof_socklen_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SOCKLEN_T $ac_cv_sizeof_socklen_t +_ACEOF + + + if test ${ac_cv_sizeof_socklen_t} -gt 0 + then + + typename=`echo socklen_t | sed "s/[^a-zA-Z0-9_]/_/g"` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether socklen_t is signed" >&5 +$as_echo_n "checking whether socklen_t is signed... " >&6; } +if eval \${ax_cv_decl_${typename}_signed+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include +int +main () +{ + int foo [ 1 - 2 * !(((socklen_t) -1) < 0) ] + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "ax_cv_decl_${typename}_signed=\"yes\"" +else + eval "ax_cv_decl_${typename}_signed=\"no\"" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$ax_cv_decl_${typename}_signed + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + symbolname=`echo socklen_t | sed "s/[^a-zA-Z0-9_]/_/g" | tr "a-z" "A-Z"` + if eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"yes\""; then + +$as_echo "#define HAWK_SOCKLEN_T_IS_SIGNED 1" >>confdefs.h + + elif eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"no\""; then + $as_echo_n "" + fi + + fi + + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of sa_family_t" >&5 +$as_echo_n "checking size of sa_family_t... " >&6; } +if ${ac_cv_sizeof_sa_family_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (sa_family_t))" "ac_cv_sizeof_sa_family_t" " + #include + #include + #include +"; then : + +else + if test "$ac_cv_type_sa_family_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (sa_family_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_sa_family_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_sa_family_t" >&5 +$as_echo "$ac_cv_sizeof_sa_family_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SA_FAMILY_T $ac_cv_sizeof_sa_family_t +_ACEOF + + + if test ${ac_cv_sizeof_sa_family_t} -gt 0 + then + + typename=`echo sa_family_t | sed "s/[^a-zA-Z0-9_]/_/g"` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sa_family_t is signed" >&5 +$as_echo_n "checking whether sa_family_t is signed... " >&6; } +if eval \${ax_cv_decl_${typename}_signed+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include +int +main () +{ + int foo [ 1 - 2 * !(((sa_family_t) -1) < 0) ] + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "ax_cv_decl_${typename}_signed=\"yes\"" +else + eval "ax_cv_decl_${typename}_signed=\"no\"" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$ax_cv_decl_${typename}_signed + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + symbolname=`echo sa_family_t | sed "s/[^a-zA-Z0-9_]/_/g" | tr "a-z" "A-Z"` + if eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"yes\""; then + +$as_echo "#define HAWK_SA_FAMILY_T_IS_SIGNED 1" >>confdefs.h + + elif eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"no\""; then + $as_echo_n "" + fi + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking offset of sa_family in struct sockaddr" >&5 +$as_echo_n "checking offset of sa_family in struct sockaddr... " >&6; } + if ac_fn_c_compute_int "$LINENO" "offsetof(struct sockaddr, sa_family)" "ac_cv_offsetof_sa_family" "#include + #include + #include "; then : + +else + ac_cv_offsteof_sa_family=0 +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_offsetof_sa_family" >&5 +$as_echo "$ac_cv_offsetof_sa_family" >&6; } + +cat >>confdefs.h <<_ACEOF +#define HAWK_OFFSETOF_SA_FAMILY ${ac_cv_offsetof_sa_family} +_ACEOF + +fi + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pthread_t" >&5 +$as_echo_n "checking size of pthread_t... " >&6; } +if ${ac_cv_sizeof_pthread_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_t))" "ac_cv_sizeof_pthread_t" "#include +"; then : + +else + if test "$ac_cv_type_pthread_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (pthread_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_pthread_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pthread_t" >&5 +$as_echo "$ac_cv_sizeof_pthread_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_PTHREAD_T $ac_cv_sizeof_pthread_t +_ACEOF + + +if test ${ac_cv_sizeof_pthread_t} -gt 0 +then + + typename=`echo pthread_t | sed "s/[^a-zA-Z0-9_]/_/g"` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_t is signed" >&5 +$as_echo_n "checking whether pthread_t is signed... " >&6; } +if eval \${ax_cv_decl_${typename}_signed+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + int foo [ 1 - 2 * !(((pthread_t) -1) < 0) ] + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "ax_cv_decl_${typename}_signed=\"yes\"" +else + eval "ax_cv_decl_${typename}_signed=\"no\"" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$ax_cv_decl_${typename}_signed + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + symbolname=`echo pthread_t | sed "s/[^a-zA-Z0-9_]/_/g" | tr "a-z" "A-Z"` + if eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"yes\""; then + +$as_echo "#define HAWK_PTHREAD_T_IS_SIGNED 1" >>confdefs.h + + elif eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"no\""; then + $as_echo_n "" + fi + +fi + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pthread_mutex_t" >&5 +$as_echo_n "checking size of pthread_mutex_t... " >&6; } +if ${ac_cv_sizeof_pthread_mutex_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_mutex_t))" "ac_cv_sizeof_pthread_mutex_t" "#include +"; then : + +else + if test "$ac_cv_type_pthread_mutex_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (pthread_mutex_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_pthread_mutex_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pthread_mutex_t" >&5 +$as_echo "$ac_cv_sizeof_pthread_mutex_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_PTHREAD_MUTEX_T $ac_cv_sizeof_pthread_mutex_t +_ACEOF + + +if test ${ac_cv_sizeof_pthread_mutex_t} -gt 0 +then + + typename=`echo pthread_mutex_t | sed "s/[^a-zA-Z0-9_]/_/g"` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_mutex_t is signed" >&5 +$as_echo_n "checking whether pthread_mutex_t is signed... " >&6; } +if eval \${ax_cv_decl_${typename}_signed+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + int foo [ 1 - 2 * !(((pthread_mutex_t) -1) < 0) ] + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "ax_cv_decl_${typename}_signed=\"yes\"" +else + eval "ax_cv_decl_${typename}_signed=\"no\"" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$ax_cv_decl_${typename}_signed + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + symbolname=`echo pthread_mutex_t | sed "s/[^a-zA-Z0-9_]/_/g" | tr "a-z" "A-Z"` + if eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"yes\""; then + +$as_echo "#define HAWK_PTHREAD_MUTEX_T_IS_SIGNED 1" >>confdefs.h + + elif eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"no\""; then + $as_echo_n "" + fi + +fi + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pthread_cond_t" >&5 +$as_echo_n "checking size of pthread_cond_t... " >&6; } +if ${ac_cv_sizeof_pthread_cond_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_cond_t))" "ac_cv_sizeof_pthread_cond_t" "#include +"; then : + +else + if test "$ac_cv_type_pthread_cond_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (pthread_cond_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_pthread_cond_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pthread_cond_t" >&5 +$as_echo "$ac_cv_sizeof_pthread_cond_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_PTHREAD_COND_T $ac_cv_sizeof_pthread_cond_t +_ACEOF + + +if test ${ac_cv_sizeof_pthread_cond_t} -gt 0 +then + + typename=`echo pthread_cond_t | sed "s/[^a-zA-Z0-9_]/_/g"` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_cond_t is signed" >&5 +$as_echo_n "checking whether pthread_cond_t is signed... " >&6; } +if eval \${ax_cv_decl_${typename}_signed+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + int foo [ 1 - 2 * !(((pthread_cond_t) -1) < 0) ] + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "ax_cv_decl_${typename}_signed=\"yes\"" +else + eval "ax_cv_decl_${typename}_signed=\"no\"" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$ax_cv_decl_${typename}_signed + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + symbolname=`echo pthread_cond_t | sed "s/[^a-zA-Z0-9_]/_/g" | tr "a-z" "A-Z"` + if eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"yes\""; then + +$as_echo "#define HAWK_PTHREAD_MUTEX_T_IS_SIGNED 1" >>confdefs.h + + elif eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"no\""; then + $as_echo_n "" + fi + +fi + +if test ${ac_cv_sizeof___int128_t} -gt 0 +then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking __int128_t with % and va_arg" >&5 +$as_echo_n "checking __int128_t with % and va_arg... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + + volatile __int128_t x, base; + va_list ap; + va_arg(ap, __int128_t); + x = (__int128_t)&base; + base = (__int128_t)&x; + x = x % base; + return (int)x; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ac_cv_sizeof___int128_t=0 + ac_cv_sizeof___uint128_t=0 + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +if test ${ac_cv_sizeof___float128} -gt 0 +then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking __float128 with linking" >&5 +$as_echo_n "checking __float128 with linking... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + + __float128 x, y, z; + z = x * y + x; + printf ("%p", (char*)(int)z); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ac_cv_sizeof___float128=0 + + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi + +if test ${ac_cv_sizeof___float128} -gt 0 +then + for ac_func in quadmath_snprintf +do : + ac_fn_c_check_func "$LINENO" "quadmath_snprintf" "ac_cv_func_quadmath_snprintf" +if test "x$ac_cv_func_quadmath_snprintf" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_QUADMATH_SNPRINTF 1 +_ACEOF + +fi +done + + if test "$ac_cv_func_quadmath_snprintf" = "no" + then + OLDLIBS="$LIBS" + LIBS="$LIBM $LIBS" + for ac_func in quadmath_snprintf +do : + ac_fn_c_check_func "$LINENO" "quadmath_snprintf" "ac_cv_func_quadmath_snprintf" +if test "x$ac_cv_func_quadmath_snprintf" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_QUADMATH_SNPRINTF 1 +_ACEOF + +fi +done + + LIBS="$OLDLIBS" + + if test "$ac_cv_func_quadmath_snprintf" = "no" + then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for quadmath_snprintf in -lquadmath" >&5 +$as_echo_n "checking for quadmath_snprintf in -lquadmath... " >&6; } +if ${ac_cv_lib_quadmath_quadmath_snprintf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lquadmath $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char quadmath_snprintf (); +int +main () +{ +return quadmath_snprintf (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_quadmath_quadmath_snprintf=yes +else + ac_cv_lib_quadmath_quadmath_snprintf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_quadmath_quadmath_snprintf" >&5 +$as_echo "$ac_cv_lib_quadmath_quadmath_snprintf" >&6; } +if test "x$ac_cv_lib_quadmath_quadmath_snprintf" = xyes; then : + + QUADMATH_LIBS="-lquadmath" + LIBM="$LIBM -lquadmath" + $as_echo "#define HAVE_QUADMATH_SNPRINTF 1" >>confdefs.h + + +fi + + + if test "$ac_cv_lib_quadmath_quadmath_snprintf" = "no" + then + + ac_cv_sizeof___float128=0 + fi + + else + QUADMATH_LIBS="$LIBM" + fi + fi + + if test ${ac_cv_sizeof___float128} -gt 0 + then + OLDLIBS="$LIBS" + LIBS="$LIBM $LIBS" + for ac_func in powq fmodq sinq cosq tanq sinhq coshq tanhq asinq acosq atanq atan2q logq log10q expq sqrtq ceilq floorq roundq +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + for ac_func in strtoflt128 +do : + ac_fn_c_check_func "$LINENO" "strtoflt128" "ac_cv_func_strtoflt128" +if test "x$ac_cv_func_strtoflt128" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRTOFLT128 1 +_ACEOF + +fi +done + + LIBS="$OLDLIBS" + fi +fi + + + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF_CHAR ${ac_cv_sizeof_char} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF_SHORT ${ac_cv_sizeof_short} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF_INT ${ac_cv_sizeof_int} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF_LONG ${ac_cv_sizeof_long} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF_LONG_LONG ${ac_cv_sizeof_long_long} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF___INT8 ${ac_cv_sizeof___int8} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF___INT16 ${ac_cv_sizeof___int16} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF___INT32 ${ac_cv_sizeof___int32} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF___INT64 ${ac_cv_sizeof___int64} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF___INT128 ${ac_cv_sizeof___int128} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF___INT128_T ${ac_cv_sizeof___int128_t} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF___UINT128_T ${ac_cv_sizeof___uint128_t} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF_VOID_P ${ac_cv_sizeof_void_p} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF_FLOAT ${ac_cv_sizeof_float} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF_DOUBLE ${ac_cv_sizeof_double} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF_LONG_DOUBLE ${ac_cv_sizeof_long_double} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF___FLOAT128 ${ac_cv_sizeof___float128} +_ACEOF + + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF_WCHAR_T ${ac_cv_sizeof_wchar_t} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF_OFF_T ${ac_cv_sizeof_off_t} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF_OFF64_T ${ac_cv_sizeof_off64_t} +_ACEOF + + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF_MBSTATE_T ${ac_cv_sizeof_mbstate_t} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_MBLEN_MAX ${ax_cv_numvalof_MB_LEN_MAX} +_ACEOF + +if test ${ax_cv_numvalof_PATH_MAX} -gt 0 +then + +cat >>confdefs.h <<_ACEOF +#define HAWK_PATH_MAX ${ax_cv_numvalof_PATH_MAX} +_ACEOF + +fi + +cat >>confdefs.h <<_ACEOF +#define HAWK_NSIG ${ax_cv_numvalof_NSIG} +_ACEOF + + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF_STRUCT_SOCKADDR_IN ${ac_cv_sizeof_struct_sockaddr_in} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF_STRUCT_SOCKADDR_IN6 ${ac_cv_sizeof_struct_sockaddr_in6} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF_STRUCT_SOCKADDR_LL ${ac_cv_sizeof_struct_sockaddr_ll} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF_STRUCT_SOCKADDR_UN ${ac_cv_sizeof_struct_sockaddr_un} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF_STRUCT_SOCKADDR_DL ${ac_cv_sizeof_struct_sockaddr_dl} +_ACEOF + + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF_SOCKLEN_T ${ac_cv_sizeof_socklen_t} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF_SA_FAMILY_T ${ac_cv_sizeof_sa_family_t} +_ACEOF + + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF_PTHREAD_T ${ac_cv_sizeof_pthread_t} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF_PTHREAD_MUTEX_T ${ac_cv_sizeof_pthread_mutex_t} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_SIZEOF_PTHREAD_COND_T ${ac_cv_sizeof_pthread_cond_t} +_ACEOF + + +hawk_package_version_major="`echo ${PACKAGE_VERSION} | cut -d. -f1`" +hawk_package_version_minor="`echo ${PACKAGE_VERSION} | cut -d. -f2`" +hawk_package_version_patch="`echo ${PACKAGE_VERSION} | cut -d. -f3`" +PACKAGE_VERSION_MAJOR=${hawk_package_version_major} + +PACKAGE_VERSION_MINOR=${hawk_package_version_minor} + +PACKAGE_VERSION_PATCH=${hawk_package_version_patch} + + + +cat >>confdefs.h <<_ACEOF +#define HAWK_PACKAGE_VERSION "${PACKAGE_VERSION}" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_PACKAGE_VERSION_MAJOR ${hawk_package_version_major} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_PACKAGE_VERSION_MINOR ${hawk_package_version_minor} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_PACKAGE_VERSION_PATCH ${hawk_package_version_patch} +_ACEOF + + + +cat >>confdefs.h <<_ACEOF +#define HAWK_PACKAGE_AUTHOR "${PACKAGE_BUGREPORT}" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_PACKAGE_NAME "${PACKAGE_NAME}" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_PACKAGE_URL "${PACKAGE_URL}" +_ACEOF + + + +hawk_package_version_major="`echo ${PACKAGE_VERSION} | cut -d. -f1`" +hawk_package_version_minor="`echo ${PACKAGE_VERSION} | cut -d. -f2`" +hawk_package_version_patch="`echo ${PACKAGE_VERSION} | cut -d. -f3`" +PACKAGE_VERSION_MAJOR=${hawk_package_version_major} + +PACKAGE_VERSION_MINOR=${hawk_package_version_minor} + +PACKAGE_VERSION_PATCH=${hawk_package_version_patch} + + + +cat >>confdefs.h <<_ACEOF +#define HAWK_PACKAGE_VERSION "${PACKAGE_VERSION}" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_PACKAGE_VERSION_MAJOR ${hawk_package_version_major} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_PACKAGE_VERSION_MINOR ${hawk_package_version_minor} +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_PACKAGE_VERSION_PATCH ${hawk_package_version_patch} +_ACEOF + + + +cat >>confdefs.h <<_ACEOF +#define HAWK_PACKAGE_AUTHOR "${PACKAGE_BUGREPORT}" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_PACKAGE_NAME "${PACKAGE_NAME}" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define HAWK_PACKAGE_URL "${PACKAGE_URL}" +_ACEOF + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + +$as_echo "#define HAWK_ENDIAN_BIG /**/" >>confdefs.h +;; #( + no) + +$as_echo "#define HAWK_ENDIAN_LITTLE /**/" >>confdefs.h + ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + +$as_echo "#define HAWK_ENDIAN_UNKNOWN /**/" >>confdefs.h + ;; + esac + + +# Check whether --enable-experimental was given. +if test "${enable_experimental+set}" = set; then : + enableval=$enable_experimental; enable_experimental_is=$enableval +else + enable_experimental_is=no +fi + + if test "${enable_experimental_is}" = "yes" ; then + ENABLE_EXPERIMENTAL_TRUE= + ENABLE_EXPERIMENTAL_FALSE='#' +else + ENABLE_EXPERIMENTAL_TRUE='#' + ENABLE_EXPERIMENTAL_FALSE= +fi + + +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; enable_debug_is=$enableval +else + enable_debug_is=no +fi + +if test "$enable_debug_is" = "yes" +then + CFLAGS="$CFLAGS -g -D_DEBUG -UNDEBUG -U_FORTIFY_SOURCE" + CXXFLAGS="$CXXFLAGS -g -D_DEBUG -UNDEBUG -U_FORTIFY_SOURCE" + +$as_echo "#define HAWK_BUILD_DEBUG 1" >>confdefs.h + + BUILD_MODE="debug" + +else + CFLAGS="$CFLAGS -DNDEBUG -U_DEBUG -U_FORTIFY_SOURCE" + CXXFLAGS="$CXXFLAGS -DNDEBUG -U_DEBUG -U_FORTIFY_SOURCE" + +$as_echo "#define HAWK_BUILD_RELEASE 1" >>confdefs.h + + BUILD_MODE="release" + +fi + +# Check whether --enable-unicode was given. +if test "${enable_unicode+set}" = set; then : + enableval=$enable_unicode; enable_unicode=$enableval +else + enable_unicode=yes + +fi + +if test "${enable_unicode}" = "yes:4" +then + +$as_echo "#define HAWK_UNICODE_SIZE 4" >>confdefs.h + + +$as_echo "#define HAWK_ENABLE_UNICODE 1" >>confdefs.h + + if test "${platform_win32}" = "yes" + then + CFLAGS="$CFLAGS -DUNICODE -D_UNICODE" + CXXFLAGS="$CXXFLAGS -DUNICODE -D_UNICODE" + fi +elif test "${enable_unicode}" = "yes:2" +then + +$as_echo "#define HAWK_UNICODE_SIZE 2" >>confdefs.h + + +$as_echo "#define HAWK_ENABLE_UNICODE 1" >>confdefs.h + + if test "${platform_win32}" = "yes" + then + CFLAGS="$CFLAGS -DUNICODE -D_UNICODE" + CXXFLAGS="$CXXFLAGS -DUNICODE -D_UNICODE" + fi +elif test "${enable_unicode}" = "yes" +then + +$as_echo "#define HAWK_UNICODE_SIZE 1" >>confdefs.h + + +$as_echo "#define HAWK_ENABLE_UNICODE 1" >>confdefs.h + + if test "${platform_win32}" = "yes" + then + CFLAGS="$CFLAGS -DUNICODE -D_UNICODE" + CXXFLAGS="$CXXFLAGS -DUNICODE -D_UNICODE" + fi +elif test "${enable_unicode}" = "no:4" +then + +$as_echo "#define HAWK_UNICODE_SIZE 4" >>confdefs.h + +elif test "${enable_unicode}" = "no:2" +then + +$as_echo "#define HAWK_UNICODE_SIZE 2" >>confdefs.h + +else + +$as_echo "#define HAWK_UNICODE_SIZE 1" >>confdefs.h + +fi + +# Check whether --enable-full-liw was given. +if test "${enable_full_liw+set}" = set; then : + enableval=$enable_full_liw; enable_full_liw=$enableval +else + enable_full_liw=no + +fi + +if test "${enable_full_liw}" = "yes" +then + +$as_echo "#define HAWK_ENABLE_FULL_LIW 1" >>confdefs.h + +fi + +# Check whether --enable-intmax was given. +if test "${enable_intmax+set}" = set; then : + enableval=$enable_intmax; enable_intmax_is=$enableval +else + enable_intmax_is=no + +fi + +if test "${enable_intmax_is}" = "yes" +then + +$as_echo "#define HAWK_USE_INTMAX /**/" >>confdefs.h + +fi + +# Check whether --enable-fltmax was given. +if test "${enable_fltmax+set}" = set; then : + enableval=$enable_fltmax; enable_fltmax_is=$enableval +else + enable_fltmax_is=no + +fi + +if test "${enable_fltmax_is}" = "yes" +then + +$as_echo "#define HAWK_USE_FLTMAX /**/" >>confdefs.h + +fi + +# Check whether --enable-cxx was given. +if test "${enable_cxx+set}" = set; then : + enableval=$enable_cxx; enable_cxx_is=$enableval +else + enable_cxx_is=yes + +fi + +test "${HAVE_CXX}" = "yes" || enable_cxx_is="no" +test "${ax_cv_cxx_have_std_namespace}" = "yes" || enable_cxx_is="no" + + if test "${enable_cxx_is}" = "yes" ; then + ENABLE_CXX_TRUE= + ENABLE_CXX_FALSE='#' +else + ENABLE_CXX_TRUE='#' + ENABLE_CXX_FALSE= +fi + + +# Check whether --enable-dynamic-module was given. +if test "${enable_dynamic_module+set}" = set; then : + enableval=$enable_dynamic_module; enable_dynamic_module_is=$enableval +else + enable_dynamic_module_is=yes + +fi + +if test "x${enable_shared}" = "xno" +then + enable_dynamic_module_is="no" +fi + +if test "x${enable_dynamic_module_is}" = "xyes" +then + +$as_echo "#define HAWK_ENABLE_DYNAMIC_MODULE 1" >>confdefs.h + +fi + if test "x${enable_dynamic_module_is}" = "xyes"; then + ENABLE_DYNAMIC_MODULE_TRUE= + ENABLE_DYNAMIC_MODULE_FALSE='#' +else + ENABLE_DYNAMIC_MODULE_TRUE='#' + ENABLE_DYNAMIC_MODULE_FALSE= +fi + + +# Check whether --enable-static-module was given. +if test "${enable_static_module+set}" = set; then : + enableval=$enable_static_module; enable_static_module_is=$enableval +else + enable_static_module_is=no + +fi + +if test "x${enable_shared}" = "xno" -a "x${enable_static}" = "xyes" +then + enable_static_module_is="yes" +fi + +if test "${enable_static_module_is}" = "yes" +then + +$as_echo "#define HAWK_ENABLE_STATIC_MODULE 1" >>confdefs.h + +fi + if test "x${enable_static_module_is}" = "xyes"; then + ENABLE_STATIC_MODULE_TRUE= + ENABLE_STATIC_MODULE_FALSE='#' +else + ENABLE_STATIC_MODULE_TRUE='#' + ENABLE_STATIC_MODULE_FALSE= +fi + + +# Check whether --enable-libltdl was given. +if test "${enable_libltdl+set}" = set; then : + enableval=$enable_libltdl; enable_libltdl_is=$enableval +else + enable_libltdl_is=no + +fi + +if test "x${enable_libltdl_is}" = "xyes" +then + if test "x${ac_cv_header_ltdl_h}" = "xyes" -a "${LTDL_LIBS}" != "" + then + +$as_echo "#define HAWK_ENABLE_LIBLTDL /**/" >>confdefs.h + + else + enable_libltdl_is="no" + fi +fi + if test "x${enable_libltdl_is}" = "xyes"; then + ENABLE_LIBLTDL_TRUE= + ENABLE_LIBLTDL_FALSE='#' +else + ENABLE_LIBLTDL_TRUE='#' + ENABLE_LIBLTDL_FALSE= +fi + + +# Check whether --enable-libunwind was given. +if test "${enable_libunwind+set}" = set; then : + enableval=$enable_libunwind; enable_libunwind_is=$enableval +else + enable_libunwind_is=no + +fi + +if test "x${enable_libunwind_is}" = "xyes" +then + if test "x${ac_cv_header_libunwind_h}" = "xyes" -a "${UNWIND_LIBS}" != "" + then + +$as_echo "#define HAWK_ENABLE_LIBUNWIND /**/" >>confdefs.h + + else + enable_libunwind_is="no" + fi +fi + if test "x${enable_libunwind_is}" = "xyes"; then + ENABLE_LIBUNWIND_TRUE= + ENABLE_LIBUNWIND_FALSE='#' +else + ENABLE_LIBUNWIND_TRUE='#' + ENABLE_LIBUNWIND_FALSE= +fi + + + + +# Check whether --enable-mod-mysql was given. +if test "${enable_mod_mysql+set}" = set; then : + enableval=$enable_mod_mysql; enable_mod_mysql_is=$enableval +else + enable_mod_mysql_is=yes + +fi + +if test "${enable_mod_mysql_is}" = "yes" +then + +$as_echo "#define HAWK_ENABLE_MOD_MYSQL 1" >>confdefs.h + +fi + if test "${enable_mod_mysql_is}" = "yes"; then + ENABLE_MOD_MYSQL_TRUE= + ENABLE_MOD_MYSQL_FALSE='#' +else + ENABLE_MOD_MYSQL_TRUE='#' + ENABLE_MOD_MYSQL_FALSE= +fi + + +# Check whether --enable-mod-uci was given. +if test "${enable_mod_uci+set}" = set; then : + enableval=$enable_mod_uci; enable_mod_uci_is=$enableval +else + enable_mod_uci_is=yes + +fi + +if test "${enable_mod_uci_is}" = "yes" +then + +$as_echo "#define HAWK_ENABLE_MOD_UCI 1" >>confdefs.h + +fi + if test "${enable_mod_uci_is}" = "yes"; then + ENABLE_MOD_UCI_TRUE= + ENABLE_MOD_UCI_FALSE='#' +else + ENABLE_MOD_UCI_TRUE='#' + ENABLE_MOD_UCI_FALSE= +fi + + + +HAWK_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t + +HAWK_SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long + +HAWK_SIZEOF_LONG=$ac_cv_sizeof_long + +HAWK_SIZEOF_INT=$ac_cv_sizeof_int + +HAWK_SIZEOF_SHORT=$ac_cv_sizeof_short + +HAWK_SIZEOF_CHAR=$ac_cv_sizeof_char + +HAWK_SIZEOF_VOID_P=$ac_cv_sizeof_void_p + +HAWK_SIZEOF_FLOAT=$ac_cv_sizeof_float + +HAWK_SIZEOF_DOUBLE=$ac_cv_sizeof_double + +HAWK_SIZEOF_LONG_DOUBLE=$ac_cv_sizeof_long_double + +HAWK_SIZEOF_OFF_T=$ac_cv_sizeof_off_t + +HAWK_SIZEOF_OFF64_T=$ac_cv_sizeof_off64_t + + +HAWK_PROJECT_AUTHOR="${PACKAGE_BUGREPORT}" + +HAWK_PROJECT_URL="${PACKAGE_URL}" + + +ac_config_files="$ac_config_files Makefile tools/Makefile lib/Makefile mod/Makefile bin/Makefile t/Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WIN32_TRUE}" && test -z "${WIN32_FALSE}"; then + as_fn_error $? "conditional \"WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${MACOSX_TRUE}" && test -z "${MACOSX_FALSE}"; then + as_fn_error $? "conditional \"MACOSX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +if test -z "${ENABLE_EXPERIMENTAL_TRUE}" && test -z "${ENABLE_EXPERIMENTAL_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_EXPERIMENTAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_CXX_TRUE}" && test -z "${ENABLE_CXX_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_CXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_DYNAMIC_MODULE_TRUE}" && test -z "${ENABLE_DYNAMIC_MODULE_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_DYNAMIC_MODULE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_STATIC_MODULE_TRUE}" && test -z "${ENABLE_STATIC_MODULE_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_STATIC_MODULE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_LIBLTDL_TRUE}" && test -z "${ENABLE_LIBLTDL_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_LIBLTDL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_LIBUNWIND_TRUE}" && test -z "${ENABLE_LIBUNWIND_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_LIBUNWIND\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_MOD_MYSQL_TRUE}" && test -z "${ENABLE_MOD_MYSQL_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_MOD_MYSQL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_MOD_UCI_TRUE}" && test -z "${ENABLE_MOD_UCI_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_MOD_UCI\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by hawk $as_me 0.9.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to . +hawk home page: ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +hawk config.status 0.9.0 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' +configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' +predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' +predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' +postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' +reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' +reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +OBJDUMP \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +DLLTOOL \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_import \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +lt_cv_nm_interface \ +nm_file_list_spec \ +lt_cv_truncate_bin \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib \ +compiler_lib_search_dirs \ +predep_objects \ +postdep_objects \ +predeps \ +postdeps \ +compiler_lib_search_path \ +LD_CXX \ +reload_flag_CXX \ +compiler_CXX \ +lt_prog_compiler_no_builtin_flag_CXX \ +lt_prog_compiler_pic_CXX \ +lt_prog_compiler_wl_CXX \ +lt_prog_compiler_static_CXX \ +lt_cv_prog_compiler_c_o_CXX \ +export_dynamic_flag_spec_CXX \ +whole_archive_flag_spec_CXX \ +compiler_needs_object_CXX \ +with_gnu_ld_CXX \ +allow_undefined_flag_CXX \ +no_undefined_flag_CXX \ +hardcode_libdir_flag_spec_CXX \ +hardcode_libdir_separator_CXX \ +exclude_expsyms_CXX \ +include_expsyms_CXX \ +file_list_spec_CXX \ +compiler_lib_search_dirs_CXX \ +predep_objects_CXX \ +postdep_objects_CXX \ +predeps_CXX \ +postdeps_CXX \ +compiler_lib_search_path_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +configure_time_dlsearch_path \ +configure_time_lt_sys_library_path \ +reload_cmds_CXX \ +old_archive_cmds_CXX \ +old_archive_from_new_cmds_CXX \ +old_archive_from_expsyms_cmds_CXX \ +archive_cmds_CXX \ +archive_expsym_cmds_CXX \ +module_cmds_CXX \ +module_expsym_cmds_CXX \ +export_symbols_cmds_CXX \ +prelink_cmds_CXX \ +postlink_cmds_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' + +# See if we are running on zsh, and set the options that allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + RM='$RM' + ofile='$ofile' + + + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "lib/hawk-cfg.h") CONFIG_HEADERS="$CONFIG_HEADERS lib/hawk-cfg.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; + "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; + "mod/Makefile") CONFIG_FILES="$CONFIG_FILES mod/Makefile" ;; + "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;; + "t/Makefile") CONFIG_FILES="$CONFIG_FILES t/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$am_mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? + done + if test $am_rc -ne 0; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options that allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + + cfgfile=${ofile}T + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL +# Generated automatically by $as_me ($PACKAGE) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +# The names of the tagged configurations supported by this script. +available_tags='CXX ' + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shared archive member basename,for filename based shared library versioning on AIX. +shared_archive_member_spec=$shared_archive_member_spec + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# An object symbol dumper. +OBJDUMP=$lt_OBJDUMP + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm into a list of symbols to manually relocate. +global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# The name lister interface. +nm_interface=$lt_lt_cv_nm_interface + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and where our libraries should be installed. +lt_sysroot=$lt_sysroot + +# Command to truncate a binary pipe. +lt_truncate_bin=$lt_lt_cv_truncate_bin + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Detected run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path + +# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. +configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects +postdep_objects=$lt_postdep_objects +predeps=$lt_predeps +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# ### END LIBTOOL CONFIG + +_LT_EOF + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain=$ac_aux_dir/ltmain.sh + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + + cat <<_LT_EOF >> "$ofile" + +# ### BEGIN LIBTOOL TAG CONFIG: CXX + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# How to create reloadable object files. +reload_flag=$lt_reload_flag_CXX +reload_cmds=$lt_reload_cmds_CXX + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds_CXX + +# A language specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU compiler? +with_gcc=$GCC_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object_CXX + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld_CXX + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute_CXX + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath_CXX + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_CXX + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_CXX + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_CXX + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects_CXX +postdep_objects=$lt_postdep_objects_CXX +predeps=$lt_predeps_CXX +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# ### END LIBTOOL TAG CONFIG: CXX +_LT_EOF + + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + + +echo +echo "-[SUMMARY]---------------------------------------------------------------" +echo "Configured for ${host}" +echo " Build mode : ${BUILD_MODE}" +echo " Source directory: ${srcdir}" +echo " Installation directory: ${prefix}" +echo " C compiler: ${CC} ${CFLAGS}" +echo " C++ compiler: ${CXX} ${CXXFLAGS}" +echo " C++ support: ${enable_cxx_is}" +echo " Math library: ${LIBM}" +echo " Socket library: ${SOCKET_LIBS}" +echo " Native function call library: ${FFI_LIBS} ${DYNCALL_LIBS}" +echo " Thraed library: ${PTHREAD_LIBS}" +echo "-------------------------------------------------------------------------" + diff --git a/hawk/configure.ac b/hawk/configure.ac new file mode 100644 index 00000000..62680ca7 --- /dev/null +++ b/hawk/configure.ac @@ -0,0 +1,947 @@ +dnl AC_PREREQ([2.67]) + +AC_INIT([hawk],[0.9.0],[Chung, Hyung-Hwan (hyunghwan.chung@gmail.com)],[],[https://code.miflux.net/@hawk]) + +AC_CONFIG_HEADER([lib/hawk-cfg.h]) +AC_CONFIG_AUX_DIR([ac]) +AC_CONFIG_MACRO_DIR([m4]) + +dnl use CC and CPP for compilation tests with .c test programs. +AC_LANG(C) + +dnl initialize automake +AM_INIT_AUTOMAKE([-Wall -Werror subdir-objects foreign]) +AM_PROG_AR + +dnl enable silent rules if automake supports them. +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])]) +dnl m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +dnl determine a C compiler to use +AC_PROG_CC + +dnl determine a C++ compiler to use +AC_PROG_CXX + +dnl check if the C++ compiler exists in PATH +AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no) + +dnl check if the C++ compiler supports namespace +AX_CXX_NAMESPACE_STD + +dnl determine some key programs +AC_PROG_INSTALL +AC_PROG_EGREP +AC_PROG_LN_S +AC_PROG_SED + +dnl initialize libtool +LT_INIT +AC_SUBST(LIBTOOL_DEPS) + +dnl overrides the default CFLAGS setting +if test "$ac_test_CFLAGS" != "set" +then + if test "$GCC" = "yes" + then + CFLAGS="$CFLAGS -Wall" + fi +fi + +if test "$ac_test_CXXFLAGS" != "set" +then + if test "$GCC" = "yes" + then + CXXFLAGS="$CXXFLAGS -Wall" + fi +fi + +dnl indicate the existence of config.h +CFLAGS="$CFLAGS -DHAWK_HAVE_CFG_H" +CXXFLAGS="$CXXFLAGS -DHAWK_HAVE_CFG_H" + +dnl make visible the 64-bit interface to the file system +AC_SYS_LARGEFILE() + +dnl define the WIN32 conditional if necessary +case "$host" in +*-*-mingw*|*-*-cygwin*) + #CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0400" + platform_win32=yes + platform_macosx=no + ;; +*-*-darwin*) + platform_win32=no + platform_macosx=yes + ;; +*) + platform_win32=no + platform_macosx=no + ;; +esac +AM_CONDITIONAL(WIN32, test "x${platform_win32}" = "xyes" ) +AM_CONDITIONAL(MACOSX, test "x${platform_macosx}" = "xyes" ) + +dnl check the math library (check if -lm is needed) +LT_LIB_M +AC_SUBST(LIBM, $LIBM) + +AX_PTHREAD() + +dnl check some compiler builtins +AC_MSG_CHECKING([for __builtin_memset]) +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([], [__builtin_memset ((void*)1, ' ', 10);])], + [AC_MSG_RESULT(yes) + AC_DEFINE([HAVE___BUILTIN_MEMSET], [1], [__builtin_memset])], + [AC_MSG_RESULT(no)] +) + +AC_MSG_CHECKING([for __builtin_memcpy]) +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([], [__builtin_memcpy ((void*)1, (void*)2, 10);])], + [AC_MSG_RESULT(yes) + AC_DEFINE([HAVE___BUILTIN_MEMCPY], [1], [__builtin_memcpy])], + [AC_MSG_RESULT(no)] +) + +AC_MSG_CHECKING([for __builtin_memmove]) +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([], [__builtin_memmove ((void*)1, (void*)2, 10);])], + [AC_MSG_RESULT(yes) + AC_DEFINE([HAVE___BUILTIN_MEMMOVE], [1], [__builtin_memmove])], + [AC_MSG_RESULT(no)] +) + +AC_MSG_CHECKING([for __builtin_memcmp]) +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([], [int a = __builtin_memcmp ((void*)1, (void*)2, 10);])], + [AC_MSG_RESULT(yes) + AC_DEFINE([HAVE___BUILTIN_MEMCMP], [1], [__builtin_memcmp])], + [AC_MSG_RESULT(no)] +) + +AC_MSG_CHECKING([labels as values]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( [], [[void* jp[] = { &&jpt1, &&jpt2, &&jpt3 }; goto *jp[1]; jpt1: 1; jpt2: 2; jpt3: 3; ]])], + [AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_LABELS_AS_VALUES, 1, [labels as values])], + [AC_MSG_RESULT(no)] +) + +dnl check header files. +AC_HEADER_STDC +AC_CHECK_HEADERS([stddef.h wchar.h wctype.h errno.h signal.h fcntl.h dirent.h]) +AC_CHECK_HEADERS([time.h sys/time.h utime.h spawn.h execinfo.h ucontext.h]) +AC_CHECK_HEADERS([sys/resource.h sys/wait.h sys/syscall.h sys/ioctl.h]) +AC_CHECK_HEADERS([dlfcn.h ltdl.h sys/mman.h]) +AC_CHECK_HEADERS([sys/devpoll.h sys/epoll.h poll.h sys/event.h]) +AC_CHECK_HEADERS([netinet/in.h sys/un.h netpacket/packet.h net/if_dl.h]) +AC_CHECK_HEADERS([ffi.h dyncall.h libunwind.h quadmath.h]) + +dnl check data types +dnl AC_CHECK_TYPE([wchar_t], +dnl [ AC_DEFINE([HAVE_WCHAR_T_IN_STDDEF_H], +dnl [],[wchar_t is available in stddef.h]) ], +dnl [], +dnl [#include ]) + +dnl check functions +AC_CHECK_FUNCS([gettimeofday settimeofday clock_gettime clock_settime getitimer setitimer]) +AC_CHECK_FUNCS([backtrace backtrace_symbols]) +AC_CHECK_FUNCS([makecontext swapcontext getcontext setcontext]) +AC_CHECK_FUNCS([clock_nanosleep nanosleep usleep]) +AC_CHECK_FUNCS([localtime_r gmtime_r]) +AC_CHECK_FUNCS([sigaction signal]) +AC_CHECK_FUNCS([snprintf _vsnprintf _vsnwprintf strerror_r]) +AC_CHECK_FUNCS([accept4 pipe2 epoll_create epoll_create1 kqueue kqueue1]) +AC_CHECK_FUNCS([isatty mmap munmap]) +AC_CHECK_FUNCS([readdir64 dirfd faccessat]) +AC_CHECK_FUNCS([stat64 fstat64 lstat64 fstatat64 fstat fstatat]) + +OLDLIBS="$LIBS" +LIBS="$LIBM $LIBS" +AC_CHECK_FUNCS([powl fmodl sinl cosl tanl sinhl coshl tanhl asinl acosl atanl atan2l logl log2l log10l expl sqrtl ceill floorl roundl]) +AC_CHECK_FUNCS([pow fmod sin cos tan sinh cosh tanh asin acos atan atan2 log log2 log10 exp sqrt ceil floor round]) +AC_CHECK_FUNCS([powf fmodf sinf cosf tanf sinhf coshf tanhf asinf acosf atanf atan2f logf log2f log10f expf sqrtf ceilf floorf roundf]) +LIBS="$OLDLIBS" + +save_LIBS="$LIBS" +AC_SEARCH_LIBS([dlopen], [dl dld], [ + DL_LIBS="$ac_cv_search_dlopen" + if test "x${DL_LIBS}" = "xnone required" + then + DL_LIBS="" + fi +]) +LIBS="$save_LIBS" +AC_SUBST(DL_LIBS) + +save_LIBS="$LIBS" +AC_SEARCH_LIBS([lt_dlopen], [ltdl], [ + LTDL_LIBS="$ac_cv_search_lt_dlopen" + if test "x${LTDL_LIBS}" = "xnone required" + then + LTDL_LIBS="" + fi +]) +LIBS="$save_LIBS" +AC_SUBST(LTDL_LIBS) + +AC_CHECK_LIB([dyncall_s], [dcNewCallVM], + [ + DYNCALL_LIBS="-ldyncall_s" + AC_DEFINE([HAVE_DYNCALL_LIB], [1], [dyncall library is available]) + ] +) +AC_SUBST(DYNCALL_LIBS) + +AC_CHECK_LIB([ffi], [ffi_call], + [ + FFI_LIBS="-lffi" + AC_DEFINE([HAVE_FFI_LIB], [1], [libffi library is available]) + ] +) +AC_SUBST(FFI_LIBS) + +if test "x${ac_cv_header_libunwind_h}" = "xyes" +then + AC_CHECK_LIB([unwind], [unw_backtrace], + [ + UNWIND_LIBS="-lunwind" + AC_DEFINE([HAVE_UNWIND_LIB], [1], [libunwind is available]) + ] + ) + AC_SUBST(UNWIND_LIBS) +fi + +dnl OLDLIBS="$LIBS" +dnl AC_SEARCH_LIBS([connect], [socket]) +dnl LIBS="$OLDLIBS" +dnl if test "$ac_cv_search_connect" != "none required" -a "$ac_cv_search_connect" != "no" +dnl then +dnl SOCKET_LIBS="$SOCKET_LIBS -lsocket" +dnl fi +dnl AC_SUBST(SOCKET_LIBS) +AC_CHECK_FUNCS([connect gethostbyname]) +if test "x$ac_cv_func_gethostbyname" = "xno" +then + AC_CHECK_LIB([nsl], [gethostbyname], [ + SOCKET_LIBS="$SOCKET_LIBS -lnsl" + AC_DEFINE(HAVE_GETHOSTBYNAME, 1) + ]) +fi +if test "x$ac_cv_func_connect" = "xno" +then + AC_CHECK_LIB([socket], [connect], [ + SOCKET_LIBS="$SOCKET_LIBS -lsocket" + AC_DEFINE(HAVE_CONNECT, 1) + ]) + + if test "x$ac_cv_lib_socket_connect" = xno + then + AC_CHECK_FUNCS([t_connect]) + if test "x$ac_cv_func_t_connect" = "xno" + then + AC_CHECK_LIB([nsl_s], [t_connect], [ + SOCKET_LIBS="$SOCKET_LIBS -lnsl_s" + AC_DEFINE(HAVE_T_CONNECT, 1) + ]) + fi + fi +fi +if test "x${platform_win32}" = "xyes" +then + SOCKET_LIBS="$SOCKET_LIBS -lws2_32" +fi +AC_SUBST(SOCKET_LIBS) + + +AC_CHECK_LIB([pthread], [pthread_mutex_timedlock], [ + AC_DEFINE([HAVE_PTHREAD_MUTEX_TIMEDLOCK],1,[pthreads has pthread_mutex_timedlock()]) +]) +AC_CHECK_LIB([pthread], [pthread_mutex_trylock], [ + AC_DEFINE([HAVE_PTHREAD_MUTEX_TRYLOCK],1,[pthreads has pthread_mutex_trylock()]) +]) + +dnl check is the import library for unicows.dll exists +dnl this check doesn't look for a particular symbol +dnl but for the symbol 'main' since i want to check +dnl the existence of the libaray. +AC_CHECK_LIB([unicows], [main], [UNICOWS_LIBS="-lunicows"]) +AC_SUBST(UNICOWS_LIBS) + +AC_CHECK_LIB([rt], [clock_gettime], [LIBS="$LIBS -lrt"]) + +AC_MSG_CHECKING([for va_copy]) +AC_TRY_LINK( + [#include ], + [ + va_list x, y; + va_copy(x,y); + ], + [ + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_VA_COPY], [1], [va_copy is available]) + ], + [AC_MSG_RESULT(no)] +) + +AC_MSG_CHECKING([for __va_copy]) +AC_TRY_LINK( + [#include ], + [ + va_list x, y; + __va_copy(x,y); + ], + [ + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE___VA_COPY], [1], [__va_copy is available]) + ], + [AC_MSG_RESULT(no)] +) + +AC_MSG_CHECKING([for strftime %z]) +AC_TRY_RUN( + [#include + #if defined(HAVE_SYS_TIME_H) + #include + #endif + #if defined(HAVE_TIME_H) + #include + #endif + int main () + { + char buf[100]; + time_t t = 0; + strftime (buf, sizeof(buf), "%z", gmtime(&t)); + return (strcmp(buf, "%z") == 0 || strcmp(buf, "z") == 0)? 1: 0; + }], + [ + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_STRFTIME_SMALL_Z], [1], [strftime supports %z]) + ], + [AC_MSG_RESULT(no)], + [ + dnl cross-compiling, assume yes + AC_MSG_RESULT(unknown) + AC_DEFINE([HAVE_STRFTIME_SMALL_Z], [1], [strftime supports %z]) + ] +) + +dnl check struct members +AC_STRUCT_DIRENT_D_TYPE +AC_CHECK_MEMBERS([DIR.d_fd, DIR.dd_fd],,,[[#include ]]) + +dnl check the size of primitive data types +AC_CHECK_SIZEOF(char,,[[]]) +AC_CHECK_SIZEOF(short,,[[]]) +AC_CHECK_SIZEOF(int,,[[]]) +AC_CHECK_SIZEOF(long,,[[]]) +AC_CHECK_SIZEOF(long long,,[[]]) +AC_CHECK_SIZEOF(__int8,,[[]]) +AC_CHECK_SIZEOF(__int16,,[[]]) +AC_CHECK_SIZEOF(__int32,,[[]]) +AC_CHECK_SIZEOF(__int64,,[[]]) +AC_CHECK_SIZEOF(__int128,,[[]]) +AC_CHECK_SIZEOF(__int8_t,,[[]]) +AC_CHECK_SIZEOF(__int16_t,,[[]]) +AC_CHECK_SIZEOF(__int32_t,,[[]]) +AC_CHECK_SIZEOF(__int64_t,,[[]]) +AC_CHECK_SIZEOF(__int128_t,,[[]]) +AC_CHECK_SIZEOF(__uint128_t,,[[]]) +dnl AC_CHECK_SIZEOF doesn't work without white-space between void and * +AC_CHECK_SIZEOF(void *,,[[]]) +AC_CHECK_SIZEOF(float,,[[]]) +AC_CHECK_SIZEOF(double,,[[]]) +AC_CHECK_SIZEOF(long double,,[[]]) +AC_CHECK_SIZEOF(__float128,,[[]]) + +AC_CHECK_SIZEOF(wchar_t) +AC_CHECK_SIZEOF(off_t) +AC_CHECK_SIZEOF(off64_t) + +AC_CHECK_SIZEOF(mbstate_t,,[#include ]) +AX_CHECK_NUMVALOF(MB_LEN_MAX,[32],[#include ]) +AX_CHECK_NUMVALOF(PATH_MAX,[0],[#include ]) +AX_CHECK_NUMVALOF(NSIG,[32],[#include ]) + +if test "x${platform_win32}" = "xyes" +then + AC_CHECK_SIZEOF(struct sockaddr_in,,[ + #include + #include ]) + AC_CHECK_SIZEOF(struct sockaddr_in6,,[ + #include + #include ]) + AC_CHECK_SIZEOF(struct sockaddr_un,,[ + #include + #include ]) + AC_CHECK_SIZEOF(struct sockaddr_ll,,[ + #include + #include ]) + AC_CHECK_SIZEOF(struct sockaddr_dl,,[ + #include + #include ]) + + AC_CHECK_SIZEOF(socklen_t,, [ + #include + #include ]) + if test ${ac_cv_sizeof_socklen_t} -gt 0 + then + AX_CHECK_SIGN([socklen_t], + [ AC_DEFINE(HAWK_SOCKLEN_T_IS_SIGNED, 1, [Define if socklen_t is signed]) ], + [ AS_ECHO_N("") ], + [#include + #include ]) + fi + + AC_CHECK_SIZEOF(sa_family_t,, [ + #include + #include ]) + if test ${ac_cv_sizeof_sa_family_t} -gt 0 + then + AX_CHECK_SIGN([sa_family_t], + [ AC_DEFINE(HAWK_SA_FAMILY_T_IS_SIGNED, 1, [Define if sa_family_t is signed]) ], + [ AS_ECHO_N("") ], + [#include + #include ]) + fi + + AC_MSG_CHECKING([offset of sa_family in struct sockaddr]) + AC_COMPUTE_INT([ac_cv_offsetof_sa_family], + [[offsetof(struct sockaddr, sa_family)]], + [#include + #include + #include ], [ac_cv_offsteof_sa_family=0]) + AC_MSG_RESULT([$ac_cv_offsetof_sa_family]) + AC_DEFINE_UNQUOTED(HAWK_OFFSETOF_SA_FAMILY, ${ac_cv_offsetof_sa_family}, [offsetof(struct sockaddr, sa_family)]) + +else + AC_CHECK_SIZEOF(struct sockaddr_in,,[ + #include + #include + #include ]) + AC_CHECK_SIZEOF(struct sockaddr_in6,,[ + #include + #include + #include ]) + AC_CHECK_SIZEOF(struct sockaddr_un,,[ + #include + #include + #include ]) + AC_CHECK_SIZEOF(struct sockaddr_ll,,[ + #include + #include + #include ]) + AC_CHECK_SIZEOF(struct sockaddr_dl,,[ + #include + #include + #include ]) + + + AC_CHECK_SIZEOF(socklen_t,, [ + #include + #include ]) + if test ${ac_cv_sizeof_socklen_t} -gt 0 + then + AX_CHECK_SIGN([socklen_t], + [ AC_DEFINE(HAWK_SOCKLEN_T_IS_SIGNED, 1, [Define if socklen_t is signed]) ], + [ AS_ECHO_N("") ], + [#include + #include ]) + fi + + AC_CHECK_SIZEOF(sa_family_t,, [ + #include + #include + #include ]) + if test ${ac_cv_sizeof_sa_family_t} -gt 0 + then + AX_CHECK_SIGN([sa_family_t], + [ AC_DEFINE(HAWK_SA_FAMILY_T_IS_SIGNED, 1, [Define if sa_family_t is signed]) ], + [ AS_ECHO_N("") ], + [#include + #include + #include ]) + fi + + AC_MSG_CHECKING([offset of sa_family in struct sockaddr]) + AC_COMPUTE_INT([ac_cv_offsetof_sa_family], + [[offsetof(struct sockaddr, sa_family)]], + [#include + #include + #include ], [ac_cv_offsteof_sa_family=0]) + AC_MSG_RESULT([$ac_cv_offsetof_sa_family]) + AC_DEFINE_UNQUOTED(HAWK_OFFSETOF_SA_FAMILY, ${ac_cv_offsetof_sa_family}, [offsetof(struct sockaddr, sa_family)]) +fi + +AC_CHECK_SIZEOF(pthread_t,, [#include ]) +if test ${ac_cv_sizeof_pthread_t} -gt 0 +then + AX_CHECK_SIGN([pthread_t], + [AC_DEFINE(HAWK_PTHREAD_T_IS_SIGNED, 1, [Define if pthread_t is signed])], + [AS_ECHO_N("")], + [#include ]) +fi + +AC_CHECK_SIZEOF(pthread_mutex_t,, [#include ]) +if test ${ac_cv_sizeof_pthread_mutex_t} -gt 0 +then + AX_CHECK_SIGN([pthread_mutex_t], + [ AC_DEFINE(HAWK_PTHREAD_MUTEX_T_IS_SIGNED, 1, [Define if pthread_mutex_t is signed]) ], + [ AS_ECHO_N("") ], + [#include ]) +fi + +AC_CHECK_SIZEOF(pthread_cond_t,, [#include ]) +if test ${ac_cv_sizeof_pthread_cond_t} -gt 0 +then + AX_CHECK_SIGN([pthread_cond_t], + [ AC_DEFINE(HAWK_PTHREAD_MUTEX_T_IS_SIGNED, 1, [Define if pthread_cond_t is signed]) ], + [ AS_ECHO_N("") ], + [#include ]) +fi + +dnl gcc 3.4.3 on opensolaris x86 gave this warning without -msse or +dnl something similar. +dnl SSE vector argument without SSE enabled changes the ABI +dnl it also ended with an internal compiler error while compiling +dnl some expressions like 'v % base' where v is of the __int128_t type. +dnl so i've added this check to determine if the compiler has +dnl proper support for __int128_t. +dnl +dnl Changing ac_cv_sizeof___int128_t here doesn't corret SIZEOF___INT128_T +dnl since it's already generated. It only affects HAWK_SIZEOF___INT128_T below. +if test ${ac_cv_sizeof___int128_t} -gt 0 +then + AC_MSG_CHECKING([__int128_t with % and va_arg]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([#include ], [ + volatile __int128_t x, base; + va_list ap; + va_arg(ap, __int128_t); + x = (__int128_t)&base; + base = (__int128_t)&x; + x = x % base; + return (int)x; + ])], + + [ + AC_MSG_RESULT(yes) + ], + [ + AC_MSG_RESULT(no) + ac_cv_sizeof___int128_t=0 + ac_cv_sizeof___uint128_t=0 + ] + ) +fi + +dnl Some compilers doesn't seem to have full support for __float128 +dnl even if the type is available. +if test ${ac_cv_sizeof___float128} -gt 0 +then + AC_MSG_CHECKING([__float128 with linking]) + AC_TRY_LINK( + [#include ], + [ + __float128 x, y, z; + z = x * y + x; + printf ("%p", (char*)(int)z); + ], + [AC_MSG_RESULT(yes)], + [ + AC_MSG_RESULT(no) + ac_cv_sizeof___float128=0 + ] + ) +fi + +dnl Quadmath functions may not be in the default c library. +dnl Find a library containing them. Disable the float128 type +dnl if they are not available. +if test ${ac_cv_sizeof___float128} -gt 0 +then + AC_CHECK_FUNCS([quadmath_snprintf]) + if test "$ac_cv_func_quadmath_snprintf" = "no" + then + OLDLIBS="$LIBS" + LIBS="$LIBM $LIBS" + AC_CHECK_FUNCS([quadmath_snprintf]) + LIBS="$OLDLIBS" + + if test "$ac_cv_func_quadmath_snprintf" = "no" + then + dnl quadmath_snprintf not avalable in the + dnl standard math lib. + + AC_CHECK_LIB([quadmath], [quadmath_snprintf], [ + QUADMATH_LIBS="-lquadmath" + LIBM="$LIBM -lquadmath" + AC_DEFINE(HAVE_QUADMATH_SNPRINTF, 1) + ]) + + if test "$ac_cv_lib_quadmath_quadmath_snprintf" = "no" + then + dnl quadmath_snprintf not avalable in the + dnl quadmath lib. + + ac_cv_sizeof___float128=0 + fi + + else + QUADMATH_LIBS="$LIBM" + fi + fi + + if test ${ac_cv_sizeof___float128} -gt 0 + then + OLDLIBS="$LIBS" + LIBS="$LIBM $LIBS" + AC_CHECK_FUNCS([powq fmodq sinq cosq tanq sinhq coshq tanhq asinq acosq atanq atan2q logq log10q expq sqrtq ceilq floorq roundq]) + AC_CHECK_FUNCS([strtoflt128]) + LIBS="$OLDLIBS" + fi +fi +AC_SUBST(QUADMATH_LIBS) + + +AC_DEFINE_UNQUOTED(HAWK_SIZEOF_CHAR, ${ac_cv_sizeof_char}, [sizeof(char)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF_SHORT, ${ac_cv_sizeof_short}, [sizeof(short)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF_INT, ${ac_cv_sizeof_int}, [sizeof(int)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF_LONG, ${ac_cv_sizeof_long}, [sizeof(long)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF_LONG_LONG, ${ac_cv_sizeof_long_long}, [sizeof(long long)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF___INT8, ${ac_cv_sizeof___int8}, [sizeof(__int8)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF___INT16, ${ac_cv_sizeof___int16}, [sizeof(__int16)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF___INT32, ${ac_cv_sizeof___int32}, [sizeof(__int32)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF___INT64, ${ac_cv_sizeof___int64}, [sizeof(__int64)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF___INT128, ${ac_cv_sizeof___int128}, [sizeof(__int128)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF___INT128_T, ${ac_cv_sizeof___int128_t}, [sizeof(__int128_t)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF___UINT128_T, ${ac_cv_sizeof___uint128_t}, [sizeof(__uint128_t)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF_VOID_P, ${ac_cv_sizeof_void_p}, [sizeof(void*)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF_FLOAT, ${ac_cv_sizeof_float}, [sizeof(float)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF_DOUBLE, ${ac_cv_sizeof_double}, [sizeof(double)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF_LONG_DOUBLE, ${ac_cv_sizeof_long_double}, [sizeof(long double)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF___FLOAT128, ${ac_cv_sizeof___float128}, [sizeof(__float128)]) + +AC_DEFINE_UNQUOTED(HAWK_SIZEOF_WCHAR_T, ${ac_cv_sizeof_wchar_t}, [sizeof(wchar_t)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF_OFF_T, ${ac_cv_sizeof_off_t}, [sizeof(off_t)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF_OFF64_T, ${ac_cv_sizeof_off64_t}, [sizeof(off64_t)]) + +AC_DEFINE_UNQUOTED(HAWK_SIZEOF_MBSTATE_T, ${ac_cv_sizeof_mbstate_t}, [sizeof(mbstate_t)]) +AC_DEFINE_UNQUOTED(HAWK_MBLEN_MAX, ${ax_cv_numvalof_MB_LEN_MAX}, [MB_LEN_MAX]) +if test ${ax_cv_numvalof_PATH_MAX} -gt 0 +then + AC_DEFINE_UNQUOTED(HAWK_PATH_MAX, ${ax_cv_numvalof_PATH_MAX}, [PATH_MAX]) +fi +AC_DEFINE_UNQUOTED(HAWK_NSIG, ${ax_cv_numvalof_NSIG}, [NSIG]) + +AC_DEFINE_UNQUOTED(HAWK_SIZEOF_STRUCT_SOCKADDR_IN, ${ac_cv_sizeof_struct_sockaddr_in}, [sizeof(struct sockaddr_in)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF_STRUCT_SOCKADDR_IN6, ${ac_cv_sizeof_struct_sockaddr_in6}, [sizeof(struct sockaddr_in6)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF_STRUCT_SOCKADDR_LL, ${ac_cv_sizeof_struct_sockaddr_ll}, [sizeof(struct sockaddr_ll)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF_STRUCT_SOCKADDR_UN, ${ac_cv_sizeof_struct_sockaddr_un}, [sizeof(struct sockaddr_un)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF_STRUCT_SOCKADDR_DL, ${ac_cv_sizeof_struct_sockaddr_dl}, [sizeof(struct sockaddr_dl)]) + +AC_DEFINE_UNQUOTED(HAWK_SIZEOF_SOCKLEN_T, ${ac_cv_sizeof_socklen_t}, [sizeof(socklen_t)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF_SA_FAMILY_T, ${ac_cv_sizeof_sa_family_t}, [sizeof(sa_family_t)]) + +AC_DEFINE_UNQUOTED(HAWK_SIZEOF_PTHREAD_T, ${ac_cv_sizeof_pthread_t}, [sizeof(pthread_t)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF_PTHREAD_MUTEX_T, ${ac_cv_sizeof_pthread_mutex_t}, [sizeof(pthread_mutex_t)]) +AC_DEFINE_UNQUOTED(HAWK_SIZEOF_PTHREAD_COND_T, ${ac_cv_sizeof_pthread_cond_t}, [sizeof(pthread_cond_t)]) + +hawk_package_version_major="`echo ${PACKAGE_VERSION} | cut -d. -f1`" +hawk_package_version_minor="`echo ${PACKAGE_VERSION} | cut -d. -f2`" +hawk_package_version_patch="`echo ${PACKAGE_VERSION} | cut -d. -f3`" +AC_SUBST(PACKAGE_VERSION_MAJOR, ${hawk_package_version_major}) +AC_SUBST(PACKAGE_VERSION_MINOR, ${hawk_package_version_minor}) +AC_SUBST(PACKAGE_VERSION_PATCH, ${hawk_package_version_patch}) + +AC_DEFINE_UNQUOTED(HAWK_PACKAGE_VERSION, "${PACKAGE_VERSION}", [Package version]) +dnl AC_DEFINE_UNQUOTED(HAWK_PACKAGE_VERSION_MAJOR, $(echo ${VERSION} | cut -d. -f1), [Major version number]) +dnl AC_DEFINE_UNQUOTED(HAWK_PACKAGE_VERSION_MINOR, $(echo ${VERSION} | cut -d. -f2), [Minor version number]) +dnl AC_DEFINE_UNQUOTED(HAWK_PACKAGE_VERSION_PATCH, $(echo ${VERSION} | cut -d. -f3), [Patch level]) +AC_DEFINE_UNQUOTED(HAWK_PACKAGE_VERSION_MAJOR, ${hawk_package_version_major}, [Major version number]) +AC_DEFINE_UNQUOTED(HAWK_PACKAGE_VERSION_MINOR, ${hawk_package_version_minor}, [Minor version number]) +AC_DEFINE_UNQUOTED(HAWK_PACKAGE_VERSION_PATCH, ${hawk_package_version_patch}, [Patch level]) + +AC_DEFINE_UNQUOTED(HAWK_PACKAGE_AUTHOR,"${PACKAGE_BUGREPORT}", [Author]) +AC_DEFINE_UNQUOTED(HAWK_PACKAGE_NAME,"${PACKAGE_NAME}", [package name]) +AC_DEFINE_UNQUOTED(HAWK_PACKAGE_URL, "${PACKAGE_URL}", [Project URL]) + + +hawk_package_version_major="`echo ${PACKAGE_VERSION} | cut -d. -f1`" +hawk_package_version_minor="`echo ${PACKAGE_VERSION} | cut -d. -f2`" +hawk_package_version_patch="`echo ${PACKAGE_VERSION} | cut -d. -f3`" +AC_SUBST(PACKAGE_VERSION_MAJOR, ${hawk_package_version_major}) +AC_SUBST(PACKAGE_VERSION_MINOR, ${hawk_package_version_minor}) +AC_SUBST(PACKAGE_VERSION_PATCH, ${hawk_package_version_patch}) + +AC_DEFINE_UNQUOTED(HAWK_PACKAGE_VERSION, "${PACKAGE_VERSION}", [Package version]) +dnl AC_DEFINE_UNQUOTED(HAWK_PACKAGE_VERSION_MAJOR, $(echo ${VERSION} | cut -d. -f1), [Major version number]) +dnl AC_DEFINE_UNQUOTED(HAWK_PACKAGE_VERSION_MINOR, $(echo ${VERSION} | cut -d. -f2), [Minor version number]) +dnl AC_DEFINE_UNQUOTED(HAWK_PACKAGE_VERSION_PATCH, $(echo ${VERSION} | cut -d. -f3), [Patch level]) +AC_DEFINE_UNQUOTED(HAWK_PACKAGE_VERSION_MAJOR, ${hawk_package_version_major}, [Major version number]) +AC_DEFINE_UNQUOTED(HAWK_PACKAGE_VERSION_MINOR, ${hawk_package_version_minor}, [Minor version number]) +AC_DEFINE_UNQUOTED(HAWK_PACKAGE_VERSION_PATCH, ${hawk_package_version_patch}, [Patch level]) + +AC_DEFINE_UNQUOTED(HAWK_PACKAGE_AUTHOR,"${PACKAGE_BUGREPORT}", [Author]) +AC_DEFINE_UNQUOTED(HAWK_PACKAGE_NAME,"${PACKAGE_NAME}", [package name]) +AC_DEFINE_UNQUOTED(HAWK_PACKAGE_URL, "${PACKAGE_URL}", [Project URL]) + +AC_C_BIGENDIAN( + [AC_DEFINE([HAWK_ENDIAN_BIG],[],[Big Endian])], + [AC_DEFINE([HAWK_ENDIAN_LITTLE],[],[Little Endian])], + [AC_DEFINE([HAWK_ENDIAN_UNKNOWN],[],[Unknown Endian])]) + +dnl ===== enable-experimental ===== +AC_ARG_ENABLE([experimental], + [AS_HELP_STRING([--enable-experimental],[enable experimental feature(default. no)])], + enable_experimental_is=$enableval, + enable_experimental_is=no) +AM_CONDITIONAL(ENABLE_EXPERIMENTAL, test "${enable_experimental_is}" = "yes" ) + +dnl ===== enable-debug ===== +AC_ARG_ENABLE([debug], + [AS_HELP_STRING([--enable-debug],[compile the code in the debug mode (default. no)])], + enable_debug_is=$enableval, + enable_debug_is=no) +if test "$enable_debug_is" = "yes" +then + [CFLAGS="$CFLAGS -g -D_DEBUG -UNDEBUG -U_FORTIFY_SOURCE"] + [CXXFLAGS="$CXXFLAGS -g -D_DEBUG -UNDEBUG -U_FORTIFY_SOURCE"] + AC_DEFINE([HAWK_BUILD_DEBUG],[1],[build release/debug]) + AC_SUBST(BUILD_MODE, "debug") +else + [CFLAGS="$CFLAGS -DNDEBUG -U_DEBUG -U_FORTIFY_SOURCE"] + [CXXFLAGS="$CXXFLAGS -DNDEBUG -U_DEBUG -U_FORTIFY_SOURCE"] + AC_DEFINE([HAWK_BUILD_RELEASE],[1],[build release/debug]) + AC_SUBST(BUILD_MODE, "release") +fi + +dnl ===== enable-unicode ===== +AC_ARG_ENABLE([unicode], + [AS_HELP_STRING([--enable-unicode],[Use the unicode character type as the default character type. one of yes, no, yes:2, yes:4, no:2, no:4 (default. yes)])], + enable_unicode=$enableval, + enable_unicode=yes +) +if test "${enable_unicode}" = "yes:4" +then + AC_DEFINE([HAWK_UNICODE_SIZE],[4],[Unicode character type size]) + AC_DEFINE([HAWK_ENABLE_UNICODE],[1],[Use the unicode character type as the default character type]) + if test "${platform_win32}" = "yes" + then + [CFLAGS="$CFLAGS -DUNICODE -D_UNICODE"] + [CXXFLAGS="$CXXFLAGS -DUNICODE -D_UNICODE"] + fi +elif test "${enable_unicode}" = "yes:2" +then + AC_DEFINE([HAWK_UNICODE_SIZE],[2],[Unicode character type size]) + AC_DEFINE([HAWK_ENABLE_UNICODE],[1],[Use the unicode character type as the default character type]) + if test "${platform_win32}" = "yes" + then + [CFLAGS="$CFLAGS -DUNICODE -D_UNICODE"] + [CXXFLAGS="$CXXFLAGS -DUNICODE -D_UNICODE"] + fi +elif test "${enable_unicode}" = "yes" +then + AC_DEFINE([HAWK_UNICODE_SIZE],[1],[Unicode character type size]) + AC_DEFINE([HAWK_ENABLE_UNICODE],[1],[Use the unicode character type as the default character type]) + if test "${platform_win32}" = "yes" + then + [CFLAGS="$CFLAGS -DUNICODE -D_UNICODE"] + [CXXFLAGS="$CXXFLAGS -DUNICODE -D_UNICODE"] + fi +elif test "${enable_unicode}" = "no:4" +then + AC_DEFINE([HAWK_UNICODE_SIZE],[4],[Unicode character type size]) +elif test "${enable_unicode}" = "no:2" +then + AC_DEFINE([HAWK_UNICODE_SIZE],[2],[Unicode character type size]) +else + AC_DEFINE([HAWK_UNICODE_SIZE],[1],[Unicode character type size]) +fi + +dnl ===== enable-full-liw ===== +AC_ARG_ENABLE([full-liw], + [AS_HELP_STRING([--enable-full-liw],[Use a full word as a large integer word (default. no)])], + enable_full_liw=$enableval, + enable_full_liw=no +) +if test "${enable_full_liw}" = "yes" +then + AC_DEFINE([HAWK_ENABLE_FULL_LIW],[1],[Use a full word as a large integer word]) +fi + +dnl ===== enable-intmax ====== +AC_ARG_ENABLE([intmax], + [AS_HELP_STRING([--enable-intmax],[use hawk_intmax_t for integers (default. no)])], + enable_intmax_is=$enableval, + enable_intmax_is=no +) +if test "${enable_intmax_is}" = "yes" +then + AC_DEFINE([HAWK_USE_INTMAX],[],[use hawk_intmax_t for integers]) +fi + +dnl ===== enable-fltmax ====== +AC_ARG_ENABLE([fltmax], + [AS_HELP_STRING([--enable-awk-fltmax],[use hawk_fltmax_t for floating-point numbers (default. no)])], + enable_fltmax_is=$enableval, + enable_fltmax_is=no +) +if test "${enable_fltmax_is}" = "yes" +then + AC_DEFINE([HAWK_USE_FLTMAX],[],[use hawk_fltmax_t for floating-point numbers]) +fi + +dnl ===== enable-cxx ===== +AC_ARG_ENABLE([cxx], + [AS_HELP_STRING([--enable-cxx],[build the library for C++ if a C++ compiler is available (default. yes)])], + enable_cxx_is=$enableval, + enable_cxx_is=yes +) +dnl disable c++ if no c++ compiler was found +test "${HAVE_CXX}" = "yes" || enable_cxx_is="no" +dnl disable c++ if the compiler is too old. +test "${ax_cv_cxx_have_std_namespace}" = "yes" || enable_cxx_is="no" + +AM_CONDITIONAL(ENABLE_CXX, test "${enable_cxx_is}" = "yes" ) + +dnl ===== enable-dynamic-module ===== +AC_ARG_ENABLE([dynamic-module], + [AS_HELP_STRING([--enable-dynamic-module],[enable dynamic module capability(default. yes)])], + enable_dynamic_module_is=$enableval, + enable_dynamic_module_is=yes +) +if test "x${enable_shared}" = "xno" +then + enable_dynamic_module_is="no" +fi + +if test "x${enable_dynamic_module_is}" = "xyes" +then + AC_DEFINE([HAWK_ENABLE_DYNAMIC_MODULE],[1],[enable dynamic module capability]) +fi +AM_CONDITIONAL(ENABLE_DYNAMIC_MODULE, test "x${enable_dynamic_module_is}" = "xyes") + +dnl ===== enable-static-module ===== +AC_ARG_ENABLE([static-module], + [AS_HELP_STRING([--enable-static-module],[build modules statically into the main library(default. no)])], + enable_static_module_is=$enableval, + enable_static_module_is=no +) +if test "x${enable_shared}" = "xno" -a "x${enable_static}" = "xyes" +then + enable_static_module_is="yes" +fi + +if test "${enable_static_module_is}" = "yes" +then + AC_DEFINE([HAWK_ENABLE_STATIC_MODULE],[1],[link modules statically into the main library]) +fi +AM_CONDITIONAL(ENABLE_STATIC_MODULE, test "x${enable_static_module_is}" = "xyes") + +dnl ===== enable-libltdl ===== +AC_ARG_ENABLE([libltdl], + [AS_HELP_STRING([--enable-libltdl],[use libltdl(default. no)])], + enable_libltdl_is=$enableval, + enable_libltdl_is=no +) +if test "x${enable_libltdl_is}" = "xyes" +then + if test "x${ac_cv_header_ltdl_h}" = "xyes" -a "${LTDL_LIBS}" != "" + then + AC_DEFINE([HAWK_ENABLE_LIBLTDL],[],[use libltdl when loading a dynamic module]) + else + enable_libltdl_is="no" + fi +fi +AM_CONDITIONAL(ENABLE_LIBLTDL, test "x${enable_libltdl_is}" = "xyes") + +dnl ===== enable-libunwind ===== +AC_ARG_ENABLE([libunwind], + [AS_HELP_STRING([--enable-libunwind],[use libunwind(default. no)])], + enable_libunwind_is=$enableval, + enable_libunwind_is=no +) +if test "x${enable_libunwind_is}" = "xyes" +then + if test "x${ac_cv_header_libunwind_h}" = "xyes" -a "${UNWIND_LIBS}" != "" + then + AC_DEFINE([HAWK_ENABLE_LIBUNWIND],[],[use libunwind for backtracing stack frames]) + else + enable_libunwind_is="no" + fi +fi +AM_CONDITIONAL(ENABLE_LIBUNWIND, test "x${enable_libunwind_is}" = "xyes") + + + +dnl ===== enable-mod-mysql ===== +AC_ARG_ENABLE([mod-mysql], + [AS_HELP_STRING([--enable-mod-mysql],[enable mod/mysql (default. yes)])], + enable_mod_mysql_is=$enableval, + enable_mod_mysql_is=yes +) +if test "${enable_mod_mysql_is}" = "yes" +then + AC_DEFINE([HAWK_ENABLE_MOD_MYSQL],[1],[build mod/mysql]) +fi +AM_CONDITIONAL(ENABLE_MOD_MYSQL, test "${enable_mod_mysql_is}" = "yes") + +dnl ===== enable-mod-uci ===== +AC_ARG_ENABLE([mod-uci], + [AS_HELP_STRING([--enable-mod-uci],[enable mod/uci (default. yes)])], + enable_mod_uci_is=$enableval, + enable_mod_uci_is=yes +) +if test "${enable_mod_uci_is}" = "yes" +then + AC_DEFINE([HAWK_ENABLE_MOD_UCI],[1],[build mod/uci]) +fi +AM_CONDITIONAL(ENABLE_MOD_UCI, test "${enable_mod_uci_is}" = "yes") + + +AC_SUBST(HAWK_SIZEOF_WCHAR_T, $ac_cv_sizeof_wchar_t) +AC_SUBST(HAWK_SIZEOF_LONG_LONG, $ac_cv_sizeof_long_long) +AC_SUBST(HAWK_SIZEOF_LONG, $ac_cv_sizeof_long) +AC_SUBST(HAWK_SIZEOF_INT, $ac_cv_sizeof_int) +AC_SUBST(HAWK_SIZEOF_SHORT, $ac_cv_sizeof_short) +AC_SUBST(HAWK_SIZEOF_CHAR, $ac_cv_sizeof_char) +AC_SUBST(HAWK_SIZEOF_VOID_P, $ac_cv_sizeof_void_p) +AC_SUBST(HAWK_SIZEOF_FLOAT, $ac_cv_sizeof_float) +AC_SUBST(HAWK_SIZEOF_DOUBLE, $ac_cv_sizeof_double) +AC_SUBST(HAWK_SIZEOF_LONG_DOUBLE, $ac_cv_sizeof_long_double) +AC_SUBST(HAWK_SIZEOF_OFF_T, $ac_cv_sizeof_off_t) +AC_SUBST(HAWK_SIZEOF_OFF64_T, $ac_cv_sizeof_off64_t) + +AC_SUBST(HAWK_PROJECT_AUTHOR, "${PACKAGE_BUGREPORT}") +AC_SUBST(HAWK_PROJECT_URL, "${PACKAGE_URL}") + +AC_CONFIG_FILES([ + Makefile + tools/Makefile + lib/Makefile + mod/Makefile + bin/Makefile + t/Makefile +]) +AC_OUTPUT + +[ +echo +echo "-[SUMMARY]---------------------------------------------------------------" +echo "Configured for ${host}" +echo " Build mode : ${BUILD_MODE}" +echo " Source directory: ${srcdir}" +echo " Installation directory: ${prefix}" +echo " C compiler: ${CC} ${CFLAGS}" +echo " C++ compiler: ${CXX} ${CXXFLAGS}" +echo " C++ support: ${enable_cxx_is}" +echo " Math library: ${LIBM}" +echo " Socket library: ${SOCKET_LIBS}" +echo " Native function call library: ${FFI_LIBS} ${DYNCALL_LIBS}" +echo " Thraed library: ${PTHREAD_LIBS}" +echo "-------------------------------------------------------------------------" +] diff --git a/hawk/lib/Hawk.cpp b/hawk/lib/Hawk.cpp new file mode 100644 index 00000000..5abb5b72 --- /dev/null +++ b/hawk/lib/Hawk.cpp @@ -0,0 +1,2453 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include "hawk-prv.h" + +///////////////////////////////// +HAWK_BEGIN_NAMESPACE(QSE) +///////////////////////////////// + +////////////////////////////////////////////////////////////////// +// Hawk::Source +////////////////////////////////////////////////////////////////// + +struct xtn_t +{ + Hawk* awk; + hawk_ecb_t ecb; +}; + +struct rxtn_t +{ + Hawk::Run* run; +}; + +Hawk::NoSource Hawk::Source::NONE; + +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE xtn_t* GET_XTN(hawk_t* awk) { return (xtn_t*)((hawk_uint8_t*)hawk_getxtn(awk) - HAWK_SIZEOF(xtn_t)); } +static HAWK_INLINE rxtn_t* GET_RXTN(hawk_rtx_t* rtx) { return (rxtn_t*)((hawk_uint8_t*)hawk_rtx_getxtn(rtx) - HAWK_SIZEOF(rxtn_t)); } +#else +#define GET_XTN(awk) ((xtn_t*)((hawk_uint8_t*)hawk_getxtn(awk) - HAWK_SIZEOF(xtn_t))) +#define GET_RXTN(rtx) ((rxtn_t*)((hawk_uint8_t*)hawk_rtx_getxtn(rtx) - HAWK_SIZEOF(rxtn_t))) +#endif + +////////////////////////////////////////////////////////////////// +// Hawk::RIO +////////////////////////////////////////////////////////////////// + +Hawk::RIOBase::RIOBase (Run* run, rio_arg_t* riod): run (run), riod (riod) +{ +} + +const Hawk::char_t* Hawk::RIOBase::getName () const +{ + return this->riod->name; +} + +const void* Hawk::RIOBase::getHandle () const +{ + return this->riod->handle; +} + +void Hawk::RIOBase::setHandle (void* handle) +{ + this->riod->handle = handle; +} + +int Hawk::RIOBase::getUflags () const +{ + return this->riod->uflags; +} + +void Hawk::RIOBase::setUflags (int uflags) +{ + this->riod->uflags = uflags; +} + +Hawk::RIOBase::operator Hawk* () const +{ + return this->run->awk; +} + +Hawk::RIOBase::operator Hawk::awk_t* () const +{ + HAWK_ASSERT (hawk_rtx_getawk(this->run->rtx) == this->run->awk->getHandle()); + return this->run->awk->getHandle(); +} + +Hawk::RIOBase::operator Hawk::rio_arg_t* () const +{ + return this->riod; +} + +Hawk::RIOBase::operator Hawk::Run* () const +{ + return this->run; +} + +Hawk::RIOBase::operator Hawk::rtx_t* () const +{ + return this->run->rtx; +} + +////////////////////////////////////////////////////////////////// +// Hawk::Pipe +////////////////////////////////////////////////////////////////// + +Hawk::Pipe::Pipe (Run* run, rio_arg_t* riod): RIOBase (run, riod) +{ +} + +Hawk::Pipe::Mode Hawk::Pipe::getMode () const +{ + return (Mode)riod->mode; +} + +Hawk::Pipe::CloseMode Hawk::Pipe::getCloseMode () const +{ + return (CloseMode)riod->rwcmode; +} + +////////////////////////////////////////////////////////////////// +// Hawk::File +////////////////////////////////////////////////////////////////// + +Hawk::File::File (Run* run, rio_arg_t* riod): RIOBase (run, riod) +{ +} + +Hawk::File::Mode Hawk::File::getMode () const +{ + return (Mode)riod->mode; +} + +////////////////////////////////////////////////////////////////// +// Hawk::Console +////////////////////////////////////////////////////////////////// + +Hawk::Console::Console (Run* run, rio_arg_t* riod): + RIOBase (run, riod), filename (HAWK_NULL) +{ +} + +Hawk::Console::~Console () +{ + if (filename != HAWK_NULL) + { + hawk_freemem ((awk_t*)this, filename); + } +} + +int Hawk::Console::setFileName (const char_t* name) +{ + if (this->getMode() == READ) + { + return hawk_rtx_setfilename ( + this->run->rtx, name, hawk_strlen(name)); + } + else + { + return hawk_rtx_setofilename ( + this->run->rtx, name, hawk_strlen(name)); + } +} + +int Hawk::Console::setFNR (int_t fnr) +{ + val_t* tmp; + int n; + + tmp = hawk_rtx_makeintval (this->run->rtx, fnr); + if (tmp == HAWK_NULL) return -1; + + hawk_rtx_refupval (this->run->rtx, tmp); + n = hawk_rtx_setgbl (this->run->rtx, HAWK_GBL_FNR, tmp); + hawk_rtx_refdownval (this->run->rtx, tmp); + + return n; +} + +Hawk::Console::Mode Hawk::Console::getMode () const +{ + return (Mode)riod->mode; +} + +////////////////////////////////////////////////////////////////// +// Hawk::Value +////////////////////////////////////////////////////////////////// + +Hawk::Value::IndexIterator Hawk::Value::IndexIterator::END; + +const Hawk::char_t* Hawk::Value::getEmptyStr() +{ + static const Hawk::char_t* EMPTY_STRING = HAWK_T(""); + return EMPTY_STRING; +} +const hawk_bch_t* Hawk::Value::getEmptyMbs() +{ + static const hawk_bch_t* EMPTY_STRING = HAWK_BT(""); + return EMPTY_STRING; +} + +Hawk::Value::IntIndex::IntIndex (int_t x) +{ + ptr = buf; + len = 0; + +#define NTOC(n) (HAWK_T("0123456789")[n]) + + int base = 10; + int_t last = x % base; + int_t y = 0; + int dig = 0; + + if (x < 0) buf[len++] = HAWK_T('-'); + + x = x / base; + if (x < 0) x = -x; + + while (x > 0) + { + y = y * base + (x % base); + x = x / base; + dig++; + } + + while (y > 0) + { + buf[len++] = NTOC (y % base); + y = y / base; + dig--; + } + + while (dig > 0) + { + dig--; + buf[len++] = HAWK_T('0'); + } + if (last < 0) last = -last; + buf[len++] = NTOC(last); + + buf[len] = HAWK_T('\0'); + +#undef NTOC +} + +#if defined(HAWK_VALUE_USE_IN_CLASS_PLACEMENT_NEW) +void* Hawk::Value::operator new (size_t n, Run* run) throw () +{ + void* ptr = hawk_rtx_allocmem (run->rtx, HAWK_SIZEOF(run) + n); + if (ptr == HAWK_NULL) return HAWK_NULL; + + *(Run**)ptr = run; + return (char*)ptr + HAWK_SIZEOF(run); +} + +void* Hawk::Value::operator new[] (size_t n, Run* run) throw () +{ + void* ptr = hawk_rtx_allocmem (run->rtx, HAWK_SIZEOF(run) + n); + if (ptr == HAWK_NULL) return HAWK_NULL; + + *(Run**)ptr = run; + return (char*)ptr + HAWK_SIZEOF(run); +} + +#if !defined(__BORLANDC__) && !defined(__WATCOMC__) +void Hawk::Value::operator delete (void* ptr, Run* run) +{ + // this placement delete is to be called when the constructor + // throws an exception and it's caught by the caller. + hawk_rtx_freemem (run->rtx, (char*)ptr - HAWK_SIZEOF(run)); +} + +void Hawk::Value::operator delete[] (void* ptr, Run* run) +{ + // this placement delete is to be called when the constructor + // throws an exception and it's caught by the caller. + hawk_rtx_freemem (run->rtx, (char*)ptr - HAWK_SIZEOF(run)); +} +#endif + +void Hawk::Value::operator delete (void* ptr) +{ + // this delete is to be called for normal destruction. + void* p = (char*)ptr - HAWK_SIZEOF(Run*); + hawk_rtx_freemem ((*(Run**)p)->rtx, p); +} + +void Hawk::Value::operator delete[] (void* ptr) +{ + // this delete is to be called for normal destruction. + void* p = (char*)ptr - HAWK_SIZEOF(Run*); + hawk_rtx_freemem ((*(Run**)p)->rtx, p); +} +#endif + +Hawk::Value::Value (): run (HAWK_NULL), val (hawk_get_awk_nil_val()) +{ + cached.str.ptr = HAWK_NULL; + cached.str.len = 0; + cached.mbs.ptr = HAWK_NULL; + cached.mbs.len = 0; +} + +Hawk::Value::Value (Run& run): run (&run), val (hawk_get_awk_nil_val()) +{ + cached.str.ptr = HAWK_NULL; + cached.str.len = 0; + cached.mbs.ptr = HAWK_NULL; + cached.mbs.len = 0; +} + +Hawk::Value::Value (Run* run): run (run), val (hawk_get_awk_nil_val()) +{ + cached.str.ptr = HAWK_NULL; + cached.str.len = 0; + cached.mbs.ptr = HAWK_NULL; + cached.mbs.len = 0; +} + +Hawk::Value::Value (const Value& v): run(v.run), val(v.val) +{ + if (run) hawk_rtx_refupval (run->rtx, val); + + cached.str.ptr = HAWK_NULL; + cached.str.len = 0; + cached.mbs.ptr = HAWK_NULL; + cached.mbs.len = 0; +} + +Hawk::Value::~Value () +{ + if (run != HAWK_NULL) + { + hawk_rtx_refdownval (run->rtx, val); + if (cached.str.ptr) hawk_rtx_freemem (run->rtx, cached.str.ptr); + if (cached.mbs.ptr) hawk_rtx_freemem (run->rtx, cached.mbs.ptr); + } +} + +Hawk::Value& Hawk::Value::operator= (const Value& v) +{ + if (this == &v) return *this; + + if (run) + { + hawk_rtx_refdownval (run->rtx, val); + if (cached.str.ptr) + { + hawk_rtx_freemem (run->rtx, cached.str.ptr); + cached.str.ptr = HAWK_NULL; + cached.str.len = 0; + } + if (cached.mbs.ptr) + { + hawk_rtx_freemem (run->rtx, cached.mbs.ptr); + cached.mbs.ptr = HAWK_NULL; + cached.mbs.len = 0; + } + } + + run = v.run; + val = v.val; + + if (run) hawk_rtx_refupval (run->rtx, val); + + return *this; +} + +void Hawk::Value::clear () +{ + if (run) + { + hawk_rtx_refdownval (run->rtx, val); + + if (cached.str.ptr) + { + hawk_rtx_freemem (run->rtx, cached.str.ptr); + cached.str.ptr = HAWK_NULL; + cached.str.len = 0; + } + if (cached.mbs.ptr) + { + hawk_rtx_freemem (run->rtx, cached.mbs.ptr); + cached.mbs.ptr = HAWK_NULL; + cached.mbs.len = 0; + } + + run = HAWK_NULL; + val = hawk_get_awk_nil_val(); + } +} + +Hawk::Value::operator Hawk::int_t () const +{ + int_t v; + if (this->getInt(&v) <= -1) v = 0; + return v; +} + +Hawk::Value::operator Hawk::flt_t () const +{ + flt_t v; + if (this->getFlt(&v) <= -1) v = 0.0; + return v; +} + +Hawk::Value::operator const Hawk::char_t* () const +{ + const Hawk::char_t* ptr; + size_t len; + if (Hawk::Value::getStr(&ptr, &len) <= -1) ptr = getEmptyStr(); + return ptr; +} + +#if defined(HAWK_OOCH_IS_UCH) +Hawk::Value::operator const hawk_bch_t* () const +{ + const hawk_bch_t* ptr; + size_t len; + if (Hawk::Value::getMbs(&ptr, &len) <= -1) ptr = getEmptyMbs(); + return ptr; +} +#endif + +int Hawk::Value::getInt (int_t* v) const +{ + int_t lv = 0; + + HAWK_ASSERT (this->val != HAWK_NULL); + + if (this->run) + { + int n = hawk_rtx_valtoint(this->run->rtx, this->val, &lv); + if (n <= -1) + { + run->awk->retrieveError (this->run); + return -1; + } + } + + *v = lv; + return 0; +} + +int Hawk::Value::getFlt (flt_t* v) const +{ + flt_t rv = 0; + + HAWK_ASSERT (this->val != HAWK_NULL); + + if (this->run) + { + int n = hawk_rtx_valtoflt(this->run->rtx, this->val, &rv); + if (n <= -1) + { + run->awk->retrieveError (this->run); + return -1; + } + } + + *v = rv; + return 0; +} + +int Hawk::Value::getNum (int_t* lv, flt_t* fv) const +{ + HAWK_ASSERT (this->val != HAWK_NULL); + + if (this->run) + { + int n = hawk_rtx_valtonum(this->run->rtx, this->val, lv, fv); + if (n <= -1) + { + run->awk->retrieveError (this->run); + return -1; + } + return n; + } + + *lv = 0; + return 0; +} + +int Hawk::Value::getStr (const char_t** str, size_t* len) const +{ + const char_t* p = getEmptyStr(); + size_t l = 0; + + HAWK_ASSERT (this->val != HAWK_NULL); + + if (this->run) + { + if (HAWK_RTX_GETVALTYPE(this->run->rtx, this->val) == HAWK_VAL_STR) + { + p = ((hawk_val_str_t*)this->val)->val.ptr; + l = ((hawk_val_str_t*)this->val)->val.len; + } + else + { + if (!cached.str.ptr) + { + hawk_rtx_valtostr_out_t out; + out.type = HAWK_RTX_VALTOSTR_CPLDUP; + if (hawk_rtx_valtostr(this->run->rtx, this->val, &out) <= -1) + { + run->awk->retrieveError (this->run); + return -1; + } + + p = out.u.cpldup.ptr; + l = out.u.cpldup.len; + + cached.str.ptr = out.u.cpldup.ptr; + cached.str.len = out.u.cpldup.len; + } + else + { + p = cached.str.ptr; + l = cached.str.len; + } + } + } + + *str = p; + *len = l; + + return 0; +} + +int Hawk::Value::getMbs (const hawk_bch_t** str, size_t* len) const +{ + const hawk_bch_t* p = getEmptyMbs(); + size_t l = 0; + + HAWK_ASSERT (this->val != HAWK_NULL); + + if (this->run) + { + if (HAWK_RTX_GETVALTYPE(this->run->rtx, this->val) == HAWK_VAL_MBS) + { + p = ((hawk_val_mbs_t*)this->val)->val.ptr; + l = ((hawk_val_mbs_t*)this->val)->val.len; + } + else + { + if (!cached.mbs.ptr) + { + p = hawk_rtx_valtobcstrdup(this->run->rtx, this->val, &l); + if (!p) + { + run->awk->retrieveError (this->run); + return -1; + } + + cached.mbs.ptr = (hawk_bch_t*)p; + cached.mbs.len = l; + } + else + { + p = cached.mbs.ptr; + l = cached.mbs.len; + } + } + } + + *str = p; + *len = l; + + return 0; +} + +int Hawk::Value::setVal (val_t* v) +{ + if (this->run == HAWK_NULL) + { + /* no runtime context assoicated. unfortunately, i can't + * set an error number for the same reason */ + return -1; + } + return this->setVal(this->run, v); +} + +int Hawk::Value::setVal (Run* r, val_t* v) +{ + if (this->run != HAWK_NULL) + { + hawk_rtx_refdownval (this->run->rtx, val); + if (cached.str.ptr) + { + hawk_rtx_freemem (this->run->rtx, cached.str.ptr); + cached.str.ptr = HAWK_NULL; + cached.str.len = 0; + } + if (cached.mbs.ptr) + { + hawk_rtx_freemem (this->run->rtx, cached.mbs.ptr); + cached.mbs.ptr = HAWK_NULL; + cached.mbs.len = 0; + } + } + + HAWK_ASSERT (cached.str.ptr == HAWK_NULL); + HAWK_ASSERT (cached.mbs.ptr == HAWK_NULL); + hawk_rtx_refupval (r->rtx, v); + + this->run = r; + this->val = v; + + return 0; +} + +int Hawk::Value::setInt (int_t v) +{ + if (this->run == HAWK_NULL) + { + /* no runtime context assoicated. unfortunately, i can't + * set an error number for the same reason */ + return -1; + } + return this->setInt(this->run, v); +} + +int Hawk::Value::setInt (Run* r, int_t v) +{ + val_t* tmp; + tmp = hawk_rtx_makeintval(r->rtx, v); + if (tmp == HAWK_NULL) + { + r->awk->retrieveError (r); + return -1; + } + + int n = this->setVal(r, tmp); + HAWK_ASSERT (n == 0); + return n; +} + +int Hawk::Value::setFlt (flt_t v) +{ + if (this->run == HAWK_NULL) + { + /* no runtime context assoicated. unfortunately, i can't + * set an error number for the same reason */ + return -1; + } + return this->setFlt(this->run, v); +} + +int Hawk::Value::setFlt (Run* r, flt_t v) +{ + val_t* tmp; + tmp = hawk_rtx_makefltval(r->rtx, v); + if (tmp == HAWK_NULL) + { + r->awk->retrieveError (r); + return -1; + } + + int n = this->setVal(r, tmp); + HAWK_ASSERT (n == 0); + return n; +} + +int Hawk::Value::setStr (const char_t* str, size_t len, bool numeric) +{ + if (this->run == HAWK_NULL) + { + /* no runtime context assoicated. unfortunately, i can't + * set an error number for the same reason */ + return -1; + } + return this->setStr(this->run, str, len, numeric); +} + +int Hawk::Value::setStr (Run* r, const char_t* str, size_t len, bool numeric) +{ + val_t* tmp; + + oocs_t oocs; + oocs.ptr = (char_t*)str; + oocs.len = len; + + tmp = numeric? hawk_rtx_makenstrvalwithoocs(r->rtx, &oocs): + hawk_rtx_makestrvalwithoocs(r->rtx, &oocs); + if (tmp == HAWK_NULL) + { + r->awk->retrieveError (r); + return -1; + } + + int n = this->setVal(r, tmp); + HAWK_ASSERT (n == 0); + return n; +} + +int Hawk::Value::setStr (const char_t* str, bool numeric) +{ + if (this->run == HAWK_NULL) return -1; + return this->setStr(this->run, str, numeric); +} + +int Hawk::Value::setStr (Run* r, const char_t* str, bool numeric) +{ + val_t* tmp; + tmp = numeric? hawk_rtx_makenstrvalwithoocstr(r->rtx, str): + hawk_rtx_makestrvalwithoocstr(r->rtx, str); + if (tmp == HAWK_NULL) + { + r->awk->retrieveError (r); + return -1; + } + + int n = this->setVal(r, tmp); + HAWK_ASSERT (n == 0); + return n; +} + + +int Hawk::Value::setMbs (const hawk_bch_t* str, size_t len) +{ + if (this->run == HAWK_NULL) + { + /* no runtime context assoicated. unfortunately, i can't + * set an error number for the same reason */ + return -1; + } + return this->setMbs(this->run, str, len); +} + +int Hawk::Value::setMbs (Run* r, const hawk_bch_t* str, size_t len) +{ + val_t* tmp; + + hawk_bcs_t oocs; + oocs.ptr = (hawk_bch_t*)str; + oocs.len = len; + + tmp = hawk_rtx_makembsvalwithbcs(r->rtx, &oocs); + if (!tmp) + { + r->awk->retrieveError (r); + return -1; + } + + int n = this->setVal(r, tmp); + HAWK_ASSERT (n == 0); + return n; +} + +int Hawk::Value::setMbs (const hawk_bch_t* str) +{ + if (this->run == HAWK_NULL) return -1; + return this->setMbs(this->run, str); +} + +int Hawk::Value::setMbs (Run* r, const hawk_bch_t* str) +{ + val_t* tmp; + tmp = hawk_rtx_makembsval(r->rtx, str, hawk_mbslen(str)); + if (!tmp) + { + r->awk->retrieveError (r); + return -1; + } + + int n = this->setVal(r, tmp); + HAWK_ASSERT (n == 0); + return n; +} + +int Hawk::Value::setIndexedVal (const Index& idx, val_t* v) +{ + if (this->run == HAWK_NULL) return -1; + return this->setIndexedVal (this->run, idx, v); +} + +int Hawk::Value::setIndexedVal (Run* r, const Index& idx, val_t* v) +{ + HAWK_ASSERT (r != HAWK_NULL); + + if (HAWK_RTX_GETVALTYPE (r->rtx, this->val) != HAWK_VAL_MAP) + { + // the previous value is not a map. + // a new map value needs to be created first. + val_t* map = hawk_rtx_makemapval(r->rtx); + if (map == HAWK_NULL) + { + r->awk->retrieveError (r); + return -1; + } + + hawk_rtx_refupval (r->rtx, map); + + // update the map with a given value + if (hawk_rtx_setmapvalfld(r->rtx, map, idx.ptr, idx.len, v) == HAWK_NULL) + { + hawk_rtx_refdownval (r->rtx, map); + r->awk->retrieveError (r); + return -1; + } + + // free the previous value + if (this->run) + { + // if val is not nil, this->run can't be NULL + hawk_rtx_refdownval (this->run->rtx, this->val); + } + + this->run = r; + this->val = map; + } + else + { + HAWK_ASSERT (run != HAWK_NULL); + + // if the previous value is a map, things are a bit simpler + // however it needs to check if the runtime context matches + // with the previous one. + if (this->run != r) + { + // it can't span across multiple runtime contexts + this->run->setError (HAWK_EINVAL); + this->run->awk->retrieveError (run); + return -1; + } + + // update the map with a given value + if (hawk_rtx_setmapvalfld(r->rtx, val, idx.ptr, idx.len, v) == HAWK_NULL) + { + r->awk->retrieveError (r); + return -1; + } + } + + return 0; +} + +int Hawk::Value::setIndexedInt (const Index& idx, int_t v) +{ + if (run == HAWK_NULL) return -1; + return this->setIndexedInt (run, idx, v); +} + +int Hawk::Value::setIndexedInt (Run* r, const Index& idx, int_t v) +{ + val_t* tmp = hawk_rtx_makeintval (r->rtx, v); + if (tmp == HAWK_NULL) + { + r->awk->retrieveError (r); + return -1; + } + + hawk_rtx_refupval (r->rtx, tmp); + int n = this->setIndexedVal(r, idx, tmp); + hawk_rtx_refdownval (r->rtx, tmp); + + return n; +} + +int Hawk::Value::setIndexedFlt (const Index& idx, flt_t v) +{ + if (run == HAWK_NULL) return -1; + return this->setIndexedFlt(run, idx, v); +} + +int Hawk::Value::setIndexedFlt (Run* r, const Index& idx, flt_t v) +{ + val_t* tmp = hawk_rtx_makefltval(r->rtx, v); + if (tmp == HAWK_NULL) + { + r->awk->retrieveError (r); + return -1; + } + + hawk_rtx_refupval (r->rtx, tmp); + int n = this->setIndexedVal(r, idx, tmp); + hawk_rtx_refdownval (r->rtx, tmp); + + return n; +} + +int Hawk::Value::setIndexedStr (const Index& idx, const char_t* str, size_t len, bool numeric) +{ + if (run == HAWK_NULL) return -1; + return this->setIndexedStr(run, idx, str, len, numeric); +} + +int Hawk::Value::setIndexedStr ( + Run* r, const Index& idx, const char_t* str, size_t len, bool numeric) +{ + val_t* tmp; + + oocs_t oocs; + oocs.ptr = (char_t*)str; + oocs.len = len; + + tmp = numeric? hawk_rtx_makenstrvalwithoocs(r->rtx, &oocs): + hawk_rtx_makestrvalwithoocs(r->rtx, &oocs); + if (tmp == HAWK_NULL) + { + r->awk->retrieveError (r); + return -1; + } + + hawk_rtx_refupval (r->rtx, tmp); + int n = this->setIndexedVal(r, idx, tmp); + hawk_rtx_refdownval (r->rtx, tmp); + + return n; +} + +int Hawk::Value::setIndexedStr (const Index& idx, const char_t* str, bool numeric) +{ + if (run == HAWK_NULL) return -1; + return this->setIndexedStr(run, idx, str, numeric); +} + +int Hawk::Value::setIndexedStr (Run* r, const Index& idx, const char_t* str, bool numeric) +{ + val_t* tmp; + tmp = numeric? hawk_rtx_makenstrvalwithoocstr(r->rtx, str): + hawk_rtx_makestrvalwithoocstr(r->rtx, str); + if (tmp == HAWK_NULL) + { + r->awk->retrieveError (r); + return -1; + } + + hawk_rtx_refupval (r->rtx, tmp); + int n = this->setIndexedVal(r, idx, tmp); + hawk_rtx_refdownval (r->rtx, tmp); + + return n; +} + +int Hawk::Value::setIndexedMbs (const Index& idx, const hawk_bch_t* str, size_t len) +{ + if (run == HAWK_NULL) return -1; + return this->setIndexedMbs(run, idx, str, len); +} + +int Hawk::Value::setIndexedMbs (Run* r, const Index& idx, const hawk_bch_t* str, size_t len) +{ + val_t* tmp; + + hawk_bcs_t oocs; + oocs.ptr = (hawk_bch_t*)str; + oocs.len = len; + + tmp = hawk_rtx_makembsvalwithbcs(r->rtx, &oocs); + if (!tmp) + { + r->awk->retrieveError (r); + return -1; + } + + hawk_rtx_refupval (r->rtx, tmp); + int n = this->setIndexedVal(r, idx, tmp); + hawk_rtx_refdownval (r->rtx, tmp); + + return n; +} + +int Hawk::Value::setIndexedMbs (const Index& idx, const hawk_bch_t* str) +{ + if (run == HAWK_NULL) return -1; + return this->setIndexedMbs(run, idx, str); +} + +int Hawk::Value::setIndexedMbs (Run* r, const Index& idx, const hawk_bch_t* str) +{ + val_t* tmp; + tmp = hawk_rtx_makembsval(r->rtx, str, hawk_mbslen(str)); + if (tmp == HAWK_NULL) + { + r->awk->retrieveError (r); + return -1; + } + + hawk_rtx_refupval (r->rtx, tmp); + int n = this->setIndexedVal(r, idx, tmp); + hawk_rtx_refdownval (r->rtx, tmp); + + return n; +} + + +bool Hawk::Value::isIndexed () const +{ + HAWK_ASSERT (val != HAWK_NULL); + return HAWK_RTX_GETVALTYPE(this->run->rtx, val) == HAWK_VAL_MAP; +} + +int Hawk::Value::getIndexed (const Index& idx, Value* v) const +{ + HAWK_ASSERT (val != HAWK_NULL); + + // not a map. v is just nil. not an error + if (HAWK_RTX_GETVALTYPE(this->run->rtx, val) != HAWK_VAL_MAP) + { + v->clear (); + return 0; + } + + // get the value from the map. + val_t* fv = hawk_rtx_getmapvalfld(this->run->rtx, val, (char_t*)idx.ptr, idx.len); + + // the key is not found. it is not an error. v is just nil + if (fv == HAWK_NULL) + { + v->clear (); + return 0; + } + + // if v.set fails, it should return an error + return v->setVal (this->run, fv); +} + +Hawk::Value::IndexIterator Hawk::Value::getFirstIndex (Index* idx) const +{ + HAWK_ASSERT (this->val != HAWK_NULL); + + if (HAWK_RTX_GETVALTYPE (this->run->rtx, this->val) != HAWK_VAL_MAP) return IndexIterator::END; + + HAWK_ASSERT (this->run != HAWK_NULL); + + Hawk::Value::IndexIterator itr; + hawk_val_map_itr_t* iptr; + + iptr = hawk_rtx_getfirstmapvalitr(this->run->rtx, this->val, &itr); + if (iptr == HAWK_NULL) return IndexIterator::END; // no more key + + idx->set (HAWK_VAL_MAP_ITR_KEY(iptr)); + + return itr; +} + +Hawk::Value::IndexIterator Hawk::Value::getNextIndex ( + Index* idx, const IndexIterator& curitr) const +{ + HAWK_ASSERT (val != HAWK_NULL); + + if (HAWK_RTX_GETVALTYPE (this->run->rtx, val) != HAWK_VAL_MAP) return IndexIterator::END; + + HAWK_ASSERT (this->run != HAWK_NULL); + + Hawk::Value::IndexIterator itr (curitr); + hawk_val_map_itr_t* iptr; + + iptr = hawk_rtx_getnextmapvalitr(this->run->rtx, this->val, &itr); + if (iptr == HAWK_NULL) return IndexIterator::END; // no more key + + idx->set (HAWK_VAL_MAP_ITR_KEY(iptr)); + + return itr; +} + +////////////////////////////////////////////////////////////////// +// Hawk::Run +////////////////////////////////////////////////////////////////// + +Hawk::Run::Run (Hawk* awk): awk (awk), rtx (HAWK_NULL) +{ +} + +Hawk::Run::Run (Hawk* awk, rtx_t* rtx): awk (awk), rtx (rtx) +{ + HAWK_ASSERT (this->rtx != HAWK_NULL); +} + +Hawk::Run::~Run () +{ +} + +Hawk::Run::operator Hawk* () const +{ + return this->awk; +} + +Hawk::Run::operator Hawk::rtx_t* () const +{ + return this->rtx; +} + +void Hawk::Run::halt () const +{ + HAWK_ASSERT (this->rtx != HAWK_NULL); + hawk_rtx_halt (this->rtx); +} + +bool Hawk::Run::isHalt () const +{ + HAWK_ASSERT (this->rtx != HAWK_NULL); + return hawk_rtx_ishalt (this->rtx)? true: false; +} + +Hawk::errnum_t Hawk::Run::getErrorNumber () const +{ + HAWK_ASSERT (this->rtx != HAWK_NULL); + return hawk_rtx_geterrnum (this->rtx); +} + +Hawk::loc_t Hawk::Run::getErrorLocation () const +{ + HAWK_ASSERT (this->rtx != HAWK_NULL); + return *hawk_rtx_geterrloc (this->rtx); +} + +const Hawk::char_t* Hawk::Run::getErrorMessage () const +{ + HAWK_ASSERT (this->rtx != HAWK_NULL); + return hawk_rtx_geterrmsg (this->rtx); +} + +void Hawk::Run::setError (errnum_t code, const oocs_t* args, const loc_t* loc) +{ + HAWK_ASSERT (this->rtx != HAWK_NULL); + hawk_rtx_seterror (this->rtx, code, args, loc); +} + +void Hawk::Run::setErrorWithMessage ( + errnum_t code, const char_t* msg, const loc_t* loc) +{ + HAWK_ASSERT (this->rtx != HAWK_NULL); + + errinf_t errinf; + + HAWK_MEMSET (&errinf, 0, HAWK_SIZEOF(errinf)); + errinf.num = code; + if (loc == HAWK_NULL) errinf.loc = *loc; + hawk_strxcpy (errinf.msg, HAWK_COUNTOF(errinf.msg), msg); + + hawk_rtx_seterrinf (this->rtx, &errinf); +} + +int Hawk::Run::setGlobal (int id, int_t v) +{ + HAWK_ASSERT (this->rtx != HAWK_NULL); + + val_t* tmp = hawk_rtx_makeintval (this->rtx, v); + if (tmp == HAWK_NULL) return -1; + + hawk_rtx_refupval (this->rtx, tmp); + int n = hawk_rtx_setgbl (this->rtx, id, tmp); + hawk_rtx_refdownval (this->rtx, tmp); + return n; +} + +int Hawk::Run::setGlobal (int id, flt_t v) +{ + HAWK_ASSERT (this->rtx != HAWK_NULL); + + val_t* tmp = hawk_rtx_makefltval (this->rtx, v); + if (tmp == HAWK_NULL) return -1; + + hawk_rtx_refupval (this->rtx, tmp); + int n = hawk_rtx_setgbl (this->rtx, id, tmp); + hawk_rtx_refdownval (this->rtx, tmp); + return n; +} + +int Hawk::Run::setGlobal (int id, const char_t* ptr, size_t len) +{ + HAWK_ASSERT (this->rtx != HAWK_NULL); + + val_t* tmp = hawk_rtx_makestrvalwithoochars(this->rtx, ptr, len); + if (tmp == HAWK_NULL) return -1; + + hawk_rtx_refupval (this->rtx, tmp); + int n = hawk_rtx_setgbl (this->rtx, id, tmp); + hawk_rtx_refdownval (this->rtx, tmp); + return n; +} + +int Hawk::Run::setGlobal (int id, const Value& gbl) +{ + HAWK_ASSERT (this->rtx != HAWK_NULL); + return hawk_rtx_setgbl (this->rtx, id, (val_t*)gbl); +} + +int Hawk::Run::getGlobal (int id, Value& g) const +{ + HAWK_ASSERT (this->rtx != HAWK_NULL); + return g.setVal ((Run*)this, hawk_rtx_getgbl (this->rtx, id)); +} + +////////////////////////////////////////////////////////////////// +// Hawk +////////////////////////////////////////////////////////////////// + +Hawk::Hawk (Mmgr* mmgr): + Mmged (mmgr), awk (HAWK_NULL), +#if defined(HAWK_USE_HTB_FOR_FUNCTION_MAP) + functionMap (HAWK_NULL), +#else + functionMap (this), +#endif + source_reader (HAWK_NULL), source_writer (HAWK_NULL), + pipe_handler (HAWK_NULL), file_handler (HAWK_NULL), + console_handler (HAWK_NULL), runctx (this) + +{ + HAWK_MEMSET (&errinf, 0, HAWK_SIZEOF(errinf)); + errinf.num = HAWK_ENOERR; +} + +Hawk::operator Hawk::awk_t* () const +{ + return this->awk; +} + +const Hawk::char_t* Hawk::getErrorString (errnum_t num) const +{ + HAWK_ASSERT (awk != HAWK_NULL); + HAWK_ASSERT (dflerrstr != HAWK_NULL); + return dflerrstr (awk, num); +} + +const Hawk::char_t* Hawk::xerrstr (awk_t* a, errnum_t num) +{ + Hawk* awk = *(Hawk**)GET_XTN(a); + return awk->getErrorString (num); +} + + +Hawk::errnum_t Hawk::getErrorNumber () const +{ + return this->errinf.num; +} + +Hawk::loc_t Hawk::getErrorLocation () const +{ + return this->errinf.loc; +} + +const Hawk::char_t* Hawk::getErrorMessage () const +{ + return this->errinf.msg; +} + +void Hawk::setError (errnum_t code, const oocs_t* args, const loc_t* loc) +{ + if (awk != HAWK_NULL) + { + hawk_seterror (awk, code, args, loc); + this->retrieveError (); + } + else + { + HAWK_MEMSET (&errinf, 0, HAWK_SIZEOF(errinf)); + errinf.num = code; + if (loc != HAWK_NULL) errinf.loc = *loc; + hawk_strxcpy (errinf.msg, HAWK_COUNTOF(errinf.msg), + HAWK_T("not ready to set an error message")); + } +} + +void Hawk::setErrorWithMessage (errnum_t code, const char_t* msg, const loc_t* loc) +{ + HAWK_MEMSET (&errinf, 0, HAWK_SIZEOF(errinf)); + + errinf.num = code; + if (loc != HAWK_NULL) errinf.loc = *loc; + hawk_strxcpy (errinf.msg, HAWK_COUNTOF(errinf.msg), msg); + + if (awk != HAWK_NULL) hawk_seterrinf (awk, &errinf); +} + +void Hawk::clearError () +{ + HAWK_MEMSET (&errinf, 0, HAWK_SIZEOF(errinf)); + errinf.num = HAWK_ENOERR; +} + +void Hawk::retrieveError () +{ + if (this->awk == HAWK_NULL) + { + clearError (); + } + else + { + hawk_geterrinf (this->awk, &errinf); + } +} + +void Hawk::retrieveError (Run* run) +{ + HAWK_ASSERT (run != HAWK_NULL); + if (run->rtx == HAWK_NULL) return; + hawk_rtx_geterrinf (run->rtx, &errinf); +} + +static void fini_xtn (hawk_t* awk) +{ + xtn_t* xtn = GET_XTN(awk); + xtn->awk->uponClosing (); +} + +static void clear_xtn (hawk_t* awk) +{ + xtn_t* xtn = GET_XTN(awk); + xtn->awk->uponClearing (); +} + +int Hawk::open () +{ + HAWK_ASSERT (this->awk == HAWK_NULL); +#if defined(HAWK_USE_HTB_FOR_FUNCTION_MAP) + HAWK_ASSERT (this->functionMap == HAWK_NULL); +#endif + + hawk_prm_t prm; + + HAWK_MEMSET (&prm, 0, HAWK_SIZEOF(prm)); + prm.math.pow = pow; + prm.math.mod = mod; + prm.modopen = modopen; + prm.modclose = modclose; + prm.modsym = modsym; + + hawk_errnum_t errnum; + this->awk = hawk_open(this->getMmgr(), HAWK_SIZEOF(xtn_t), &prm, &errnum); + if (!this->awk) + { + this->setError (errnum); + return -1; + } + + this->awk->_instsize += HAWK_SIZEOF(xtn_t); + + // associate this Hawk object with the underlying awk object + xtn_t* xtn = (xtn_t*)GET_XTN(this->awk); + xtn->awk = this; + xtn->ecb.close = fini_xtn; + xtn->ecb.clear = clear_xtn; + + dflerrstr = hawk_geterrstr (this->awk); + hawk_seterrstr (this->awk, xerrstr); + +#if defined(HAWK_USE_HTB_FOR_FUNCTION_MAP) + this->functionMap = hawk_htb_open( + hawk_getmmgr(this->awk), HAWK_SIZEOF(this), 512, 70, + HAWK_SIZEOF(hawk_ooch_t), 1 + ); + if (this->functionMap == HAWK_NULL) + { + hawk_close (this->awk); + this->awk = HAWK_NULL; + + this->setError (HAWK_ENOMEM); + return -1; + } + + *(Hawk**)hawk_htb_getxtn(this->functionMap) = this; + + static hawk_htb_style_t style = + { + { + HAWK_HTB_COPIER_DEFAULT, // keep the key pointer only + HAWK_HTB_COPIER_INLINE // copy the value into the pair + }, + { + HAWK_HTB_FREEER_DEFAULT, // free nothing + HAWK_HTB_FREEER_DEFAULT // free nothing + }, + HAWK_HTB_COMPER_DEFAULT, + HAWK_HTB_KEEPER_DEFAULT, + HAWK_HTB_SIZER_DEFAULT, + HAWK_HTB_HASHER_DEFAULT + }; + hawk_htb_setstyle (this->functionMap, &style); + +#endif + + // push the call back after everything else is ok. + hawk_pushecb (this->awk, &xtn->ecb); + return 0; +} + +void Hawk::close () +{ + this->fini_runctx (); + this->clearArguments (); + +#if defined(HAWK_USE_HTB_FOR_FUNCTION_MAP) + if (this->functionMap) + { + hawk_htb_close (this->functionMap); + this->functionMap = HAWK_NULL; + } +#else + this->functionMap.clear (); +#endif + + if (this->awk) + { + hawk_close (this->awk); + this->awk = HAWK_NULL; + } + + this->clearError (); +} + +hawk_cmgr_t* Hawk::getCmgr () const +{ + if (!this->awk) return HAWK_NULL; + return hawk_getcmgr(this->awk); +} + +void Hawk::uponClosing () +{ + // nothing to do +} + +void Hawk::uponClearing () +{ + // nothing to do +} + +Hawk::Run* Hawk::parse (Source& in, Source& out) +{ + HAWK_ASSERT (awk != HAWK_NULL); + + if (&in == &Source::NONE) + { + this->setError (HAWK_EINVAL); + return HAWK_NULL; + } + + this->fini_runctx (); + + source_reader = ∈ + source_writer = (&out == &Source::NONE)? HAWK_NULL: &out; + + hawk_sio_cbs_t sio; + sio.in = readSource; + sio.out = (source_writer == HAWK_NULL)? HAWK_NULL: writeSource; + + int n = hawk_parse(awk, &sio); + if (n <= -1) + { + this->retrieveError (); + return HAWK_NULL; + } + + if (this->init_runctx() <= -1) return HAWK_NULL; + return &this->runctx; +} + +Hawk::Run* Hawk::resetRunContext () +{ + if (this->runctx.rtx) + { + this->fini_runctx (); + if (this->init_runctx() <= -1) return HAWK_NULL; + return &this->runctx; + } + else return HAWK_NULL; +} + +int Hawk::loop (Value* ret) +{ + HAWK_ASSERT (this->awk != HAWK_NULL); + HAWK_ASSERT (this->runctx.rtx != HAWK_NULL); + + val_t* rv = hawk_rtx_loop (this->runctx.rtx); + if (rv == HAWK_NULL) + { + this->retrieveError (&this->runctx); + return -1; + } + + ret->setVal (&this->runctx, rv); + hawk_rtx_refdownval (this->runctx.rtx, rv); + + return 0; +} + +int Hawk::call (const hawk_bch_t* name, Value* ret, const Value* args, size_t nargs) +{ + HAWK_ASSERT (this->awk != HAWK_NULL); + HAWK_ASSERT (this->runctx.rtx != HAWK_NULL); + + val_t* buf[16]; + val_t** ptr = HAWK_NULL; + + if (args != HAWK_NULL) + { + if (nargs <= HAWK_COUNTOF(buf)) ptr = buf; + else + { + ptr = (val_t**)hawk_allocmem(awk, HAWK_SIZEOF(val_t*) * nargs); + if (ptr == HAWK_NULL) + { + this->runctx.setError (HAWK_ENOMEM); + this->retrieveError (&this->runctx); + return -1; + } + } + + for (size_t i = 0; i < nargs; i++) ptr[i] = (val_t*)args[i]; + } + + val_t* rv = hawk_rtx_callwithbcstr(this->runctx.rtx, name, ptr, nargs); + + if (ptr != HAWK_NULL && ptr != buf) hawk_freemem (awk, ptr); + + if (rv == HAWK_NULL) + { + this->retrieveError (&this->runctx); + return -1; + } + + ret->setVal (&this->runctx, rv); + + hawk_rtx_refdownval (this->runctx.rtx, rv); + return 0; +} + +int Hawk::call (const hawk_uch_t* name, Value* ret, const Value* args, size_t nargs) +{ + HAWK_ASSERT (this->awk != HAWK_NULL); + HAWK_ASSERT (this->runctx.rtx != HAWK_NULL); + + val_t* buf[16]; + val_t** ptr = HAWK_NULL; + + if (args != HAWK_NULL) + { + if (nargs <= HAWK_COUNTOF(buf)) ptr = buf; + else + { + ptr = (val_t**)hawk_allocmem(awk, HAWK_SIZEOF(val_t*) * nargs); + if (ptr == HAWK_NULL) + { + this->runctx.setError (HAWK_ENOMEM); + this->retrieveError (&this->runctx); + return -1; + } + } + + for (size_t i = 0; i < nargs; i++) ptr[i] = (val_t*)args[i]; + } + + val_t* rv = hawk_rtx_callwithucstr(this->runctx.rtx, name, ptr, nargs); + + if (ptr != HAWK_NULL && ptr != buf) hawk_freemem (awk, ptr); + + if (rv == HAWK_NULL) + { + this->retrieveError (&this->runctx); + return -1; + } + + ret->setVal (&this->runctx, rv); + + hawk_rtx_refdownval (this->runctx.rtx, rv); + return 0; +} + +void Hawk::halt () +{ + HAWK_ASSERT (awk != HAWK_NULL); + hawk_haltall (awk); +} + +int Hawk::init_runctx () +{ + if (this->runctx.rtx) return 0; + + hawk_rio_t rio; + + rio.pipe = pipeHandler; + rio.file = fileHandler; + rio.console = consoleHandler; + + rtx_t* rtx = hawk_rtx_open(awk, HAWK_SIZEOF(rxtn_t), &rio); + if (rtx == HAWK_NULL) + { + this->retrieveError(); + return -1; + } + + rtx->_instsize += HAWK_SIZEOF(rxtn_t); + runctx.rtx = rtx; + + rxtn_t* rxtn = GET_RXTN(rtx); + rxtn->run = &runctx; + + return 0; +} + +void Hawk::fini_runctx () +{ + if (this->runctx.rtx) + { + hawk_rtx_close (this->runctx.rtx); + this->runctx.rtx = HAWK_NULL; + } +} + +int Hawk::getTrait () const +{ + HAWK_ASSERT (awk != HAWK_NULL); + int val; + hawk_getopt (awk, HAWK_TRAIT, &val); + return val; +} + +void Hawk::setTrait (int trait) +{ + HAWK_ASSERT (awk != HAWK_NULL); + hawk_setopt (awk, HAWK_TRAIT, &trait); +} + +Hawk::size_t Hawk::getMaxDepth (depth_t id) const +{ + HAWK_ASSERT (awk != HAWK_NULL); + + size_t depth; + hawk_getopt (awk, (hawk_opt_t)id, &depth); + return depth; +} + +void Hawk::setMaxDepth (depth_t id, size_t depth) +{ + HAWK_ASSERT (awk != HAWK_NULL); + hawk_setopt (awk, (hawk_opt_t)id, &depth); +} + +int Hawk::dispatch_function (Run* run, const fnc_info_t* fi) +{ + bool has_ref_arg = false; + +#if defined(HAWK_USE_HTB_FOR_FUNCTION_MAP) + hawk_htb_pair_t* pair; + pair = hawk_htb_search (this->functionMap, fi->name.ptr, fi->name.len); + if (pair == HAWK_NULL) + { + run->setError (HAWK_EFUNNF, &fi->name); + return -1; + } + + FunctionHandler handler; + handler = *(FunctionHandler*)HAWK_HTB_VPTR(pair); +#else + FunctionMap::Pair* pair = this->functionMap.search (Cstr(fi->name.ptr, fi->name.len)); + if (pair == HAWK_NULL) + { + run->setError (HAWK_EFUNNF, &fi->name); + return -1; + } + + FunctionHandler handler; + handler = pair->value; +#endif + + size_t i, nargs = hawk_rtx_getnargs(run->rtx); + + Value buf[16]; + Value* args; + if (nargs <= HAWK_COUNTOF(buf)) args = buf; + else + { + #if defined(AWK_VALUE_USE_IN_CLASS_PLACEMENT_NEW) + args = new(run) Value[nargs]; + if (args == HAWK_NULL) + { + run->setError (HAWK_ENOMEM); + return -1; + } + #else + try + { + //args = (Value*)::operator new (HAWK_SIZEOF(Value) * nargs, this->getMmgr()); + args = (Value*)this->getMmgr()->allocate(HAWK_SIZEOF(Value) * nargs); + } + catch (...) { args = HAWK_NULL; } + if (args == HAWK_NULL) + { + run->setError (HAWK_ENOMEM); + return -1; + } + for (i = 0; i < nargs; i++) + { + // call the default constructor on the space allocated above. + // no exception handling is implemented here as i know + // that Value::Value() doesn't throw an exception + new((QSE::Mmgr*)HAWK_NULL, (void*)&args[i]) Value (); + } + #endif + } + + for (i = 0; i < nargs; i++) + { + int xx; + val_t* v = hawk_rtx_getarg (run->rtx, i); + + if (HAWK_RTX_GETVALTYPE (run->rtx, v) == HAWK_VAL_REF) + { + hawk_val_ref_t* ref = (hawk_val_ref_t*)v; + + switch (ref->id) + { + case hawk_val_ref_t::HAWK_VAL_REF_POS: + { + hawk_oow_t idx = (hawk_oow_t)ref->adr; + + if (idx == 0) + { + xx = args[i].setStr (run, + HAWK_STR_PTR(&run->rtx->inrec.line), + HAWK_STR_LEN(&run->rtx->inrec.line)); + } + else if (idx <= run->rtx->inrec.nflds) + { + xx = args[i].setStr (run, + run->rtx->inrec.flds[idx-1].ptr, + run->rtx->inrec.flds[idx-1].len); + } + else + { + xx = args[i].setStr (run, HAWK_T(""), (size_t)0); + } + break; + } + + case hawk_val_ref_t::HAWK_VAL_REF_GBL: + { + hawk_oow_t idx = (hawk_oow_t)ref->adr; + hawk_val_t* val = (hawk_val_t*)RTX_STACK_GBL(run->rtx, idx); + xx = args[i].setVal (run, val); + break; + } + + default: + xx = args[i].setVal (run, *(ref->adr)); + break; + } + has_ref_arg = true; + } + else + { + xx = args[i].setVal (run, v); + } + + if (xx <= -1) + { + run->setError (HAWK_ENOMEM); + if (args != buf) delete[] args; + return -1; + } + } + + Value ret (run); + + int n; + + try { n = (this->*handler) (*run, ret, args, nargs, fi); } + catch (...) { n = -1; } + + if (n >= 0 && has_ref_arg) + { + for (i = 0; i < nargs; i++) + { + HAWK_ASSERTX (args[i].run == run, + "Do NOT change the run field from function handler"); + + val_t* v = hawk_rtx_getarg(run->rtx, i); + if (HAWK_RTX_GETVALTYPE(run->rtx, v) == HAWK_VAL_REF) + { + if (hawk_rtx_setrefval(run->rtx, (hawk_val_ref_t*)v, args[i].toVal()) <= -1) + { + n = -1; + break; + } + } + } + } + + if (args != buf) + { + #if defined(AWK_VALUE_USE_IN_CLASS_PLACEMENT_NEW) + delete[] args; + #else + for (i = nargs; i > 0; ) + { + --i; + args[i].Value::~Value (); + } + + //::operator delete (args, this->getMmgr()); + this->getMmgr()->dispose (args); + #endif + } + + if (n <= -1) + { + /* this is really the handler error. the underlying engine + * will take care of the error code. */ + return -1; + } + + hawk_rtx_setretval (run->rtx, ret.toVal()); + return 0; +} + +int Hawk::xstrs_t::add (awk_t* awk, const char_t* arg, size_t len) +{ + if (this->len >= this->capa) + { + hawk_oocs_t* ptr; + size_t capa = this->capa; + + capa += 64; + ptr = (hawk_oocs_t*)hawk_reallocmem(awk, this->ptr, HAWK_SIZEOF(hawk_oocs_t)*(capa+1)); + if (ptr == HAWK_NULL) return -1; + + this->ptr = ptr; + this->capa = capa; + } + + this->ptr[this->len].len = len; + this->ptr[this->len].ptr = hawk_strxdup(awk, arg, len); + if (this->ptr[this->len].ptr == HAWK_NULL) return -1; + + this->len++; + this->ptr[this->len].len = 0; + this->ptr[this->len].ptr = HAWK_NULL; + + return 0; +} + +void Hawk::xstrs_t::clear (awk_t* awk) +{ + if (this->ptr != HAWK_NULL) + { + while (this->len > 0) + hawk_freemem (awk, this->ptr[--this->len].ptr); + + hawk_freemem (awk, this->ptr); + this->ptr = HAWK_NULL; + this->capa = 0; + } +} + +int Hawk::addArgument (const char_t* arg, size_t len) +{ + HAWK_ASSERT (awk != HAWK_NULL); + int n = runarg.add(awk, arg, len); + if (n <= -1) this->setError (HAWK_ENOMEM); + return n; +} + +int Hawk::addArgument (const char_t* arg) +{ + return addArgument(arg, hawk_strlen(arg)); +} + +void Hawk::clearArguments () +{ + runarg.clear (awk); +} + +int Hawk::addGlobal(const hawk_bch_t* name) +{ + HAWK_ASSERT (awk != HAWK_NULL); + int n = hawk_addgblwithbcstr(awk, name); + if (n <= -1) this->retrieveError (); + return n; +} + +int Hawk::addGlobal(const hawk_uch_t* name) +{ + HAWK_ASSERT (awk != HAWK_NULL); + int n = hawk_addgblwithucstr(awk, name); + if (n <= -1) this->retrieveError (); + return n; +} + +int Hawk::deleteGlobal (const hawk_bch_t* name) +{ + HAWK_ASSERT (awk != HAWK_NULL); + int n = hawk_delgblwithbcstr(awk, name); + if (n <= -1) this->retrieveError (); + return n; +} + +int Hawk::deleteGlobal (const hawk_uch_t* name) +{ + HAWK_ASSERT (awk != HAWK_NULL); + int n = hawk_delgblwithucstr(awk, name); + if (n <= -1) this->retrieveError (); + return n; +} + + +int Hawk::findGlobal (const hawk_bch_t* name) +{ + HAWK_ASSERT (awk != HAWK_NULL); + int n = hawk_findgblwithbcstr(awk, name); + if (n <= -1) this->retrieveError (); + return n; +} + +int Hawk::findGlobal (const hawk_uch_t* name) +{ + HAWK_ASSERT (awk != HAWK_NULL); + int n = hawk_findgblwithucstr(awk, name); + if (n <= -1) this->retrieveError (); + return n; +} + +int Hawk::setGlobal (int id, const Value& v) +{ + HAWK_ASSERT (awk != HAWK_NULL); + HAWK_ASSERT (runctx.rtx != HAWK_NULL); + + if (v.run != &runctx) + { + this->setError (HAWK_EINVAL); + return -1; + } + + int n = runctx.setGlobal (id, v); + if (n <= -1) this->retrieveError (); + return n; +} + +int Hawk::getGlobal (int id, Value& v) +{ + HAWK_ASSERT (awk != HAWK_NULL); + HAWK_ASSERT (runctx.rtx != HAWK_NULL); + + int n = runctx.getGlobal (id, v); + if (n <= -1) this->retrieveError (); + return n; +} + +int Hawk::addFunction ( + const hawk_bch_t* name, size_t minArgs, size_t maxArgs, + const hawk_bch_t* argSpec, FunctionHandler handler, int validOpts) +{ + HAWK_ASSERT (awk != HAWK_NULL); + + hawk_fnc_mspec_t spec; + + HAWK_MEMSET (&spec, 0, HAWK_SIZEOF(spec)); + spec.arg.min = minArgs; + spec.arg.max = maxArgs; + spec.arg.spec = argSpec; + spec.impl = this->functionHandler; + spec.trait = validOpts; + + hawk_fnc_t* fnc = hawk_addfncwithbcstr(awk, name, &spec); + if (fnc == HAWK_NULL) + { + this->retrieveError (); + return -1; + } + +#if defined(HAWK_USE_HTB_FOR_FUNCTION_MAP) + // handler is a pointer to a member function. + // sizeof(handler) is likely to be greater than sizeof(void*) + // copy the handler pointer into the table. + // + // the function name exists in the underlying function table. + // use the pointer to the name to maintain the hash table. + hawk_htb_pair_t* pair = hawk_htb_upsert(this->functionMap, (char_t*)fnc->name.ptr, fnc->name.len, &handler, HAWK_SIZEOF(handler)); +#else + FunctionMap::Pair* pair; + try { pair = this->functionMap.upsert(Cstr(fnc->name.ptr, fnc->name.len), handler); } + catch (...) { pair = HAWK_NULL; } +#endif + + if (pair == HAWK_NULL) + { + hawk_delfncwithbcstr (awk, name); + this->setError (HAWK_ENOMEM); + return -1; + } + + return 0; +} + +int Hawk::addFunction ( + const hawk_uch_t* name, size_t minArgs, size_t maxArgs, + const hawk_uch_t* argSpec, FunctionHandler handler, int validOpts) +{ + HAWK_ASSERT (awk != HAWK_NULL); + + hawk_fnc_wspec_t spec; + + HAWK_MEMSET (&spec, 0, HAWK_SIZEOF(spec)); + spec.arg.min = minArgs; + spec.arg.max = maxArgs; + spec.arg.spec = argSpec; + spec.impl = this->functionHandler; + spec.trait = validOpts; + + hawk_fnc_t* fnc = hawk_addfncwithucstr(awk, name, &spec); + if (fnc == HAWK_NULL) + { + this->retrieveError (); + return -1; + } + +#if defined(HAWK_USE_HTB_FOR_FUNCTION_MAP) + // handler is a pointer to a member function. + // sizeof(handler) is likely to be greater than sizeof(void*) + // copy the handler pointer into the table. + // + // the function name exists in the underlying function table. + // use the pointer to the name to maintain the hash table. + hawk_htb_pair_t* pair = hawk_htb_upsert(this->functionMap, (char_t*)fnc->name.ptr, fnc->name.len, &handler, HAWK_SIZEOF(handler)); +#else + FunctionMap::Pair* pair; + try { pair = this->functionMap.upsert(Cstr(fnc->name.ptr, fnc->name.len), handler); } + catch (...) { pair = HAWK_NULL; } +#endif + + if (pair == HAWK_NULL) + { + hawk_delfncwithucstr (awk, name); + this->setError (HAWK_ENOMEM); + return -1; + } + + return 0; +} + +int Hawk::deleteFunction (const char_t* name) +{ + HAWK_ASSERT (awk != HAWK_NULL); + + int n = hawk_delfnc(awk, name); + if (n == 0) + { +#if defined(HAWK_USE_HTB_FOR_FUNCTION_MAP) + hawk_htb_delete (this->functionMap, name, hawk_strlen(name)); +#else + this->functionMap.remove (Cstr(name)); +#endif + } + else this->retrieveError (); + + return n; +} + +Hawk::ssize_t Hawk::readSource ( + awk_t* awk, sio_cmd_t cmd, sio_arg_t* arg, + char_t* data, size_t count) +{ + xtn_t* xtn = GET_XTN(awk); + Source::Data sdat (xtn->awk, Source::READ, arg); + + switch (cmd) + { + case HAWK_SIO_CMD_OPEN: + return xtn->awk->source_reader->open (sdat); + case HAWK_SIO_CMD_CLOSE: + return xtn->awk->source_reader->close (sdat); + case HAWK_SIO_CMD_READ: + return xtn->awk->source_reader->read (sdat, data, count); + default: + return -1; + } +} + +Hawk::ssize_t Hawk::writeSource ( + awk_t* awk, hawk_sio_cmd_t cmd, sio_arg_t* arg, + char_t* data, size_t count) +{ + xtn_t* xtn = GET_XTN(awk); + Source::Data sdat (xtn->awk, Source::WRITE, arg); + + switch (cmd) + { + case HAWK_SIO_CMD_OPEN: + return xtn->awk->source_writer->open (sdat); + case HAWK_SIO_CMD_CLOSE: + return xtn->awk->source_writer->close (sdat); + case HAWK_SIO_CMD_WRITE: + return xtn->awk->source_writer->write (sdat, data, count); + default: + return -1; + } +} + +Hawk::ssize_t Hawk::pipeHandler (rtx_t* rtx, rio_cmd_t cmd, rio_arg_t* riod, void* data, size_t count) +{ + rxtn_t* rxtn = GET_RXTN(rtx); + Hawk* awk = rxtn->run->awk; + + HAWK_ASSERT ((riod->type & 0xFF) == HAWK_RIO_PIPE); + + Pipe pipe (rxtn->run, riod); + + try + { + if (awk->pipe_handler) + { + switch (cmd) + { + case HAWK_RIO_CMD_OPEN: + return awk->pipe_handler->open(pipe); + case HAWK_RIO_CMD_CLOSE: + return awk->pipe_handler->close(pipe); + + case HAWK_RIO_CMD_READ: + return awk->pipe_handler->read(pipe, (hawk_ooch_t*)data, count); + case HAWK_RIO_CMD_WRITE: + return awk->pipe_handler->write(pipe, (const hawk_ooch_t*)data, count); + case HAWK_RIO_CMD_WRITE_BYTES: + return awk->pipe_handler->writeBytes(pipe, (const hawk_bch_t*)data, count); + + case HAWK_RIO_CMD_FLUSH: + return awk->pipe_handler->flush(pipe); + + default: + return -1; + } + } + else + { + switch (cmd) + { + case HAWK_RIO_CMD_OPEN: + return awk->openPipe(pipe); + case HAWK_RIO_CMD_CLOSE: + return awk->closePipe(pipe); + + case HAWK_RIO_CMD_READ: + return awk->readPipe(pipe, (hawk_ooch_t*)data, count); + case HAWK_RIO_CMD_WRITE: + return awk->writePipe(pipe, (const hawk_ooch_t*)data, count); + case HAWK_RIO_CMD_WRITE_BYTES: + return awk->writePipeBytes(pipe, (const hawk_bch_t*)data, count); + + case HAWK_RIO_CMD_FLUSH: + return awk->flushPipe(pipe); + + default: + return -1; + } + } + } + catch (...) + { + return -1; + } +} + +Hawk::ssize_t Hawk::fileHandler (rtx_t* rtx, rio_cmd_t cmd, rio_arg_t* riod, void* data, size_t count) +{ + rxtn_t* rxtn = GET_RXTN(rtx); + Hawk* awk = rxtn->run->awk; + + HAWK_ASSERT ((riod->type & 0xFF) == HAWK_RIO_FILE); + + File file (rxtn->run, riod); + + try + { + if (awk->file_handler) + { + switch (cmd) + { + case HAWK_RIO_CMD_OPEN: + return awk->file_handler->open(file); + case HAWK_RIO_CMD_CLOSE: + return awk->file_handler->close(file); + + case HAWK_RIO_CMD_READ: + return awk->file_handler->read(file, (hawk_ooch_t*)data, count); + case HAWK_RIO_CMD_WRITE: + return awk->file_handler->write(file, (const hawk_ooch_t*)data, count); + case HAWK_RIO_CMD_WRITE_BYTES: + return awk->file_handler->writeBytes(file, (const hawk_bch_t*)data, count); + + case HAWK_RIO_CMD_FLUSH: + return awk->file_handler->flush(file); + + default: + return -1; + } + } + else + { + switch (cmd) + { + case HAWK_RIO_CMD_OPEN: + return awk->openFile(file); + case HAWK_RIO_CMD_CLOSE: + return awk->closeFile(file); + + case HAWK_RIO_CMD_READ: + return awk->readFile(file, (hawk_ooch_t*)data, count); + case HAWK_RIO_CMD_WRITE: + return awk->writeFile(file, (const hawk_ooch_t*)data, count); + case HAWK_RIO_CMD_WRITE_BYTES: + return awk->writeFileBytes(file, (const hawk_bch_t*)data, count); + + case HAWK_RIO_CMD_FLUSH: + return awk->flushFile(file); + + default: + return -1; + } + } + } + catch (...) + { + return -1; + } +} + +Hawk::ssize_t Hawk::consoleHandler (rtx_t* rtx, rio_cmd_t cmd, rio_arg_t* riod, void* data, size_t count) +{ + rxtn_t* rxtn = GET_RXTN(rtx); + Hawk* awk = rxtn->run->awk; + + HAWK_ASSERT ((riod->type & 0xFF) == HAWK_RIO_CONSOLE); + + Console console (rxtn->run, riod); + + try + { + if (awk->console_handler) + { + switch (cmd) + { + case HAWK_RIO_CMD_OPEN: + return awk->console_handler->open(console); + case HAWK_RIO_CMD_CLOSE: + return awk->console_handler->close(console); + + case HAWK_RIO_CMD_READ: + return awk->console_handler->read(console, (hawk_ooch_t*)data, count); + case HAWK_RIO_CMD_WRITE: + return awk->console_handler->write(console, (const hawk_ooch_t*)data, count); + case HAWK_RIO_CMD_WRITE_BYTES: + return awk->console_handler->writeBytes(console, (const hawk_bch_t*)data, count); + + case HAWK_RIO_CMD_FLUSH: + return awk->console_handler->flush(console); + case HAWK_RIO_CMD_NEXT: + return awk->console_handler->next(console); + + default: + return -1; + } + } + else + { + switch (cmd) + { + case HAWK_RIO_CMD_OPEN: + return awk->openConsole(console); + case HAWK_RIO_CMD_CLOSE: + return awk->closeConsole(console); + + case HAWK_RIO_CMD_READ: + return awk->readConsole(console, (hawk_ooch_t*)data, count); + case HAWK_RIO_CMD_WRITE: + return awk->writeConsole(console, (const hawk_ooch_t*)data, count); + case HAWK_RIO_CMD_WRITE_BYTES: + return awk->writeConsoleBytes(console, (const hawk_bch_t*)data, count); + + case HAWK_RIO_CMD_FLUSH: + return awk->flushConsole(console); + case HAWK_RIO_CMD_NEXT: + return awk->nextConsole(console); + + default: + return -1; + } + } + } + catch (...) + { + return -1; + } +} + +int Hawk::openPipe (Pipe& io) +{ + ((Run*)io)->setError (HAWK_ENOIMPL); + return -1; +} + +int Hawk::closePipe (Pipe& io) +{ + ((Run*)io)->setError (HAWK_ENOIMPL); + return -1; +} + +Hawk::ssize_t Hawk::readPipe (Pipe& io, char_t* buf, size_t len) +{ + ((Run*)io)->setError (HAWK_ENOIMPL); + return -1; +} + +Hawk::ssize_t Hawk::writePipe (Pipe& io, const char_t* buf, size_t len) +{ + ((Run*)io)->setError (HAWK_ENOIMPL); + return -1; +} + +Hawk::ssize_t Hawk::writePipeBytes (Pipe& io, const hawk_bch_t* buf, size_t len) +{ + ((Run*)io)->setError (HAWK_ENOIMPL); + return -1; +} + +int Hawk::flushPipe (Pipe& io) +{ + ((Run*)io)->setError (HAWK_ENOIMPL); + return -1; +} + +int Hawk::openFile (File& io) +{ + ((Run*)io)->setError (HAWK_ENOIMPL); + return -1; +} + +int Hawk::closeFile (File& io) +{ + ((Run*)io)->setError (HAWK_ENOIMPL); + return -1; +} + +Hawk::ssize_t Hawk::readFile (File& io, char_t* buf, size_t len) +{ + ((Run*)io)->setError (HAWK_ENOIMPL); + return -1; +} + +Hawk::ssize_t Hawk::writeFile (File& io, const char_t* buf, size_t len) +{ + ((Run*)io)->setError (HAWK_ENOIMPL); + return -1; +} + +Hawk::ssize_t Hawk::writeFileBytes (File& io, const hawk_bch_t* buf, size_t len) +{ + ((Run*)io)->setError (HAWK_ENOIMPL); + return -1; +} + +int Hawk::flushFile (File& io) +{ + ((Run*)io)->setError (HAWK_ENOIMPL); + return -1; +} + +int Hawk::openConsole (Console& io) +{ + ((Run*)io)->setError (HAWK_ENOIMPL); + return -1; +} + +int Hawk::closeConsole (Console& io) +{ + ((Run*)io)->setError (HAWK_ENOIMPL); + return -1; +} + +Hawk::ssize_t Hawk::readConsole (Console& io, char_t* buf, size_t len) +{ + ((Run*)io)->setError (HAWK_ENOIMPL); + return -1; +} + +Hawk::ssize_t Hawk::writeConsole (Console& io, const char_t* buf, size_t len) +{ + ((Run*)io)->setError (HAWK_ENOIMPL); + return -1; +} + +Hawk::ssize_t Hawk::writeConsoleBytes (Console& io, const hawk_bch_t* buf, size_t len) +{ + ((Run*)io)->setError (HAWK_ENOIMPL); + return -1; +} + +int Hawk::flushConsole (Console& io) +{ + ((Run*)io)->setError (HAWK_ENOIMPL); + return -1; +} + +int Hawk::nextConsole (Console& io) +{ + ((Run*)io)->setError (HAWK_ENOIMPL); + return -1; +} + +int Hawk::functionHandler (rtx_t* rtx, const fnc_info_t* fi) +{ + rxtn_t* rxtn = GET_RXTN(rtx); + return rxtn->run->awk->dispatch_function (rxtn->run, fi); +} + +Hawk::flt_t Hawk::pow (awk_t* awk, flt_t x, flt_t y) +{ + xtn_t* xtn = GET_XTN(awk); + return xtn->awk->pow (x, y); +} + +Hawk::flt_t Hawk::mod (awk_t* awk, flt_t x, flt_t y) +{ + xtn_t* xtn = GET_XTN(awk); + return xtn->awk->mod (x, y); +} + +void* Hawk::modopen (awk_t* awk, const mod_spec_t* spec) +{ + xtn_t* xtn = GET_XTN(awk); + return xtn->awk->modopen (spec); +} + +void Hawk::modclose (awk_t* awk, void* handle) +{ + xtn_t* xtn = GET_XTN(awk); + xtn->awk->modclose (handle); +} + +void* Hawk::modsym (awk_t* awk, void* handle, const char_t* name) +{ + xtn_t* xtn = GET_XTN(awk); + return xtn->awk->modsym (handle, name); +} +///////////////////////////////// +HAWK_END_NAMESPACE(QSE) +///////////////////////////////// diff --git a/hawk/lib/Hawk.hpp b/hawk/lib/Hawk.hpp new file mode 100644 index 00000000..d69e810b --- /dev/null +++ b/hawk/lib/Hawk.hpp @@ -0,0 +1,1430 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_HAWK_HPP_ +#define _HAWK_HAWK_HPP_ + +#include +#include + +//#define HAWK_AWK_USE_HTB_FOR_FUNCTION_MAP 1 +//#define HAWK_AWK_VALUE_USE_IN_CLASS_PLACEMENT_NEW 1 + +#if defined(HAWK_AWK_USE_HTB_FOR_FUNCTION_MAP) +# include +#else +# include +# include +#endif + +/// \file +/// AWK Interpreter + +///////////////////////////////// +HAWK_BEGIN_NAMESPACE(QSE) +///////////////////////////////// + +/// +/// The Hawk class implements an AWK interpreter by wrapping around +/// #hawk_t and #hawk_rtx_t. +/// +class HAWK_EXPORT Hawk: public Uncopyable, public Types, public Mmged +{ +public: + + // define a primitive handle + typedef hawk_t awk_t; + + // redefine flt_t. To access Types::flt_t, use the fully qualified + // name as it's overriding Types::flt_t. + typedef hawk_flt_t flt_t; + typedef hawk_int_t int_t; + typedef hawk_uint_t uint_t; + + typedef hawk_loc_t loc_t; + typedef hawk_errnum_t errnum_t; + typedef hawk_errstr_t errstr_t; + typedef hawk_errinf_t errinf_t; + + enum depth_t + { + DEPTH_INCLUDE = HAWK_AWK_DEPTH_INCLUDE, + DEPTH_BLOCK_PARSE = HAWK_AWK_DEPTH_BLOCK_PARSE, + DEPTH_BLOCK_RUN = HAWK_AWK_DEPTH_BLOCK_RUN, + DEPTH_EXPR_PARSE = HAWK_AWK_DEPTH_EXPR_PARSE, + DEPTH_EXPR_RUN = HAWK_AWK_DEPTH_EXPR_RUN, + DEPTH_REX_BUILD = HAWK_AWK_DEPTH_REX_BUILD, + DEPTH_REX_MATCH = HAWK_AWK_DEPTH_REX_MATCH + }; + + /// The gbl_id_t type redefines #hawk_gbl_id_t. + typedef hawk_gbl_id_t gbl_id_t; + + /** Represents an internal awk value */ + typedef hawk_val_t val_t; + + /** Represents a runtime context */ + typedef hawk_rtx_t rtx_t; + + /** Represents an runtime I/O data */ + typedef hawk_rio_arg_t rio_arg_t; + + typedef hawk_rio_cmd_t rio_cmd_t; + + typedef hawk_sio_arg_t sio_arg_t; + + typedef hawk_sio_cmd_t sio_cmd_t; + + typedef hawk_fnc_spec_t fnc_spec_t; + + typedef hawk_fnc_info_t fnc_info_t; + + typedef hawk_mod_spec_t mod_spec_t; + + class Run; + friend class Run; + + +protected: + /// + /// \name Error Handling + /// + /// \{ + + /// + /// The getErrorString() function returns a formatting string + /// for an error code \a num. You can override this function + /// to customize an error message. You must include the same numbers + /// of ${X}'s as the orginal formatting string. Their order may be + /// different. The example below changes the formatting string for + /// #HAWK_AWK_ENOENT. + /// \code + /// const MyHawk::char_t* MyHawk::getErrorString (errnum_t num) const + /// { + /// if (num == HAWK_AWK_ENOENT) return HAWK_T("cannot find '${0}'"); + /// return Hawk::getErrorString (num); + /// } + /// \endcode + /// + virtual const char_t* getErrorString ( + errnum_t num + ) const; + +public: + /// + /// The getErrorNumber() function returns the number of the last + /// error occurred. + /// + errnum_t getErrorNumber () const; + + /// + /// The getErrorLocation() function returns the location of the + /// last error occurred. + /// + loc_t getErrorLocation () const; + + /// + /// The Hawk::getErrorMessage() function returns a message describing + /// the last error occurred. + /// + const char_t* getErrorMessage () const; + + /// + /// The setError() function sets error information. + /// + void setError ( + errnum_t code, ///< error code + const oocs_t* args = HAWK_NULL, ///< message formatting + /// argument array + const loc_t* loc = HAWK_NULL ///< error location + ); + + /// + /// The setErrorWithMessage() functions sets error information + /// with a customized error message. + /// + void setErrorWithMessage ( + errnum_t code, ///< error code + const char_t* msg, ///< error message + const loc_t* loc ///< error location + ); + + /// + /// The clearError() function clears error information + /// + void clearError (); + +//protected: can't make it protected for borland + void retrieveError (); + void retrieveError (Run* run); + /// \} + +protected: + class NoSource; + +public: + /// + /// The Source class is an abstract class to encapsulate + /// source script I/O. The Hawk::parse function requires a concrete + /// object instantiated from its child class. + /// + class HAWK_EXPORT Source + { + public: + /// + /// The Mode type defines opening mode. + /// + enum Mode + { + READ, ///< open for read + WRITE ///< open for write + }; + + /// + /// The Data class encapsulates information passed in and out + /// for source script I/O. + /// + class HAWK_EXPORT Data + { + public: + friend class Hawk; + + protected: + Data (Hawk* awk, Mode mode, sio_arg_t* arg): + awk (awk), mode (mode), arg (arg) + { + } + + public: + Mode getMode() const + { + return this->mode; + } + + bool isMaster() const + { + return this->arg->prev == HAWK_NULL; + } + + const char_t* getName() const + { + return this->arg->name; + } + + // since it doesn't copy the contents, + // it should point to something that outlives this object. + void setName (const char_t* name) + { + this->arg->name = name; + } + + const char_t* getPrevName() const + { + return this->arg->prev->name; + } + + const void* getPrevHandle() const + { + return this->arg->prev->handle; + } + + void* getHandle () const + { + return this->arg->handle; + } + + void setHandle (void* handle) + { + this->arg->handle = handle; + } + + operator Hawk* () const + { + return this->awk; + } + + operator awk_t* () const + { + return this->awk->getHandle(); + } + + protected: + Hawk* awk; + Mode mode; + sio_arg_t* arg; + }; + + Source () {} + virtual ~Source () {} + + virtual int open (Data& io) = 0; + virtual int close (Data& io) = 0; + virtual ssize_t read (Data& io, char_t* buf, size_t len) = 0; + virtual ssize_t write (Data& io, const char_t* buf, size_t len) = 0; + + /// + /// The NONE object indicates no source. + /// + static NoSource NONE; + + private: + Source (const Source&); + Source& operator= (const Source&); + }; + +protected: + class HAWK_EXPORT NoSource: public Source + { + public: + int open (Data& io) { return -1; } + int close (Data& io) { return 0; } + ssize_t read (Data& io, char_t* buf, size_t len) { return 0; } + ssize_t write (Data& io, const char_t* buf, size_t len) { return 0; } + }; + +public: + /// + /// The RIOBase class is a base class to represent runtime I/O + /// operations. The Console, File, Pipe classes implement more specific + /// I/O operations by inheriting this class. + /// + class HAWK_EXPORT RIOBase + { + protected: + RIOBase (Run* run, rio_arg_t* riod); + + public: + const char_t* getName() const; + + const void* getHandle () const; + void setHandle (void* handle); + + int getUflags () const; + void setUflags (int uflags); + + operator Hawk* () const; + operator awk_t* () const; + operator rio_arg_t* () const; + operator Run* () const; + operator rtx_t* () const; + + protected: + Run* run; + rio_arg_t* riod; + + private: + RIOBase (const RIOBase&); + RIOBase& operator= (const RIOBase&); + }; + + /// + /// The Pipe class encapsulates the pipe operations indicated by + /// the | and || operators. + /// + class HAWK_EXPORT Pipe: public RIOBase + { + public: + friend class Hawk; + + /// The Mode type defines the opening mode. + enum Mode + { + /// open for read-only access + READ = HAWK_AWK_RIO_PIPE_READ, + /// open for write-only access + WRITE = HAWK_AWK_RIO_PIPE_WRITE, + /// open for read and write + RW = HAWK_AWK_RIO_PIPE_RW + }; + + /// The CloseMode type defines the closing mode for a pipe + /// opened in the #RW mode. + enum CloseMode + { + /// close both read and write ends + CLOSE_FULL = HAWK_AWK_RIO_CLOSE_FULL, + /// close the read end only + CLOSE_READ = HAWK_AWK_RIO_CLOSE_READ, + /// close the write end only + CLOSE_WRITE = HAWK_AWK_RIO_CLOSE_WRITE + }; + + class HAWK_EXPORT Handler + { + public: + virtual ~Handler () {} + + virtual int open (Pipe& io) = 0; + virtual int close (Pipe& io) = 0; + virtual ssize_t read (Pipe& io, char_t* buf, size_t len) = 0; + virtual ssize_t write (Pipe& io, const char_t* buf, size_t len) = 0; + virtual ssize_t writeBytes (Pipe& io, const hawk_bch_t* buf, size_t len) = 0; + virtual int flush (Pipe& io) = 0; + }; + + protected: + Pipe (Run* run, rio_arg_t* riod); + + public: + /// The getMode() function returns the opening mode requested. + /// You can inspect the opening mode, typically in the + /// openPipe() function, to create a pipe with proper + /// access mode. It is harmless to call this function from + /// other pipe handling functions. + Mode getMode () const; + + /// The getCloseMode() function returns the closing mode + /// requested. The returned value is valid if getMode() + /// returns #RW. + CloseMode getCloseMode () const; + }; + + /// + /// The File class encapsulates file operations by inheriting RIOBase. + /// + class HAWK_EXPORT File: public RIOBase + { + public: + friend class Hawk; + + enum Mode + { + READ = HAWK_AWK_RIO_FILE_READ, + WRITE = HAWK_AWK_RIO_FILE_WRITE, + APPEND = HAWK_AWK_RIO_FILE_APPEND + }; + + class HAWK_EXPORT Handler + { + public: + virtual ~Handler () {} + + virtual int open (File& io) = 0; + virtual int close (File& io) = 0; + virtual ssize_t read (File& io, char_t* buf, size_t len) = 0; + virtual ssize_t write (File& io, const char_t* buf, size_t len) = 0; + virtual ssize_t writeBytes (File& io, const hawk_bch_t* buf, size_t len) = 0; + virtual int flush (File& io) = 0; + }; + + protected: + File (Run* run, rio_arg_t* riod); + + public: + Mode getMode () const; + }; + + /// + /// The Console class encapsulates the console operations by + /// inheriting RIOBase. + /// + class HAWK_EXPORT Console: public RIOBase + { + public: + friend class Hawk; + + /// Console mode enumerators + enum Mode + { + READ = HAWK_AWK_RIO_CONSOLE_READ, ///< open for input + WRITE = HAWK_AWK_RIO_CONSOLE_WRITE ///< open for output + }; + + /// + /// The Handler class is an abstract class that can be + /// implemented for customized I/O handling. + class HAWK_EXPORT Handler + { + public: + virtual ~Handler () {} + + /// The open() function is called before the initial + /// access to the console for input and output. + /// It must return 0 for success and -1 for failure. + /// Upon successful opening, it can store information + /// required using setHandle() and setUflags(). + /// The information set here is available in subsequent + /// calls to other methods and are accessible with + /// getHandle() and getUflags(). + virtual int open (Console& io) = 0; + + /// The close() function is called when the console + /// is not needed any more. It must return 0 for success + /// and -1 for failure. + virtual int close (Console& io) = 0; + + /// The read() function is called when the console + /// is read for input. It must fill the buffer \a buf with + /// data not more than \a len characters and return the + /// number of characters filled into the buufer. It can + /// return 0 to indicate EOF and -1 for failure. + virtual ssize_t read (Console& io, char_t* buf, size_t len) = 0; + + /// The write() function is called when the console + /// is written for output. It can write upto \a len characters + /// available in the buffer \a buf and return the number of + /// characters written. It can return 0 to indicate EOF and -1 + /// for failure. + virtual ssize_t write (Console& io, const char_t* buf, size_t len) = 0; + + virtual ssize_t writeBytes (Console& io, const hawk_bch_t* buf, size_t len) = 0; + + /// You may choose to buffer the data passed to the write() + /// function and perform actual writing when flush() is called. + /// It must return 0 for success and -1 for failure. + virtual int flush (Console& io) = 0; + + /// The next() function is called when \b nextfile or + /// \b nextofile is executed. It must return 0 for success + /// and -1 for failure. + virtual int next (Console& io) = 0; + }; + + protected: + Console (Run* run, rio_arg_t* riod); + ~Console (); + + public: + /// The getMode() function returns if the console is + /// opened for reading or writing. + Mode getMode () const; + + int setFileName (const char_t* name); + int setFNR (int_t fnr); + + protected: + char_t* filename; + }; + + + /// + /// The Value class wraps around #hawk_val_t to provide a more + /// comprehensive interface. + /// + class HAWK_EXPORT Value + { + public: + friend class Hawk; + + #if defined(HAWK_AWK_VALUE_USE_IN_CLASS_PLACEMENT_NEW) + // initialization + void* operator new (size_t n, Run* run) throw (); + void* operator new[] (size_t n, Run* run) throw (); + + #if !defined(__BORLANDC__) && !defined(__WATCOMC__) + // deletion when initialization fails + void operator delete (void* p, Run* run); + void operator delete[] (void* p, Run* run); + #endif + + // normal deletion + void operator delete (void* p); + void operator delete[] (void* p); + #endif + + /// + /// The Index class encapsulates an index of an arrayed value. + /// + class HAWK_EXPORT Index: protected hawk_oocs_t + { + public: + friend class Value; + + /// The Index() function creates an empty array index. + Index () + { + this->ptr = (char_t*)Value::getEmptyStr(); + this->len = 0; + } + + /// The Index() function creates a string array index. + Index (const char_t* ptr, size_t len) + { + this->ptr = (char_t*)ptr; + this->len = len; + } + + void set (const hawk_oocs_t* x) + { + this->ptr = x->ptr; + this->len = x->len; + } + + Index& operator= (const hawk_oocs_t* x) + { + this->set (x); + return *this; + } + + const char_t* pointer () const + { + return this->ptr; + } + + size_t length () const + { + return this->len; + } + }; + + /// + /// Represents a numeric index of an arrayed value + /// + class HAWK_EXPORT IntIndex: public Index + { + public: + IntIndex (int_t num); + + protected: + // 2^32: 4294967296 + // 2^64: 18446744073709551616 + // 2^128: 340282366920938463463374607431768211456 + // -(2^32/2): -2147483648 + // -(2^64/2): -9223372036854775808 + // -(2^128/2): -170141183460469231731687303715884105728 + #if HAWK_SIZEOF_LONG_T > 16 + # error SIZEOF(int_t) TOO LARGE. + # error INCREASE THE BUFFER SIZE TO SUPPORT IT. + #elif HAWK_SIZEOF_LONG_T == 16 + char_t buf[41]; + #elif HAWK_SIZEOF_LONG_T == 8 + char_t buf[21]; + #else + char_t buf[12]; + #endif + }; + + /// + /// The IndexIterator class is a helper class to make simple + /// iteration over array elements. + /// + class HAWK_EXPORT IndexIterator: public hawk_val_map_itr_t + { + public: + friend class Value; + + /// + /// The END variable is a special variable to + /// represent the end of iteration. + /// + static IndexIterator END; + + /// + /// The IndexIterator() function creates an iterator + /// for an arrayed value. + /// + IndexIterator () + { + this->pair = HAWK_NULL; + this->buckno = 0; + } + + protected: + IndexIterator (hawk_htb_pair_t* pair, size_t buckno) + { + this->pair = pair; + this->buckno = buckno; + } + + public: + bool operator== (const IndexIterator& ii) const + { + return this->pair == ii.pair && this->buckno == ii.buckno; + } + + bool operator!= (const IndexIterator& ii) const + { + return !operator== (ii); + } + }; + + /// + /// The Value() function creates an empty value associated + /// with no runtime context. To set an actual inner value, + /// you must specify a context when calling setXXX() functions. + /// i.e., use setInt(run,10) instead of setInt(10). + /// + Value (); + + /// + /// The Value() function creates an empty value associated + /// with a runtime context. + /// + Value (Run& run); + + /// + /// The Value() function creates an empty value associated + /// with a runtime context. + /// + Value (Run* run); + + Value (const Value& v); + ~Value (); + + Value& operator= (const Value& v); + + void clear (); + + operator val_t* () const { return val; } + operator int_t () const; + operator flt_t () const; + operator const char_t* () const; + #if defined(HAWK_OOCH_IS_UCH) + operator const hawk_bch_t* () const; + #endif + + val_t* toVal () const + { + return operator val_t* (); + } + + int_t toInt () const + { + return operator int_t (); + } + + flt_t toFlt () const + { + return operator flt_t (); + } + + const char_t* toStr (size_t* len) const + { + const char_t* p; + size_t l; + + if (this->getStr(&p, &l) <= -1) + { + p = this->getEmptyStr(); + l = 0; + } + + if (len) *len = l; + return p; + } + + const hawk_bch_t* toMbs (size_t* len) const + { + const hawk_bch_t* p; + size_t l; + + if (this->getMbs(&p, &l) <= -1) + { + p = this->getEmptyMbs(); + l = 0; + } + + if (len) *len = l; + return p; + } + + int getInt (int_t* v) const; + int getFlt (flt_t* v) const; + int getNum (int_t* lv, flt_t* fv) const; + int getStr (const char_t** str, size_t* len) const; + int getMbs (const hawk_bch_t** str, size_t* len) const; + + int setVal (val_t* v); + int setVal (Run* r, val_t* v); + + int setInt (int_t v); + int setInt (Run* r, int_t v); + int setFlt (flt_t v); + int setFlt (Run* r, flt_t v); + + int setStr (const char_t* str, size_t len, bool numeric = false); + int setStr (Run* r, const char_t* str, size_t len, bool numeric = false); + int setStr (const char_t* str, bool numeric = false); + int setStr (Run* r, const char_t* str, bool numeric = false); + + int setMbs (const hawk_bch_t* str, size_t len); + int setMbs (Run* r, const hawk_bch_t* str, size_t len); + int setMbs (const hawk_bch_t* str); + int setMbs (Run* r, const hawk_bch_t* str); + + int setIndexedVal (const Index& idx, val_t* v); + int setIndexedVal (Run* r, const Index& idx, val_t* v); + int setIndexedInt (const Index& idx, int_t v); + int setIndexedInt (Run* r, const Index& idx, int_t v); + int setIndexedFlt (const Index& idx, flt_t v); + int setIndexedFlt (Run* r, const Index& idx, flt_t v); + + int setIndexedStr (const Index& idx, const char_t* str, size_t len, bool numeric = false); + int setIndexedStr (Run* r, const Index& idx, const char_t* str, size_t len, bool numeric = false); + int setIndexedStr (const Index& idx, const char_t* str, bool numeric = false); + int setIndexedStr (Run* r, const Index& idx, const char_t* str, bool numeric = false); + + int setIndexedMbs (const Index& idx, const hawk_bch_t* str, size_t len); + int setIndexedMbs (Run* r, const Index& idx, const hawk_bch_t* str, size_t len); + int setIndexedMbs (const Index& idx, const hawk_bch_t* str); + int setIndexedMbs (Run* r, const Index& idx, const hawk_bch_t* str); + + /// + /// The isIndexed() function determines if a value is arrayed. + /// \return true if indexed, false if not. + /// + bool isIndexed () const; + + /// + /// The getIndexed() function gets a value at the given + /// index \a idx and sets it to \a val. + /// \return 0 on success, -1 on failure + /// + int getIndexed ( + const Index& idx, ///< array index + Value* val ///< value holder + ) const; + + /// + /// The getFirstIndex() function stores the first index of + /// an arrayed value into \a idx. + /// \return IndexIterator::END if the arrayed value is empty, + /// iterator that can be passed to getNextIndex() if not + /// + IndexIterator getFirstIndex ( + Index* idx ///< index holder + ) const; + + /// + /// The getNextIndex() function stores into \a idx the next + /// index of an array value from the position indicated by + /// \a iter. + /// \return IndexIterator::END if the arrayed value is empty, + /// iterator that can be passed to getNextIndex() if not + /// + IndexIterator getNextIndex ( + Index* idx, ///< index holder + const IndexIterator& curitr ///< current position + ) const; + + protected: + Run* run; + val_t* val; + + mutable struct + { + hawk_oocs_t str; + hawk_bcs_t mbs; + } cached; + + public: + static const char_t* getEmptyStr(); + static const hawk_bch_t* getEmptyMbs(); + }; + +public: + /// + /// The Run class wraps around #hawk_rtx_t to represent the + /// runtime context. + /// + class HAWK_EXPORT Run + { + protected: + friend class Hawk; + friend class Value; + friend class RIOBase; + friend class Console; + + Run (Hawk* awk); + Run (Hawk* awk, rtx_t* run); + ~Run (); + + public: + operator Hawk* () const; + operator rtx_t* () const; + + void halt () const; + bool isHalt () const; + + errnum_t getErrorNumber () const; + loc_t getErrorLocation () const; + const char_t* getErrorMessage () const; + + void setError ( + errnum_t code, + const oocs_t* args = HAWK_NULL, + const loc_t* loc = HAWK_NULL + ); + + void setErrorWithMessage ( + errnum_t code, + const char_t* msg, + const loc_t* loc + ); + + /// + /// The setGlobal() function sets the value of a global + /// variable identified by \a id + /// to \a v. + /// \return 0 on success, -1 on failure + /// + int setGlobal (int id, int_t v); + + /// + /// The setGlobal() function sets the value of a global + /// variable identified by \a id + /// to \a v. + /// \return 0 on success, -1 on failure + /// + int setGlobal (int id, flt_t v); + + /// + /// The setGlobal() function sets the value of a global + /// variable identified by \a id + /// to a string as long as \a len characters pointed to by + /// \a ptr. + /// \return 0 on success, -1 on failure + /// + int setGlobal (int id, const char_t* ptr, size_t len); + + /// + /// The setGlobal() function sets a global variable + /// identified by \a id to a value \a v. + /// \return 0 on success, -1 on failure + /// + int setGlobal (int id, const Value& v); + + /// + /// The getGlobal() function gets the value of a global + /// variable identified by \a id and stores it in \a v. + /// \return 0 on success, -1 on failure + /// + int getGlobal (int id, Value& v) const; + + protected: + Hawk* awk; + rtx_t* rtx; + }; + + /// + /// Returns the primitive handle + /// + operator awk_t* () const; + + /// + /// \name Basic Functions + /// \{ + /// + + /// The Hawk() function creates an interpreter without fully + /// initializing it. You must call open() for full initialization + /// before calling other functions. + Hawk (Mmgr* mmgr = HAWK_NULL); + + /// The ~Hawk() function destroys an interpreter. Make sure to have + /// called close() for finalization before the destructor is executed. + virtual ~Hawk () {} + + hawk_cmgr_t* getCmgr () const; + + /// + /// The open() function initializes an interpreter. + /// You must call this function before doing anything meaningful. + /// \return 0 on success, -1 on failure + /// + int open (); + + /// + /// The close() function closes the interpreter. + /// + void close (); + + /// + /// The uponClosing() function is called back after Hawk::close() + /// has cleared most of the internal data but before destroying + /// the underlying awk object. This maps to the close callback + /// of #hawk_ecb_t. + /// + virtual void uponClosing (); + + /// + /// The uponClearing() function is called back when Hawk::close() + /// begins clearing internal data. This maps to the clear callback + /// of #hawk_ecb_t. + /// + virtual void uponClearing (); + + /// + /// The parse() function parses the source code read from the input + /// stream \a in and writes the parse tree to the output stream \a out. + /// To disable deparsing, you may set \a out to Hawk::Source::NONE. + /// However, it is not allowed to specify Hawk::Source::NONE for \a in. + /// + /// \return Run object on success, #HAWK_NULL on failure + /// + Hawk::Run* parse ( + Source& in, ///< script to parse + Source& out ///< deparsing target + ); + + /// + /// The getRunContext() funciton returns the execution context + /// returned by the parse() function. The returned context + /// is valid if parse() has been called. You may call this + /// function to get the context if you forgot to store it + /// in a call to parse(). + /// + const Hawk::Run* getRunContext () const + { + return &runctx; + } + + /// + /// The getRunContext() funciton returns the execution context + /// returned by the parse() function. The returned context + /// is valid if parse() has been called. You may call this + /// function to get the context if you forgot to store it + /// in a call to parse(). + /// + Hawk::Run* getRunContext () + { + return &runctx; + } + + /// + /// The resetRunContext() function closes an existing + /// execution context and creates a new execution context. + /// You may want to call this function if you want to + /// reset it without calling the parse() function again + /// after the first call to it. + Hawk::Run* resetRunContext (); + + /// + /// The loop() function executes the BEGIN block, pattern-action blocks, + /// and the END block. The return value is stored into \a ret. + /// \return 0 on succes, -1 on failure + /// + int loop ( + Value* ret ///< return value holder + ); + + /// + /// The call() function invokes a function named \a name. + /// + int call ( + const hawk_bch_t* name, ///< function name + Value* ret, ///< return value holder + const Value* args, ///< argument array + size_t nargs ///< number of arguments + ); + + /// + /// The call() function invokes a function named \a name. + /// + int call ( + const hawk_uch_t* name, ///< function name + Value* ret, ///< return value holder + const Value* args, ///< argument array + size_t nargs ///< number of arguments + ); + + /// + /// The halt() function makes request to abort execution + /// + void halt (); + /// \} + + /// + /// \name Configuration + /// \{ + /// + + /// + /// The getTrait() function gets the current options. + /// \return current traits + /// + int getTrait () const; + + /// + /// The setTrait() function changes the current traits. + /// + void setTrait ( + int trait + ); + + /// + /// The setMaxDepth() function sets the maximum processing depth + /// for operations identified by \a ids. + /// + void setMaxDepth ( + depth_t id, ///< depth identifier + size_t depth ///< new depth + ); + + /// + /// The getMaxDepth() function gets the maximum depth for an operation + /// type identified by \a id. + /// + size_t getMaxDepth ( + depth_t id ///< depth identifier + ) const; + + /// + /// The addArgument() function adds an ARGV string as long as \a len + /// characters pointed to + /// by \a arg. loop() and call() make a string added available + /// to a script through ARGV. + /// \return 0 on success, -1 on failure + /// + int addArgument ( + const char_t* arg, ///< string pointer + size_t len ///< string length + ); + + /// + /// The addArgument() function adds a null-terminated string \a arg. + /// loop() and call() make a string added available to a script + /// through ARGV. + /// \return 0 on success, -1 on failure + /// + int addArgument ( + const char_t* arg ///< string pointer + ); + + /// + /// The clearArguments() function deletes all ARGV strings. + /// + void clearArguments (); + + /// + /// The addGlobal() function registers an intrinsic global variable. + /// \return integer >= 0 on success, -1 on failure. + /// + int addGlobal ( + const hawk_bch_t* name ///< variable name + ); + + int addGlobal ( + const hawk_uch_t* name ///< variable name + ); + + /// + /// The deleteGlobal() function unregisters an intrinsic global + /// variable by name. + /// \return 0 on success, -1 on failure. + /// + int deleteGlobal ( + const hawk_bch_t* name ///< variable name + ); + + int deleteGlobal ( + const hawk_uch_t* name ///< variable name + ); + + /// + /// The findGlobal() function returns the numeric ID of an intrinsic + // global variable. + /// \return integer >= 0 on success, -1 on failure. + /// + int findGlobal ( + const hawk_bch_t* name ///> variable name + ); + int findGlobal ( + const hawk_uch_t* name ///> variable name + ); + + /// + /// The setGlobal() function sets the value of a global variable + /// identified by \a id. The \a id is either a value returned by + /// addGlobal() or one of the #gbl_id_t enumerators. It is not allowed + /// to call this function prior to parse(). + /// \return 0 on success, -1 on failure + /// + int setGlobal ( + int id, ///< numeric identifier + const Value& v ///< value + ); + + /// + /// The getGlobal() function gets the value of a global variable + /// identified by \a id. The \a id is either a value returned by + /// addGlobal() or one of the #gbl_id_t enumerators. It is not allowed + /// to call this function before parse(). + /// \return 0 on success, -1 on failure + /// + int getGlobal ( + int id, ///< numeric identifier + Value& v ///< value store + ); + + /// + /// The FunctionHandler type defines a intrinsic function handler. + /// + typedef int (Hawk::*FunctionHandler) ( + Run& run, + Value& ret, + Value* args, + size_t nargs, + const fnc_info_t* fi + ); + + /// + /// The addFunction() function adds a new user-defined intrinsic + /// function. + /// + int addFunction ( + const hawk_bch_t* name, ///< function name + size_t minArgs, ///< minimum numbers of arguments + size_t maxArgs, ///< maximum numbers of arguments + const hawk_bch_t* argSpec, ///< argument specification + FunctionHandler handler, ///< function handler + int validOpts = 0 ///< valid if these options are set + ); + + int addFunction ( + const hawk_uch_t* name, ///< function name + size_t minArgs, ///< minimum numbers of arguments + size_t maxArgs, ///< maximum numbers of arguments + const hawk_uch_t* argSpec, ///< argument specification + FunctionHandler handler, ///< function handler + int validOpts = 0 ///< valid if these options are set + ); + + /// + /// The deleteFunction() function deletes a user-defined intrinsic + /// function by name. + /// + int deleteFunction ( + const char_t* name ///< function name + ); + /// \} + + Pipe::Handler* getPipeHandler () + { + return this->pipe_handler; + } + + const Pipe::Handler* getPipeHandler () const + { + return this->pipe_handler; + } + + /// + /// The setPipeHandler() function registers an external pipe + /// handler object. An external pipe handler can be implemented + /// outside this class without overriding various pipe functions. + /// Note that an external pipe handler must outlive an outer + /// awk object. + /// + void setPipeHandler (Pipe::Handler* handler) + { + this->pipe_handler = handler; + } + + File::Handler* getFileHandler () + { + return this->file_handler; + } + + const File::Handler* getFileHandler () const + { + return this->file_handler; + } + + /// + /// The setFileHandler() function registers an external file + /// handler object. An external file handler can be implemented + /// outside this class without overriding various file functions. + /// Note that an external file handler must outlive an outer + /// awk object. + /// + void setFileHandler (File::Handler* handler) + { + this->file_handler = handler; + } + + Console::Handler* getConsoleHandler () + { + return this->console_handler; + } + + const Console::Handler* getConsoleHandler () const + { + return this->console_handler; + } + + /// + /// The setConsoleHandler() function registers an external console + /// handler object. An external file handler can be implemented + /// outside this class without overriding various console functions. + /// Note that an external console handler must outlive an outer + /// awk object. + /// + void setConsoleHandler (Console::Handler* handler) + { + this->console_handler = handler; + } + +protected: + /// + /// \name Pipe I/O handlers + /// Pipe operations are achieved through the following functions + /// if no external pipe handler is set with setPipeHandler(). + /// \{ + + /// The openPipe() function is a pure virtual function that must be + /// overridden by a child class to open a pipe. It must return 1 + /// on success, 0 on end of a pipe, and -1 on failure. + virtual int openPipe (Pipe& io); + + /// The closePipe() function is a pure virtual function that must be + /// overridden by a child class to close a pipe. It must return 0 + /// on success and -1 on failure. + virtual int closePipe (Pipe& io); + + virtual ssize_t readPipe (Pipe& io, char_t* buf, size_t len); + virtual ssize_t writePipe (Pipe& io, const char_t* buf, size_t len); + virtual ssize_t writePipeBytes (Pipe& io, const hawk_bch_t* buf, size_t len); + virtual int flushPipe (Pipe& io); + /// \} + + /// + /// \name File I/O handlers + /// File operations are achieved through the following functions + /// if no external file handler is set with setFileHandler(). + /// \{ + /// + virtual int openFile (File& io); + virtual int closeFile (File& io); + virtual ssize_t readFile (File& io, char_t* buf, size_t len); + virtual ssize_t writeFile (File& io, const char_t* buf, size_t len); + virtual ssize_t writeFileBytes (File& io, const hawk_bch_t* buf, size_t len); + virtual int flushFile (File& io); + /// \} + + /// + /// \name Console I/O handlers + /// Console operations are achieved through the following functions. + /// if no external console handler is set with setConsoleHandler(). + /// \{ + /// + virtual int openConsole (Console& io); + virtual int closeConsole (Console& io); + virtual ssize_t readConsole (Console& io, char_t* buf, size_t len); + virtual ssize_t writeConsole (Console& io, const char_t* buf, size_t len); + virtual ssize_t writeConsoleBytes (Console& io, const hawk_bch_t* buf, size_t len); + virtual int flushConsole (Console& io); + virtual int nextConsole (Console& io); + /// \} + + // primitive handlers + virtual flt_t pow (flt_t x, flt_t y) = 0; + virtual flt_t mod (flt_t x, flt_t y) = 0; + + virtual void* modopen (const mod_spec_t* spec) = 0; + virtual void modclose (void* handle) = 0; + virtual void* modsym (void* handle, const char_t* name) = 0; + + // static glue members for various handlers + static ssize_t readSource ( + awk_t* awk, sio_cmd_t cmd, sio_arg_t* arg, + char_t* data, size_t count); + static ssize_t writeSource ( + awk_t* awk, sio_cmd_t cmd, sio_arg_t* arg, + char_t* data, size_t count); + + static ssize_t pipeHandler ( + rtx_t* rtx, rio_cmd_t cmd, rio_arg_t* riod, + void* data, size_t count); + static ssize_t fileHandler ( + rtx_t* rtx, rio_cmd_t cmd, rio_arg_t* riod, + void* data, size_t count); + static ssize_t consoleHandler ( + rtx_t* rtx, rio_cmd_t cmd, rio_arg_t* riod, + void* data, size_t count); + + static int functionHandler (rtx_t* rtx, const fnc_info_t* fi); + + + static flt_t pow (awk_t* awk, flt_t x, flt_t y); + static flt_t mod (awk_t* awk, flt_t x, flt_t y); + + static void* modopen (awk_t* awk, const mod_spec_t* spec); + static void modclose (awk_t* awk, void* handle); + static void* modsym (awk_t* awk, void* handle, const char_t* name); + +public: + // use this with care + awk_t* getHandle() const { return this->awk; } + +protected: + awk_t* awk; + + errstr_t dflerrstr; + errinf_t errinf; + +#if defined(HAWK_AWK_USE_HTB_FOR_FUNCTION_MAP) + hawk_htb_t* functionMap; +#else + + class FunctionMap: public HashTable + { + public: + FunctionMap (Hawk* awk): awk(awk) {} + + protected: + Hawk* awk; + }; + + FunctionMap functionMap; +#endif + + Source* source_reader; + Source* source_writer; + + Pipe::Handler* pipe_handler; + File::Handler* file_handler; + Console::Handler* console_handler; + + struct xstrs_t + { + xstrs_t (): ptr (HAWK_NULL), len (0), capa (0) {} + + int add (awk_t* awk, const char_t* arg, size_t len); + void clear (awk_t* awk); + + hawk_oocs_t* ptr; + size_t len; + size_t capa; + }; + + xstrs_t runarg; + +private: + Run runctx; + + int init_runctx (); + void fini_runctx (); + int dispatch_function (Run* run, const fnc_info_t* fi); + + static const char_t* xerrstr (awk_t* a, errnum_t num); +}; + +///////////////////////////////// +HAWK_END_NAMESPACE(QSE) +///////////////////////////////// + +#endif diff --git a/hawk/lib/Makefile.am b/hawk/lib/Makefile.am new file mode 100644 index 00000000..45cb3cc6 --- /dev/null +++ b/hawk/lib/Makefile.am @@ -0,0 +1,221 @@ +AUTOMAKE_OPTIONS = nostdinc + +##AM_CFLAGS = $(PTHREAD_CFLAGS) + +CPPFLAGS_ALL_COMMON = \ + -I$(abs_builddir) \ + -I$(abs_srcdir) \ + -I$(includedir) + +if ENABLE_STATIC_MODULE +LDFLAGS_ALL_COMMON = -L../mod +else +LDFLAGS_ALL_COMMON = -L. +endif + +################################################## +# MAIN LIBRARY +################################################## + +CPPFLAGS_LIB_COMMON = $(CPPFLAGS_ALL_COMMON) $(LTDLINCL) +LDFLAGS_LIB_COMMON = $(LDFLAGS_ALL_COMMON) -version-info 1:0:0 -no-undefined +LIBADD_LIB_COMMON = $(LIBM) +DEPENDENCIES_LIB_COMMON = + +if ENABLE_LIBLTDL +LIBADD_LIB_COMMON += $(LTDL_LIBS) +else +LIBADD_LIB_COMMON += $(DL_LIBS) +endif + +if WIN32 +# you must adjust the value of DEFAULT_MODPOSTFIX according +# to the first number in -version-info above +CPPFLAGS_PFMOD = -DHAWK_DEFAULT_MODPREFIX=\"libhawk-\" -DHAWK_DEFAULT_MODPOSTFIX=\"-1.dll\" +else +CPPFLAGS_PFMOD = -DHAWK_DEFAULT_MODPREFIX=\"$(libdir)/libhawk-\" +if MACOSX +CPPFLAGS_PFMOD += -DHAWK_DEFAULT_MODPOSTFIX=\".dylib\" +else +CPPFLAGS_PFMOD += -DHAWK_DEFAULT_MODPOSTFIX=\".so\" +endif +endif + +################################################## +# include files to deploy +################################################## + +pkgincludedir = $(includedir) + +pkginclude_HEADERS = \ + hawk.h \ + hawk-chr.h \ + hawk-cmn.h \ + hawk-ecs.h \ + hawk-fmt.h \ + hawk-htb.h \ + hawk-rbt.h \ + hawk-pack1.h \ + hawk-pma.h \ + hawk-utl.h \ + hawk-std.h \ + hawk-tre.h \ + hawk-unpack.h + + +################################################## +# libraries to deploy +################################################## +pkglibdir = $(libdir) +pkglib_LTLIBRARIES = libhawk.la + +libhawk_la_SOURCES = \ + $(pkginclude_HEADERS) \ + arr.c \ + chr.c \ + ecs-imp.h \ + ecs.c \ + err-prv.h \ + err.c \ + fmt-imp.h \ + fmt.c \ + fnc-prv.h \ + fnc.c \ + htb.c \ + hawk-prv.h \ + hawk.c \ + mb8.c \ + misc-imp.h \ + misc-prv.h \ + misc.c \ + parse-prv.h \ + parse.c \ + pma.c \ + rbt.c \ + rec.c \ + rio-prv.h \ + rio.c \ + run-prv.h \ + run.c \ + tre-prv.h \ + tre-ast.c \ + tre-ast.h \ + tre-compile.c \ + tre-compile.h \ + tre-match-bt.c \ + tre-match-pa.c \ + tre-match-ut.h \ + tre-parse.c \ + tre-parse.h \ + tre-stack.c \ + tre-stack.h \ + tre.c \ + tree-prv.h \ + tree.c \ + utf16.c \ + utf8.c \ + utl-sort.c \ + utl-str.c \ + utl-sys.c \ + utl.c \ + val-imp.h \ + val-prv.h \ + val.c + +libhawk_la_SOURCES += \ + hawk-cli.h \ + hawk-fio.h \ + hawk-mtx.h \ + hawk-pio.h \ + hawk-sio.h \ + hawk-tio.h \ + cli.c \ + fio.c \ + mtx.c \ + pio.c \ + sio.c \ + syscall.h \ + syserr.h \ + tio.c \ + std-prv.h \ + std.c + +libhawk_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) +libhawk_la_LDFLAGS = $(LDFLAGS_LIB_COMMON) +libhawk_la_LIBADD = $(LIBADD_LIB_COMMON) +libhawk_la_DEPENDENCIES = $(DEPENDENCIES_LIB_COMMON) + +if ENABLE_CXX +pkglib_LTLIBRARIES += libhawkxx.la +libhawkxx_la_SOURCES = Hawk.cpp StdHawk.cpp +libhawkxx_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) +libhawkxx_la_LDFLAGS = $(LDFLAGS_LIB_COMMON) +libhawkxx_la_LIBADD = -lhawk $(LIBADD_LIB_COMMON) +libhawkxx_la_DEPENDENCIES = libhawk.la +endif + +if ENABLE_STATIC_MODULE + +################################################## +# STATIC MODULES BUILT INTO MAIN LIBRARY +################################################## +libhawk_la_SOURCES += \ + imap-imp.h \ + mod-math.c mod-math.h \ + mod-str.c mod-str.h +##libhawk_la_LIBADD += + +### mod-dir.c mod-dir.h +### mod-sys.c mod-sys.h + +if ENABLE_MOD_MYSQL +libhawk_la_LIBADD += -lhawk-mysql +libhawk_la_DEPENDENCIES += ../mod/libhawk-mysql.la +endif + +if ENABLE_MOD_UCI +libhawk_la_LIBADD += -lhawk-uci +libhawk_la_DEPENDENCIES += ../mod/libhawk-uci.la +endif + +else +################################################## +# DYNAMIC MODULES +################################################## + +CPPFLAGS_MOD_COMMON = $(CPPFLAGS_ALL_COMMON) +LDFLAGS_MOD_COMMON = $(LDFLAGS_ALL_COMMON) +LIBADD_MOD_COMMON = -lhawk +DEPENDENCIES_MOD_COMMON = libhawk.la + +#modexecdir = $(libdir) +# +#modexec_LTLIBRARIES = libhawk-dir.la +#libhawk_dir_la_SOURCES = mod-dir.c mod-dir.h +#libhawk_dir_la_CPPFLAGS = $(CPPFLAGS_MOD_COMMON) +#libhawk_dir_la_LDFLAGS = $(LDFLAGS_MOD_COMMON) -L../si +#libhawk_dir_la_LIBADD = $(LIBADD_MOD_COMMON) -lqsesi +#libhawk_dir_la_DEPENDENCIES = $(DEPENDENCIES_MOD_COMMON) ../../lib/si/libqsesi.la +# +#modexec_LTLIBRARIES += libhawk-math.la +#libhawk_math_la_SOURCES = mod-math.c mod-math.h +#libhawk_math_la_CPPFLAGS = $(CPPFLAGS_MOD_COMMON) +#libhawk_math_la_LDFLAGS = $(LDFLAGS_MOD_COMMON) +#libhawk_math_la_LIBADD = $(LIBADD_MOD_COMMON) +#libhawk_math_la_DEPENDENCIES = $(DEPENDENCIES_MOD_COMMON) +# +#modexec_LTLIBRARIES += libhawk-str.la +#libhawk_str_la_SOURCES = mod-str.c mod-str.h +#libhawk_str_la_CPPFLAGS = $(CPPFLAGS_MOD_COMMON) +#libhawk_str_la_LDFLAGS = $(LDFLAGS_MOD_COMMON) +#libhawk_str_la_LIBADD = $(LIBADD_MOD_COMMON) +#libhawk_str_la_DEPENDENCIES = $(DEPENDENCIES_MOD_COMMON) +# +#modexec_LTLIBRARIES += libhawk-sys.la +#libhawk_sys_la_SOURCES = mod-sys.c mod-sys.h +#libhawk_sys_la_CPPFLAGS = $(CPPFLAGS_MOD_COMMON) +#libhawk_sys_la_LDFLAGS = $(LDFLAGS_MOD_COMMON) -L../si +#libhawk_sys_la_LIBADD = $(LIBADD_MOD_COMMON) -lqsesi +#libhawk_sys_la_DEPENDENCIES = $(DEPENDENCIES_MOD_COMMON) ../../lib/si/libqsesi.la + +endif diff --git a/hawk/lib/Makefile.in b/hawk/lib/Makefile.in new file mode 100644 index 00000000..0cb275f7 --- /dev/null +++ b/hawk/lib/Makefile.in @@ -0,0 +1,1403 @@ +# Makefile.in generated by automake 1.16.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2018 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@ +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@ +@ENABLE_LIBLTDL_TRUE@am__append_1 = $(LTDL_LIBS) +@ENABLE_LIBLTDL_FALSE@am__append_2 = $(DL_LIBS) +@MACOSX_TRUE@@WIN32_FALSE@am__append_3 = -DHAWK_DEFAULT_MODPOSTFIX=\".dylib\" +@MACOSX_FALSE@@WIN32_FALSE@am__append_4 = -DHAWK_DEFAULT_MODPOSTFIX=\".so\" +@ENABLE_CXX_TRUE@am__append_5 = libhawkxx.la + +################################################## +# STATIC MODULES BUILT INTO MAIN LIBRARY +################################################## +@ENABLE_STATIC_MODULE_TRUE@am__append_6 = \ +@ENABLE_STATIC_MODULE_TRUE@ imap-imp.h \ +@ENABLE_STATIC_MODULE_TRUE@ mod-math.c mod-math.h \ +@ENABLE_STATIC_MODULE_TRUE@ mod-str.c mod-str.h + + +### mod-dir.c mod-dir.h +### mod-sys.c mod-sys.h +@ENABLE_MOD_MYSQL_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_7 = -lhawk-mysql +@ENABLE_MOD_MYSQL_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_8 = ../mod/libhawk-mysql.la +@ENABLE_MOD_UCI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_9 = -lhawk-uci +@ENABLE_MOD_UCI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_10 = ../mod/libhawk-uci.la +subdir = lib +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ + $(top_srcdir)/m4/ax_cxx_namespace.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)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(pkginclude_HEADERS) \ + $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = hawk-cfg.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(pkglibdir)" \ + "$(DESTDIR)$(pkgincludedir)" +LTLIBRARIES = $(pkglib_LTLIBRARIES) +am__DEPENDENCIES_1 = +@ENABLE_LIBLTDL_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) +@ENABLE_LIBLTDL_FALSE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) +am__DEPENDENCIES_4 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) +am__libhawk_la_SOURCES_DIST = hawk.h hawk-chr.h hawk-cmn.h hawk-ecs.h \ + hawk-fmt.h hawk-htb.h hawk-rbt.h hawk-pack1.h hawk-pma.h \ + hawk-utl.h hawk-std.h hawk-tre.h hawk-unpack.h arr.c chr.c \ + ecs-imp.h ecs.c err-prv.h err.c fmt-imp.h fmt.c fnc-prv.h \ + fnc.c htb.c hawk-prv.h hawk.c mb8.c misc-imp.h misc-prv.h \ + misc.c parse-prv.h parse.c pma.c rbt.c rec.c rio-prv.h rio.c \ + run-prv.h run.c tre-prv.h tre-ast.c tre-ast.h tre-compile.c \ + tre-compile.h tre-match-bt.c tre-match-pa.c tre-match-ut.h \ + tre-parse.c tre-parse.h tre-stack.c tre-stack.h tre.c \ + tree-prv.h tree.c utf16.c utf8.c utl-sort.c utl-str.c \ + utl-sys.c utl.c val-imp.h val-prv.h val.c hawk-cli.h \ + hawk-fio.h hawk-mtx.h hawk-pio.h hawk-sio.h hawk-tio.h cli.c \ + fio.c mtx.c pio.c sio.c syscall.h syserr.h tio.c std-prv.h \ + std.c imap-imp.h mod-math.c mod-math.h mod-str.c mod-str.h +am__objects_1 = +@ENABLE_STATIC_MODULE_TRUE@am__objects_2 = libhawk_la-mod-math.lo \ +@ENABLE_STATIC_MODULE_TRUE@ libhawk_la-mod-str.lo +am_libhawk_la_OBJECTS = $(am__objects_1) libhawk_la-arr.lo \ + libhawk_la-chr.lo libhawk_la-ecs.lo libhawk_la-err.lo \ + libhawk_la-fmt.lo libhawk_la-fnc.lo libhawk_la-htb.lo \ + libhawk_la-hawk.lo libhawk_la-mb8.lo libhawk_la-misc.lo \ + libhawk_la-parse.lo libhawk_la-pma.lo libhawk_la-rbt.lo \ + libhawk_la-rec.lo libhawk_la-rio.lo libhawk_la-run.lo \ + libhawk_la-tre-ast.lo libhawk_la-tre-compile.lo \ + libhawk_la-tre-match-bt.lo libhawk_la-tre-match-pa.lo \ + libhawk_la-tre-parse.lo libhawk_la-tre-stack.lo \ + libhawk_la-tre.lo libhawk_la-tree.lo libhawk_la-utf16.lo \ + libhawk_la-utf8.lo libhawk_la-utl-sort.lo \ + libhawk_la-utl-str.lo libhawk_la-utl-sys.lo libhawk_la-utl.lo \ + libhawk_la-val.lo libhawk_la-cli.lo libhawk_la-fio.lo \ + libhawk_la-mtx.lo libhawk_la-pio.lo libhawk_la-sio.lo \ + libhawk_la-tio.lo libhawk_la-std.lo $(am__objects_2) +libhawk_la_OBJECTS = $(am_libhawk_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libhawk_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libhawk_la_LDFLAGS) $(LDFLAGS) -o $@ +am__libhawkxx_la_SOURCES_DIST = Hawk.cpp StdHawk.cpp +@ENABLE_CXX_TRUE@am_libhawkxx_la_OBJECTS = libhawkxx_la-Hawk.lo \ +@ENABLE_CXX_TRUE@ libhawkxx_la-StdHawk.lo +libhawkxx_la_OBJECTS = $(am_libhawkxx_la_OBJECTS) +libhawkxx_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(libhawkxx_la_LDFLAGS) $(LDFLAGS) -o $@ +@ENABLE_CXX_TRUE@am_libhawkxx_la_rpath = -rpath $(pkglibdir) +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 = +DEFAULT_INCLUDES = +depcomp = $(SHELL) $(top_srcdir)/ac/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/libhawk_la-arr.Plo \ + ./$(DEPDIR)/libhawk_la-chr.Plo ./$(DEPDIR)/libhawk_la-cli.Plo \ + ./$(DEPDIR)/libhawk_la-ecs.Plo ./$(DEPDIR)/libhawk_la-err.Plo \ + ./$(DEPDIR)/libhawk_la-fio.Plo ./$(DEPDIR)/libhawk_la-fmt.Plo \ + ./$(DEPDIR)/libhawk_la-fnc.Plo ./$(DEPDIR)/libhawk_la-hawk.Plo \ + ./$(DEPDIR)/libhawk_la-htb.Plo ./$(DEPDIR)/libhawk_la-mb8.Plo \ + ./$(DEPDIR)/libhawk_la-misc.Plo \ + ./$(DEPDIR)/libhawk_la-mod-math.Plo \ + ./$(DEPDIR)/libhawk_la-mod-str.Plo \ + ./$(DEPDIR)/libhawk_la-mtx.Plo \ + ./$(DEPDIR)/libhawk_la-parse.Plo \ + ./$(DEPDIR)/libhawk_la-pio.Plo ./$(DEPDIR)/libhawk_la-pma.Plo \ + ./$(DEPDIR)/libhawk_la-rbt.Plo ./$(DEPDIR)/libhawk_la-rec.Plo \ + ./$(DEPDIR)/libhawk_la-rio.Plo ./$(DEPDIR)/libhawk_la-run.Plo \ + ./$(DEPDIR)/libhawk_la-sio.Plo ./$(DEPDIR)/libhawk_la-std.Plo \ + ./$(DEPDIR)/libhawk_la-tio.Plo \ + ./$(DEPDIR)/libhawk_la-tre-ast.Plo \ + ./$(DEPDIR)/libhawk_la-tre-compile.Plo \ + ./$(DEPDIR)/libhawk_la-tre-match-bt.Plo \ + ./$(DEPDIR)/libhawk_la-tre-match-pa.Plo \ + ./$(DEPDIR)/libhawk_la-tre-parse.Plo \ + ./$(DEPDIR)/libhawk_la-tre-stack.Plo \ + ./$(DEPDIR)/libhawk_la-tre.Plo ./$(DEPDIR)/libhawk_la-tree.Plo \ + ./$(DEPDIR)/libhawk_la-utf16.Plo \ + ./$(DEPDIR)/libhawk_la-utf8.Plo \ + ./$(DEPDIR)/libhawk_la-utl-sort.Plo \ + ./$(DEPDIR)/libhawk_la-utl-str.Plo \ + ./$(DEPDIR)/libhawk_la-utl-sys.Plo \ + ./$(DEPDIR)/libhawk_la-utl.Plo ./$(DEPDIR)/libhawk_la-val.Plo \ + ./$(DEPDIR)/libhawkxx_la-Hawk.Plo \ + ./$(DEPDIR)/libhawkxx_la-StdHawk.Plo +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +AM_V_CXX = $(am__v_CXX_@AM_V@) +am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) +am__v_CXX_0 = @echo " CXX " $@; +am__v_CXX_1 = +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) +am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) +am__v_CXXLD_0 = @echo " CXXLD " $@; +am__v_CXXLD_1 = +SOURCES = $(libhawk_la_SOURCES) $(libhawkxx_la_SOURCES) +DIST_SOURCES = $(am__libhawk_la_SOURCES_DIST) \ + $(am__libhawkxx_la_SOURCES_DIST) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +HEADERS = $(pkginclude_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)hawk-cfg.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/hawk-cfg.h.in \ + $(top_srcdir)/ac/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +################################################## +# include files to deploy +################################################## +pkgincludedir = $(includedir) + +################################################## +# libraries to deploy +################################################## +pkglibdir = $(libdir) +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@ +DYNCALL_LIBS = @DYNCALL_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FFI_LIBS = @FFI_LIBS@ +FGREP = @FGREP@ +GREP = @GREP@ +HAVE_CXX = @HAVE_CXX@ +HAWK_PROJECT_AUTHOR = @HAWK_PROJECT_AUTHOR@ +HAWK_PROJECT_URL = @HAWK_PROJECT_URL@ +HAWK_SIZEOF_CHAR = @HAWK_SIZEOF_CHAR@ +HAWK_SIZEOF_DOUBLE = @HAWK_SIZEOF_DOUBLE@ +HAWK_SIZEOF_FLOAT = @HAWK_SIZEOF_FLOAT@ +HAWK_SIZEOF_INT = @HAWK_SIZEOF_INT@ +HAWK_SIZEOF_LONG = @HAWK_SIZEOF_LONG@ +HAWK_SIZEOF_LONG_DOUBLE = @HAWK_SIZEOF_LONG_DOUBLE@ +HAWK_SIZEOF_LONG_LONG = @HAWK_SIZEOF_LONG_LONG@ +HAWK_SIZEOF_OFF64_T = @HAWK_SIZEOF_OFF64_T@ +HAWK_SIZEOF_OFF_T = @HAWK_SIZEOF_OFF_T@ +HAWK_SIZEOF_SHORT = @HAWK_SIZEOF_SHORT@ +HAWK_SIZEOF_VOID_P = @HAWK_SIZEOF_VOID_P@ +HAWK_SIZEOF_WCHAR_T = @HAWK_SIZEOF_WCHAR_T@ +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@ +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@ +QUADMATH_LIBS = @QUADMATH_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SOCKET_LIBS = @SOCKET_LIBS@ +STRIP = @STRIP@ +UNICOWS_LIBS = @UNICOWS_LIBS@ +UNWIND_LIBS = @UNWIND_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@ +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 = nostdinc +CPPFLAGS_ALL_COMMON = \ + -I$(abs_builddir) \ + -I$(abs_srcdir) \ + -I$(includedir) + +@ENABLE_STATIC_MODULE_FALSE@LDFLAGS_ALL_COMMON = -L. +@ENABLE_STATIC_MODULE_TRUE@LDFLAGS_ALL_COMMON = -L../mod + +################################################## +# MAIN LIBRARY +################################################## +CPPFLAGS_LIB_COMMON = $(CPPFLAGS_ALL_COMMON) $(LTDLINCL) +LDFLAGS_LIB_COMMON = $(LDFLAGS_ALL_COMMON) -version-info 1:0:0 -no-undefined +LIBADD_LIB_COMMON = $(LIBM) $(am__append_1) $(am__append_2) +DEPENDENCIES_LIB_COMMON = +@WIN32_FALSE@CPPFLAGS_PFMOD = \ +@WIN32_FALSE@ -DHAWK_DEFAULT_MODPREFIX=\"$(libdir)/libhawk-\" \ +@WIN32_FALSE@ $(am__append_3) $(am__append_4) + +# you must adjust the value of DEFAULT_MODPOSTFIX according +# to the first number in -version-info above +@WIN32_TRUE@CPPFLAGS_PFMOD = -DHAWK_DEFAULT_MODPREFIX=\"libhawk-\" \ +@WIN32_TRUE@ -DHAWK_DEFAULT_MODPOSTFIX=\"-1.dll\" \ +@WIN32_TRUE@ $(am__append_3) $(am__append_4) +pkginclude_HEADERS = \ + hawk.h \ + hawk-chr.h \ + hawk-cmn.h \ + hawk-ecs.h \ + hawk-fmt.h \ + hawk-htb.h \ + hawk-rbt.h \ + hawk-pack1.h \ + hawk-pma.h \ + hawk-utl.h \ + hawk-std.h \ + hawk-tre.h \ + hawk-unpack.h + +pkglib_LTLIBRARIES = libhawk.la $(am__append_5) +libhawk_la_SOURCES = $(pkginclude_HEADERS) arr.c chr.c ecs-imp.h ecs.c \ + err-prv.h err.c fmt-imp.h fmt.c fnc-prv.h fnc.c htb.c \ + hawk-prv.h hawk.c mb8.c misc-imp.h misc-prv.h misc.c \ + parse-prv.h parse.c pma.c rbt.c rec.c rio-prv.h rio.c \ + run-prv.h run.c tre-prv.h tre-ast.c tre-ast.h tre-compile.c \ + tre-compile.h tre-match-bt.c tre-match-pa.c tre-match-ut.h \ + tre-parse.c tre-parse.h tre-stack.c tre-stack.h tre.c \ + tree-prv.h tree.c utf16.c utf8.c utl-sort.c utl-str.c \ + utl-sys.c utl.c val-imp.h val-prv.h val.c hawk-cli.h \ + hawk-fio.h hawk-mtx.h hawk-pio.h hawk-sio.h hawk-tio.h cli.c \ + fio.c mtx.c pio.c sio.c syscall.h syserr.h tio.c std-prv.h \ + std.c $(am__append_6) +libhawk_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) +libhawk_la_LDFLAGS = $(LDFLAGS_LIB_COMMON) +libhawk_la_LIBADD = $(LIBADD_LIB_COMMON) $(am__append_7) \ + $(am__append_9) +libhawk_la_DEPENDENCIES = $(DEPENDENCIES_LIB_COMMON) $(am__append_8) \ + $(am__append_10) +@ENABLE_CXX_TRUE@libhawkxx_la_SOURCES = Hawk.cpp StdHawk.cpp +@ENABLE_CXX_TRUE@libhawkxx_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) +@ENABLE_CXX_TRUE@libhawkxx_la_LDFLAGS = $(LDFLAGS_LIB_COMMON) +@ENABLE_CXX_TRUE@libhawkxx_la_LIBADD = -lhawk $(LIBADD_LIB_COMMON) +@ENABLE_CXX_TRUE@libhawkxx_la_DEPENDENCIES = libhawk.la + +################################################## +# DYNAMIC MODULES +################################################## +@ENABLE_STATIC_MODULE_FALSE@CPPFLAGS_MOD_COMMON = $(CPPFLAGS_ALL_COMMON) +@ENABLE_STATIC_MODULE_FALSE@LDFLAGS_MOD_COMMON = $(LDFLAGS_ALL_COMMON) +@ENABLE_STATIC_MODULE_FALSE@LIBADD_MOD_COMMON = -lhawk +@ENABLE_STATIC_MODULE_FALSE@DEPENDENCIES_MOD_COMMON = libhawk.la +all: hawk-cfg.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .cpp .lo .o .obj +$(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 lib/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign lib/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): + +hawk-cfg.h: stamp-h1 + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + +stamp-h1: $(srcdir)/hawk-cfg.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status lib/hawk-cfg.h +$(srcdir)/hawk-cfg.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f hawk-cfg.h stamp-h1 + +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ + } + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libhawk.la: $(libhawk_la_OBJECTS) $(libhawk_la_DEPENDENCIES) $(EXTRA_libhawk_la_DEPENDENCIES) + $(AM_V_CCLD)$(libhawk_la_LINK) -rpath $(pkglibdir) $(libhawk_la_OBJECTS) $(libhawk_la_LIBADD) $(LIBS) + +libhawkxx.la: $(libhawkxx_la_OBJECTS) $(libhawkxx_la_DEPENDENCIES) $(EXTRA_libhawkxx_la_DEPENDENCIES) + $(AM_V_CXXLD)$(libhawkxx_la_LINK) $(am_libhawkxx_la_rpath) $(libhawkxx_la_OBJECTS) $(libhawkxx_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-arr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-chr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-cli.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-ecs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-err.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-fio.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-fmt.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-fnc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-hawk.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-htb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-mb8.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-misc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-mod-math.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-mod-str.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-mtx.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-parse.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-pio.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-pma.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-rbt.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-rec.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-rio.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-run.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-sio.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-std.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-tio.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-tre-ast.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-tre-compile.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-tre-match-bt.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-tre-match-pa.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-tre-parse.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-tre-stack.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-tre.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-tree.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-utf16.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-utf8.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-utl-sort.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-utl-str.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-utl-sys.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-utl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-val.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawkxx_la-Hawk.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawkxx_la-StdHawk.Plo@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +libhawk_la-arr.lo: arr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-arr.lo -MD -MP -MF $(DEPDIR)/libhawk_la-arr.Tpo -c -o libhawk_la-arr.lo `test -f 'arr.c' || echo '$(srcdir)/'`arr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-arr.Tpo $(DEPDIR)/libhawk_la-arr.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arr.c' object='libhawk_la-arr.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-arr.lo `test -f 'arr.c' || echo '$(srcdir)/'`arr.c + +libhawk_la-chr.lo: chr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-chr.lo -MD -MP -MF $(DEPDIR)/libhawk_la-chr.Tpo -c -o libhawk_la-chr.lo `test -f 'chr.c' || echo '$(srcdir)/'`chr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-chr.Tpo $(DEPDIR)/libhawk_la-chr.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='chr.c' object='libhawk_la-chr.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-chr.lo `test -f 'chr.c' || echo '$(srcdir)/'`chr.c + +libhawk_la-ecs.lo: ecs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-ecs.lo -MD -MP -MF $(DEPDIR)/libhawk_la-ecs.Tpo -c -o libhawk_la-ecs.lo `test -f 'ecs.c' || echo '$(srcdir)/'`ecs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-ecs.Tpo $(DEPDIR)/libhawk_la-ecs.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ecs.c' object='libhawk_la-ecs.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-ecs.lo `test -f 'ecs.c' || echo '$(srcdir)/'`ecs.c + +libhawk_la-err.lo: err.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-err.lo -MD -MP -MF $(DEPDIR)/libhawk_la-err.Tpo -c -o libhawk_la-err.lo `test -f 'err.c' || echo '$(srcdir)/'`err.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-err.Tpo $(DEPDIR)/libhawk_la-err.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='err.c' object='libhawk_la-err.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-err.lo `test -f 'err.c' || echo '$(srcdir)/'`err.c + +libhawk_la-fmt.lo: fmt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-fmt.lo -MD -MP -MF $(DEPDIR)/libhawk_la-fmt.Tpo -c -o libhawk_la-fmt.lo `test -f 'fmt.c' || echo '$(srcdir)/'`fmt.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-fmt.Tpo $(DEPDIR)/libhawk_la-fmt.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fmt.c' object='libhawk_la-fmt.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-fmt.lo `test -f 'fmt.c' || echo '$(srcdir)/'`fmt.c + +libhawk_la-fnc.lo: fnc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-fnc.lo -MD -MP -MF $(DEPDIR)/libhawk_la-fnc.Tpo -c -o libhawk_la-fnc.lo `test -f 'fnc.c' || echo '$(srcdir)/'`fnc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-fnc.Tpo $(DEPDIR)/libhawk_la-fnc.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fnc.c' object='libhawk_la-fnc.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-fnc.lo `test -f 'fnc.c' || echo '$(srcdir)/'`fnc.c + +libhawk_la-htb.lo: htb.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-htb.lo -MD -MP -MF $(DEPDIR)/libhawk_la-htb.Tpo -c -o libhawk_la-htb.lo `test -f 'htb.c' || echo '$(srcdir)/'`htb.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-htb.Tpo $(DEPDIR)/libhawk_la-htb.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='htb.c' object='libhawk_la-htb.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-htb.lo `test -f 'htb.c' || echo '$(srcdir)/'`htb.c + +libhawk_la-hawk.lo: hawk.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-hawk.lo -MD -MP -MF $(DEPDIR)/libhawk_la-hawk.Tpo -c -o libhawk_la-hawk.lo `test -f 'hawk.c' || echo '$(srcdir)/'`hawk.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-hawk.Tpo $(DEPDIR)/libhawk_la-hawk.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hawk.c' object='libhawk_la-hawk.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-hawk.lo `test -f 'hawk.c' || echo '$(srcdir)/'`hawk.c + +libhawk_la-mb8.lo: mb8.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-mb8.lo -MD -MP -MF $(DEPDIR)/libhawk_la-mb8.Tpo -c -o libhawk_la-mb8.lo `test -f 'mb8.c' || echo '$(srcdir)/'`mb8.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-mb8.Tpo $(DEPDIR)/libhawk_la-mb8.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mb8.c' object='libhawk_la-mb8.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-mb8.lo `test -f 'mb8.c' || echo '$(srcdir)/'`mb8.c + +libhawk_la-misc.lo: misc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-misc.lo -MD -MP -MF $(DEPDIR)/libhawk_la-misc.Tpo -c -o libhawk_la-misc.lo `test -f 'misc.c' || echo '$(srcdir)/'`misc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-misc.Tpo $(DEPDIR)/libhawk_la-misc.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='misc.c' object='libhawk_la-misc.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-misc.lo `test -f 'misc.c' || echo '$(srcdir)/'`misc.c + +libhawk_la-parse.lo: parse.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-parse.lo -MD -MP -MF $(DEPDIR)/libhawk_la-parse.Tpo -c -o libhawk_la-parse.lo `test -f 'parse.c' || echo '$(srcdir)/'`parse.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-parse.Tpo $(DEPDIR)/libhawk_la-parse.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parse.c' object='libhawk_la-parse.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-parse.lo `test -f 'parse.c' || echo '$(srcdir)/'`parse.c + +libhawk_la-pma.lo: pma.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-pma.lo -MD -MP -MF $(DEPDIR)/libhawk_la-pma.Tpo -c -o libhawk_la-pma.lo `test -f 'pma.c' || echo '$(srcdir)/'`pma.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-pma.Tpo $(DEPDIR)/libhawk_la-pma.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pma.c' object='libhawk_la-pma.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-pma.lo `test -f 'pma.c' || echo '$(srcdir)/'`pma.c + +libhawk_la-rbt.lo: rbt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-rbt.lo -MD -MP -MF $(DEPDIR)/libhawk_la-rbt.Tpo -c -o libhawk_la-rbt.lo `test -f 'rbt.c' || echo '$(srcdir)/'`rbt.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-rbt.Tpo $(DEPDIR)/libhawk_la-rbt.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rbt.c' object='libhawk_la-rbt.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-rbt.lo `test -f 'rbt.c' || echo '$(srcdir)/'`rbt.c + +libhawk_la-rec.lo: rec.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-rec.lo -MD -MP -MF $(DEPDIR)/libhawk_la-rec.Tpo -c -o libhawk_la-rec.lo `test -f 'rec.c' || echo '$(srcdir)/'`rec.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-rec.Tpo $(DEPDIR)/libhawk_la-rec.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rec.c' object='libhawk_la-rec.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-rec.lo `test -f 'rec.c' || echo '$(srcdir)/'`rec.c + +libhawk_la-rio.lo: rio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-rio.lo -MD -MP -MF $(DEPDIR)/libhawk_la-rio.Tpo -c -o libhawk_la-rio.lo `test -f 'rio.c' || echo '$(srcdir)/'`rio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-rio.Tpo $(DEPDIR)/libhawk_la-rio.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rio.c' object='libhawk_la-rio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-rio.lo `test -f 'rio.c' || echo '$(srcdir)/'`rio.c + +libhawk_la-run.lo: run.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-run.lo -MD -MP -MF $(DEPDIR)/libhawk_la-run.Tpo -c -o libhawk_la-run.lo `test -f 'run.c' || echo '$(srcdir)/'`run.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-run.Tpo $(DEPDIR)/libhawk_la-run.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='run.c' object='libhawk_la-run.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-run.lo `test -f 'run.c' || echo '$(srcdir)/'`run.c + +libhawk_la-tre-ast.lo: tre-ast.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-tre-ast.lo -MD -MP -MF $(DEPDIR)/libhawk_la-tre-ast.Tpo -c -o libhawk_la-tre-ast.lo `test -f 'tre-ast.c' || echo '$(srcdir)/'`tre-ast.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-tre-ast.Tpo $(DEPDIR)/libhawk_la-tre-ast.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tre-ast.c' object='libhawk_la-tre-ast.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-tre-ast.lo `test -f 'tre-ast.c' || echo '$(srcdir)/'`tre-ast.c + +libhawk_la-tre-compile.lo: tre-compile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-tre-compile.lo -MD -MP -MF $(DEPDIR)/libhawk_la-tre-compile.Tpo -c -o libhawk_la-tre-compile.lo `test -f 'tre-compile.c' || echo '$(srcdir)/'`tre-compile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-tre-compile.Tpo $(DEPDIR)/libhawk_la-tre-compile.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tre-compile.c' object='libhawk_la-tre-compile.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-tre-compile.lo `test -f 'tre-compile.c' || echo '$(srcdir)/'`tre-compile.c + +libhawk_la-tre-match-bt.lo: tre-match-bt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-tre-match-bt.lo -MD -MP -MF $(DEPDIR)/libhawk_la-tre-match-bt.Tpo -c -o libhawk_la-tre-match-bt.lo `test -f 'tre-match-bt.c' || echo '$(srcdir)/'`tre-match-bt.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-tre-match-bt.Tpo $(DEPDIR)/libhawk_la-tre-match-bt.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tre-match-bt.c' object='libhawk_la-tre-match-bt.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-tre-match-bt.lo `test -f 'tre-match-bt.c' || echo '$(srcdir)/'`tre-match-bt.c + +libhawk_la-tre-match-pa.lo: tre-match-pa.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-tre-match-pa.lo -MD -MP -MF $(DEPDIR)/libhawk_la-tre-match-pa.Tpo -c -o libhawk_la-tre-match-pa.lo `test -f 'tre-match-pa.c' || echo '$(srcdir)/'`tre-match-pa.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-tre-match-pa.Tpo $(DEPDIR)/libhawk_la-tre-match-pa.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tre-match-pa.c' object='libhawk_la-tre-match-pa.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-tre-match-pa.lo `test -f 'tre-match-pa.c' || echo '$(srcdir)/'`tre-match-pa.c + +libhawk_la-tre-parse.lo: tre-parse.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-tre-parse.lo -MD -MP -MF $(DEPDIR)/libhawk_la-tre-parse.Tpo -c -o libhawk_la-tre-parse.lo `test -f 'tre-parse.c' || echo '$(srcdir)/'`tre-parse.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-tre-parse.Tpo $(DEPDIR)/libhawk_la-tre-parse.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tre-parse.c' object='libhawk_la-tre-parse.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-tre-parse.lo `test -f 'tre-parse.c' || echo '$(srcdir)/'`tre-parse.c + +libhawk_la-tre-stack.lo: tre-stack.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-tre-stack.lo -MD -MP -MF $(DEPDIR)/libhawk_la-tre-stack.Tpo -c -o libhawk_la-tre-stack.lo `test -f 'tre-stack.c' || echo '$(srcdir)/'`tre-stack.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-tre-stack.Tpo $(DEPDIR)/libhawk_la-tre-stack.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tre-stack.c' object='libhawk_la-tre-stack.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-tre-stack.lo `test -f 'tre-stack.c' || echo '$(srcdir)/'`tre-stack.c + +libhawk_la-tre.lo: tre.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-tre.lo -MD -MP -MF $(DEPDIR)/libhawk_la-tre.Tpo -c -o libhawk_la-tre.lo `test -f 'tre.c' || echo '$(srcdir)/'`tre.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-tre.Tpo $(DEPDIR)/libhawk_la-tre.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tre.c' object='libhawk_la-tre.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-tre.lo `test -f 'tre.c' || echo '$(srcdir)/'`tre.c + +libhawk_la-tree.lo: tree.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-tree.lo -MD -MP -MF $(DEPDIR)/libhawk_la-tree.Tpo -c -o libhawk_la-tree.lo `test -f 'tree.c' || echo '$(srcdir)/'`tree.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-tree.Tpo $(DEPDIR)/libhawk_la-tree.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tree.c' object='libhawk_la-tree.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-tree.lo `test -f 'tree.c' || echo '$(srcdir)/'`tree.c + +libhawk_la-utf16.lo: utf16.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-utf16.lo -MD -MP -MF $(DEPDIR)/libhawk_la-utf16.Tpo -c -o libhawk_la-utf16.lo `test -f 'utf16.c' || echo '$(srcdir)/'`utf16.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-utf16.Tpo $(DEPDIR)/libhawk_la-utf16.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utf16.c' object='libhawk_la-utf16.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-utf16.lo `test -f 'utf16.c' || echo '$(srcdir)/'`utf16.c + +libhawk_la-utf8.lo: utf8.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-utf8.lo -MD -MP -MF $(DEPDIR)/libhawk_la-utf8.Tpo -c -o libhawk_la-utf8.lo `test -f 'utf8.c' || echo '$(srcdir)/'`utf8.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-utf8.Tpo $(DEPDIR)/libhawk_la-utf8.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utf8.c' object='libhawk_la-utf8.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-utf8.lo `test -f 'utf8.c' || echo '$(srcdir)/'`utf8.c + +libhawk_la-utl-sort.lo: utl-sort.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-utl-sort.lo -MD -MP -MF $(DEPDIR)/libhawk_la-utl-sort.Tpo -c -o libhawk_la-utl-sort.lo `test -f 'utl-sort.c' || echo '$(srcdir)/'`utl-sort.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-utl-sort.Tpo $(DEPDIR)/libhawk_la-utl-sort.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utl-sort.c' object='libhawk_la-utl-sort.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-utl-sort.lo `test -f 'utl-sort.c' || echo '$(srcdir)/'`utl-sort.c + +libhawk_la-utl-str.lo: utl-str.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-utl-str.lo -MD -MP -MF $(DEPDIR)/libhawk_la-utl-str.Tpo -c -o libhawk_la-utl-str.lo `test -f 'utl-str.c' || echo '$(srcdir)/'`utl-str.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-utl-str.Tpo $(DEPDIR)/libhawk_la-utl-str.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utl-str.c' object='libhawk_la-utl-str.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-utl-str.lo `test -f 'utl-str.c' || echo '$(srcdir)/'`utl-str.c + +libhawk_la-utl-sys.lo: utl-sys.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-utl-sys.lo -MD -MP -MF $(DEPDIR)/libhawk_la-utl-sys.Tpo -c -o libhawk_la-utl-sys.lo `test -f 'utl-sys.c' || echo '$(srcdir)/'`utl-sys.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-utl-sys.Tpo $(DEPDIR)/libhawk_la-utl-sys.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utl-sys.c' object='libhawk_la-utl-sys.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-utl-sys.lo `test -f 'utl-sys.c' || echo '$(srcdir)/'`utl-sys.c + +libhawk_la-utl.lo: utl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-utl.lo -MD -MP -MF $(DEPDIR)/libhawk_la-utl.Tpo -c -o libhawk_la-utl.lo `test -f 'utl.c' || echo '$(srcdir)/'`utl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-utl.Tpo $(DEPDIR)/libhawk_la-utl.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utl.c' object='libhawk_la-utl.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-utl.lo `test -f 'utl.c' || echo '$(srcdir)/'`utl.c + +libhawk_la-val.lo: val.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-val.lo -MD -MP -MF $(DEPDIR)/libhawk_la-val.Tpo -c -o libhawk_la-val.lo `test -f 'val.c' || echo '$(srcdir)/'`val.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-val.Tpo $(DEPDIR)/libhawk_la-val.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='val.c' object='libhawk_la-val.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-val.lo `test -f 'val.c' || echo '$(srcdir)/'`val.c + +libhawk_la-cli.lo: cli.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-cli.lo -MD -MP -MF $(DEPDIR)/libhawk_la-cli.Tpo -c -o libhawk_la-cli.lo `test -f 'cli.c' || echo '$(srcdir)/'`cli.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-cli.Tpo $(DEPDIR)/libhawk_la-cli.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cli.c' object='libhawk_la-cli.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-cli.lo `test -f 'cli.c' || echo '$(srcdir)/'`cli.c + +libhawk_la-fio.lo: fio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-fio.lo -MD -MP -MF $(DEPDIR)/libhawk_la-fio.Tpo -c -o libhawk_la-fio.lo `test -f 'fio.c' || echo '$(srcdir)/'`fio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-fio.Tpo $(DEPDIR)/libhawk_la-fio.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fio.c' object='libhawk_la-fio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-fio.lo `test -f 'fio.c' || echo '$(srcdir)/'`fio.c + +libhawk_la-mtx.lo: mtx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-mtx.lo -MD -MP -MF $(DEPDIR)/libhawk_la-mtx.Tpo -c -o libhawk_la-mtx.lo `test -f 'mtx.c' || echo '$(srcdir)/'`mtx.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-mtx.Tpo $(DEPDIR)/libhawk_la-mtx.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mtx.c' object='libhawk_la-mtx.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-mtx.lo `test -f 'mtx.c' || echo '$(srcdir)/'`mtx.c + +libhawk_la-pio.lo: pio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-pio.lo -MD -MP -MF $(DEPDIR)/libhawk_la-pio.Tpo -c -o libhawk_la-pio.lo `test -f 'pio.c' || echo '$(srcdir)/'`pio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-pio.Tpo $(DEPDIR)/libhawk_la-pio.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pio.c' object='libhawk_la-pio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-pio.lo `test -f 'pio.c' || echo '$(srcdir)/'`pio.c + +libhawk_la-sio.lo: sio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-sio.lo -MD -MP -MF $(DEPDIR)/libhawk_la-sio.Tpo -c -o libhawk_la-sio.lo `test -f 'sio.c' || echo '$(srcdir)/'`sio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-sio.Tpo $(DEPDIR)/libhawk_la-sio.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sio.c' object='libhawk_la-sio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-sio.lo `test -f 'sio.c' || echo '$(srcdir)/'`sio.c + +libhawk_la-tio.lo: tio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-tio.lo -MD -MP -MF $(DEPDIR)/libhawk_la-tio.Tpo -c -o libhawk_la-tio.lo `test -f 'tio.c' || echo '$(srcdir)/'`tio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-tio.Tpo $(DEPDIR)/libhawk_la-tio.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tio.c' object='libhawk_la-tio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-tio.lo `test -f 'tio.c' || echo '$(srcdir)/'`tio.c + +libhawk_la-std.lo: std.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-std.lo -MD -MP -MF $(DEPDIR)/libhawk_la-std.Tpo -c -o libhawk_la-std.lo `test -f 'std.c' || echo '$(srcdir)/'`std.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-std.Tpo $(DEPDIR)/libhawk_la-std.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='std.c' object='libhawk_la-std.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-std.lo `test -f 'std.c' || echo '$(srcdir)/'`std.c + +libhawk_la-mod-math.lo: mod-math.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-mod-math.lo -MD -MP -MF $(DEPDIR)/libhawk_la-mod-math.Tpo -c -o libhawk_la-mod-math.lo `test -f 'mod-math.c' || echo '$(srcdir)/'`mod-math.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-mod-math.Tpo $(DEPDIR)/libhawk_la-mod-math.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mod-math.c' object='libhawk_la-mod-math.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-mod-math.lo `test -f 'mod-math.c' || echo '$(srcdir)/'`mod-math.c + +libhawk_la-mod-str.lo: mod-str.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_la-mod-str.lo -MD -MP -MF $(DEPDIR)/libhawk_la-mod-str.Tpo -c -o libhawk_la-mod-str.lo `test -f 'mod-str.c' || echo '$(srcdir)/'`mod-str.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_la-mod-str.Tpo $(DEPDIR)/libhawk_la-mod-str.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mod-str.c' object='libhawk_la-mod-str.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_la-mod-str.lo `test -f 'mod-str.c' || echo '$(srcdir)/'`mod-str.c + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< + +libhawkxx_la-Hawk.lo: Hawk.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawkxx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libhawkxx_la-Hawk.lo -MD -MP -MF $(DEPDIR)/libhawkxx_la-Hawk.Tpo -c -o libhawkxx_la-Hawk.lo `test -f 'Hawk.cpp' || echo '$(srcdir)/'`Hawk.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawkxx_la-Hawk.Tpo $(DEPDIR)/libhawkxx_la-Hawk.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Hawk.cpp' object='libhawkxx_la-Hawk.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawkxx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libhawkxx_la-Hawk.lo `test -f 'Hawk.cpp' || echo '$(srcdir)/'`Hawk.cpp + +libhawkxx_la-StdHawk.lo: StdHawk.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawkxx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libhawkxx_la-StdHawk.lo -MD -MP -MF $(DEPDIR)/libhawkxx_la-StdHawk.Tpo -c -o libhawkxx_la-StdHawk.lo `test -f 'StdHawk.cpp' || echo '$(srcdir)/'`StdHawk.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawkxx_la-StdHawk.Tpo $(DEPDIR)/libhawkxx_la-StdHawk.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='StdHawk.cpp' object='libhawkxx_la-StdHawk.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawkxx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libhawkxx_la-StdHawk.lo `test -f 'StdHawk.cpp' || echo '$(srcdir)/'`StdHawk.cpp + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgincludeHEADERS: $(pkginclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ + done + +uninstall-pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +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 $(LTLIBRARIES) $(HEADERS) hawk-cfg.h +installdirs: + for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(pkgincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +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 clean-pkglibLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/libhawk_la-arr.Plo + -rm -f ./$(DEPDIR)/libhawk_la-chr.Plo + -rm -f ./$(DEPDIR)/libhawk_la-cli.Plo + -rm -f ./$(DEPDIR)/libhawk_la-ecs.Plo + -rm -f ./$(DEPDIR)/libhawk_la-err.Plo + -rm -f ./$(DEPDIR)/libhawk_la-fio.Plo + -rm -f ./$(DEPDIR)/libhawk_la-fmt.Plo + -rm -f ./$(DEPDIR)/libhawk_la-fnc.Plo + -rm -f ./$(DEPDIR)/libhawk_la-hawk.Plo + -rm -f ./$(DEPDIR)/libhawk_la-htb.Plo + -rm -f ./$(DEPDIR)/libhawk_la-mb8.Plo + -rm -f ./$(DEPDIR)/libhawk_la-misc.Plo + -rm -f ./$(DEPDIR)/libhawk_la-mod-math.Plo + -rm -f ./$(DEPDIR)/libhawk_la-mod-str.Plo + -rm -f ./$(DEPDIR)/libhawk_la-mtx.Plo + -rm -f ./$(DEPDIR)/libhawk_la-parse.Plo + -rm -f ./$(DEPDIR)/libhawk_la-pio.Plo + -rm -f ./$(DEPDIR)/libhawk_la-pma.Plo + -rm -f ./$(DEPDIR)/libhawk_la-rbt.Plo + -rm -f ./$(DEPDIR)/libhawk_la-rec.Plo + -rm -f ./$(DEPDIR)/libhawk_la-rio.Plo + -rm -f ./$(DEPDIR)/libhawk_la-run.Plo + -rm -f ./$(DEPDIR)/libhawk_la-sio.Plo + -rm -f ./$(DEPDIR)/libhawk_la-std.Plo + -rm -f ./$(DEPDIR)/libhawk_la-tio.Plo + -rm -f ./$(DEPDIR)/libhawk_la-tre-ast.Plo + -rm -f ./$(DEPDIR)/libhawk_la-tre-compile.Plo + -rm -f ./$(DEPDIR)/libhawk_la-tre-match-bt.Plo + -rm -f ./$(DEPDIR)/libhawk_la-tre-match-pa.Plo + -rm -f ./$(DEPDIR)/libhawk_la-tre-parse.Plo + -rm -f ./$(DEPDIR)/libhawk_la-tre-stack.Plo + -rm -f ./$(DEPDIR)/libhawk_la-tre.Plo + -rm -f ./$(DEPDIR)/libhawk_la-tree.Plo + -rm -f ./$(DEPDIR)/libhawk_la-utf16.Plo + -rm -f ./$(DEPDIR)/libhawk_la-utf8.Plo + -rm -f ./$(DEPDIR)/libhawk_la-utl-sort.Plo + -rm -f ./$(DEPDIR)/libhawk_la-utl-str.Plo + -rm -f ./$(DEPDIR)/libhawk_la-utl-sys.Plo + -rm -f ./$(DEPDIR)/libhawk_la-utl.Plo + -rm -f ./$(DEPDIR)/libhawk_la-val.Plo + -rm -f ./$(DEPDIR)/libhawkxx_la-Hawk.Plo + -rm -f ./$(DEPDIR)/libhawkxx_la-StdHawk.Plo + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-pkgincludeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-pkglibLTLIBRARIES + +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 ./$(DEPDIR)/libhawk_la-arr.Plo + -rm -f ./$(DEPDIR)/libhawk_la-chr.Plo + -rm -f ./$(DEPDIR)/libhawk_la-cli.Plo + -rm -f ./$(DEPDIR)/libhawk_la-ecs.Plo + -rm -f ./$(DEPDIR)/libhawk_la-err.Plo + -rm -f ./$(DEPDIR)/libhawk_la-fio.Plo + -rm -f ./$(DEPDIR)/libhawk_la-fmt.Plo + -rm -f ./$(DEPDIR)/libhawk_la-fnc.Plo + -rm -f ./$(DEPDIR)/libhawk_la-hawk.Plo + -rm -f ./$(DEPDIR)/libhawk_la-htb.Plo + -rm -f ./$(DEPDIR)/libhawk_la-mb8.Plo + -rm -f ./$(DEPDIR)/libhawk_la-misc.Plo + -rm -f ./$(DEPDIR)/libhawk_la-mod-math.Plo + -rm -f ./$(DEPDIR)/libhawk_la-mod-str.Plo + -rm -f ./$(DEPDIR)/libhawk_la-mtx.Plo + -rm -f ./$(DEPDIR)/libhawk_la-parse.Plo + -rm -f ./$(DEPDIR)/libhawk_la-pio.Plo + -rm -f ./$(DEPDIR)/libhawk_la-pma.Plo + -rm -f ./$(DEPDIR)/libhawk_la-rbt.Plo + -rm -f ./$(DEPDIR)/libhawk_la-rec.Plo + -rm -f ./$(DEPDIR)/libhawk_la-rio.Plo + -rm -f ./$(DEPDIR)/libhawk_la-run.Plo + -rm -f ./$(DEPDIR)/libhawk_la-sio.Plo + -rm -f ./$(DEPDIR)/libhawk_la-std.Plo + -rm -f ./$(DEPDIR)/libhawk_la-tio.Plo + -rm -f ./$(DEPDIR)/libhawk_la-tre-ast.Plo + -rm -f ./$(DEPDIR)/libhawk_la-tre-compile.Plo + -rm -f ./$(DEPDIR)/libhawk_la-tre-match-bt.Plo + -rm -f ./$(DEPDIR)/libhawk_la-tre-match-pa.Plo + -rm -f ./$(DEPDIR)/libhawk_la-tre-parse.Plo + -rm -f ./$(DEPDIR)/libhawk_la-tre-stack.Plo + -rm -f ./$(DEPDIR)/libhawk_la-tre.Plo + -rm -f ./$(DEPDIR)/libhawk_la-tree.Plo + -rm -f ./$(DEPDIR)/libhawk_la-utf16.Plo + -rm -f ./$(DEPDIR)/libhawk_la-utf8.Plo + -rm -f ./$(DEPDIR)/libhawk_la-utl-sort.Plo + -rm -f ./$(DEPDIR)/libhawk_la-utl-str.Plo + -rm -f ./$(DEPDIR)/libhawk_la-utl-sys.Plo + -rm -f ./$(DEPDIR)/libhawk_la-utl.Plo + -rm -f ./$(DEPDIR)/libhawk_la-val.Plo + -rm -f ./$(DEPDIR)/libhawkxx_la-Hawk.Plo + -rm -f ./$(DEPDIR)/libhawkxx_la-StdHawk.Plo + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkgincludeHEADERS uninstall-pkglibLTLIBRARIES + +.MAKE: all install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libtool clean-pkglibLTLIBRARIES \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags 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-pkgincludeHEADERS \ + install-pkglibLTLIBRARIES install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-pkgincludeHEADERS uninstall-pkglibLTLIBRARIES + +.PRECIOUS: Makefile + + +#modexecdir = $(libdir) +# +#modexec_LTLIBRARIES = libhawk-dir.la +#libhawk_dir_la_SOURCES = mod-dir.c mod-dir.h +#libhawk_dir_la_CPPFLAGS = $(CPPFLAGS_MOD_COMMON) +#libhawk_dir_la_LDFLAGS = $(LDFLAGS_MOD_COMMON) -L../si +#libhawk_dir_la_LIBADD = $(LIBADD_MOD_COMMON) -lqsesi +#libhawk_dir_la_DEPENDENCIES = $(DEPENDENCIES_MOD_COMMON) ../../lib/si/libqsesi.la +# +#modexec_LTLIBRARIES += libhawk-math.la +#libhawk_math_la_SOURCES = mod-math.c mod-math.h +#libhawk_math_la_CPPFLAGS = $(CPPFLAGS_MOD_COMMON) +#libhawk_math_la_LDFLAGS = $(LDFLAGS_MOD_COMMON) +#libhawk_math_la_LIBADD = $(LIBADD_MOD_COMMON) +#libhawk_math_la_DEPENDENCIES = $(DEPENDENCIES_MOD_COMMON) +# +#modexec_LTLIBRARIES += libhawk-str.la +#libhawk_str_la_SOURCES = mod-str.c mod-str.h +#libhawk_str_la_CPPFLAGS = $(CPPFLAGS_MOD_COMMON) +#libhawk_str_la_LDFLAGS = $(LDFLAGS_MOD_COMMON) +#libhawk_str_la_LIBADD = $(LIBADD_MOD_COMMON) +#libhawk_str_la_DEPENDENCIES = $(DEPENDENCIES_MOD_COMMON) +# +#modexec_LTLIBRARIES += libhawk-sys.la +#libhawk_sys_la_SOURCES = mod-sys.c mod-sys.h +#libhawk_sys_la_CPPFLAGS = $(CPPFLAGS_MOD_COMMON) +#libhawk_sys_la_LDFLAGS = $(LDFLAGS_MOD_COMMON) -L../si +#libhawk_sys_la_LIBADD = $(LIBADD_MOD_COMMON) -lqsesi +#libhawk_sys_la_DEPENDENCIES = $(DEPENDENCIES_MOD_COMMON) ../../lib/si/libqsesi.la + +# 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: diff --git a/hawk/lib/StdHawk.cpp b/hawk/lib/StdHawk.cpp new file mode 100644 index 00000000..66efc422 --- /dev/null +++ b/hawk/lib/StdHawk.cpp @@ -0,0 +1,1376 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include "hawk-prv.h" +#include + +#if !defined(HAWK_HAVE_CONFIG_H) +# if defined(_WIN32) || defined(__OS2__) || defined(__DOS__) +# define HAVE_POW +# define HAVE_FMOD +# endif +#endif + + +// TODO: remove the following definitions and find a way to share the similar definitions in std.c +#if defined(HAWK_ENABLE_LIBLTDL) +# define USE_LTDL +#elif defined(HAVE_DLFCN_H) +# define USE_DLFCN +#else +# error UNSUPPORTED DYNAMIC LINKER +#endif + + +///////////////////////////////// +HAWK_BEGIN_NAMESPACE(QSE) +///////////////////////////////// + +StdHawk::ioattr_t StdHawk::default_ioattr; + +static hawk_sio_t* open_sio (Hawk* awk, StdHawk::Run* run, const hawk_ooch_t* file, int flags) +{ + hawk_sio_t* sio; + + //sio = hawk_sio_open ((run? ((Hawk::awk_t*)*(Hawk*)*run)->mmgr: awk->getMmgr()), 0, file, flags); + sio = hawk_sio_open ((run? ((Hawk*)*run)->getMmgr(): awk->getMmgr()), 0, file, flags); + if (sio == HAWK_NULL) + { + hawk_oocs_t ea; + ea.ptr = (StdHawk::char_t*)file; + ea.len = hawk_strlen (file); + if (run) run->setError (HAWK_EOPEN, &ea); + else awk->setError (HAWK_EOPEN, &ea); + } + return sio; +} + +static hawk_sio_t* open_sio_std (Hawk* awk, StdHawk::Run* run, hawk_sio_std_t std, int flags) +{ + hawk_sio_t* sio; + static const StdHawk::char_t* std_names[] = + { + HAWK_T("stdin"), + HAWK_T("stdout"), + HAWK_T("stderr"), + }; + + //sio = hawk_sio_openstd ((run? ((Hawk::awk_t*)*(Hawk*)*run)->mmgr: awk->getMmgr()), 0, std, flags); + sio = hawk_sio_openstd ((run? ((Hawk*)*run)->getMmgr(): awk->getMmgr()), 0, std, flags); + if (sio == HAWK_NULL) + { + hawk_oocs_t ea; + ea.ptr = (StdHawk::char_t*)std_names[std]; + ea.len = hawk_strlen (std_names[std]); + if (run) run->setError (HAWK_EOPEN, &ea); + else awk->setError (HAWK_EOPEN, &ea); + } + return sio; +} + +int StdHawk::open () +{ + int n = Hawk::open (); + if (n == -1) return n; + + this->gbl_argc = addGlobal (HAWK_T("ARGC")); + this->gbl_argv = addGlobal (HAWK_T("ARGV")); + this->gbl_environ = addGlobal (HAWK_T("ENVIRON")); + if (this->gbl_argc <= -1 || + this->gbl_argv <= -1 || + this->gbl_environ <= -1) + { + goto oops; + } + + if (addFunction (HAWK_T("rand"), 1, 0, HAWK_T("math"), HAWK_NULL, 0) <= -1 || + addFunction (HAWK_T("srand"), 1, 0, HAWK_T("math"), HAWK_NULL, 0) <= -1 || + addFunction (HAWK_T("system"), 1, 0, HAWK_T("sys"), HAWK_NULL, 0) <= -1 || + addFunction (HAWK_T("setioattr"), 3, 3, HAWK_NULL, (FunctionHandler)&StdHawk::setioattr, HAWK_RIO) <= -1 || + addFunction (HAWK_T("getioattr"), 3, 3, HAWK_T("vvr"), (FunctionHandler)&StdHawk::getioattr, HAWK_RIO) <= -1) + { + goto oops; + } + + if (!this->stdmod_up) + { + #if defined(USE_DLFCN) + if (hawk_setopt(awk, HAWK_MODPOSTFIX, HAWK_T(".so")) <= -1) goto oops; + #endif + + if (hawk_stdmodstartup (this->awk) <= -1) goto oops; + this->stdmod_up = true; + } + + this->cmgrtab_inited = false; + return 0; + +oops: + Hawk::close (); + return -1; +} + +void StdHawk::close () +{ + if (this->cmgrtab_inited) + { + hawk_htb_fini (&this->cmgrtab); + this->cmgrtab_inited = false; + } + + clearConsoleOutputs (); + + // + // StdHawk called hawk_stdmodstartup() after Hawk::open(). + // It's logical to call hawk_stdmodshutdown() Hawk::close(). + // but Hawk::close() still needs to call some module's fini and + // unload functions. So it must be done in StdHawk::uponClosing() + // which is called after modules have been unloaded but while + // the underlying awk object is still alive. + // + // See StdHawk::uponClosing() below. + // + //if (this->stdmod_up) + //{ + // hawk_stdmodshutdown (this->awk); + // this->stdmod_up = false; + //} + // + + Hawk::close (); +} + +void StdHawk::uponClosing () +{ + if (this->stdmod_up) + { + hawk_stdmodshutdown (this->awk); + this->stdmod_up = false; + } + + // chain up + Hawk::uponClosing (); +} + +StdHawk::Run* StdHawk::parse (Source& in, Source& out) +{ + Run* run = Hawk::parse(in, out); + + if (this->cmgrtab_inited) + { + // if cmgrtab has already been initialized, + // just clear the contents regardless of + // parse() result. + hawk_htb_clear (&this->cmgrtab); + } + else if (run && (this->getTrait() & HAWK_RIO)) + { + // it initialized cmgrtab only if HAWK_RIO is set. + // but if you call parse() multiple times while + // setting and unsetting HAWK_RIO in-between, + // cmgrtab can still be initialized when HAWK_RIO is not set. + if (hawk_htb_init(&this->cmgrtab, this->getMmgr(), 256, 70, HAWK_SIZEOF(hawk_ooch_t), 1) <= -1) + { + this->setError (HAWK_ENOMEM); + return HAWK_NULL; + } + hawk_htb_setstyle (&this->cmgrtab, hawk_get_htb_style(HAWK_HTB_STYLE_INLINE_KEY_COPIER)); + this->cmgrtab_inited = true; + } + + if (run && make_additional_globals(run) <= -1) return HAWK_NULL; + + return run; +} + +int StdHawk::build_argcv (Run* run) +{ + Value argv (run); + + for (size_t i = 0; i < this->runarg.len; i++) + { + if (argv.setIndexedStr ( + Value::IntIndex(i), + this->runarg.ptr[i].ptr, + this->runarg.ptr[i].len, true) <= -1) return -1; + } + + run->setGlobal (this->gbl_argc, (int_t)this->runarg.len); + run->setGlobal (this->gbl_argv, argv); + return 0; +} + +int StdHawk::__build_environ (Run* run, void* envptr) +{ + hawk_env_char_t** envarr = (hawk_env_char_t**)envptr; + Value v_env (run); + + if (envarr) + { + hawk_env_char_t* eq; + hawk_ooch_t* kptr, * vptr; + hawk_oow_t klen, count; + hawk_mmgr_t* mmgr = ((Hawk*)*run)->getMmgr(); + hawk_cmgr_t* cmgr = ((Hawk*)*run)->getCmgr(); + + for (count = 0; envarr[count]; count++) + { + #if ((defined(HAWK_ENV_CHAR_IS_MCHAR) && defined(HAWK_OOCH_IS_BCH)) || \ + (defined(HAWK_ENV_CHAR_IS_WCHAR) && defined(HAWK_OOCH_IS_UCH))) + eq = hawk_strchr (envarr[count], HAWK_T('=')); + if (eq == HAWK_NULL || eq == envarr[count]) continue; + + kptr = envarr[count]; + klen = eq - envarr[count]; + vptr = eq + 1; + #elif defined(HAWK_ENV_CHAR_IS_MCHAR) + eq = hawk_mbschr (envarr[count], HAWK_BT('=')); + if (eq == HAWK_NULL || eq == envarr[count]) continue; + + *eq = HAWK_BT('\0'); + + kptr = hawk_mbstowcsalldupwithcmgr(envarr[count], &klen, mmgr, cmgr); + vptr = hawk_mbstowcsalldupwithcmgr(eq + 1, HAWK_NULL, mmgr, cmgr); + if (kptr == HAWK_NULL || vptr == HAWK_NULL) + { + if (kptr) HAWK_MMGR_FREE (mmgr, kptr); + if (vptr) HAWK_MMGR_FREE (mmgr, vptr); + + /* mbstowcsdup() may fail for invalid encoding. + * so setting the error code to ENOMEM may not + * be really accurate */ + this->setError (HAWK_ENOMEM); + return -1; + } + + *eq = HAWK_BT('='); + #else + eq = hawk_wcschr (envarr[count], HAWK_UT('=')); + if (eq == HAWK_NULL || eq == envarr[count]) continue; + + *eq = HAWK_UT('\0'); + + kptr = hawk_wcstombsdupwithcmgr(envarr[count], &klen, mmgr, cmgr); + vptr = hawk_wcstombsdupwithcmgr(eq + 1, HAWK_NULL, mmgr, cmgr); + if (kptr == HAWK_NULL || vptr == HAWK_NULL) + { + if (kptr) HAWK_MMGR_FREE (mmgr, kptr); + if (vptr) HAWK_MMGR_FREE (mmgr, vptr); + + /* mbstowcsdup() may fail for invalid encoding. + * so setting the error code to ENOMEM may not + * be really accurate */ + this->setError (HAWK_ENOMEM); + return -1; + } + + *eq = HAWK_UT('='); + #endif + + // numeric string + v_env.setIndexedStr (Value::Index (kptr, klen), vptr, true); + + #if ((defined(HAWK_ENV_CHAR_IS_MCHAR) && defined(HAWK_OOCH_IS_BCH)) || \ + (defined(HAWK_ENV_CHAR_IS_WCHAR) && defined(HAWK_OOCH_IS_UCH))) + /* nothing to do */ + #else + if (vptr) HAWK_MMGR_FREE (mmgr, vptr); + if (kptr) HAWK_MMGR_FREE (mmgr, kptr); + #endif + } + } + + return run->setGlobal (this->gbl_environ, v_env); +} + +int StdHawk::build_environ (Run* run) +{ + hawk_env_t env; + int xret; + + if (hawk_env_init (&env, ((Hawk*)*run)->getMmgr(), 1) <= -1) + { + this->setError (HAWK_ENOMEM); + return -1; + } + + xret = __build_environ (run, hawk_env_getarr(&env)); + + hawk_env_fini (&env); + return xret; +} + +int StdHawk::make_additional_globals (Run* run) +{ + if (build_argcv (run) <= -1 || + build_environ (run) <= -1) return -1; + + return 0; +} + +hawk_cmgr_t* StdHawk::getiocmgr (const char_t* ioname) +{ + HAWK_ASSERT (this->cmgrtab_inited == true); + +#if defined(HAWK_OOCH_IS_UCH) + ioattr_t* ioattr = get_ioattr(ioname, hawk_strlen(ioname)); + if (ioattr) return ioattr->cmgr; +#endif + return HAWK_NULL; +} + +StdHawk::ioattr_t* StdHawk::get_ioattr (const char_t* ptr, size_t len) +{ + hawk_htb_pair_t* pair; + + pair = hawk_htb_search (&this->cmgrtab, ptr, len); + if (pair == HAWK_NULL) return HAWK_NULL; + + return (ioattr_t*)HAWK_HTB_VPTR(pair); +} + +StdHawk::ioattr_t* StdHawk::find_or_make_ioattr (const char_t* ptr, size_t len) +{ + hawk_htb_pair_t* pair; + + pair = hawk_htb_search (&this->cmgrtab, ptr, len); + if (pair == HAWK_NULL) + { + pair = hawk_htb_insert ( + &this->cmgrtab, (void*)ptr, len, + (void*)&StdHawk::default_ioattr, + HAWK_SIZEOF(StdHawk::default_ioattr)); + if (pair == HAWK_NULL) + { + this->setError (HAWK_ENOMEM); + return HAWK_NULL; + } + } + + return (ioattr_t*)HAWK_HTB_VPTR(pair); +} + +static int timeout_code (const hawk_ooch_t* name) +{ + if (hawk_strcasecmp (name, HAWK_T("rtimeout")) == 0) return 0; + if (hawk_strcasecmp (name, HAWK_T("wtimeout")) == 0) return 1; + if (hawk_strcasecmp (name, HAWK_T("ctimeout")) == 0) return 2; + if (hawk_strcasecmp (name, HAWK_T("atimeout")) == 0) return 3; + return -1; +} + +int StdHawk::setioattr ( + Run& run, Value& ret, Value* args, size_t nargs, + const char_t* name, size_t len) +{ + HAWK_ASSERT (this->cmgrtab_inited == true); + size_t l[3]; + const char_t* ptr[3]; + + ptr[0] = args[0].toStr(&l[0]); + ptr[1] = args[1].toStr(&l[1]); + ptr[2] = args[2].toStr(&l[2]); + + if (hawk_strxchr (ptr[0], l[0], HAWK_T('\0')) || + hawk_strxchr (ptr[1], l[1], HAWK_T('\0')) || + hawk_strxchr (ptr[2], l[2], HAWK_T('\0'))) + { + return ret.setInt ((int_t)-1); + } + + int tmout; + if ((tmout = timeout_code (ptr[1])) >= 0) + { + int_t lv; + flt_t fv; + int n; + + n = args[2].getNum(&lv, &fv); + if (n <= -1) return -1; + + ioattr_t* ioattr = find_or_make_ioattr (ptr[0], l[0]); + if (ioattr == HAWK_NULL) return -1; + + if (n == 0) + { + ioattr->tmout[tmout].sec = lv; + ioattr->tmout[tmout].nsec = 0; + } + else + { + hawk_flt_t nsec; + ioattr->tmout[tmout].sec = (hawk_int_awk_t)fv; + nsec = fv - ioattr->tmout[tmout].sec; + ioattr->tmout[tmout].nsec = HAWK_SEC_TO_NSEC(nsec); + } + return ret.setInt ((int_t)0); + } +#if defined(HAWK_OOCH_IS_UCH) + else if (hawk_strcasecmp (ptr[1], HAWK_T("codepage")) == 0 || + hawk_strcasecmp (ptr[1], HAWK_T("encoding")) == 0) + { + ioattr_t* ioattr; + hawk_cmgr_t* cmgr; + + if (ptr[2][0] == HAWK_T('\0')) cmgr = HAWK_NULL; + else + { + cmgr = hawk_findcmgr (ptr[2]); + if (cmgr == HAWK_NULL) return ret.setInt ((int_t)-1); + } + + ioattr = find_or_make_ioattr (ptr[0], l[0]); + if (ioattr == HAWK_NULL) return -1; + + ioattr->cmgr = cmgr; + hawk_strxcpy (ioattr->cmgr_name, HAWK_COUNTOF(ioattr->cmgr_name), ptr[2]); + return 0; + } +#endif + else + { + // unknown attribute name + return ret.setInt ((int_t)-1); + } +} + +int StdHawk::getioattr ( + Run& run, Value& ret, Value* args, size_t nargs, + const char_t* name, size_t len) +{ + HAWK_ASSERT (this->cmgrtab_inited == true); + size_t l[2]; + const char_t* ptr[2]; + + ptr[0] = args[0].toStr(&l[0]); + ptr[1] = args[1].toStr(&l[1]); + + int xx = -1; + + /* ionames must not contains a null character */ + if (hawk_strxchr (ptr[0], l[0], HAWK_T('\0')) == HAWK_NULL && + hawk_strxchr (ptr[1], l[1], HAWK_T('\0')) == HAWK_NULL) + { + ioattr_t* ioattr = get_ioattr (ptr[0], l[0]); + if (ioattr == HAWK_NULL) ioattr = &StdHawk::default_ioattr; + + int tmout; + if ((tmout = timeout_code(ptr[1])) >= 0) + { + if (ioattr->tmout[tmout].nsec == 0) + xx = args[2].setInt ((int_t)ioattr->tmout[tmout].sec); + else + xx = args[2].setFlt ((hawk_flt_t)ioattr->tmout[tmout].sec + HAWK_NSEC_TO_SEC((hawk_flt_t)ioattr->tmout[tmout].nsec)); + } + #if defined(HAWK_OOCH_IS_UCH) + else if (hawk_strcasecmp (ptr[1], HAWK_T("codepage")) == 0 || + hawk_strcasecmp (ptr[1], HAWK_T("encoding")) == 0) + { + xx = args[2].setStr (ioattr->cmgr_name); + } + #endif + } + + // unknown attribute name or errors + return ret.setInt ((int_t)xx); +} + +int StdHawk::open_nwio (Pipe& io, int flags, void* nwad) +{ + hawk_nwio_tmout_t tmout_buf; + hawk_nwio_tmout_t* tmout = HAWK_NULL; + + const hawk_ooch_t* name = io.getName(); + ioattr_t* ioattr = get_ioattr (name, hawk_strlen(name)); + if (ioattr) + { + tmout = &tmout_buf; + tmout->r = ioattr->tmout[0]; + tmout->w = ioattr->tmout[1]; + tmout->c = ioattr->tmout[2]; + tmout->a = ioattr->tmout[3]; + } + + hawk_nwio_t* handle = hawk_nwio_open ( + this->getMmgr(), 0, (hawk_nwad_t*)nwad, + flags | HAWK_NWIO_TEXT | HAWK_NWIO_IGNOREECERR | + HAWK_NWIO_REUSEADDR | HAWK_NWIO_READNORETRY | HAWK_NWIO_WRITENORETRY, + tmout + ); + if (handle == HAWK_NULL) return -1; + +#if defined(HAWK_OOCH_IS_UCH) + hawk_cmgr_t* cmgr = this->getiocmgr(io.getName()); + if (cmgr) hawk_nwio_setcmgr (handle, cmgr); +#endif + + io.setHandle ((void*)handle); + io.setUflags (1); + + return 1; +} + +int StdHawk::open_pio (Pipe& io) +{ + Hawk::Pipe::Mode mode = io.getMode(); + hawk_pio_t* pio = HAWK_NULL; + int flags = HAWK_PIO_TEXT | HAWK_PIO_SHELL | HAWK_PIO_IGNOREECERR; + + switch (mode) + { + case Hawk::Pipe::READ: + /* TODO: should we specify ERRTOOUT? */ + flags |= HAWK_PIO_READOUT | + HAWK_PIO_ERRTOOUT; + break; + + case Hawk::Pipe::WRITE: + flags |= HAWK_PIO_WRITEIN; + break; + + case Hawk::Pipe::RW: + flags |= HAWK_PIO_READOUT | + HAWK_PIO_ERRTOOUT | + HAWK_PIO_WRITEIN; + break; + } + + pio = hawk_pio_open ( + this->getMmgr(), + 0, + io.getName(), + HAWK_NULL, + flags + ); + if (pio == HAWK_NULL) return -1; + +#if defined(HAWK_OOCH_IS_UCH) + hawk_cmgr_t* cmgr = this->getiocmgr(io.getName()); + if (cmgr) + { + hawk_pio_setcmgr (pio, HAWK_PIO_IN, cmgr); + hawk_pio_setcmgr (pio, HAWK_PIO_OUT, cmgr); + hawk_pio_setcmgr (pio, HAWK_PIO_ERR, cmgr); + } +#endif + io.setHandle (pio); + io.setUflags (0); + return 1; +} + +static int parse_rwpipe_uri (const hawk_ooch_t* uri, int* flags, hawk_nwad_t* nwad) +{ + static struct + { + const hawk_ooch_t* prefix; + hawk_oow_t len; + int flags; + } x[] = + { + { HAWK_T("tcp://"), 6, HAWK_NWIO_TCP }, + { HAWK_T("udp://"), 6, HAWK_NWIO_UDP }, + { HAWK_T("tcpd://"), 7, HAWK_NWIO_TCP | HAWK_NWIO_PASSIVE }, + { HAWK_T("udpd://"), 7, HAWK_NWIO_UDP | HAWK_NWIO_PASSIVE } + }; + StdHawk::size_t i; + + for (i = 0; i < HAWK_COUNTOF(x); i++) + { + if (hawk_strzcmp (uri, x[i].prefix, x[i].len) == 0) + { + if (hawk_strtonwad (uri + x[i].len, nwad) <= -1) return -1; + *flags = x[i].flags; + return 0; + } + } + + return -1; +} + +int StdHawk::openPipe (Pipe& io) +{ + int flags; + hawk_nwad_t nwad; + + if (io.getMode() != Hawk::Pipe::RW || + parse_rwpipe_uri (io.getName(), &flags, &nwad) <= -1) + { + return open_pio (io); + } + else + { + return open_nwio (io, flags, &nwad); + } +} + +int StdHawk::closePipe (Pipe& io) +{ + if (io.getUflags() > 0) + { + /* nwio can't honor partical close */ + hawk_nwio_close ((hawk_nwio_t*)io.getHandle()); + } + else + { + hawk_pio_t* pio = (hawk_pio_t*)io.getHandle(); + if (io.getMode() == Hawk::Pipe::RW) + { + Pipe::CloseMode rwcopt = io.getCloseMode(); + if (rwcopt == Hawk::Pipe::CLOSE_READ) + { + hawk_pio_end (pio, HAWK_PIO_IN); + return 0; + } + else if (rwcopt == Hawk::Pipe::CLOSE_WRITE) + { + hawk_pio_end (pio, HAWK_PIO_OUT); + return 0; + } + } + + hawk_pio_close (pio); + } + return 0; +} + +StdHawk::ssize_t StdHawk::readPipe (Pipe& io, char_t* buf, size_t len) +{ + return (io.getUflags() > 0)? + hawk_nwio_read ((hawk_nwio_t*)io.getHandle(), buf, len): + hawk_pio_read ((hawk_pio_t*)io.getHandle(), HAWK_PIO_OUT, buf, len); +} + +StdHawk::ssize_t StdHawk::writePipe (Pipe& io, const char_t* buf, size_t len) +{ + return (io.getUflags() > 0)? + hawk_nwio_write((hawk_nwio_t*)io.getHandle(), buf, len): + hawk_pio_write((hawk_pio_t*)io.getHandle(), HAWK_PIO_IN, buf, len); +} + +StdHawk::ssize_t StdHawk::writePipeBytes (Pipe& io, const hawk_bch_t* buf, size_t len) +{ + return (io.getUflags() > 0)? + hawk_nwio_writebytes((hawk_nwio_t*)io.getHandle(), buf, len): + hawk_pio_writebytes((hawk_pio_t*)io.getHandle(), HAWK_PIO_IN, buf, len); +} + +int StdHawk::flushPipe (Pipe& io) +{ + return (io.getUflags() > 0)? + hawk_nwio_flush ((hawk_nwio_t*)io.getHandle()): + hawk_pio_flush ((hawk_pio_t*)io.getHandle(), HAWK_PIO_IN); +} + +int StdHawk::openFile (File& io) +{ + Hawk::File::Mode mode = io.getMode(); + hawk_sio_t* sio = HAWK_NULL; + int flags = HAWK_SIO_IGNOREECERR; + + switch (mode) + { + case Hawk::File::READ: + flags |= HAWK_SIO_READ; + break; + case Hawk::File::WRITE: + flags |= HAWK_SIO_WRITE | + HAWK_SIO_CREATE | + HAWK_SIO_TRUNCATE; + break; + case Hawk::File::APPEND: + flags |= HAWK_SIO_APPEND | + HAWK_SIO_CREATE; + break; + } + + sio = hawk_sio_open(this->getMmgr(), 0, io.getName(), flags); + if (!sio) return -1; +#if defined(HAWK_OOCH_IS_UCH) + hawk_cmgr_t* cmgr = this->getiocmgr(io.getName()); + if (cmgr) hawk_sio_setcmgr (sio, cmgr); +#endif + + io.setHandle (sio); + return 1; +} + +int StdHawk::closeFile (File& io) +{ + hawk_sio_close ((hawk_sio_t*)io.getHandle()); + return 0; +} + +StdHawk::ssize_t StdHawk::readFile (File& io, char_t* buf, size_t len) +{ + return hawk_sio_getoochars((hawk_sio_t*)io.getHandle(), buf, len); +} + +StdHawk::ssize_t StdHawk::writeFile (File& io, const char_t* buf, size_t len) +{ + return hawk_sio_putoochars((hawk_sio_t*)io.getHandle(), buf, len); +} + +StdHawk::ssize_t StdHawk::writeFileBytes (File& io, const hawk_bch_t* buf, size_t len) +{ + return hawk_sio_putbchars((hawk_sio_t*)io.getHandle(), buf, len); +} + + +int StdHawk::flushFile (File& io) +{ + return hawk_sio_flush((hawk_sio_t*)io.getHandle()); +} + +void StdHawk::setConsoleCmgr (const hawk_cmgr_t* cmgr) +{ + this->console_cmgr = (hawk_cmgr_t*)cmgr; +} + +const hawk_cmgr_t* StdHawk::getConsoleCmgr () const +{ + return this->console_cmgr; +} + +int StdHawk::addConsoleOutput (const char_t* arg, size_t len) +{ + HAWK_ASSERT (awk != HAWK_NULL); + int n = this->ofile.add (awk, arg, len); + if (n <= -1) setError (HAWK_ENOMEM); + return n; +} + +int StdHawk::addConsoleOutput (const char_t* arg) +{ + return addConsoleOutput (arg, hawk_strlen(arg)); +} + +void StdHawk::clearConsoleOutputs () +{ + this->ofile.clear (awk); +} + +int StdHawk::open_console_in (Console& io) +{ + hawk_rtx_t* rtx = (rtx_t*)io; + + if (this->runarg.ptr == HAWK_NULL) + { + HAWK_ASSERT (this->runarg.len == 0 && this->runarg.capa == 0); + + if (this->runarg_count == 0) + { + hawk_sio_t* sio; + + sio = open_sio_std ( + HAWK_NULL, io, HAWK_SIO_STDIN, + HAWK_SIO_READ | HAWK_SIO_IGNOREECERR); + if (sio == HAWK_NULL) return -1; + + if (this->console_cmgr) + hawk_sio_setcmgr (sio, this->console_cmgr); + + io.setHandle (sio); + this->runarg_count++; + return 1; + } + + return 0; + } + else + { + hawk_sio_t* sio; + const hawk_ooch_t* file; + hawk_val_t* argv; + hawk_htb_t* map; + hawk_htb_pair_t* pair; + hawk_ooch_t ibuf[128]; + hawk_oow_t ibuflen; + hawk_val_t* v; + hawk_oocs_t as; + + nextfile: + file = this->runarg.ptr[this->runarg_index].ptr; + + if (file == HAWK_NULL) + { + /* no more input file */ + + if (this->runarg_count == 0) + { + /* all ARGVs are empty strings. + * so no console files were opened. + * open the standard input here. + * + * 'BEGIN { ARGV[1]=""; ARGV[2]=""; } + * { print $0; }' file1 file2 + */ + sio = open_sio_std ( + HAWK_NULL, io, HAWK_SIO_STDIN, + HAWK_SIO_READ | HAWK_SIO_IGNOREECERR); + if (sio == HAWK_NULL) return -1; + + if (this->console_cmgr) + hawk_sio_setcmgr (sio, this->console_cmgr); + + io.setHandle (sio); + this->runarg_count++; + return 1; + } + + return 0; + } + + if (hawk_strlen(file) != this->runarg.ptr[this->runarg_index].len) + { + oocs_t arg; + arg.ptr = (char_t*)file; + arg.len = hawk_strlen (arg.ptr); + ((Run*)io)->setError (HAWK_EIONMNL, &arg); + return -1; + } + + /* handle special case when ARGV[x] has been altered. + * so from here down, the file name gotten from + * rxtn->c.in.files is not important and is overridden + * from ARGV. + * 'BEGIN { ARGV[1]="file3"; } + * { print $0; }' file1 file2 + */ + argv = hawk_rtx_getgbl (rtx, this->gbl_argv); + HAWK_ASSERT (argv != HAWK_NULL); + HAWK_ASSERT (HAWK_RTX_GETVALTYPE (rtx, argv) == HAWK_VAL_MAP); + + map = ((hawk_val_map_t*)argv)->map; + HAWK_ASSERT (map != HAWK_NULL); + + // ok to find ARGV[this->runarg_index] as ARGV[0] + // has been skipped. + ibuflen = hawk_int_to_oocstr (this->runarg_index, 10, HAWK_NULL, ibuf, HAWK_COUNTOF(ibuf)); + + pair = hawk_htb_search (map, ibuf, ibuflen); + HAWK_ASSERT (pair != HAWK_NULL); + + v = (hawk_val_t*)HAWK_HTB_VPTR(pair); + HAWK_ASSERT (v != HAWK_NULL); + + as.ptr = hawk_rtx_getvaloocstr (rtx, v, &as.len); + if (as.ptr == HAWK_NULL) return -1; + + if (as.len == 0) + { + /* the name is empty */ + hawk_rtx_freevaloocstr (rtx, v, as.ptr); + this->runarg_index++; + goto nextfile; + } + + if (hawk_strlen(as.ptr) < as.len) + { + /* the name contains one or more '\0' */ + oocs_t arg; + arg.ptr = as.ptr; + arg.len = hawk_strlen (as.ptr); + ((Run*)io)->setError (HAWK_EIONMNL, &arg); + hawk_rtx_freevaloocstr (rtx, v, as.ptr); + return -1; + } + + file = as.ptr; + + if (file[0] == HAWK_T('-') && file[1] == HAWK_T('\0')) + sio = open_sio_std(HAWK_NULL, io, HAWK_SIO_STDIN, HAWK_SIO_READ | HAWK_SIO_IGNOREECERR); + else + sio = open_sio(HAWK_NULL, io, file, HAWK_SIO_READ | HAWK_SIO_IGNOREECERR); + if (sio == HAWK_NULL) + { + hawk_rtx_freevaloocstr (rtx, v, as.ptr); + return -1; + } + + if (hawk_rtx_setfilename (rtx, file, hawk_strlen(file)) <= -1) + { + hawk_sio_close (sio); + hawk_rtx_freevaloocstr (rtx, v, as.ptr); + return -1; + } + + hawk_rtx_freevaloocstr (rtx, v, as.ptr); + + if (this->console_cmgr) hawk_sio_setcmgr (sio, this->console_cmgr); + + io.setHandle (sio); + + /* increment the counter of files successfully opened */ + this->runarg_count++; + this->runarg_index++; + return 1; + } + +} + +int StdHawk::open_console_out (Console& io) +{ + hawk_rtx_t* rtx = (rtx_t*)io; + + if (this->ofile.ptr == HAWK_NULL) + { + HAWK_ASSERT (this->ofile.len == 0 && this->ofile.capa == 0); + + if (this->ofile_count == 0) + { + hawk_sio_t* sio; + sio = open_sio_std ( + HAWK_NULL, io, HAWK_SIO_STDOUT, + HAWK_SIO_WRITE | HAWK_SIO_IGNOREECERR | HAWK_SIO_LINEBREAK); + if (sio == HAWK_NULL) return -1; + + if (this->console_cmgr) + hawk_sio_setcmgr (sio, this->console_cmgr); + + io.setHandle (sio); + this->ofile_count++; + return 1; + } + + return 0; + } + else + { + /* a temporary variable sio is used here not to change + * any fields of riod when the open operation fails */ + hawk_sio_t* sio; + const hawk_ooch_t* file; + + file = this->ofile.ptr[this->ofile_index].ptr; + + if (file == HAWK_NULL) + { + /* no more input file */ + return 0; + } + + if (hawk_strlen(file) != this->ofile.ptr[this->ofile_index].len) + { + oocs_t arg; + arg.ptr = (char_t*)file; + arg.len = hawk_strlen (arg.ptr); + ((Run*)io)->setError (HAWK_EIONMNL, &arg); + return -1; + } + + if (file[0] == HAWK_T('-') && file[1] == HAWK_T('\0')) + sio = open_sio_std (HAWK_NULL, io, HAWK_SIO_STDOUT, HAWK_SIO_WRITE | HAWK_SIO_IGNOREECERR | HAWK_SIO_LINEBREAK); + else + sio = open_sio (HAWK_NULL, io, file, HAWK_SIO_WRITE | HAWK_SIO_CREATE | HAWK_SIO_TRUNCATE | HAWK_SIO_IGNOREECERR); + if (sio == HAWK_NULL) return -1; + + if (hawk_rtx_setofilename ( + rtx, file, hawk_strlen(file)) == -1) + { + hawk_sio_close (sio); + return -1; + } + + if (this->console_cmgr) + hawk_sio_setcmgr (sio, this->console_cmgr); + io.setHandle (sio); + + this->ofile_index++; + this->ofile_count++; + return 1; + } +} + +int StdHawk::openConsole (Console& io) +{ + Console::Mode mode = io.getMode(); + + if (mode == Console::READ) + { + this->runarg_count = 0; + this->runarg_index = 0; + if (this->runarg.len > 0) + { + // skip ARGV[0] + this->runarg_index++; + } + return open_console_in (io); + } + else + { + HAWK_ASSERT (mode == Console::WRITE); + + this->ofile_count = 0; + this->ofile_index = 0; + return open_console_out (io); + } +} + +int StdHawk::closeConsole (Console& io) +{ + hawk_sio_close ((hawk_sio_t*)io.getHandle()); + return 0; +} + +StdHawk::ssize_t StdHawk::readConsole (Console& io, char_t* data, size_t size) +{ + hawk_ssize_t nn; + + while ((nn = hawk_sio_getoochars((hawk_sio_t*)io.getHandle(),data,size)) == 0) + { + int n; + hawk_sio_t* sio = (hawk_sio_t*)io.getHandle(); + + n = open_console_in (io); + if (n == -1) return -1; + + if (n == 0) + { + /* no more input console */ + return 0; + } + + if (sio) hawk_sio_close (sio); + } + + return nn; +} + +StdHawk::ssize_t StdHawk::writeConsole (Console& io, const char_t* data, size_t size) +{ + return hawk_sio_putoochars((hawk_sio_t*)io.getHandle(), data, size); +} + +StdHawk::ssize_t StdHawk::writeConsoleBytes (Console& io, const hawk_bch_t* data, size_t size) +{ + return hawk_sio_putbchars((hawk_sio_t*)io.getHandle(), data, size); +} + +int StdHawk::flushConsole (Console& io) +{ + return hawk_sio_flush ((hawk_sio_t*)io.getHandle()); +} + +int StdHawk::nextConsole (Console& io) +{ + int n; + hawk_sio_t* sio = (hawk_sio_t*)io.getHandle(); + + n = (io.getMode() == Console::READ)? + open_console_in(io): open_console_out(io); + if (n == -1) return -1; + + if (n == 0) + { + /* if there is no more file, keep the previous handle */ + return 0; + } + + if (sio) hawk_sio_close (sio); + return n; +} + +// memory allocation primitives +void* StdHawk::allocMem (size_t n) +{ + return ::malloc (n); +} + +void* StdHawk::reallocMem (void* ptr, size_t n) +{ + return ::realloc (ptr, n); +} + +void StdHawk::freeMem (void* ptr) +{ + ::free (ptr); +} + +// miscellaneous primitive + +StdHawk::flt_t StdHawk::pow (flt_t x, flt_t y) +{ + return hawk_stdmathpow (this->awk, x, y); +} + +StdHawk::flt_t StdHawk::mod (flt_t x, flt_t y) +{ + return hawk_stdmathmod (this->awk, x, y); +} + +void* StdHawk::modopen (const mod_spec_t* spec) +{ + void* h; + h = hawk_stdmodopen (this->awk, spec); + if (!h) this->retrieveError (); + return h; +} + +void StdHawk::modclose (void* handle) +{ + hawk_stdmodclose (this->awk, handle); +} + +void* StdHawk::modsym (void* handle, const hawk_ooch_t* name) +{ + void* s; + s = hawk_stdmodsym (this->awk, handle, name); + if (!s) this->retrieveError (); + return s; +} + +int StdHawk::SourceFile::open (Data& io) +{ + hawk_sio_t* sio; + + if (io.isMaster()) + { + // open the main source file. + + if (this->name[0] == HAWK_T('-') && this->name[1] == HAWK_T('\0')) + { + if (io.getMode() == READ) + sio = open_sio_std ( + io, HAWK_NULL, HAWK_SIO_STDIN, + HAWK_SIO_READ | HAWK_SIO_IGNOREECERR); + else + sio = open_sio_std ( + io, HAWK_NULL, HAWK_SIO_STDOUT, + HAWK_SIO_WRITE | HAWK_SIO_CREATE | + HAWK_SIO_TRUNCATE | HAWK_SIO_IGNOREECERR | HAWK_SIO_LINEBREAK); + if (sio == HAWK_NULL) return -1; + } + else + { + sio = open_sio ( + io, HAWK_NULL, this->name, + (io.getMode() == READ? + (HAWK_SIO_READ | HAWK_SIO_IGNOREECERR | HAWK_SIO_KEEPPATH): + (HAWK_SIO_WRITE | HAWK_SIO_CREATE | HAWK_SIO_TRUNCATE | HAWK_SIO_IGNOREECERR)) + ); + if (sio == HAWK_NULL) return -1; + } + + if (this->cmgr) hawk_sio_setcmgr (sio, this->cmgr); + io.setName (this->name); + } + else + { + // open an included file + const char_t* ioname, * file; + char_t fbuf[64]; + char_t* dbuf = HAWK_NULL; + + ioname = io.getName(); + HAWK_ASSERT (ioname != HAWK_NULL); + + file = ioname; + if (io.getPrevHandle()) + { + const hawk_ooch_t* outer; + + outer = hawk_sio_getpath ((hawk_sio_t*)io.getPrevHandle()); + if (outer) + { + const hawk_ooch_t* base; + + base = hawk_basename(outer); + if (base != outer && ioname[0] != HAWK_T('/')) + { + size_t tmplen, totlen, dirlen; + + dirlen = base - outer; + totlen = hawk_strlen(ioname) + dirlen; + if (totlen >= HAWK_COUNTOF(fbuf)) + { + dbuf = (hawk_ooch_t*) HAWK_MMGR_ALLOC ( + ((Hawk*)io)->getMmgr(), + HAWK_SIZEOF(hawk_ooch_t) * (totlen + 1) + ); + if (dbuf == HAWK_NULL) + { + ((Hawk*)io)->setError (HAWK_ENOMEM); + return -1; + } + + file = dbuf; + } + else file = fbuf; + + tmplen = hawk_copy_oochars_to_oocstr_unlimited ((char_t*)file, outer, dirlen); + hawk_copy_oocstr_unlimited ((char_t*)file + tmplen, ioname); + } + } + } + + sio = open_sio ( + io, HAWK_NULL, file, + (io.getMode() == READ? + (HAWK_SIO_READ | HAWK_SIO_IGNOREECERR | HAWK_SIO_KEEPPATH): + (HAWK_SIO_WRITE | HAWK_SIO_CREATE | HAWK_SIO_TRUNCATE | HAWK_SIO_IGNOREECERR)) + ); + if (dbuf) HAWK_MMGR_FREE (((Hawk*)io)->getMmgr(), dbuf); + if (sio == HAWK_NULL) return -1; + if (this->cmgr) hawk_sio_setcmgr (sio, this->cmgr); + } + + io.setHandle (sio); + return 1; +} + +int StdHawk::SourceFile::close (Data& io) +{ + hawk_sio_t* sio = (hawk_sio_t*)io.getHandle(); + hawk_sio_flush (sio); + hawk_sio_close (sio); + return 0; +} + +StdHawk::ssize_t StdHawk::SourceFile::read (Data& io, char_t* buf, size_t len) +{ + return hawk_sio_getoochars ((hawk_sio_t*)io.getHandle(), buf, len); +} + +StdHawk::ssize_t StdHawk::SourceFile::write (Data& io, const char_t* buf, size_t len) +{ + return hawk_sio_putoochars ((hawk_sio_t*)io.getHandle(), buf, len); +} + +int StdHawk::SourceString::open (Data& io) +{ + hawk_sio_t* sio; + + if (io.getName() == HAWK_NULL) + { + // open the main source file. + // SourceString does not support writing. + if (io.getMode() == WRITE) return -1; + ptr = str; + } + else + { + // open an included file + + const char_t* ioname, * file; + char_t fbuf[64]; + char_t* dbuf = HAWK_NULL; + + ioname = io.getName(); + HAWK_ASSERT (ioname != HAWK_NULL); + + file = ioname; + if (io.getPrevHandle()) + { + const hawk_ooch_t* outer; + + outer = hawk_sio_getpath ((hawk_sio_t*)io.getPrevHandle()); + if (outer) + { + const hawk_ooch_t* base; + + base = hawk_basename(outer); + if (base != outer && ioname[0] != HAWK_T('/')) + { + size_t tmplen, totlen, dirlen; + + dirlen = base - outer; + totlen = hawk_strlen(ioname) + dirlen; + if (totlen >= HAWK_COUNTOF(fbuf)) + { + dbuf = (hawk_ooch_t*)HAWK_MMGR_ALLOC( + ((Hawk*)io)->getMmgr(), + HAWK_SIZEOF(hawk_ooch_t) * (totlen + 1) + ); + if (dbuf == HAWK_NULL) + { + ((Hawk*)io)->setError (HAWK_ENOMEM); + return -1; + } + + file = dbuf; + } + else file = fbuf; + + tmplen = hawk_copy_oochars_to_oocstr_unlimited ((char_t*)file, outer, dirlen); + hawk_copy_oocstr_unlimited ((char_t*)file + tmplen, ioname); + } + } + } + + sio = open_sio ( + io, HAWK_NULL, file, + (io.getMode() == READ? + (HAWK_SIO_READ | HAWK_SIO_IGNOREECERR | HAWK_SIO_KEEPPATH): + (HAWK_SIO_WRITE | HAWK_SIO_CREATE | HAWK_SIO_TRUNCATE | HAWK_SIO_IGNOREECERR)) + ); + if (dbuf) HAWK_MMGR_FREE (((Hawk*)io)->getMmgr(), dbuf); + if (sio == HAWK_NULL) return -1; + + io.setHandle (sio); + } + + return 1; +} + +int StdHawk::SourceString::close (Data& io) +{ + if (!io.isMaster()) hawk_sio_close ((hawk_sio_t*)io.getHandle()); + return 0; +} + +StdHawk::ssize_t StdHawk::SourceString::read (Data& io, char_t* buf, size_t len) +{ + if (io.isMaster()) + { + hawk_oow_t n = 0; + while (*ptr != HAWK_T('\0') && n < len) buf[n++] = *ptr++; + return n; + } + else + { + return hawk_sio_getoochars ((hawk_sio_t*)io.getHandle(), buf, len); + } +} + +StdHawk::ssize_t StdHawk::SourceString::write (Data& io, const char_t* buf, size_t len) +{ + if (io.isMaster()) + { + return -1; + } + else + { + // in fact, this block will never be reached as + // there is no included file concept for deparsing + return hawk_sio_putoochars ((hawk_sio_t*)io.getHandle(), buf, len); + } +} + +///////////////////////////////// +HAWK_END_NAMESPACE(QSE) +///////////////////////////////// + diff --git a/hawk/lib/StdHawk.hpp b/hawk/lib/StdHawk.hpp new file mode 100644 index 00000000..dfbb7bee --- /dev/null +++ b/hawk/lib/StdHawk.hpp @@ -0,0 +1,227 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_STDAWK_HPP_ +#define _HAWK_STDAWK_HPP_ + +#include +#include + +/// \file +/// Standard AWK Interpreter + +///////////////////////////////// +HAWK_BEGIN_NAMESPACE(QSE) +//////////////////////////////// + +/// +/// The StdHawk class provides an easier-to-use interface by overriding +/// primitive methods, and implementing the file handler, the pipe handler, +/// and common intrinsic functions. +/// +class HAWK_EXPORT StdHawk: public Hawk +{ +public: + /// + /// The SourceFile class implements script I/O from and to a file. + /// + class HAWK_EXPORT SourceFile: public Source + { + public: + SourceFile (const char_t* name, hawk_cmgr_t* cmgr = HAWK_NULL): + name (name), cmgr (cmgr) + { + dir.ptr = HAWK_NULL; dir.len = 0; + } + + int open (Data& io); + int close (Data& io); + ssize_t read (Data& io, char_t* buf, size_t len); + ssize_t write (Data& io, const char_t* buf, size_t len); + + protected: + const char_t* name; + hawk_oocs_t dir; + hawk_cmgr_t* cmgr; + }; + + /// + /// The SourceString class implements script input from a string. + /// Deparsing is not supported. + /// + class HAWK_EXPORT SourceString: public Source + { + public: + SourceString (const char_t* str): str (str) {} + + int open (Data& io); + int close (Data& io); + ssize_t read (Data& io, char_t* buf, size_t len); + ssize_t write (Data& io, const char_t* buf, size_t len); + + protected: + const char_t* str; + const char_t* ptr; + }; + + StdHawk (Mmgr* mmgr = HAWK_NULL): Hawk(mmgr), stdmod_up(false), console_cmgr(HAWK_NULL) + { + } + + int open (); + void close (); + + void uponClosing (); + + Run* parse (Source& in, Source& out); + + /// The setConsoleCmgr() function sets the encoding type of + /// the console streams. They include both the input and the output + /// streams. It provides no way to specify a different encoding + /// type for the input and the output stream. + void setConsoleCmgr (const hawk_cmgr_t* cmgr); + + /// The getConsoleCmgr() function returns the current encoding + /// type set for the console streams. + const hawk_cmgr_t* getConsoleCmgr () const; + + /// The addConsoleOutput() function adds a file to form an + /// output console stream. + int addConsoleOutput (const char_t* arg, size_t len); + int addConsoleOutput (const char_t* arg); + + void clearConsoleOutputs (); + +protected: + int make_additional_globals (Run* run); + int build_argcv (Run* run); + int build_environ (Run* run); + int __build_environ (Run* run, void* envptr); + + // intrinsic functions + hawk_cmgr_t* getiocmgr (const char_t* ioname); + + int setioattr (Run& run, Value& ret, Value* args, size_t nargs, const char_t* name, size_t len); + int getioattr (Run& run, Value& ret, Value* args, size_t nargs, const char_t* name, size_t len); + + // pipe io handlers + int openPipe (Pipe& io); + int closePipe (Pipe& io); + ssize_t readPipe (Pipe& io, char_t* buf, size_t len); + ssize_t writePipe (Pipe& io, const char_t* buf, size_t len); + ssize_t writePipeBytes (Pipe& io, const hawk_bch_t* buf, size_t len); + int flushPipe (Pipe& io); + + // file io handlers + int openFile (File& io); + int closeFile (File& io); + ssize_t readFile (File& io, char_t* buf, size_t len); + ssize_t writeFile (File& io, const char_t* buf, size_t len); + ssize_t writeFileBytes (File& io, const hawk_bch_t* buf, size_t len); + int flushFile (File& io); + + // console io handlers + int openConsole (Console& io); + int closeConsole (Console& io); + ssize_t readConsole (Console& io, char_t* buf, size_t len); + ssize_t writeConsole (Console& io, const char_t* buf, size_t len); + ssize_t writeConsoleBytes (Console& io, const hawk_bch_t* buf, size_t len); + int flushConsole (Console& io); + int nextConsole (Console& io); + + // primitive handlers + void* allocMem (size_t n); + void* reallocMem (void* ptr, size_t n); + void freeMem (void* ptr); + + flt_t pow (flt_t x, flt_t y); + flt_t mod (flt_t x, flt_t y); + + void* modopen (const mod_spec_t* spec); + void modclose (void* handle); + void* modsym (void* handle, const char_t* name); + +protected: + hawk_htb_t cmgrtab; + bool cmgrtab_inited; + bool stdmod_up; + + hawk_cmgr_t* console_cmgr; + + // global variables + int gbl_argc; + int gbl_argv; + int gbl_environ; + + // standard input console - reuse runarg + size_t runarg_index; + size_t runarg_count; + + // standard output console + xstrs_t ofile; + size_t ofile_index; + size_t ofile_count; + +public: + struct ioattr_t + { + hawk_cmgr_t* cmgr; + char_t cmgr_name[64]; // i assume that the cmgr name never exceeds this length. + hawk_ntime_t tmout[4]; + + ioattr_t (): cmgr (HAWK_NULL) + { + this->cmgr_name[0] = HAWK_T('\0'); + for (size_t i = 0; i < HAWK_COUNTOF(this->tmout); i++) + { + this->tmout[i].sec = -999; + this->tmout[i].nsec = 0; + } + } + }; + + static ioattr_t default_ioattr; + +protected: + ioattr_t* get_ioattr (const char_t* ptr, size_t len); + ioattr_t* find_or_make_ioattr (const char_t* ptr, size_t len); + + +private: + int open_console_in (Console& io); + int open_console_out (Console& io); + + int open_pio (Pipe& io); + int open_nwio (Pipe& io, int flags, void* nwad); +}; + +///////////////////////////////// +HAWK_END_NAMESPACE(QSE) +///////////////////////////////// + +#endif + + diff --git a/hawk/lib/arr.c b/hawk/lib/arr.c new file mode 100644 index 00000000..d46aa79c --- /dev/null +++ b/hawk/lib/arr.c @@ -0,0 +1,763 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include "hawk-prv.h" + +#define slot_t hawk_arr_slot_t +#define copier_t hawk_arr_copier_t +#define freeer_t hawk_arr_freeer_t +#define comper_t hawk_arr_comper_t +#define sizer_t hawk_arr_sizer_t +#define keeper_t hawk_arr_keeper_t +#define walker_t hawk_arr_walker_t + + +#define TOB(arr,len) ((len)*(arr)->scale) +#define DPTR(slot) ((slot)->val.ptr) +#define DLEN(slot) ((slot)->val.len) + +/* the default comparator is not proper for number comparision. + * the first different byte decides whice side is greater */ +static int default_comparator (hawk_arr_t* arr, + const void* dptr1, hawk_oow_t dlen1, + const void* dptr2, hawk_oow_t dlen2) +{ + /* + if (dlen1 == dlen2) return HAWK_MEMCMP(dptr1, dptr2, TOB(arr,dlen1)); + return 1; + */ + + int n; + hawk_oow_t min; + + min = (dlen1 < dlen2)? dlen1: dlen2; + n = HAWK_MEMCMP(dptr1, dptr2, TOB(arr,min)); + if (n == 0 && dlen1 != dlen2) + { + n = (dlen1 > dlen2)? 1: -1; + } + + return n; +} + +static HAWK_INLINE slot_t* alloc_slot (hawk_arr_t* arr, void* dptr, hawk_oow_t dlen) +{ + slot_t* n; + + if (arr->copier == HAWK_ARR_COPIER_SIMPLE) + { + n = (slot_t*)hawk_allocmem(arr->hawk, HAWK_SIZEOF(slot_t)); + if (!n) return HAWK_NULL; + DPTR(n) = dptr; + } + else if (arr->copier == HAWK_ARR_COPIER_INLINE) + { + n = (slot_t*)hawk_allocmem(arr->hawk, HAWK_SIZEOF(slot_t) + TOB(arr,dlen)); + if (!n) return HAWK_NULL; + + HAWK_MEMCPY (n + 1, dptr, TOB(arr,dlen)); + DPTR(n) = n + 1; + } + else + { + n = (slot_t*)hawk_allocmem(arr->hawk, HAWK_SIZEOF(slot_t)); + if (!n) return HAWK_NULL; + DPTR(n) = arr->copier (arr, dptr, dlen); + if (DPTR(n) == HAWK_NULL) + { + hawk_freemem (arr->hawk, n); + return HAWK_NULL; + } + } + + DLEN(n) = dlen; + + return n; +} + +hawk_arr_t* hawk_arr_open (hawk_t* awk, hawk_oow_t xtnsize, hawk_oow_t capa) +{ + hawk_arr_t* arr; + + arr = (hawk_arr_t*)hawk_allocmem(awk, HAWK_SIZEOF(hawk_arr_t) + xtnsize); + if (arr == HAWK_NULL) return HAWK_NULL; + + if (hawk_arr_init(arr, awk, capa) <= -1) + { + hawk_freemem (awk, arr); + return HAWK_NULL; + } + + HAWK_MEMSET (arr + 1, 0, xtnsize); + return arr; +} + +void hawk_arr_close (hawk_arr_t* arr) +{ + hawk_arr_fini (arr); + hawk_freemem (arr->hawk, arr); +} + +int hawk_arr_init (hawk_arr_t* arr, hawk_t* awk, hawk_oow_t capa) +{ + HAWK_MEMSET (arr, 0, HAWK_SIZEOF(*arr)); + + arr->hawk = awk; + arr->size = 0; + arr->capa = 0; + arr->slot = HAWK_NULL; + arr->scale = 1; + arr->heap_pos_offset = HAWK_ARR_NIL; + + arr->copier = HAWK_ARR_COPIER_SIMPLE; + arr->comper = default_comparator; + + return (hawk_arr_setcapa(arr, capa) == HAWK_NULL)? -1: 0; +} + +void hawk_arr_fini (hawk_arr_t* arr) +{ + hawk_arr_clear (arr); + + if (arr->slot) + { + hawk_freemem (arr->hawk, arr->slot); + arr->slot = HAWK_NULL; + arr->capa = 0; + } +} + +int hawk_arr_getscale (hawk_arr_t* arr) +{ + return arr->scale; +} + +void hawk_arr_setscale (hawk_arr_t* arr, int scale) +{ + /* The scale should be larger than 0 and less than or equal to the + * maximum value that the hawk_uint8_t type can hold */ + HAWK_ASSERT (arr->hawk, scale > 0 && scale <= HAWK_TYPE_MAX(hawk_uint8_t)); + + if (scale <= 0) scale = 1; + if (scale > HAWK_TYPE_MAX(hawk_uint8_t)) scale = HAWK_TYPE_MAX(hawk_uint8_t); + + arr->scale = scale; +} + +copier_t hawk_arr_getcopier (hawk_arr_t* arr) +{ + return arr->copier; +} + +void hawk_arr_setcopier (hawk_arr_t* arr, copier_t copier) +{ + if (copier == HAWK_NULL) copier = HAWK_ARR_COPIER_SIMPLE; + arr->copier = copier; +} + +freeer_t hawk_arr_getfreeer (hawk_arr_t* arr) +{ + return arr->freeer; +} + +void hawk_arr_setfreeer (hawk_arr_t* arr, freeer_t freeer) +{ + arr->freeer = freeer; +} + +comper_t hawk_arr_getcomper (hawk_arr_t* arr) +{ + return arr->comper; +} + +void hawk_arr_setcomper (hawk_arr_t* arr, comper_t comper) +{ + if (comper == HAWK_NULL) comper = default_comparator; + arr->comper = comper; +} + +keeper_t hawk_arr_getkeeper (hawk_arr_t* arr) +{ + return arr->keeper; +} + +void hawk_arr_setkeeper (hawk_arr_t* arr, keeper_t keeper) +{ + arr->keeper = keeper; +} + +sizer_t hawk_arr_getsizer (hawk_arr_t* arr) +{ + return arr->sizer; +} + +void hawk_arr_setsizer (hawk_arr_t* arr, sizer_t sizer) +{ + arr->sizer = sizer; +} + +hawk_oow_t hawk_arr_getsize (hawk_arr_t* arr) +{ + return arr->size; +} + +hawk_oow_t hawk_arr_getcapa (hawk_arr_t* arr) +{ + return arr->capa; +} + +hawk_arr_t* hawk_arr_setcapa (hawk_arr_t* arr, hawk_oow_t capa) +{ + void* tmp; + + if (capa == arr->capa) return arr; + + if (arr->size > capa) + { + /* to trigger freeers on the items truncated */ + hawk_arr_delete (arr, capa, arr->size - capa); + HAWK_ASSERT (arr->hawk, arr->size <= capa); + } + + if (capa > 0) + { + tmp = (slot_t**)hawk_reallocmem(arr->hawk, arr->slot, HAWK_SIZEOF(*arr->slot) * capa); + if (!tmp) return HAWK_NULL; + } + else + { + if (arr->slot) + { + hawk_arr_clear (arr); + hawk_freemem (arr->hawk, arr->slot); + } + + tmp = HAWK_NULL; + } + + arr->slot = tmp; + arr->capa = capa; + + return arr; +} + +hawk_oow_t hawk_arr_search (hawk_arr_t* arr, hawk_oow_t pos, const void* dptr, hawk_oow_t dlen) +{ + hawk_oow_t i; + + for (i = pos; i < arr->size; i++) + { + if (arr->slot[i] == HAWK_NULL) continue; + + if (arr->comper (arr, + DPTR(arr->slot[i]), DLEN(arr->slot[i]), + dptr, dlen) == 0) return i; + } + + return HAWK_ARR_NIL; +} + +hawk_oow_t hawk_arr_rsearch (hawk_arr_t* arr, hawk_oow_t pos, const void* dptr, hawk_oow_t dlen) +{ + hawk_oow_t i; + + if (arr->size > 0) + { + if (pos >= arr->size) pos = arr->size - 1; + + for (i = pos + 1; i-- > 0; ) + { + if (arr->slot[i] == HAWK_NULL) continue; + + if (arr->comper (arr, + DPTR(arr->slot[i]), DLEN(arr->slot[i]), + dptr, dlen) == 0) return i; + } + } + + return HAWK_ARR_NIL; +} + +hawk_oow_t hawk_arr_upsert (hawk_arr_t* arr, hawk_oow_t pos, void* dptr, hawk_oow_t dlen) +{ + if (pos < arr->size) return hawk_arr_update (arr, pos, dptr, dlen); + return hawk_arr_insert (arr, pos, dptr, dlen); +} + +hawk_oow_t hawk_arr_insert (hawk_arr_t* arr, hawk_oow_t pos, void* dptr, hawk_oow_t dlen) +{ + hawk_oow_t i; + slot_t* slot; + + /* allocate the slot first */ + slot = alloc_slot (arr, dptr, dlen); + if (slot == HAWK_NULL) return HAWK_ARR_NIL; + + /* do resizeing if necessary. + * resizing is performed after slot allocation because that way, it + * doesn't modify arr on any errors */ + if (pos >= arr->capa || arr->size >= arr->capa) + { + hawk_oow_t capa, mincapa; + + /* get the minimum capacity needed */ + mincapa = (pos >= arr->size)? (pos + 1): (arr->size + 1); + + if (arr->sizer) + { + capa = arr->sizer (arr, mincapa); + } + else + { + if (arr->capa <= 0) + { + HAWK_ASSERT (arr->hawk, arr->size <= 0); + capa = (pos < 16)? 16: (pos + 1); + } + else + { + hawk_oow_t bound = (pos >= arr->size)? pos: arr->size; + do { capa = arr->capa * 2; } while (capa <= bound); + } + } + + do + { + if (hawk_arr_setcapa(arr,capa) != HAWK_NULL) break; + + if (capa <= mincapa) + { + if (arr->freeer) arr->freeer (arr, DPTR(slot), DLEN(slot)); + hawk_freemem (arr->hawk, slot); + return HAWK_ARR_NIL; + } + + capa--; /* let it retry after lowering the capacity */ + } + while (1); + } + + if (pos >= arr->capa || arr->size >= arr->capa) + { + /* the buffer is not still enough after resizing */ + if (arr->freeer) arr->freeer (arr, DPTR(slot), DLEN(slot)); + hawk_freemem (arr->hawk, slot); + return HAWK_ARR_NIL; + } + + /* fill in the gap with HAWK_NULL */ + for (i = arr->size; i < pos; i++) arr->slot[i] = HAWK_NULL; + + /* shift values to the next cell */ + for (i = arr->size; i > pos; i--) arr->slot[i] = arr->slot[i-1]; + + /* set the value */ + arr->slot[pos] = slot; + + if (pos > arr->size) arr->size = pos + 1; + else arr->size++; + + return pos; +} + +hawk_oow_t hawk_arr_update (hawk_arr_t* arr, hawk_oow_t pos, void* dptr, hawk_oow_t dlen) +{ + slot_t* c; + + if (pos >= arr->size) return HAWK_ARR_NIL; + + c = arr->slot[pos]; + if (c == HAWK_NULL) + { + /* no previous data */ + arr->slot[pos] = alloc_slot (arr, dptr, dlen); + if (arr->slot[pos] == HAWK_NULL) return HAWK_ARR_NIL; + } + else + { + if (dptr == DPTR(c) && dlen == DLEN(c)) + { + /* updated to the same data */ + if (arr->keeper) arr->keeper (arr, dptr, dlen); + } + else + { + /* updated to different data */ + slot_t* slot = alloc_slot (arr, dptr, dlen); + if (slot == HAWK_NULL) return HAWK_ARR_NIL; + + if (arr->freeer) arr->freeer (arr, DPTR(c), DLEN(c)); + hawk_freemem (arr->hawk, c); + + arr->slot[pos] = slot; + } + } + + return pos; +} + +hawk_oow_t hawk_arr_delete (hawk_arr_t* arr, hawk_oow_t index, hawk_oow_t count) +{ + hawk_oow_t i; + + if (index >= arr->size) return 0; + if (count > arr->size - index) count = arr->size - index; + + i = index; + + for (i = index; i < index + count; i++) + { + slot_t* c = arr->slot[i]; + + if (c != HAWK_NULL) + { + if (arr->freeer) arr->freeer (arr, DPTR(c), DLEN(c)); + hawk_freemem (arr->hawk, c); + + arr->slot[i] = HAWK_NULL; + } + } + + for (i = index + count; i < arr->size; i++) + { + arr->slot[i-count] = arr->slot[i]; + } + arr->slot[arr->size-1] = HAWK_NULL; + + arr->size -= count; + return count; +} + +hawk_oow_t hawk_arr_uplete (hawk_arr_t* arr, hawk_oow_t index, hawk_oow_t count) +{ + hawk_oow_t i; + + if (index >= arr->size) return 0; + if (count > arr->size - index) count = arr->size - index; + + i = index; + + for (i = index; i < index + count; i++) + { + slot_t* c = arr->slot[i]; + + if (c != HAWK_NULL) + { + if (arr->freeer) arr->freeer (arr, DPTR(c), DLEN(c)); + hawk_freemem (arr->hawk, c); + + arr->slot[i] = HAWK_NULL; + } + } + + return count; +} + +void hawk_arr_clear (hawk_arr_t* arr) +{ + hawk_oow_t i; + + for (i = 0; i < arr->size; i++) + { + slot_t* c = arr->slot[i]; + if (c != HAWK_NULL) + { + if (arr->freeer) + arr->freeer (arr, DPTR(c), DLEN(c)); + hawk_freemem (arr->hawk, c); + arr->slot[i] = HAWK_NULL; + } + } + + arr->size = 0; +} + +hawk_oow_t hawk_arr_walk (hawk_arr_t* arr, walker_t walker, void* ctx) +{ + hawk_arr_walk_t w = HAWK_ARR_WALK_FORWARD; + hawk_oow_t i = 0, nwalks = 0; + + if (arr->size <= 0) return 0; + + while (1) + { + if (arr->slot[i] != HAWK_NULL) + { + w = walker (arr, i, ctx); + nwalks++; + } + + if (w == HAWK_ARR_WALK_STOP) break; + + if (w == HAWK_ARR_WALK_FORWARD) + { + i++; + if (i >= arr->size) break; + } + if (w == HAWK_ARR_WALK_BACKWARD) + { + if (i <= 0) break; + i--; + } + } + + return nwalks; +} + +hawk_oow_t hawk_arr_rwalk (hawk_arr_t* arr, walker_t walker, void* ctx) +{ + hawk_arr_walk_t w = HAWK_ARR_WALK_BACKWARD; + hawk_oow_t i, nwalks = 0; + + if (arr->size <= 0) return 0; + i = arr->size - 1; + + while (1) + { + if (arr->slot[i] != HAWK_NULL) + { + w = walker (arr, i, ctx); + nwalks++; + } + + if (w == HAWK_ARR_WALK_STOP) break; + + if (w == HAWK_ARR_WALK_FORWARD) + { + i++; + if (i >= arr->size) break; + } + if (w == HAWK_ARR_WALK_BACKWARD) + { + if (i <= 0) break; + i--; + } + } + + return nwalks; +} + +hawk_oow_t hawk_arr_pushstack (hawk_arr_t* arr, void* dptr, hawk_oow_t dlen) +{ + return hawk_arr_insert (arr, arr->size, dptr, dlen); +} + +void hawk_arr_popstack (hawk_arr_t* arr) +{ + HAWK_ASSERT (arr->hawk, arr->size > 0); + hawk_arr_delete (arr, arr->size - 1, 1); +} + +#define HEAP_PARENT(x) (((x)-1) / 2) +#define HEAP_LEFT(x) ((x)*2 + 1) +#define HEAP_RIGHT(x) ((x)*2 + 2) + +#define HEAP_UPDATE_POS(arr, index) \ + do { \ + if (arr->heap_pos_offset != HAWK_ARR_NIL) \ + *(hawk_oow_t*)((hawk_uint8_t*)DPTR(arr->slot[index]) + arr->heap_pos_offset) = index; \ + } while(0) + +hawk_oow_t sift_up (hawk_arr_t* arr, hawk_oow_t index) +{ + hawk_oow_t parent; + + if (index > 0) + { + int n; + + parent = HEAP_PARENT(index); + n = arr->comper (arr, + DPTR(arr->slot[index]), DLEN(arr->slot[index]), + DPTR(arr->slot[parent]), DLEN(arr->slot[parent])); + if (n > 0) + { + slot_t* tmp; + + tmp = arr->slot[index]; + + while (1) + { + arr->slot[index] = arr->slot[parent]; + HEAP_UPDATE_POS (arr, index); + + index = parent; + parent = HEAP_PARENT(parent); + + if (index <= 0) break; + + n = arr->comper (arr, + DPTR(tmp), DLEN(tmp), + DPTR(arr->slot[parent]), DLEN(arr->slot[parent])); + if (n <= 0) break; + } + + arr->slot[index] = tmp; + HEAP_UPDATE_POS (arr, index); + } + } + return index; +} + +hawk_oow_t sift_down (hawk_arr_t* arr, hawk_oow_t index) +{ + hawk_oow_t base; + + base = arr->size / 2; + + if (index < base) /* at least 1 child is under the 'index' position */ + { + slot_t* tmp; + + tmp = arr->slot[index]; + + do + { + hawk_oow_t left, right, child; + int n; + + left= HEAP_LEFT(index); + right = HEAP_RIGHT(index); + + if (right < arr->size) + { + n = arr->comper (arr, + DPTR(arr->slot[right]), DLEN(arr->slot[right]), + DPTR(arr->slot[left]), DLEN(arr->slot[left])); + child = (n > 0)? right: left; + } + else + { + child = left; + } + + n = arr->comper (arr, + DPTR(tmp), DLEN(tmp), + DPTR(arr->slot[child]), DLEN(arr->slot[child])); + if (n > 0) break; + + arr->slot[index] = arr->slot[child]; + HEAP_UPDATE_POS (arr, index); + index = child; + } + while (index < base); + + arr->slot[index] = tmp; + HEAP_UPDATE_POS (arr, index); + } + + return index; +} + +hawk_oow_t hawk_arr_pushheap (hawk_arr_t* arr, void* dptr, hawk_oow_t dlen) +{ + hawk_oow_t index; + + /* add a value at the back of the array */ + index = arr->size; + if (hawk_arr_insert (arr, index, dptr, dlen) == HAWK_ARR_NIL) return HAWK_ARR_NIL; + HEAP_UPDATE_POS (arr, index); + + HAWK_ASSERT (arr->hawk, arr->size == index + 1); + + /* move the item upto the top if it's greater than the parent items */ + sift_up (arr, index); + return arr->size; +} + +void hawk_arr_popheap (hawk_arr_t* arr) +{ + HAWK_ASSERT (arr->hawk, arr->size > 0); + hawk_arr_deleteheap (arr, 0); +} + +void hawk_arr_deleteheap (hawk_arr_t* arr, hawk_oow_t index) +{ + slot_t* tmp; + + HAWK_ASSERT (arr->hawk, arr->size > 0); + HAWK_ASSERT (arr->hawk, index < arr->size); + + /* remember the item to destroy */ + tmp = arr->slot[index]; + + arr->size = arr->size - 1; + if (arr->size > 0 && index != arr->size) + { + int n; + + /* move the last item to the deleting position */ + arr->slot[index] = arr->slot[arr->size]; + HEAP_UPDATE_POS (arr, index); + + /* move it up if the last item is greater than the item to be deleted, + * move it down otherwise. */ + n = arr->comper (arr, + DPTR(arr->slot[index]), DLEN(arr->slot[index]), + DPTR(tmp), DLEN(tmp)); + if (n > 0) sift_up (arr, index); + else if (n < 0) sift_down (arr, index); + } + + /* destroy the actual item */ + if (arr->freeer) arr->freeer (arr, DPTR(tmp), DLEN(tmp)); + hawk_freemem (arr->hawk, tmp); + + /* empty the last slot */ + arr->slot[arr->size] = HAWK_NULL; +} + +hawk_oow_t hawk_arr_updateheap (hawk_arr_t* arr, hawk_oow_t index, void* dptr, hawk_oow_t dlen) +{ + slot_t* tmp; + int n; + + tmp = arr->slot[index]; + HAWK_ASSERT (arr->hawk, tmp != HAWK_NULL); + + n = arr->comper(arr, dptr, dlen, DPTR(tmp), DLEN(tmp)); + if (n) + { + if (hawk_arr_update(arr, index, dptr, dlen) == HAWK_ARR_NIL) return HAWK_ARR_NIL; + HEAP_UPDATE_POS (arr, index); + + if (n > 0) sift_up (arr, index); + else sift_down (arr, index); + } + + return index; +} + +hawk_oow_t hawk_arr_getheapposoffset (hawk_arr_t* arr) +{ + return arr->heap_pos_offset; +} + +void hawk_arr_setheapposoffset (hawk_arr_t* arr, hawk_oow_t offset) +{ + arr->heap_pos_offset = offset; +} diff --git a/hawk/lib/chr.c b/hawk/lib/chr.c new file mode 100644 index 00000000..28eb96f6 --- /dev/null +++ b/hawk/lib/chr.c @@ -0,0 +1,489 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include "hawk-prv.h" + +/* ---------------------------------------------------------- */ +#include "uch-prop.h" +#include "uch-case.h" +/* ---------------------------------------------------------- */ + +#define UCH_PROP_MAP_INDEX(c) ((c) / HAWK_COUNTOF(uch_prop_page_0000)) +#define UCH_PROP_PAGE_INDEX(c) ((c) % HAWK_COUNTOF(uch_prop_page_0000)) + +#define UCH_CASE_MAP_INDEX(c) ((c) / HAWK_COUNTOF(uch_case_page_0000)) +#define UCH_CASE_PAGE_INDEX(c) ((c) % HAWK_COUNTOF(uch_case_page_0000)) + +#define UCH_IS_TYPE(c,type) \ + ((c) >= 0 && (c) <= UCH_PROP_MAX && \ + (uch_prop_map[UCH_PROP_MAP_INDEX(c)][UCH_PROP_PAGE_INDEX(c)] & (type)) != 0) + +int hawk_is_uch_type (hawk_uch_t c, hawk_uch_prop_t type) +{ + return UCH_IS_TYPE((hawk_uchu_t)c, type); +} + +int hawk_is_uch_upper (hawk_uch_t c) +{ + return UCH_IS_TYPE((hawk_uchu_t)c, HAWK_UCH_PROP_UPPER); +} + +int hawk_is_uch_lower (hawk_uch_t c) +{ + return UCH_IS_TYPE((hawk_uchu_t)c, HAWK_UCH_PROP_LOWER); +} + +int hawk_is_uch_alpha (hawk_uch_t c) +{ + return UCH_IS_TYPE((hawk_uchu_t)c, HAWK_UCH_PROP_ALPHA); +} + +int hawk_is_uch_digit (hawk_uch_t c) +{ + return UCH_IS_TYPE((hawk_uchu_t)c, HAWK_UCH_PROP_DIGIT); +} + +int hawk_is_uch_xdigit (hawk_uch_t c) +{ + return UCH_IS_TYPE((hawk_uchu_t)c, HAWK_UCH_PROP_XDIGIT); +} + +int hawk_is_uch_alnum (hawk_uch_t c) +{ + return UCH_IS_TYPE((hawk_uchu_t)c, HAWK_UCH_PROP_ALNUM); +} + +int hawk_is_uch_space (hawk_uch_t c) +{ + return UCH_IS_TYPE((hawk_uchu_t)c, HAWK_UCH_PROP_SPACE); +} + +int hawk_is_uch_print (hawk_uch_t c) +{ + return UCH_IS_TYPE((hawk_uchu_t)c, HAWK_UCH_PROP_PRINT); +} + +int hawk_is_uch_graph (hawk_uch_t c) +{ + return UCH_IS_TYPE((hawk_uchu_t)c, HAWK_UCH_PROP_GRAPH); +} + +int hawk_is_uch_cntrl (hawk_uch_t c) +{ + return UCH_IS_TYPE((hawk_uchu_t)c, HAWK_UCH_PROP_CNTRL); +} + +int hawk_is_uch_punct (hawk_uch_t c) +{ + return UCH_IS_TYPE((hawk_uchu_t)c, HAWK_UCH_PROP_PUNCT); +} + +int hawk_is_uch_blank (hawk_uch_t c) +{ + return UCH_IS_TYPE((hawk_uchu_t)c, HAWK_UCH_PROP_BLANK); +} + +hawk_uch_t hawk_to_uch_upper (hawk_uch_t c) +{ + hawk_uchu_t uc = (hawk_uchu_t)c; + if (uc >= 0 && uc <= UCH_CASE_MAX) + { + uch_case_page_t* page; + page = uch_case_map[UCH_CASE_MAP_INDEX(uc)]; + return uc - page[UCH_CASE_PAGE_INDEX(uc)].upper; + } + return c; +} + +hawk_uch_t hawk_to_uch_lower (hawk_uch_t c) +{ + hawk_uchu_t uc = (hawk_uchu_t)c; + if (uc >= 0 && uc <= UCH_CASE_MAX) + { + uch_case_page_t* page; + page = uch_case_map[UCH_CASE_MAP_INDEX(uc)]; + return uc + page[UCH_CASE_PAGE_INDEX(uc)].lower; + } + return c; +} + +/* ---------------------------------------------------------- */ + +int hawk_is_bch_type (hawk_bch_t c, hawk_bch_prop_t type) +{ + switch (type) + { + case HAWK_OOCH_PROP_UPPER: + return hawk_is_bch_upper(c); + case HAWK_OOCH_PROP_LOWER: + return hawk_is_bch_lower(c); + case HAWK_OOCH_PROP_ALPHA: + return hawk_is_bch_alpha(c); + case HAWK_OOCH_PROP_DIGIT: + return hawk_is_bch_digit(c); + case HAWK_OOCH_PROP_XDIGIT: + return hawk_is_bch_xdigit(c); + case HAWK_OOCH_PROP_ALNUM: + return hawk_is_bch_alnum(c); + case HAWK_OOCH_PROP_SPACE: + return hawk_is_bch_space(c); + case HAWK_OOCH_PROP_PRINT: + return hawk_is_bch_print(c); + case HAWK_OOCH_PROP_GRAPH: + return hawk_is_bch_graph(c); + case HAWK_OOCH_PROP_CNTRL: + return hawk_is_bch_cntrl(c); + case HAWK_OOCH_PROP_PUNCT: + return hawk_is_bch_punct(c); + case HAWK_OOCH_PROP_BLANK: + return hawk_is_bch_blank(c); + } + + /* must not reach here */ + return 0; +} + +#if !defined(hawk_to_bch_upper) +hawk_bch_t hawk_to_bch_upper (hawk_bch_t c) +{ + if(hawk_is_bch_lower(c)) return c & 95; + return c; +} +#endif + +#if !defined(hawk_to_bch_lower) +hawk_bch_t hawk_to_bch_lower (hawk_bch_t c) +{ + if(hawk_is_bch_upper(c)) return c | 32; + return c; +} +#endif + + +/* ---------------------------------------------------------- */ + +static struct prop_tab_t +{ + const hawk_bch_t* name; + int class; +} prop_tab[] = +{ + { "alnum", HAWK_OOCH_PROP_ALNUM }, + { "alpha", HAWK_OOCH_PROP_ALPHA }, + { "blank", HAWK_OOCH_PROP_BLANK }, + { "cntrl", HAWK_OOCH_PROP_CNTRL }, + { "digit", HAWK_OOCH_PROP_DIGIT }, + { "graph", HAWK_OOCH_PROP_GRAPH }, + { "lower", HAWK_OOCH_PROP_LOWER }, + { "print", HAWK_OOCH_PROP_PRINT }, + { "punct", HAWK_OOCH_PROP_PUNCT }, + { "space", HAWK_OOCH_PROP_SPACE }, + { "upper", HAWK_OOCH_PROP_UPPER }, + { "xdigit", HAWK_OOCH_PROP_XDIGIT } +}; + +/* ---------------------------------------------------------- */ + +int hawk_ucstr_to_uch_prop (const hawk_uch_t* name, hawk_uch_prop_t* id) +{ + int left = 0, right = HAWK_COUNTOF(prop_tab) - 1, mid; + while (left <= right) + { + int n; + struct prop_tab_t* kwp; + + /*mid = (left + right) / 2;*/ + mid = left + (right - left) / 2; + kwp = &prop_tab[mid]; + + n = hawk_comp_ucstr_bcstr(name, kwp->name); + if (n > 0) + { + /* if left, right, mid were of hawk_oow_t, + * you would need the following line. + if (mid == 0) break; + */ + right = mid - 1; + } + else if (n < 0) left = mid + 1; + else + { + *id = kwp->class; + return 0; + } + } + + return -1; +} + +int hawk_uchars_to_uch_prop (const hawk_uch_t* name, hawk_oow_t len, hawk_uch_prop_t* id) +{ + int left = 0, right = HAWK_COUNTOF(prop_tab) - 1, mid; + while (left <= right) + { + int n; + struct prop_tab_t* kwp; + + /*mid = (left + right) / 2;*/ + mid = left + (right - left) / 2; + kwp = &prop_tab[mid]; + + n = hawk_comp_uchars_bcstr(name, len, kwp->name); + if (n < 0) + { + /* if left, right, mid were of hawk_oow_t, + * you would need the following line. + if (mid == 0) break; + */ + right = mid - 1; + } + else if (n > 0) left = mid + 1; + else + { + *id = kwp->class; + return 0; + } + } + + return -1; +} + +/* ---------------------------------------------------------- */ + +int hawk_bcstr_to_bch_prop (const hawk_bch_t* name, hawk_bch_prop_t* id) +{ + int left = 0, right = HAWK_COUNTOF(prop_tab) - 1, mid; + while (left <= right) + { + int n; + struct prop_tab_t* kwp; + + /*mid = (left + right) / 2;*/ + mid = left + (right - left) / 2; + kwp = &prop_tab[mid]; + + n = hawk_comp_bcstr(name, kwp->name, 0); + if (n > 0) + { + /* if left, right, mid were of hawk_oow_t, + * you would need the following line. + if (mid == 0) break; + */ + right = mid - 1; + } + else if (n < 0) left = mid + 1; + else + { + *id = kwp->class; + return 0; + } + } + + return -1; +} + +int hawk_bchars_to_bch_prop (const hawk_bch_t* name, hawk_oow_t len, hawk_bch_prop_t* id) +{ + int left = 0, right = HAWK_COUNTOF(prop_tab) - 1, mid; + while (left <= right) + { + int n; + struct prop_tab_t* kwp; + + /*mid = (left + right) / 2;*/ + mid = left + (right - left) / 2; + kwp = &prop_tab[mid]; + + n = hawk_comp_bchars_bcstr(name, len, kwp->name); + if (n < 0) + { + /* if left, right, mid were of hawk_oow_t, + * you would need the following line. + if (mid == 0) break; + */ + right = mid - 1; + } + else if (n > 0) left = mid + 1; + else + { + *id = kwp->class; + return 0; + } + } + + return -1; +} + +/* ----------------------------------------------------------------------- */ + +/* + * See http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c + */ +struct interval +{ + int first; + int last; +}; + +/* auxiliary function for binary search in interval table */ +static int bisearch(hawk_uch_t ucs, const struct interval *table, int max) +{ + int min = 0; + int mid; + + if (ucs < table[0].first || ucs > table[max].last) return 0; + while (max >= min) + { + mid = (min + max) / 2; + if (ucs > table[mid].last) min = mid + 1; + else if (ucs < table[mid].first) max = mid - 1; + else return 1; + } + + return 0; +} + +/* The following two functions define the column width of an ISO 10646 + * character as follows: + * + * - The null character (U+0000) has a column width of 0. + * + * - Other C0/C1 control characters and DEL will lead to a return + * value of -1. + * + * - Non-spacing and enclosing combining characters (general + * category code Mn or Me in the Unicode database) have a + * column width of 0. + * + * - SOFT HYPHEN (U+00AD) has a column width of 1. + * + * - Other format characters (general category code Cf in the Unicode + * database) and ZERO WIDTH SPACE (U+200B) have a column width of 0. + * + * - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF) + * have a column width of 0. + * + * - Spacing characters in the East Asian Wide (W) or East Asian + * Full-width (F) category as defined in Unicode Technical + * Report #11 have a column width of 2. + * + * - All remaining characters (including all printable + * ISO 8859-1 and WGL4 characters, Unicode control characters, + * etc.) have a column width of 1. + * + * This implementation assumes that wchar_t characters are encoded + * in ISO 10646. + */ + +int hawk_get_ucwidth (hawk_uch_t uc) +{ + /* sorted list of non-overlapping intervals of non-spacing characters */ + /* generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c" */ + static const struct interval combining[] = { + { 0x0300, 0x036F }, { 0x0483, 0x0486 }, { 0x0488, 0x0489 }, + { 0x0591, 0x05BD }, { 0x05BF, 0x05BF }, { 0x05C1, 0x05C2 }, + { 0x05C4, 0x05C5 }, { 0x05C7, 0x05C7 }, { 0x0600, 0x0603 }, + { 0x0610, 0x0615 }, { 0x064B, 0x065E }, { 0x0670, 0x0670 }, + { 0x06D6, 0x06E4 }, { 0x06E7, 0x06E8 }, { 0x06EA, 0x06ED }, + { 0x070F, 0x070F }, { 0x0711, 0x0711 }, { 0x0730, 0x074A }, + { 0x07A6, 0x07B0 }, { 0x07EB, 0x07F3 }, { 0x0901, 0x0902 }, + { 0x093C, 0x093C }, { 0x0941, 0x0948 }, { 0x094D, 0x094D }, + { 0x0951, 0x0954 }, { 0x0962, 0x0963 }, { 0x0981, 0x0981 }, + { 0x09BC, 0x09BC }, { 0x09C1, 0x09C4 }, { 0x09CD, 0x09CD }, + { 0x09E2, 0x09E3 }, { 0x0A01, 0x0A02 }, { 0x0A3C, 0x0A3C }, + { 0x0A41, 0x0A42 }, { 0x0A47, 0x0A48 }, { 0x0A4B, 0x0A4D }, + { 0x0A70, 0x0A71 }, { 0x0A81, 0x0A82 }, { 0x0ABC, 0x0ABC }, + { 0x0AC1, 0x0AC5 }, { 0x0AC7, 0x0AC8 }, { 0x0ACD, 0x0ACD }, + { 0x0AE2, 0x0AE3 }, { 0x0B01, 0x0B01 }, { 0x0B3C, 0x0B3C }, + { 0x0B3F, 0x0B3F }, { 0x0B41, 0x0B43 }, { 0x0B4D, 0x0B4D }, + { 0x0B56, 0x0B56 }, { 0x0B82, 0x0B82 }, { 0x0BC0, 0x0BC0 }, + { 0x0BCD, 0x0BCD }, { 0x0C3E, 0x0C40 }, { 0x0C46, 0x0C48 }, + { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, { 0x0CBC, 0x0CBC }, + { 0x0CBF, 0x0CBF }, { 0x0CC6, 0x0CC6 }, { 0x0CCC, 0x0CCD }, + { 0x0CE2, 0x0CE3 }, { 0x0D41, 0x0D43 }, { 0x0D4D, 0x0D4D }, + { 0x0DCA, 0x0DCA }, { 0x0DD2, 0x0DD4 }, { 0x0DD6, 0x0DD6 }, + { 0x0E31, 0x0E31 }, { 0x0E34, 0x0E3A }, { 0x0E47, 0x0E4E }, + { 0x0EB1, 0x0EB1 }, { 0x0EB4, 0x0EB9 }, { 0x0EBB, 0x0EBC }, + { 0x0EC8, 0x0ECD }, { 0x0F18, 0x0F19 }, { 0x0F35, 0x0F35 }, + { 0x0F37, 0x0F37 }, { 0x0F39, 0x0F39 }, { 0x0F71, 0x0F7E }, + { 0x0F80, 0x0F84 }, { 0x0F86, 0x0F87 }, { 0x0F90, 0x0F97 }, + { 0x0F99, 0x0FBC }, { 0x0FC6, 0x0FC6 }, { 0x102D, 0x1030 }, + { 0x1032, 0x1032 }, { 0x1036, 0x1037 }, { 0x1039, 0x1039 }, + { 0x1058, 0x1059 }, { 0x1160, 0x11FF }, { 0x135F, 0x135F }, + { 0x1712, 0x1714 }, { 0x1732, 0x1734 }, { 0x1752, 0x1753 }, + { 0x1772, 0x1773 }, { 0x17B4, 0x17B5 }, { 0x17B7, 0x17BD }, + { 0x17C6, 0x17C6 }, { 0x17C9, 0x17D3 }, { 0x17DD, 0x17DD }, + { 0x180B, 0x180D }, { 0x18A9, 0x18A9 }, { 0x1920, 0x1922 }, + { 0x1927, 0x1928 }, { 0x1932, 0x1932 }, { 0x1939, 0x193B }, + { 0x1A17, 0x1A18 }, { 0x1B00, 0x1B03 }, { 0x1B34, 0x1B34 }, + { 0x1B36, 0x1B3A }, { 0x1B3C, 0x1B3C }, { 0x1B42, 0x1B42 }, + { 0x1B6B, 0x1B73 }, { 0x1DC0, 0x1DCA }, { 0x1DFE, 0x1DFF }, + { 0x200B, 0x200F }, { 0x202A, 0x202E }, { 0x2060, 0x2063 }, + { 0x206A, 0x206F }, { 0x20D0, 0x20EF }, { 0x302A, 0x302F }, + { 0x3099, 0x309A }, { 0xA806, 0xA806 }, { 0xA80B, 0xA80B }, + { 0xA825, 0xA826 }, { 0xFB1E, 0xFB1E }, { 0xFE00, 0xFE0F }, + { 0xFE20, 0xFE23 }, { 0xFEFF, 0xFEFF }, { 0xFFF9, 0xFFFB }, + { 0x10A01, 0x10A03 }, { 0x10A05, 0x10A06 }, { 0x10A0C, 0x10A0F }, + { 0x10A38, 0x10A3A }, { 0x10A3F, 0x10A3F }, { 0x1D167, 0x1D169 }, + { 0x1D173, 0x1D182 }, { 0x1D185, 0x1D18B }, { 0x1D1AA, 0x1D1AD }, + { 0x1D242, 0x1D244 }, { 0xE0001, 0xE0001 }, { 0xE0020, 0xE007F }, + { 0xE0100, 0xE01EF } + }; + + /* test for 8-bit control characters */ + if (uc == 0) return 0; + if (uc < 32 || (uc >= 0x7f && uc < 0xa0)) return -1; + + /* binary search in table of non-spacing characters */ + if (bisearch(uc, combining, sizeof(combining) / sizeof(struct interval) - 1)) return 0; + + /* if we arrive here, uc is not a combining or C0/C1 control character */ + + if (uc >= 0x1100) + { + if (uc <= 0x115f || /* Hangul Jamo init. consonants */ + uc == 0x2329 || uc == 0x232a || + (uc >= 0x2e80 && uc <= 0xa4cf && uc != 0x303f) || /* CJK ... Yi */ + (uc >= 0xac00 && uc <= 0xd7a3) || /* Hangul Syllables */ + (uc >= 0xf900 && uc <= 0xfaff) || /* CJK Compatibility Ideographs */ + (uc >= 0xfe10 && uc <= 0xfe19) || /* Vertical forms */ + (uc >= 0xfe30 && uc <= 0xfe6f) || /* CJK Compatibility Forms */ + (uc >= 0xff00 && uc <= 0xff60) || /* Fullwidth Forms */ + (uc >= 0xffe0 && uc <= 0xffe6) + #if (HAWK_SIZEOF_UCH_T > 2) + || + (uc >= 0x20000 && uc <= 0x2fffd) || + (uc >= 0x30000 && uc <= 0x3fffd) + #endif + ) + { + return 2; + } + } + + return 1; +} diff --git a/hawk/lib/cli-imp.h b/hawk/lib/cli-imp.h new file mode 100644 index 00000000..bf7188b4 --- /dev/null +++ b/hawk/lib/cli-imp.h @@ -0,0 +1,211 @@ +/* + * $Id$ + * + Copyright (c) 2014-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +/* this file is supposed to be included by opt.c multiple times */ + +/* + * hawk_getopt is based on BSD getopt. + * -------------------------------------------------------------------------- + * + * Copyright (c) 1987-2002 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * A. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * B. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * C. Neither the names of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS + * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * -------------------------------------------------------------------------- + */ + + + +xci_t xgetcli (int argc, xch_t* const* argv, xcli_t* opt) +{ + xch_t* oli; /* option letter list index */ + int dbldash = 0; + + opt->arg = HAWK_NULL; + opt->lngopt = HAWK_NULL; + + if (opt->cur == HAWK_NULL) + { + opt->cur = XEMSG; + opt->ind = 1; + } + + if (*opt->cur == '\0') + { + /* update scanning pointer */ + if (opt->ind >= argc || *(opt->cur = argv[opt->ind]) != '-') + { + /* All arguments have been processed or the current + * argument doesn't start with a dash */ + opt->cur = XEMSG; + return XCI_EOF; + } + + opt->cur++; + + #if 0 + if (*opt->cur == '\0') + { + /* - */ + opt->ind++; + opt->cur = XEMSG; + return XCI_EOF; + } + #endif + + if (*opt->cur == '-') + { + if (*++opt->cur == '\0') + { + /* -- */ + opt->ind++; + opt->cur = XEMSG; + return XCI_EOF; + } + else + { + dbldash = 1; + } + } + } + + if (dbldash && opt->lng != HAWK_NULL) + { + const xcli_lng_t* o; + xch_t* end = opt->cur; + + while (*end != '\0' && *end != '=') end++; + + for (o = opt->lng; o->str; o++) + { + const xch_t* str = o->str; + + if (*str == ':') str++; + + if (xcompcharscstr(opt->cur, end - opt->cur, str) != 0) continue; + + /* match */ + opt->cur = XEMSG; + opt->lngopt = o->str; + + /* for a long matching option, remove the leading colon */ + if (opt->lngopt[0] == ':') opt->lngopt++; + + if (*end == '=') opt->arg = end + 1; + + if (*o->str != ':') + { + /* should not have an option argument */ + if (opt->arg != HAWK_NULL) return BADARG; + } + else if (opt->arg == HAWK_NULL) + { + /* check if it has a remaining argument + * available */ + if (argc <= ++opt->ind) return BADARG; + /* If so, the next available argument is + * taken to be an option argument */ + opt->arg = argv[opt->ind]; + } + + opt->ind++; + return o->val; + } + + /*if (*end == HAWK_T('=')) *end = HAWK_T('\0');*/ + opt->lngopt = opt->cur; + return BADCH; + } + + if ((opt->opt = *opt->cur++) == ':' || + (oli = xfindcharincstr(opt->str, opt->opt)) == HAWK_NULL) + { + /* + * if the user didn't specify '-' as an option, + * assume it means EOF. + */ + if (opt->opt == (int)'-') return XCI_EOF; + if (*opt->cur == '\0') ++opt->ind; + return BADCH; + } + + if (*++oli != ':') + { + /* don't need argument */ + if (*opt->cur == '\0') opt->ind++; + } + else + { + /* need an argument */ + + if (*opt->cur != '\0') + { + /* no white space */ + opt->arg = opt->cur; + } + else if (argc <= ++opt->ind) + { + /* no arg */ + opt->cur = XEMSG; + /*if (*opt->str == ':')*/ return BADARG; + /*return BADCH;*/ + } + else + { + /* white space */ + opt->arg = argv[opt->ind]; + } + + opt->cur = XEMSG; + opt->ind++; + } + + return opt->opt; /* dump back option letter */ +} diff --git a/hawk/lib/cli.c b/hawk/lib/cli.c new file mode 100644 index 00000000..ab603cb5 --- /dev/null +++ b/hawk/lib/cli.c @@ -0,0 +1,82 @@ +/* + * $Id$ + * + Copyright (c) 2014-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include + +#define BADCH '?' +#define BADARG ':' + +static hawk_uch_t EMSG_UCH[] = { '\0' }; +static hawk_bch_t EMSG_BCH[] = { '\0' }; + +/* ------------------------------------------------------------ */ + +#undef XEMSG +#undef xch_t +#undef xci_t +#undef xcli_t +#undef xcli_lng_t +#undef xgetcli +#undef xcompcharscstr +#undef xfindcharincstr +#undef XCI_EOF + +#define XEMSG EMSG_UCH +#define xch_t hawk_uch_t +#define xci_t hawk_uci_t +#define xcli_t hawk_ucli_t +#define xcli_lng_t hawk_ucli_lng_t +#define xgetcli hawk_get_ucli +#define xcompcharscstr hawk_comp_uchars_ucstr +#define xfindcharincstr hawk_find_uchar_in_ucstr +#define XCI_EOF HAWK_BCI_EOF +#include "cli-imp.h" + +/* ------------------------------------------------------------ */ + +#undef XEMSG +#undef xch_t +#undef xci_t +#undef xcli_t +#undef xcli_lng_t +#undef xgetcli +#undef xcompcharscstr +#undef xfindcharincstr +#undef XCI_EOF + +#define XEMSG EMSG_BCH +#define xch_t hawk_bch_t +#define xci_t hawk_bci_t +#define xcli_t hawk_bcli_t +#define xcli_lng_t hawk_bcli_lng_t +#define xgetcli hawk_get_bcli +#define xcompcharscstr hawk_comp_bchars_bcstr +#define xfindcharincstr hawk_find_bchar_in_bcstr +#define XCI_EOF HAWK_UCI_EOF +#include "cli-imp.h" + +/* ------------------------------------------------------------ */ diff --git a/hawk/lib/ecs-imp.h b/hawk/lib/ecs-imp.h new file mode 100644 index 00000000..7d68930f --- /dev/null +++ b/hawk/lib/ecs-imp.h @@ -0,0 +1,456 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +str_t* FN(open) (hawk_t* hawk, hawk_oow_t xtnsize, hawk_oow_t capa) +{ + str_t* str; + + str = (str_t*)hawk_allocmem(hawk, HAWK_SIZEOF(str_t) + xtnsize); + if (str) + { + if (FN(init)(str, hawk, capa) <= -1) + { + hawk_freemem (hawk, str); + str = HAWK_NULL; + } + else + { + HAWK_MEMSET (str + 1, 0, xtnsize); + } + } + return str; +} + +void FN(close) (str_t* str) +{ + FN(fini) (str); + hawk_freemem (str->hawk, str); +} + +int FN(init) (str_t* str, hawk_t* hawk, hawk_oow_t capa) +{ + HAWK_MEMSET (str, 0, HAWK_SIZEOF(str_t)); + + str->hawk = hawk; + str->sizer = HAWK_NULL; + + if (capa == 0) str->val.ptr = HAWK_NULL; + else + { + str->val.ptr = (char_t*)hawk_allocmem(hawk, HAWK_SIZEOF(char_t) * (capa + 1)); + if (!str->val.ptr) return -1; + str->val.ptr[0] = '\0'; + } + + str->val.len = 0; + str->capa = capa; + + return 0; +} + +void FN(fini) (str_t* str) +{ + if (str->val.ptr) hawk_freemem (str->hawk, str->val.ptr); +} + +int FN(yield) (str_t* str, cstr_t* buf, hawk_oow_t newcapa) +{ + char_t* tmp; + + if (newcapa == 0) tmp = HAWK_NULL; + else + { + tmp = (char_t*)hawk_allocmem(str->hawk, HAWK_SIZEOF(char_t) * (newcapa + 1)); + if (!tmp) return -1; + tmp[0] = '\0'; + } + + if (buf) *buf = str->val; + + str->val.ptr = tmp; + str->val.len = 0; + str->capa = newcapa; + + return 0; +} + +char_t* FN(yieldptr) (str_t* str, hawk_oow_t newcapa) +{ + cstr_t mx; + if (FN(yield)(str, &mx, newcapa) <= -1) return HAWK_NULL; + return mx.ptr; +} + + +hawk_oow_t FN(setcapa) (str_t* str, hawk_oow_t capa) +{ + char_t* tmp; + + if (capa == str->capa) return capa; + + tmp = (char_t*)hawk_reallocmem(str->hawk, str->val.ptr, HAWK_SIZEOF(char_t) * (capa+1)); + if (!tmp) return (hawk_oow_t)-1; + + if (capa < str->val.len) + { + str->val.len = capa; + tmp[capa] = '\0'; + } + + str->capa = capa; + str->val.ptr = tmp; + + return str->capa; +} + +hawk_oow_t FN(setlen) (str_t* str, hawk_oow_t len) +{ + if (len == str->val.len) return len; + if (len < str->val.len) + { + str->val.len = len; + str->val.ptr[len] = '\0'; + return len; + } + + if (len > str->capa) + { + if (FN(setcapa)(str, len) == (hawk_oow_t)-1) return (hawk_oow_t)-1; + } + + while (str->val.len < len) str->val.ptr[str->val.len++] = ' '; + str->val.ptr[str->val.len] = '\0'; + return str->val.len; +} + +void FN(clear) (str_t* str) +{ + str->val.len = 0; + if (str->val.ptr) + { + HAWK_ASSERT (str->hawk, str->capa >= 1); + str->val.ptr[0] = '\0'; + } +} + +void FN(swap) (str_t* str, str_t* str1) +{ + str_t tmp; + + tmp.val.ptr = str->val.ptr; + tmp.val.len = str->val.len; + tmp.capa = str->capa; + tmp.hawk = str->hawk; + + str->val.ptr = str1->val.ptr; + str->val.len = str1->val.len; + str->capa = str1->capa; + str->hawk = str1->hawk; + + str1->val.ptr = tmp.val.ptr; + str1->val.len = tmp.val.len; + str1->capa = tmp.capa; + str1->hawk = tmp.hawk; +} + + +hawk_oow_t FN(cpy) (str_t* str, const char_t* s) +{ + /* TODO: improve it */ + return FN(ncpy)(str, s, count_chars(s)); +} + +hawk_oow_t FN(ncpy) (str_t* str, const char_t* s, hawk_oow_t len) +{ + if (len > str->capa || str->capa <= 0) + { + hawk_oow_t tmp; + + /* if the current capacity is 0 and the string len to copy is 0 + * we can't simply pass 'len' as the new capapcity. + * ecs_setcapa() won't do anything the current capacity of 0 + * is the same as new capacity required. note that when str->capa + * is 0, str->val.ptr is HAWK_NULL. However, this is copying operation. + * Copying a zero-length string may indicate that str->val.ptr must + * not be HAWK_NULL. so I simply pass 1 as the new capacity */ + tmp = FN(setcapa)(str, ((str->capa <= 0 && len <= 0)? 1: len)); + if (tmp == (hawk_oow_t)-1) return (hawk_oow_t)-1; + } + + HAWK_MEMCPY (&str->val.ptr[0], s, len * HAWK_SIZEOF(*s)); + str->val.ptr[len] = '\0'; + str->val.len = len; + return len; +} + +hawk_oow_t FN(cat) (str_t* str, const char_t* s) +{ + /* TODO: improve it. no counting */ + return FN(ncat)(str, s, count_chars(s)); +} + +static int FN(resize_for_ncat) (str_t* str, hawk_oow_t len) +{ + if (len > str->capa - str->val.len) + { + hawk_oow_t ncapa, mincapa; + + /* let the minimum capacity be as large as + * to fit in the new substring */ + mincapa = str->val.len + len; + + if (!str->sizer) + { + /* increase the capacity by the length to add */ + ncapa = mincapa; + /* if the new capacity is less than the double, + * just double it */ + if (ncapa < str->capa * 2) ncapa = str->capa * 2; + } + else + { + /* let the user determine the new capacity. + * pass the minimum capacity required as a hint */ + ncapa = str->sizer(str, mincapa); + /* if no change in capacity, return current length */ + if (ncapa == str->capa) return 0; + } + + /* change the capacity */ + do + { + if (FN(setcapa)(str, ncapa) != (hawk_oow_t)-1) break; + if (ncapa <= mincapa) return -1; + ncapa--; + } + while (1); + } + else if (str->capa <= 0 && len <= 0) + { + HAWK_ASSERT (str->hawk, str->val.ptr == HAWK_NULL); + HAWK_ASSERT (str->hawk, str->val.len <= 0); + if (FN(setcapa)(str, 1) == (hawk_oow_t)-1) return -1; + } + + return 1; +} + +hawk_oow_t FN(ncat) (str_t* str, const char_t* s, hawk_oow_t len) +{ + int n; + hawk_oow_t i, j; + + n = FN(resize_for_ncat)(str, len); + if (n <= -1) return (hawk_oow_t)-1; + if (n == 0) return str->val.len; + + if (len > str->capa - str->val.len) + { + /* copy as many characters as the number of cells available. + * if the capacity has been decreased, len is adjusted here */ + len = str->capa - str->val.len; + } + + /* + HAWK_MEMCPY (&str->val.ptr[str->val.len], s, len*HAWK_SIZEOF(*s)); + str->val.len += len; + str->val.ptr[str->val.len] = T('\0'); + */ + for (i = 0, j = str->val.len ; i < len; j++, i++) str->val.ptr[j] = s[i]; + str->val.ptr[j] = '\0'; + str->val.len = j; + + return str->val.len; +} + +hawk_oow_t FN(nrcat) (str_t* str, const char_t* s, hawk_oow_t len) +{ + int n; + hawk_oow_t i, j; + + n = FN(resize_for_ncat)(str, len); + if (n <= -1) return (hawk_oow_t)-1; + if (n == 0) return str->val.len; + + if (len > str->capa - str->val.len) len = str->capa - str->val.len; + + for (i = len, j = str->val.len ; i > 0; j++) str->val.ptr[j] = s[--i]; + str->val.ptr[j] = '\0'; + str->val.len = j; + + return str->val.len; +} + +hawk_oow_t FN(ccat) (str_t* str, char_t c) +{ + return FN(ncat)(str, &c, 1); +} + +hawk_oow_t FN(nccat) (str_t* str, char_t c, hawk_oow_t len) +{ + while (len > 0) + { + if (FN(ncat)(str, &c, 1) == (hawk_oow_t)-1) return (hawk_oow_t)-1; + len--; + } + return str->val.len; +} + +hawk_oow_t FN(del) (str_t* str, hawk_oow_t index, hawk_oow_t size) +{ + if (str->val.ptr && index < str->val.len && size > 0) + { + hawk_oow_t nidx = index + size; + if (nidx >= str->val.len) + { + str->val.ptr[index] = '\0'; + str->val.len = index; + } + else + { + HAWK_MEMMOVE (&str->val.ptr[index], &str->val.ptr[nidx], HAWK_SIZEOF(*str->val.ptr) * (str->val.len - nidx + 1)); + str->val.len -= size; + } + } + + return str->val.len; +} + +hawk_oow_t FN(amend) (str_t* str, hawk_oow_t pos, hawk_oow_t len, const char_t* repl) +{ + hawk_oow_t max_len; + hawk_oow_t repl_len = count_chars(repl); + + if (pos >= str->val.len) pos = str->val.len; + max_len = str->val.len - pos; + if (len > max_len) len = max_len; + + if (len > repl_len) + { + FN(del) (str, pos, len - repl_len); + } + else if (len < repl_len) + { + hawk_oow_t old_ecs_len = str->val.len; + if (FN(setlen)(str, str->val.len + repl_len - len) == (hawk_oow_t)-1) return (hawk_oow_t)-1; + HAWK_MEMMOVE (&str->val.ptr[pos + repl_len], &str->val.ptr[pos + len], HAWK_SIZEOF(*repl) * (old_ecs_len - (pos + len))); + } + + if (repl_len > 0) HAWK_MEMMOVE (&str->val.ptr[pos], repl, HAWK_SIZEOF(*repl) * repl_len); + return str->val.len; +} + +static int FN(put_bchars) (hawk_fmtout_t* fmtout, const hawk_bch_t* ptr, hawk_oow_t len) +{ + /* hawk_rtx_getcmgr(rtx) is equal to hawk_getcmgr(rtx->awk) as of this writing. + * this elastic character string object doesn't get affected whether it is + * instantiated under the main awk object or a runtime context object. + * however, if they are to have different cmgrs configured in the future, this + * can be problematic potentially */ +#if defined(BUILD_UECS) + hawk_uecs_t* uecs = (hawk_uecs_t*)fmtout->ctx; + if (hawk_uecs_ncatbchars(uecs, ptr, len, hawk_getcmgr(uecs->hawk), 1) == (hawk_oow_t)-1) return -1; +#else + hawk_becs_t* becs = (hawk_becs_t*)fmtout->ctx; + if (hawk_becs_ncat(becs, ptr, len) == (hawk_oow_t)-1) return -1; +#endif + return 1; /* success. carry on */ +} + +static int FN(put_uchars) (hawk_fmtout_t* fmtout, const hawk_uch_t* ptr, hawk_oow_t len) +{ +#if defined(BUILD_UECS) + hawk_uecs_t* uecs = (hawk_uecs_t*)fmtout->ctx; + if (hawk_uecs_ncat(uecs, ptr, len) == (hawk_oow_t)-1) return -1; +#else + hawk_becs_t* becs = (hawk_becs_t*)fmtout->ctx; + if (hawk_becs_ncatuchars(becs, ptr, len, hawk_getcmgr(becs->hawk)) == (hawk_oow_t)-1) return -1; +#endif + return 1; /* success. carry on */ +} + +hawk_oow_t FN(vfcat) (str_t* str, const char_t* fmt, va_list ap) +{ + hawk_fmtout_t fo; + + HAWK_MEMSET (&fo, 0, HAWK_SIZEOF(fo)); + fo.mmgr = hawk_getmmgr(str->hawk); + fo.putbchars = FN(put_bchars); + fo.putuchars = FN(put_uchars); + fo.ctx = str; + +#if defined(BUILD_UECS) + if (hawk_ufmt_outv(&fo, fmt, ap) <= -1) return -1; +#else + if (hawk_bfmt_outv(&fo, fmt, ap) <= -1) return -1; +#endif + return str->val.len; +} + +hawk_oow_t FN(fcat) (str_t* str, const char_t* fmt, ...) +{ + hawk_oow_t x; + va_list ap; + + va_start (ap, fmt); + x = FN(vfcat)(str, fmt, ap); + va_end (ap); + + return x; +} + +hawk_oow_t FN(vfmt) (str_t* str, const char_t* fmt, va_list ap) +{ + hawk_fmtout_t fo; + + HAWK_MEMSET (&fo, 0, HAWK_SIZEOF(fo)); + fo.mmgr = hawk_getmmgr(str->hawk); + fo.putbchars = FN(put_bchars); + fo.putuchars = FN(put_uchars); + fo.ctx = str; + + FN(clear) (str); + +#if defined(BUILD_UECS) + if (hawk_ufmt_outv(&fo, fmt, ap) <= -1) return -1; +#else + if (hawk_bfmt_outv(&fo, fmt, ap) <= -1) return -1; +#endif + return str->val.len; +} + +hawk_oow_t FN(fmt) (str_t* str, const char_t* fmt, ...) +{ + hawk_oow_t x; + va_list ap; + + va_start (ap, fmt); + x = FN(vfmt)(str, fmt, ap); + va_end (ap); + + return x; +} diff --git a/hawk/lib/ecs.c b/hawk/lib/ecs.c new file mode 100644 index 00000000..87d046fc --- /dev/null +++ b/hawk/lib/ecs.c @@ -0,0 +1,106 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "hawk-prv.h" + +#define _FN(type,verb) hawk_ ## type ## _ ## verb + +/* ------------------------------------------------------------------------- */ + +#undef FN +#undef T +#undef str_t +#undef char_t +#undef cstr_t +#undef count_chars +#define FN(verb) _FN(becs,verb) +#define T(x) HAWK_BT(x) +#define str_t hawk_becs_t +#define char_t hawk_bch_t +#define cstr_t hawk_bcs_t +#define count_chars(x) hawk_count_bcstr(x) +#define BUILD_BECS +#include "ecs-imp.h" + +/* ------------------------------------------------------------------------- */ + +#undef FN +#undef T +#undef str_t +#undef char_t +#undef cstr_t +#undef count_chars +#define FN(verb) _FN(uecs,verb) +#define T(x) HAWK_UT(x) +#define str_t hawk_uecs_t +#define char_t hawk_uch_t +#define cstr_t hawk_ucs_t +#define count_chars(x) hawk_count_ucstr(x) +#define BUILD_UECS +#include "ecs-imp.h" + +/* ------------------------------------------------------------------------- */ + + +hawk_oow_t hawk_becs_ncatuchars (hawk_becs_t* str, const hawk_uch_t* s, hawk_oow_t len, hawk_cmgr_t* cmgr) +{ + hawk_oow_t bcslen, ucslen; + + ucslen = len; + //if (qse_wcsntombsnwithcmgr(s, &ucslen, QSE_NULL, &bcslen, cmgr) <= -1) return (hawk_oow_t)-1; + if (hawk_conv_uchars_to_bchars_with_cmgr(s, &ucslen, HAWK_NULL, &bcslen, cmgr) <= -1) return (hawk_oow_t)-1; + + if (hawk_becs_resize_for_ncat(str, bcslen) <= 0) return -1; + + ucslen = len; + bcslen = str->capa - str->val.len; + //qse_wcsntombsnwithcmgr(s, &ucslen, &str->val.ptr[str->val.len], &bcslen, cmgr); + hawk_conv_uchars_to_bchars_with_cmgr (s, &ucslen, &str->val.ptr[str->val.len], &bcslen, cmgr); + str->val.len += bcslen; + str->val.ptr[str->val.len] = '\0'; + + return str->val.len; +} + +hawk_oow_t hawk_uecs_ncatbchars (hawk_uecs_t* str, const hawk_bch_t* s, hawk_oow_t len, hawk_cmgr_t* cmgr, int all) +{ + hawk_oow_t bcslen, ucslen; + + bcslen = len; + //if (qse_mbsntowcsnallwithcmgr(s, &bcslen, QSE_NULL, &ucslen, cmgr) <= -1) return (hawk_oow_t)-1; + if (hawk_conv_bchars_to_uchars_with_cmgr(s, &bcslen, HAWK_NULL, &ucslen, cmgr, all) <= -1) return (hawk_oow_t)-1; + + if (hawk_uecs_resize_for_ncat(str, ucslen) <= 0) return -1; + + bcslen = len; + ucslen = str->capa - str->val.len; + //qse_mbsntowcsnallwithcmgr(s, &bcslen, &str->val.ptr[str->val.len], &ucslen, cmgr); + hawk_conv_bchars_to_uchars_with_cmgr (s, &bcslen, &str->val.ptr[str->val.len], &ucslen, cmgr, all); + str->val.len += ucslen; + str->val.ptr[str->val.len] = '\0'; + + return str->val.len; +} diff --git a/hawk/lib/err-prv.h b/hawk/lib/err-prv.h new file mode 100644 index 00000000..1558e21c --- /dev/null +++ b/hawk/lib/err-prv.h @@ -0,0 +1,41 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_ERR_PRV_H_ +#define _HAWK_ERR_PRV_H_ + +#if defined(__cplusplus) +extern "C" { +#endif + +const hawk_ooch_t* hawk_dflerrstr (hawk_t* awk, hawk_errnum_t errnum); + +#if defined(__cplusplus) +} +#endif + +#endif + diff --git a/hawk/lib/err.c b/hawk/lib/err.c new file mode 100644 index 00000000..b6a99685 --- /dev/null +++ b/hawk/lib/err.c @@ -0,0 +1,561 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "hawk-prv.h" + +const hawk_ooch_t* hawk_dflerrstr (hawk_t* awk, hawk_errnum_t errnum) +{ + static const hawk_ooch_t* errstr[] = + { + HAWK_T("no error"), + HAWK_T("other error"), + HAWK_T("not implemented"), + HAWK_T("subsystem error"), + HAWK_T("internal error that should never have happened"), + + HAWK_T("insufficient memory"), + HAWK_T("invalid parameter or data"), + HAWK_T("access denied"), + HAWK_T("operation not allowed"), + HAWK_T("not supported"), + HAWK_T("'${0}' not found"), + HAWK_T("'${0}' already exists"), + HAWK_T("I/O error"), + HAWK_T("buffer full"), + HAWK_T("encoding conversion error"), + + HAWK_T("cannot open '${0}'"), + HAWK_T("cannot read '${0}'"), + HAWK_T("cannot write '${0}'"), + HAWK_T("cannot close '${0}'"), + + HAWK_T("block nested too deeply"), + HAWK_T("expression nested too deeply"), + + HAWK_T("invalid character '${0}'"), + HAWK_T("invalid digit '${0}'"), + + HAWK_T("unexpected end of input"), + HAWK_T("comment not closed properly"), + HAWK_T("string or regular expression not closed"), + HAWK_T("invalid mbs character '${0}'"), + HAWK_T("left brace expected in place of '${0}'"), + HAWK_T("left parenthesis expected in place of '${0}'"), + HAWK_T("right parenthesis expected in place of '${0}'"), + HAWK_T("right bracket expected in place of '${0}'"), + HAWK_T("comma expected in place of '${0}'"), + HAWK_T("semicolon expected in place of '${0}'"), + HAWK_T("colon expected in place of '${0}'"), + HAWK_T("integer literal expected in place of '${0}'"), + HAWK_T("statement not ending with a semicolon"), + HAWK_T("keyword 'in' expected in place of '${0}'"), + HAWK_T("right-hand side of 'in' not a variable"), + HAWK_T("expression not recognized around '${0}'"), + + HAWK_T("keyword 'function' expected in place of '${0}'"), + HAWK_T("keyword 'while' expected in place of '${0}'"), + HAWK_T("invalid assignment statement"), + HAWK_T("identifier expected in place of '${0}'"), + HAWK_T("'${0}' not a valid function name"), + HAWK_T("BEGIN not followed by left bracket on the same line"), + HAWK_T("END not followed by left bracket on the same line"), + HAWK_T("keyword '${0}' redefined"), + HAWK_T("intrinsic function '${0}' redefined"), + HAWK_T("function '${0}' redefined"), + HAWK_T("global variable '${0}' redefined"), + HAWK_T("parameter '${0}' redefined"), + HAWK_T("variable '${0}' redefined"), + HAWK_T("duplicate parameter name '${0}'"), + HAWK_T("duplicate global variable '${0}'"), + HAWK_T("duplicate local variable '${0}'"), + HAWK_T("'${0}' not a valid parameter name"), + HAWK_T("'${0}' not a valid variable name"), + HAWK_T("variable name missing"), + HAWK_T("undefined identifier '${0}'"), + HAWK_T("l-value required"), + HAWK_T("too many global variables"), + HAWK_T("too many local variables"), + HAWK_T("too many parameters"), + HAWK_T("too many segments"), + HAWK_T("segment '${0}' too long"), + HAWK_T("bad argument"), + HAWK_T("no argument provided"), + HAWK_T("'break' outside a loop"), + HAWK_T("'continue' outside a loop"), + HAWK_T("'next' illegal in the BEGIN block"), + HAWK_T("'next' illegal in the END block"), + HAWK_T("'nextfile' illegal in the BEGIN block"), + HAWK_T("'nextfile' illegal in the END block"), + HAWK_T("both prefix and postfix increment/decrement operator present"), + HAWK_T("illegal operand for increment/decrement operator"), + HAWK_T("'@include' not followed by a string"), + HAWK_T("include level too deep"), + HAWK_T("'${0}' not recognized"), + HAWK_T("@ not followed by a valid word"), + + HAWK_T("stack error"), + HAWK_T("divide by zero"), + HAWK_T("invalid operand"), + HAWK_T("wrong position index"), + HAWK_T("too few arguments"), + HAWK_T("too many arguments"), + HAWK_T("function '${0}' not found"), + HAWK_T("non-function value in '${0}'"), + HAWK_T("'${0}' not deletable"), + HAWK_T("value not a map"), + HAWK_T("right-hand side of the 'in' operator not a map"), + HAWK_T("right-hand side of the 'in' operator not a map nor nil"), + HAWK_T("value not referenceable"), + HAWK_T("cannot return a map"), /* EMAPRET */ + HAWK_T("cannot assign a map to a positional"), /* EMAPTOPOS */ + HAWK_T("cannot assign a map to an indexed variable"),/* EMAPTOIDX */ + HAWK_T("cannot assign a map to a variable '${0}'"), /* EMAPTONVAR */ + HAWK_T("cannot change a map to a scalar"), /* EMAPTOSCALAR */ + HAWK_T("cannot change a scalar to a map"), /* ESCALARTOMAP */ + HAWK_T("cannot change a map '${0}' to another map"),/* ENMAPTOMAP */ + HAWK_T("cannot change a map '${0}' to a scalar"), /* ENMAPTOSCALAR */ + HAWK_T("cannot change a scalar '${0}' to a map"), /* ENSCALARTOMAP */ + HAWK_T("invalid value to convert to a string"), + HAWK_T("invalid value to convert to a number"), + HAWK_T("invalid value to a character"), + HAWK_T("invalid value for hashing"), + HAWK_T("'next' called from BEGIN block"), + HAWK_T("'next' called from END block"), + HAWK_T("'nextfile' called from BEGIN block"), + HAWK_T("'nextfile' called from END block"), + HAWK_T("intrinsic function handler for '${0}' failed"), + HAWK_T("wrong implementation of user-defined I/O handler"), + HAWK_T("I/O handler returned an error"), + HAWK_T("no such I/O name found"), + HAWK_T("I/O name empty"), + HAWK_T("I/O name '${0}' containing '\\0'"), + HAWK_T("not sufficient arguments to formatting sequence"), + HAWK_T("recursion detected in format conversion"), + HAWK_T("invalid character in CONVFMT"), + HAWK_T("invalid character in OFMT"), + + HAWK_T("failed to build regular expression"), + HAWK_T("failed to match regular expression"), + HAWK_T("recursion too deep in regular expression"), + HAWK_T("right parenthesis expected in regular expression"), + HAWK_T("right bracket expected in regular expression"), + HAWK_T("right brace expected in regular expression"), + HAWK_T("colon expected in regular expression"), + HAWK_T("invalid character range in regular expression"), + HAWK_T("invalid character class in regular expression"), + HAWK_T("invalid occurrence bound in regular expression"), + HAWK_T("special character at wrong position"), + HAWK_T("premature end of regular expression") + }; + + return (errnum >= 0 && errnum < HAWK_COUNTOF(errstr))? errstr[errnum]: HAWK_T("unknown error"); +} + +hawk_errstr_t hawk_geterrstr (hawk_t* hawk) +{ + return hawk->errstr; +} + +void hawk_seterrstr (hawk_t* hawk, hawk_errstr_t errstr) +{ + hawk->errstr = errstr; +} + +/* ------------------------------------------------------------------------- */ + +const hawk_loc_t* hawk_geterrloc (hawk_t* hawk) +{ + return &hawk->errloc; +} + +const hawk_bch_t* hawk_geterrbmsg (hawk_t* hawk) +{ +#if defined(MOO_OOCH_IS_BCH) + return (hawk->_gem.errmsg[0] == '\0')? hawk_geterrstr(hawk)(hawk, hawk->_gem.errnum): hawk->_gem.errmsg; +#else + const hawk_ooch_t* msg; + hawk_oow_t wcslen, mbslen; + + msg = (hawk->_gem.errmsg[0] == '\0')? hawk_geterrstr(hawk)(hawk, hawk->_gem.errnum): hawk->_gem.errmsg; + + mbslen = HAWK_COUNTOF(hawk->berrmsg); + hawk_conv_ucstr_to_bcstr_with_cmgr (msg, &wcslen, hawk->berrmsg, &mbslen, hawk_getcmgr(hawk)); + + return hawk->berrmsg; +#endif +} + +const hawk_uch_t* hawk_geterrumsg (hawk_t* hawk) +{ +#if defined(MOO_OOCH_IS_BCH) + const hawk_ooch_t* msg; + hawk_oow_t wcslen, mbslen; + + msg = (hawk->_gem.errmsg[0] == '\0')? hawk_geterrstr(hawk)(hawk, hawk->_gem.errnum): hawk->_gem.errmsg; + + wcslen = HAWK_COUNTOF(hawk->uerrmsg); + hawk_conv_bcstr_to_ucstr_with_cmgr (msg, &mbslen, hawk->uerrmsg, &wcslen, hawk_getcmgr(hawk), 1); + + return hawk->uerrmsg; +#else + return (hawk->_gem.errmsg[0] == '\0')? hawk_geterrstr(hawk)(hawk, hawk->_gem.errnum): hawk->_gem.errmsg; +#endif +} + +void hawk_geterrinf (hawk_t* hawk, hawk_errinf_t* errinf) +{ + errinf->num = hawk->_gem.errnum; + errinf->loc = hawk->errloc; + hawk_copy_oocstr (errinf->msg, HAWK_COUNTOF(errinf->msg), (hawk->_gem.errmsg[0] == '\0'? hawk_geterrstr(hawk)(hawk, hawk->_gem.errnum): hawk->_gem.errmsg)); +} + +void hawk_geterror (hawk_t* hawk, hawk_errnum_t* errnum, const hawk_ooch_t** errmsg, hawk_loc_t* errloc) +{ + if (errnum) *errnum = hawk->_gem.errnum; + if (errmsg) *errmsg = (hawk->_gem.errmsg[0] == '\0')? hawk_geterrstr(hawk)(hawk, hawk->_gem.errnum): hawk->_gem.errmsg; + if (errloc) *errloc = hawk->errloc; +} + +const hawk_ooch_t* hawk_backuperrmsg (hawk_t* hawk) +{ + hawk_copy_oocstr (hawk->errmsg_backup, HAWK_COUNTOF(hawk->errmsg_backup), hawk_geterrmsg(hawk)); + return hawk->errmsg_backup; +} + +void hawk_seterrnum (hawk_t* hawk, hawk_errnum_t errnum, const hawk_oocs_t* errarg) +{ + hawk_seterror (hawk, errnum, errarg, HAWK_NULL); +} + +void hawk_seterrinf (hawk_t* hawk, const hawk_errinf_t* errinf) +{ + hawk->_gem.errnum = errinf->num; + hawk_copy_oocstr(hawk->_gem.errmsg, HAWK_COUNTOF(hawk->_gem.errmsg), errinf->msg); + hawk->errloc = errinf->loc; +} + +static int err_bchars (hawk_fmtout_t* fmtout, const hawk_bch_t* ptr, hawk_oow_t len) +{ + hawk_t* hawk = (hawk_t*)fmtout->ctx; + hawk_oow_t max; + + max = HAWK_COUNTOF(hawk->_gem.errmsg) - hawk->errmsg_len - 1; + +#if defined(HAWK_OOCH_IS_UCH) + if (max <= 0) return 1; + hawk_conv_bchars_to_uchars_with_cmgr (ptr, &len, &hawk->_gem.errmsg[hawk->errmsg_len], &max, hawk_getcmgr(hawk), 1); + hawk->errmsg_len += max; +#else + if (len > max) len = max; + if (len <= 0) return 1; + HAWK_MEMCPY (&hawk->_gem.errmsg[hawk->errmsg_len], ptr, len * HAWK_SIZEOF(*ptr)); + hawk->errmsg_len += len; +#endif + + hawk->_gem.errmsg[hawk->errmsg_len] = '\0'; + + return 1; /* success */ +} + +static int err_uchars (hawk_fmtout_t* fmtout, const hawk_uch_t* ptr, hawk_oow_t len) +{ + hawk_t* hawk = (hawk_t*)fmtout->ctx; + hawk_oow_t max; + + max = HAWK_COUNTOF(hawk->_gem.errmsg) - hawk->errmsg_len - 1; + +#if defined(HAWK_OOCH_IS_UCH) + if (len > max) len = max; + if (len <= 0) return 1; + HAWK_MEMCPY (&hawk->_gem.errmsg[hawk->errmsg_len], ptr, len * HAWK_SIZEOF(*ptr)); + hawk->errmsg_len += len; +#else + if (max <= 0) return 1; + hawk_conv_uchars_to_bchars_with_cmgr (ptr, &len, &hawk->_gem.errmsg[hawk->errmsg_len], &max, hawk_getcmgr(hawk)); + hawk->errmsg_len += max; +#endif + hawk->_gem.errmsg[hawk->errmsg_len] = '\0'; + return 1; /* success */ +} + + +void hawk_seterrbfmt (hawk_t* hawk, hawk_errnum_t errnum, hawk_loc_t* errloc, const hawk_bch_t* errfmt, ...) +{ + va_list ap; + hawk_fmtout_t fo; + + /*if (hawk->shuterr) return;*/ + hawk->errmsg_len = 0; + hawk->_gem.errmsg[0] = '\0'; + + HAWK_MEMSET (&fo, 0, HAWK_SIZEOF(fo)); + fo.mmgr = hawk_getmmgr(hawk); + fo.putbchars = err_bchars; + fo.putuchars = err_uchars; + fo.ctx = hawk; + + va_start (ap, errfmt); + hawk_bfmt_outv (&fo, errfmt, ap); + va_end (ap); + + hawk->_gem.errnum = errnum; + if (errloc) hawk->errloc = *errloc; + else HAWK_MEMSET (&hawk->errloc, 0, HAWK_SIZEOF(hawk->errloc)); +} + +void hawk_seterrufmt (hawk_t* hawk, hawk_errnum_t errnum, hawk_loc_t* errloc, const hawk_uch_t* errfmt, ...) +{ + va_list ap; + hawk_fmtout_t fo; + + /*if (hawk->shuterr) return;*/ + hawk->errmsg_len = 0; + hawk->_gem.errmsg[0] = '\0'; + + HAWK_MEMSET (&fo, 0, HAWK_SIZEOF(fo)); + fo.mmgr = hawk_getmmgr(hawk); + fo.putbchars = err_bchars; + fo.putuchars = err_uchars; + fo.ctx = hawk; + + va_start (ap, errfmt); + hawk_ufmt_outv (&fo, errfmt, ap); + va_end (ap); + + hawk->_gem.errnum = errnum; + if (errloc) hawk->errloc = *errloc; + else HAWK_MEMSET (&hawk->errloc, 0, HAWK_SIZEOF(hawk->errloc)); +} + +void hawk_seterror (hawk_t* hawk, hawk_errnum_t errnum, const hawk_oocs_t* errarg, const hawk_loc_t* errloc) +{ +/* TODO: remove awk_rtx_seterror() and substitute hawk_rtx_seterrfmt()/seterrbfmt()/seterrufmt() */ + const hawk_ooch_t* errfmt; + + hawk->_gem.errnum = errnum; + + errfmt = hawk_geterrstr(hawk)(hawk, errnum); + HAWK_ASSERT (awk, errfmt != HAWK_NULL); +/* TODO: this change is buggy... copying won't process arguments... + qse_strxfncpy (hawk->_gem.errmsg, HAWK_COUNTOF(hawk->_gem.errmsg), errfmt, errarg); +*/ + hawk_copy_oocstr(hawk->_gem.errmsg, HAWK_COUNTOF(hawk->_gem.errmsg), errfmt); +/* TODO: remove awk_rtx_seterror() and substitute hawk_rtx_seterrfmt()/seterrbfmt()/seterrufmt() */ + if (errloc) hawk->errloc = *errloc; + else HAWK_MEMSET (&hawk->errloc, 0, HAWK_SIZEOF(hawk->errloc)); +} + +/* ------------------------------------------------------------------------- */ + +const hawk_loc_t* hawk_rtx_geterrloc (hawk_rtx_t* rtx) +{ + return &rtx->errloc; +} + +const hawk_bch_t* hawk_rtx_geterrbmsg (hawk_rtx_t* rtx) +{ +#if defined(MOO_OOCH_IS_BCH) + return (rtx->_gem.errmsg[0] == '\0')? hawk_geterrstr(awk)(rtx->awk, rtx->_gem.errnum): rtx->_gem.errmsg; +#else + const hawk_ooch_t* msg; + hawk_oow_t wcslen, mbslen; + + msg = (rtx->_gem.errmsg[0] == '\0')? hawk_geterrstr(rtx->awk)(rtx->awk, rtx->_gem.errnum): rtx->_gem.errmsg; + + mbslen = HAWK_COUNTOF(rtx->berrmsg); + hawk_conv_ucstr_to_bcstr_with_cmgr (msg, &wcslen, rtx->berrmsg, &mbslen, hawk_rtx_getcmgr(rtx)); + + return rtx->berrmsg; +#endif +} + +const hawk_uch_t* hawk_rtx_geterrumsg (hawk_rtx_t* rtx) +{ +#if defined(MOO_OOCH_IS_BCH) + const hawk_ooch_t* msg; + hawk_oow_t wcslen, mbslen; + + msg = (rtx->_gem.errmsg[0] == '\0')? hawk_geterrstr(rtx->awk)(rtx->awk, rtx->_gem.errnum): rtx->_gem.errmsg; + + wcslen = HAWK_COUNTOF(rtx->uerrmsg); + hawk_conv_bcstr_to_ucstr_with_cmgr (msg, &mbslen, rtx->uerrmsg, &wcslen, hawk_rtx_getcmgr(rtx), 1); + + return rtx->uerrmsg; +#else + return (rtx->_gem.errmsg[0] == '\0')? hawk_geterrstr(rtx->awk)(rtx->awk, rtx->_gem.errnum): rtx->_gem.errmsg; +#endif +} + +void hawk_rtx_geterrinf (hawk_rtx_t* rtx, hawk_errinf_t* errinf) +{ + errinf->num = rtx->_gem.errnum; + errinf->loc = rtx->errloc; + hawk_copy_oocstr (errinf->msg, HAWK_COUNTOF(errinf->msg), (rtx->_gem.errmsg[0] == '\0'? hawk_geterrstr(rtx->awk)(rtx->awk, rtx->_gem.errnum): rtx->_gem.errmsg)); +} + +void hawk_rtx_geterror (hawk_rtx_t* rtx, hawk_errnum_t* errnum, const hawk_ooch_t** errmsg, hawk_loc_t* errloc) +{ + if (errnum) *errnum = rtx->_gem.errnum; + if (errmsg) *errmsg = (rtx->_gem.errmsg[0] == '\0')? hawk_geterrstr(rtx->awk)(rtx->awk, rtx->_gem.errnum): rtx->_gem.errmsg; + if (errloc) *errloc = rtx->errloc; +} + +const hawk_ooch_t* hawk_rtx_backuperrmsg (hawk_rtx_t* rtx) +{ + hawk_copy_oocstr (rtx->errmsg_backup, HAWK_COUNTOF(rtx->errmsg_backup), hawk_rtx_geterrmsg(rtx)); + return rtx->errmsg_backup; +} + +void hawk_rtx_seterrnum (hawk_rtx_t* rtx, hawk_errnum_t errnum, const hawk_oocs_t* errarg) +{ + hawk_rtx_seterror (rtx, errnum, errarg, HAWK_NULL); +} + +void hawk_rtx_seterrinf (hawk_rtx_t* rtx, const hawk_errinf_t* errinf) +{ + rtx->_gem.errnum = errinf->num; + hawk_copy_oocstr(rtx->_gem.errmsg, HAWK_COUNTOF(rtx->_gem.errmsg), errinf->msg); + rtx->errloc = errinf->loc; +} + + +static int rtx_err_bchars (hawk_fmtout_t* fmtout, const hawk_bch_t* ptr, hawk_oow_t len) +{ + hawk_rtx_t* rtx = (hawk_rtx_t*)fmtout->ctx; + hawk_oow_t max; + + max = HAWK_COUNTOF(rtx->_gem.errmsg) - rtx->errmsg_len - 1; + +#if defined(HAWK_OOCH_IS_UCH) + if (max <= 0) return 1; + hawk_conv_bchars_to_uchars_with_cmgr (ptr, &len, &rtx->_gem.errmsg[rtx->errmsg_len], &max, hawk_rtx_getcmgr(rtx), 1); + rtx->errmsg_len += max; +#else + if (len > max) len = max; + if (len <= 0) return 1; + HAWK_MEMCPY (&rtx->errinf.msg[rtx->errmsg_len], ptr, len * HAWK_SIZEOF(*ptr)); + rtx->errmsg_len += len; +#endif + + rtx->_gem.errmsg[rtx->errmsg_len] = '\0'; + + return 1; /* success */ +} + +static int rtx_err_uchars (hawk_fmtout_t* fmtout, const hawk_uch_t* ptr, hawk_oow_t len) +{ + hawk_rtx_t* rtx = (hawk_rtx_t*)fmtout->ctx; + hawk_oow_t max; + + max = HAWK_COUNTOF(rtx->_gem.errmsg) - rtx->errmsg_len - 1; + +#if defined(HAWK_OOCH_IS_UCH) + if (len > max) len = max; + if (len <= 0) return 1; + HAWK_MEMCPY (&rtx->_gem.errmsg[rtx->errmsg_len], ptr, len * HAWK_SIZEOF(*ptr)); + rtx->errmsg_len += len; +#else + if (max <= 0) return 1; + hawk_conv_uchars_to_bchars_with_cmgr (ptr, &len, &rtx->_gem.errmsg[rtx->errmsg_len], &max, hawk_getcmgr(hawk)); + rtx->errmsg_len += max; +#endif + rtx->_gem.errmsg[rtx->errmsg_len] = '\0'; + return 1; /* success */ +} + +void hawk_rtx_seterrbfmt (hawk_rtx_t* rtx, hawk_errnum_t errnum, const hawk_loc_t* errloc, const hawk_bch_t* errfmt, ...) +{ + va_list ap; + hawk_fmtout_t fo; + + /*if (hawk->shuterr) return;*/ + rtx->errmsg_len = 0; + rtx->_gem.errmsg[0] = '\0'; + + HAWK_MEMSET (&fo, 0, HAWK_SIZEOF(fo)); + fo.mmgr = hawk_rtx_getmmgr(rtx); + fo.putbchars = rtx_err_bchars; + fo.putuchars = rtx_err_uchars; + fo.ctx = rtx; + + va_start (ap, errfmt); + hawk_bfmt_outv (&fo, errfmt, ap); + va_end (ap); + + rtx->_gem.errnum = errnum; + if (errloc) rtx->errloc = *errloc; + else HAWK_MEMSET (&rtx->errloc, 0, HAWK_SIZEOF(rtx->errloc)); +} + +void hawk_rtx_seterrufmt (hawk_rtx_t* rtx, hawk_errnum_t errnum, const hawk_loc_t* errloc, const hawk_uch_t* errfmt, ...) +{ + va_list ap; + hawk_fmtout_t fo; + + /*if (hawk->shuterr) return;*/ + rtx->errmsg_len = 0; + rtx->_gem.errmsg[0] = '\0'; + + HAWK_MEMSET (&fo, 0, HAWK_SIZEOF(fo)); + fo.mmgr = hawk_rtx_getmmgr(rtx); + fo.putbchars = rtx_err_bchars; + fo.putuchars = rtx_err_uchars; + fo.ctx = rtx; + + va_start (ap, errfmt); + hawk_ufmt_outv (&fo, errfmt, ap); + va_end (ap); + + rtx->_gem.errnum = errnum; + if (errloc) rtx->errloc = *errloc; + else HAWK_MEMSET (&rtx->errloc, 0, HAWK_SIZEOF(rtx->errloc)); +} + + +void hawk_rtx_seterror (hawk_rtx_t* rtx, hawk_errnum_t errnum, const hawk_oocs_t* errarg, const hawk_loc_t* errloc) +{ + /* TODO: remove awk_rtx_seterror() and substitute hawk_rtx_seterrfmt()/seterrbfmt()/seterrufmt() */ + const hawk_ooch_t* errfmt; + + rtx->_gem.errnum = errnum; + + errfmt = hawk_geterrstr(rtx->awk)(rtx->awk, errnum); + HAWK_ASSERT (awk, errfmt != HAWK_NULL); +/* TODO: this change is buggy... copying won't process arguments... + qse_strxfncpy (rtx->_gem.errmsg, HAWK_COUNTOF(rtx->_gem.errmsg), errfmt, errarg); +*/ + hawk_copy_oocstr(rtx->_gem.errmsg, HAWK_COUNTOF(rtx->_gem.errmsg), errfmt); +/* TODO: remove awk_rtx_seterror() and substitute hawk_rtx_seterrfmt()/seterrbfmt()/seterrufmt() */ + if (errloc) rtx->errloc = *errloc; + else HAWK_MEMSET (&rtx->errloc, 0, HAWK_SIZEOF(rtx->errloc)); +} + +void hawk_rtx_errortohawk (hawk_rtx_t* rtx, hawk_t* hawk) +{ + hawk->_gem.errnum = rtx->_gem.errnum; + hawk->errloc = rtx->errloc; + hawk_copy_oocstr (hawk->_gem.errmsg, HAWK_COUNTOF(hawk->_gem.errmsg), rtx->_gem.errmsg); +} diff --git a/hawk/lib/fio.c b/hawk/lib/fio.c new file mode 100644 index 00000000..378722f6 --- /dev/null +++ b/hawk/lib/fio.c @@ -0,0 +1,1579 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include "hawk-prv.h" + +#if defined(_WIN32) +# include +/*# include */ /* for GetMappedFileName(). but dynamically loaded */ +# include +# if !defined(INVALID_SET_FILE_POINTER) +# define INVALID_SET_FILE_POINTER ((DWORD)-1) +# endif +#elif defined(__OS2__) +# define INCL_DOSFILEMGR +# define INCL_DOSMODULEMGR +# define INCL_DOSPROCESS +# define INCL_DOSERRORS +# include +#elif defined(__DOS__) +# include +# include +# include +#elif defined(vms) || defined(__vms) +# define __NEW_STARLET 1 +# include +# include +#else +# include "syscall.h" +#endif + +/* internal status codes */ +enum +{ + STATUS_APPEND = (1 << 0), + STATUS_NOCLOSE = (1 << 1), + STATUS_WIN32_STDIN = (1 << 2) +}; + +#include "syserr.h" +IMPLEMENT_SYSERR_TO_ERRNUM (fio, FIO) + +#if defined(_WIN32) + +typedef DWORD WINAPI (*getmappedfilename_t) ( + HANDLE hProcess, + LPVOID lpv, + LPTSTR lpFilename, + DWORD nSize +); + +#elif defined(__OS2__) + +#if defined(__WATCOMC__) && (__WATCOMC__ < 1200) && !defined(LONGLONG_INCLUDED) +typedef struct _LONGLONG { + ULONG ulLo; + LONG ulHi; +} LONGLONG, *PLONGLONG; + +typedef struct _ULONGLONG { + ULONG ulLo; + ULONG ulHi; +} ULONGLONG, *PULONGLONG; +#endif + +typedef APIRET APIENTRY (*dosopenl_t) ( + PSZ pszFileName, + PHFILE pHf, + PULONG pulAction, + LONGLONG cbFile, + ULONG ulAttribute, + ULONG fsOpenFlags, + ULONG fsOpenMode, + PEAOP2 peaop2 +); + +typedef APIRET APIENTRY (*dossetfileptrl_t) ( + HFILE hFile, + LONGLONG ib, + ULONG method, + PLONGLONG ibActual +); + +typedef APIRET APIENTRY (*dossetfilesizel_t) ( + HFILE hFile, + LONGLONG cbSize +); + +static int dos_set = 0; +static dosopenl_t dos_open_l = HAWK_NULL; +static dossetfileptrl_t dos_set_file_ptr_l = HAWK_NULL; +static dossetfilesizel_t dos_set_file_size_l = HAWK_NULL; + +#endif + +hawk_fio_t* hawk_fio_open ( + hawk_t* hawk, hawk_oow_t xtnsize, + const hawk_ooch_t* path, int flags, int mode) +{ + hawk_fio_t* fio; + + fio = (hawk_fio_t*)hawk_allocmem(hawk, HAWK_SIZEOF(hawk_fio_t) + xtnsize); + if (fio) + { + if (hawk_fio_init (fio, hawk, path, flags, mode) <= -1) + { + hawk_freemem (hawk, fio); + return HAWK_NULL; + } + else HAWK_MEMSET (fio + 1, 0, xtnsize); + } + return fio; +} + +void hawk_fio_close (hawk_fio_t* fio) +{ + hawk_fio_fini (fio); + hawk_freemem (fio->hawk, fio); +} + +int hawk_fio_init (hawk_fio_t* fio, hawk_t* hawk, const hawk_ooch_t* path, int flags, int mode) +{ + hawk_fio_hnd_t handle; + +#if defined(_WIN32) + int fellback = 0; +#endif + +#if defined(__OS2__) + if (!dos_set) + { + DosEnterCritSec (); + if (!dos_set) + { + HMODULE mod; + if (DosLoadModule(NULL, 0, "DOSCALL1", &mod) == NO_ERROR) + { + /* look up routines by ordinal */ + DosQueryProcAddr (mod, 981, NULL, (PFN*)&dos_open_l); + DosQueryProcAddr (mod, 988, NULL, (PFN*)&dos_set_file_ptr_l); + DosQueryProcAddr (mod, 989, NULL, (PFN*)&dos_set_file_size_l); + } + + dos_set = 1; + } + DosExitCritSec (); + } +#endif + + HAWK_MEMSET (fio, 0, HAWK_SIZEOF(*fio)); + fio->hawk = hawk; + + if (!(flags & (HAWK_FIO_READ | HAWK_FIO_WRITE | HAWK_FIO_APPEND | HAWK_FIO_HANDLE))) + { + /* one of HAWK_FIO_READ, HAWK_FIO_WRITE, HAWK_FIO_APPEND, + * and HAWK_FIO_HANDLE must be specified */ + fio->errnum = HAWK_FIO_EINVAL; + return -1; + } + + /* Store some flags for later use */ + if (flags & HAWK_FIO_NOCLOSE) + fio->status |= STATUS_NOCLOSE; + +#if defined(_WIN32) + if (flags & HAWK_FIO_HANDLE) + { + handle = *(hawk_fio_hnd_t*)path; + /* do not specify an invalid handle value */ + HAWK_ASSERT (hawk, handle != INVALID_HANDLE_VALUE); + + if (handle == GetStdHandle (STD_INPUT_HANDLE)) + fio->status |= STATUS_WIN32_STDIN; + } + else + { + DWORD desired_access = 0; + DWORD share_mode = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE; + DWORD creation_disposition = 0; + DWORD flag_and_attr = FILE_ATTRIBUTE_NORMAL; + + if (fellback) share_mode &= ~FILE_SHARE_DELETE; + + if (flags & HAWK_FIO_APPEND) + { + if (fellback) + { + desired_access |= GENERIC_WRITE; + } + else + { + /* this is not officially documented for CreateFile. + * ZwCreateFile (kernel) seems to document it */ + fio->status &= ~STATUS_APPEND; + desired_access |= FILE_APPEND_DATA; + } + } + else if (flags & HAWK_FIO_WRITE) + { + /* In WIN32, FILE_APPEND_DATA and GENERIC_WRITE can't + * be used together */ + desired_access |= GENERIC_WRITE; + } + if (flags & HAWK_FIO_READ) desired_access |= GENERIC_READ; + + if (flags & HAWK_FIO_CREATE) + { + creation_disposition = + (flags & HAWK_FIO_EXCLUSIVE)? CREATE_NEW: + (flags & HAWK_FIO_TRUNCATE)? CREATE_ALWAYS: OPEN_ALWAYS; + } + else if (flags & HAWK_FIO_TRUNCATE) + { + creation_disposition = TRUNCATE_EXISTING; + } + else creation_disposition = OPEN_EXISTING; + + if (flags & HAWK_FIO_NOSHREAD) + share_mode &= ~FILE_SHARE_READ; + if (flags & HAWK_FIO_NOSHWRITE) + share_mode &= ~FILE_SHARE_WRITE; + if (flags & HAWK_FIO_NOSHDELETE) + share_mode &= ~FILE_SHARE_DELETE; + + if (!(mode & HAWK_FIO_WUSR)) + flag_and_attr = FILE_ATTRIBUTE_READONLY; + if (flags & HAWK_FIO_SYNC) + flag_and_attr |= FILE_FLAG_WRITE_THROUGH; + + #if defined(FILE_FLAG_OPEN_REPARSE_POINT) + if (flags & HAWK_FIO_NOFOLLOW) + flag_and_attr |= FILE_FLAG_OPEN_REPARSE_POINT; + #endif + + /* these two are just hints to OS */ + if (flags & HAWK_FIO_RANDOM) + flag_and_attr |= FILE_FLAG_RANDOM_ACCESS; + if (flags & HAWK_FIO_SEQUENTIAL) + flag_and_attr |= FILE_FLAG_SEQUENTIAL_SCAN; + + if (flags & HAWK_FIO_MBSPATH) + { + handle = CreateFileA ( + (const hawk_bch_t*)path, desired_access, share_mode, + HAWK_NULL, /* set noinherit by setting no secattr */ + creation_disposition, flag_and_attr, 0 + ); + } + else + { + handle = CreateFile ( + path, desired_access, share_mode, + HAWK_NULL, /* set noinherit by setting no secattr */ + creation_disposition, flag_and_attr, 0 + ); + } + if (handle == INVALID_HANDLE_VALUE) + { + DWORD e = GetLastError(); + if (!fellback && e == ERROR_INVALID_PARAMETER && + ((share_mode & FILE_SHARE_DELETE) || (flags & HAWK_FIO_APPEND))) + { + /* old windows fails with ERROR_INVALID_PARAMETER + * when some advanced flags are used. so try again + * with fallback flags */ + fellback = 1; + + share_mode &= ~FILE_SHARE_DELETE; + if (flags & HAWK_FIO_APPEND) + { + fio->status |= STATUS_APPEND; + desired_access &= ~FILE_APPEND_DATA; + desired_access |= GENERIC_WRITE; + } + + if (flags & HAWK_FIO_MBSPATH) + { + handle = CreateFileA ( + (const hawk_bch_t*)path, desired_access, share_mode, + HAWK_NULL, /* set noinherit by setting no secattr */ + creation_disposition, flag_and_attr, 0 + ); + } + else + { + handle = CreateFile ( + path, desired_access, share_mode, + HAWK_NULL, /* set noinherit by setting no secattr */ + creation_disposition, flag_and_attr, 0 + ); + } + if (handle == INVALID_HANDLE_VALUE) + { + fio->errnum = syserr_to_errnum(GetLastError()); + return -1; + } + } + else + { + fio->errnum = syserr_to_errnum(e); + return -1; + } + } + } + + /* some special check */ +#if 0 + if (GetFileType(handle) == FILE_TYPE_UNKNOWN) + { + fio->errnum = syserr_to_errnum(GetLastError()); + CloseHandle (handle); + return -1; + } +#endif + + /* TODO: support more features on WIN32 - TEMPORARY, DELETE_ON_CLOSE */ + +#elif defined(__OS2__) + + if (flags & HAWK_FIO_HANDLE) + { + handle = *(hawk_fio_hnd_t*)path; + } + else + { + APIRET ret; + ULONG action_taken = 0; + ULONG open_action, open_mode, open_attr; + + #if defined(HAWK_OOCH_IS_BCH) + const hawk_bch_t* path_mb = path; + #else + hawk_bch_t path_mb_buf[CCHMAXPATH]; + hawk_bch_t* path_mb; + hawk_oow_t wl, ml; + int px; + + if (flags & HAWK_FIO_MBSPATH) + { + path_mb = (hawk_bch_t*)path; + } + else + { + path_mb = path_mb_buf; + ml = HAWK_COUNTOF(path_mb_buf); + px = hawk_wcstombs (path, &wl, path_mb, &ml); + if (px == -2) + { + /* the static buffer is too small. + * dynamically allocate a buffer */ + path_mb = hawk_wcstombsdup (path, HAWK_NULL, mmgr); + if (path_mb == HAWK_NULL) + { + fio->errnum = HAWK_FIO_ENOMEM; + return -1; + } + } + else if (px <= -1) + { + fio->errnum = HAWK_FIO_EINVAL; + return -1; + } + } + #endif + + if (flags & HAWK_FIO_APPEND) + fio->status |= STATUS_APPEND; + + if (flags & HAWK_FIO_CREATE) + { + if (flags & HAWK_FIO_EXCLUSIVE) + { + open_action = OPEN_ACTION_FAIL_IF_EXISTS | + OPEN_ACTION_CREATE_IF_NEW; + } + else if (flags & HAWK_FIO_TRUNCATE) + { + open_action = OPEN_ACTION_REPLACE_IF_EXISTS | + OPEN_ACTION_CREATE_IF_NEW; + } + else + { + open_action = OPEN_ACTION_CREATE_IF_NEW | + OPEN_ACTION_OPEN_IF_EXISTS; + } + } + else if (flags & HAWK_FIO_TRUNCATE) + { + open_action = OPEN_ACTION_REPLACE_IF_EXISTS | + OPEN_ACTION_FAIL_IF_NEW; + } + else + { + open_action = OPEN_ACTION_OPEN_IF_EXISTS | + OPEN_ACTION_FAIL_IF_NEW; + } + + open_mode = OPEN_FLAGS_NOINHERIT; + + if (flags & HAWK_FIO_SYNC) + open_mode |= OPEN_FLAGS_WRITE_THROUGH; + + if ((flags & HAWK_FIO_NOSHREAD) && (flags & HAWK_FIO_NOSHWRITE)) + open_mode |= OPEN_SHARE_DENYREADWRITE; + else if (flags & HAWK_FIO_NOSHREAD) + open_mode |= OPEN_SHARE_DENYREAD; + else if (flags & HAWK_FIO_NOSHWRITE) + open_mode |= OPEN_SHARE_DENYWRITE; + else + open_mode |= OPEN_SHARE_DENYNONE; + + if ((flags & HAWK_FIO_READ) && + (flags & HAWK_FIO_WRITE)) open_mode |= OPEN_ACCESS_READWRITE; + else if (flags & HAWK_FIO_READ) open_mode |= OPEN_ACCESS_READONLY; + else if (flags & HAWK_FIO_WRITE) open_mode |= OPEN_ACCESS_WRITEONLY; + + open_attr = (mode & HAWK_FIO_WUSR)? FILE_NORMAL: FILE_READONLY; + + #if defined(FIL_STANDARDL) + if (dos_open_l) + { + LONGLONG zero; + + zero.ulLo = 0; + zero.ulHi = 0; + ret = dos_open_l ( + path_mb, /* file name */ + &handle, /* file handle */ + &action_taken, /* store action taken */ + zero, /* size */ + open_attr, /* attribute */ + open_action, /* action if it exists */ + open_mode, /* open mode */ + 0L + ); + } + else + { + #endif + ret = DosOpen ( + path_mb, /* file name */ + &handle, /* file handle */ + &action_taken, /* store action taken */ + 0, /* size */ + open_attr, /* attribute */ + open_action, /* action if it exists */ + open_mode, /* open mode */ + 0L + ); + #if defined(FIL_STANDARDL) + } + #endif + + #if defined(HAWK_OOCH_IS_BCH) + /* nothing to do */ + #else + if (path_mb != path_mb_buf) hawk_freemem (hawk->awk, path_mb); + #endif + + if (ret != NO_ERROR) + { + fio->errnum = syserr_to_errnum(ret); + return -1; + } + } + +#elif defined(__DOS__) + + if (flags & HAWK_FIO_HANDLE) + { + handle = *(hawk_fio_hnd_t*)path; + /* do not specify an invalid handle value */ + HAWK_ASSERT (hawk, handle >= 0); + } + else + { + int oflags = 0; + int permission = 0; + + #if defined(HAWK_OOCH_IS_BCH) + const hawk_bch_t* path_mb = path; + #else + hawk_bch_t path_mb_buf[_MAX_PATH]; + hawk_bch_t* path_mb; + hawk_oow_t wl, ml; + int px; + + if (flags & HAWK_FIO_MBSPATH) + { + path_mb = (hawk_bch_t*)path; + } + else + { + path_mb = path_mb_buf; + ml = HAWK_COUNTOF(path_mb_buf); + px = hawk_wcstombs (path, &wl, path_mb, &ml); + if (px == -2) + { + /* static buffer size not enough. + * switch to dynamic allocation */ + path_mb = hawk_wcstombsdup (path, HAWK_NULL, mmgr); + if (path_mb == HAWK_NULL) + { + fio->errnum = HAWK_FIO_ENOMEM; + return -1; + } + } + else if (px <= -1) + { + fio->errnum = HAWK_FIO_EINVAL; + return -1; + } + } + #endif + + if (flags & HAWK_FIO_APPEND) + { + if ((flags & HAWK_FIO_READ)) oflags |= O_RDWR; + else oflags |= O_WRONLY; + oflags |= O_APPEND; + } + else + { + if ((flags & HAWK_FIO_READ) && + (flags & HAWK_FIO_WRITE)) oflags |= O_RDWR; + else if (flags & HAWK_FIO_READ) oflags |= O_RDONLY; + else if (flags & HAWK_FIO_WRITE) oflags |= O_WRONLY; + } + + if (flags & HAWK_FIO_CREATE) oflags |= O_CREAT; + if (flags & HAWK_FIO_TRUNCATE) oflags |= O_TRUNC; + if (flags & HAWK_FIO_EXCLUSIVE) oflags |= O_EXCL; + + oflags |= O_BINARY | O_NOINHERIT; + + if (mode & HAWK_FIO_RUSR) permission |= S_IREAD; + if (mode & HAWK_FIO_WUSR) permission |= S_IWRITE; + + handle = open ( + path_mb, + oflags, + permission + ); + + #if defined(HAWK_OOCH_IS_BCH) + /* nothing to do */ + #else + if (path_mb != path_mb_buf) hawk_freemem (hawk->awk, path_mb); + #endif + + if (handle <= -1) + { + fio->errnum = syserr_to_errnum (errno); + return -1; + } + } + +#elif defined(vms) || defined(__vms) + + if (flags & HAWK_FIO_HANDLE) + { + /* TODO: implement this */ + fio->errnum = HAWK_FIO_ENOIMPL; + return -1; + } + else + { + struct FAB* fab; + struct RAB* rab; + unsigned long r0; + + #if defined(HAWK_OOCH_IS_BCH) + const hawk_bch_t* path_mb = path; + #else + hawk_bch_t path_mb_buf[1024]; + hawk_bch_t* path_mb; + hawk_oow_t wl, ml; + int px; + + if (flags & HAWK_FIO_MBSPATH) + { + path_mb = (hawk_bch_t*)path; + } + else + { + path_mb = path_mb_buf; + ml = HAWK_COUNTOF(path_mb_buf); + px = hawk_wcstombs (path, &wl, path_mb, &ml); + if (px == -2) + { + /* the static buffer is too small. + * allocate a buffer */ + path_mb = hawk_wcstombsdup (path, mmgr); + if (path_mb == HAWK_NULL) + { + fio->errnum = HAWK_FIO_ENOMEM; + return -1; + } + } + else if (px <= -1) + { + fio->errnum = HAWK_FIO_EINVAL; + return -1; + } + } + #endif + + rab = (struct RAB*)hawk_allocmem(hawk, HAWK_SIZEOF(*rab) + HAWK_SIZEOF(*fab)); + if (rab == HAWK_NULL) + { + #if defined(HAWK_OOCH_IS_BCH) + /* nothing to do */ + #else + if (path_mb != path_mb_buf) hawk_freemem (hawk, path_mb); + #endif + fio->errnum = HAWK_FIO_ENOMEM; + return -1; + } + + fab = (struct FAB*)(rab + 1); + *rab = cc$rms_rab; + rab->rab$l_fab = fab; + + *fab = cc$rms_fab; + fab->fab$l_fna = path_mb; + fab->fab$b_fns = strlen(path_mb); + fab->fab$b_org = FAB$C_SEQ; + fab->fab$b_rfm = FAB$C_VAR; /* FAB$C_STM, FAB$C_STMLF, FAB$C_VAR, etc... */ + fab->fab$b_fac = FAB$M_GET | FAB$M_PUT; + + fab->fab$b_fac = FAB$M_NIL; + if (flags & HAWK_FIO_READ) fab->fab$b_fac |= FAB$M_GET; + if (flags & (HAWK_FIO_WRITE | HAWK_FIO_APPEND)) fab->fab$b_fac |= FAB$M_PUT | FAB$M_TRN; /* put, truncate */ + + fab->fab$b_shr |= FAB$M_SHRPUT | FAB$M_SHRGET; /* FAB$M_NIL */ + if (flags & HAWK_FIO_NOSHREAD) fab->fab$b_shr &= ~FAB$M_SHRGET; + if (flags & HAWK_FIO_NOSHWRITE) fab->fab$b_shr &= ~FAB$M_SHRPUT; + + if (flags & HAWK_FIO_APPEND) rab->rab$l_rop |= RAB$M_EOF; + + if (flags & HAWK_FIO_CREATE) + { + if (flags & HAWK_FIO_EXCLUSIVE) + fab->fab$l_fop &= ~FAB$M_CIF; + else + fab->fab$l_fop |= FAB$M_CIF; + + r0 = sys$create (&fab, 0, 0); + } + else + { + r0 = sys$open (&fab, 0, 0); + } + + if (r0 != RMS$_NORMAL && r0 != RMS$_CREATED) + { + #if defined(HAWK_OOCH_IS_BCH) + /* nothing to do */ + #else + if (path_mb != path_mb_buf) hawk_freemem (hawk, path_mb); + #endif + fio->errnum = syserr_to_errnum (r0); + return -1; + } + + + r0 = sys$connect (&rab, 0, 0); + if (r0 != RMS$_NORMAL) + { + #if defined(HAWK_OOCH_IS_BCH) + /* nothing to do */ + #else + if (path_mb != path_mb_buf) hawk_freemem (hawk, path_mb); + #endif + fio->errnum = syserr_to_errnum (r0); + return -1; + } + + #if defined(HAWK_OOCH_IS_BCH) + /* nothing to do */ + #else + if (path_mb != path_mb_buf) hawk_freemem (hawk, path_mb); + #endif + + handle = rab; + } + +#else + + if (flags & HAWK_FIO_HANDLE) + { + handle = *(hawk_fio_hnd_t*)path; + /* do not specify an invalid handle value */ + HAWK_ASSERT (hawk, handle >= 0); + } + else + { + int desired_access = 0; + + #if defined(HAWK_OOCH_IS_BCH) + const hawk_bch_t* path_mb = path; + #else + hawk_bch_t path_mb_buf[1024]; /* PATH_MAX instead? */ + hawk_bch_t* path_mb; + hawk_oow_t wl, ml; + int px; + + if (flags & HAWK_FIO_MBSPATH) + { + path_mb = (hawk_bch_t*)path; + } + else + { + path_mb = path_mb_buf; + ml = HAWK_COUNTOF(path_mb_buf); + px = hawk_conv_ucstr_to_bcstr_with_cmgr(path, &wl, path_mb, &ml, hawk_getcmgr(fio->hawk)); + if (px == -2) + { + /* the static buffer is too small. + * allocate a buffer */ + path_mb = hawk_duputobcstr(fio->hawk, path, HAWK_NULL); + if (path_mb == HAWK_NULL) + { + fio->errnum = HAWK_FIO_ENOMEM; + return -1; + } + } + else if (px <= -1) + { + fio->errnum = HAWK_FIO_EINVAL; + return -1; + } + } + #endif + /* + * rwa -> RDWR | APPEND + * ra -> RDWR | APPEND + * wa -> WRONLY | APPEND + * a -> WRONLY | APPEND + */ + if (flags & HAWK_FIO_APPEND) + { + if ((flags & HAWK_FIO_READ)) desired_access |= O_RDWR; + else desired_access |= O_WRONLY; + desired_access |= O_APPEND; + } + else + { + if ((flags & HAWK_FIO_READ) && + (flags & HAWK_FIO_WRITE)) desired_access |= O_RDWR; + else if (flags & HAWK_FIO_READ) desired_access |= O_RDONLY; + else if (flags & HAWK_FIO_WRITE) desired_access |= O_WRONLY; + } + + if (flags & HAWK_FIO_CREATE) desired_access |= O_CREAT; + if (flags & HAWK_FIO_TRUNCATE) desired_access |= O_TRUNC; + if (flags & HAWK_FIO_EXCLUSIVE) desired_access |= O_EXCL; + #if defined(O_SYNC) + if (flags & HAWK_FIO_SYNC) desired_access |= O_SYNC; + #endif + + #if defined(O_NOFOLLOW) + if (flags & HAWK_FIO_NOFOLLOW) desired_access |= O_NOFOLLOW; + #endif + + #if defined(O_LARGEFILE) + desired_access |= O_LARGEFILE; + #endif + #if defined(O_CLOEXEC) + desired_access |= O_CLOEXEC; /* no inherit */ + #endif + + handle = HAWK_OPEN(path_mb, desired_access, mode); + + #if defined(HAWK_OOCH_IS_BCH) + /* nothing to do */ + #else + if (path_mb != path_mb_buf && path_mb != path) + { + hawk_freemem (hawk, path_mb); + } + #endif + if (handle == -1) + { + fio->errnum = syserr_to_errnum(errno); + return -1; + } + else + { + #if !defined(O_CLOEXEC) && defined(FD_CLOEXEC) + int flag = fcntl(handle, F_GETFD); + if (flag >= 0) fcntl (handle, F_SETFD, flag | FD_CLOEXEC); + #endif + } + + /* set some file access hints */ + #if defined(POSIX_FADV_RANDOM) + if (flags & HAWK_FIO_RANDOM) + posix_fadvise (handle, 0, 0, POSIX_FADV_RANDOM); + #endif + #if defined(POSIX_FADV_SEQUENTIAL) + if (flags & HAWK_FIO_SEQUENTIAL) + posix_fadvise (handle, 0, 0, POSIX_FADV_SEQUENTIAL); + #endif + } +#endif + + fio->handle = handle; + return 0; +} + +void hawk_fio_fini (hawk_fio_t* fio) +{ + if (!(fio->status & STATUS_NOCLOSE)) + { +#if defined(_WIN32) + CloseHandle (fio->handle); + +#elif defined(__OS2__) + DosClose (fio->handle); + +#elif defined(__DOS__) + close (fio->handle); + +#elif defined(vms) || defined(__vms) + struct RAB* rab = (struct RAB*)fio->handle; + sys$disconnect (rab, 0, 0); + sys$close ((struct FAB*)(rab + 1), 0, 0); + hawk_freemem (fio->hawk, fio->handle); + +#else + HAWK_CLOSE (fio->handle); +#endif + } +} + +hawk_fio_errnum_t hawk_fio_geterrnum (const hawk_fio_t* fio) +{ + return fio->errnum; +} + +hawk_fio_hnd_t hawk_fio_gethnd (const hawk_fio_t* fio) +{ + return fio->handle; +} + +hawk_fio_off_t hawk_fio_seek (hawk_fio_t* fio, hawk_fio_off_t offset, hawk_fio_ori_t origin) +{ +#if defined(_WIN32) + static int seek_map[] = + { + FILE_BEGIN, + FILE_CURRENT, + FILE_END + }; + LARGE_INTEGER x; + #if defined(_WIN64) + LARGE_INTEGER y; + #endif + + HAWK_ASSERT (fio->hawk, HAWK_SIZEOF(offset) <= HAWK_SIZEOF(x.QuadPart)); + + #if defined(_WIN64) + x.QuadPart = offset; + if (SetFilePointerEx (fio->handle, x, &y, seek_map[origin]) == FALSE) + { + return (hawk_fio_off_t)-1; + } + return (hawk_fio_off_t)y.QuadPart; + #else + + /* SetFilePointerEx is not available on Windows NT 4. + * So let's use SetFilePointer */ + x.QuadPart = offset; + x.LowPart = SetFilePointer ( + fio->handle, x.LowPart, &x.HighPart, seek_map[origin]); + if (x.LowPart == INVALID_SET_FILE_POINTER && GetLastError() != NO_ERROR) + { + fio->errnum = syserr_to_errnum (GetLastError()); + return (hawk_fio_off_t)-1; + } + return (hawk_fio_off_t)x.QuadPart; + #endif + +#elif defined(__OS2__) + static int seek_map[] = + { + FILE_BEGIN, + FILE_CURRENT, + FILE_END + }; + + #if defined(FIL_STANDARDL) + if (dos_set_file_ptr_l) + { + LONGLONG pos, newpos; + APIRET ret; + + HAWK_ASSERT (fio->hawk, HAWK_SIZEOF(offset) >= HAWK_SIZEOF(pos)); + + pos.ulLo = (ULONG)(offset&0xFFFFFFFFlu); + pos.ulHi = (ULONG)(offset>>32); + + ret = dos_set_file_ptr_l (fio->handle, pos, seek_map[origin], &newpos); + if (ret != NO_ERROR) + { + fio->errnum = syserr_to_errnum (ret); + return (hawk_fio_off_t)-1; + } + + return ((hawk_fio_off_t)newpos.ulHi << 32) | newpos.ulLo; + } + else + { + #endif + ULONG newpos; + APIRET ret; + + ret = DosSetFilePtr (fio->handle, offset, seek_map[origin], &newpos); + if (ret != NO_ERROR) + { + fio->errnum = syserr_to_errnum (ret); + return (hawk_fio_off_t)-1; + } + + return newpos; + #if defined(FIL_STANDARDL) + } + #endif + +#elif defined(__DOS__) + static int seek_map[] = + { + SEEK_SET, + SEEK_CUR, + SEEK_END + }; + + return lseek (fio->handle, offset, seek_map[origin]); +#elif defined(vms) || defined(__vms) + + /* TODO: */ + fio->errnum = HAWK_FIO_ENOIMPL; + return (hawk_fio_off_t)-1; +#else + static int seek_map[] = + { + SEEK_SET, + SEEK_CUR, + SEEK_END + }; + +#if defined(HAWK_LLSEEK) + loff_t tmp; + + if (HAWK_LLSEEK (fio->handle, + (unsigned long)(offset>>32), + (unsigned long)(offset&0xFFFFFFFFlu), + &tmp, + seek_map[origin]) == -1) + { + fio->errnum = syserr_to_errnum (errno); + return (hawk_fio_off_t)-1; + } + + return (hawk_fio_off_t)tmp; +#else + return HAWK_LSEEK (fio->handle, offset, seek_map[origin]); +#endif + +#endif +} + +int hawk_fio_truncate (hawk_fio_t* fio, hawk_fio_off_t size) +{ +#if defined(_WIN32) + if (hawk_fio_seek (fio, size, HAWK_FIO_BEGIN) == (hawk_fio_off_t)-1) return -1; + if (SetEndOfFile(fio->handle) == FALSE) + { + fio->errnum = syserr_to_errnum (GetLastError()); + return -1; + } + return 0; +#elif defined(__OS2__) + + APIRET ret; + + #if defined(FIL_STANDARDL) + if (dos_set_file_size_l) + { + LONGLONG sz; + /* the file must have the write access for it to succeed */ + + sz.ulLo = (ULONG)(size&0xFFFFFFFFlu); + sz.ulHi = (ULONG)(size>>32); + + ret = dos_set_file_size_l (fio->handle, sz); + } + else + { + #endif + ret = DosSetFileSize (fio->handle, size); + #if defined(FIL_STANDARDL) + } + #endif + + if (ret != NO_ERROR) + { + fio->errnum = syserr_to_errnum (ret); + return -1; + } + return 0; + +#elif defined(__DOS__) + + int n; + n = chsize (fio->handle, size); + if (n <= -1) fio->errnum = syserr_to_errnum (errno); + return n; + +#elif defined(vms) || defined(__vms) + + unsigned long r0; + struct RAB* rab = (struct RAB*)fio->handle; + + if ((r0 = sys$rewind (rab, 0, 0)) != RMS$_NORMAL || + (r0 = sys$truncate (rab, 0, 0)) != RMS$_NORMAL) + { + fio->errnum = syserr_to_errnum (r0); + return -1; + } + + return 0; + +#elif defined(HAVE_FTRUNCATE) + + int n; + n = HAWK_FTRUNCATE (fio->handle, size); + if (n <= -1) fio->errnum = syserr_to_errnum (errno); + return n; + +#else + fio->errnum = HAWK_FIO_ENOIMPL; + return -1; +#endif +} + +hawk_ooi_t hawk_fio_read (hawk_fio_t* fio, void* buf, hawk_oow_t size) +{ +#if defined(_WIN32) + + DWORD count; + + if (size > (HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(DWORD))) + size = HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(DWORD); + if (ReadFile (fio->handle, buf, (DWORD)size, &count, HAWK_NULL) == FALSE) + { + DWORD e = GetLastError(); + /* special case when ReadFile returns failure with ERROR_BROKEN_PIPE. + * this happens when an anonymous pipe is a standard input for redirection. + * assuming that ERROR_BROKEN_PIPE doesn't occur with normal + * input streams, i treat the condition as a normal EOF indicator. */ + if ((fio->status & STATUS_WIN32_STDIN) && e == ERROR_BROKEN_PIPE) return 0; + fio->errnum = syserr_to_errnum (e); + return -1; + } + return (hawk_ooi_t)count; + +#elif defined(__OS2__) + + APIRET ret; + ULONG count; + if (size > (HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(ULONG))) + size = HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(ULONG); + ret = DosRead (fio->handle, buf, (ULONG)size, &count); + if (ret != NO_ERROR) + { + fio->errnum = syserr_to_errnum (ret); + return -1; + } + return (hawk_ooi_t)count; + +#elif defined(__DOS__) + + int n; + if (size > (HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(unsigned int))) + size = HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(unsigned int); + n = read (fio->handle, buf, size); + if (n <= -1) fio->errnum = syserr_to_errnum (errno); + return n; + +#elif defined(vms) || defined(__vms) + + unsigned long r0; + struct RAB* rab = (struct RAB*)fio->handle; + + if (size > 32767) size = 32767; + + rab->rab$l_ubf = buf; + rab->rab$w_usz = size; + + r0 = sys$get (rab, 0, 0); + if (r0 != RMS$_NORMAL) + { + fio->errnum = syserr_to_errnum (r0); + return -1; + } + + return rab->rab$w_rsz; +#else + + hawk_ooi_t n; + if (size > HAWK_TYPE_MAX(hawk_ooi_t)) size = HAWK_TYPE_MAX(hawk_ooi_t); + n = HAWK_READ (fio->handle, buf, size); + if (n <= -1) fio->errnum = syserr_to_errnum (errno); + return n; +#endif +} + +hawk_ooi_t hawk_fio_write (hawk_fio_t* fio, const void* data, hawk_oow_t size) +{ +#if defined(_WIN32) + + DWORD count; + + if (fio->status & STATUS_APPEND) + { +/* TODO: only when FILE_APPEND_DATA failed??? how do i know this??? */ + /* i do this on a best-effort basis */ + #if defined(_WIN64) + LARGE_INTEGER x; + x.QuadPart = 0; + SetFilePointerEx (fio->handle, x, HAWK_NULL, FILE_END); + #else + SetFilePointer (fio->handle, 0, HAWK_NULL, FILE_END); + #endif + } + + if (size > (HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(DWORD))) + size = HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(DWORD); + if (WriteFile (fio->handle, + data, (DWORD)size, &count, HAWK_NULL) == FALSE) + { + fio->errnum = syserr_to_errnum (GetLastError()); + return -1; + } + return (hawk_ooi_t)count; + +#elif defined(__OS2__) + + APIRET ret; + ULONG count; + + if (fio->status & STATUS_APPEND) + { + /* i do this on a best-effort basis */ + #if defined(FIL_STANDARDL) + if (dos_set_file_ptr_l) + { + LONGLONG pos, newpos; + pos.ulLo = (ULONG)0; + pos.ulHi = (ULONG)0; + dos_set_file_ptr_l (fio->handle, pos, FILE_END, &newpos); + } + else + { + #endif + ULONG newpos; + DosSetFilePtr (fio->handle, 0, FILE_END, &newpos); + #if defined(FIL_STANDARDL) + } + #endif + } + + if (size > (HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(ULONG))) + size = HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(ULONG); + ret = DosWrite(fio->handle, + (PVOID)data, (ULONG)size, &count); + if (ret != NO_ERROR) + { + fio->errnum = syserr_to_errnum (ret); + return -1; + } + return (hawk_ooi_t)count; + +#elif defined(__DOS__) + + int n; + if (size > (HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(unsigned int))) + size = HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(unsigned int); + n = write (fio->handle, data, size); + if (n <= -1) fio->errnum = syserr_to_errnum (errno); + return n; + +#elif defined(vms) || defined(__vms) + + unsigned long r0; + struct RAB* rab = (struct RAB*)fio->handle; + + if (size > 32767) size = 32767; + + rab->rab$l_rbf = (char*)data; + rab->rab$w_rsz = size; + + r0 = sys$put (rab, 0, 0); + if (r0 != RMS$_NORMAL) + { + fio->errnum = syserr_to_errnum (r0); + return -1; + } + + return rab->rab$w_rsz; + +#else + + hawk_ooi_t n; + if (size > HAWK_TYPE_MAX(hawk_ooi_t)) size = HAWK_TYPE_MAX(hawk_ooi_t); + n = HAWK_WRITE (fio->handle, data, size); + if (n <= -1) fio->errnum = syserr_to_errnum (errno); + return n; +#endif +} + +#if defined(_WIN32) + +static int get_devname_from_handle ( + hawk_fio_t* fio, hawk_ooch_t* buf, hawk_oow_t len) +{ + HANDLE map = NULL; + void* mem = NULL; + DWORD olen; + HINSTANCE psapi; + getmappedfilename_t getmappedfilename; + + /* try to load psapi.dll dynamially for + * systems without it. direct linking to the library + * may end up with dependency failure on such systems. + * this way, the worst case is that this function simply + * fails. */ + psapi = LoadLibrary (HAWK_T("PSAPI.DLL")); + if (!psapi) + { + fio->errnum = syserr_to_errnum (GetLastError()); + return -1; + } + + getmappedfilename = (getmappedfilename_t) + GetProcAddress (psapi, HAWK_BT("GetMappedFileName")); + if (!getmappedfilename) + { + fio->errnum = syserr_to_errnum (GetLastError()); + FreeLibrary (psapi); + return -1; + } + + /* create a file mapping object */ + map = CreateFileMapping ( + fio->handle, + NULL, + PAGE_READONLY, + 0, + 1, + NULL + ); + if (map == NULL) + { + fio->errnum = syserr_to_errnum (GetLastError()); + FreeLibrary (psapi); + return -1; + } + + /* create a file mapping to get the file name. */ + mem = MapViewOfFile (map, FILE_MAP_READ, 0, 0, 1); + if (mem == NULL) + { + fio->errnum = syserr_to_errnum (GetLastError()); + CloseHandle (map); + FreeLibrary (psapi); + return -1; + } + + olen = getmappedfilename (GetCurrentProcess(), mem, buf, len); + if (olen == 0) + { + fio->errnum = syserr_to_errnum (GetLastError()); + UnmapViewOfFile (mem); + CloseHandle (map); + FreeLibrary (psapi); + return -1; + } + + UnmapViewOfFile (mem); + CloseHandle (map); + FreeLibrary (psapi); + return 0; +} + +static int get_volname_from_handle ( + hawk_fio_t* fio, hawk_ooch_t* buf, hawk_oow_t len) +{ + if (get_devname_from_handle (fio, buf, len) == -1) return -1; + + if (hawk_strcasebeg (buf, HAWK_T("\\Device\\LanmanRedirector\\"))) + { + /*buf[0] = HAWK_T('\\');*/ + hawk_strcpy (&buf[1], &buf[24]); + } + else + { + DWORD n; + hawk_ooch_t drives[128]; + + n = GetLogicalDriveStrings (HAWK_COUNTOF(drives), drives); + + if (n == 0 /* error */ || + n > HAWK_COUNTOF(drives) /* buffer small */) + { + fio->errnum = syserr_to_errnum (GetLastError()); + return -1; + } + + while (n > 0) + { + hawk_ooch_t drv[3]; + hawk_ooch_t path[MAX_PATH]; + + drv[0] = drives[--n]; + drv[1] = HAWK_T(':'); + drv[2] = HAWK_T('\0'); + if (QueryDosDevice (drv, path, HAWK_COUNTOF(path))) + { + hawk_oow_t pl = hawk_strlen(path); + hawk_oow_t bl = hawk_strlen(buf); + if (bl > pl && buf[pl] == HAWK_T('\\') && + hawk_strxncasecmp(buf, pl, path, pl) == 0) + { + buf[0] = drv[0]; + buf[1] = HAWK_T(':'); + hawk_strcpy (&buf[2], &buf[pl]); + break; + } + } + } + } + + /* if the match is not found, the device name is returned + * without translation */ + return 0; +} +#endif + +int hawk_fio_chmod (hawk_fio_t* fio, int mode) +{ +#if defined(_WIN32) + + int flags = FILE_ATTRIBUTE_NORMAL; + hawk_ooch_t name[MAX_PATH]; + + /* it is a best effort implementation. if the file size is 0, + * it can't even get the file name from the handle and thus fails. + * if GENERIC_READ is not set in CreateFile, CreateFileMapping fails. + * so if this fio is opened without HAWK_FIO_READ, this function fails. + */ + if (get_volname_from_handle (fio, name, HAWK_COUNTOF(name)) == -1) return -1; + + if (!(mode & HAWK_FIO_WUSR)) flags = FILE_ATTRIBUTE_READONLY; + if (SetFileAttributes (name, flags) == FALSE) + { + fio->errnum = syserr_to_errnum (GetLastError()); + return -1; + } + return 0; + +#elif defined(__OS2__) + + APIRET n; + int flags = FILE_NORMAL; + #if defined(FIL_STANDARDL) + FILESTATUS3L stat; + #else + FILESTATUS3 stat; + #endif + ULONG size = HAWK_SIZEOF(stat); + + #if defined(FIL_STANDARDL) + n = DosQueryFileInfo (fio->handle, FIL_STANDARDL, &stat, size); + #else + n = DosQueryFileInfo (fio->handle, FIL_STANDARD, &stat, size); + #endif + if (n != NO_ERROR) + { + fio->errnum = syserr_to_errnum (n); + return -1; + } + + if (!(mode & HAWK_FIO_WUSR)) flags = FILE_READONLY; + + stat.attrFile = flags; + #if defined(FIL_STANDARDL) + n = DosSetFileInfo (fio->handle, FIL_STANDARDL, &stat, size); + #else + n = DosSetFileInfo (fio->handle, FIL_STANDARD, &stat, size); + #endif + if (n != NO_ERROR) + { + fio->errnum = syserr_to_errnum (n); + return -1; + } + + return 0; + +#elif defined(__DOS__) + + int permission = 0; + + if (mode & HAWK_FIO_RUSR) permission |= S_IREAD; + if (mode & HAWK_FIO_WUSR) permission |= S_IWRITE; + + /* TODO: fchmod not available. find a way to do this + return fchmod (fio->handle, permission); */ + + fio->errnum = HAWK_FIO_ENOIMPL; + return -1; + +#elif defined(vms) || defined(__vms) + + /* TODO: */ + fio->errnum = HAWK_FIO_ENOIMPL; + return (hawk_fio_off_t)-1; + +#elif defined(HAVE_FCHMOD) + int n; + n = HAWK_FCHMOD (fio->handle, mode); + if (n <= -1) fio->errnum = syserr_to_errnum (errno); + return n; + +#else + fio->errnum = HAWK_FIO_ENOIMPL; + return -1; + +#endif +} + +int hawk_fio_sync (hawk_fio_t* fio) +{ +#if defined(_WIN32) + + if (FlushFileBuffers (fio->handle) == FALSE) + { + fio->errnum = syserr_to_errnum (GetLastError()); + return -1; + } + return 0; + +#elif defined(__OS2__) + + APIRET n; + n = DosResetBuffer (fio->handle); + if (n != NO_ERROR) + { + fio->errnum = syserr_to_errnum (n); + return -1; + } + return 0; + +#elif defined(__DOS__) + + int n; + n = fsync (fio->handle); + if (n <= -1) fio->errnum = syserr_to_errnum (errno); + return n; + +#elif defined(vms) || defined(__vms) + + /* TODO: */ + fio->errnum = HAWK_FIO_ENOIMPL; + return (hawk_fio_off_t)-1; + +#elif defined(HAVE_FSYNC) + + int n; + n = HAWK_FSYNC (fio->handle); + if (n <= -1) fio->errnum = syserr_to_errnum (errno); + return n; +#else + + fio->errnum = HAWK_FIO_ENOIMPL; + return -1; +#endif +} + +int hawk_fio_lock (hawk_fio_t* fio, hawk_fio_lck_t* lck, int flags) +{ + /* TODO: hawk_fio_lock + * struct flock fl; + * fl.l_type = F_RDLCK, F_WRLCK; + * HAWK_FCNTL (fio->handle, F_SETLK, &fl); + */ + fio->errnum = HAWK_FIO_ENOIMPL; + return -1; +} + +int hawk_fio_unlock (hawk_fio_t* fio, hawk_fio_lck_t* lck, int flags) +{ + /* TODO: hawk_fio_unlock + * struct flock fl; + * fl.l_type = F_UNLCK; + * HAWK_FCNTL (fio->handle, F_SETLK, &fl); + */ + fio->errnum = HAWK_FIO_ENOIMPL; + return -1; +} + +int hawk_get_std_fio_handle (hawk_fio_std_t std, hawk_fio_hnd_t* hnd) +{ +#if defined(_WIN32) + static DWORD tab[] = + { + STD_INPUT_HANDLE, + STD_OUTPUT_HANDLE, + STD_ERROR_HANDLE + }; +#elif defined(vms) || defined(__vms) + /* TODO */ + static int tab[] = { 0, 1, 2 }; +#else + + static hawk_fio_hnd_t tab[] = + { +#if defined(__OS2__) + (HFILE)0, (HFILE)1, (HFILE)2 +#elif defined(__DOS__) + 0, 1, 2 +#else + 0, 1, 2 +#endif + }; + +#endif + + if (std < 0 || std >= HAWK_COUNTOF(tab)) return -1; + +#if defined(_WIN32) + { + HANDLE tmp = GetStdHandle(tab[std]); + if (tmp == INVALID_HANDLE_VALUE) return -1; + *hnd = tmp; + } +#elif defined(vms) || defined(__vms) + /* TODO: */ + return -1; +#else + *hnd = tab[std]; +#endif + return 0; +} diff --git a/hawk/lib/fmt-imp.h b/hawk/lib/fmt-imp.h new file mode 100644 index 00000000..2c49c7d8 --- /dev/null +++ b/hawk/lib/fmt-imp.h @@ -0,0 +1,228 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +static int fmt_uintmax ( + char_t* buf, int size, + hawk_uintmax_t value, int base_and_flags, int prec, + char_t fillchar, char_t signchar, const char_t* prefix) +{ + char_t tmp[(HAWK_SIZEOF(hawk_uintmax_t) * 8)]; + int reslen, base, fillsize, reqlen, pflen, preczero; + char_t* p, * bp, * be; + const hawk_bch_t* xbasestr; + + base = base_and_flags & 0x3F; + if (base < 2 || base > 36) return -1; + + xbasestr = (base_and_flags & HAWK_FMT_INTMAX_UPPERCASE)? + "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ": + "0123456789abcdefghijklmnopqrstuvwxyz"; + + if ((base_and_flags & HAWK_FMT_INTMAX_NOZERO) && value == 0) + { + p = tmp; + if (base_and_flags & HAWK_FMT_INTMAX_ZEROLEAD) + { + /* NOZERO emits no digit, ZEROLEAD emits 1 digit. + * so it emits '0' */ + reslen = 1; + preczero = 1; + } + else + { + /* since the value is zero, emit no digits */ + reslen = 0; + preczero = 0; + } + } + else + { + hawk_uintmax_t v = value; + + /* store the resulting numeric string into 'tmp' first */ + p = tmp; + do + { + *p++ = xbasestr[v % base]; + v /= base; + } + while (v > 0); + + /* reslen is the length of the resulting string without padding. */ + reslen = (int)(p - tmp); + + /* precision specified the minum number of digits to produce. + * so if the precision is larger that the digits produced, + * reslen should be adjusted to precision */ + if (prec > reslen) + { + /* if the precision is greater than the actual digits + * made from the value, 0 is inserted in front. + * ZEROLEAD doesn't have to be handled explicitly + * since it's achieved effortlessly */ + preczero = prec - reslen; + reslen = prec; + } + else + { + preczero = 0; + if ((base_and_flags & HAWK_FMT_INTMAX_ZEROLEAD) && value != 0) + { + /* if value is zero, 0 is emitted from it. + * so ZEROLEAD don't need to add another 0. */ + preczero++; + reslen++; + } + } + } + + if (signchar) reslen++; /* increment reslen for the sign character */ + if (prefix) + { + /* since the length can be truncated for different type sizes, + * don't pass in a very long prefix. */ + const char_t* pp; + for (pp = prefix; *pp != '\0'; pp++) ; + pflen = pp - prefix; + reslen += pflen; + } + else pflen = 0; + + /* get the required buffer size for lossless formatting */ + reqlen = (base_and_flags & HAWK_FMT_INTMAX_NONULL)? reslen: (reslen + 1); + + if (size <= 0 || + ((base_and_flags & HAWK_FMT_INTMAX_NOTRUNC) && size < reqlen)) + { + return -reqlen; + } + + /* get the size to fill with fill characters */ + fillsize = (base_and_flags & HAWK_FMT_INTMAX_NONULL)? size: (size - 1); + bp = buf; + be = buf + fillsize; + + /* fill space */ + if (fillchar != '\0') + { + if (base_and_flags & HAWK_FMT_INTMAX_FILLRIGHT) + { + /* emit sign */ + if (signchar && bp < be) *bp++ = signchar; + + /* copy prefix if necessary */ + if (prefix) while (*prefix && bp < be) *bp++ = *prefix++; + + /* add 0s for precision */ + while (preczero > 0 && bp < be) + { + *bp++ = '0'; + preczero--; + } + + /* copy the numeric string to the destination buffer */ + while (p > tmp && bp < be) *bp++ = *--p; + + /* fill the right side */ + while (fillsize > reslen) + { + *bp++ = fillchar; + fillsize--; + } + } + else if (base_and_flags & HAWK_FMT_INTMAX_FILLCENTER) + { + /* emit sign */ + if (signchar && bp < be) *bp++ = signchar; + + /* fill the left side */ + while (fillsize > reslen) + { + *bp++ = fillchar; + fillsize--; + } + + /* copy prefix if necessary */ + if (prefix) while (*prefix && bp < be) *bp++ = *prefix++; + + /* add 0s for precision */ + while (preczero > 0 && bp < be) + { + *bp++ = '0'; + preczero--; + } + + /* copy the numeric string to the destination buffer */ + while (p > tmp && bp < be) *bp++ = *--p; + } + else + { + /* fill the left side */ + while (fillsize > reslen) + { + *bp++ = fillchar; + fillsize--; + } + + /* emit sign */ + if (signchar && bp < be) *bp++ = signchar; + + /* copy prefix if necessary */ + if (prefix) while (*prefix && bp < be) *bp++ = *prefix++; + + /* add 0s for precision */ + while (preczero > 0 && bp < be) + { + *bp++ = '0'; + preczero--; + } + + /* copy the numeric string to the destination buffer */ + while (p > tmp && bp < be) *bp++ = *--p; + } + } + else + { + /* emit sign */ + if (signchar && bp < be) *bp++ = signchar; + + /* copy prefix if necessary */ + if (prefix) while (*prefix && bp < be) *bp++ = *prefix++; + + /* add 0s for precision */ + while (preczero > 0 && bp < be) + { + *bp++ = '0'; + preczero--; + } + + /* copy the numeric string to the destination buffer */ + while (p > tmp && bp < be) *bp++ = *--p; + } + + if (!(base_and_flags & HAWK_FMT_INTMAX_NONULL)) *bp = '\0'; + return bp - buf; +} diff --git a/hawk/lib/fmt-intmax.c b/hawk/lib/fmt-intmax.c new file mode 100644 index 00000000..55c0a2fa --- /dev/null +++ b/hawk/lib/fmt-intmax.c @@ -0,0 +1,206 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include + +#undef T +#undef char_t +#undef fmt_uintmax +#undef strlen + +#define T(x) HAWK_BT(x) +#define char_t hawk_bch_t +#define fmt_uintmax fmt_unsigned_to_mbs +#define strlen(x) hawk_count_bcs(x) +#include "fmt-intmax.h" + +#undef T +#undef char_t +#undef fmt_uintmax +#undef strlen + +#define T(x) HAWK_UT(x) +#define char_t hawk_uch_t +#define fmt_uintmax fmt_unsigned_to_wcs +#define strlen(x) hawk_count_ucs(x) +#include "fmt-intmax.h" + +/* ==================== multibyte ===================================== */ + +int hawk_fmtintmaxtombs ( + hawk_bch_t* buf, int size, + hawk_intmax_t value, int base_and_flags, int prec, + hawk_bch_t fillchar, const hawk_bch_t* prefix) +{ + hawk_bch_t signchar; + hawk_uintmax_t absvalue; + + if (value < 0) + { + signchar = HAWK_BT('-'); + absvalue = -value; + } + else if (base_and_flags & HAWK_FMTINTMAXTOMBS_PLUSSIGN) + { + signchar = HAWK_BT('+'); + absvalue = value; + } + else if (base_and_flags & HAWK_FMTINTMAXTOMBS_EMPTYSIGN) + { + signchar = HAWK_BT(' '); + absvalue = value; + } + else + { + signchar = HAWK_BT('\0'); + absvalue = value; + } + + return fmt_unsigned_to_mbs(buf, size, absvalue, base_and_flags, prec, fillchar, signchar, prefix); +} + +int hawk_fmtuintmaxtombs ( + hawk_bch_t* buf, int size, + hawk_uintmax_t value, int base_and_flags, int prec, + hawk_bch_t fillchar, const hawk_bch_t* prefix) +{ + hawk_bch_t signchar; + + /* determine if a sign character is needed */ + if (base_and_flags & HAWK_FMTINTMAXTOMBS_PLUSSIGN) + { + signchar = HAWK_BT('+'); + } + else if (base_and_flags & HAWK_FMTINTMAXTOMBS_EMPTYSIGN) + { + signchar = HAWK_BT(' '); + } + else + { + signchar = HAWK_BT('\0'); + } + + return fmt_unsigned_to_mbs(buf, size, value, base_and_flags, prec, fillchar, signchar, prefix); +} + +/* ==================== wide-char ===================================== */ + +int hawk_fmtintmaxtowcs ( + hawk_uch_t* buf, int size, + hawk_intmax_t value, int base_and_flags, int prec, + hawk_uch_t fillchar, const hawk_uch_t* prefix) +{ + hawk_uch_t signchar; + hawk_uintmax_t absvalue; + + if (value < 0) + { + signchar = HAWK_UT('-'); + absvalue = -value; + } + else if (base_and_flags & HAWK_FMTINTMAXTOWCS_PLUSSIGN) + { + signchar = HAWK_UT('+'); + absvalue = value; + } + else if (base_and_flags & HAWK_FMTINTMAXTOMBS_EMPTYSIGN) + { + signchar = HAWK_UT(' '); + absvalue = value; + } + else + { + signchar = HAWK_UT('\0'); + absvalue = value; + } + + return fmt_unsigned_to_wcs(buf, size, absvalue, base_and_flags, prec, fillchar, signchar, prefix); +} + +int hawk_fmtuintmaxtowcs ( + hawk_uch_t* buf, int size, + hawk_uintmax_t value, int base_and_flags, int prec, + hawk_uch_t fillchar, const hawk_uch_t* prefix) +{ + hawk_uch_t signchar; + + /* determine if a sign character is needed */ + if (base_and_flags & HAWK_FMTINTMAXTOWCS_PLUSSIGN) + { + signchar = HAWK_UT('+'); + } + else if (base_and_flags & HAWK_FMTINTMAXTOMBS_EMPTYSIGN) + { + signchar = HAWK_UT(' '); + } + else + { + signchar = HAWK_UT('\0'); + } + + return fmt_unsigned_to_wcs(buf, size, value, base_and_flags, prec, fillchar, signchar, prefix); +} + + +/* ==================== floating-point number =========================== */ + +/* TODO: finish this function */ +int hawk_fmtfltmaxtombs (hawk_bch_t* buf, hawk_oow_t bufsize, hawk_fltmax_t f, hawk_bch_t point, int digits) +{ + hawk_oow_t len; + hawk_uintmax_t v; + + /*if (bufsize <= 0) return -reqlen; TODO: */ + + if (f < 0) + { + f *= -1; + v = (hawk_uintmax_t)f; + len = hawk_fmtuintmaxtombs (buf, bufsize, v, 10, 0, HAWK_BT('\0'), HAWK_BT("-")); + } + else + { + v = (hawk_uintmax_t)f; + len = hawk_fmtuintmaxtombs (buf, bufsize, v, 10, 0, HAWK_BT('\0'), HAWK_NULL); + } + + if (len + 1 < bufsize) + { + buf[len++] = point; /* add decimal point to string */ + buf[len] = HAWK_BT('\0'); + } + + while (len + 1 < bufsize && digits-- > 0) + { + f = (f - (hawk_fltmax_t)v) * 10; + v = (hawk_uintmax_t)f; + len += hawk_fmtuintmaxtombs(&buf[len], bufsize - len, v, 10, 0, HAWK_BT('\0'), HAWK_NULL); + } + + return (int)len; +} + diff --git a/hawk/lib/fmt-intmax.h b/hawk/lib/fmt-intmax.h new file mode 100644 index 00000000..1222e8f6 --- /dev/null +++ b/hawk/lib/fmt-intmax.h @@ -0,0 +1,226 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +static int fmt_uintmax ( + char_t* buf, int size, + hawk_uintmax_t value, int base_and_flags, int prec, + char_t fillchar, char_t signchar, const char_t* prefix) +{ + char_t tmp[(HAWK_SIZEOF(hawk_uintmax_t) * 8)]; + int reslen, base, fillsize, reqlen, pflen, preczero; + char_t* p, * bp, * be; + const char_t* xbasestr; + + base = base_and_flags & 0x3F; + if (base < 2 || base > 36) return -1; + + xbasestr = (base_and_flags & HAWK_FMTINTMAX_UPPERCASE)? + T("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"): + T("0123456789abcdefghijklmnopqrstuvwxyz"); + + if ((base_and_flags & HAWK_FMTINTMAX_NOZERO) && value == 0) + { + p = tmp; + if (base_and_flags & HAWK_FMTINTMAX_ZEROLEAD) + { + /* NOZERO emits no digit, ZEROLEAD emits 1 digit. + * so it emits '0' */ + reslen = 1; + preczero = 1; + } + else + { + /* since the value is zero, emit no digits */ + reslen = 0; + preczero = 0; + } + } + else + { + hawk_uintmax_t v = value; + + /* store the resulting numeric string into 'tmp' first */ + p = tmp; + do + { + *p++ = xbasestr[v % base]; + v /= base; + } + while (v > 0); + + /* reslen is the length of the resulting string without padding. */ + reslen = (int)(p - tmp); + + /* precision specified the minum number of digits to produce. + * so if the precision is larger that the digits produced, + * reslen should be adjusted to precision */ + if (prec > reslen) + { + /* if the precision is greater than the actual digits + * made from the value, 0 is inserted in front. + * ZEROLEAD doesn't have to be handled explicitly + * since it's achieved effortlessly */ + preczero = prec - reslen; + reslen = prec; + } + else + { + preczero = 0; + if ((base_and_flags & HAWK_FMTINTMAX_ZEROLEAD) && value != 0) + { + /* if value is zero, 0 is emitted from it. + * so ZEROLEAD don't need to add another 0. */ + preczero++; + reslen++; + } + } + } + + if (signchar) reslen++; /* increment reslen for the sign character */ + if (prefix) + { + /* since the length can be truncated for different type sizes, + * don't pass in a very long prefix. */ + pflen = (int) strlen(prefix); + reslen += pflen; + } + else pflen = 0; + + /* get the required buffer size for lossless formatting */ + reqlen = (base_and_flags & HAWK_FMTINTMAX_NONULL)? reslen: (reslen + 1); + + if (size <= 0 || + ((base_and_flags & HAWK_FMTINTMAX_NOTRUNC) && size < reqlen)) + { + return -reqlen; + } + + /* get the size to fill with fill characters */ + fillsize = (base_and_flags & HAWK_FMTINTMAX_NONULL)? size: (size - 1); + bp = buf; + be = buf + fillsize; + + /* fill space */ + if (fillchar != T('\0')) + { + if (base_and_flags & HAWK_FMTINTMAX_FILLRIGHT) + { + /* emit sign */ + if (signchar && bp < be) *bp++ = signchar; + + /* copy prefix if necessary */ + if (prefix) while (*prefix && bp < be) *bp++ = *prefix++; + + /* add 0s for precision */ + while (preczero > 0 && bp < be) + { + *bp++ = T('0'); + preczero--; + } + + /* copy the numeric string to the destination buffer */ + while (p > tmp && bp < be) *bp++ = *--p; + + /* fill the right side */ + while (fillsize > reslen) + { + *bp++ = fillchar; + fillsize--; + } + } + else if (base_and_flags & HAWK_FMTINTMAX_FILLCENTER) + { + /* emit sign */ + if (signchar && bp < be) *bp++ = signchar; + + /* fill the left side */ + while (fillsize > reslen) + { + *bp++ = fillchar; + fillsize--; + } + + /* copy prefix if necessary */ + if (prefix) while (*prefix && bp < be) *bp++ = *prefix++; + + /* add 0s for precision */ + while (preczero > 0 && bp < be) + { + *bp++ = T('0'); + preczero--; + } + + /* copy the numeric string to the destination buffer */ + while (p > tmp && bp < be) *bp++ = *--p; + } + else + { + /* fill the left side */ + while (fillsize > reslen) + { + *bp++ = fillchar; + fillsize--; + } + + /* emit sign */ + if (signchar && bp < be) *bp++ = signchar; + + /* copy prefix if necessary */ + if (prefix) while (*prefix && bp < be) *bp++ = *prefix++; + + /* add 0s for precision */ + while (preczero > 0 && bp < be) + { + *bp++ = T('0'); + preczero--; + } + + /* copy the numeric string to the destination buffer */ + while (p > tmp && bp < be) *bp++ = *--p; + } + } + else + { + /* emit sign */ + if (signchar && bp < be) *bp++ = signchar; + + /* copy prefix if necessary */ + if (prefix) while (*prefix && bp < be) *bp++ = *prefix++; + + /* add 0s for precision */ + while (preczero > 0 && bp < be) + { + *bp++ = T('0'); + preczero--; + } + + /* copy the numeric string to the destination buffer */ + while (p > tmp && bp < be) *bp++ = *--p; + } + + if (!(base_and_flags & HAWK_FMTINTMAX_NONULL)) *bp = T('\0'); + return bp - buf; +} diff --git a/hawk/lib/fmt-out.c b/hawk/lib/fmt-out.c new file mode 100644 index 00000000..0bf29a36 --- /dev/null +++ b/hawk/lib/fmt-out.c @@ -0,0 +1,190 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#include +#include +#include +#include "fmt-prv.h" + +#include /* for snrintf(). used for floating-point number formatting */ +#if defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && (__WATCOMC__ < 1200)) +# define snprintf _snprintf +# if !defined(HAVE_SNPRINTF) +# define HAVE_SNPRINTF +# endif +#endif +#if defined(HAVE_QUADMATH_H) +# include /* for quadmath_snprintf() */ +#endif +/* TODO: remove stdio.h and quadmath.h once snprintf gets replaced by own +floting-point conversion implementation*/ + +/* number of bits in a byte */ +#define NBBY 8 + +/* Max number conversion buffer length: + * hawk_intmax_t in base 2, plus NUL byte. */ +#define MAXNBUF (HAWK_SIZEOF(hawk_intmax_t) * NBBY + 1) + +enum +{ + /* integer */ + LF_C = (1 << 0), + LF_H = (1 << 1), + LF_J = (1 << 2), + LF_L = (1 << 3), + LF_Q = (1 << 4), + LF_T = (1 << 5), + LF_Z = (1 << 6), + + LF_I8 = (1 << 7), + LF_I16 = (1 << 8), + LF_I32 = (1 << 9), + LF_I64 = (1 << 10), + LF_I128 = (1 << 11), + + /* long double */ + LF_LD = (1 << 12), + /* __float128 */ + LF_QD = (1 << 13) +}; + +static struct +{ + hawk_uint8_t flag; /* for single occurrence */ + hawk_uint8_t dflag; /* for double occurrence */ +} lm_tab[26] = +{ + { 0, 0 }, /* a */ + { 0, 0 }, /* b */ + { 0, 0 }, /* c */ + { 0, 0 }, /* d */ + { 0, 0 }, /* e */ + { 0, 0 }, /* f */ + { 0, 0 }, /* g */ + { LF_H, LF_C }, /* h */ + { 0, 0 }, /* i */ + { LF_J, 0 }, /* j */ + { 0, 0 }, /* k */ + { LF_L, LF_Q }, /* l */ + { 0, 0 }, /* m */ + { 0, 0 }, /* n */ + { 0, 0 }, /* o */ + { 0, 0 }, /* p */ + { LF_Q, 0 }, /* q */ + { 0, 0 }, /* r */ + { 0, 0 }, /* s */ + { LF_T, 0 }, /* t */ + { 0, 0 }, /* u */ + { 0, 0 }, /* v */ + { 0, 0 }, /* w */ + { 0, 0 }, /* z */ + { 0, 0 }, /* y */ + { LF_Z, 0 }, /* z */ +}; + + +enum +{ + FLAGC_DOT = (1 << 0), + FLAGC_SPACE = (1 << 1), + FLAGC_SHARP = (1 << 2), + FLAGC_SIGN = (1 << 3), + FLAGC_LEFTADJ = (1 << 4), + FLAGC_ZEROPAD = (1 << 5), + FLAGC_WIDTH = (1 << 6), + FLAGC_PRECISION = (1 << 7), + FLAGC_STAR1 = (1 << 8), + FLAGC_STAR2 = (1 << 9), + FLAGC_LENMOD = (1 << 10) /* length modifier */ +}; + +/* ------------------------------------------------------------------ */ + +static const hawk_bch_t* m_hex2ascii = + HAWK_BT("0123456789abcdefghijklmnopqrstuvwxyz"); +static const hawk_uch_t* w_hex2ascii = + HAWK_UT("0123456789abcdefghijklmnopqrstuvwxyz"); + +/* ------------------------------------------------------------------ */ + +#undef char_t +#undef uchar_t +#undef ochar_t +#undef T +#undef OT +#undef CONV_MAX +#undef toupper +#undef hex2ascii +#undef sprintn +#undef fmtout_t +#undef fmtout + +#define char_t hawk_bch_t +#define uchar_t hawk_bch_t +#define ochar_t hawk_uch_t +#define T(x) HAWK_BT(x) +#define OT(x) HAWK_UT(x) +#define CONV_MAX HAWK_MBLEN_MAX +#define toupper HAWK_TOUPPER +#define sprintn m_sprintn +#define fmtout_t hawk_mfmtout_t +#define fmtout hawk_mfmtout + +#define hex2ascii(hex) (m_hex2ascii[hex]) + +#include "fmt-out.h" + +/* ------------------------------------------------------------------ */ + +#undef char_t +#undef uchar_t +#undef ochar_t +#undef T +#undef OT +#undef CONV_MAX +#undef toupper +#undef hex2ascii +#undef sprintn +#undef fmtout_t +#undef fmtout + +#define char_t hawk_uch_t +#define uchar_t hawk_uch_t +#define ochar_t hawk_bch_t +#define T(x) HAWK_UT(x) +#define OT(x) HAWK_BT(x) +#define CONV_MAX 1 +#define toupper HAWK_TOWUPPER +#define sprintn w_sprintn +#define fmtout_t hawk_wfmtout_t +#define fmtout hawk_wfmtout + +#define hex2ascii(hex) (w_hex2ascii[hex]) + +#include "fmt-out.h" + diff --git a/hawk/lib/fmt-out.h b/hawk/lib/fmt-out.h new file mode 100644 index 00000000..88ab8089 --- /dev/null +++ b/hawk/lib/fmt-out.h @@ -0,0 +1,1262 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This file contains a formatted output routine derived from kvprintf() + * of FreeBSD. It has been heavily modified and bug-fixed. + */ + +/* + * Copyright (c) 1986, 1988, 1991, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +/* + * Put a NUL-terminated ASCII number (base <= 36) in a buffer in reverse + * order; return an optional length and a pointer to the last character + * written in the buffer (i.e., the first character of the string). + * The buffer pointed to by `nbuf' must have length >= MAXNBUF. + */ +static char_t* sprintn (char_t* nbuf, hawk_uintmax_t num, int base, int *lenp, int upper) +{ + char_t *p, c; + + p = nbuf; + *p = T('\0'); + do + { + c = hex2ascii(num % base); + *++p = upper ? toupper(c) : c; + } + while (num /= base); + + if (lenp) *lenp = p - nbuf; + return p; +} + +/* NOTE: data output is aborted if the data limit is reached or + * I/O error occurs */ + +#undef PUT_CHAR +#undef PUT_BYTE_IN_HEX + +#define PUT_CHAR(c) do { \ + int xx; \ + if (data->count >= data->limit) goto done; \ + if ((xx = data->put(c, data->ctx)) <= -1) goto oops; \ + if (xx == 0) goto done; \ + data->count++; \ +} while (0) + +#define PUT_BYTE_IN_HEX(byte,extra_flags) do { \ + hawk_bch_t __xbuf[3]; \ + hawk_bytetombs ((byte), __xbuf, HAWK_COUNTOF(__xbuf), (16 | (extra_flags)), '0'); \ + PUT_CHAR(__xbuf[0]); \ + PUT_CHAR(__xbuf[1]); \ +} while (0) + +#define BYTE_PRINTABLE(x) ((x) <= 0x7F && (x) != '\\' && HAWK_ISMPRINT(x)) + +int fmtout (const char_t* fmt, fmtout_t* data, va_list ap) +{ + char_t nbuf[MAXNBUF]; + const char_t* p, * percent; + int n, base, tmp, width, neg, sign, precision, upper; + uchar_t ch; + char_t ach, padc, * sp; + ochar_t oach, * osp; + hawk_oow_t oslen, slen; + hawk_byte_t* bytep; + int lm_flag, lm_dflag, flagc, numlen; + hawk_uintmax_t num = 0; + int stop = 0; + + struct + { + hawk_bch_t sbuf[32]; + hawk_bch_t* ptr; + hawk_oow_t capa; + } fltfmt; + + struct + { + char_t sbuf[96]; + char_t* ptr; + hawk_oow_t capa; + } fltout; + + data->count = 0; + + fltfmt.ptr = fltfmt.sbuf; + fltfmt.capa = HAWK_COUNTOF(fltfmt.sbuf) - 1; + + fltout.ptr = fltout.sbuf; + fltout.capa = HAWK_COUNTOF(fltout.sbuf) - 1; + + while (1) + { + while ((ch = (uchar_t)*fmt++) != T('%') || stop) + { + if (ch == T('\0')) goto done; + PUT_CHAR (ch); + } + percent = fmt - 1; + + padc = T(' '); + width = 0; precision = 0; + neg = 0; sign = 0; upper = 0; + + lm_flag = 0; lm_dflag = 0; flagc = 0; + +reswitch: + switch (ch = (uchar_t)*fmt++) + { + case T('%'): /* %% */ + ach = ch; + goto print_lowercase_c; + break; + + /* flag characters */ + case T('.'): + if (flagc & FLAGC_DOT) goto invalid_format; + flagc |= FLAGC_DOT; + goto reswitch; + + case T('#'): + if (flagc & (FLAGC_WIDTH | FLAGC_DOT | FLAGC_LENMOD)) goto invalid_format; + flagc |= FLAGC_SHARP; + goto reswitch; + + case T(' '): + if (flagc & (FLAGC_WIDTH | FLAGC_DOT | FLAGC_LENMOD)) goto invalid_format; + flagc |= FLAGC_SPACE; + goto reswitch; + + case T('+'): /* place sign for signed conversion */ + if (flagc & (FLAGC_WIDTH | FLAGC_DOT | FLAGC_LENMOD)) goto invalid_format; + flagc |= FLAGC_SIGN; + goto reswitch; + + case T('-'): /* left adjusted */ + if (flagc & (FLAGC_WIDTH | FLAGC_DOT | FLAGC_LENMOD)) goto invalid_format; + if (flagc & FLAGC_DOT) + { + goto invalid_format; + } + else + { + flagc |= FLAGC_LEFTADJ; + if (flagc & FLAGC_ZEROPAD) + { + padc = T(' '); + flagc &= ~FLAGC_ZEROPAD; + } + } + + goto reswitch; + + case T('*'): /* take the length from the parameter */ + if (flagc & FLAGC_DOT) + { + if (flagc & (FLAGC_STAR2 | FLAGC_PRECISION)) goto invalid_format; + flagc |= FLAGC_STAR2; + + precision = va_arg(ap, int); + if (precision < 0) + { + /* if precision is less than 0, + * treat it as if no .precision is specified */ + flagc &= ~FLAGC_DOT; + precision = 0; + } + } + else + { + if (flagc & (FLAGC_STAR1 | FLAGC_WIDTH)) goto invalid_format; + flagc |= FLAGC_STAR1; + + width = va_arg(ap, int); + if (width < 0) + { + /* + if (flagc & FLAGC_LEFTADJ) + flagc &= ~FLAGC_LEFTADJ; + else + */ + flagc |= FLAGC_LEFTADJ; + width = -width; + } + } + goto reswitch; + + case T('0'): /* zero pad */ + if (flagc & FLAGC_LENMOD) goto invalid_format; + if (!(flagc & (FLAGC_DOT | FLAGC_LEFTADJ))) + { + padc = T('0'); + flagc |= FLAGC_ZEROPAD; + goto reswitch; + } + /* end of flags characters */ + + case T('1'): case T('2'): case T('3'): case T('4'): + case T('5'): case T('6'): case T('7'): case T('8'): case T('9'): + if (flagc & FLAGC_LENMOD) goto invalid_format; + for (n = 0;; ++fmt) + { + n = n * 10 + ch - T('0'); + ch = *fmt; + if (ch < T('0') || ch > T('9')) break; + } + if (flagc & FLAGC_DOT) + { + if (flagc & FLAGC_STAR2) goto invalid_format; + precision = n; + flagc |= FLAGC_PRECISION; + } + else + { + if (flagc & FLAGC_STAR1) goto invalid_format; + width = n; + flagc |= FLAGC_WIDTH; + } + goto reswitch; + + /* length modifiers */ + case T('h'): /* short int */ + case T('l'): /* long int */ + case T('q'): /* long long int */ + case T('j'): /* uintmax_t */ + case T('z'): /* size_t */ + case T('t'): /* ptrdiff_t */ + if (lm_flag & (LF_LD | LF_QD)) goto invalid_format; + + flagc |= FLAGC_LENMOD; + if (lm_dflag) + { + /* error */ + goto invalid_format; + } + else if (lm_flag) + { + if (lm_tab[ch - T('a')].dflag && lm_flag == lm_tab[ch - T('a')].flag) + { + lm_flag &= ~lm_tab[ch - T('a')].flag; + lm_flag |= lm_tab[ch - T('a')].dflag; + lm_dflag |= lm_flag; + goto reswitch; + } + else + { + /* error */ + goto invalid_format; + } + } + else + { + lm_flag |= lm_tab[ch - T('a')].flag; + goto reswitch; + } + break; + + case T('L'): /* long double */ + if (flagc & FLAGC_LENMOD) + { + /* conflict with other length modifier */ + goto invalid_format; + } + flagc |= FLAGC_LENMOD; + lm_flag |= LF_LD; + goto reswitch; + + case T('Q'): /* __float128 */ + if (flagc & FLAGC_LENMOD) + { + /* conflict with other length modifier */ + goto invalid_format; + } + flagc |= FLAGC_LENMOD; + lm_flag |= LF_QD; + goto reswitch; + + case T('I'): + { + int save_lm_flag = lm_flag; + if (fmt[0] == T('8')) + { + lm_flag |= LF_I8; + fmt += 1; + } + else if (fmt[0] == T('1') && fmt[1] == T('6')) + { + lm_flag |= LF_I16; + fmt += 2; + } + #if defined(HAWK_HAVE_INT128_T) + else if (fmt[0] == T('1') && fmt[1] == T('2') && fmt[2] == T('8')) + { + lm_flag |= LF_I128; + fmt += 3; + } + #endif + else if (fmt[0] == T('3') && fmt[1] == T('2')) + { + lm_flag |= LF_I32; + fmt += 2; + } + #if defined(HAWK_HAVE_INT64_T) + else if (fmt[0] == T('6') && fmt[1] == T('4')) + { + lm_flag |= LF_I64; + fmt += 2; + } + #endif + else + { + goto invalid_format; + } + + if (flagc & FLAGC_LENMOD) + { + /* conflict with other length modifier */ + lm_flag = save_lm_flag; + goto invalid_format; + } + flagc |= FLAGC_LENMOD; + goto reswitch; + } + + /* end of length modifiers */ + + case T('n'): + if (lm_flag & LF_J) /* j */ + *(va_arg(ap, hawk_intmax_t*)) = data->count; + else if (lm_flag & LF_Z) /* z */ + *(va_arg(ap, hawk_oow_t*)) = data->count; + #if (HAWK_SIZEOF_LONG_LONG > 0) + else if (lm_flag & LF_Q) /* ll */ + *(va_arg(ap, long long int*)) = data->count; + #endif + else if (lm_flag & LF_L) /* l */ + *(va_arg(ap, long int*)) = data->count; + else if (lm_flag & LF_H) /* h */ + *(va_arg(ap, short int*)) = data->count; + else if (lm_flag & LF_C) /* hh */ + *(va_arg(ap, char*)) = data->count; + else if (flagc & FLAGC_LENMOD) + goto oops; + else + *(va_arg(ap, int*)) = data->count; + break; + + + /* signed integer conversions */ + case T('d'): + case T('i'): /* signed conversion */ + base = 10; + sign = 1; + goto handle_sign; + /* end of signed integer conversions */ + + /* unsigned integer conversions */ + case T('o'): + base = 8; + goto handle_nosign; + case T('u'): + base = 10; + goto handle_nosign; + case T('X'): + upper = 1; + case T('x'): + base = 16; + goto handle_nosign; + case T('b'): + base = 2; + goto handle_nosign; + /* end of unsigned integer conversions */ + + case T('p'): /* pointer */ + base = 16; + + if (width == 0) flagc |= FLAGC_SHARP; + else flagc &= ~FLAGC_SHARP; + + num = (hawk_uintptr_t)va_arg(ap, void*); + goto number; + + case T('c'): + /* zeropad must not take effect for 'c' */ + if (flagc & FLAGC_ZEROPAD) padc = T(' '); + if (((lm_flag & LF_H) && (HAWK_SIZEOF(char_t) > HAWK_SIZEOF(ochar_t))) || + ((lm_flag & LF_L) && (HAWK_SIZEOF(char_t) < HAWK_SIZEOF(ochar_t)))) goto uppercase_c; + lowercase_c: + ach = HAWK_SIZEOF(char_t) < HAWK_SIZEOF(int)? va_arg(ap, int): va_arg(ap, char_t); + + print_lowercase_c: + /* precision 0 doesn't kill the letter */ + width--; + if (!(flagc & FLAGC_LEFTADJ) && width > 0) + { + while (width--) PUT_CHAR (padc); + } + PUT_CHAR (ach); + if ((flagc & FLAGC_LEFTADJ) && width > 0) + { + while (width--) PUT_CHAR (padc); + } + break; + + case T('C'): + /* zeropad must not take effect for 'C' */ + if (flagc & FLAGC_ZEROPAD) padc = T(' '); + if (((lm_flag & LF_H) && (HAWK_SIZEOF(char_t) < HAWK_SIZEOF(ochar_t))) || + ((lm_flag & LF_L) && (HAWK_SIZEOF(char_t) > HAWK_SIZEOF(ochar_t)))) goto lowercase_c; + uppercase_c: + oach = HAWK_SIZEOF(ochar_t) < HAWK_SIZEOF(int)? va_arg(ap, int): va_arg(ap, ochar_t); + + oslen = 1; + if (data->conv (&oach, &oslen, HAWK_NULL, &slen, data->ctx) <= -1) + { + /* conversion error */ + goto oops; + } + + /* precision 0 doesn't kill the letter */ + width -= slen; + if (!(flagc & FLAGC_LEFTADJ) && width > 0) + { + while (width--) PUT_CHAR (padc); + } + + { + char_t conv_buf[CONV_MAX]; + hawk_oow_t i, conv_len; + + oslen = 1; + conv_len = HAWK_COUNTOF(conv_buf); + + /* this must not fail since the dry-run above was successful */ + data->conv (&oach, &oslen, conv_buf, &conv_len, data->ctx); + + for (i = 0; i < conv_len; i++) + { + PUT_CHAR (conv_buf[i]); + } + } + + if ((flagc & FLAGC_LEFTADJ) && width > 0) + { + while (width--) PUT_CHAR (padc); + } + break; + + case T('s'): + /* zeropad must not take effect for 's' */ + if (flagc & FLAGC_ZEROPAD) padc = T(' '); + if (((lm_flag & LF_H) && (HAWK_SIZEOF(char_t) > HAWK_SIZEOF(ochar_t))) || + ((lm_flag & LF_L) && (HAWK_SIZEOF(char_t) < HAWK_SIZEOF(ochar_t)))) goto uppercase_s; + lowercase_s: + sp = va_arg (ap, char_t*); + if (sp == HAWK_NULL) p = T("(null)"); + + print_lowercase_s: + if (flagc & FLAGC_DOT) + { + for (n = 0; n < precision && sp[n]; n++); + } + else + { + for (n = 0; sp[n]; n++); + } + + width -= n; + + if (!(flagc & FLAGC_LEFTADJ) && width > 0) + { + while (width--) PUT_CHAR(padc); + } + while (n--) PUT_CHAR(*sp++); + if ((flagc & FLAGC_LEFTADJ) && width > 0) + { + while (width--) PUT_CHAR(padc); + } + break; + + case T('S'): + /* zeropad must not take effect for 'S' */ + if (flagc & FLAGC_ZEROPAD) padc = T(' '); + if (((lm_flag & LF_H) && (HAWK_SIZEOF(char_t) < HAWK_SIZEOF(ochar_t))) || + ((lm_flag & LF_L) && (HAWK_SIZEOF(char_t) > HAWK_SIZEOF(ochar_t)))) goto lowercase_s; + uppercase_s: + + osp = va_arg (ap, ochar_t*); + if (osp == HAWK_NULL) osp = OT("(null)"); + + /* get the length */ + for (oslen = 0; osp[oslen]; oslen++); + + if (data->conv(osp, &oslen, HAWK_NULL, &slen, data->ctx) <= -1) + { + /* conversion error */ + goto oops; + } + + /* slen hold the length after conversion */ + n = slen; + if ((flagc & FLAGC_DOT) && precision < slen) n = precision; + width -= n; + + if (!(flagc & FLAGC_LEFTADJ) && width > 0) + { + while (width--) PUT_CHAR (padc); + } + + { + char_t conv_buf[CONV_MAX]; + hawk_oow_t i, conv_len, src_len, tot_len = 0; + while (n > 0) + { + HAWK_ASSERT (oslen > tot_len); + + #if CONV_MAX == 1 + src_len = oslen - tot_len; + #else + src_len = 1; + #endif + conv_len = HAWK_COUNTOF(conv_buf); + + /* this must not fail since the dry-run above was successful */ + data->conv (&osp[tot_len], &src_len, conv_buf, &conv_len, data->ctx); + + tot_len += src_len; + + /* stop outputting if a converted character can't be printed + * in its entirety (limited by precision). but this is not an error */ + if (n < conv_len) break; + + for (i = 0; i < conv_len; i++) + { + PUT_CHAR (conv_buf[i]); + } + + n -= conv_len; + } + } + + if ((flagc & FLAGC_LEFTADJ) && width > 0) + { + while (width--) PUT_CHAR (padc); + } + break; + + case T('k'): + case T('K'): + { + int k_hex_width; + /* zeropad must not take effect for 's'. + * 'h' & 'l' is not used to differentiate hawk_bch_t and hawk_uch_t + * because 'k' means hawk_byte_t. + * 'l', results in uppercase hexadecimal letters. + * 'h' drops the leading \x in the output + * -------------------------------------------------------- + * hk -> \x + non-printable in lowercase hex + * k -> all in lowercase hex + * lk -> \x + all in lowercase hex + * -------------------------------------------------------- + * hK -> \x + non-printable in uppercase hex + * K -> all in uppercase hex + * lK -> \x + all in uppercase hex + * -------------------------------------------------------- + * with 'k' or 'K', i don't substitute "(null)" for the NULL pointer + */ + if (flagc & FLAGC_ZEROPAD) padc = T(' '); + + bytep = va_arg(ap, hawk_byte_t*); + k_hex_width = (lm_flag & (LF_H | LF_L))? 4: 2; + + if (lm_flag & LF_H) + { + /* to print non-printables in hex. i don't use ismprint() to avoid escaping a backslash itself. */ + if (flagc & FLAGC_DOT) + { + /* if precision is specifed, it doesn't stop at the value of zero unlike 's' or 'S' */ + for (n = 0; n < precision; n++) width -= BYTE_PRINTABLE(bytep[n])? 1: k_hex_width; + } + else + { + for (n = 0; bytep[n]; n++) width -= BYTE_PRINTABLE(bytep[n])? 1: k_hex_width; + } + } + else + { + /* to print all in hex */ + if (flagc & FLAGC_DOT) + { + /* if precision is specifed, it doesn't stop at the value of zero unlike 's' or 'S' */ + for (n = 0; n < precision; n++) /* nothing */; + } + else + { + for (n = 0; bytep[n]; n++) /* nothing */; + } + width -= (n * k_hex_width); + } + + if (!(flagc & FLAGC_LEFTADJ) && width > 0) + { + while (width--) PUT_CHAR(padc); + } + + while (n--) + { + if ((lm_flag & LF_H) && BYTE_PRINTABLE(*bytep)) + { + PUT_CHAR(*bytep); + } + else + { + hawk_bch_t xbuf[3]; + hawk_bytetombs (*bytep, xbuf, HAWK_COUNTOF(xbuf), (16 | (ch == T('k')? HAWK_BYTETOSTR_LOWERCASE: 0)), HAWK_BT('0')); + if (lm_flag & (LF_H | LF_L)) + { + PUT_CHAR('\\'); + PUT_CHAR('x'); + } + PUT_CHAR(xbuf[0]); + PUT_CHAR(xbuf[1]); + } + bytep++; + } + + if ((flagc & FLAGC_LEFTADJ) && width > 0) + { + while (width--) PUT_CHAR(padc); + } + break; + } + + case T('w'): + case T('W'): + { + /* unicode string in unicode escape sequence. + * + * hw -> \uXXXX, \UXXXXXXXX, printable-byte(only in ascii range) + * w -> \uXXXX, \UXXXXXXXX + * lw -> all in \UXXXXXXXX + */ + const hawk_uch_t* usp; + hawk_oow_t uwid; + + if (flagc & FLAGC_ZEROPAD) padc = T(' '); + usp = va_arg(ap, hawk_uch_t*); + + if (flagc & FLAGC_DOT) + { + /* if precision is specifed, it doesn't stop at the value of zero unlike 's' or 'S' */ + for (n = 0; n < precision; n++) + { + if ((lm_flag & LF_H) && BYTE_PRINTABLE(usp[n])) uwid = 1; + else if (!(lm_flag & LF_L) && usp[n] <= 0xFFFF) uwid = 6; + else uwid = 10; + width -= uwid; + } + } + else + { + for (n = 0; usp[n]; n++) + { + if ((lm_flag & LF_H) && BYTE_PRINTABLE(usp[n])) uwid = 1; + else if (!(lm_flag & LF_L) && usp[n] <= 0xFFFF) uwid = 6; + else uwid = 10; + width -= uwid; + } + } + + if (!(flagc & FLAGC_LEFTADJ) && width > 0) + { + while (width--) PUT_CHAR(padc); + } + + while (n--) + { + if ((lm_flag & LF_H) && BYTE_PRINTABLE(*usp)) + { + PUT_CHAR(*usp); + } + else if (!(lm_flag & LF_L) && *usp <= 0xFFFF) + { + hawk_uint16_t u16 = *usp; + int extra_flags = ((ch) == 'w'? HAWK_BYTETOSTR_LOWERCASE: 0); + PUT_CHAR('\\'); + PUT_CHAR('u'); + PUT_BYTE_IN_HEX((u16 >> 8) & 0xFF, extra_flags); + PUT_BYTE_IN_HEX(u16 & 0xFF, extra_flags); + } + else + { + hawk_uint32_t u32 = *usp; + int extra_flags = ((ch) == 'w'? HAWK_BYTETOSTR_LOWERCASE: 0); + PUT_CHAR('\\'); + PUT_CHAR('U'); + PUT_BYTE_IN_HEX((u32 >> 24) & 0xFF, extra_flags); + PUT_BYTE_IN_HEX((u32 >> 16) & 0xFF, extra_flags); + PUT_BYTE_IN_HEX((u32 >> 8) & 0xFF, extra_flags); + PUT_BYTE_IN_HEX(u32 & 0xFF, extra_flags); + } + usp++; + } + + if ((flagc & FLAGC_LEFTADJ) && width > 0) + { + while (width--) PUT_CHAR(padc); + } + break; + } + + case T('e'): + case T('E'): + case T('f'): + case T('F'): + case T('g'): + case T('G'): + /* + case T('a'): + case T('A'): + */ + { + /* let me rely on snprintf until i implement float-point to string conversion */ + int q; + hawk_oow_t fmtlen; + #if (HAWK_SIZEOF___FLOAT128 > 0) && defined(HAVE_QUADMATH_SNPRINTF) + __float128 v_qd; + #endif + long double v_ld; + double v_d; + int dtype = 0; + hawk_oow_t newcapa; + + if (lm_flag & LF_J) + { + #if (HAWK_SIZEOF___FLOAT128 > 0) && defined(HAVE_QUADMATH_SNPRINTF) && (HAWK_SIZEOF_FLTMAX_T == HAWK_SIZEOF___FLOAT128) + v_qd = va_arg (ap, hawk_fltmax_t); + dtype = LF_QD; + #elif HAWK_SIZEOF_FLTMAX_T == HAWK_SIZEOF_DOUBLE + v_d = va_arg (ap, hawk_fltmax_t); + #elif HAWK_SIZEOF_FLTMAX_T == HAWK_SIZEOF_LONG_DOUBLE + v_ld = va_arg (ap, hawk_fltmax_t); + dtype = LF_LD; + #else + #error Unsupported hawk_flt_t + #endif + } + else if (lm_flag & LF_Z) + { + /* hawk_flt_t is limited to double or long double */ + + /* precedence goes to double if sizeof(double) == sizeof(long double) + * for example, %Lf didn't work on some old platforms. + * so i prefer the format specifier with no modifier. + */ + #if HAWK_SIZEOF_FLT_T == HAWK_SIZEOF_DOUBLE + v_d = va_arg (ap, hawk_flt_t); + #elif HAWK_SIZEOF_FLT_T == HAWK_SIZEOF_LONG_DOUBLE + v_ld = va_arg (ap, hawk_flt_t); + dtype = LF_LD; + #else + #error Unsupported hawk_flt_t + #endif + } + else if (lm_flag & (LF_LD | LF_L)) + { + v_ld = va_arg (ap, long double); + dtype = LF_LD; + } + #if (HAWK_SIZEOF___FLOAT128 > 0) && defined(HAVE_QUADMATH_SNPRINTF) + else if (lm_flag & (LF_QD | LF_Q)) + { + v_qd = va_arg(ap, __float128); + dtype = LF_QD; + } + #endif + else if (flagc & FLAGC_LENMOD) + { + goto oops; + } + else + { + v_d = va_arg (ap, double); + } + + fmtlen = fmt - percent; + if (fmtlen > fltfmt.capa) + { + if (fltfmt.ptr == fltfmt.sbuf) + { + fltfmt.ptr = HAWK_MMGR_ALLOC (HAWK_MMGR_GETDFL(), HAWK_SIZEOF(*fltfmt.ptr) * (fmtlen + 1)); + if (fltfmt.ptr == HAWK_NULL) goto oops; + } + else + { + hawk_bch_t* tmpptr; + + tmpptr = HAWK_MMGR_REALLOC (HAWK_MMGR_GETDFL(), fltfmt.ptr, HAWK_SIZEOF(*fltfmt.ptr) * (fmtlen + 1)); + if (tmpptr == HAWK_NULL) goto oops; + fltfmt.ptr = tmpptr; + } + + fltfmt.capa = fmtlen; + } + + /* compose back the format specifier */ + fmtlen = 0; + fltfmt.ptr[fmtlen++] = HAWK_BT('%'); + if (flagc & FLAGC_SPACE) fltfmt.ptr[fmtlen++] = HAWK_BT(' '); + if (flagc & FLAGC_SHARP) fltfmt.ptr[fmtlen++] = HAWK_BT('#'); + if (flagc & FLAGC_SIGN) fltfmt.ptr[fmtlen++] = HAWK_BT('+'); + if (flagc & FLAGC_LEFTADJ) fltfmt.ptr[fmtlen++] = HAWK_BT('-'); + if (flagc & FLAGC_ZEROPAD) fltfmt.ptr[fmtlen++] = HAWK_BT('0'); + + if (flagc & FLAGC_STAR1) fltfmt.ptr[fmtlen++] = HAWK_BT('*'); + else if (flagc & FLAGC_WIDTH) + { + fmtlen += hawk_fmtuintmaxtombs ( + &fltfmt.ptr[fmtlen], fltfmt.capa - fmtlen, + width, 10, -1, HAWK_BT('\0'), HAWK_NULL); + } + if (flagc & FLAGC_DOT) fltfmt.ptr[fmtlen++] = HAWK_BT('.'); + if (flagc & FLAGC_STAR2) fltfmt.ptr[fmtlen++] = HAWK_BT('*'); + else if (flagc & FLAGC_PRECISION) + { + fmtlen += hawk_fmtuintmaxtombs ( + &fltfmt.ptr[fmtlen], fltfmt.capa - fmtlen, + precision, 10, -1, HAWK_BT('\0'), HAWK_NULL); + } + + if (dtype == LF_LD) + fltfmt.ptr[fmtlen++] = HAWK_BT('L'); + #if (HAWK_SIZEOF___FLOAT128 > 0) + else if (dtype == LF_QD) + fltfmt.ptr[fmtlen++] = HAWK_BT('Q'); + #endif + + fltfmt.ptr[fmtlen++] = ch; + fltfmt.ptr[fmtlen] = HAWK_BT('\0'); + + #if defined(HAVE_SNPRINTF) + /* nothing special here */ + #else + /* best effort to avoid buffer overflow when no snprintf is available. + * i really can't do much if it happens. */ + newcapa = precision + width + 32; + if (fltout.capa < newcapa) + { + HAWK_ASSERT (fltout.ptr == fltout.sbuf); + + fltout.ptr = HAWK_MMGR_ALLOC (HAWK_MMGR_GETDFL(), HAWK_SIZEOF(char_t) * (newcapa + 1)); + if (fltout.ptr == HAWK_NULL) goto oops; + fltout.capa = newcapa; + } + #endif + + while (1) + { + + if (dtype == LF_LD) + { + #if defined(HAVE_SNPRINTF) + q = snprintf ((hawk_bch_t*)fltout.ptr, fltout.capa + 1, fltfmt.ptr, v_ld); + #else + q = sprintf ((hawk_bch_t*)fltout.ptr, fltfmt.ptr, v_ld); + #endif + } + #if (HAWK_SIZEOF___FLOAT128 > 0) && defined(HAVE_QUADMATH_SNPRINTF) + else if (dtype == LF_QD) + { + q = quadmath_snprintf ((hawk_bch_t*)fltout.ptr, fltout.capa + 1, fltfmt.ptr, v_qd); + } + #endif + else + { + #if defined(HAVE_SNPRINTF) + q = snprintf ((hawk_bch_t*)fltout.ptr, fltout.capa + 1, fltfmt.ptr, v_d); + #else + q = sprintf ((hawk_bch_t*)fltout.ptr, fltfmt.ptr, v_d); + #endif + } + if (q <= -1) goto oops; + if (q <= fltout.capa) break; + + newcapa = fltout.capa * 2; + if (newcapa < q) newcapa = q; + + if (fltout.ptr == fltout.sbuf) + { + fltout.ptr = HAWK_MMGR_ALLOC (HAWK_MMGR_GETDFL(), HAWK_SIZEOF(char_t) * (newcapa + 1)); + if (fltout.ptr == HAWK_NULL) goto oops; + } + else + { + char_t* tmpptr; + + tmpptr = HAWK_MMGR_REALLOC (HAWK_MMGR_GETDFL(), fltout.ptr, HAWK_SIZEOF(char_t) * (newcapa + 1)); + if (tmpptr == HAWK_NULL) goto oops; + fltout.ptr = tmpptr; + } + fltout.capa = newcapa; + } + + if (HAWK_SIZEOF(char_t) != HAWK_SIZEOF(hawk_bch_t)) + { + fltout.ptr[q] = T('\0'); + while (q > 0) + { + q--; + fltout.ptr[q] = ((hawk_bch_t*)fltout.ptr)[q]; + } + } + + sp = fltout.ptr; + flagc &= ~FLAGC_DOT; + width = 0; + precision = 0; + goto print_lowercase_s; + } + + handle_nosign: + sign = 0; + if (lm_flag & LF_J) + { + #if defined(__GNUC__) && \ + (HAWK_SIZEOF_UINTMAX_T > HAWK_SIZEOF_SIZE_T) && \ + (HAWK_SIZEOF_UINTMAX_T != HAWK_SIZEOF_LONG_LONG) && \ + (HAWK_SIZEOF_UINTMAX_T != HAWK_SIZEOF_LONG) + /* GCC-compiled binaries crashed when getting hawk_uintmax_t with va_arg. + * This is just a work-around for it */ + int i; + for (i = 0, num = 0; i < HAWK_SIZEOF(hawk_uintmax_t) / HAWK_SIZEOF(hawk_oow_t); i++) + { + #if defined(HAWK_ENDIAN_BIG) + num = num << (8 * HAWK_SIZEOF(hawk_oow_t)) | (va_arg (ap, hawk_oow_t)); + #else + register int shift = i * HAWK_SIZEOF(hawk_oow_t); + hawk_oow_t x = va_arg (ap, hawk_oow_t); + num |= (hawk_uintmax_t)x << (shift * 8); + #endif + } + #else + num = va_arg (ap, hawk_uintmax_t); + #endif + } + else if (lm_flag & LF_T) + num = va_arg (ap, hawk_ptrdiff_t); + else if (lm_flag & LF_Z) + num = va_arg (ap, hawk_oow_t); + #if (HAWK_SIZEOF_LONG_LONG > 0) + else if (lm_flag & LF_Q) + num = va_arg (ap, unsigned long long int); + #endif + else if (lm_flag & (LF_L | LF_LD)) + num = va_arg (ap, unsigned long int); + else if (lm_flag & LF_H) + num = (unsigned short int)va_arg (ap, int); + else if (lm_flag & LF_C) + num = (unsigned char)va_arg (ap, int); + + else if (lm_flag & LF_I8) + { + #if (HAWK_SIZEOF_UINT8_T < HAWK_SIZEOF_INT) + num = (hawk_uint8_t)va_arg (ap, unsigned int); + #else + num = va_arg (ap, hawk_uint8_t); + #endif + } + else if (lm_flag & LF_I16) + { + #if (HAWK_SIZEOF_UINT16_T < HAWK_SIZEOF_INT) + num = (hawk_uint16_t)va_arg (ap, unsigned int); + #else + num = va_arg (ap, hawk_uint16_t); + #endif + } + else if (lm_flag & LF_I32) + { + #if (HAWK_SIZEOF_UINT32_T < HAWK_SIZEOF_INT) + num = (hawk_uint32_t)va_arg (ap, unsigned int); + #else + num = va_arg (ap, hawk_uint32_t); + #endif + } + #if defined(HAWK_HAVE_UINT64_T) + else if (lm_flag & LF_I64) + { + #if (HAWK_SIZEOF_UINT64_T < HAWK_SIZEOF_INT) + num = (hawk_uint64_t)va_arg (ap, unsigned int); + #else + num = va_arg (ap, hawk_uint64_t); + #endif + } + #endif + #if defined(HAWK_HAVE_UINT128_T) + else if (lm_flag & LF_I128) + { + #if (HAWK_SIZEOF_UINT128_T < HAWK_SIZEOF_INT) + num = (hawk_uint128_t)va_arg (ap, unsigned int); + #else + num = va_arg (ap, hawk_uint128_t); + #endif + } + #endif + else + { + num = va_arg (ap, unsigned int); + } + goto number; + +handle_sign: + if (lm_flag & LF_J) + { + #if defined(__GNUC__) && \ + (HAWK_SIZEOF_INTMAX_T > HAWK_SIZEOF_SIZE_T) && \ + (HAWK_SIZEOF_UINTMAX_T != HAWK_SIZEOF_LONG_LONG) && \ + (HAWK_SIZEOF_UINTMAX_T != HAWK_SIZEOF_LONG) + /* GCC-compiled binraries crashed when getting hawk_uintmax_t with va_arg. + * This is just a work-around for it */ + int i; + for (i = 0, num = 0; i < HAWK_SIZEOF(hawk_intmax_t) / HAWK_SIZEOF(hawk_oow_t); i++) + { + #if defined(HAWK_ENDIAN_BIG) + num = num << (8 * HAWK_SIZEOF(hawk_oow_t)) | (va_arg (ap, hawk_oow_t)); + #else + register int shift = i * HAWK_SIZEOF(hawk_oow_t); + hawk_oow_t x = va_arg (ap, hawk_oow_t); + num |= (hawk_uintmax_t)x << (shift * 8); + #endif + } + #else + num = va_arg (ap, hawk_intmax_t); + #endif + } + + else if (lm_flag & LF_T) + num = va_arg(ap, hawk_ptrdiff_t); + else if (lm_flag & LF_Z) + num = va_arg (ap, hawk_ssize_t); + #if (HAWK_SIZEOF_LONG_LONG > 0) + else if (lm_flag & LF_Q) + num = va_arg (ap, long long int); + #endif + else if (lm_flag & (LF_L | LF_LD)) + num = va_arg (ap, long int); + else if (lm_flag & LF_H) + num = (short int)va_arg (ap, int); + else if (lm_flag & LF_C) + num = (char)va_arg (ap, int); + + else if (lm_flag & LF_I8) + { + #if (HAWK_SIZEOF_INT8_T < HAWK_SIZEOF_INT) + num = (hawk_int8_t)va_arg (ap, int); + #else + num = va_arg (ap, hawk_int8_t); + #endif + } + else if (lm_flag & LF_I16) + { + #if (HAWK_SIZEOF_INT16_T < HAWK_SIZEOF_INT) + num = (hawk_int16_t)va_arg (ap, int); + #else + num = va_arg (ap, hawk_int16_t); + #endif + } + else if (lm_flag & LF_I32) + { + #if (HAWK_SIZEOF_INT32_T < HAWK_SIZEOF_INT) + num = (hawk_int32_t)va_arg (ap, int); + #else + num = va_arg (ap, hawk_int32_t); + #endif + } + #if defined(HAWK_HAVE_INT64_T) + else if (lm_flag & LF_I64) + { + #if (HAWK_SIZEOF_INT64_T < HAWK_SIZEOF_INT) + num = (hawk_int64_t)va_arg (ap, int); + #else + num = va_arg (ap, hawk_int64_t); + #endif + } + #endif + #if defined(HAWK_HAVE_INT128_T) + else if (lm_flag & LF_I128) + { + #if (HAWK_SIZEOF_INT128_T < HAWK_SIZEOF_INT) + num = (hawk_int128_t)va_arg (ap, int); + #else + num = va_arg (ap, hawk_int128_t); + #endif + } + #endif + else + { + num = va_arg (ap, int); + } + +number: + if (sign && (hawk_intmax_t)num < 0) + { + neg = 1; + num = -(hawk_intmax_t)num; + } + p = sprintn (nbuf, num, base, &tmp, upper); + if ((flagc & FLAGC_SHARP) && num != 0) + { + if (base == 8) tmp++; + else if (base == 16) tmp += 2; + } + if (neg) tmp++; + else if (flagc & FLAGC_SIGN) tmp++; + else if (flagc & FLAGC_SPACE) tmp++; + + numlen = p - nbuf; + if ((flagc & FLAGC_DOT) && precision > numlen) + { + /* extra zeros fro precision specified */ + tmp += (precision - numlen); + } + + if (!(flagc & FLAGC_LEFTADJ) && !(flagc & FLAGC_ZEROPAD) && width > 0 && (width -= tmp) > 0) + { + while (width--) PUT_CHAR(padc); + } + + if (neg) PUT_CHAR(T('-')); + else if (flagc & FLAGC_SIGN) PUT_CHAR(T('+')); + else if (flagc & FLAGC_SPACE) PUT_CHAR(T(' ')); + + if ((flagc & FLAGC_SHARP) && num != 0) + { + if (base == 2) + { + PUT_CHAR(T('0')); + PUT_CHAR(T('b')); + } + else if (base == 8) + { + PUT_CHAR(T('0')); + } + else if (base == 16) + { + PUT_CHAR(T('0')); + PUT_CHAR(T('x')); + } + } + + if ((flagc & FLAGC_DOT) && precision > numlen) + { + /* extra zeros for precision specified */ + while (numlen < precision) + { + PUT_CHAR (T('0')); + numlen++; + } + } + + if (!(flagc & FLAGC_LEFTADJ) && width > 0 && (width -= tmp) > 0) + { + while (width-- > 0) PUT_CHAR (padc); + } + + while (*p) PUT_CHAR(*p--); /* output actual digits */ + + if ((flagc & FLAGC_LEFTADJ) && width > 0 && (width -= tmp) > 0) + { + while (width-- > 0) PUT_CHAR (padc); + } + break; + +invalid_format: + while (percent < fmt) PUT_CHAR(*percent++); + break; + + default: + while (percent < fmt) PUT_CHAR(*percent++); + /* + * Since we ignore an formatting argument it is no + * longer safe to obey the remaining formatting + * arguments as the arguments will no longer match + * the format specs. + */ + stop = 1; + break; + } + } + +done: + if (fltfmt.ptr != fltfmt.sbuf) + HAWK_MMGR_FREE (HAWK_MMGR_GETDFL(), fltfmt.ptr); + if (fltout.ptr != fltout.sbuf) + HAWK_MMGR_FREE (HAWK_MMGR_GETDFL(), fltout.ptr); + return 0; + +oops: + if (fltfmt.ptr != fltfmt.sbuf) + HAWK_MMGR_FREE (HAWK_MMGR_GETDFL(), fltfmt.ptr); + if (fltout.ptr != fltout.sbuf) + HAWK_MMGR_FREE (HAWK_MMGR_GETDFL(), fltout.ptr); + return (hawk_ssize_t)-1; +} +#undef PUT_CHAR + diff --git a/hawk/lib/fmt-prv.h b/hawk/lib/fmt-prv.h new file mode 100644 index 00000000..eeddbd24 --- /dev/null +++ b/hawk/lib/fmt-prv.h @@ -0,0 +1,113 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_FMT_PRV_H_ +#define _HAWK_FMT_PRV_H_ + +#include +#include + +typedef int (*hawk_mfmtout_put_t) ( + hawk_bch_t c, + void* ctx +); + +/* convert a wide string to a multi-byte string */ +typedef int (*hawk_mfmtout_conv_t) ( + const hawk_uch_t* wcs, + hawk_oow_t* wcslen, + hawk_bch_t* mbs, + hawk_oow_t* mbslen, + void* ctx +); + +struct hawk_mfmtout_t +{ + hawk_oow_t count; /* out */ + hawk_oow_t limit; /* in */ + void* ctx; /* in */ + hawk_mfmtout_put_t put; /* in */ + hawk_mfmtout_conv_t conv; /* in */ +}; + +typedef struct hawk_mfmtout_t hawk_mfmtout_t; + +typedef int (*hawk_wfmtout_put_t) ( + hawk_uch_t c, + void* ctx +); + +/* convert a multi-byte string to a wide string */ +typedef int (*hawk_wfmtout_conv_t) ( + const hawk_bch_t* mbs, + hawk_oow_t* mbslen, + hawk_uch_t* wcs, + hawk_oow_t* wcslen, + void* ctx +); + +struct hawk_wfmtout_t +{ + hawk_oow_t count; /* out */ + hawk_oow_t limit; /* in */ + void* ctx; /* in */ + hawk_wfmtout_put_t put; /* in */ + hawk_wfmtout_conv_t conv; /* in */ +}; + + +typedef struct hawk_wfmtout_t hawk_wfmtout_t; + +#if defined(__cplusplus) +extern "C" { +#endif + +/* HAWK_EXPORTed, but keep in it the private header for used by other libraries in HAWK */ +HAWK_EXPORT int hawk_mfmtout ( + const hawk_bch_t* fmt, + hawk_mfmtout_t* data, + va_list ap +); + +HAWK_EXPORT int hawk_wfmtout ( + const hawk_uch_t* fmt, + hawk_wfmtout_t* data, + va_list ap +); + +#if defined(HAWK_OOCH_IS_BCH) +# define hawk_fmtout_t hawk_mfmtout_t +# define hawk_fmtout(fmt,fo,ap) hawk_mfmtout(fmt,fo,ap) +#else +# define hawk_fmtout_t hawk_wfmtout_t +# define hawk_fmtout(fmt,fo,ap) hawk_wfmtout(fmt,fo,ap) +#endif + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/hawk/lib/fmt.c b/hawk/lib/fmt.c new file mode 100644 index 00000000..4fb1b84c --- /dev/null +++ b/hawk/lib/fmt.c @@ -0,0 +1,1843 @@ +/* + * $Id$ + * + Copyright (c) 2014-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This file contains a formatted output routine derived from kvprintf() + * of FreeBSD. It has been heavily modified and bug-fixed. + */ + +/* + * Copyright (c) 1986, 1988, 1991, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + + +#include +#include "hawk-prv.h" + +#include /* for snrintf(). used for floating-point number formatting */ +#if defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && (__WATCOMC__ < 1200)) +# define snprintf _snprintf +# if !defined(HAVE_SNPRINTF) +# define HAVE_SNPRINTF +# endif +#endif +#if defined(HAVE_QUADMATH_H) +# include /* for quadmath_snprintf() */ +#endif + +/* Max number conversion buffer length: + * hawk_intmax_t in base 2, plus NUL byte. */ +#define MAXNBUF (HAWK_SIZEOF(hawk_intmax_t) * HAWK_BITS_PER_BYTE + 1) + +enum +{ + /* integer */ + LF_C = (1 << 0), + LF_H = (1 << 1), + LF_J = (1 << 2), + LF_L = (1 << 3), + LF_Q = (1 << 4), + LF_T = (1 << 5), + LF_Z = (1 << 6), + + /* long double */ + LF_LD = (1 << 7), + /* __float128 */ + LF_QD = (1 << 8) +}; + +static struct +{ + hawk_uint8_t flag; /* for single occurrence */ + hawk_uint8_t dflag; /* for double occurrence */ +} lm_tab[26] = +{ + { 0, 0 }, /* a */ + { 0, 0 }, /* b */ + { 0, 0 }, /* c */ + { 0, 0 }, /* d */ + { 0, 0 }, /* e */ + { 0, 0 }, /* f */ + { 0, 0 }, /* g */ + { LF_H, LF_C }, /* h */ + { 0, 0 }, /* i */ + { LF_J, 0 }, /* j */ + { 0, 0 }, /* k */ + { LF_L, LF_Q }, /* l */ + { 0, 0 }, /* m */ + { 0, 0 }, /* n */ + { 0, 0 }, /* o */ + { 0, 0 }, /* p */ + { LF_Q, 0 }, /* q */ + { 0, 0 }, /* r */ + { 0, 0 }, /* s */ + { LF_T, 0 }, /* t */ + { 0, 0 }, /* u */ + { 0, 0 }, /* v */ + { 0, 0 }, /* w */ + { 0, 0 }, /* z */ + { 0, 0 }, /* y */ + { LF_Z, 0 }, /* z */ +}; + + +enum +{ + FLAGC_DOT = (1 << 0), + FLAGC_SPACE = (1 << 1), + FLAGC_SHARP = (1 << 2), + FLAGC_SIGN = (1 << 3), + FLAGC_LEFTADJ = (1 << 4), + FLAGC_ZEROPAD = (1 << 5), + FLAGC_WIDTH = (1 << 6), + FLAGC_PRECISION = (1 << 7), + FLAGC_STAR1 = (1 << 8), + FLAGC_STAR2 = (1 << 9), + FLAGC_LENMOD = (1 << 10) /* length modifier */ +}; + +static const hawk_bch_t hex2ascii_lower[] = +{ + '0','1','2','3','4','5','6','7','8','9', + 'a','b','c','d','e','f','g','h','i','j','k','l','m', + 'n','o','p','q','r','s','t','u','v','w','x','y','z' +}; + +static const hawk_bch_t hex2ascii_upper[] = +{ + '0','1','2','3','4','5','6','7','8','9', + 'A','B','C','D','E','F','G','H','I','J','K','L','M', + 'N','O','P','Q','R','S','T','U','V','W','X','H','Z' +}; + +static hawk_uch_t uch_nullstr[] = { '(','n','u','l','l', ')','\0' }; +static hawk_bch_t bch_nullstr[] = { '(','n','u','l','l', ')','\0' }; + +/* ------------------------------------------------------------------------- */ + +/*define static int fmt_uintmax_to_bcstr(...)*/ +#undef char_t +#undef fmt_uintmax +#define char_t hawk_bch_t +#define fmt_uintmax fmt_uintmax_to_bcstr +#include "fmt-imp.h" + +/*define static int fmt_uintmax_to_ucstr(...)*/ +#undef char_t +#undef fmt_uintmax +#define char_t hawk_uch_t +#define fmt_uintmax fmt_uintmax_to_ucstr +#include "fmt-imp.h" + +int hawk_fmt_intmax_to_bcstr ( + hawk_bch_t* buf, int size, + hawk_intmax_t value, int base_and_flags, int prec, + hawk_bch_t fillchar, const hawk_bch_t* prefix) +{ + hawk_bch_t signchar; + hawk_uintmax_t absvalue; + + if (value < 0) + { + signchar = '-'; + absvalue = -value; + } + else if (base_and_flags & HAWK_FMT_INTMAX_TO_BCSTR_PLUSSIGN) + { + signchar = '+'; + absvalue = value; + } + else if (base_and_flags & HAWK_FMT_INTMAX_TO_BCSTR_EMPTYSIGN) + { + signchar = ' '; + absvalue = value; + } + else + { + signchar = '\0'; + absvalue = value; + } + + return fmt_uintmax_to_bcstr(buf, size, absvalue, base_and_flags, prec, fillchar, signchar, prefix); +} + +int hawk_fmt_uintmax_to_bcstr ( + hawk_bch_t* buf, int size, + hawk_uintmax_t value, int base_and_flags, int prec, + hawk_bch_t fillchar, const hawk_bch_t* prefix) +{ + hawk_bch_t signchar; + + /* determine if a sign character is needed */ + if (base_and_flags & HAWK_FMT_INTMAX_TO_BCSTR_PLUSSIGN) + { + signchar = '+'; + } + else if (base_and_flags & HAWK_FMT_INTMAX_TO_BCSTR_EMPTYSIGN) + { + signchar = ' '; + } + else + { + signchar = '\0'; + } + + return fmt_uintmax_to_bcstr(buf, size, value, base_and_flags, prec, fillchar, signchar, prefix); +} + +/* ==================== wide-char ===================================== */ + +int hawk_fmt_intmax_to_ucstr ( + hawk_uch_t* buf, int size, + hawk_intmax_t value, int base_and_flags, int prec, + hawk_uch_t fillchar, const hawk_uch_t* prefix) +{ + hawk_uch_t signchar; + hawk_uintmax_t absvalue; + + if (value < 0) + { + signchar = '-'; + absvalue = -value; + } + else if (base_and_flags & HAWK_FMT_INTMAX_TO_UCSTR_PLUSSIGN) + { + signchar = '+'; + absvalue = value; + } + else if (base_and_flags & HAWK_FMT_INTMAX_TO_UCSTR_EMPTYSIGN) + { + signchar = ' '; + absvalue = value; + } + else + { + signchar = '\0'; + absvalue = value; + } + + return fmt_uintmax_to_ucstr(buf, size, absvalue, base_and_flags, prec, fillchar, signchar, prefix); +} + +int hawk_fmt_uintmax_to_ucstr ( + hawk_uch_t* buf, int size, + hawk_uintmax_t value, int base_and_flags, int prec, + hawk_uch_t fillchar, const hawk_uch_t* prefix) +{ + hawk_uch_t signchar; + + /* determine if a sign character is needed */ + if (base_and_flags & HAWK_FMT_INTMAX_TO_UCSTR_PLUSSIGN) + { + signchar = '+'; + } + else if (base_and_flags & HAWK_FMT_INTMAX_TO_UCSTR_EMPTYSIGN) + { + signchar = ' '; + } + else + { + signchar = '\0'; + } + + return fmt_uintmax_to_ucstr(buf, size, value, base_and_flags, prec, fillchar, signchar, prefix); +} + +/* ------------------------------------------------------------------------- */ +/* + * Put a NUL-terminated ASCII number (base <= 36) in a buffer in reverse + * order; return an optional length and a pointer to the last character + * written in the buffer (i.e., the first character of the string). + * The buffer pointed to by `nbuf' must have length >= MAXNBUF. + */ + +static hawk_bch_t* sprintn_lower (hawk_bch_t* nbuf, hawk_uintmax_t num, int base, hawk_ooi_t* lenp) +{ + hawk_bch_t* p; + + p = nbuf; + *p = '\0'; + do { *++p = hex2ascii_lower[num % base]; } while (num /= base); + + if (lenp) *lenp = p - nbuf; + return p; /* returns the end */ +} + +static hawk_bch_t* sprintn_upper (hawk_bch_t* nbuf, hawk_uintmax_t num, int base, hawk_ooi_t* lenp) +{ + hawk_bch_t* p; + + p = nbuf; + *p = '\0'; + do { *++p = hex2ascii_upper[num % base]; } while (num /= base); + + if (lenp) *lenp = p - nbuf; + return p; /* returns the end */ +} + +/* ------------------------------------------------------------------------- */ + +#define PUT_BCH(fmtout,c,n) do { \ + if (n > 0) { \ + hawk_oow_t _yy; \ + hawk_bch_t _cc = c; \ + for (_yy = 0; _yy < n; _yy++) \ + { \ + int _xx; \ + if ((_xx = fmtout->putbchars(fmtout, &_cc, 1)) <= -1) goto oops; \ + if (_xx == 0) goto done; \ + fmtout->count++; \ + } \ + } \ +} while (0) + +#define PUT_BCS(fmtout,ptr,len) do { \ + if (len > 0) { \ + int _xx; \ + if ((_xx = fmtout->putbchars(fmtout, ptr, len)) <= -1) goto oops; \ + if (_xx == 0) goto done; \ + fmtout->count += len; \ + } \ +} while (0) + +#define PUT_UCH(fmtout,c,n) do { \ + if (n > 0) { \ + hawk_oow_t _yy; \ + hawk_uch_t _cc = c; \ + for (_yy = 0; _yy < n; _yy++) \ + { \ + int _xx; \ + if ((_xx = fmtout->putuchars(fmtout, &_cc, 1)) <= -1) goto oops; \ + if (_xx == 0) goto done; \ + fmtout->count++; \ + } \ + } \ +} while (0) + +#define PUT_UCS(fmtout,ptr,len) do { \ + if (len > 0) { \ + int _xx; \ + if ((_xx = fmtout->putuchars(fmtout, ptr, len)) <= -1) goto oops; \ + if (_xx == 0) goto done; \ + fmtout->count += len; \ + } \ +} while (0) + + +#if defined(HAWK_OOCH_IS_BCH) +# define PUT_OOCH(fmtout,c,n) PUT_BCH(fmtout,c,n) +# define PUT_OOCS(fmtout,ptr,len) PUT_BCS(fmtout,ptr,len) +#else +# define PUT_OOCH(fmtout,c,n) PUT_UCH(fmtout,c,n) +# define PUT_OOCS(fmtout,ptr,len) PUT_UCS(fmtout,ptr,len) +#endif + +#define BYTE_PRINTABLE(x) ((x >= 'a' && x <= 'z') || (x >= 'A' && x <= 'Z') || (x >= '0' && x <= '9') || (x == ' ')) + + +#define PUT_BYTE_IN_HEX(fmtout,byte,extra_flags) do { \ + hawk_bch_t __xbuf[3]; \ + hawk_byte_to_bcstr ((byte), __xbuf, HAWK_COUNTOF(__xbuf), (16 | (extra_flags)), '0'); \ + PUT_BCH(fmtout, __xbuf[0], 1); \ + PUT_BCH(fmtout, __xbuf[1], 1); \ +} while (0) + +/* ------------------------------------------------------------------------- */ +static int fmt_outv (hawk_fmtout_t* fmtout, va_list ap) +{ + const hawk_uint8_t* fmtptr, * percent; + int fmtchsz; + + hawk_uch_t uch; + hawk_bch_t bch; + hawk_ooch_t padc; + + int n, base, neg, sign; + hawk_ooi_t tmp, width, precision; + int lm_flag, lm_dflag, flagc, numlen; + + hawk_uintmax_t num = 0; + hawk_bch_t nbuf[MAXNBUF]; + const hawk_bch_t* nbufp; + int stop = 0; + + struct + { + struct + { + hawk_bch_t sbuf[32]; + hawk_bch_t* ptr; + hawk_oow_t capa; + } fmt; + struct + { + hawk_bch_t sbuf[64]; + hawk_bch_t* ptr; + hawk_oow_t capa; + } out; + } fb; /* some buffers for handling float-point number formatting */ + + hawk_bch_t* (*sprintn) (hawk_bch_t* nbuf, hawk_uintmax_t num, int base, hawk_ooi_t* lenp); + + fmtptr = (const hawk_uint8_t*)fmtout->fmt_str; + switch (fmtout->fmt_type) + { + case HAWK_FMTOUT_FMT_TYPE_BCH: + fmtchsz = HAWK_SIZEOF_BCH_T; + break; + case HAWK_FMTOUT_FMT_TYPE_UCH: + fmtchsz = HAWK_SIZEOF_UCH_T; + break; + } + + /* this is an internal function. it doesn't reset count to 0 */ + /* fmtout->count = 0; */ + + fb.fmt.ptr = fb.fmt.sbuf; + fb.fmt.capa = HAWK_COUNTOF(fb.fmt.sbuf) - 1; + fb.out.ptr = fb.out.sbuf; + fb.out.capa = HAWK_COUNTOF(fb.out.sbuf) - 1; + + while (1) + { + #if defined(HAVE_LABELS_AS_VALUES) + static void* before_percent_tab[] = { &&before_percent_bch, &&before_percent_uch }; + goto *before_percent_tab[fmtout->fmt_type]; + #else + switch (fmtout->fmt_type) + { + case HAWK_FMTOUT_FMT_TYPE_BCH: + goto before_percent_bch; + case HAWK_FMTOUT_FMT_TYPE_UCH: + goto before_percent_uch; + } + #endif + + before_percent_bch: + { + const hawk_bch_t* start, * end; + start = end = (const hawk_bch_t*)fmtptr; + while ((bch = *end++) != '%' || stop) + { + if (bch == '\0') + { + PUT_BCS (fmtout, start, end - start - 1); + goto done; + } + } + PUT_BCS (fmtout, start, end - start - 1); + fmtptr = (const hawk_uint8_t*)end; + percent = (const hawk_uint8_t*)(end - 1); + } + goto handle_percent; + + before_percent_uch: + { + const hawk_uch_t* start, * end; + start = end = (const hawk_uch_t*)fmtptr; + while ((uch = *end++) != '%' || stop) + { + if (uch == '\0') + { + PUT_UCS (fmtout, start, end - start - 1); + goto done; + } + } + PUT_UCS (fmtout, start, end - start - 1); + fmtptr = (const hawk_uint8_t*)end; + percent = (const hawk_uint8_t*)(end - 1); + } + goto handle_percent; + + handle_percent: + padc = ' '; + width = 0; precision = 0; neg = 0; sign = 0; + lm_flag = 0; lm_dflag = 0; flagc = 0; + sprintn = sprintn_lower; + + reswitch: + /* store the formatting character in uch regardless of the + * requested character type. */ + switch (fmtout->fmt_type) + { + case HAWK_FMTOUT_FMT_TYPE_BCH: + uch = *(const hawk_bch_t*)fmtptr; + break; + case HAWK_FMTOUT_FMT_TYPE_UCH: + uch = *(const hawk_uch_t*)fmtptr; + break; + } + fmtptr += fmtchsz; + + switch (uch) + { + case '%': /* %% */ + bch = uch; + goto print_lowercase_c; + + /* flag characters */ + case '.': + if (flagc & FLAGC_DOT) goto invalid_format; + flagc |= FLAGC_DOT; + goto reswitch; + + case '#': + if (flagc & (FLAGC_WIDTH | FLAGC_DOT | FLAGC_LENMOD)) goto invalid_format; + flagc |= FLAGC_SHARP; + goto reswitch; + + case ' ': + if (flagc & (FLAGC_WIDTH | FLAGC_DOT | FLAGC_LENMOD)) goto invalid_format; + flagc |= FLAGC_SPACE; + goto reswitch; + + case '+': /* place sign for signed conversion */ + if (flagc & (FLAGC_WIDTH | FLAGC_DOT | FLAGC_LENMOD)) goto invalid_format; + flagc |= FLAGC_SIGN; + goto reswitch; + + case '-': /* left adjusted */ + if (flagc & (FLAGC_WIDTH | FLAGC_DOT | FLAGC_LENMOD)) goto invalid_format; + if (flagc & FLAGC_DOT) + { + goto invalid_format; + } + else + { + flagc |= FLAGC_LEFTADJ; + if (flagc & FLAGC_ZEROPAD) + { + padc = ' '; + flagc &= ~FLAGC_ZEROPAD; + } + } + + goto reswitch; + + case '*': /* take the length from the parameter */ + if (flagc & FLAGC_DOT) + { + if (flagc & (FLAGC_STAR2 | FLAGC_PRECISION)) goto invalid_format; + flagc |= FLAGC_STAR2; + + precision = va_arg(ap, hawk_ooi_t); /* this deviates from the standard printf that accepts 'int' */ + if (precision < 0) + { + /* if precision is less than 0, + * treat it as if no .precision is specified */ + flagc &= ~FLAGC_DOT; + precision = 0; + } + } + else + { + if (flagc & (FLAGC_STAR1 | FLAGC_WIDTH)) goto invalid_format; + flagc |= FLAGC_STAR1; + + width = va_arg(ap, hawk_ooi_t); /* it deviates from the standard printf that accepts 'int' */ + if (width < 0) + { + /* + if (flagc & FLAGC_LEFTADJ) + flagc &= ~FLAGC_LEFTADJ; + else + */ + flagc |= FLAGC_LEFTADJ; + width = -width; + } + } + goto reswitch; + + case '0': /* zero pad */ + if (flagc & FLAGC_LENMOD) goto invalid_format; + if (!(flagc & (FLAGC_DOT | FLAGC_LEFTADJ))) + { + padc = '0'; + flagc |= FLAGC_ZEROPAD; + goto reswitch; + } + /* end of flags characters */ + + case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + { + if (flagc & FLAGC_LENMOD) goto invalid_format; + for (n = 0;; fmtptr += fmtchsz) + { + n = n * 10 + uch - '0'; + switch (fmtout->fmt_type) + { + case HAWK_FMTOUT_FMT_TYPE_BCH: + uch = *(const hawk_bch_t*)fmtptr; + break; + case HAWK_FMTOUT_FMT_TYPE_UCH: + uch = *(const hawk_uch_t*)fmtptr; + break; + } + if (uch < '0' || uch > '9') break; + } + if (flagc & FLAGC_DOT) + { + if (flagc & FLAGC_STAR2) goto invalid_format; + precision = n; + flagc |= FLAGC_PRECISION; + } + else + { + if (flagc & FLAGC_STAR1) goto invalid_format; + width = n; + flagc |= FLAGC_WIDTH; + } + goto reswitch; + } + + /* length modifiers */ + case 'h': /* short int */ + case 'l': /* long int */ + case 'q': /* long long int */ + case 'j': /* hawk_intmax_t/hawk_uintmax_t */ + case 'z': /* hawk_ooi_t/hawk_oow_t */ + case 't': /* ptrdiff_t - usually hawk_intptr_t */ + if (lm_flag & (LF_LD | LF_QD)) goto invalid_format; + + flagc |= FLAGC_LENMOD; + if (lm_dflag) + { + /* error */ + goto invalid_format; + } + else if (lm_flag) + { + if (lm_tab[uch - 'a'].dflag && lm_flag == lm_tab[uch - 'a'].flag) + { + lm_flag &= ~lm_tab[uch - 'a'].flag; + lm_flag |= lm_tab[uch - 'a'].dflag; + lm_dflag |= lm_flag; + goto reswitch; + } + else + { + /* error */ + goto invalid_format; + } + } + else + { + lm_flag |= lm_tab[uch - 'a'].flag; + goto reswitch; + } + break; + + case 'L': /* long double */ + if (flagc & FLAGC_LENMOD) + { + /* conflict with other length modifier */ + goto invalid_format; + } + flagc |= FLAGC_LENMOD; + lm_flag |= LF_LD; + goto reswitch; + + case 'Q': /* __float128 */ + if (flagc & FLAGC_LENMOD) + { + /* conflict with other length modifier */ + goto invalid_format; + } + flagc |= FLAGC_LENMOD; + lm_flag |= LF_QD; + goto reswitch; + /* end of length modifiers */ + + case 'n': /* number of characters printed so far */ + if (lm_flag & LF_J) /* j */ + *(va_arg(ap, hawk_intmax_t*)) = fmtout->count; + else if (lm_flag & LF_Z) /* z */ + *(va_arg(ap, hawk_ooi_t*)) = fmtout->count; + #if (HAWK_SIZEOF_LONG_LONG > 0) + else if (lm_flag & LF_Q) /* ll */ + *(va_arg(ap, long long int*)) = fmtout->count; + #endif + else if (lm_flag & LF_L) /* l */ + *(va_arg(ap, long int*)) = fmtout->count; + else if (lm_flag & LF_H) /* h */ + *(va_arg(ap, short int*)) = fmtout->count; + else if (lm_flag & LF_C) /* hh */ + *(va_arg(ap, char*)) = fmtout->count; + else if (flagc & FLAGC_LENMOD) + goto invalid_format; + else + *(va_arg(ap, int*)) = fmtout->count; + break; + + /* signed integer conversions */ + case 'd': + case 'i': /* signed conversion */ + base = 10; + sign = 1; + goto handle_sign; + /* end of signed integer conversions */ + + /* unsigned integer conversions */ + case 'o': + base = 8; + goto handle_nosign; + case 'u': + base = 10; + goto handle_nosign; + case 'X': + sprintn = sprintn_upper; + case 'x': + base = 16; + goto handle_nosign; + case 'b': + base = 2; + goto handle_nosign; + /* end of unsigned integer conversions */ + + case 'p': /* pointer */ + base = 16; + + if (width == 0) flagc |= FLAGC_SHARP; + else flagc &= ~FLAGC_SHARP; + + num = (hawk_uintptr_t)va_arg(ap, void*); + goto number; + + case 'c': + { + /* zeropad must not take effect for 'c' */ + if (flagc & FLAGC_ZEROPAD) padc = ' '; + if (lm_flag & LF_L) goto uppercase_c; + #if defined(HAWK_OOCH_IS_UCH) + if (lm_flag & LF_J) goto uppercase_c; + #endif + lowercase_c: + bch = HAWK_SIZEOF(hawk_bch_t) < HAWK_SIZEOF(int)? va_arg(ap, int): va_arg(ap, hawk_bch_t); + + print_lowercase_c: + /* precision 0 doesn't kill the letter */ + width--; + if (!(flagc & FLAGC_LEFTADJ) && width > 0) PUT_BCH (fmtout, padc, width); + PUT_BCH (fmtout, bch, 1); + if ((flagc & FLAGC_LEFTADJ) && width > 0) PUT_BCH (fmtout, padc, width); + break; + } + + case 'C': + { + /* zeropad must not take effect for 'C' */ + if (flagc & FLAGC_ZEROPAD) padc = ' '; + if (lm_flag & LF_H) goto lowercase_c; + #if defined(HAWK_OOCH_IS_BCH) + if (lm_flag & LF_J) goto lowercase_c; + #endif + uppercase_c: + uch = HAWK_SIZEOF(hawk_uch_t) < HAWK_SIZEOF(int)? va_arg(ap, int): va_arg(ap, hawk_uch_t); + + /* precision 0 doesn't kill the letter */ + width--; + if (!(flagc & FLAGC_LEFTADJ) && width > 0) PUT_UCH (fmtout, padc, width); + PUT_UCH (fmtout, uch, 1); + if ((flagc & FLAGC_LEFTADJ) && width > 0) PUT_UCH (fmtout, padc, width); + break; + } + + case 's': + { + const hawk_bch_t* bsp; + + /* zeropad must not take effect for 'S' */ + if (flagc & FLAGC_ZEROPAD) padc = ' '; + if (lm_flag & LF_L) goto uppercase_s; + #if defined(HAWK_OOCH_IS_UCH) + if (lm_flag & LF_J) goto uppercase_s; + #endif + lowercase_s: + bsp = va_arg(ap, hawk_bch_t*); + if (!bsp) bsp = bch_nullstr; + + n = 0; + if (flagc & FLAGC_DOT) + { + while (n < precision && bsp[n]) n++; + } + else + { + while (bsp[n]) n++; + } + + width -= n; + + if (!(flagc & FLAGC_LEFTADJ) && width > 0) PUT_BCH (fmtout, padc, width); + PUT_BCS (fmtout, bsp, n); + if ((flagc & FLAGC_LEFTADJ) && width > 0) PUT_BCH (fmtout, padc, width); + break; + } + + case 'S': + { + const hawk_uch_t* usp; + + /* zeropad must not take effect for 's' */ + if (flagc & FLAGC_ZEROPAD) padc = ' '; + if (lm_flag & LF_H) goto lowercase_s; + #if defined(HAWK_OOCH_IS_UCH) + if (lm_flag & LF_J) goto lowercase_s; + #endif + uppercase_s: + usp = va_arg(ap, hawk_uch_t*); + if (!usp) usp = uch_nullstr; + + n = 0; + if (flagc & FLAGC_DOT) + { + while (n < precision && usp[n]) n++; + } + else + { + while (usp[n]) n++; + } + + width -= n; + + if (!(flagc & FLAGC_LEFTADJ) && width > 0) PUT_UCH (fmtout, padc, width); + PUT_UCS (fmtout, usp, n); + if ((flagc & FLAGC_LEFTADJ) && width > 0) PUT_UCH (fmtout, padc, width); + + break; + } + + case 'k': + case 'K': + { + /* byte or multibyte character string in escape sequence */ + const hawk_uint8_t* bsp; + hawk_oow_t k_hex_width; + + /* zeropad must not take effect for 'k' and 'K' + * + * 'h' & 'l' is not used to differentiate hawk_bch_t and hawk_uch_t + * because 'k' means hawk_byte_t. + * 'l', results in uppercase hexadecimal letters. + * 'h' drops the leading \x in the output + * -------------------------------------------------------- + * hk -> \x + non-printable in lowercase hex + * k -> all in lowercase hex + * lk -> \x + all in lowercase hex + * -------------------------------------------------------- + * hK -> \x + non-printable in uppercase hex + * K -> all in uppercase hex + * lK -> \x + all in uppercase hex + * -------------------------------------------------------- + * with 'k' or 'K', i don't substitute "(null)" for the NULL pointer + */ + if (flagc & FLAGC_ZEROPAD) padc = ' '; + + bsp = va_arg(ap, hawk_uint8_t*); + k_hex_width = (lm_flag & (LF_H | LF_L))? 4: 2; + + if (lm_flag& LF_H) + { + if (flagc & FLAGC_DOT) + { + /* if precision is specifed, it doesn't stop at the value of zero unlike 's' or 'S' */ + for (n = 0; n < precision; n++) width -= BYTE_PRINTABLE(bsp[n])? 1: k_hex_width; + } + else + { + for (n = 0; bsp[n]; n++) width -= BYTE_PRINTABLE(bsp[n])? 1: k_hex_width; + } + } + else + { + if (flagc & FLAGC_DOT) + { + /* if precision is specifed, it doesn't stop at the value of zero unlike 's' or 'S' */ + n = precision; + } + else + { + for (n = 0; bsp[n]; n++) /* nothing */; + } + width -= (n * k_hex_width); + } + + if (!(flagc & FLAGC_LEFTADJ) && width > 0) PUT_OOCH (fmtout, padc, width); + + while (n--) + { + if ((lm_flag & LF_H) && BYTE_PRINTABLE(*bsp)) + { + PUT_BCH (fmtout, *bsp, 1); + } + else + { + hawk_bch_t xbuf[3]; + hawk_byte_to_bcstr (*bsp, xbuf, HAWK_COUNTOF(xbuf), (16 | (uch == 'k'? HAWK_BYTE_TO_BCSTR_LOWERCASE: 0)), '0'); + if (lm_flag & (LF_H | LF_L)) PUT_BCS (fmtout, "\\x", 2); + PUT_BCS (fmtout, xbuf, 2); + } + bsp++; + } + + if ((flagc & FLAGC_LEFTADJ) && width > 0) PUT_OOCH (fmtout, padc, width); + break; + } + + case 'w': + case 'W': + { + /* unicode string in unicode escape sequence. + * + * hw -> \uXXXX, \UXXXXXXXX, printable-byte(only in ascii range) + * w -> \uXXXX, \UXXXXXXXX + * lw -> all in \UXXXXXXXX + */ + const hawk_uch_t* usp; + hawk_oow_t uwid; + + if (flagc & FLAGC_ZEROPAD) padc = ' '; + usp = va_arg(ap, hawk_uch_t*); + + if (flagc & FLAGC_DOT) + { + /* if precision is specifed, it doesn't stop at the value of zero unlike 's' or 'S' */ + for (n = 0; n < precision; n++) + { + if ((lm_flag & LF_H) && BYTE_PRINTABLE(usp[n])) uwid = 1; + else if (!(lm_flag & LF_L) && usp[n] <= 0xFFFF) uwid = 6; + else uwid = 10; + width -= uwid; + } + } + else + { + for (n = 0; usp[n]; n++) + { + if ((lm_flag & LF_H) && BYTE_PRINTABLE(usp[n])) uwid = 1; + else if (!(lm_flag & LF_L) && usp[n] <= 0xFFFF) uwid = 6; + else uwid = 10; + width -= uwid; + } + } + + if (!(flagc & FLAGC_LEFTADJ) && width > 0) PUT_OOCH (fmtout, padc, width); + + while (n--) + { + if ((lm_flag & LF_H) && BYTE_PRINTABLE(*usp)) + { + PUT_OOCH(fmtout, *usp, 1); + } + else if (!(lm_flag & LF_L) && *usp <= 0xFFFF) + { + hawk_uint16_t u16 = *usp; + int extra_flags = ((uch) == 'w'? HAWK_BYTE_TO_BCSTR_LOWERCASE: 0); + PUT_BCS(fmtout, "\\u", 2); + PUT_BYTE_IN_HEX(fmtout, (u16 >> 8) & 0xFF, extra_flags); + PUT_BYTE_IN_HEX(fmtout, u16 & 0xFF, extra_flags); + } + else + { + hawk_uint32_t u32 = *usp; + int extra_flags = ((uch) == 'w'? HAWK_BYTE_TO_BCSTR_LOWERCASE: 0); + PUT_BCS(fmtout, "\\u", 2); + PUT_BYTE_IN_HEX(fmtout, (u32 >> 24) & 0xFF, extra_flags); + PUT_BYTE_IN_HEX(fmtout, (u32 >> 16) & 0xFF, extra_flags); + PUT_BYTE_IN_HEX(fmtout, (u32 >> 8) & 0xFF, extra_flags); + PUT_BYTE_IN_HEX(fmtout, u32 & 0xFF, extra_flags); + } + usp++; + } + + if ((flagc & FLAGC_LEFTADJ) && width > 0) PUT_OOCH (fmtout, padc, width); + break; + } + + case 'O': /* object - ignore precision, width, adjustment */ + if (!fmtout->putobj) goto invalid_format; + if (fmtout->putobj(fmtout, va_arg(ap, hawk_val_t*)) <= -1) goto oops; + break; + + case 'e': + case 'E': + case 'f': + case 'F': + case 'g': + case 'G': + /* + case 'a': + case 'A': + */ + { + /* let me rely on snprintf until i implement float-point to string conversion */ + int q; + hawk_oow_t fmtlen; + union + { + #if (HAWK_SIZEOF___FLOAT128 > 0) && defined(HAVE_QUADMATH_SNPRINTF) + __float128 qd; + #endif + long double ld; + double d; + } v; + int dtype = 0; + hawk_oow_t newcapa; + hawk_bch_t* bsp; + + if (lm_flag & LF_J) + { + #if (HAWK_SIZEOF___FLOAT128 > 0) && defined(HAVE_QUADMATH_SNPRINTF) && (HAWK_SIZEOF_FLTMAX_T == HAWK_SIZEOF___FLOAT128) + v.qd = va_arg(ap, hawk_fltmax_t); + dtype = LF_QD; + #elif HAWK_SIZEOF_FLTMAX_T == HAWK_SIZEOF_DOUBLE + v.d = va_arg(ap, hawk_fltmax_t); + #elif HAWK_SIZEOF_FLTMAX_T == HAWK_SIZEOF_LONG_DOUBLE + v.ld = va_arg(ap, hawk_fltmax_t); + dtype = LF_LD; + #else + #error Unsupported hawk_flt_t + #endif + } + else if (lm_flag & LF_Z) + { + /* hawk_flt_t is limited to double or long double */ + + /* precedence goes to double if sizeof(double) == sizeof(long double) + * for example, %Lf didn't work on some old platforms. + * so i prefer the format specifier with no modifier. + */ + #if HAWK_SIZEOF_FLT_T == HAWK_SIZEOF_DOUBLE + v.d = va_arg(ap, hawk_flt_t); + #elif HAWK_SIZEOF_FLT_T == HAWK_SIZEOF_LONG_DOUBLE + v.ld = va_arg(ap, hawk_flt_t); + dtype = LF_LD; + #else + #error Unsupported hawk_flt_t + #endif + } + else if (lm_flag & (LF_LD | LF_L)) + { + v.ld = va_arg(ap, long double); + dtype = LF_LD; + } + #if (HAWK_SIZEOF___FLOAT128 > 0) && defined(HAVE_QUADMATH_SNPRINTF) + else if (lm_flag & (LF_QD | LF_Q)) + { + v.qd = va_arg(ap, __float128); + dtype = LF_QD; + } + #endif + else if (flagc & FLAGC_LENMOD) + { + goto invalid_format; + } + else + { + v.d = va_arg(ap, double); + } + + fmtlen = fmtptr - percent; + if (fmtlen > fb.fmt.capa) + { + if (fb.fmt.ptr == fb.fmt.sbuf) + { + fb.fmt.ptr = (hawk_bch_t*)HAWK_MMGR_ALLOC(fmtout->mmgr, HAWK_SIZEOF(*fb.fmt.ptr) * (fmtlen + 1)); + if (!fb.fmt.ptr) goto oops; + } + else + { + hawk_bch_t* tmpptr; + + tmpptr = (hawk_bch_t*)HAWK_MMGR_REALLOC(fmtout->mmgr, fb.fmt.ptr, HAWK_SIZEOF(*fb.fmt.ptr) * (fmtlen + 1)); + if (!tmpptr) goto oops; + fb.fmt.ptr = tmpptr; + } + + fb.fmt.capa = fmtlen; + } + + /* compose back the format specifier */ + fmtlen = 0; + fb.fmt.ptr[fmtlen++] = '%'; + if (flagc & FLAGC_SPACE) fb.fmt.ptr[fmtlen++] = ' '; + if (flagc & FLAGC_SHARP) fb.fmt.ptr[fmtlen++] = '#'; + if (flagc & FLAGC_SIGN) fb.fmt.ptr[fmtlen++] = '+'; + if (flagc & FLAGC_LEFTADJ) fb.fmt.ptr[fmtlen++] = '-'; + if (flagc & FLAGC_ZEROPAD) fb.fmt.ptr[fmtlen++] = '0'; + + if (flagc & FLAGC_STAR1) fb.fmt.ptr[fmtlen++] = '*'; + else if (flagc & FLAGC_WIDTH) + { + fmtlen += hawk_fmt_uintmax_to_bcstr( + &fb.fmt.ptr[fmtlen], fb.fmt.capa - fmtlen, + width, 10, -1, '\0', HAWK_NULL); + } + if (flagc & FLAGC_DOT) fb.fmt.ptr[fmtlen++] = '.'; + if (flagc & FLAGC_STAR2) fb.fmt.ptr[fmtlen++] = '*'; + else if (flagc & FLAGC_PRECISION) + { + fmtlen += hawk_fmt_uintmax_to_bcstr( + &fb.fmt.ptr[fmtlen], fb.fmt.capa - fmtlen, + precision, 10, -1, '\0', HAWK_NULL); + } + + if (dtype == LF_LD) + fb.fmt.ptr[fmtlen++] = 'L'; + #if (HAWK_SIZEOF___FLOAT128 > 0) + else if (dtype == LF_QD) + fb.fmt.ptr[fmtlen++] = 'Q'; + #endif + + fb.fmt.ptr[fmtlen++] = uch; + fb.fmt.ptr[fmtlen] = '\0'; + + #if defined(HAVE_SNPRINTF) + /* nothing special here */ + #else + /* best effort to avoid buffer overflow when no snprintf is available. + * i really can't do much if it happens. */ + newcapa = precision + width + 32; + if (fltout->capa < newcapa) + { + HAWK_ASSERT (hawk, fltout->ptr == fltout->buf); + + fltout->ptr = HAWK_MMGR_ALLOC(fmtout->mmgr, HAWK_SIZEOF(char_t) * (newcapa + 1)); + if (!fltout->ptr) goto oops; + fltout->capa = newcapa; + } + #endif + + while (1) + { + if (dtype == LF_LD) + { + #if defined(HAVE_SNPRINTF) + q = snprintf((hawk_bch_t*)fb.out.ptr, fb.out.capa + 1, fb.fmt.ptr, v.ld); + #else + q = sprintf((hawk_bch_t*)fb.out.ptr, fb.fmt.ptr, v.ld); + #endif + } + #if (HAWK_SIZEOF___FLOAT128 > 0) && defined(HAVE_QUADMATH_SNPRINTF) + else if (dtype == LF_QD) + { + q = quadmath_snprintf((hawk_bch_t*)fb.out.ptr, fb.out.capa + 1, fb.fmt.ptr, v.qd); + } + #endif + else + { + #if defined(HAVE_SNPRINTF) + q = snprintf((hawk_bch_t*)fb.out.ptr, fb.out.capa + 1, fb.fmt.ptr, v.d); + #else + q = sprintf((hawk_bch_t*)fb.out.ptr, fb.fmt.ptr, v.d); + #endif + } + if (q <= -1) goto oops; + if (q <= fb.out.capa) break; + + newcapa = fb.out.capa * 2; + if (newcapa < q) newcapa = q; + + if (fb.out.ptr == fb.out.sbuf) + { + fb.out.ptr = (hawk_bch_t*)HAWK_MMGR_ALLOC(fmtout->mmgr, HAWK_SIZEOF(char_t) * (newcapa + 1)); + if (!fb.out.ptr) goto oops; + } + else + { + hawk_bch_t* tmpptr; + tmpptr = (hawk_bch_t*)HAWK_MMGR_REALLOC(fmtout->mmgr, fb.out.ptr, HAWK_SIZEOF(char_t) * (newcapa + 1)); + if (!tmpptr) goto oops; + fb.out.ptr = tmpptr; + } + fb.out.capa = newcapa; + } + + if (HAWK_SIZEOF(char_t) != HAWK_SIZEOF(hawk_bch_t)) + { + fb.out.ptr[q] = '\0'; + while (q > 0) + { + q--; + fb.out.ptr[q] = ((hawk_bch_t*)fb.out.ptr)[q]; + } + } + + bsp = fb.out.ptr; + n = 0; while (bsp[n] != '\0') n++; + PUT_BCS (fmtout, bsp, n); + break; + } + handle_nosign: + sign = 0; + if (lm_flag & LF_J) + { + #if defined(__GNUC__) && \ + (HAWK_SIZEOF_UINTMAX_T > HAWK_SIZEOF_OOW_T) && \ + (HAWK_SIZEOF_UINTMAX_T != HAWK_SIZEOF_LONG_LONG) && \ + (HAWK_SIZEOF_UINTMAX_T != HAWK_SIZEOF_LONG) + /* GCC-compiled binaries crashed when getting hawk_uintmax_t with va_arg. + * This is just a work-around for it */ + int i; + for (i = 0, num = 0; i < HAWK_SIZEOF(hawk_uintmax_t) / HAWK_SIZEOF(hawk_oow_t); i++) + { + #if defined(HAWK_ENDIAN_BIG) + num = num << (8 * HAWK_SIZEOF(hawk_oow_t)) | (va_arg(ap, hawk_oow_t)); + #else + register int shift = i * HAWK_SIZEOF(hawk_oow_t); + hawk_oow_t x = va_arg(ap, hawk_oow_t); + num |= (hawk_uintmax_t)x << (shift * HAWK_BITS_PER_BYTE); + #endif + } + #else + num = va_arg(ap, hawk_uintmax_t); + #endif + } + else if (lm_flag & LF_T) + num = va_arg(ap, hawk_intptr_t/*hawk_ptrdiff_t*/); + else if (lm_flag & LF_Z) + num = va_arg(ap, hawk_oow_t); + #if (HAWK_SIZEOF_LONG_LONG > 0) + else if (lm_flag & LF_Q) + num = va_arg(ap, unsigned long long int); + #endif + else if (lm_flag & (LF_L | LF_LD)) + num = va_arg(ap, unsigned long int); + else if (lm_flag & LF_H) + num = (unsigned short int)va_arg(ap, int); + else if (lm_flag & LF_C) + num = (unsigned char)va_arg(ap, int); + else + num = va_arg(ap, unsigned int); + goto number; + + handle_sign: + if (lm_flag & LF_J) + { + #if defined(__GNUC__) && \ + (HAWK_SIZEOF_INTMAX_T > HAWK_SIZEOF_OOI_T) && \ + (HAWK_SIZEOF_UINTMAX_T != HAWK_SIZEOF_LONG_LONG) && \ + (HAWK_SIZEOF_UINTMAX_T != HAWK_SIZEOF_LONG) + /* GCC-compiled binraries crashed when getting hawk_uintmax_t with va_arg. + * This is just a work-around for it */ + int i; + for (i = 0, num = 0; i < HAWK_SIZEOF(hawk_intmax_t) / HAWK_SIZEOF(hawk_oow_t); i++) + { + #if defined(HAWK_ENDIAN_BIG) + num = num << (8 * HAWK_SIZEOF(hawk_oow_t)) | (va_arg(ap, hawk_oow_t)); + #else + register int shift = i * HAWK_SIZEOF(hawk_oow_t); + hawk_oow_t x = va_arg(ap, hawk_oow_t); + num |= (hawk_uintmax_t)x << (shift * HAWK_BITS_PER_BYTE); + #endif + } + #else + num = va_arg(ap, hawk_intmax_t); + #endif + } + + else if (lm_flag & LF_T) + num = va_arg(ap, hawk_intptr_t/*hawk_ptrdiff_t*/); + else if (lm_flag & LF_Z) + num = va_arg(ap, hawk_ooi_t); + #if (HAWK_SIZEOF_LONG_LONG > 0) + else if (lm_flag & LF_Q) + num = va_arg(ap, long long int); + #endif + else if (lm_flag & (LF_L | LF_LD)) + num = va_arg(ap, long int); + else if (lm_flag & LF_H) + num = (short int)va_arg(ap, int); + else if (lm_flag & LF_C) + num = (char)va_arg(ap, int); + else + num = va_arg(ap, int); + + number: + if (sign && (hawk_intmax_t)num < 0) + { + neg = 1; + num = -(hawk_intmax_t)num; + } + + nbufp = sprintn(nbuf, num, base, &tmp); + if ((flagc & FLAGC_SHARP) && num != 0) + { + if (base == 2 || base == 16) tmp += 2; /* 0b 0x */ + else if (tmp == 8) tmp += 1; /* 0 */ + } + if (neg) tmp++; + else if (flagc & FLAGC_SIGN) tmp++; + else if (flagc & FLAGC_SPACE) tmp++; + + numlen = (int)((const hawk_bch_t*)nbufp - (const hawk_bch_t*)nbuf); + if ((flagc & FLAGC_DOT) && precision > numlen) + { + /* extra zeros for precision specified */ + tmp += (precision - numlen); + } + + if (!(flagc & FLAGC_LEFTADJ) && !(flagc & FLAGC_ZEROPAD) && width > 0 && (width -= tmp) > 0) + { + PUT_OOCH (fmtout, padc, width); + width = 0; + } + + if (neg) PUT_OOCH (fmtout, '-', 1); + else if (flagc & FLAGC_SIGN) PUT_OOCH (fmtout, '+', 1); + else if (flagc & FLAGC_SPACE) PUT_OOCH (fmtout, ' ', 1); + + if ((flagc & FLAGC_SHARP) && num != 0) + { + if (base == 2) + { + PUT_OOCH (fmtout, '0', 1); + PUT_OOCH (fmtout, 'b', 1); + } + else if (base == 8) + { + PUT_OOCH (fmtout, '0', 1); + } + else if (base == 16) + { + PUT_OOCH (fmtout, '0', 1); + PUT_OOCH (fmtout, 'x', 1); + } + } + + if ((flagc & FLAGC_DOT) && precision > numlen) + { + /* extra zeros for precision specified */ + PUT_OOCH (fmtout, '0', precision - numlen); + } + + if (!(flagc & FLAGC_LEFTADJ) && width > 0 && (width -= tmp) > 0) + { + PUT_OOCH (fmtout, padc, width); + } + + while (*nbufp) PUT_OOCH (fmtout, *nbufp--, 1); /* output actual digits */ + + if ((flagc & FLAGC_LEFTADJ) && width > 0 && (width -= tmp) > 0) + { + PUT_OOCH (fmtout, padc, width); + } + break; + + invalid_format: + switch (fmtout->fmt_type) + { + case HAWK_FMTOUT_FMT_TYPE_BCH: + PUT_BCS (fmtout, (const hawk_bch_t*)percent, (fmtptr - percent) / fmtchsz); + break; + case HAWK_FMTOUT_FMT_TYPE_UCH: + PUT_UCS (fmtout, (const hawk_uch_t*)percent, (fmtptr - percent) / fmtchsz); + break; + } + break; + + default: + switch (fmtout->fmt_type) + { + case HAWK_FMTOUT_FMT_TYPE_BCH: + PUT_BCS (fmtout, (const hawk_bch_t*)percent, (fmtptr - percent) / fmtchsz); + break; + case HAWK_FMTOUT_FMT_TYPE_UCH: + PUT_UCS (fmtout, (const hawk_uch_t*)percent, (fmtptr - percent) / fmtchsz); + break; + } + /* + * Since we ignore an formatting argument it is no + * longer safe to obey the remaining formatting + * arguments as the arguments will no longer match + * the format specs. + */ + stop = 1; + break; + } + } + +done: + if (fb.fmt.ptr != fb.fmt.sbuf) HAWK_MMGR_FREE (fmtout->mmgr, fb.fmt.ptr); + if (fb.out.ptr != fb.out.sbuf) HAWK_MMGR_FREE (fmtout->mmgr, fb.out.ptr); + return 0; + +oops: + if (fb.fmt.ptr != fb.fmt.sbuf) HAWK_MMGR_FREE (fmtout->mmgr, fb.fmt.ptr); + if (fb.out.ptr != fb.out.sbuf) HAWK_MMGR_FREE (fmtout->mmgr, fb.out.ptr); + return -1; +} + +int hawk_bfmt_outv (hawk_fmtout_t* fmtout, const hawk_bch_t* fmt, va_list ap) +{ + int n; + const void* fmt_str; + hawk_fmtout_fmt_type_t fmt_type; + + fmt_str = fmtout->fmt_str; + fmt_type = fmtout->fmt_type; + + fmtout->fmt_type = HAWK_FMTOUT_FMT_TYPE_BCH; + fmtout->fmt_str = fmt; + + n = fmt_outv(fmtout, ap); + + fmtout->fmt_str = fmt_str; + fmtout->fmt_type = fmt_type; + return n; +} + +int hawk_ufmt_outv (hawk_fmtout_t* fmtout, const hawk_uch_t* fmt, va_list ap) +{ + int n; + const void* fmt_str; + hawk_fmtout_fmt_type_t fmt_type; + + fmt_str = fmtout->fmt_str; + fmt_type = fmtout->fmt_type; + + fmtout->fmt_type = HAWK_FMTOUT_FMT_TYPE_UCH; + fmtout->fmt_str = fmt; + + n = fmt_outv(fmtout, ap); + + fmtout->fmt_str = fmt_str; + fmtout->fmt_type = fmt_type; + return n; +} + +int hawk_bfmt_out (hawk_fmtout_t* fmtout, const hawk_bch_t* fmt, ...) +{ + va_list ap; + int n; + const void* fmt_str; + hawk_fmtout_fmt_type_t fmt_type; + + fmt_str = fmtout->fmt_str; + fmt_type = fmtout->fmt_type; + + fmtout->fmt_type = HAWK_FMTOUT_FMT_TYPE_BCH; + fmtout->fmt_str = fmt; + + va_start (ap, fmt); + n = fmt_outv(fmtout, ap); + va_end (ap); + + fmtout->fmt_str = fmt_str; + fmtout->fmt_type = fmt_type; + return n; +} + +int hawk_ufmt_out (hawk_fmtout_t* fmtout, const hawk_uch_t* fmt, ...) +{ + va_list ap; + int n; + const void* fmt_str; + hawk_fmtout_fmt_type_t fmt_type; + + fmt_str = fmtout->fmt_str; + fmt_type = fmtout->fmt_type; + + fmtout->fmt_type = HAWK_FMTOUT_FMT_TYPE_UCH; + fmtout->fmt_str = fmt; + + va_start (ap, fmt); + n = fmt_outv(fmtout, ap); + va_end (ap); + + fmtout->fmt_str = fmt_str; + fmtout->fmt_type = fmt_type; + return n; +} + +/* -------------------------------------------------------------------------- + * FORMATTED LOG OUTPUT + * -------------------------------------------------------------------------- */ + +#if 0 +static int log_oocs (hawk_fmtout_t* fmtout, const hawk_ooch_t* ptr, hawk_oow_t len) +{ + hawk_t* hawk = (hawk_t*)fmtout->ctx; + hawk_oow_t rem; + + if (len <= 0) return 1; + + if (hawk->log.len > 0 && hawk->log.last_mask != fmtout->mask) + { + /* the mask has changed. commit the buffered text */ +/* TODO: HANDLE LINE ENDING CONVENTION BETTER... */ + if (hawk->log.ptr[hawk->log.len - 1] != '\n') + { + /* no line ending - append a line terminator */ + hawk->log.ptr[hawk->log.len++] = '\n'; + } + + vmprim_log_write (hawk, hawk->log.last_mask, hawk->log.ptr, hawk->log.len); + hawk->log.len = 0; + } + +redo: + rem = 0; + if (len > hawk->log.capa - hawk->log.len) + { + hawk_oow_t newcapa, max; + hawk_ooch_t* tmp; + + max = HAWK_TYPE_MAX(hawk_oow_t) - hawk->log.len; + if (len > max) + { + /* data too big. */ + rem += len - max; + len = max; + } + + newcapa = HAWK_ALIGN_POW2(hawk->log.len + len, 512); /* TODO: adjust this capacity */ + if (newcapa > hawk->option.log_maxcapa) + { + /* [NOTE] + * it doesn't adjust newcapa to hawk->option.log_maxcapa. + * nor does it cut the input to fit it into the adjusted capacity. + * if maxcapa set is not aligned to HAWK_LOG_CAPA_ALIGN, + * the largest buffer capacity may be suboptimal */ + goto make_do; + } + + /* +1 to handle line ending injection more easily */ + tmp = hawk_reallocmem(hawk, hawk->log.ptr, (newcapa + 1) * HAWK_SIZEOF(*tmp)); + if (!tmp) + { + make_do: + if (hawk->log.len > 0) + { + /* can't expand the buffer. just flush the existing contents */ + /* TODO: HANDLE LINE ENDING CONVENTION BETTER... */ + if (hawk->log.ptr[hawk->log.len - 1] != '\n') + { + /* no line ending - append a line terminator */ + hawk->log.ptr[hawk->log.len++] = '\n'; + } + vmprim_log_write (hawk, hawk->log.last_mask, hawk->log.ptr, hawk->log.len); + hawk->log.len = 0; + } + + if (len > hawk->log.capa) + { + rem += len - hawk->log.capa; + len = hawk->log.capa; + } + } + else + { + hawk->log.ptr = tmp; + hawk->log.capa = newcapa; + } + } + + HAWK_MEMCPY (&hawk->log.ptr[hawk->log.len], ptr, len * HAWK_SIZEOF(*ptr)); + hawk->log.len += len; + hawk->log.last_mask = fmtout->mask; + + if (rem > 0) + { + ptr += len; + len = rem; + goto redo; + } + + return 1; /* success */ +} + +#if defined(HAWK_OOCH_IS_BCH) +#define log_bcs log_oocs + +static int log_ucs (hawk_fmtout_t* fmtout, const hawk_uch_t* ptr, hawk_oow_t len) +{ + hawk_t* hawk = (hawk_t*)fmtout->ctx; + hawk_bch_t bcs[128]; + hawk_oow_t bcslen, rem; + + rem = len; + while (rem > 0) + { + len = rem; + bcslen = HAWK_COUNTOF(bcs); + hawk_conv_uchars_to_bchars_with_cmgr(ptr, &len, bcs, &bcslen, hawk_getcmgr(hawk)); + log_bcs(fmtout, bcs, bcslen); + rem -= len; + ptr += len; + } + return 1; +} + + +#else + +#define log_ucs log_oocs + +static int log_bcs (hawk_fmtout_t* fmtout, const hawk_bch_t* ptr, hawk_oow_t len) +{ + hawk_t* hawk = (hawk_t*)fmtout->ctx; + hawk_uch_t ucs[64]; + hawk_oow_t ucslen, rem; + + rem = len; + while (rem > 0) + { + len = rem; + ucslen = HAWK_COUNTOF(ucs); + hawk_conv_bchars_to_uchars_with_cmgr(ptr, &len, ucs, &ucslen, hawk_getcmgr(hawk), 1); + log_ucs(fmtout, ucs, ucslen); + rem -= len; + ptr += len; + } + return 1; +} + +#endif + +hawk_ooi_t hawk_logbfmtv (hawk_t* hawk, hawk_bitmask_t mask, const hawk_bch_t* fmt, va_list ap) +{ + int x; + hawk_fmtout_t fo; + + if (hawk->log.default_type_mask & HAWK_LOG_ALL_TYPES) + { + /* if a type is given, it's not untyped any more. + * mask off the UNTYPED bit */ + mask &= ~HAWK_LOG_UNTYPED; + + /* if the default_type_mask has the UNTYPED bit on, + * it'll get turned back on */ + mask |= (hawk->log.default_type_mask & HAWK_LOG_ALL_TYPES); + } + else if (!(mask & HAWK_LOG_ALL_TYPES)) + { + /* no type is set in the given mask and no default type is set. + * make it UNTYPED. */ + mask |= HAWK_LOG_UNTYPED; + } + + HAWK_MEMSET (&fo, 0, HAWK_SIZEOF(fo)); + fo.fmt_type = HAWK_FMTOUT_FMT_TYPE_BCH; + fo.fmt_str = fmt; + fo.ctx = hawk; + fo.mask = mask; + fo.putbchars = log_bcs; + fo.putuchars = log_ucs; + + x = fmt_outv(&fo, ap); + + if (hawk->log.len > 0 && hawk->log.ptr[hawk->log.len - 1] == '\n') + { + vmprim_log_write (hawk, hawk->log.last_mask, hawk->log.ptr, hawk->log.len); + hawk->log.len = 0; + } + + return (x <= -1)? -1: fo.count; +} + +hawk_ooi_t hawk_logbfmt (hawk_t* hawk, hawk_bitmask_t mask, const hawk_bch_t* fmt, ...) +{ + hawk_ooi_t x; + va_list ap; + + va_start (ap, fmt); + x = hawk_logbfmtv(hawk, mask, fmt, ap); + va_end (ap); + + return x; +} + +hawk_ooi_t hawk_logufmtv (hawk_t* hawk, hawk_bitmask_t mask, const hawk_uch_t* fmt, va_list ap) +{ + int x; + hawk_fmtout_t fo; + + if (hawk->log.default_type_mask & HAWK_LOG_ALL_TYPES) + { + /* if a type is given, it's not untyped any more. + * mask off the UNTYPED bit */ + mask &= ~HAWK_LOG_UNTYPED; + + /* if the default_type_mask has the UNTYPED bit on, + * it'll get turned back on */ + mask |= (hawk->log.default_type_mask & HAWK_LOG_ALL_TYPES); + } + else if (!(mask & HAWK_LOG_ALL_TYPES)) + { + /* no type is set in the given mask and no default type is set. + * make it UNTYPED. */ + mask |= HAWK_LOG_UNTYPED; + } + + HAWK_MEMSET (&fo, 0, HAWK_SIZEOF(fo)); + fo.fmt_type = HAWK_FMTOUT_FMT_TYPE_UCH; + fo.fmt_str = fmt; + fo.ctx = hawk; + fo.mask = mask; + fo.putbchars = log_bcs; + fo.putuchars = log_ucs; + + x = fmt_outv(&fo, ap); + + if (hawk->log.len > 0 && hawk->log.ptr[hawk->log.len - 1] == '\n') + { + vmprim_log_write (hawk, hawk->log.last_mask, hawk->log.ptr, hawk->log.len); + hawk->log.len = 0; + } + return (x <= -1)? -1: fo.count; +} + +hawk_ooi_t hawk_logufmt (hawk_t* hawk, hawk_bitmask_t mask, const hawk_uch_t* fmt, ...) +{ + hawk_ooi_t x; + va_list ap; + + va_start (ap, fmt); + x = hawk_logufmtv(hawk, mask, fmt, ap); + va_end (ap); + + return x; +} +#endif + +/* -------------------------------------------------------------------------- + * STRING FORMATTING + * -------------------------------------------------------------------------- */ + +#if 0 +static int sprint_bchars (hawk_fmtout_t* fmtout, const hawk_bch_t* ptr, hawk_oow_t len) +{ + hawk_t* hawk = (hawk_t*)fmtout->ctx; + hawk_oow_t unused, oolen, blen; + + unused = hawk->sprintf.xbuf.capa - hawk->sprintf.xbuf.len; + +#if defined(HAWK_OOCH_IS_UCH) + blen = len; + hawk_conv_bchars_to_uchars_with_cmgr (ptr, &blen, HAWK_NULL, &oolen, hawk_getcmgr(hawk), 1); +#else + oolen = len; +#endif + + if (oolen > unused) + { + hawk_ooch_t* tmp; + hawk_oow_t newcapa; + + newcapa = hawk->sprintf.xbuf.len + oolen + 1; + newcapa = HAWK_ALIGN_POW2(newcapa, 256); + + tmp = (hawk_ooch_t*)hawk_reallocmem(hawk, hawk->sprintf.xbuf.ptr, newcapa * HAWK_SIZEOF(*tmp)); + if (!tmp) return -1; + + hawk->sprintf.xbuf.ptr = tmp; + hawk->sprintf.xbuf.capa = newcapa; + } + +#if defined(HAWK_OOCH_IS_UCH) + hawk_conv_bchars_to_uchars_with_cmgr (ptr, &len, &hawk->sprintf.xbuf.ptr[hawk->sprintf.xbuf.len], &oolen, hawk_getcmgr(hawk), 1); +#else + HAWK_MEMCPY (&hawk->sprintf.xbuf.ptr[hawk->sprintf.xbuf.len], ptr, len * HAWK_SIZEOF(*ptr)); +#endif + hawk->sprintf.xbuf.len += oolen; + + return 1; /* success */ +} + +static int sprint_uchars (hawk_fmtout_t* fmtout, const hawk_uch_t* ptr, hawk_oow_t len) +{ + hawk_t* hawk = (hawk_t*)fmtout->ctx; + hawk_oow_t unused, oolen, ulen; + + unused = hawk->sprintf.xbuf.capa - hawk->sprintf.xbuf.len; + +#if defined(HAWK_OOCH_IS_UCH) + oolen = len; +#else + ulen = len; + hawk_conv_uchars_to_bchars_with_cmgr (ptr, &ulen, HAWK_NULL, &oolen, hawk_getcmgr(hawk)); +#endif + + if (oolen > unused) + { + hawk_ooch_t* tmp; + hawk_oow_t newcapa; + + newcapa = hawk->sprintf.xbuf.len + oolen + 1; + newcapa = HAWK_ALIGN_POW2(newcapa, 256); + + tmp = (hawk_ooch_t*)hawk_reallocmem(hawk, hawk->sprintf.xbuf.ptr, newcapa * HAWK_SIZEOF(*tmp)); + if (!tmp) return -1; + + hawk->sprintf.xbuf.ptr = tmp; + hawk->sprintf.xbuf.capa = newcapa; + } + +#if defined(HAWK_OOCH_IS_UCH) + HAWK_MEMCPY (&hawk->sprintf.xbuf.ptr[hawk->sprintf.xbuf.len], ptr, len * HAWK_SIZEOF(*ptr)); +#else + hawk_conv_uchars_to_bchars_with_cmgr (ptr, &len, &hawk->sprintf.xbuf.ptr[hawk->sprintf.xbuf.len], &oolen, hawk_getcmgr(hawk)); +#endif + hawk->sprintf.xbuf.len += oolen; + + return 1; /* success */ +} + + +#endif diff --git a/hawk/lib/fnc-prv.h b/hawk/lib/fnc-prv.h new file mode 100644 index 00000000..83f45442 --- /dev/null +++ b/hawk/lib/fnc-prv.h @@ -0,0 +1,77 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_FNC_PRV_H_ +#define _HAWK_FNC_PRV_H_ + +struct hawk_fnc_t +{ + struct + { + hawk_ooch_t* ptr; + hawk_oow_t len; + } name; + + int dfl0; /* if set, ($0) is assumed if () is missing. + * this ia mainly for the weird length() function */ + + hawk_fnc_spec_t spec; + const hawk_ooch_t* owner; /* set this to a module name if a built-in function is located in a module */ + + hawk_mod_t* mod; /* set by the engine to a valid pointer if it's associated to a module */ +}; + +#if defined(__cplusplus) +extern "C" { +#endif + +hawk_fnc_t* hawk_findfncwithbcs (hawk_t* awk, const hawk_bcs_t* name); +hawk_fnc_t* hawk_findfncwithucs (hawk_t* awk, const hawk_ucs_t* name); + +#if defined(HAWK_OOCH_IS_BCH) +# define hawk_findfncwithoocs hawk_findfncwithbcs +#else +# define hawk_findfncwithoocs hawk_findfncwithucs +#endif + +/* EXPORT is required for linking on windows as they are referenced by mod-str.c */ +HAWK_EXPORT int hawk_fnc_gsub (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi); +HAWK_EXPORT int hawk_fnc_index (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi); +HAWK_EXPORT int hawk_fnc_length (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi); +HAWK_EXPORT int hawk_fnc_match (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi); +HAWK_EXPORT int hawk_fnc_rindex (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi); +HAWK_EXPORT int hawk_fnc_split (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi); +HAWK_EXPORT int hawk_fnc_sprintf (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi); +HAWK_EXPORT int hawk_fnc_sub (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi); +HAWK_EXPORT int hawk_fnc_substr (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi); +HAWK_EXPORT int hawk_fnc_tolower (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi); +HAWK_EXPORT int hawk_fnc_toupper (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi); + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/hawk/lib/fnc.c b/hawk/lib/fnc.c new file mode 100644 index 00000000..08511a76 --- /dev/null +++ b/hawk/lib/fnc.c @@ -0,0 +1,1868 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "hawk-prv.h" + +static int fnc_close (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi); +static int fnc_fflush (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi); +static int fnc_int (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi); +static int fnc_typename (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi); +static int fnc_isnil (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi); +static int fnc_ismap (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi); +static int fnc_asort (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi); +static int fnc_asorti (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi); + +#define A_MAX HAWK_TYPE_MAX(int) + +/* Argument Specifier + * + * Each character in the specifier indicates how a parameter + * of the corresponding postion should be passed to a function. + * + * - v: value. pass it after normal evaluation. + * - r: pass a variable by reference + * - x: regular expression as it is. not evaluated as /rex/ ~ $0. + * + * NOTE: If min is greater than max, the specifier indicate the + * name of the module where the function is located. + */ +static hawk_fnc_t sysfnctab[] = +{ + /* io functions */ + { {HAWK_T("close"), 5}, 0, { {1, 2, HAWK_NULL}, fnc_close, HAWK_RIO }, HAWK_NULL}, + { {HAWK_T("fflush"), 6}, 0, { {0, 1, HAWK_NULL}, fnc_fflush, HAWK_RIO }, HAWK_NULL}, + + /* type info/conversion */ + { {HAWK_T("int"), 3}, 0, { {1, 1, HAWK_NULL}, fnc_int, 0 }, HAWK_NULL}, + { {HAWK_T("isnil"), 5}, 0, { {1, 1, HAWK_NULL}, fnc_isnil, 0 }, HAWK_NULL}, + { {HAWK_T("ismap"), 5}, 0, { {1, 1, HAWK_NULL}, fnc_ismap, 0 }, HAWK_NULL}, + { {HAWK_T("typename"), 8}, 0, { {1, 1, HAWK_NULL}, fnc_typename, 0 }, HAWK_NULL}, + + /* map(array) sort */ + { {HAWK_T("asort"), 5}, 0, { {1, 3, HAWK_T("rrv")}, fnc_asort, 0 }, HAWK_NULL}, + { {HAWK_T("asorti"), 6}, 0, { {1, 3, HAWK_T("rrv")}, fnc_asorti, 0 }, HAWK_NULL}, + + /* string functions */ + { {HAWK_T("gsub"), 4}, 0, { {2, 3, HAWK_T("xvr")}, hawk_fnc_gsub, 0 }, HAWK_NULL}, + { {HAWK_T("index"), 5}, 0, { {2, 3, HAWK_NULL}, hawk_fnc_index, 0 }, HAWK_NULL}, + { {HAWK_T("length"), 6}, 1, { {0, 1, HAWK_NULL}, hawk_fnc_length, 0 }, HAWK_NULL}, + { {HAWK_T("match"), 5}, 0, { {2, 4, HAWK_T("vxvr")}, hawk_fnc_match, 0 }, HAWK_NULL}, + { {HAWK_T("split"), 5}, 0, { {2, 3, HAWK_T("vrx")}, hawk_fnc_split, 0 }, HAWK_NULL}, + { {HAWK_T("sprintf"), 7}, 0, { {1, A_MAX, HAWK_NULL}, hawk_fnc_sprintf, 0 }, HAWK_NULL}, + { {HAWK_T("sub"), 3}, 0, { {2, 3, HAWK_T("xvr")}, hawk_fnc_sub, 0 }, HAWK_NULL}, + { {HAWK_T("substr"), 6}, 0, { {2, 3, HAWK_NULL}, hawk_fnc_substr, 0 }, HAWK_NULL}, + { {HAWK_T("tolower"), 7}, 0, { {1, 1, HAWK_NULL}, hawk_fnc_tolower, 0 }, HAWK_NULL}, + { {HAWK_T("toupper"), 7}, 0, { {1, 1, HAWK_NULL}, hawk_fnc_toupper, 0 }, HAWK_NULL}, + + /* math functions */ + { {HAWK_T("sin"), 3}, 0, { {A_MAX, 0, HAWK_T("math") }, HAWK_NULL, 0 }, HAWK_NULL}, + { {HAWK_T("cos"), 3}, 0, { {A_MAX, 0, HAWK_T("math") }, HAWK_NULL, 0 }, HAWK_NULL}, + { {HAWK_T("tan"), 3}, 0, { {A_MAX, 0, HAWK_T("math") }, HAWK_NULL, 0 }, HAWK_NULL}, + { {HAWK_T("atan"), 4}, 0, { {A_MAX, 0, HAWK_T("math") }, HAWK_NULL, 0 }, HAWK_NULL}, + { {HAWK_T("atan2"), 5}, 0, { {A_MAX, 0, HAWK_T("math") }, HAWK_NULL, 0 }, HAWK_NULL}, + { {HAWK_T("log"), 3}, 0, { {A_MAX, 0, HAWK_T("math") }, HAWK_NULL, 0 }, HAWK_NULL}, + { {HAWK_T("log10"), 5}, 0, { {A_MAX, 0, HAWK_T("math") }, HAWK_NULL, 0 }, HAWK_NULL}, + { {HAWK_T("exp"), 3}, 0, { {A_MAX, 0, HAWK_T("math") }, HAWK_NULL, 0 }, HAWK_NULL}, + { {HAWK_T("sqrt"), 4}, 0, { {A_MAX, 0, HAWK_T("math") }, HAWK_NULL, 0 }, HAWK_NULL}, + + /* time functions */ + { {HAWK_T("mktime"), 6}, 0, { {A_MAX, 0, HAWK_T("sys") }, HAWK_NULL, 0 }, HAWK_NULL}, + { {HAWK_T("strftime"), 8}, 0, { {A_MAX, 0, HAWK_T("sys") }, HAWK_NULL, 0 }, HAWK_NULL}, + { {HAWK_T("systime"), 7}, 0, { {A_MAX, 0, HAWK_T("sys") }, HAWK_NULL, 0 }, HAWK_NULL} +}; + +static hawk_fnc_t* add_fnc (hawk_t* awk, const hawk_ooch_t* name, const hawk_fnc_spec_t* spec) +{ + hawk_fnc_t* fnc; + hawk_oow_t fnc_size; + hawk_oow_t speclen; + hawk_oocs_t ncs; + + ncs.ptr = (hawk_ooch_t*)name; + ncs.len = hawk_count_oocstr(name); + if (ncs.len <= 0) + { + hawk_seterrnum (awk, HAWK_EINVAL, HAWK_NULL); + return HAWK_NULL; + } + + /* Note it doesn't check if it conflicts with a keyword. + * such a function registered won't take effect because + * the word is treated as a keyword */ + + if (hawk_findfncwithoocs(awk, &ncs) != HAWK_NULL) + { + hawk_seterrnum (awk, HAWK_EEXIST, &ncs); + return HAWK_NULL; + } + + speclen = spec->arg.spec? hawk_count_oocstr(spec->arg.spec): 0; + + fnc_size = HAWK_SIZEOF(*fnc) + (ncs.len + 1 + speclen + 1) * HAWK_SIZEOF(hawk_ooch_t); + fnc = (hawk_fnc_t*)hawk_callocmem(awk, fnc_size); + if (fnc) + { + hawk_ooch_t* tmp; + + tmp = (hawk_ooch_t*)(fnc + 1); + fnc->name.len = hawk_copy_oocstr_unlimited(tmp, ncs.ptr); + fnc->name.ptr = tmp; + + fnc->spec = *spec; + if (spec->arg.spec) + { + tmp = fnc->name.ptr + fnc->name.len + 1; + hawk_copy_oocstr_unlimited (tmp, spec->arg.spec); + fnc->spec.arg.spec = tmp; + } + + if (hawk_htb_insert(awk->fnc.user, (hawk_ooch_t*)ncs.ptr, ncs.len, fnc, 0) == HAWK_NULL) + { + hawk_seterrnum (awk, HAWK_ENOMEM, HAWK_NULL); + hawk_freemem (awk, fnc); + fnc = HAWK_NULL; + } + } + + return fnc; +} + +hawk_fnc_t* hawk_addfncwithbcstr (hawk_t* awk, const hawk_bch_t* name, const hawk_fnc_mspec_t* spec) +{ +#if defined(HAWK_OOCH_IS_BCH) + return add_fnc(awk, name, spec); +#else + hawk_ucs_t wcs; + hawk_fnc_t* fnc; + hawk_fnc_spec_t wspec; + + HAWK_STATIC_ASSERT (HAWK_SIZEOF(*spec) == HAWK_SIZEOF(wspec)); + + HAWK_MEMCPY (&wspec, spec, HAWK_SIZEOF(wspec)); + if (spec->arg.spec) + { + wcs.ptr = hawk_dupbtoucstr(awk, spec->arg.spec, &wcs.len, 0); + if (!wcs.ptr) return HAWK_NULL; + wspec.arg.spec = wcs.ptr; + } + + wcs.ptr = hawk_dupbtoucstr(awk, name, &wcs.len, 0); + if (!wcs.ptr) + { + if (wspec.arg.spec) hawk_freemem (awk, (hawk_uch_t*)wspec.arg.spec); + return HAWK_NULL; + } + + fnc = add_fnc(awk, wcs.ptr, &wspec); + hawk_freemem (awk, wcs.ptr); + if (wspec.arg.spec) hawk_freemem (awk, (hawk_uch_t*)wspec.arg.spec); + return fnc; +#endif +} + +hawk_fnc_t* hawk_addfncwithucstr (hawk_t* awk, const hawk_uch_t* name, const hawk_fnc_wspec_t* spec) +{ +#if defined(HAWK_OOCH_IS_BCH) + hawk_bcs_t mbs; + hawk_fnc_t* fnc; + hawk_fnc_spec_t mspec; + + HAWK_STATIC_ASSERT (HAWK_SIZEOF(*spec) == HAWK_SIZEOF(mspec)); + + HAWK_MEMCPY (&mspec, spec, HAWK_SIZEOF(mspec)); + if (spec->arg.spec) + { + mbs.ptr = hawk_duputobcstr(awk, spec->arg.spec, &mbs.len); + if (!mbs.ptr) return HAWK_NULL; + mspec.arg.spec = mbs.ptr; + } + + mbs.ptr = hawk_duputobcstr(awk, name, &mbs.len); + if (!mbs.ptr) + { + if (mspec.arg.spec) hawk_freemem (awk, (hawk_bch_t*)mspec.arg.spec); + return HAWK_NULL; + } + + fnc = add_fnc(awk, mbs.ptr, &mspec); + hawk_freemem (awk, mbs.ptr); + if (mspec.arg.spec) hawk_freemem (awk, (hawk_bch_t*)mspec.arg.spec); + return fnc; +#else + return add_fnc(awk, name, spec); +#endif +} + +int hawk_delfncwithbcstr (hawk_t* awk, const hawk_bch_t* name) +{ + hawk_bcs_t ncs; + hawk_ucs_t wcs; + + ncs.ptr = (hawk_bch_t*)name; + ncs.len = hawk_count_bcstr(name); + +#if defined(HAWK_OOCH_IS_BCH) + if (hawk_htb_delete(awk->fnc.user, ncs.ptr, ncs.len) <= -1) + { + hawk_seterrnum (awk, HAWK_ENOENT, &ncs); + return -1; + } +#else + wcs.ptr = hawk_dupbtoucstr(awk, ncs.ptr, &wcs.len, 0); + if (!wcs.ptr) return -1; + if (hawk_htb_delete(awk->fnc.user, wcs.ptr, wcs.len) <= -1) + { + hawk_seterrnum (awk, HAWK_ENOENT, &wcs); + hawk_freemem (awk, wcs.ptr); + return -1; + } + hawk_freemem (awk, wcs.ptr); +#endif + + return 0; +} + +int hawk_delfncwithucstr (hawk_t* awk, const hawk_uch_t* name) +{ + hawk_ucs_t ncs; + hawk_bcs_t mbs; + + ncs.ptr = (hawk_uch_t*)name; + ncs.len = hawk_count_ucstr(name); + +#if defined(HAWK_OOCH_IS_BCH) + mbs.ptr = hawk_duputobcstr(awk, ncs.ptr, &mbs.len); + if (!mbs.ptr) return -1; + if (hawk_htb_delete(awk->fnc.user, mbs.ptr, mbs.len) <= -1) + { + hawk_seterrnum (awk, HAWK_ENOENT, &mbs); + hawk_freemem (awk, mbs.ptr); + return -1; + } + hawk_freemem (awk, mbs.ptr); +#else + if (hawk_htb_delete(awk->fnc.user, ncs.ptr, ncs.len) <= -1) + { + hawk_seterrnum (awk, HAWK_ENOENT, &ncs); + return -1; + } +#endif + + return 0; +} + +void hawk_clrfnc (hawk_t* awk) +{ + hawk_htb_clear (awk->fnc.user); +} + +static hawk_fnc_t* find_fnc (hawk_t* awk, const hawk_oocs_t* name) +{ + hawk_htb_pair_t* pair; + int i; + + /* search the system function table + * though some optimization like binary search can + * speed up the search, i don't do that since this + * function is called durting parse-time only. + */ + for (i = 0; i < HAWK_COUNTOF(sysfnctab); i++) + { + if ((awk->opt.trait & sysfnctab[i].spec.trait) != sysfnctab[i].spec.trait) continue; + + if (hawk_comp_oochars(sysfnctab[i].name.ptr, sysfnctab[i].name.len, name->ptr, name->len, 0) == 0) return &sysfnctab[i]; + } + + pair = hawk_htb_search(awk->fnc.user, name->ptr, name->len); + if (pair) + { + hawk_fnc_t* fnc; + fnc = (hawk_fnc_t*)HAWK_HTB_VPTR(pair); + if ((awk->opt.trait & fnc->spec.trait) == fnc->spec.trait) return fnc; + } + + hawk_seterrnum (awk, HAWK_ENOENT, name); + return HAWK_NULL; +} + +hawk_fnc_t* hawk_findfncwithbcs (hawk_t* awk, const hawk_bcs_t* name) +{ +#if defined(HAWK_OOCH_IS_BCH) + return find_fnc(awk, name); +#else + hawk_ucs_t wcs; + hawk_fnc_t* fnc; + + wcs.ptr = hawk_dupbtouchars(awk, name->ptr, name->len, &wcs.len, 0); + if (!wcs.ptr) return HAWK_NULL; + fnc = find_fnc(awk, &wcs); + hawk_freemem (awk, wcs.ptr); + return fnc; +#endif +} + +hawk_fnc_t* hawk_findfncwithucs (hawk_t* awk, const hawk_ucs_t* name) +{ +#if defined(HAWK_OOCH_IS_BCH) + hawk_bcs_t mbs; + hawk_fnc_t* fnc; + + mbs.ptr = hawk_duputobchars(awk, name->ptr, name->len, &mbs.len); + if (!mbs.ptr) return HAWK_NULL; + fnc = find_fnc(awk, &mbs); + hawk_freemem (awk, mbs.ptr); + return fnc; +#else + return find_fnc(awk, name); +#endif +} + +static int fnc_close (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_oow_t nargs; + hawk_val_t* v, * a0, * a1 = HAWK_NULL; + int n; + + hawk_ooch_t* name, * opt = HAWK_NULL; + hawk_oow_t len, optlen = 0; + + nargs = hawk_rtx_getnargs(rtx); + HAWK_ASSERT (hawk_rtx_getawk(rtx), nargs == 1 || nargs == 2); + + a0 = hawk_rtx_getarg (rtx, 0); + if (nargs >= 2) a1 = hawk_rtx_getarg(rtx, 1); + HAWK_ASSERT (hawk_rtx_getawk(rtx), a0 != HAWK_NULL); + + name = hawk_rtx_getvaloocstr(rtx, a0, &len); + if (name == HAWK_NULL) return -1; + + if (a1) + { + opt = hawk_rtx_getvaloocstr(rtx, a1, &optlen); + if (opt == HAWK_NULL) + { + hawk_rtx_freevaloocstr(rtx, a0, name); + return -1; + } + } + + if (len == 0) + { + /* getline or print doesn't allow an empty string for the + * input or output file name. so close should not allow + * it either. + * another reason for this is if close is called explicitly + * with an empty string, it may close the console that uses + * an empty string for its identification because closeio + * closes any ios that match the name given unlike + * closeio_read or closeio_write. */ + n = -1; + goto skip_close; + } + + while (len > 0) + { + if (name[--len] == HAWK_T('\0')) + { + /* the name contains a null charater. + * make close return -1 */ + n = -1; + goto skip_close; + } + } + + if (opt) + { + if (optlen != 1 || (opt[0] != HAWK_T('r') && opt[0] != HAWK_T('w'))) + { + n = -1; + goto skip_close; + } + } + + n = hawk_rtx_closeio (rtx, name, opt); + /* failure to close is not a critical error. instead, that is + * flagged by the return value of close(). + if (n <= -1 && rtx->errinf.num != HAWK_EIONMNF) + { + if (a0->type != HAWK_VAL_STR) hawk_rtx_freemem (rtx, name); + return -1; + } + */ + +skip_close: + if (a1) hawk_rtx_freevaloocstr (rtx, a1, opt); + hawk_rtx_freevaloocstr (rtx, a0, name); + + v = hawk_rtx_makeintval (rtx, (hawk_int_t)n); + if (v == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, v); + return 0; +} + +static int flush_io (hawk_rtx_t* rtx, int rio, const hawk_ooch_t* name, int n) +{ + int n2; + + if (rtx->rio.handler[rio] != HAWK_NULL) + { + n2 = hawk_rtx_flushio (rtx, rio, name); + if (n2 <= -1) + { + /* + if (rtx->errinf.num == HAWK_EIOIMPL) n = -1; + else if (rtx->errinf.num == HAWK_EIONMNF) + { + if (n != 0) n = -2; + } + else n = -99; + */ + if (hawk_rtx_geterrnum(rtx) == HAWK_EIONMNF) + { + if (n != 0) n = -2; + } + else n = -1; + } + else if (n != -1) n = 0; + } + + return n; +} + +static int fnc_fflush (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_oow_t nargs; + hawk_val_t* a0, * v; + hawk_ooch_t* str0; + hawk_oow_t len0; + int n; + + nargs = hawk_rtx_getnargs (rtx); + HAWK_ASSERT (hawk_rtx_getawk(rtx), nargs == 0 || nargs == 1); + + if (nargs == 0) + { + /* fflush() flushes the console output. + * fflush() should return -1 on errors. + * + * if no previous console output statement is seen, + * this function won't be able to find the entry. + * so it returns -1; + * + * BEGIN { flush(); } # flush() returns -1 + * BEGIN { print 1; flush(); } # flush() returns 0 + */ + n = hawk_rtx_flushio (rtx, HAWK_OUT_CONSOLE, HAWK_T("")); + } + else + { + hawk_ooch_t* ptr, * end; + + a0 = hawk_rtx_getarg (rtx, 0); + str0 = hawk_rtx_getvaloocstr (rtx, a0, &len0); + if (str0 == HAWK_NULL) return -1; + + /* the target name contains a null character. + * make fflush return -1 */ + ptr = str0; end = str0 + len0; + while (ptr < end) + { + if (*ptr == HAWK_T('\0')) + { + n = -1; + goto skip_flush; + } + + ptr++; + } + + /* flush the given rio. + * + * flush("") flushes all output streams regardless of names. + * pass HAWK_NULL for the name in that case so that the + * callee matches any streams. + * + * fflush() doesn't specify the type of output streams + * so it attemps to flush all types of output streams. + * + * though not useful, it's possible to have multiple + * streams with the same name but of different types. + * + * BEGIN { + * print 1 | "/tmp/x"; + * print 1 > "/tmp/x"; + * fflush("/tmp/x"); + * } + */ + + n = flush_io ( + rtx, HAWK_OUT_FILE, + ((len0 == 0)? HAWK_NULL: str0), 1); + /*if (n == -99) return -1;*/ + n = flush_io ( + rtx, HAWK_OUT_APFILE, + ((len0 == 0)? HAWK_NULL: str0), n); + /*if (n == -99) return -1;*/ + n = flush_io ( + rtx, HAWK_OUT_PIPE, + ((len0 == 0)? HAWK_NULL: str0), n); + /*if (n == -99) return -1;*/ + n = flush_io ( + rtx, HAWK_OUT_RWPIPE, + ((len0 == 0)? HAWK_NULL: str0), n); + /*if (n == -99) return -1;*/ + + /* if n remains 1, no io handlers have been defined for + * file, pipe, and rwpipe. so make fflush return -1. + * if n is -2, no such named io has been found at all + * if n is -1, the io handler has returned an error */ + if (n != 0) n = -1; + + skip_flush: + hawk_rtx_freevaloocstr (rtx, a0, str0); + } + + v = hawk_rtx_makeintval (rtx, (hawk_int_t)n); + if (v == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, v); + return 0; +} + +static int index_or_rindex (hawk_rtx_t* rtx, int rindex) +{ + /* this is similar to the built-in index() function but doesn't + * care about IGNORECASE. */ + hawk_oow_t nargs; + hawk_val_t* a0, * a1; + hawk_int_t idx, boundary = 1; + + nargs = hawk_rtx_getnargs(rtx); + a0 = hawk_rtx_getarg(rtx, 0); + a1 = hawk_rtx_getarg(rtx, 1); + + /* + index ("abc", "d", 3); + rindex ("abcdefabcdx", "cd", 8); + */ + + if (nargs >= 3) + { + hawk_val_t* a2; + int n; + + a2 = hawk_rtx_getarg(rtx, 2); + n = hawk_rtx_valtoint(rtx, a2, &boundary); + if (n <= -1) return -1; + } + + if (HAWK_RTX_GETVALTYPE(rtx, a0) == HAWK_VAL_MBS) + { + hawk_bch_t* str0, * str1, * ptr; + hawk_oow_t len0, len1; + + str0 = ((hawk_val_mbs_t*)a0)->val.ptr; + len0 = ((hawk_val_mbs_t*)a0)->val.len; + + str1 = hawk_rtx_getvalbcstr(rtx, a1, &len1); + if (!str1) return -1; + + if (nargs < 3) + { + boundary = rindex? len0: 1; + } + else + { + if (boundary == 0) boundary = 1; + else if (boundary < 0) boundary = len0 + boundary + 1; + } + + if (boundary > len0 || boundary <= 0) + { + ptr = HAWK_NULL; + } + else if (rindex) + { + /* 'boundary' acts as an end position */ + ptr = hawk_rfind_bchars_in_bchars(&str0[0], boundary, str1, len1, rtx->gbl.ignorecase); + } + else + { + /* 'boundary' acts as an start position */ + ptr = hawk_find_bchars_in_bchars(&str0[boundary-1], len0 - boundary + 1, str1, len1, rtx->gbl.ignorecase); + } + + idx = (ptr == HAWK_NULL)? 0: ((hawk_int_t)(ptr - str0) + 1); + + hawk_rtx_freevalbcstr (rtx, a1, str1); + } + else + { + hawk_ooch_t* str0, * str1, * ptr; + hawk_oow_t len0, len1; + + str0 = hawk_rtx_getvaloocstr(rtx, a0, &len0); + if (!str0) return -1; + + str1 = hawk_rtx_getvaloocstr(rtx, a1, &len1); + if (!str1) + { + hawk_rtx_freevaloocstr (rtx, a0, str0); + return -1; + } + + if (nargs < 3) + { + boundary = rindex? len0: 1; + } + else + { + if (boundary == 0) boundary = 1; + else if (boundary < 0) boundary = len0 + boundary + 1; + } + + if (boundary > len0 || boundary <= 0) + { + ptr = HAWK_NULL; + } + else if (rindex) + { + /* 'boundary' acts as an end position */ + ptr = hawk_rfind_oochars_in_oochars(&str0[0], boundary, str1, len1, rtx->gbl.ignorecase); + } + else + { + /* 'boundary' acts as an start position */ + ptr = hawk_find_oochars_in_oochars(&str0[boundary-1], len0 - boundary + 1, str1, len1, rtx->gbl.ignorecase); + } + + idx = (ptr == HAWK_NULL)? 0: ((hawk_int_t)(ptr - str0) + 1); + + hawk_rtx_freevaloocstr (rtx, a1, str1); + hawk_rtx_freevaloocstr (rtx, a0, str0); + } + + a0 = hawk_rtx_makeintval(rtx, idx); + if (a0 == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, a0); + return 0; +} + +int hawk_fnc_index (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return index_or_rindex (rtx, 0); +} + +int hawk_fnc_rindex (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return index_or_rindex (rtx, 1); +} + +int hawk_fnc_length (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_oow_t nargs; + hawk_val_t* v; + hawk_val_type_t vtype; + hawk_ooch_t* str; + hawk_oow_t len; + + nargs = hawk_rtx_getnargs (rtx); + HAWK_ASSERT (hawk_rtx_getawk(rtx), nargs >= 0 && nargs <= 1); + + if (nargs == 0) + { + /* get the length of $0 */ + len = HAWK_OOECS_LEN(&rtx->inrec.line); + } + else + { + v = hawk_rtx_getarg (rtx, 0); + vtype = HAWK_RTX_GETVALTYPE (rtx, v); + + switch (vtype) + { + case HAWK_VAL_MAP: + /* map size */ + len = HAWK_HTB_SIZE(((hawk_val_map_t*)v)->map); + break; + + case HAWK_VAL_STR: + /* string length */ + len = ((hawk_val_str_t*)v)->val.len; + break; + + case HAWK_VAL_MBS: + len = ((hawk_val_mbs_t*)v)->val.len; + break; + + default: + /* convert to string and get length */ + str = hawk_rtx_valtooocstrdup(rtx, v, &len); + if (!str) return -1; + hawk_rtx_freemem (rtx, str); + } + } + + v = hawk_rtx_makeintval(rtx, len); + if (!v) return -1; + + hawk_rtx_setretval (rtx, v); + return 0; +} + +int hawk_fnc_substr (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_oow_t nargs; + hawk_val_t* a0, * a1, * a2, * r; + hawk_int_t lindex, lcount; + int n; + + nargs = hawk_rtx_getnargs(rtx); + HAWK_ASSERT (hawk_rtx_getawk(rtx), nargs >= 2 && nargs <= 3); + + a0 = hawk_rtx_getarg(rtx, 0); + a1 = hawk_rtx_getarg(rtx, 1); + a2 = (nargs >= 3)? hawk_rtx_getarg(rtx, 2): HAWK_NULL; + + n = hawk_rtx_valtoint(rtx, a1, &lindex); + if (n <= -1) return -1; + + if (a2) + { + n = hawk_rtx_valtoint(rtx, a2, &lcount); + if (n <= -1) return -1; + if (lcount < 0) lcount = 0; + } + else lcount = HAWK_TYPE_MAX(hawk_int_t); + + lindex = lindex - 1; + if (lindex < 0) lindex = 0; + + if (HAWK_RTX_GETVALTYPE(rtx, a0) == HAWK_VAL_MBS) + { + hawk_bch_t* str; + hawk_oow_t len; + + str = ((hawk_val_mbs_t*)a0)->val.ptr; + len = ((hawk_val_mbs_t*)a0)->val.len; + + if (lindex >= (hawk_int_t)len) lindex = (hawk_int_t)len; + if (lcount > (hawk_int_t)len - lindex) lcount = (hawk_int_t)len - lindex; + + r = hawk_rtx_makembsval(rtx, &str[lindex], (hawk_oow_t)lcount); + if (!r) return -1; + } + else + { + hawk_ooch_t* str; + hawk_oow_t len; + + str = hawk_rtx_getvaloocstr(rtx, a0, &len); + if (!str) return -1; + + if (lindex >= (hawk_int_t)len) lindex = (hawk_int_t)len; + if (lcount > (hawk_int_t)len - lindex) lcount = (hawk_int_t)len - lindex; + + r = hawk_rtx_makestrvalwithoochars(rtx, &str[lindex], (hawk_oow_t)lcount); + hawk_rtx_freevaloocstr (rtx, a0, str); + if (!r) return -1; + } + + hawk_rtx_setretval (rtx, r); + return 0; +} + +int hawk_fnc_split (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_oow_t nargs; + hawk_val_t* a0, * a1, * a2, * t1, * t2; + hawk_val_type_t a1_vtype, a2_vtype, t1_vtype; + + hawk_oocs_t str; + hawk_oocs_t fs; + hawk_ooch_t* fs_free = HAWK_NULL; + const hawk_ooch_t* p; + hawk_oow_t str_left, org_len; + void* fs_rex = HAWK_NULL; + void* fs_rex_free = HAWK_NULL; + + hawk_oocs_t tok; + hawk_int_t nflds; + + hawk_errnum_t errnum; + int x; + + str.ptr = HAWK_NULL; + str.len = 0; + + nargs = hawk_rtx_getnargs(rtx); + HAWK_ASSERT (hawk_rtx_getawk(rtx), nargs >= 2 && nargs <= 3); + + a0 = hawk_rtx_getarg(rtx, 0); + a1 = hawk_rtx_getarg(rtx, 1); + a2 = (nargs >= 3)? hawk_rtx_getarg (rtx, 2): HAWK_NULL; + + a1_vtype = HAWK_RTX_GETVALTYPE (rtx, a1); + HAWK_ASSERT (hawk_rtx_getawk(rtx), a1_vtype == HAWK_VAL_REF); + + str.ptr = hawk_rtx_getvaloocstr(rtx, a0, &str.len); + if (str.ptr == HAWK_NULL) goto oops; + + if (a2 == HAWK_NULL) + { + /* get the value from FS */ + t1 = hawk_rtx_getgbl(rtx, HAWK_GBL_FS); + t1_vtype = HAWK_RTX_GETVALTYPE(rtx, t1); + if (t1_vtype == HAWK_VAL_NIL) + { + fs.ptr = HAWK_T(" "); + fs.len = 1; + } + else if (t1_vtype == HAWK_VAL_STR) + { + fs.ptr = ((hawk_val_str_t*)t1)->val.ptr; + fs.len = ((hawk_val_str_t*)t1)->val.len; + } + else + { + fs.ptr = hawk_rtx_valtooocstrdup(rtx, t1, &fs.len); + if (fs.ptr == HAWK_NULL) goto oops; + fs_free = (hawk_ooch_t*)fs.ptr; + } + + if (fs.len > 1) fs_rex = rtx->gbl.fs[rtx->gbl.ignorecase]; + } + else + { + a2_vtype = HAWK_RTX_GETVALTYPE (rtx, a2); + + if (a2_vtype == HAWK_VAL_REX) + { + /* the third parameter is a regular expression */ + fs_rex = ((hawk_val_rex_t*)a2)->code[rtx->gbl.ignorecase]; + + /* make the loop below to take fs_rex by + * setting fs_len greater than 1*/ + fs.ptr = HAWK_NULL; + fs.len = 2; + } + else + { + if (a2_vtype == HAWK_VAL_STR) + { + fs.ptr = ((hawk_val_str_t*)a2)->val.ptr; + fs.len = ((hawk_val_str_t*)a2)->val.len; + } + else + { + fs.ptr = hawk_rtx_valtooocstrdup(rtx, a2, &fs.len); + if (fs.ptr == HAWK_NULL) goto oops; + fs_free = (hawk_ooch_t*)fs.ptr; + } + + if (fs.len > 1) + { + int x; + + if (rtx->gbl.ignorecase) + x = hawk_buildrex(hawk_rtx_getawk(rtx), fs.ptr, fs.len, &errnum, HAWK_NULL, &fs_rex); + else + x = hawk_buildrex(hawk_rtx_getawk(rtx), fs.ptr, fs.len, &errnum, &fs_rex, HAWK_NULL); + + if (x <= -1) + { + hawk_rtx_seterrnum (rtx, errnum, HAWK_NULL); + goto oops; + } + + fs_rex_free = fs_rex; + } + } + } + + t1 = hawk_rtx_makemapval(rtx); + if (t1 == HAWK_NULL) goto oops; + + hawk_rtx_refupval (rtx, t1); + x = hawk_rtx_setrefval (rtx, (hawk_val_ref_t*)a1, t1); + hawk_rtx_refdownval (rtx, t1); + if (x <= -1) goto oops; + + /* fill the map with actual values */ + p = str.ptr; str_left = str.len; org_len = str.len; + nflds = 0; + + while (p != HAWK_NULL) + { + hawk_ooch_t key_buf[HAWK_SIZEOF(hawk_int_t)*8+2]; + hawk_oow_t key_len; + + if (fs.len <= 1) + { + p = hawk_rtx_strxntok(rtx, p, str.len, fs.ptr, fs.len, &tok); + } + else + { + p = hawk_rtx_strxntokbyrex(rtx, str.ptr, org_len, p, str.len, fs_rex, &tok, &errnum); + if (p == HAWK_NULL && errnum != HAWK_ENOERR) + { + hawk_rtx_seterrnum (rtx, errnum, HAWK_NULL); + goto oops; + } + } + + if (nflds == 0 && p == HAWK_NULL && tok.len == 0) + { + /* no field at all*/ + break; + } + + HAWK_ASSERT (hawk_rtx_getawk(rtx), (tok.ptr != HAWK_NULL && tok.len > 0) || tok.len == 0); + + /* create the field string - however, the split function must + * create a numeric string if the string is a number */ + /*t2 = hawk_rtx_makestrvalwithoocs (rtx, &tok);*/ + t2 = hawk_rtx_makenstrvalwithoocs (rtx, &tok); + if (t2 == HAWK_NULL) goto oops; + + /* put it into the map */ + key_len = hawk_int_to_oocstr(++nflds, 10, HAWK_NULL, key_buf, HAWK_COUNTOF(key_buf)); + HAWK_ASSERT (hawk_rtx_getawk(rtx), key_len != (hawk_oow_t)-1); + + if (hawk_rtx_setmapvalfld(rtx, t1, key_buf, key_len, t2) == HAWK_NULL) + { + hawk_rtx_refupval (rtx, t2); + hawk_rtx_refdownval (rtx, t2); + goto oops; + } + + str.len = str_left - (p - str.ptr); + } + + /*if (str_free) hawk_rtx_freemem (rtx, str_free);*/ + hawk_rtx_freevaloocstr (rtx, a0, str.ptr); + + if (fs_free) hawk_rtx_freemem (rtx, fs_free); + + if (fs_rex_free) + { + if (rtx->gbl.ignorecase) + hawk_freerex (hawk_rtx_getawk(rtx), HAWK_NULL, fs_rex_free); + else + hawk_freerex (hawk_rtx_getawk(rtx), fs_rex_free, HAWK_NULL); + } + + /*nflds--;*/ + + t1 = hawk_rtx_makeintval (rtx, nflds); + if (t1 == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, t1); + return 0; + +oops: + /*if (str_free) hawk_rtx_freemem (rtx, str_free);*/ + if (str.ptr) hawk_rtx_freevaloocstr (rtx, a0, str.ptr); + + if (fs_free) hawk_rtx_freemem (rtx, fs_free); + + if (fs_rex_free) + { + if (rtx->gbl.ignorecase) + hawk_freerex (hawk_rtx_getawk(rtx), HAWK_NULL, fs_rex_free); + else + hawk_freerex (hawk_rtx_getawk(rtx), fs_rex_free, HAWK_NULL); + } + return -1; +} + +int hawk_fnc_tolower (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_oow_t nargs; + hawk_oow_t i; + hawk_val_t* a0, * r; + + nargs = hawk_rtx_getnargs(rtx); + HAWK_ASSERT (hawk_rtx_getawk(rtx), nargs == 1); + + a0 = hawk_rtx_getarg (rtx, 0); + if (HAWK_RTX_GETVALTYPE(rtx, a0) == HAWK_VAL_MBS) + { + hawk_bcs_t str; + str.ptr = hawk_rtx_getvalbcstr(rtx, a0, &str.len); + if (!str.ptr) return -1; + r = hawk_rtx_makembsvalwithbcs(rtx, &str); + hawk_rtx_freevalbcstr (rtx, a0, str.ptr); + if (!r) return -1; + str.ptr = ((hawk_val_mbs_t*)r)->val.ptr; + str.len = ((hawk_val_mbs_t*)r)->val.len; + for (i = 0; i < str.len; i++) str.ptr[i] = hawk_to_bch_lower(str.ptr[i]); + } + else + { + hawk_oocs_t str; + str.ptr = hawk_rtx_getvaloocstr(rtx, a0, &str.len); + if (!str.ptr) return -1; + r = hawk_rtx_makestrvalwithoocs(rtx, &str); + hawk_rtx_freevaloocstr (rtx, a0, str.ptr); + if (!r) return -1; + str.ptr = ((hawk_val_str_t*)r)->val.ptr; + str.len = ((hawk_val_str_t*)r)->val.len; + for (i = 0; i < str.len; i++) str.ptr[i] = hawk_to_ooch_lower(str.ptr[i]); + } + hawk_rtx_setretval (rtx, r); + return 0; +} + +int hawk_fnc_toupper (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_oow_t nargs; + hawk_oow_t i; + hawk_val_t* a0, * r; + + nargs = hawk_rtx_getnargs(rtx); + HAWK_ASSERT (hawk_rtx_getawk(rtx), nargs == 1); + + a0 = hawk_rtx_getarg (rtx, 0); + if (HAWK_RTX_GETVALTYPE(rtx, a0) == HAWK_VAL_MBS) + { + hawk_bcs_t str; + str.ptr = hawk_rtx_getvalbcstr(rtx, a0, &str.len); + if (!str.ptr) return -1; + r = hawk_rtx_makembsvalwithbcs(rtx, &str); + hawk_rtx_freevalbcstr (rtx, a0, str.ptr); + if (!r) return -1; + str.ptr = ((hawk_val_mbs_t*)r)->val.ptr; + str.len = ((hawk_val_mbs_t*)r)->val.len; + for (i = 0; i < str.len; i++) str.ptr[i] = hawk_to_bch_upper(str.ptr[i]); + } + else + { + hawk_oocs_t str; + str.ptr = hawk_rtx_getvaloocstr(rtx, a0, &str.len); + if (!str.ptr) return -1; + r = hawk_rtx_makestrvalwithoocs(rtx, &str); + hawk_rtx_freevaloocstr (rtx, a0, str.ptr); + if (!r) return -1; + str.ptr = ((hawk_val_str_t*)r)->val.ptr; + str.len = ((hawk_val_str_t*)r)->val.len; + for (i = 0; i < str.len; i++) str.ptr[i] = hawk_to_ooch_upper(str.ptr[i]); + } + hawk_rtx_setretval (rtx, r); + return 0; +} + +static int __substitute (hawk_rtx_t* rtx, hawk_int_t max_count) +{ + hawk_oow_t nargs; + hawk_val_t* a0, * a1, * a2, * v; + hawk_val_type_t a0_vtype; + + hawk_oocs_t s0, s2; + hawk_oocs_t s1; + const hawk_ooch_t* s2_end; + + hawk_ooch_t* s0_free = HAWK_NULL; + hawk_ooch_t* s2_free = HAWK_NULL; + + void* rex = HAWK_NULL; + void* rex_free = HAWK_NULL; + + hawk_ooecs_t new; + int new_inited = 0; + + hawk_oocs_t mat, pmat, cur; + + hawk_int_t sub_count; + + s1.ptr = HAWK_NULL; + s1.len = 0; + + nargs = hawk_rtx_getnargs (rtx); + HAWK_ASSERT (hawk_rtx_getawk(rtx), nargs >= 2 && nargs <= 3); + + a0 = hawk_rtx_getarg(rtx, 0); + a1 = hawk_rtx_getarg(rtx, 1); + a2 = (nargs >= 3)? hawk_rtx_getarg(rtx, 2): HAWK_NULL; + + a0_vtype = HAWK_RTX_GETVALTYPE (rtx, a0); + HAWK_ASSERT (hawk_rtx_getawk(rtx), a2 == HAWK_NULL || HAWK_RTX_GETVALTYPE(rtx, a2) == HAWK_VAL_REF); + + if (a0_vtype == HAWK_VAL_REX) + { + rex = ((hawk_val_rex_t*)a0)->code[rtx->gbl.ignorecase]; + } + else if (a0_vtype == HAWK_VAL_STR) + { + s0.ptr = ((hawk_val_str_t*)a0)->val.ptr; + s0.len = ((hawk_val_str_t*)a0)->val.len; + } + else + { + s0.ptr = hawk_rtx_valtooocstrdup (rtx, a0, &s0.len); + if (s0.ptr == HAWK_NULL) goto oops; + s0_free = (hawk_ooch_t*)s0.ptr; + } + + s1.ptr = hawk_rtx_getvaloocstr (rtx, a1, &s1.len); + if (s1.ptr == HAWK_NULL) goto oops; + + if (a2 == HAWK_NULL) + { + /* is this correct? any needs to use inrec.d0? */ + s2.ptr = HAWK_OOECS_PTR(&rtx->inrec.line); + s2.len = HAWK_OOECS_LEN(&rtx->inrec.line); + } + else + { + s2.ptr = hawk_rtx_valtooocstrdup (rtx, a2, &s2.len); + if (s2.ptr == HAWK_NULL) goto oops; + s2_free = (hawk_ooch_t*)s2.ptr; + } + + if (hawk_ooecs_init (&new, hawk_rtx_getawk(rtx), s2.len) <= -1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + goto oops; + } + new_inited = 1; + + if (a0_vtype != HAWK_VAL_REX) + { + hawk_errnum_t errnum; + int x; + + if (rtx->gbl.ignorecase) + x = hawk_buildrex (hawk_rtx_getawk(rtx), s0.ptr, s0.len, &errnum, HAWK_NULL, &rex); + else + x = hawk_buildrex (hawk_rtx_getawk(rtx), s0.ptr, s0.len, &errnum, &rex, HAWK_NULL); + + if (x <= -1) + { + hawk_rtx_seterrnum (rtx, errnum, HAWK_NULL); + goto oops; + } + + rex_free = rex; + } + + s2_end = s2.ptr + s2.len; + cur.ptr = s2.ptr; + cur.len = s2.len; + sub_count = 0; + + pmat.ptr = HAWK_NULL; + pmat.len = 0; + + /* perform test when cur_ptr == s2_end also because + * end of string($) needs to be tested */ + while (cur.ptr <= s2_end) + { + hawk_errnum_t errnum; + int n; + hawk_oow_t m, i; + + if (max_count == 0 || sub_count < max_count) + { + n = hawk_matchrex ( + hawk_rtx_getawk(rtx), rex, rtx->gbl.ignorecase, + &s2, &cur, &mat, HAWK_NULL, &errnum + ); + } + else n = 0; + + if (n <= -1) + { + hawk_rtx_seterrnum (rtx, errnum, HAWK_NULL); + goto oops; + } + + if (n == 0) + { + /* no more match found */ + if (hawk_ooecs_ncat ( + &new, cur.ptr, cur.len) == (hawk_oow_t)-1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + goto oops; + } + break; + } + + if (mat.len == 0 && pmat.ptr != HAWK_NULL && mat.ptr == pmat.ptr + pmat.len) + { + /* match length is 0 and the match is still at the + * end of the previous match */ + goto skip_one_char; + } + + if (hawk_ooecs_ncat(&new, cur.ptr, mat.ptr - cur.ptr) == (hawk_oow_t)-1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + goto oops; + } + + for (i = 0; i < s1.len; i++) + { + if ((i+1) < s1.len && s1.ptr[i] == HAWK_T('\\') && s1.ptr[i+1] == HAWK_T('&')) + { + m = hawk_ooecs_ccat (&new, HAWK_T('&')); + i++; + } + else if (s1.ptr[i] == HAWK_T('&')) + { + m = hawk_ooecs_ncat (&new, mat.ptr, mat.len); + } + else + { + m = hawk_ooecs_ccat (&new, s1.ptr[i]); + } + + if (m == (hawk_oow_t)-1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + goto oops; + } + } + + sub_count++; + cur.len = cur.len - ((mat.ptr - cur.ptr) + mat.len); + cur.ptr = mat.ptr + mat.len; + + pmat = mat; + + if (mat.len == 0) + { + skip_one_char: + /* special treatment is needed if match length is 0 */ + + m = hawk_ooecs_ncat (&new, cur.ptr, 1); + if (m == (hawk_oow_t)-1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + goto oops; + } + + cur.ptr++; cur.len--; + } + } + + if (rex_free) + { + if (rtx->gbl.ignorecase) + hawk_freerex (hawk_rtx_getawk(rtx), HAWK_NULL, rex_free); + else + hawk_freerex (hawk_rtx_getawk(rtx), rex_free, HAWK_NULL); + rex_free = HAWK_NULL; + } + + if (sub_count > 0) + { + if (a2 == HAWK_NULL) + { + int n; + n = hawk_rtx_setrec(rtx, 0, HAWK_OOECS_OOCS(&new)); + if (n <= -1) goto oops; + } + else + { + int n; + + v = hawk_rtx_makestrvalwithoocs(rtx, HAWK_OOECS_OOCS(&new)); + if (v == HAWK_NULL) goto oops; + hawk_rtx_refupval (rtx, v); + n = hawk_rtx_setrefval(rtx, (hawk_val_ref_t*)a2, v); + hawk_rtx_refdownval (rtx, v); + if (n <= -1) goto oops; + } + } + + hawk_ooecs_fini (&new); + + if (s2_free) hawk_rtx_freemem (rtx, s2_free); + + hawk_rtx_freevaloocstr (rtx, a1, s1.ptr); + + if (s0_free) hawk_rtx_freemem (rtx, s0_free); + + v = hawk_rtx_makeintval (rtx, sub_count); + if (v == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, v); + return 0; + +oops: + if (rex_free) + { + if (rtx->gbl.ignorecase) + hawk_freerex (hawk_rtx_getawk(rtx), HAWK_NULL, rex_free); + else + hawk_freerex (hawk_rtx_getawk(rtx), rex_free, HAWK_NULL); + } + if (new_inited) hawk_ooecs_fini (&new); + if (s2_free) hawk_rtx_freemem (rtx, s2_free); + if (s1.ptr) hawk_rtx_freevaloocstr (rtx, a1, s1.ptr); + if (s0_free) hawk_rtx_freemem (rtx, s0_free); + return -1; +} + +int hawk_fnc_gsub (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return __substitute(rtx, 0); +} + +int hawk_fnc_sub (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return __substitute(rtx, 1); +} + +int hawk_fnc_match (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_oow_t nargs; + hawk_val_t* a0, * a1, * a3; + hawk_ooch_t* str0; + hawk_oow_t len0; + hawk_int_t idx, start = 1; + hawk_val_t* x0 = HAWK_NULL, * x1 = HAWK_NULL, * x2 = HAWK_NULL; + int n; + hawk_oocs_t mat, submat[9]; + hawk_ooecs_t* tmpbuf = HAWK_NULL; + + nargs = hawk_rtx_getnargs(rtx); + HAWK_ASSERT (hawk_rtx_getawk(rtx), nargs >= 2 && nargs <= 4); + + a0 = hawk_rtx_getarg(rtx, 0); + a1 = hawk_rtx_getarg(rtx, 1); + + if (nargs >= 3) + { + hawk_val_t* a2; + + a2 = hawk_rtx_getarg(rtx, 2); + /* if the 3rd parameter is not an array, + * it is treated as a match start index */ + n = hawk_rtx_valtoint(rtx, a2, &start); + if (n <= -1) return -1; + + if (nargs >= 4) a3 = hawk_rtx_getarg(rtx, 3); + } + +#if 0 + if (HAWK_RTX_GETVALTYPE(rtx, a0) == HAWK_VAL_MBS) + { + str0 = ((hawk_val_mbs_t*)a0)->val.ptr; + len0 = ((hawk_val_mbs_t*)a0)->val.len; + } +#endif + + str0 = hawk_rtx_getvaloocstr(rtx, a0, &len0); + if (str0 == HAWK_NULL) return -1; + + if (start == 0) start = 1; + else if (start < 0) start = len0 + start + 1; + + HAWK_MEMSET (submat, 0, HAWK_SIZEOF(submat)); + if (start > len0 || start <= 0) n = 0; + else + { + hawk_oocs_t tmp; + + /*TODO: must use str0,len0? */ + tmp.ptr = str0 + start - 1; + tmp.len = len0 - start + 1; + + n = hawk_rtx_matchrex(rtx, a1, &tmp, &tmp, &mat, (nargs >= 4? submat: HAWK_NULL)); + if (n <= -1) return -1; + } + + hawk_rtx_freevaloocstr (rtx, a0, str0); + + /* RSTART: 0 on no match */ + idx = (n == 0)? 0: ((hawk_int_t)(mat.ptr - str0) + 1); + + x0 = hawk_rtx_makeintval(rtx, idx); + if (!x0) goto oops; + hawk_rtx_refupval (rtx, x0); + + /* RLENGTH: -1 on no match */ + x1 = hawk_rtx_makeintval(rtx, ((n == 0)? (hawk_int_t)-1: (hawk_int_t)mat.len)); + if (!x1) goto oops; + hawk_rtx_refupval (rtx, x1); + + if (nargs >= 4) + { + const hawk_oocs_t* subsep; + hawk_int_t submatcount; + hawk_oow_t i, xlen; + hawk_val_t* tv; + + tmpbuf = hawk_ooecs_open(hawk_rtx_getawk(rtx), 0, 64); + if (!tmpbuf) goto oops; + + x2 = hawk_rtx_makemapval(rtx); + if (!x2) goto oops; + hawk_rtx_refupval (rtx, x2); + + submatcount =0; + subsep = hawk_rtx_getsubsep (rtx); + for (i = 0; i < HAWK_COUNTOF(submat); i++) + { + if (!submat[i].ptr) break; + + submatcount++; + + if (hawk_ooecs_fmt(tmpbuf, HAWK_T("%d"), (int)submatcount) == (hawk_oow_t)-1 || + hawk_ooecs_ncat(tmpbuf, subsep->ptr, subsep->len) == (hawk_oow_t)-1) goto oops; + xlen = HAWK_OOECS_LEN(tmpbuf); + if (hawk_ooecs_ncat(tmpbuf, HAWK_T("start"), 5) == (hawk_oow_t)-1) goto oops; + + tv = hawk_rtx_makeintval(rtx, submat[i].ptr - str0 + 1); + if (!tv) goto oops; + if (!hawk_rtx_setmapvalfld(rtx, x2, HAWK_OOECS_PTR(tmpbuf), HAWK_OOECS_LEN(tmpbuf), tv)) + { + hawk_rtx_refupval (rtx, tv); + hawk_rtx_refdownval (rtx, tv); + goto oops; + } + + if (hawk_ooecs_setlen(tmpbuf, xlen) == (hawk_oow_t)-1 || + hawk_ooecs_ncat(tmpbuf, HAWK_T("length"), 6) == (hawk_oow_t)-1) goto oops; + + tv = hawk_rtx_makeintval(rtx, submat[i].len); + if (!tv) goto oops; + if (!hawk_rtx_setmapvalfld(rtx, x2, HAWK_OOECS_PTR(tmpbuf), HAWK_OOECS_LEN(tmpbuf), tv)) + { + hawk_rtx_refupval (rtx, tv); + hawk_rtx_refdownval (rtx, tv); + goto oops; + } + } + /* the caller of this function must be able to get the submatch count by + * dividing the array size by 2 */ + + if (hawk_rtx_setrefval(rtx, (hawk_val_ref_t*)a3, x2) <= -1) goto oops; + } + + if (hawk_rtx_setgbl(rtx, HAWK_GBL_RSTART, x0) <= -1 || + hawk_rtx_setgbl(rtx, HAWK_GBL_RLENGTH, x1) <= -1) + { + goto oops; + } + + hawk_rtx_setretval (rtx, x0); + + if (tmpbuf) hawk_ooecs_close (tmpbuf); + if (x2) hawk_rtx_refdownval (rtx, x2); + hawk_rtx_refdownval (rtx, x1); + hawk_rtx_refdownval (rtx, x0); + return 0; + +oops: + if (tmpbuf) hawk_ooecs_close (tmpbuf); + if (x2) hawk_rtx_refdownval (rtx, x2); + if (x1) hawk_rtx_refdownval (rtx, x1); + if (x0) hawk_rtx_refdownval (rtx, x0); + return -1; +} + +int hawk_fnc_sprintf (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_oow_t nargs; + hawk_val_t* a0; + + nargs = hawk_rtx_getnargs (rtx); + HAWK_ASSERT (hawk_rtx_getawk(rtx), nargs > 0); + + a0 = hawk_rtx_getarg(rtx, 0); + if (HAWK_RTX_GETVALTYPE(rtx, a0) == HAWK_VAL_MBS) + { + hawk_becs_t out, fbu; + int out_inited = 0, fbu_inited = 0; + hawk_bcs_t cs0; + hawk_bcs_t x; + + if (hawk_becs_init(&out, hawk_rtx_getawk(rtx), 256) <= -1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + goto oops_mbs; + } + out_inited = 1; + + if (hawk_becs_init(&fbu, hawk_rtx_getawk(rtx), 256) <= -1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + goto oops_mbs; + } + fbu_inited = 1; + + cs0.ptr = hawk_rtx_getvalbcstr(rtx, a0, &cs0.len); + if (cs0.ptr == HAWK_NULL) goto oops_mbs; + + x.ptr = hawk_rtx_formatmbs(rtx, &out, &fbu, cs0.ptr, cs0.len, nargs, HAWK_NULL, &x.len); + hawk_rtx_freevalbcstr (rtx, a0, cs0.ptr); + if (!x.ptr) goto oops_mbs; + + a0 = hawk_rtx_makembsvalwithbcs(rtx, &x); + if (a0 == HAWK_NULL) goto oops_mbs; + + hawk_becs_fini (&fbu); + hawk_becs_fini (&out); + hawk_rtx_setretval (rtx, a0); + return 0; + + oops_mbs: + if (fbu_inited) hawk_becs_fini (&fbu); + if (out_inited) hawk_becs_fini (&out); + return -1; + } + else + { + hawk_ooecs_t out, fbu; + int out_inited = 0, fbu_inited = 0; + hawk_oocs_t cs0; + hawk_oocs_t x; + + if (hawk_ooecs_init(&out, hawk_rtx_getawk(rtx), 256) <= -1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + goto oops; + } + out_inited = 1; + + if (hawk_ooecs_init(&fbu, hawk_rtx_getawk(rtx), 256) <= -1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + goto oops; + } + fbu_inited = 1; + + cs0.ptr = hawk_rtx_getvaloocstr(rtx, a0, &cs0.len); + if (cs0.ptr == HAWK_NULL) goto oops; + + x.ptr = hawk_rtx_format(rtx, &out, &fbu, cs0.ptr, cs0.len, nargs, HAWK_NULL, &x.len); + hawk_rtx_freevaloocstr (rtx, a0, cs0.ptr); + if (!x.ptr) goto oops; + + a0 = hawk_rtx_makestrvalwithoocs(rtx, &x); + if (a0 == HAWK_NULL) goto oops; + + hawk_ooecs_fini (&fbu); + hawk_ooecs_fini (&out); + hawk_rtx_setretval (rtx, a0); + return 0; + + oops: + if (fbu_inited) hawk_ooecs_fini (&fbu); + if (out_inited) hawk_ooecs_fini (&out); + return -1; + } +} + +static int fnc_int (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_oow_t nargs; + hawk_val_t* a0; + hawk_int_t lv; + hawk_val_t* r; + int n; + + nargs = hawk_rtx_getnargs(rtx); + HAWK_ASSERT (hawk_rtx_getawk(rtx), nargs == 1); + + a0 = hawk_rtx_getarg(rtx, 0); + + n = hawk_rtx_valtoint(rtx, a0, &lv); + if (n <= -1) return -1; + + r = hawk_rtx_makeintval(rtx, lv); + if (r == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, r); + return 0; +} + +static int fnc_typename (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_val_t* a0; + hawk_val_t* r; + const hawk_ooch_t* name; + + a0 = hawk_rtx_getarg(rtx, 0); + name = hawk_rtx_getvaltypename(rtx, a0); + + r = hawk_rtx_makestrvalwithoocstr(rtx, name); + if (r == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, r); + return 0; +} + +static int fnc_isnil (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_val_t* a0; + hawk_val_t* r; + + a0 = hawk_rtx_getarg(rtx, 0); + + r = hawk_rtx_makeintval(rtx, HAWK_RTX_GETVALTYPE(rtx, a0) == HAWK_VAL_NIL); + if (r == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, r); + return 0; +} + +static int fnc_ismap (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_val_t* a0; + hawk_val_t* r; + + a0 = hawk_rtx_getarg(rtx, 0); + + r = hawk_rtx_makeintval(rtx, HAWK_RTX_GETVALTYPE(rtx, a0) == HAWK_VAL_MAP); + if (r == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, r); + return 0; +} + +static HAWK_INLINE int asort_compare (const void* x1, const void* x2, void* ctx, int* cv) +{ + int n; + if (hawk_rtx_cmpval((hawk_rtx_t*)ctx, *(hawk_val_t**)x1, *(hawk_val_t**)x2, &n) <= -1) return -1; + *cv = n; + return 0; +} + +struct cud_t +{ + hawk_rtx_t* rtx; + hawk_fun_t* fun; +}; + +static HAWK_INLINE int asort_compare_ud (const void* x1, const void* x2, void* ctx, int* cv) +{ + struct cud_t* cud = (struct cud_t*)ctx; + hawk_val_t* r, * args[2]; + hawk_int_t rv; + + args[0] = *(hawk_val_t**)x1; + args[1] = *(hawk_val_t**)x2; + r = hawk_rtx_callfun(cud->rtx, cud->fun, args, 2); + if (!r) return -1; + if (hawk_rtx_valtoint(cud->rtx, r, &rv) <= -1) return -1; + *cv = rv; + return 0; +} + +static HAWK_INLINE int __fnc_asort (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi, int sort_keys) +{ + hawk_oow_t nargs; + hawk_val_t* a0, * a0_val, * a1, * a2; + hawk_val_type_t a0_type, v_type; + hawk_val_t* r, * rmap = HAWK_NULL; + hawk_int_t rv = 0; /* as if no element in the map */ + hawk_val_map_itr_t itr; + hawk_fun_t* fun = HAWK_NULL; + hawk_oow_t msz, i; + hawk_val_t** va; + int x; + + nargs = hawk_rtx_getnargs(rtx); + + a0 = hawk_rtx_getarg(rtx, 0); + a0_type = HAWK_RTX_GETVALTYPE(rtx, a0); + HAWK_ASSERT (hawk_rtx_getawk(rtx), a0_type == HAWK_VAL_REF); + + v_type = hawk_rtx_getrefvaltype(rtx, (hawk_val_ref_t*)a0); + if (v_type != HAWK_VAL_MAP) + { + if (v_type == HAWK_VAL_NIL) + { + /* treat it as an empty value */ + goto done; + } + + hawk_rtx_seterrfmt (rtx, HAWK_ENOTMAP, HAWK_NULL, HAWK_T("source not a map")); + return -1; + } + + a0_val = hawk_rtx_getrefval(rtx, (hawk_val_ref_t*)a0); + HAWK_ASSERT (hawk_rtx_getawk(rtx), HAWK_RTX_GETVALTYPE(rtx, a0_val) == HAWK_VAL_MAP); + + if (nargs >= 2) + { + a1 = hawk_rtx_getarg(rtx, 1); /* destination map */ + + if (nargs >= 3) + { + a2 = hawk_rtx_getarg(rtx, 2); + if (HAWK_RTX_GETVALTYPE(rtx, a2) != HAWK_VAL_FUN) + { + hawk_rtx_seterrfmt (rtx, HAWK_EINVAL, HAWK_NULL, HAWK_T("comparator not a function")); + return -1; + } + + fun = ((hawk_val_fun_t*)a2)->fun; + if (fun->nargs < 2) + { + /* the comparison accepts less than 2 arguments */ + hawk_rtx_seterrfmt (rtx, HAWK_EINVAL, HAWK_NULL, HAWK_T("%.*s not accepting 2 arguments"), (int)fun->name.len, fun->name.ptr); + return -1; + } + } + } + else + { + a1 = a0; /* let a0 be the destination. a0 is both source and destination */ + } + + if (!hawk_rtx_getfirstmapvalitr(rtx, a0_val, &itr)) goto done; /* map empty */ + + msz = hawk_htb_getsize(((hawk_val_map_t*)a0_val)->map); + HAWK_ASSERT (hawk_rtx_getawk(rtx), msz > 0); + + va = (hawk_val_t**)hawk_rtx_allocmem(rtx, msz * HAWK_SIZEOF(*va)); + if (!va) return -1; + i = 0; + if (sort_keys) + { + do + { + const hawk_oocs_t* key = HAWK_VAL_MAP_ITR_KEY(&itr); + va[i] = hawk_rtx_makestrvalwithoocs(rtx, key); + if (!va[i]) + { + while (i > 0) + { + --i; + hawk_rtx_refdownval (rtx, va[i]); + } + hawk_rtx_freemem (rtx, va); + return -1; + } + hawk_rtx_refupval (rtx, va[i]); + i++; + } + while (hawk_rtx_getnextmapvalitr(rtx, a0_val, &itr)); + } + else + { + do + { + va[i] = (hawk_val_t*)HAWK_VAL_MAP_ITR_VAL(&itr); + hawk_rtx_refupval (rtx, va[i]); + i++; + } + while (hawk_rtx_getnextmapvalitr(rtx, a0_val, &itr)); + } + + if (fun) + { + struct cud_t cud; + cud.rtx = rtx; + cud.fun = fun; + x = hawk_qsortx(va, msz, HAWK_SIZEOF(*va), asort_compare_ud, &cud); + } + else + { + x = hawk_qsortx(va, msz, HAWK_SIZEOF(*va), asort_compare, rtx); + } + + if (x <= -1 || !(rmap = hawk_rtx_makemapval(rtx))) + { + for (i = 0; i < msz; i++) hawk_rtx_refdownval (rtx, va[i]); + hawk_rtx_freemem (rtx, va); + return -1; + } + + for (i = 0; i < msz; i++) + { + hawk_ooch_t ridx[128]; /* TODO: make it dynamic? can overflow? */ + hawk_oow_t ridx_len; + + ridx_len = hawk_fmt_uintmax_to_oocstr( + ridx, + HAWK_COUNTOF(ridx), + i, + 10 | HAWK_FMT_UINTMAX_NOTRUNC | HAWK_FMT_UINTMAX_NONULL, + -1, + HAWK_T('\0'), + HAWK_NULL + ); + + if (hawk_rtx_setmapvalfld(rtx, rmap, ridx, ridx_len, va[i]) == HAWK_NULL) + { + /* decrement the reference count of the values not added to the map */ + do + { + hawk_rtx_refdownval (rtx, va[i]); + i++; + } + while (i < msz); + hawk_rtx_freeval (rtx, rmap, 0); /* this derefs the elements added. */ + hawk_rtx_freemem (rtx, va); + return -1; + } + + hawk_rtx_refdownval (rtx, va[i]); /* deref it as it has been added to the map */ + } + + rv = msz; + hawk_rtx_freemem (rtx, va); + +done: + r = hawk_rtx_makeintval(rtx, rv); + if (!r) return -1; + + if (rmap) + { + /* rmap can be NULL when a jump has been made for an empty source + * at the beginning of this fucntion */ + hawk_rtx_refupval (rtx, rmap); + x = hawk_rtx_setrefval (rtx, (hawk_val_ref_t*)a1, rmap); + hawk_rtx_refdownval (rtx, rmap); + if (x <= -1) + { + hawk_rtx_freeval (rtx, r, 0); + return -1; + } + } + + hawk_rtx_setretval (rtx, r); + return 0; +} + +static int fnc_asort (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return __fnc_asort(rtx, fi, 0); +} + +static int fnc_asorti (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return __fnc_asort(rtx, fi, 1); +} diff --git a/hawk/lib/gem.c b/hawk/lib/gem.c new file mode 100644 index 00000000..955ab602 --- /dev/null +++ b/hawk/lib/gem.c @@ -0,0 +1,48 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +void* hawk_gem_allocmem (hawk_gem_t* gem, hawk_oow_t size) +{ + void* ptr = HAWK_MMGR_ALLOC(gem->mmgr, size); + if (!ptr) hawk_gem_seterrnum (gem, HAWK_ENOMEM, HAWK_NULL); + return ptr; +} + +void* hawk_gem_callocmem (hawk_gem_t* gem, hawk_oow_t size) +{ + void* ptr = HAWK_MMGR_ALLOC(gem->mmgr, size); + if (ptr) HAWK_MEMSET (ptr, 0, size); + else hawk_gem_seterrnum (gem, HAWK_ENOMEM, HAWK_NULL); + return ptr; +} + +void* hawk_gem_reallocmem (hawk_gem_t* gem, void* ptr, hawk_oow_t size) +{ + void* nptr = HAWK_MMGR_REALLOC(gem->mmgr, ptr, size); + if (!nptr) hawk_gem_seterrnum (gem, HAWK_ENOMEM, HAWK_NULL); + return nptr; +} + diff --git a/hawk/lib/generrcode.awk b/hawk/lib/generrcode.awk new file mode 100644 index 00000000..cf0679a4 --- /dev/null +++ b/hawk/lib/generrcode.awk @@ -0,0 +1,33 @@ +# +# generrcode.awk +# +# qseawk -f generrcode.awk awk.h +# + +BEGIN { + collect=0; + tab3="\t\t"; + tab4="\t\t\t"; +} + +/^[[:space:]]*enum[[:space:]]+qse_awk_errnum_t[[:space:]]*$/ { + collect=1; + print tab3 "// generated by generrcode.awk"; + print tab3 "enum ErrorNumber"; + print tab3 "{"; +} + +collect && /^[[:space:]]*};[[:space:]]*$/ { + print tab3 "};"; + print tab3 "// end of enum ErrorNumber"; + print ""; + collect=0; +} + +collect && /^[[:space:]]*QSE_AWK_E[[:alnum:]]+/ { + split ($1, flds, ","); + name=flds[1]; + + print tab4 "ERR_" substr (name,10,length(name)-9) " = " name ","; +} + diff --git a/hawk/lib/genoptcode.awk b/hawk/lib/genoptcode.awk new file mode 100644 index 00000000..900c5f48 --- /dev/null +++ b/hawk/lib/genoptcode.awk @@ -0,0 +1,33 @@ +# +# genoptcode.awk +# +# qseawk -f generror.awk awk.h +# + +BEGIN { + collect=0; + tab3="\t\t"; + tab4="\t\t\t"; +} + +/^[[:space:]]*enum[[:space:]]+qse_awk_option_t[[:space:]]*$/ { + collect=1; + print tab3 "// generated by genoptcode.awk"; + print tab3 "enum Option"; + print tab3 "{"; +} + +collect && /^[[:space:]]*};[[:space:]]*$/ { + print tab3 "};"; + print tab3 "// end of enum Option"; + print ""; + collect=0; +} + +collect && /^[[:space:]]*QSE_AWK_[[:alnum:]]+/ { + split ($1, flds, ","); + name=flds[1]; + + print tab4 "OPT_" substr (name,9,length(name)-8) " = " name ","; +} + diff --git a/hawk/lib/hawk-arr.h b/hawk/lib/hawk-arr.h new file mode 100644 index 00000000..39ed8fd2 --- /dev/null +++ b/hawk/lib/hawk-arr.h @@ -0,0 +1,482 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_ARR_H_ +#define _HAWK_ARR_H_ + +#include + +/** @file + * This file provides a linear dynamic array. It grows dynamically as items + * are added. + */ + +enum hawk_arr_walk_t +{ + HAWK_ARR_WALK_STOP = 0, + HAWK_ARR_WALK_FORWARD = 1, + HAWK_ARR_WALK_BACKWARD = 2 +}; + +typedef struct hawk_arr_t hawk_arr_t; +typedef struct hawk_arr_slot_t hawk_arr_slot_t; +typedef enum hawk_arr_walk_t hawk_arr_walk_t; + +#define HAWK_ARR_COPIER_SIMPLE ((hawk_arr_copier_t)1) +#define HAWK_ARR_COPIER_INLINE ((hawk_arr_copier_t)2) + +#define HAWK_ARR_NIL ((hawk_oow_t)-1) + +#define HAWK_ARR_SIZE(arr) (*(const hawk_oow_t*)&(arr)->size) +#define HAWK_ARR_CAPA(arr) (*(const hawk_oow_t*)&(arr)->capa) + +#define HAWK_ARR_SLOT(arr,index) ((arr)->slot[index]) +#define HAWK_ARR_DPTL(arr,index) ((const hawk_ptl_t*)&(arr)->slot[index]->val) +#define HAWK_ARR_DPTR(arr,index) ((arr)->slot[index]->val.ptr) +#define HAWK_ARR_DLEN(arr,index) ((arr)->slot[index]->val.len) + +/** + * The hawk_arr_copier_t type defines a callback function for slot construction. + * A slot is contructed when a user adds data to an array. The user can + * define how the data to add can be maintained in the array. A dynamic + * array not specified with any copiers stores the data pointer and + * the data length into a slot. A special copier HAWK_ARR_COPIER_INLINE copies + * the contents of the data a user provided into the slot. You can use the + * hawk_arr_setcopier() function to change the copier. + * + * A copier should return the pointer to the copied data. If it fails to copy + * data, it may return HAWK_NULL. You need to set a proper freeer to free up + * memory allocated for copy. + */ +typedef void* (*hawk_arr_copier_t) ( + hawk_arr_t* arr /**< array */, + void* dptr /**< pointer to data to copy */, + hawk_oow_t dlen /**< length of data to copy */ +); + +/** + * The hawk_arr_freeer_t type defines a slot destruction callback. + */ +typedef void (*hawk_arr_freeer_t) ( + hawk_arr_t* arr /**< array */, + void* dptr /**< pointer to data to free */, + hawk_oow_t dlen /**< length of data to free */ +); + +/** + * The hawk_arr_comper_t type defines a key comparator that is called when + * the arry needs to compare data. A linear dynamic array is created with a + * default comparator that performs bitwise comparison. + * + * The default comparator compares data in a memcmp-like fashion. + * It is not suitable when you want to implement a heap of numbers + * greater than a byte size. You must implement a comparator that + * takes the whole element and performs comparison in such a case. + * + * The comparator should return 0 if the data are the same, a negative + * integer if the first data is less than the second data, a positive + * integer otherwise. + * + */ +typedef int (*hawk_arr_comper_t) ( + hawk_arr_t* arr /* array */, + const void* dptr1 /* data pointer */, + hawk_oow_t dlen1 /* data length */, + const void* dptr2 /* data pointer */, + hawk_oow_t dlen2 /* data length */ +); + +/** + * The hawk_arr_keeper_t type defines a value keeper that is called when + * a value is retained in the context that it should be destroyed because + * it is identical to a new value. Two values are identical if their beginning + * pointers and their lengths are equal. + */ +typedef void (*hawk_arr_keeper_t) ( + hawk_arr_t* arr /**< array */, + void* vptr /**< pointer to a value */, + hawk_oow_t vlen /**< length of a value */ +); + +/** + * The hawk_arr_sizer_t type defines an array size claculator that is called + * when the array needs to be resized. + */ +typedef hawk_oow_t (*hawk_arr_sizer_t) ( + hawk_arr_t* arr, /**< array */ + hawk_oow_t hint /**< sizing hint */ +); + +typedef hawk_arr_walk_t (*hawk_arr_walker_t) ( + hawk_arr_t* arr /* array */, + hawk_oow_t index /* index to the visited slot */, + void* ctx /* user-defined context */ +); + +/** + * The hawk_arr_t type defines a linear dynamic array. + */ +struct hawk_arr_t +{ + hawk_t* hawk; + hawk_arr_copier_t copier; /* data copier */ + hawk_arr_freeer_t freeer; /* data freeer */ + hawk_arr_comper_t comper; /* data comparator */ + hawk_arr_keeper_t keeper; /* data keeper */ + hawk_arr_sizer_t sizer; /* size calculator */ + hawk_uint8_t scale; /* scale factor */ + hawk_oow_t heap_pos_offset; /* offset in the data element where position + * is stored when heap operation is performed. */ + hawk_oow_t size; /* number of items */ + hawk_oow_t capa; /* capacity */ + hawk_arr_slot_t** slot; +}; + +/** + * The hawk_arr_slot_t type defines a linear dynamic array slot + */ +struct hawk_arr_slot_t +{ + hawk_ptl_t val; +}; + +#if defined(__cplusplus) +extern "C" { +#endif + +/** + * The hawk_arr_open() function creates a linear dynamic array. + */ +HAWK_EXPORT hawk_arr_t* hawk_arr_open ( + hawk_t* awk, /**< memory manager */ + hawk_oow_t ext, /**< extension size in bytes */ + hawk_oow_t capa /**< initial array capacity */ +); + +/** + * The hawk_arr_close() function destroys a linear dynamic array. + */ +HAWK_EXPORT void hawk_arr_close ( + hawk_arr_t* arr /**< array */ +); + +/** + * The hawk_arr_init() function initializes a linear dynamic array. + */ +HAWK_EXPORT int hawk_arr_init ( + hawk_arr_t* arr, + hawk_t* awk, + hawk_oow_t capa +); + +/** + * The hawk_arr_fini() function finalizes a linear dynamic array. + */ +HAWK_EXPORT void hawk_arr_fini ( + hawk_arr_t* arr /**< array */ +); + +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE void* hawk_arr_getxtn (hawk_arr_t* arr) { return (void*)(arr + 1); } +#else +#define hawk_arr_getxtn(awk) ((void*)((hawk_arr_t*)(arr) + 1)) +#endif + +/** + * The hawk_arr_getscale() function returns the scale factor + */ +HAWK_EXPORT int hawk_arr_getscale ( + hawk_arr_t* arr /**< array */ +); + +/** + * The hawk_arr_setscale() function sets the scale factor of the length + * of a key and a value. A scale factor determines the actual length of + * a key and a value in bytes. A arr is created with a scale factor of 1. + * The scale factor should be larger than 0 and less than 256. + * It is a bad idea to change the scale factor when @a arr is not empty. + */ +HAWK_EXPORT void hawk_arr_setscale ( + hawk_arr_t* arr /**< array */, + int scale /**< scale factor - 1 to 255 */ +); + +HAWK_EXPORT hawk_arr_copier_t hawk_arr_getcopier ( + hawk_arr_t* arr /* array */ +); + +/** + * The hawk_arr_setcopier() specifies how to clone an element. The special + * copier #HAWK_ARR_COPIER_INLINE copies the data inline to the internal slot. + * No freeer is invoked when the slot is freeed. You may set the copier to + * #HAWK_ARR_COPIER_SIMPLE to perform no special operation when the data + * pointer is stored. + */ +HAWK_EXPORT void hawk_arr_setcopier ( + hawk_arr_t* arr /** arr */, + hawk_arr_copier_t copier /** element copier */ +); + +/** + * The hawk_arr_getfreeer() function returns a custom element destroyer. + */ +HAWK_EXPORT hawk_arr_freeer_t hawk_arr_getfreeer ( + hawk_arr_t* arr /**< arr */ +); + +/** + * The hawk_arr_setfreeer() function specifies how to destroy an element. + * The @a freeer is called when a slot containing the element is destroyed. + */ +HAWK_EXPORT void hawk_arr_setfreeer ( + hawk_arr_t* arr /**< arr */, + hawk_arr_freeer_t freeer /**< element freeer */ +); + +HAWK_EXPORT hawk_arr_comper_t hawk_arr_getcomper ( + hawk_arr_t* arr /**< arr */ +); + +/** + * The hawk_arr_setcomper() function specifies how to compare two elements + * for equality test. The comparator @a comper must return 0 if two elements + * compared are equal, 1 if the first element is greater than the + * second, -1 if the second element is greater than the first. + */ +HAWK_EXPORT void hawk_arr_setcomper ( + hawk_arr_t* arr /**< arr */, + hawk_arr_comper_t comper /**< comparator */ +); + +HAWK_EXPORT hawk_arr_keeper_t hawk_arr_getkeeper ( + hawk_arr_t* arr +); + +HAWK_EXPORT void hawk_arr_setkeeper ( + hawk_arr_t* arr, + hawk_arr_keeper_t keeper +); + +HAWK_EXPORT hawk_arr_sizer_t hawk_arr_getsizer ( + hawk_arr_t* arr +); + +HAWK_EXPORT void hawk_arr_setsizer ( + hawk_arr_t* arr, + hawk_arr_sizer_t sizer +); + +HAWK_EXPORT hawk_oow_t hawk_arr_getsize ( + hawk_arr_t* arr +); + +HAWK_EXPORT hawk_oow_t hawk_arr_getcapa ( + hawk_arr_t* arr +); + +HAWK_EXPORT hawk_arr_t* hawk_arr_setcapa ( + hawk_arr_t* arr, + hawk_oow_t capa +); + +HAWK_EXPORT hawk_oow_t hawk_arr_search ( + hawk_arr_t* arr, + hawk_oow_t pos, + const void* dptr, + hawk_oow_t dlen +); + +HAWK_EXPORT hawk_oow_t hawk_arr_rsearch ( + hawk_arr_t* arr, + hawk_oow_t pos, + const void* dptr, + hawk_oow_t dlen +); + +HAWK_EXPORT hawk_oow_t hawk_arr_upsert ( + hawk_arr_t* arr, + hawk_oow_t index, + void* dptr, + hawk_oow_t dlen +); + +HAWK_EXPORT hawk_oow_t hawk_arr_insert ( + hawk_arr_t* arr, + hawk_oow_t index, + void* dptr, + hawk_oow_t dlen +); + +HAWK_EXPORT hawk_oow_t hawk_arr_update ( + hawk_arr_t* arr, + hawk_oow_t pos, + void* dptr, + hawk_oow_t dlen +); + +/** + * The hawk_arr_delete() function deletes the as many data as the count + * from the index. It returns the number of data deleted. + */ +HAWK_EXPORT hawk_oow_t hawk_arr_delete ( + hawk_arr_t* arr, + hawk_oow_t index, + hawk_oow_t count +); + +/** + * The hawk_arr_uplete() function deletes data slot without compaction. + * It returns the number of data affected. + */ +HAWK_EXPORT hawk_oow_t hawk_arr_uplete ( + hawk_arr_t* arr, + hawk_oow_t index, + hawk_oow_t count +); + +HAWK_EXPORT void hawk_arr_clear ( + hawk_arr_t* arr +); + +/** + * The hawk_arr_walk() function calls the @a walker function for each + * element in the array beginning from the first. The @a walker function + * should return one of #HAWK_ARR_WALK_FORWARD, #HAWK_ARR_WALK_BACKWARD, + * #HAWK_ARR_WALK_STOP. + * @return number of calls to the @a walker fucntion made + */ +HAWK_EXPORT hawk_oow_t hawk_arr_walk ( + hawk_arr_t* arr, + hawk_arr_walker_t walker, + void* ctx +); + +/** + * The hawk_arr_rwalk() function calls the @a walker function for each + * element in the array beginning from the last. The @a walker function + * should return one of #HAWK_ARR_WALK_FORWARD, #HAWK_ARR_WALK_BACKWARD, + * #HAWK_ARR_WALK_STOP. + * @return number of calls to the @a walker fucntion made + */ +HAWK_EXPORT hawk_oow_t hawk_arr_rwalk ( + hawk_arr_t* arr, + hawk_arr_walker_t walker, + void* ctx +); + +/** + * The hawk_arr_pushstack() function appends data to the array. It is a utility + * function to allow stack-like operations over an array. To do so, you should + * not play with other non-stack related functions. + */ +HAWK_EXPORT hawk_oow_t hawk_arr_pushstack ( + hawk_arr_t* arr, + void* dptr, + hawk_oow_t dlen +); + +/** + * The hawk_arr_popstack() function deletes the last array data. It is a utility + * function to allow stack-like operations over an array. To do so, you should + * not play with other non-stack related functions. + * @note You must not call this function if @a arr is empty. + */ +HAWK_EXPORT void hawk_arr_popstack ( + hawk_arr_t* arr +); + +/** + * The hawk_arr_pushheap() function inserts data to an array while keeping the + * largest data at position 0. It is a utiltiy funtion to implement a binary + * max-heap over an array. Inverse the comparator to implement a min-heap. + * @return number of array elements + * @note You must not mess up the array with other non-heap related functions + * to keep the heap property. + */ +HAWK_EXPORT hawk_oow_t hawk_arr_pushheap ( + hawk_arr_t* arr, + void* dptr, + hawk_oow_t dlen +); + +/** + * The hawk_arr_popheap() function deletes data at position 0 while keeping + * the largest data at positon 0. It is a utiltiy funtion to implement a binary + * max-heap over an array. + * @note You must not mess up the array with other non-heap related functions + * to keep the heap property. + */ +HAWK_EXPORT void hawk_arr_popheap ( + hawk_arr_t* arr +); + +HAWK_EXPORT void hawk_arr_deleteheap ( + hawk_arr_t* arr, + hawk_oow_t index +); + +HAWK_EXPORT hawk_oow_t hawk_arr_updateheap ( + hawk_arr_t* arr, + hawk_oow_t index, + void* dptr, + hawk_oow_t dlen +); + +HAWK_EXPORT hawk_oow_t hawk_arr_getheapposoffset ( + hawk_arr_t* arr +); + +/** + * The hawk_arr_setheapposoffset() function sets the offset to a position holding + * field within a data element. It assumes that the field is of the hawk_oow_t type. + * + * \code + * struct data_t + * { + * int v; + * hawk_oow_t pos; + * }; + * struct data_t d; + * hawk_arr_setheapposoffset (arr, HAWK_OFFSETOF(struct data_t, pos)); + * d.v = 20; + * hawk_arr_pushheap (arr, &d, 1); + * \endcode + * + * In the code above, the 'pos' field of the first element in the array must be 0. + * + * If it's set to HAWK_ARR_NIL, position is not updated when heapification is + * performed. + */ +HAWK_EXPORT void hawk_arr_setheapposoffset ( + hawk_arr_t* arr, + hawk_oow_t offset +); + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/hawk/lib/hawk-cfg.h.in b/hawk/lib/hawk-cfg.h.in new file mode 100644 index 00000000..e276b28c --- /dev/null +++ b/hawk/lib/hawk-cfg.h.in @@ -0,0 +1,928 @@ +/* lib/hawk-cfg.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + +/* Define to 1 if you have the `accept4' function. */ +#undef HAVE_ACCEPT4 + +/* Define to 1 if you have the `acos' function. */ +#undef HAVE_ACOS + +/* Define to 1 if you have the `acosf' function. */ +#undef HAVE_ACOSF + +/* Define to 1 if you have the `acosl' function. */ +#undef HAVE_ACOSL + +/* Define to 1 if you have the `acosq' function. */ +#undef HAVE_ACOSQ + +/* Define to 1 if you have the `asin' function. */ +#undef HAVE_ASIN + +/* Define to 1 if you have the `asinf' function. */ +#undef HAVE_ASINF + +/* Define to 1 if you have the `asinl' function. */ +#undef HAVE_ASINL + +/* Define to 1 if you have the `asinq' function. */ +#undef HAVE_ASINQ + +/* Define to 1 if you have the `atan' function. */ +#undef HAVE_ATAN + +/* Define to 1 if you have the `atan2' function. */ +#undef HAVE_ATAN2 + +/* Define to 1 if you have the `atan2f' function. */ +#undef HAVE_ATAN2F + +/* Define to 1 if you have the `atan2l' function. */ +#undef HAVE_ATAN2L + +/* Define to 1 if you have the `atan2q' function. */ +#undef HAVE_ATAN2Q + +/* Define to 1 if you have the `atanf' function. */ +#undef HAVE_ATANF + +/* Define to 1 if you have the `atanl' function. */ +#undef HAVE_ATANL + +/* Define to 1 if you have the `atanq' function. */ +#undef HAVE_ATANQ + +/* Define to 1 if you have the `backtrace' function. */ +#undef HAVE_BACKTRACE + +/* Define to 1 if you have the `backtrace_symbols' function. */ +#undef HAVE_BACKTRACE_SYMBOLS + +/* Define to 1 if you have the `ceil' function. */ +#undef HAVE_CEIL + +/* Define to 1 if you have the `ceilf' function. */ +#undef HAVE_CEILF + +/* Define to 1 if you have the `ceill' function. */ +#undef HAVE_CEILL + +/* Define to 1 if you have the `ceilq' function. */ +#undef HAVE_CEILQ + +/* Define to 1 if you have the `clock_gettime' function. */ +#undef HAVE_CLOCK_GETTIME + +/* Define to 1 if you have the `clock_nanosleep' function. */ +#undef HAVE_CLOCK_NANOSLEEP + +/* Define to 1 if you have the `clock_settime' function. */ +#undef HAVE_CLOCK_SETTIME + +/* Define to 1 if you have the `connect' function. */ +#undef HAVE_CONNECT + +/* Define to 1 if you have the `cos' function. */ +#undef HAVE_COS + +/* Define to 1 if you have the `cosf' function. */ +#undef HAVE_COSF + +/* Define to 1 if you have the `cosh' function. */ +#undef HAVE_COSH + +/* Define to 1 if you have the `coshf' function. */ +#undef HAVE_COSHF + +/* Define to 1 if you have the `coshl' function. */ +#undef HAVE_COSHL + +/* Define to 1 if you have the `coshq' function. */ +#undef HAVE_COSHQ + +/* Define to 1 if you have the `cosl' function. */ +#undef HAVE_COSL + +/* Define to 1 if you have the `cosq' function. */ +#undef HAVE_COSQ + +/* Define if c++ supports namespace std. */ +#undef HAVE_CXX_NAMESPACE_STD + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_DIRENT_H + +/* Define to 1 if you have the `dirfd' function. */ +#undef HAVE_DIRFD + +/* Define to 1 if `dd_fd' is a member of `DIR'. */ +#undef HAVE_DIR_DD_FD + +/* Define to 1 if `d_fd' is a member of `DIR'. */ +#undef HAVE_DIR_D_FD + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_DYNCALL_H + +/* dyncall library is available */ +#undef HAVE_DYNCALL_LIB + +/* Define to 1 if you have the `epoll_create' function. */ +#undef HAVE_EPOLL_CREATE + +/* Define to 1 if you have the `epoll_create1' function. */ +#undef HAVE_EPOLL_CREATE1 + +/* Define to 1 if you have the header file. */ +#undef HAVE_ERRNO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_EXECINFO_H + +/* Define to 1 if you have the `exp' function. */ +#undef HAVE_EXP + +/* Define to 1 if you have the `expf' function. */ +#undef HAVE_EXPF + +/* Define to 1 if you have the `expl' function. */ +#undef HAVE_EXPL + +/* Define to 1 if you have the `expq' function. */ +#undef HAVE_EXPQ + +/* Define to 1 if you have the `faccessat' function. */ +#undef HAVE_FACCESSAT + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FFI_H + +/* libffi library is available */ +#undef HAVE_FFI_LIB + +/* Define to 1 if you have the `floor' function. */ +#undef HAVE_FLOOR + +/* Define to 1 if you have the `floorf' function. */ +#undef HAVE_FLOORF + +/* Define to 1 if you have the `floorl' function. */ +#undef HAVE_FLOORL + +/* Define to 1 if you have the `floorq' function. */ +#undef HAVE_FLOORQ + +/* Define to 1 if you have the `fmod' function. */ +#undef HAVE_FMOD + +/* Define to 1 if you have the `fmodf' function. */ +#undef HAVE_FMODF + +/* Define to 1 if you have the `fmodl' function. */ +#undef HAVE_FMODL + +/* Define to 1 if you have the `fmodq' function. */ +#undef HAVE_FMODQ + +/* Define to 1 if you have the `fstat' function. */ +#undef HAVE_FSTAT + +/* Define to 1 if you have the `fstat64' function. */ +#undef HAVE_FSTAT64 + +/* Define to 1 if you have the `fstatat' function. */ +#undef HAVE_FSTATAT + +/* Define to 1 if you have the `fstatat64' function. */ +#undef HAVE_FSTATAT64 + +/* Define to 1 if you have the `getcontext' function. */ +#undef HAVE_GETCONTEXT + +/* Define to 1 if you have the `gethostbyname' function. */ +#undef HAVE_GETHOSTBYNAME + +/* Define to 1 if you have the `getitimer' function. */ +#undef HAVE_GETITIMER + +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define to 1 if you have the `gmtime_r' function. */ +#undef HAVE_GMTIME_R + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `isatty' function. */ +#undef HAVE_ISATTY + +/* Define to 1 if you have the `kqueue' function. */ +#undef HAVE_KQUEUE + +/* Define to 1 if you have the `kqueue1' function. */ +#undef HAVE_KQUEUE1 + +/* labels as values */ +#undef HAVE_LABELS_AS_VALUES + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBUNWIND_H + +/* Define to 1 if you have the `localtime_r' function. */ +#undef HAVE_LOCALTIME_R + +/* Define to 1 if you have the `log' function. */ +#undef HAVE_LOG + +/* Define to 1 if you have the `log10' function. */ +#undef HAVE_LOG10 + +/* Define to 1 if you have the `log10f' function. */ +#undef HAVE_LOG10F + +/* Define to 1 if you have the `log10l' function. */ +#undef HAVE_LOG10L + +/* Define to 1 if you have the `log10q' function. */ +#undef HAVE_LOG10Q + +/* Define to 1 if you have the `log2' function. */ +#undef HAVE_LOG2 + +/* Define to 1 if you have the `log2f' function. */ +#undef HAVE_LOG2F + +/* Define to 1 if you have the `log2l' function. */ +#undef HAVE_LOG2L + +/* Define to 1 if you have the `logf' function. */ +#undef HAVE_LOGF + +/* Define to 1 if you have the `logl' function. */ +#undef HAVE_LOGL + +/* Define to 1 if you have the `logq' function. */ +#undef HAVE_LOGQ + +/* Define to 1 if you have the `lstat64' function. */ +#undef HAVE_LSTAT64 + +/* Define to 1 if you have the header file. */ +#undef HAVE_LTDL_H + +/* Define to 1 if you have the `makecontext' function. */ +#undef HAVE_MAKECONTEXT + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `mmap' function. */ +#undef HAVE_MMAP + +/* Define to 1 if you have the `munmap' function. */ +#undef HAVE_MUNMAP + +/* Define to 1 if you have the `nanosleep' function. */ +#undef HAVE_NANOSLEEP + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +#undef HAVE_NDIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETPACKET_PACKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NET_IF_DL_H + +/* Define to 1 if you have the `pipe2' function. */ +#undef HAVE_PIPE2 + +/* Define to 1 if you have the header file. */ +#undef HAVE_POLL_H + +/* Define to 1 if you have the `pow' function. */ +#undef HAVE_POW + +/* Define to 1 if you have the `powf' function. */ +#undef HAVE_POWF + +/* Define to 1 if you have the `powl' function. */ +#undef HAVE_POWL + +/* Define to 1 if you have the `powq' function. */ +#undef HAVE_POWQ + +/* Define if you have POSIX threads libraries and header files. */ +#undef HAVE_PTHREAD + +/* pthreads has pthread_mutex_timedlock() */ +#undef HAVE_PTHREAD_MUTEX_TIMEDLOCK + +/* pthreads has pthread_mutex_trylock() */ +#undef HAVE_PTHREAD_MUTEX_TRYLOCK + +/* Have PTHREAD_PRIO_INHERIT. */ +#undef HAVE_PTHREAD_PRIO_INHERIT + +/* Define to 1 if you have the header file. */ +#undef HAVE_QUADMATH_H + +/* Define to 1 if you have the `quadmath_snprintf' function. */ +#undef HAVE_QUADMATH_SNPRINTF + +/* Define to 1 if you have the `readdir64' function. */ +#undef HAVE_READDIR64 + +/* Define to 1 if you have the `round' function. */ +#undef HAVE_ROUND + +/* Define to 1 if you have the `roundf' function. */ +#undef HAVE_ROUNDF + +/* Define to 1 if you have the `roundl' function. */ +#undef HAVE_ROUNDL + +/* Define to 1 if you have the `roundq' function. */ +#undef HAVE_ROUNDQ + +/* Define to 1 if you have the `setcontext' function. */ +#undef HAVE_SETCONTEXT + +/* Define to 1 if you have the `setitimer' function. */ +#undef HAVE_SETITIMER + +/* Define to 1 if you have the `settimeofday' function. */ +#undef HAVE_SETTIMEOFDAY + +/* Define to 1 if you have the `sigaction' function. */ +#undef HAVE_SIGACTION + +/* Define to 1 if you have the `signal' function. */ +#undef HAVE_SIGNAL + +/* Define to 1 if you have the header file. */ +#undef HAVE_SIGNAL_H + +/* Define to 1 if you have the `sin' function. */ +#undef HAVE_SIN + +/* Define to 1 if you have the `sinf' function. */ +#undef HAVE_SINF + +/* Define to 1 if you have the `sinh' function. */ +#undef HAVE_SINH + +/* Define to 1 if you have the `sinhf' function. */ +#undef HAVE_SINHF + +/* Define to 1 if you have the `sinhl' function. */ +#undef HAVE_SINHL + +/* Define to 1 if you have the `sinhq' function. */ +#undef HAVE_SINHQ + +/* Define to 1 if you have the `sinl' function. */ +#undef HAVE_SINL + +/* Define to 1 if you have the `sinq' function. */ +#undef HAVE_SINQ + +/* Define to 1 if you have the `snprintf' function. */ +#undef HAVE_SNPRINTF + +/* Define to 1 if you have the header file. */ +#undef HAVE_SPAWN_H + +/* Define to 1 if you have the `sqrt' function. */ +#undef HAVE_SQRT + +/* Define to 1 if you have the `sqrtf' function. */ +#undef HAVE_SQRTF + +/* Define to 1 if you have the `sqrtl' function. */ +#undef HAVE_SQRTL + +/* Define to 1 if you have the `sqrtq' function. */ +#undef HAVE_SQRTQ + +/* Define to 1 if you have the `stat64' function. */ +#undef HAVE_STAT64 + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDDEF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strerror_r' function. */ +#undef HAVE_STRERROR_R + +/* strftime supports %z */ +#undef HAVE_STRFTIME_SMALL_Z + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strtoflt128' function. */ +#undef HAVE_STRTOFLT128 + +/* Define to 1 if `d_type' is a member of `struct dirent'. */ +#undef HAVE_STRUCT_DIRENT_D_TYPE + +/* Define to 1 if you have the `swapcontext' function. */ +#undef HAVE_SWAPCONTEXT + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_DEVPOLL_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_DIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_EPOLL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_EVENT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_MMAN_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_NDIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_RESOURCE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SYSCALL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_UN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_WAIT_H + +/* Define to 1 if you have the `tan' function. */ +#undef HAVE_TAN + +/* Define to 1 if you have the `tanf' function. */ +#undef HAVE_TANF + +/* Define to 1 if you have the `tanh' function. */ +#undef HAVE_TANH + +/* Define to 1 if you have the `tanhf' function. */ +#undef HAVE_TANHF + +/* Define to 1 if you have the `tanhl' function. */ +#undef HAVE_TANHL + +/* Define to 1 if you have the `tanhq' function. */ +#undef HAVE_TANHQ + +/* Define to 1 if you have the `tanl' function. */ +#undef HAVE_TANL + +/* Define to 1 if you have the `tanq' function. */ +#undef HAVE_TANQ + +/* Define to 1 if you have the header file. */ +#undef HAVE_TIME_H + +/* Define to 1 if you have the `t_connect' function. */ +#undef HAVE_T_CONNECT + +/* Define to 1 if you have the header file. */ +#undef HAVE_UCONTEXT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* libunwind is available */ +#undef HAVE_UNWIND_LIB + +/* Define to 1 if you have the `usleep' function. */ +#undef HAVE_USLEEP + +/* Define to 1 if you have the header file. */ +#undef HAVE_UTIME_H + +/* va_copy is available */ +#undef HAVE_VA_COPY + +/* Define to 1 if you have the header file. */ +#undef HAVE_WCHAR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_WCTYPE_H + +/* Define to 1 if you have the `_vsnprintf' function. */ +#undef HAVE__VSNPRINTF + +/* Define to 1 if you have the `_vsnwprintf' function. */ +#undef HAVE__VSNWPRINTF + +/* __builtin_memcmp */ +#undef HAVE___BUILTIN_MEMCMP + +/* __builtin_memcpy */ +#undef HAVE___BUILTIN_MEMCPY + +/* __builtin_memmove */ +#undef HAVE___BUILTIN_MEMMOVE + +/* __builtin_memset */ +#undef HAVE___BUILTIN_MEMSET + +/* __va_copy is available */ +#undef HAVE___VA_COPY + +/* build release/debug */ +#undef HAWK_BUILD_DEBUG + +/* build release/debug */ +#undef HAWK_BUILD_RELEASE + +/* enable dynamic module capability */ +#undef HAWK_ENABLE_DYNAMIC_MODULE + +/* Use a full word as a large integer word */ +#undef HAWK_ENABLE_FULL_LIW + +/* use libltdl when loading a dynamic module */ +#undef HAWK_ENABLE_LIBLTDL + +/* use libunwind for backtracing stack frames */ +#undef HAWK_ENABLE_LIBUNWIND + +/* build mod/mysql */ +#undef HAWK_ENABLE_MOD_MYSQL + +/* build mod/uci */ +#undef HAWK_ENABLE_MOD_UCI + +/* link modules statically into the main library */ +#undef HAWK_ENABLE_STATIC_MODULE + +/* Use the unicode character type as the default character type */ +#undef HAWK_ENABLE_UNICODE + +/* Big Endian */ +#undef HAWK_ENDIAN_BIG + +/* Little Endian */ +#undef HAWK_ENDIAN_LITTLE + +/* Unknown Endian */ +#undef HAWK_ENDIAN_UNKNOWN + +/* MB_LEN_MAX */ +#undef HAWK_MBLEN_MAX + +/* NSIG */ +#undef HAWK_NSIG + +/* offsetof(struct sockaddr, sa_family) */ +#undef HAWK_OFFSETOF_SA_FAMILY + +/* Author */ +#undef HAWK_PACKAGE_AUTHOR + +/* package name */ +#undef HAWK_PACKAGE_NAME + +/* Project URL */ +#undef HAWK_PACKAGE_URL + +/* Package version */ +#undef HAWK_PACKAGE_VERSION + +/* Major version number */ +#undef HAWK_PACKAGE_VERSION_MAJOR + +/* Minor version number */ +#undef HAWK_PACKAGE_VERSION_MINOR + +/* Patch level */ +#undef HAWK_PACKAGE_VERSION_PATCH + +/* PATH_MAX */ +#undef HAWK_PATH_MAX + +/* Define if pthread_cond_t is signed */ +#undef HAWK_PTHREAD_MUTEX_T_IS_SIGNED + +/* Define if pthread_t is signed */ +#undef HAWK_PTHREAD_T_IS_SIGNED + +/* Define if sa_family_t is signed */ +#undef HAWK_SA_FAMILY_T_IS_SIGNED + +/* sizeof(char) */ +#undef HAWK_SIZEOF_CHAR + +/* sizeof(double) */ +#undef HAWK_SIZEOF_DOUBLE + +/* sizeof(float) */ +#undef HAWK_SIZEOF_FLOAT + +/* sizeof(int) */ +#undef HAWK_SIZEOF_INT + +/* sizeof(long) */ +#undef HAWK_SIZEOF_LONG + +/* sizeof(long double) */ +#undef HAWK_SIZEOF_LONG_DOUBLE + +/* sizeof(long long) */ +#undef HAWK_SIZEOF_LONG_LONG + +/* sizeof(mbstate_t) */ +#undef HAWK_SIZEOF_MBSTATE_T + +/* sizeof(off64_t) */ +#undef HAWK_SIZEOF_OFF64_T + +/* sizeof(off_t) */ +#undef HAWK_SIZEOF_OFF_T + +/* sizeof(pthread_cond_t) */ +#undef HAWK_SIZEOF_PTHREAD_COND_T + +/* sizeof(pthread_mutex_t) */ +#undef HAWK_SIZEOF_PTHREAD_MUTEX_T + +/* sizeof(pthread_t) */ +#undef HAWK_SIZEOF_PTHREAD_T + +/* sizeof(sa_family_t) */ +#undef HAWK_SIZEOF_SA_FAMILY_T + +/* sizeof(short) */ +#undef HAWK_SIZEOF_SHORT + +/* sizeof(socklen_t) */ +#undef HAWK_SIZEOF_SOCKLEN_T + +/* sizeof(struct sockaddr_dl) */ +#undef HAWK_SIZEOF_STRUCT_SOCKADDR_DL + +/* sizeof(struct sockaddr_in) */ +#undef HAWK_SIZEOF_STRUCT_SOCKADDR_IN + +/* sizeof(struct sockaddr_in6) */ +#undef HAWK_SIZEOF_STRUCT_SOCKADDR_IN6 + +/* sizeof(struct sockaddr_ll) */ +#undef HAWK_SIZEOF_STRUCT_SOCKADDR_LL + +/* sizeof(struct sockaddr_un) */ +#undef HAWK_SIZEOF_STRUCT_SOCKADDR_UN + +/* sizeof(void*) */ +#undef HAWK_SIZEOF_VOID_P + +/* sizeof(wchar_t) */ +#undef HAWK_SIZEOF_WCHAR_T + +/* sizeof(__float128) */ +#undef HAWK_SIZEOF___FLOAT128 + +/* sizeof(__int128) */ +#undef HAWK_SIZEOF___INT128 + +/* sizeof(__int128_t) */ +#undef HAWK_SIZEOF___INT128_T + +/* sizeof(__int16) */ +#undef HAWK_SIZEOF___INT16 + +/* sizeof(__int32) */ +#undef HAWK_SIZEOF___INT32 + +/* sizeof(__int64) */ +#undef HAWK_SIZEOF___INT64 + +/* sizeof(__int8) */ +#undef HAWK_SIZEOF___INT8 + +/* sizeof(__uint128_t) */ +#undef HAWK_SIZEOF___UINT128_T + +/* Define if socklen_t is signed */ +#undef HAWK_SOCKLEN_T_IS_SIGNED + +/* Unicode character type size */ +#undef HAWK_UNICODE_SIZE + +/* use hawk_fltmax_t for floating-point numbers */ +#undef HAWK_USE_FLTMAX + +/* use hawk_intmax_t for integers */ +#undef HAWK_USE_INTMAX + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#undef LT_OBJDIR + +/* The size of `MB_LEN_MAX', as computed by valueof. */ +#undef NUMVALOF_MB_LEN_MAX + +/* The size of `NSIG', as computed by valueof. */ +#undef NUMVALOF_NSIG + +/* The size of `PATH_MAX', as computed by valueof. */ +#undef NUMVALOF_PATH_MAX + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +#undef PTHREAD_CREATE_JOINABLE + +/* The size of `char', as computed by sizeof. */ +#undef SIZEOF_CHAR + +/* The size of `double', as computed by sizeof. */ +#undef SIZEOF_DOUBLE + +/* The size of `float', as computed by sizeof. */ +#undef SIZEOF_FLOAT + +/* The size of `int', as computed by sizeof. */ +#undef SIZEOF_INT + +/* The size of `long', as computed by sizeof. */ +#undef SIZEOF_LONG + +/* The size of `long double', as computed by sizeof. */ +#undef SIZEOF_LONG_DOUBLE + +/* The size of `long long', as computed by sizeof. */ +#undef SIZEOF_LONG_LONG + +/* The size of `mbstate_t', as computed by sizeof. */ +#undef SIZEOF_MBSTATE_T + +/* The size of `off64_t', as computed by sizeof. */ +#undef SIZEOF_OFF64_T + +/* The size of `off_t', as computed by sizeof. */ +#undef SIZEOF_OFF_T + +/* The size of `pthread_cond_t', as computed by sizeof. */ +#undef SIZEOF_PTHREAD_COND_T + +/* The size of `pthread_mutex_t', as computed by sizeof. */ +#undef SIZEOF_PTHREAD_MUTEX_T + +/* The size of `pthread_t', as computed by sizeof. */ +#undef SIZEOF_PTHREAD_T + +/* The size of `sa_family_t', as computed by sizeof. */ +#undef SIZEOF_SA_FAMILY_T + +/* The size of `short', as computed by sizeof. */ +#undef SIZEOF_SHORT + +/* The size of `socklen_t', as computed by sizeof. */ +#undef SIZEOF_SOCKLEN_T + +/* The size of `struct sockaddr_dl', as computed by sizeof. */ +#undef SIZEOF_STRUCT_SOCKADDR_DL + +/* The size of `struct sockaddr_in', as computed by sizeof. */ +#undef SIZEOF_STRUCT_SOCKADDR_IN + +/* The size of `struct sockaddr_in6', as computed by sizeof. */ +#undef SIZEOF_STRUCT_SOCKADDR_IN6 + +/* The size of `struct sockaddr_ll', as computed by sizeof. */ +#undef SIZEOF_STRUCT_SOCKADDR_LL + +/* The size of `struct sockaddr_un', as computed by sizeof. */ +#undef SIZEOF_STRUCT_SOCKADDR_UN + +/* The size of `void *', as computed by sizeof. */ +#undef SIZEOF_VOID_P + +/* The size of `wchar_t', as computed by sizeof. */ +#undef SIZEOF_WCHAR_T + +/* The size of `__float128', as computed by sizeof. */ +#undef SIZEOF___FLOAT128 + +/* The size of `__int128', as computed by sizeof. */ +#undef SIZEOF___INT128 + +/* The size of `__int128_t', as computed by sizeof. */ +#undef SIZEOF___INT128_T + +/* The size of `__int16', as computed by sizeof. */ +#undef SIZEOF___INT16 + +/* The size of `__int16_t', as computed by sizeof. */ +#undef SIZEOF___INT16_T + +/* The size of `__int32', as computed by sizeof. */ +#undef SIZEOF___INT32 + +/* The size of `__int32_t', as computed by sizeof. */ +#undef SIZEOF___INT32_T + +/* The size of `__int64', as computed by sizeof. */ +#undef SIZEOF___INT64 + +/* The size of `__int64_t', as computed by sizeof. */ +#undef SIZEOF___INT64_T + +/* The size of `__int8', as computed by sizeof. */ +#undef SIZEOF___INT8 + +/* The size of `__int8_t', as computed by sizeof. */ +#undef SIZEOF___INT8_T + +/* The size of `__uint128_t', as computed by sizeof. */ +#undef SIZEOF___UINT128_T + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES diff --git a/hawk/lib/hawk-chr.h b/hawk/lib/hawk-chr.h new file mode 100644 index 00000000..fff225af --- /dev/null +++ b/hawk/lib/hawk-chr.h @@ -0,0 +1,370 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_CHR_H_ +#define _HAWK_CHR_H_ + +#include + +enum hawk_ooch_prop_t +{ + HAWK_OOCH_PROP_UPPER = (1 << 0), +#define HAWK_UCH_PROP_UPPER HAWK_OOCH_PROP_UPPER +#define HAWK_BCH_PROP_UPPER HAWK_OOCH_PROP_UPPER + + HAWK_OOCH_PROP_LOWER = (1 << 1), +#define HAWK_UCH_PROP_LOWER HAWK_OOCH_PROP_LOWER +#define HAWK_BCH_PROP_LOWER HAWK_OOCH_PROP_LOWER + + HAWK_OOCH_PROP_ALPHA = (1 << 2), +#define HAWK_UCH_PROP_ALPHA HAWK_OOCH_PROP_ALPHA +#define HAWK_BCH_PROP_ALPHA HAWK_OOCH_PROP_ALPHA + + HAWK_OOCH_PROP_DIGIT = (1 << 3), +#define HAWK_UCH_PROP_DIGIT HAWK_OOCH_PROP_DIGIT +#define HAWK_BCH_PROP_DIGIT HAWK_OOCH_PROP_DIGIT + + HAWK_OOCH_PROP_XDIGIT = (1 << 4), +#define HAWK_UCH_PROP_XDIGIT HAWK_OOCH_PROP_XDIGIT +#define HAWK_BCH_PROP_XDIGIT HAWK_OOCH_PROP_XDIGIT + + HAWK_OOCH_PROP_ALNUM = (1 << 5), +#define HAWK_UCH_PROP_ALNUM HAWK_OOCH_PROP_XDIGIT +#define HAWK_BCH_PROP_ALNUM HAWK_OOCH_PROP_XDIGIT + + HAWK_OOCH_PROP_SPACE = (1 << 6), +#define HAWK_UCH_PROP_SPACE HAWK_OOCH_PROP_SPACE +#define HAWK_BCH_PROP_SPACE HAWK_OOCH_PROP_SPACE + + HAWK_OOCH_PROP_PRINT = (1 << 8), +#define HAWK_UCH_PROP_PRINT HAWK_OOCH_PROP_PRINT +#define HAWK_BCH_PROP_PRINT HAWK_OOCH_PROP_PRINT + + HAWK_OOCH_PROP_GRAPH = (1 << 9), +#define HAWK_UCH_PROP_GRAPH HAWK_OOCH_PROP_GRAPH +#define HAWK_BCH_PROP_GRAPH HAWK_OOCH_PROP_GRAPH + + HAWK_OOCH_PROP_CNTRL = (1 << 10), +#define HAWK_UCH_PROP_CNTRL HAWK_OOCH_PROP_CNTRL +#define HAWK_BCH_PROP_CNTRL HAWK_OOCH_PROP_CNTRL + + HAWK_OOCH_PROP_PUNCT = (1 << 11), +#define HAWK_UCH_PROP_PUNCT HAWK_OOCH_PROP_PUNCT +#define HAWK_BCH_PROP_PUNCT HAWK_OOCH_PROP_PUNCT + + HAWK_OOCH_PROP_BLANK = (1 << 12) +#define HAWK_UCH_PROP_BLANK HAWK_OOCH_PROP_BLANK +#define HAWK_BCH_PROP_BLANK HAWK_OOCH_PROP_BLANK +}; + +typedef enum hawk_ooch_prop_t hawk_ooch_prop_t; +typedef enum hawk_ooch_prop_t hawk_uch_prop_t; +typedef enum hawk_ooch_prop_t hawk_bch_prop_t; + +#if defined(__cplusplus) +extern "C" { +#endif + +HAWK_EXPORT int hawk_is_uch_type (hawk_uch_t c, hawk_uch_prop_t type); +HAWK_EXPORT int hawk_is_uch_upper (hawk_uch_t c); +HAWK_EXPORT int hawk_is_uch_lower (hawk_uch_t c); +HAWK_EXPORT int hawk_is_uch_alpha (hawk_uch_t c); +HAWK_EXPORT int hawk_is_uch_digit (hawk_uch_t c); +HAWK_EXPORT int hawk_is_uch_xdigit (hawk_uch_t c); +HAWK_EXPORT int hawk_is_uch_alnum (hawk_uch_t c); +HAWK_EXPORT int hawk_is_uch_space (hawk_uch_t c); +HAWK_EXPORT int hawk_is_uch_print (hawk_uch_t c); +HAWK_EXPORT int hawk_is_uch_graph (hawk_uch_t c); +HAWK_EXPORT int hawk_is_uch_cntrl (hawk_uch_t c); +HAWK_EXPORT int hawk_is_uch_punct (hawk_uch_t c); +HAWK_EXPORT int hawk_is_uch_blank (hawk_uch_t c); +HAWK_EXPORT hawk_uch_t hawk_to_uch_upper (hawk_uch_t c); +HAWK_EXPORT hawk_uch_t hawk_to_uch_lower (hawk_uch_t c); + +/* ------------------------------------------------------------------------- */ + +HAWK_EXPORT int hawk_is_bch_type (hawk_bch_t c, hawk_bch_prop_t type); + +#if defined(__has_builtin) +# if __has_builtin(__builtin_isupper) +# define hawk_is_bch_upper __builtin_isupper +# endif +# if __has_builtin(__builtin_islower) +# define hawk_is_bch_lower __builtin_islower +# endif +# if __has_builtin(__builtin_isalpha) +# define hawk_is_bch_alpha __builtin_isalpha +# endif +# if __has_builtin(__builtin_isdigit) +# define hawk_is_bch_digit __builtin_isdigit +# endif +# if __has_builtin(__builtin_isxdigit) +# define hawk_is_bch_xdigit __builtin_isxdigit +# endif +# if __has_builtin(__builtin_isalnum) +# define hawk_is_bch_alnum __builtin_isalnum +# endif +# if __has_builtin(__builtin_isspace) +# define hawk_is_bch_space __builtin_isspace +# endif +# if __has_builtin(__builtin_isprint) +# define hawk_is_bch_print __builtin_isprint +# endif +# if __has_builtin(__builtin_isgraph) +# define hawk_is_bch_graph __builtin_isgraph +# endif +# if __has_builtin(__builtin_iscntrl) +# define hawk_is_bch_cntrl __builtin_iscntrl +# endif +# if __has_builtin(__builtin_ispunct) +# define hawk_is_bch_punct __builtin_ispunct +# endif +# if __has_builtin(__builtin_isblank) +# define hawk_is_bch_blank __builtin_isblank +# endif +# if __has_builtin(__builtin_toupper) +# define hawk_to_bch_upper __builtin_toupper +# endif +# if __has_builtin(__builtin_tolower) +# define hawk_to_bch_lower __builtin_tolower +# endif +#elif (__GNUC__ >= 14) +# define hawk_is_bch_upper __builtin_isupper +# define hawk_is_bch_lower __builtin_islower +# define hawk_is_bch_alpha __builtin_isalpha +# define hawk_is_bch_digit __builtin_isdigit +# define hawk_is_bch_xdigit __builtin_isxdigit +# define hawk_is_bch_alnum __builtin_isalnum +# define hawk_is_bch_space __builtin_isspace +# define hawk_is_bch_print __builtin_isprint +# define hawk_is_bch_graph __builtin_isgraph +# define hawk_is_bch_cntrl __builtin_iscntrl +# define hawk_is_bch_punct __builtin_ispunct +# define hawk_is_bch_blank __builtin_isblank +# define hawk_to_bch_upper __builtin_toupper +# define hawk_to_bch_lower __builtin_tolower +#endif + +/* the bch class functions support no locale. + * these implemenent latin-1 only */ + +#if !defined(hawk_is_bch_upper) && defined(HAWK_HAVE_INLINE) +static HAWK_INLINE int hawk_is_bch_upper (hawk_bch_t c) { return (hawk_bcu_t)c - 'A' < 26; } +#elif !defined(hawk_is_bch_upper) +# define hawk_is_bch_upper(c) ((hawk_bcu_t)(c) - 'A' < 26) +#endif + +#if !defined(hawk_is_bch_lower) && defined(HAWK_HAVE_INLINE) +static HAWK_INLINE int hawk_is_bch_lower (hawk_bch_t c) { return (hawk_bcu_t)c - 'a' < 26; } +#elif !defined(hawk_is_bch_lower) +# define hawk_is_bch_lower(c) ((hawk_bcu_t)(c) - 'a' < 26) +#endif + +#if !defined(hawk_is_bch_alpha) && defined(HAWK_HAVE_INLINE) +static HAWK_INLINE int hawk_is_bch_alpha (hawk_bch_t c) { return ((hawk_bcu_t)c | 32) - 'a' < 26; } +#elif !defined(hawk_is_bch_alpha) +# define hawk_is_bch_alpha(c) (((hawk_bcu_t)(c) | 32) - 'a' < 26) +#endif + +#if !defined(hawk_is_bch_digit) && defined(HAWK_HAVE_INLINE) +static HAWK_INLINE int hawk_is_bch_digit (hawk_bch_t c) { return (hawk_bcu_t)c - '0' < 10; } +#elif !defined(hawk_is_bch_digit) +# define hawk_is_bch_digit(c) ((hawk_bcu_t)(c) - '0' < 10) +#endif + +#if !defined(hawk_is_bch_xdigit) && defined(HAWK_HAVE_INLINE) +static HAWK_INLINE int hawk_is_bch_xdigit (hawk_bch_t c) { return hawk_is_bch_digit(c) || ((hawk_bcu_t)c | 32) - 'a' < 6; } +#elif !defined(hawk_is_bch_xdigit) +# define hawk_is_bch_xdigit(c) (hawk_is_bch_digit(c) || ((hawk_bcu_t)(c) | 32) - 'a' < 6) +#endif + +#if !defined(hawk_is_bch_alnum) && defined(HAWK_HAVE_INLINE) +static HAWK_INLINE int hawk_is_bch_alnum (hawk_bch_t c) { return hawk_is_bch_alpha(c) || hawk_is_bch_digit(c); } +#elif !defined(hawk_is_bch_alnum) +# define hawk_is_bch_alnum(c) (hawk_is_bch_alpha(c) || hawk_is_bch_digit(c)) +#endif + +#if !defined(hawk_is_bch_space) && defined(HAWK_HAVE_INLINE) +static HAWK_INLINE int hawk_is_bch_space (hawk_bch_t c) { return c == ' ' || (hawk_bcu_t)c - '\t' < 5; } +#elif !defined(hawk_is_bch_space) +# define hawk_is_bch_space(c) ((c) == ' ' || (hawk_bcu_t)(c) - '\t' < 5) +#endif + +#if !defined(hawk_is_bch_print) && defined(HAWK_HAVE_INLINE) +static HAWK_INLINE int hawk_is_bch_print (hawk_bch_t c) { return (hawk_bcu_t)c - ' ' < 95; } +#elif !defined(hawk_is_bch_print) +# define hawk_is_bch_print(c) ((hawk_bcu_t)(c) - ' ' < 95) +#endif + +#if !defined(hawk_is_bch_graph) && defined(HAWK_HAVE_INLINE) +static HAWK_INLINE int hawk_is_bch_graph (hawk_bch_t c) { return (hawk_bcu_t)c - '!' < 94; } +#elif !defined(hawk_is_bch_graph) +# define hawk_is_bch_graph(c) ((hawk_bcu_t)(c) - '!' < 94) +#endif + +#if !defined(hawk_is_bch_cntrl) && defined(HAWK_HAVE_INLINE) +static HAWK_INLINE int hawk_is_bch_cntrl (hawk_bch_t c) { return (hawk_bcu_t)c < ' ' || (hawk_bcu_t)c == 127; } +#elif !defined(hawk_is_bch_cntrl) +# define hawk_is_bch_cntrl(c) ((hawk_bcu_t)(c) < ' ' || (hawk_bcu_t)(c) == 127) +#endif + +#if !defined(hawk_is_bch_punct) && defined(HAWK_HAVE_INLINE) +static HAWK_INLINE int hawk_is_bch_punct (hawk_bch_t c) { return hawk_is_bch_graph(c) && !hawk_is_bch_alnum(c); } +#elif !defined(hawk_is_bch_punct) +# define hawk_is_bch_punct(c) (hawk_is_bch_graph(c) && !hawk_is_bch_alnum(c)) +#endif + +#if !defined(hawk_is_bch_blank) && defined(HAWK_HAVE_INLINE) +static HAWK_INLINE int hawk_is_bch_blank (hawk_bch_t c) { return c == ' ' || c == '\t'; } +#elif !defined(hawk_is_bch_blank) +# define hawk_is_bch_blank(c) ((c) == ' ' || (c) == '\t') +#endif + +#if !defined(hawk_to_bch_upper) +HAWK_EXPORT hawk_bch_t hawk_to_bch_upper (hawk_bch_t c); +#endif +#if !defined(hawk_to_bch_lower) +HAWK_EXPORT hawk_bch_t hawk_to_bch_lower (hawk_bch_t c); +#endif + +#if defined(HAWK_OOCH_IS_UCH) +# define hawk_is_ooch_type hawk_is_uch_type +# define hawk_is_ooch_upper hawk_is_uch_upper +# define hawk_is_ooch_lower hawk_is_uch_lower +# define hawk_is_ooch_alpha hawk_is_uch_alpha +# define hawk_is_ooch_digit hawk_is_uch_digit +# define hawk_is_ooch_xdigit hawk_is_uch_xdigit +# define hawk_is_ooch_alnum hawk_is_uch_alnum +# define hawk_is_ooch_space hawk_is_uch_space +# define hawk_is_ooch_print hawk_is_uch_print +# define hawk_is_ooch_graph hawk_is_uch_graph +# define hawk_is_ooch_cntrl hawk_is_uch_cntrl +# define hawk_is_ooch_punct hawk_is_uch_punct +# define hawk_is_ooch_blank hawk_is_uch_blank +# define hawk_to_ooch_upper hawk_to_uch_upper +# define hawk_to_ooch_lower hawk_to_uch_lower +#else +# define hawk_is_ooch_type hawk_is_bch_type +# define hawk_is_ooch_upper hawk_is_bch_upper +# define hawk_is_ooch_lower hawk_is_bch_lower +# define hawk_is_ooch_alpha hawk_is_bch_alpha +# define hawk_is_ooch_digit hawk_is_bch_digit +# define hawk_is_ooch_xdigit hawk_is_bch_xdigit +# define hawk_is_ooch_alnum hawk_is_bch_alnum +# define hawk_is_ooch_space hawk_is_bch_space +# define hawk_is_ooch_print hawk_is_bch_print +# define hawk_is_ooch_graph hawk_is_bch_graph +# define hawk_is_ooch_cntrl hawk_is_bch_cntrl +# define hawk_is_ooch_punct hawk_is_bch_punct +# define hawk_is_ooch_blank hawk_is_bch_blank +# define hawk_to_ooch_upper hawk_to_bch_upper +# define hawk_to_ooch_lower hawk_to_bch_lower +#endif + +HAWK_EXPORT int hawk_ucstr_to_uch_prop ( + const hawk_uch_t* name, + hawk_uch_prop_t* id +); + +HAWK_EXPORT int hawk_uchars_to_uch_prop ( + const hawk_uch_t* name, + hawk_oow_t len, + hawk_uch_prop_t* id +); + +HAWK_EXPORT int hawk_bcstr_to_bch_prop ( + const hawk_bch_t* name, + hawk_bch_prop_t* id +); + +HAWK_EXPORT int hawk_bchars_to_bch_prop ( + const hawk_bch_t* name, + hawk_oow_t len, + hawk_bch_prop_t* id +); + +#if defined(HAWK_OOCH_IS_UCH) +# define hawk_oocstr_to_ooch_prop hawk_ucstr_to_uch_prop +# define hawk_oochars_to_ooch_prop hawk_uchars_to_uch_prop +#else +# define hawk_oocstr_to_ooch_prop hawk_bcstr_to_bch_prop +# define hawk_oochars_to_ooch_prop hawk_bchars_to_bch_prop +#endif + +/* ------------------------------------------------------------------------- */ + +HAWK_EXPORT int hawk_get_ucwidth ( + hawk_uch_t uc +); + +/* ------------------------------------------------------------------------- */ + +HAWK_EXPORT hawk_oow_t hawk_uc_to_utf8 ( + hawk_uch_t uc, + hawk_bch_t* utf8, + hawk_oow_t size +); + +HAWK_EXPORT hawk_oow_t hawk_utf8_to_uc ( + const hawk_bch_t* utf8, + hawk_oow_t size, + hawk_uch_t* uc +); + +/* ------------------------------------------------------------------------- */ + +HAWK_EXPORT hawk_oow_t hawk_uc_to_utf16 ( + hawk_uch_t uc, + hawk_bch_t* utf16, + hawk_oow_t size +); + +HAWK_EXPORT hawk_oow_t hawk_utf16_to_uc ( + const hawk_bch_t* utf16, + hawk_oow_t size, + hawk_uch_t* uc +); + +/* ------------------------------------------------------------------------- */ + +HAWK_EXPORT hawk_oow_t hawk_uc_to_mb8 ( + hawk_uch_t uc, + hawk_bch_t* mb8, + hawk_oow_t size +); + +HAWK_EXPORT hawk_oow_t hawk_mb8_to_uc ( + const hawk_bch_t* mb8, + hawk_oow_t size, + hawk_uch_t* uc +); + + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/hawk/lib/hawk-cli.h b/hawk/lib/hawk-cli.h new file mode 100644 index 00000000..53bdf41e --- /dev/null +++ b/hawk/lib/hawk-cli.h @@ -0,0 +1,141 @@ +/* + * $Id$ + * + Copyright (c) 2014-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_CLI_H_ +#define _HAWK_CLI_H_ + +#include + +/** \file + * This file defines functions and data structures to process + * command-line arguments. + */ + +typedef struct hawk_ucli_t hawk_ucli_t; +typedef struct hawk_ucli_lng_t hawk_ucli_lng_t; + +struct hawk_ucli_lng_t +{ + const hawk_uch_t* str; + hawk_uci_t val; +}; + +struct hawk_ucli_t +{ + /* input */ + const hawk_uch_t* str; /* option string */ + hawk_ucli_lng_t* lng; /* long options */ + + /* output */ + hawk_uci_t opt; /* character checked for validity */ + hawk_uch_t* arg; /* argument associated with an option */ + + /* output */ + const hawk_uch_t* lngopt; + + /* input + output */ + int ind; /* index into parent argv vector */ + + /* input + output - internal*/ + hawk_uch_t* cur; +}; + +typedef struct hawk_bcli_t hawk_bcli_t; +typedef struct hawk_bcli_lng_t hawk_bcli_lng_t; + +struct hawk_bcli_lng_t +{ + const hawk_bch_t* str; + hawk_bci_t val; +}; + +struct hawk_bcli_t +{ + /* input */ + const hawk_bch_t* str; /* option string */ + hawk_bcli_lng_t* lng; /* long options */ + + /* output */ + hawk_bci_t opt; /* character checked for validity */ + hawk_bch_t* arg; /* argument associated with an option */ + + /* output */ + const hawk_bch_t* lngopt; + + /* input + output */ + int ind; /* index into parent argv vector */ + + /* input + output - internal*/ + hawk_bch_t* cur; +}; + +#if defined(__cplusplus) +extern "C" { +#endif + +/** + * The hawk_get_cli() function processes the \a argc command-line arguments + * pointed to by \a argv as configured in \a opt. It can process two + * different option styles: a single character starting with '-', and a + * long name starting with '--'. + * + * A character in \a opt.str is treated as a single character option. Should + * it require a parameter, specify ':' after it. + * + * Two special returning option characters indicate special error conditions. + * - \b ? indicates a bad option stored in the \a opt->opt field. + * - \b : indicates a bad parameter for an option stored in the \a opt->opt field. + * + * @return an option character on success, HAWK_CHAR_EOF on no more options. + */ +HAWK_EXPORT hawk_uci_t hawk_get_ucli ( + int argc, /* argument count */ + hawk_uch_t* const* argv, /* argument array */ + hawk_ucli_t* opt /* option configuration */ +); + +HAWK_EXPORT hawk_bci_t hawk_get_bcli ( + int argc, /* argument count */ + hawk_bch_t* const* argv, /* argument array */ + hawk_bcli_t* opt /* option configuration */ +); + + +#if defined(HAWK_OOCH_IS_UCH) +# define hawk_cli_t hawk_ucli_t +# define hawk_cli_lng_t hawk_ucli_lng_t +# define hawk_get_cli(argc,argv,opt) hawk_get_ucli(argc,argv,opt) +#else +# define hawk_cli_t hawk_bcli_t +# define hawk_cli_lng_t hawk_bcli_lng_t +# define hawk_get_cli(argc,argv,opt) hawk_get_bcli(argc,argv,opt) +#endif + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/hawk/lib/hawk-cmn.h b/hawk/lib/hawk-cmn.h new file mode 100644 index 00000000..f5fd7908 --- /dev/null +++ b/hawk/lib/hawk-cmn.h @@ -0,0 +1,1268 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_CMN_H_ +#define _HAWK_CMN_H_ + +/* WARNING: NEVER CHANGE/DELETE THE FOLLOWING HAWK_HAVE_CFG_H DEFINITION. + * IT IS USED FOR DEPLOYMENT BY MAKEFILE.AM */ +/*#define HAWK_HAVE_CFG_H*/ + +#if defined(HAWK_HAVE_CFG_H) +# include +#elif defined(_WIN32) +# include +#elif defined(__OS2__) +# include +#elif defined(__DOS__) +# include +#elif defined(macintosh) +# include /* class mac os */ +#else +# error UNSUPPORTED SYSTEM +#endif + + +/* ========================================================================= + * ARCHITECTURE/COMPILER TWEAKS + * ========================================================================= */ + +#if defined(EMSCRIPTEN) +# if defined(HAWK_SIZEOF___INT128) +# undef HAWK_SIZEOF___INT128 +# define HAWK_SIZEOF___INT128 0 +# endif +# if defined(HAWK_SIZEOF_LONG) && defined(HAWK_SIZEOF_INT) && (HAWK_SIZEOF_LONG > HAWK_SIZEOF_INT) + /* autoconf doesn't seem to match actual emscripten */ +# undef HAWK_SIZEOF_LONG +# define HAWK_SIZEOF_LONG HAWK_SIZEOF_INT +# endif +# include /* EMSCRIPTEN_KEEPALIVE */ +#endif + +#if defined(__GNUC__) && defined(__arm__) && !defined(__ARM_ARCH) +# if defined(__ARM_ARCH_8__) +# define __ARM_ARCH 8 +# elif defined(__ARM_ARCH_7__) +# define __ARM_ARCH 7 +# elif defined(__ARM_ARCH_6__) +# define __ARM_ARCH 6 +# elif defined(__ARM_ARCH_5__) +# define __ARM_ARCH 5 +# elif defined(__ARM_ARCH_4__) +# define __ARM_ARCH 4 +# endif +#endif + +/* ========================================================================= + * PRIMITIVE TYPE DEFINTIONS + * ========================================================================= */ + +/* hawk_int8_t */ +#if defined(HAWK_SIZEOF_CHAR) && (HAWK_SIZEOF_CHAR == 1) +# define HAWK_HAVE_UINT8_T +# define HAWK_HAVE_INT8_T +# define HAWK_SIZEOF_UINT8_T (HAWK_SIZEOF_CHAR) +# define HAWK_SIZEOF_INT8_T (HAWK_SIZEOF_CHAR) + typedef unsigned char hawk_uint8_t; + typedef signed char hawk_int8_t; +#elif defined(HAWK_SIZEOF___INT8) && (HAWK_SIZEOF___INT8 == 1) +# define HAWK_HAVE_UINT8_T +# define HAWK_HAVE_INT8_T +# define HAWK_SIZEOF_UINT8_T (HAWK_SIZEOF___INT8) +# define HAWK_SIZEOF_INT8_T (HAWK_SIZEOF___INT8) + typedef unsigned __int8 hawk_uint8_t; + typedef signed __int8 hawk_int8_t; +#elif defined(HAWK_SIZEOF___INT8_T) && (HAWK_SIZEOF___INT8_T == 1) +# define HAWK_HAVE_UINT8_T +# define HAWK_HAVE_INT8_T +# define HAWK_SIZEOF_UINT8_T (HAWK_SIZEOF___INT8_T) +# define HAWK_SIZEOF_INT8_T (HAWK_SIZEOF___INT8_T) + typedef unsigned __int8_t hawk_uint8_t; + typedef signed __int8_t hawk_int8_t; +#else +# define HAWK_HAVE_UINT8_T +# define HAWK_HAVE_INT8_T +# define HAWK_SIZEOF_UINT8_T (1) +# define HAWK_SIZEOF_INT8_T (1) + typedef unsigned char hawk_uint8_t; + typedef signed char hawk_int8_t; +#endif + +/* hawk_int16_t */ +#if defined(HAWK_SIZEOF_SHORT) && (HAWK_SIZEOF_SHORT == 2) +# define HAWK_HAVE_UINT16_T +# define HAWK_HAVE_INT16_T +# define HAWK_SIZEOF_UINT16_T (HAWK_SIZEOF_SHORT) +# define HAWK_SIZEOF_INT16_T (HAWK_SIZEOF_SHORT) + typedef unsigned short int hawk_uint16_t; + typedef signed short int hawk_int16_t; +#elif defined(HAWK_SIZEOF___INT16) && (HAWK_SIZEOF___INT16 == 2) +# define HAWK_HAVE_UINT16_T +# define HAWK_HAVE_INT16_T +# define HAWK_SIZEOF_UINT16_T (HAWK_SIZEOF___INT16) +# define HAWK_SIZEOF_INT16_T (HAWK_SIZEOF___INT16) + typedef unsigned __int16 hawk_uint16_t; + typedef signed __int16 hawk_int16_t; +#elif defined(HAWK_SIZEOF___INT16_T) && (HAWK_SIZEOF___INT16_T == 2) +# define HAWK_HAVE_UINT16_T +# define HAWK_HAVE_INT16_T +# define HAWK_SIZEOF_UINT16_T (HAWK_SIZEOF___INT16_T) +# define HAWK_SIZEOF_INT16_T (HAWK_SIZEOF___INT16_T) + typedef unsigned __int16_t hawk_uint16_t; + typedef signed __int16_t hawk_int16_t; +#else +# define HAWK_HAVE_UINT16_T +# define HAWK_HAVE_INT16_T +# define HAWK_SIZEOF_UINT16_T (2) +# define HAWK_SIZEOF_INT16_T (2) + typedef unsigned short int hawk_uint16_t; + typedef signed short int hawk_int16_t; +#endif + + +/* hawk_int32_t */ +#if defined(HAWK_SIZEOF_INT) && (HAWK_SIZEOF_INT == 4) +# define HAWK_HAVE_UINT32_T +# define HAWK_HAVE_INT32_T +# define HAWK_SIZEOF_UINT32_T (HAWK_SIZEOF_INT) +# define HAWK_SIZEOF_INT32_T (HAWK_SIZEOF_INT) + typedef unsigned int hawk_uint32_t; + typedef signed int hawk_int32_t; +#elif defined(HAWK_SIZEOF_LONG) && (HAWK_SIZEOF_LONG == 4) +# define HAWK_HAVE_UINT32_T +# define HAWK_HAVE_INT32_T +# define HAWK_SIZEOF_UINT32_T (HAWK_SIZEOF_LONG) +# define HAWK_SIZEOF_INT32_T (HAWK_SIZEOF_LONG) + typedef unsigned long int hawk_uint32_t; + typedef signed long int hawk_int32_t; +#elif defined(HAWK_SIZEOF___INT32) && (HAWK_SIZEOF___INT32 == 4) +# define HAWK_HAVE_UINT32_T +# define HAWK_HAVE_INT32_T +# define HAWK_SIZEOF_UINT32_T (HAWK_SIZEOF___INT32) +# define HAWK_SIZEOF_INT32_T (HAWK_SIZEOF___INT32) + typedef unsigned __int32 hawk_uint32_t; + typedef signed __int32 hawk_int32_t; +#elif defined(HAWK_SIZEOF___INT32_T) && (HAWK_SIZEOF___INT32_T == 4) +# define HAWK_HAVE_UINT32_T +# define HAWK_HAVE_INT32_T +# define HAWK_SIZEOF_UINT32_T (HAWK_SIZEOF___INT32_T) +# define HAWK_SIZEOF_INT32_T (HAWK_SIZEOF___INT32_T) + typedef unsigned __int32_t hawk_uint32_t; + typedef signed __int32_t hawk_int32_t; +#elif defined(__DOS__) +# define HAWK_HAVE_UINT32_T +# define HAWK_HAVE_INT32_T +# define HAWK_SIZEOF_UINT32_T (4) +# define HAWK_SIZEOF_INT32_T (4) + typedef unsigned long int hawk_uint32_t; + typedef signed long int hawk_int32_t; +#else +# define HAWK_HAVE_UINT32_T +# define HAWK_HAVE_INT32_T +# define HAWK_SIZEOF_UINT32_T (4) +# define HAWK_SIZEOF_INT32_T (4) + typedef unsigned int hawk_uint32_t; + typedef signed int hawk_int32_t; +#endif + +/* hawk_int64_t */ +#if defined(HAWK_SIZEOF_INT) && (HAWK_SIZEOF_INT == 8) +# define HAWK_HAVE_UINT64_T +# define HAWK_HAVE_INT64_T +# define HAWK_SIZEOF_UINT64_T (HAWK_SIZEOF_INT) +# define HAWK_SIZEOF_INT64_T (HAWK_SIZEOF_INT) + typedef unsigned int hawk_uint64_t; + typedef signed int hawk_int64_t; +#elif defined(HAWK_SIZEOF_LONG) && (HAWK_SIZEOF_LONG == 8) +# define HAWK_HAVE_UINT64_T +# define HAWK_HAVE_INT64_T +# define HAWK_SIZEOF_UINT64_T (HAWK_SIZEOF_LONG) +# define HAWK_SIZEOF_INT64_T (HAWK_SIZEOF_LONG) + typedef unsigned long int hawk_uint64_t; + typedef signed long int hawk_int64_t; +#elif defined(HAWK_SIZEOF_LONG_LONG) && (HAWK_SIZEOF_LONG_LONG == 8) +# define HAWK_HAVE_UINT64_T +# define HAWK_HAVE_INT64_T +# define HAWK_SIZEOF_UINT64_T (HAWK_SIZEOF_LONG_LONG) +# define HAWK_SIZEOF_INT64_T (HAWK_SIZEOF_LONG_LONG) + typedef unsigned long long int hawk_uint64_t; + typedef signed long long int hawk_int64_t; +#elif defined(HAWK_SIZEOF___INT64) && (HAWK_SIZEOF___INT64 == 8) +# define HAWK_HAVE_UINT64_T +# define HAWK_HAVE_INT64_T +# define HAWK_SIZEOF_UINT64_T (HAWK_SIZEOF_LONG___INT64) +# define HAWK_SIZEOF_INT64_T (HAWK_SIZEOF_LONG___INT64) + typedef unsigned __int64 hawk_uint64_t; + typedef signed __int64 hawk_int64_t; +#elif defined(HAWK_SIZEOF___INT64_T) && (HAWK_SIZEOF___INT64_T == 8) +# define HAWK_HAVE_UINT64_T +# define HAWK_HAVE_INT64_T +# define HAWK_SIZEOF_UINT64_T (HAWK_SIZEOF_LONG___INT64_T) +# define HAWK_SIZEOF_INT64_T (HAWK_SIZEOF_LONG___INT64_T) + typedef unsigned __int64_t hawk_uint64_t; + typedef signed __int64_t hawk_int64_t; +#else + /* no 64-bit integer */ +#endif + +/* hawk_int128_t */ +#if defined(HAWK_SIZEOF_INT) && (HAWK_SIZEOF_INT == 16) +# define HAWK_HAVE_UINT128_T +# define HAWK_HAVE_INT128_T +# define HAWK_SIZEOF_UINT128_T (HAWK_SIZEOF_INT) +# define HAWK_SIZEOF_INT128_T (HAWK_SIZEOF_INT) + typedef unsigned int hawk_uint128_t; + typedef signed int hawk_int128_t; +#elif defined(HAWK_SIZEOF_LONG) && (HAWK_SIZEOF_LONG == 16) +# define HAWK_HAVE_UINT128_T +# define HAWK_HAVE_INT128_T +# define HAWK_SIZEOF_UINT128_T (HAWK_SIZEOF_LONG) +# define HAWK_SIZEOF_INT128_T (HAWK_SIZEOF_LONG) + typedef unsigned long int hawk_uint128_t; + typedef signed long int hawk_int128_t; +#elif defined(HAWK_SIZEOF_LONG_LONG) && (HAWK_SIZEOF_LONG_LONG == 16) +# define HAWK_HAVE_UINT128_T +# define HAWK_HAVE_INT128_T +# define HAWK_SIZEOF_UINT128_T (HAWK_SIZEOF_LONG_LONG) +# define HAWK_SIZEOF_INT128_T (HAWK_SIZEOF_LONG_LONG) + typedef unsigned long long int hawk_uint128_t; + typedef signed long long int hawk_int128_t; +#elif defined(HAWK_SIZEOF___INT128) && (HAWK_SIZEOF___INT128 == 16) +# define HAWK_HAVE_UINT128_T +# define HAWK_HAVE_INT128_T +# define HAWK_SIZEOF_UINT128_T (HAWK_SIZEOF___INT128) +# define HAWK_SIZEOF_INT128_T (HAWK_SIZEOF___INT128) + typedef unsigned __int128 hawk_uint128_t; + typedef signed __int128 hawk_int128_t; +#elif defined(HAWK_SIZEOF___INT128_T) && (HAWK_SIZEOF___INT128_T == 16) +# define HAWK_HAVE_UINT128_T +# define HAWK_HAVE_INT128_T +# define HAWK_SIZEOF_UINT128_T (HAWK_SIZEOF___INT128_T) +# define HAWK_SIZEOF_INT128_T (HAWK_SIZEOF___INT128_T) + #if defined(HAWK_SIZEOF___UINT128_T) && (HAWK_SIZEOF___UINT128_T == HAWK_SIZEOF___INT128_T) + typedef __uint128_t hawk_uint128_t; + typedef __int128_t hawk_int128_t; + #elif defined(__clang__) + typedef __uint128_t hawk_uint128_t; + typedef __int128_t hawk_int128_t; + #else + typedef unsigned __int128_t hawk_uint128_t; + typedef signed __int128_t hawk_int128_t; + #endif +#else + /* no 128-bit integer */ +#endif + +#if defined(HAWK_HAVE_UINT8_T) && (HAWK_SIZEOF_VOID_P == 1) +# error UNSUPPORTED POINTER SIZE +#elif defined(HAWK_HAVE_UINT16_T) && (HAWK_SIZEOF_VOID_P == 2) + typedef hawk_uint16_t hawk_uintptr_t; + typedef hawk_int16_t hawk_intptr_t; + typedef hawk_uint8_t hawk_ushortptr_t; + typedef hawk_int8_t hawk_shortptr_t; +#elif defined(HAWK_HAVE_UINT32_T) && (HAWK_SIZEOF_VOID_P == 4) + typedef hawk_uint32_t hawk_uintptr_t; + typedef hawk_int32_t hawk_intptr_t; + typedef hawk_uint16_t hawk_ushortptr_t; + typedef hawk_int16_t hawk_shortptr_t; +#elif defined(HAWK_HAVE_UINT64_T) && (HAWK_SIZEOF_VOID_P == 8) + typedef hawk_uint64_t hawk_uintptr_t; + typedef hawk_int64_t hawk_intptr_t; + typedef hawk_uint32_t hawk_ushortptr_t; + typedef hawk_int32_t hawk_shortptr_t; +#elif defined(HAWK_HAVE_UINT128_T) && (HAWK_SIZEOF_VOID_P == 16) + typedef hawk_uint128_t hawk_uintptr_t; + typedef hawk_int128_t hawk_intptr_t; + typedef hawk_uint64_t hawk_ushortptr_t; + typedef hawk_int64_t hawk_shortptr_t; +#else +# error UNKNOWN POINTER SIZE +#endif + +#define HAWK_SIZEOF_INTPTR_T HAWK_SIZEOF_VOID_P +#define HAWK_SIZEOF_UINTPTR_T HAWK_SIZEOF_VOID_P +#define HAWK_SIZEOF_SHORTPTR_T (HAWK_SIZEOF_VOID_P / 2) +#define HAWK_SIZEOF_USHORTPTR_T (HAWK_SIZEOF_VOID_P / 2) + +#if defined(HAWK_HAVE_INT128_T) +# define HAWK_SIZEOF_INTMAX_T 16 +# define HAWK_SIZEOF_UINTMAX_T 16 + typedef hawk_int128_t hawk_intmax_t; + typedef hawk_uint128_t hawk_uintmax_t; +#elif defined(HAWK_HAVE_INT64_T) +# define HAWK_SIZEOF_INTMAX_T 8 +# define HAWK_SIZEOF_UINTMAX_T 8 + typedef hawk_int64_t hawk_intmax_t; + typedef hawk_uint64_t hawk_uintmax_t; +#elif defined(HAWK_HAVE_INT32_T) +# define HAWK_SIZEOF_INTMAX_T 4 +# define HAWK_SIZEOF_UINTMAX_T 4 + typedef hawk_int32_t hawk_intmax_t; + typedef hawk_uint32_t hawk_uintmax_t; +#elif defined(HAWK_HAVE_INT16_T) +# define HAWK_SIZEOF_INTMAX_T 2 +# define HAWK_SIZEOF_UINTMAX_T 2 + typedef hawk_int16_t hawk_intmax_t; + typedef hawk_uint16_t hawk_uintmax_t; +#elif defined(HAWK_HAVE_INT8_T) +# define HAWK_SIZEOF_INTMAX_T 1 +# define HAWK_SIZEOF_UINTMAX_T 1 + typedef hawk_int8_t hawk_intmax_t; + typedef hawk_uint8_t hawk_uintmax_t; +#else +# error UNKNOWN INTMAX SIZE +#endif + +#if defined(HAWK_USE_INTMAX) +typedef hawk_intmax_t hawk_int_t; +typedef hawk_uintmax_t hawk_uint_t; +#define HAWK_SIZEOF_INT_T HAWK_SIZEZOF_INTMAX_T +#else +typedef hawk_intptr_t hawk_int_t; +typedef hawk_uintptr_t hawk_uint_t; +#define HAWK_SIZEOF_INT_T HAWK_SIZEZOF_INTPTR_T +#endif + +/* ========================================================================= + * FLOATING-POINT TYPE + * ========================================================================= */ +/** \typedef hawk_fltbas_t + * The hawk_fltbas_t type defines the largest floating-pointer number type + * naturally supported. + */ +#if defined(__FreeBSD__) || defined(__MINGW32__) + /* TODO: check if the support for long double is complete. + * if so, use long double for hawk_flt_t */ + typedef double hawk_fltbas_t; +# define HAWK_SIZEOF_FLTBAS_T HAWK_SIZEOF_DOUBLE +#elif HAWK_SIZEOF_LONG_DOUBLE > HAWK_SIZEOF_DOUBLE + typedef long double hawk_fltbas_t; +# define HAWK_SIZEOF_FLTBAS_T HAWK_SIZEOF_LONG_DOUBLE +#else + typedef double hawk_fltbas_t; +# define HAWK_SIZEOF_FLTBAS_T HAWK_SIZEOF_DOUBLE +#endif + +/** \typedef hawk_fltmax_t + * The hawk_fltmax_t type defines the largest floating-pointer number type + * ever supported. + */ +#if HAWK_SIZEOF___FLOAT128 >= HAWK_SIZEOF_FLTBAS_T + /* the size of long double may be equal to the size of __float128 + * for alignment on some platforms */ + typedef __float128 hawk_fltmax_t; +# define HAWK_SIZEOF_FLTMAX_T HAWK_SIZEOF___FLOAT128 +# define HAWK_FLTMAX_REQUIRE_QUADMATH 1 +#else + typedef hawk_fltbas_t hawk_fltmax_t; +# define HAWK_SIZEOF_FLTMAX_T HAWK_SIZEOF_FLTBAS_T +# undef HAWK_FLTMAX_REQUIRE_QUADMATH +#endif + + +#if defined(HAWK_USE_FLTMAX) +typedef hawk_fltmax_t hawk_flt_t; +#define HAWK_SIZEOF_FLT_T HAWK_SIZEOF_FLTMAX_T +#else +typedef hawk_fltbas_t hawk_flt_t; +#define HAWK_SIZEOF_FLT_T HAWK_SIZEOF_FLTBAS_T +#endif + + +/* ========================================================================= + * BASIC HARD-CODED DEFINES + * ========================================================================= */ +#define HAWK_BITS_PER_BYTE (8) +/* the maximum number of bch charaters to represent a single uch character */ +#define HAWK_BCSIZE_MAX 6 + +/* ========================================================================= + * BASIC HAWK TYPES + * ========================================================================= */ + +typedef char hawk_bch_t; +typedef int hawk_bci_t; +typedef unsigned int hawk_bcu_t; +typedef unsigned char hawk_bchu_t; /* unsigned version of hawk_bch_t for inner working */ +#define HAWK_SIZEOF_BCH_T HAWK_SIZEOF_CHAR +#define HAWK_SIZEOF_BCI_T HAWK_SIZEOF_INT + +#if defined(HAWK_UNICODE_SIZE) && (HAWK_UNICODE_SIZE >= 4) +# if defined(__GNUC__) && defined(__CHAR32_TYPE__) + typedef __CHAR32_TYPE__ hawk_uch_t; +# else + typedef hawk_uint32_t hawk_uch_t; +# endif + typedef hawk_uint32_t hawk_uchu_t; /* same as hawk_uch_t as it is already unsigned */ +# define HAWK_SIZEOF_UCH_T 4 + +#elif defined(__GNUC__) && defined(__CHAR16_TYPE__) + typedef __CHAR16_TYPE__ hawk_uch_t; + typedef hawk_uint16_t hawk_uchu_t; /* same as hawk_uch_t as it is already unsigned */ +# define HAWK_SIZEOF_UCH_T 2 +# define HAWK_UCH_IS_CHAR16_T +#else + typedef hawk_uint16_t hawk_uch_t; + typedef hawk_uint16_t hawk_uchu_t; /* same as hawk_uch_t as it is already unsigned */ +# define HAWK_SIZEOF_UCH_T 2 +#endif + +typedef hawk_int32_t hawk_uci_t; +typedef hawk_uint32_t hawk_ucu_t; +#define HAWK_SIZEOF_UCI_T 4 + +typedef hawk_uint8_t hawk_oob_t; + +/* [NOTE] sizeof(hawk_oop_t) must be equal to sizeof(hawk_oow_t) */ +typedef hawk_uintptr_t hawk_oow_t; +typedef hawk_intptr_t hawk_ooi_t; +#define HAWK_SIZEOF_OOW_T HAWK_SIZEOF_UINTPTR_T +#define HAWK_SIZEOF_OOI_T HAWK_SIZEOF_INTPTR_T +#define HAWK_OOW_BITS (HAWK_SIZEOF_OOW_T * HAWK_BITS_PER_BYTE) +#define HAWK_OOI_BITS (HAWK_SIZEOF_OOI_T * HAWK_BITS_PER_BYTE) + +typedef hawk_ushortptr_t hawk_oohw_t; /* half word - half word */ +typedef hawk_shortptr_t hawk_oohi_t; /* signed half word */ +#define HAWK_SIZEOF_OOHW_T HAWK_SIZEOF_USHORTPTR_T +#define HAWK_SIZEOF_OOHI_T HAWK_SIZEOF_SHORTPTR_T +#define HAWK_OOHW_BITS (HAWK_SIZEOF_OOHW_T * HAWK_BITS_PER_BYTE) +#define HAWK_OOHI_BITS (HAWK_SIZEOF_OOHI_T * HAWK_BITS_PER_BYTE) + +typedef struct hawk_ucs_t hawk_ucs_t; +struct hawk_ucs_t +{ + hawk_uch_t* ptr; + hawk_oow_t len; +}; + +typedef struct hawk_bcs_t hawk_bcs_t; +struct hawk_bcs_t +{ + hawk_bch_t* ptr; + hawk_oow_t len; +}; + +#if defined(HAWK_ENABLE_UNICODE) + typedef hawk_uch_t hawk_ooch_t; + typedef hawk_uchu_t hawk_oochu_t; + typedef hawk_uci_t hawk_ooci_t; + typedef hawk_ucu_t hawk_oocu_t; + typedef hawk_ucs_t hawk_oocs_t; +# define HAWK_OOCH_IS_UCH +# define HAWK_SIZEOF_OOCH_T HAWK_SIZEOF_UCH_T +#else + typedef hawk_bch_t hawk_ooch_t; + typedef hawk_bchu_t hawk_oochu_t; + typedef hawk_bci_t hawk_ooci_t; + typedef hawk_bcu_t hawk_oocu_t; + typedef hawk_bcs_t hawk_oocs_t; +# define HAWK_OOCH_IS_BCH +# define HAWK_SIZEOF_OOCH_T HAWK_SIZEOF_BCH_T +#endif + +typedef unsigned int hawk_bitmask_t; + + +typedef struct hawk_ptl_t hawk_ptl_t; +struct hawk_ptl_t +{ + void* ptr; + hawk_oow_t len; +}; + +typedef struct hawk_link_t hawk_link_t; +struct hawk_link_t +{ + hawk_link_t* link; +}; + +/* ========================================================================= + * TIME-RELATED TYPES + * =========================================================================*/ +#define HAWK_MSECS_PER_SEC (1000) +#define HAWK_MSECS_PER_MIN (HAWK_MSECS_PER_SEC * HAWK_SECS_PER_MIN) +#define HAWK_MSECS_PER_HOUR (HAWK_MSECS_PER_SEC * HAWK_SECS_PER_HOUR) +#define HAWK_MSECS_PER_DAY (HAWK_MSECS_PER_SEC * HAWK_SECS_PER_DAY) + +#define HAWK_USECS_PER_MSEC (1000) +#define HAWK_NSECS_PER_USEC (1000) +#define HAWK_NSECS_PER_MSEC (HAWK_NSECS_PER_USEC * HAWK_USECS_PER_MSEC) +#define HAWK_USECS_PER_SEC (HAWK_USECS_PER_MSEC * HAWK_MSECS_PER_SEC) +#define HAWK_NSECS_PER_SEC (HAWK_NSECS_PER_USEC * HAWK_USECS_PER_MSEC * HAWK_MSECS_PER_SEC) + +#define HAWK_SECNSEC_TO_MSEC(sec,nsec) \ + (((hawk_intptr_t)(sec) * HAWK_MSECS_PER_SEC) + ((hawk_intptr_t)(nsec) / HAWK_NSECS_PER_MSEC)) + +#define HAWK_SECNSEC_TO_USEC(sec,nsec) \ + (((hawk_intptr_t)(sec) * HAWK_USECS_PER_SEC) + ((hawk_intptr_t)(nsec) / HAWK_NSECS_PER_USEC)) + +#define HAWK_SECNSEC_TO_NSEC(sec,nsec) \ + (((hawk_intptr_t)(sec) * HAWK_NSECS_PER_SEC) + (hawk_intptr_t)(nsec)) + +#define HAWK_SEC_TO_MSEC(sec) ((sec) * HAWK_MSECS_PER_SEC) +#define HAWK_MSEC_TO_SEC(sec) ((sec) / HAWK_MSECS_PER_SEC) + +#define HAWK_USEC_TO_NSEC(usec) ((usec) * HAWK_NSECS_PER_USEC) +#define HAWK_NSEC_TO_USEC(nsec) ((nsec) / HAWK_NSECS_PER_USEC) + +#define HAWK_MSEC_TO_NSEC(msec) ((msec) * HAWK_NSECS_PER_MSEC) +#define HAWK_NSEC_TO_MSEC(nsec) ((nsec) / HAWK_NSECS_PER_MSEC) + +#define HAWK_MSEC_TO_USEC(msec) ((msec) * HAWK_USECS_PER_MSEC) +#define HAWK_USEC_TO_MSEC(usec) ((usec) / HAWK_USECS_PER_MSEC) + +#define HAWK_SEC_TO_NSEC(sec) ((sec) * HAWK_NSECS_PER_SEC) +#define HAWK_NSEC_TO_SEC(nsec) ((nsec) / HAWK_NSECS_PER_SEC) + +#define HAWK_SEC_TO_USEC(sec) ((sec) * HAWK_USECS_PER_SEC) +#define HAWK_USEC_TO_SEC(usec) ((usec) / HAWK_USECS_PER_SEC) + +typedef struct hawk_ntime_t hawk_ntime_t; +struct hawk_ntime_t +{ + hawk_intptr_t sec; + hawk_int32_t nsec; /* nanoseconds */ +}; + +#define HAWK_INIT_NTIME(c,s,ns) (((c)->sec = (s)), ((c)->nsec = (ns))) +#define HAWK_CLEAR_NTIME(c) HAWK_INIT_NTIME(c, 0, 0) + +#define HAWK_ADD_NTIME(c,a,b) \ + do { \ + (c)->sec = (a)->sec + (b)->sec; \ + (c)->nsec = (a)->nsec + (b)->nsec; \ + while ((c)->nsec >= HAWK_NSECS_PER_SEC) { (c)->sec++; (c)->nsec -= HAWK_NSECS_PER_SEC; } \ + } while(0) + +#define HAWK_ADD_NTIME_SNS(c,a,s,ns) \ + do { \ + (c)->sec = (a)->sec + (s); \ + (c)->nsec = (a)->nsec + (ns); \ + while ((c)->nsec >= HAWK_NSECS_PER_SEC) { (c)->sec++; (c)->nsec -= HAWK_NSECS_PER_SEC; } \ + } while(0) + +#define HAWK_SUB_NTIME(c,a,b) \ + do { \ + (c)->sec = (a)->sec - (b)->sec; \ + (c)->nsec = (a)->nsec - (b)->nsec; \ + while ((c)->nsec < 0) { (c)->sec--; (c)->nsec += HAWK_NSECS_PER_SEC; } \ + } while(0) + +#define HAWK_SUB_NTIME_SNS(c,a,s,ns) \ + do { \ + (c)->sec = (a)->sec - s; \ + (c)->nsec = (a)->nsec - ns; \ + while ((c)->nsec < 0) { (c)->sec--; (c)->nsec += HAWK_NSECS_PER_SEC; } \ + } while(0) + + +#define HAWK_CMP_NTIME(a,b) (((a)->sec == (b)->sec)? ((a)->nsec - (b)->nsec): ((a)->sec - (b)->sec)) + +/* if time has been normalized properly, nsec must be equal to or + * greater than 0. */ +#define HAWK_IS_NEG_NTIME(x) ((x)->sec < 0) +#define HAWK_IS_POS_NTIME(x) ((x)->sec > 0 || ((x)->sec == 0 && (x)->nsec > 0)) +#define HAWK_IS_ZERO_NTIME(x) ((x)->sec == 0 && (x)->nsec == 0) + +/* ========================================================================= + * PRIMITIVE MACROS + * ========================================================================= */ +#define HAWK_UCI_EOF ((hawk_uci_t)-1) +#define HAWK_BCI_EOF ((hawk_bci_t)-1) +#define HAWK_OOCI_EOF ((hawk_ooci_t)-1) + +#define HAWK_SIZEOF(x) (sizeof(x)) +#define HAWK_COUNTOF(x) (sizeof(x) / sizeof((x)[0])) +#define HAWK_BITSOF(x) (sizeof(x) * HAWK_BITS_PER_BYTE) + +/** + * The HAWK_OFFSETOF() macro returns the offset of a field from the beginning + * of a structure. + */ +#define HAWK_OFFSETOF(type,member) ((hawk_uintptr_t)&((type*)0)->member) + +/** + * The HAWK_ALIGNOF() macro returns the alignment size of a structure. + * Note that this macro may not work reliably depending on the type given. + */ +#define HAWK_ALIGNOF(type) HAWK_OFFSETOF(struct { hawk_uint8_t d1; type d2; }, d2) + /*(sizeof(struct { hawk_uint8_t d1; type d2; }) - sizeof(type))*/ + +#if defined(__cplusplus) +# if (__cplusplus >= 201103L) /* C++11 */ +# define HAWK_NULL nullptr +# else +# define HAWK_NULL (0) +# endif +#else +# define HAWK_NULL ((void*)0) +#endif + +/* make a bit mask that can mask off low n bits */ +#define HAWK_LBMASK(type,n) (~(~((type)0) << (n))) +#define HAWK_LBMASK_SAFE(type,n) (((n) < HAWK_BITSOF(type))? HAWK_LBMASK(type,n): ~(type)0) + +/* make a bit mask that can mask off hig n bits */ +#define HAWK_HBMASK(type,n) (~(~((type)0) >> (n))) +#define HAWK_HBMASK_SAFE(type,n) (((n) < HAWK_BITSOF(type))? HAWK_HBMASK(type,n): ~(type)0) + +/* get 'length' bits starting from the bit at the 'offset' */ +#define HAWK_GETBITS(type,value,offset,length) \ + ((((type)(value)) >> (offset)) & HAWK_LBMASK(type,length)) + +#define HAWK_CLEARBITS(type,value,offset,length) \ + (((type)(value)) & ~(HAWK_LBMASK(type,length) << (offset))) + +#define HAWK_SETBITS(type,value,offset,length,bits) \ + (value = (HAWK_CLEARBITS(type,value,offset,length) | (((bits) & HAWK_LBMASK(type,length)) << (offset)))) + +#define HAWK_FLIPBITS(type,value,offset,length) \ + (((type)(value)) ^ (HAWK_LBMASK(type,length) << (offset))) + +#define HAWK_ORBITS(type,value,offset,length,bits) \ + (value = (((type)(value)) | (((bits) & HAWK_LBMASK(type,length)) << (offset)))) + + +/** + * The HAWK_BITS_MAX() macros calculates the maximum value that the 'nbits' + * bits of an unsigned integer of the given 'type' can hold. + * \code + * printf ("%u", HAWK_BITS_MAX(unsigned int, 5)); + * \endcode + */ +/*#define HAWK_BITS_MAX(type,nbits) ((((type)1) << (nbits)) - 1)*/ +#define HAWK_BITS_MAX(type,nbits) ((~(type)0) >> (HAWK_BITSOF(type) - (nbits))) + +/* ========================================================================= + * MMGR + * ========================================================================= */ +typedef struct hawk_mmgr_t hawk_mmgr_t; + +/** + * allocate a memory chunk of the size \a n. + * \return pointer to a memory chunk on success, #HAWK_NULL on failure. + */ +typedef void* (*hawk_mmgr_alloc_t) (hawk_mmgr_t* mmgr, hawk_oow_t n); +/** + * resize a memory chunk pointed to by \a ptr to the size \a n. + * \return pointer to a memory chunk on success, #HAWK_NULL on failure. + */ +typedef void* (*hawk_mmgr_realloc_t) (hawk_mmgr_t* mmgr, void* ptr, hawk_oow_t n); +/** + * free a memory chunk pointed to by \a ptr. + */ +typedef void (*hawk_mmgr_free_t) (hawk_mmgr_t* mmgr, void* ptr); + +/** + * The hawk_mmgr_t type defines the memory management interface. + * As the type is merely a structure, it is just used as a single container + * for memory management functions with a pointer to user-defined data. + * The user-defined data pointer \a ctx is passed to each memory management + * function whenever it is called. You can allocate, reallocate, and free + * a memory chunk. + * + * For example, a hawk_xxx_open() function accepts a pointer of the hawk_mmgr_t + * type and the xxx object uses it to manage dynamic data within the object. + */ +struct hawk_mmgr_t +{ + hawk_mmgr_alloc_t alloc; /**< allocation function */ + hawk_mmgr_realloc_t realloc; /**< resizing function */ + hawk_mmgr_free_t free; /**< disposal function */ + void* ctx; /**< user-defined data pointer */ +}; + +/** + * The HAWK_MMGR_ALLOC() macro allocates a memory block of the \a size bytes + * using the \a mmgr memory manager. + */ +#define HAWK_MMGR_ALLOC(mmgr,size) ((mmgr)->alloc(mmgr,size)) + +/** + * The HAWK_MMGR_REALLOC() macro resizes a memory block pointed to by \a ptr + * to the \a size bytes using the \a mmgr memory manager. + */ +#define HAWK_MMGR_REALLOC(mmgr,ptr,size) ((mmgr)->realloc(mmgr,ptr,size)) + +/** + * The HAWK_MMGR_FREE() macro deallocates the memory block pointed to by \a ptr. + */ +#define HAWK_MMGR_FREE(mmgr,ptr) ((mmgr)->free(mmgr,ptr)) + + +/* ========================================================================= + * CMGR + * =========================================================================*/ + +typedef struct hawk_cmgr_t hawk_cmgr_t; + +typedef hawk_oow_t (*hawk_cmgr_bctouc_t) ( + const hawk_bch_t* mb, + hawk_oow_t size, + hawk_uch_t* wc +); + +typedef hawk_oow_t (*hawk_cmgr_uctobc_t) ( + hawk_uch_t wc, + hawk_bch_t* mb, + hawk_oow_t size +); + +/** + * The hawk_cmgr_t type defines the character-level interface to + * multibyte/wide-character conversion. This interface doesn't + * provide any facility to store conversion state in a context + * independent manner. This leads to the limitation that it can + * handle a stateless multibyte encoding only. + */ +struct hawk_cmgr_t +{ + hawk_cmgr_bctouc_t bctouc; + hawk_cmgr_uctobc_t uctobc; +}; + +/* ========================================================================= + * FORWARD DECLARATION FOR MAIN HAWK STRUCTURE + * =========================================================================*/ +typedef struct hawk_t hawk_t; +typedef struct hawk_val_t hawk_val_t; +typedef struct hawk_gem_t hawk_gem_t; + +#define HAWK_ERRMSG_CAPA 2048 + +/** + * The hawk_errnum_t type defines error codes. + */ +enum hawk_errnum_t +{ + HAWK_ENOERR, /**< no error */ + HAWK_EOTHER, /**< other error */ + HAWK_ENOIMPL, /**< not implemented */ + HAWK_ESYSERR, /**< subsystem error */ + HAWK_EINTERN, /**< internal error */ + + /* common errors */ + HAWK_ENOMEM, /**< insufficient memory */ + HAWK_EINVAL, /**< invalid parameter or data */ + HAWK_EACCES, /**< access denied */ + HAWK_EPERM, /**< operation not permitted */ + HAWK_ENOSUP, /**< not supported */ + HAWK_ENOENT, /**< '${0}' not found */ + HAWK_EEXIST, /**< '${0}' already exists */ + HAWK_EIOERR, /**< I/O error */ + HAWK_EBUFFULL, /**< buffer full */ + HAWK_EECERR, /**< encoding conversion error */ + + /* mostly parse errors */ + HAWK_EOPEN, /**< cannot open '${0}' */ + HAWK_EREAD, /**< cannot read '${0}' */ + HAWK_EWRITE, /**< cannot write '${0}' */ + HAWK_ECLOSE, /**< cannot close '${0}' */ + + HAWK_EBLKNST, /**< block nested too deeply */ + HAWK_EEXPRNST,/**< expression nested too deeply */ + + HAWK_ELXCHR, /**< invalid character '${0}' */ + HAWK_ELXDIG, /**< invalid digit '${0}' */ + + HAWK_EEOF, /**< unexpected end of source */ + HAWK_ECMTNC, /**< comment not closed properly */ + HAWK_ESTRNC, /**< string or regular expression not closed */ + HAWK_EMBSCHR, /**< invalid mbs character '%{0}' */ + HAWK_ELBRACE, /**< left brace expected in place of '${0}' */ + HAWK_ELPAREN, /**< left parenthesis expected in place of '${0}' */ + HAWK_ERPAREN, /**< right parenthesis expected in place of '${0}' */ + HAWK_ERBRACK, /**< right bracket expected in place of '${0}' */ + HAWK_ECOMMA, /**< comma expected in place of '${0}' */ + HAWK_ESCOLON, /**< semicolon expected in place of '${0}' */ + HAWK_ECOLON, /**< colon expected in place of '${0}' */ + HAWK_EINTLIT, /**< integer literal expected in place of '${0}' */ + HAWK_ESTMEND, /**< statement not ending with a semicolon */ + HAWK_EKWIN, /**< keyword 'in' expected in place of '${0}' */ + HAWK_ENOTVAR, /**< right-hand side of 'in' not a variable */ + HAWK_EEXPRNR, /**< expression not recognized around '${0}' */ + + HAWK_EKWFNC, /**< keyword 'function' expected in place of '${0}' */ + HAWK_EKWWHL, /**< keyword 'while' expected in place of '${0}' */ + HAWK_EASSIGN, /**< assignment statement expected */ + HAWK_EIDENT, /**< identifier expected in place of '${0}' */ + HAWK_EFUNNAM, /**< '${0}' not a valid function name */ + HAWK_EBLKBEG, /**< BEGIN not followed by left bracket on the same line */ + HAWK_EBLKEND, /**< END not followed by left bracket on the same line */ + HAWK_EKWRED, /**< keyword '${0}' redefined */ + HAWK_EFNCRED, /**< intrinsic function '${0}' redefined */ + HAWK_EFUNRED, /**< function '${0}' redefined */ + HAWK_EGBLRED, /**< global variable '${0}' redefined */ + HAWK_EPARRED, /**< parameter '${0}' redefined */ + HAWK_EVARRED, /**< variable '${0}' redefined */ + HAWK_EDUPPAR, /**< duplicate parameter name '${0}' */ + HAWK_EDUPGBL, /**< duplicate global variable name '${0}' */ + HAWK_EDUPLCL, /**< duplicate local variable name '${0}' */ + HAWK_EBADPAR, /**< '${0}' not a valid parameter name */ + HAWK_EBADVAR, /**< '${0}' not a valid variable name */ + HAWK_EVARMS, /**< variable name missing */ + HAWK_EUNDEF, /**< undefined identifier '${0}' */ + HAWK_ELVALUE, /**< l-value required */ + HAWK_EGBLTM, /**< too many global variables */ + HAWK_ELCLTM, /**< too many local variables */ + HAWK_EPARTM, /**< too many parameters */ + HAWK_ESEGTM, /**< too many segments */ + HAWK_ESEGTL, /**< segment '${0}' too long */ + HAWK_EBADARG, /**< bad argument */ + HAWK_ENOARG, /**< no argument */ + HAWK_EBREAK, /**< 'break' outside a loop */ + HAWK_ECONTINUE, /**< 'continue' outside a loop */ + HAWK_ENEXTBEG, /**< 'next' illegal in BEGIN block */ + HAWK_ENEXTEND, /**< 'next' illegal in END block */ + HAWK_ENEXTFBEG, /**< 'nextfile' illegal in BEGIN block */ + HAWK_ENEXTFEND, /**< 'nextfile' illegal in END block */ + HAWK_EPREPST, /**< both prefix and postfix incr/decr operator present */ + HAWK_EINCDECOPR,/**< illegal operand for incr/decr operator */ + HAWK_EINCLSTR, /**< 'include' not followed by a string */ + HAWK_EINCLTD, /**< include level too deep */ + HAWK_EXKWNR, /**< @word '${0}' not recognized */ + HAWK_EXKWEM, /**< @ not followed by a valid word */ + + /* run time error */ + HAWK_ESTACK, /**< stack error */ + HAWK_EDIVBY0, /**< divide by zero */ + HAWK_EOPERAND, /**< invalid operand */ + HAWK_EPOSIDX, /**< wrong position index */ + HAWK_EARGTF, /**< too few arguments */ + HAWK_EARGTM, /**< too many arguments */ + HAWK_EFUNNF, /**< function '${0}' not found */ + HAWK_ENOTFUN, /**< non-function value in '%{0}' */ + HAWK_ENOTDEL, /**< '${0}' not deletable */ + HAWK_ENOTMAP, /**< value not a map */ + HAWK_ENOTMAPIN, /**< right-hand side of 'in' not a map */ + HAWK_ENOTMAPNILIN, /**< right-hand side of 'in' not a map nor nil */ + HAWK_ENOTREF, /**< value not referenceable */ + HAWK_EMAPRET, /**< map cannot be returned */ + HAWK_EMAPTOPOS, /**< map cannot be assigned to a positional */ + HAWK_EMAPTOIDX, /**< map cannot be assigned to an indexed variable */ + HAWK_EMAPTONVAR, /**< map cannot be assigned to an variable '${0}' */ + HAWK_EMAPTOSCALAR, /**< cannot change a map to a scalar value */ + HAWK_ESCALARTOMAP, /**< cannot change a scalar to a map */ + HAWK_ENMAPTOMAP, /**< cannot change a map '${0}' to another map */ + HAWK_ENMAPTOSCALAR, /**< cannot change a map '${0}' to a scalar */ + HAWK_ENSCALARTOMAP, /**< cannot change a scalar '${0}' to a map */ + HAWK_EVALTOSTR, /**< invalid value to convert to a string */ + HAWK_EVALTONUM, /**< invalid value to convert to a number */ + HAWK_EVALTOCHR, /**< invalid value to convert to a character */ + HAWK_EHASHVAL, /**< invalid value to hash */ + HAWK_ERNEXTBEG, /**< 'next' called from BEGIN block */ + HAWK_ERNEXTEND, /**< 'next' called from END block */ + HAWK_ERNEXTFBEG, /**< 'nextfile' called from BEGIN block */ + HAWK_ERNEXTFEND, /**< 'nextfile' called from END block */ + HAWK_EFNCIMPL, /**< intrinsic function handler for '${0}' failed */ + HAWK_EIOUSER, /**< wrong user io handler implementation */ + HAWK_EIOIMPL, /**< I/O callback returned an error */ + HAWK_EIONMNF, /**< no such I/O name found */ + HAWK_EIONMEM, /**< I/O name empty */ + HAWK_EIONMNL, /**< I/O name '${0}' containing '\\0' */ + HAWK_EFMTARG, /**< not sufficient arguments to formatting sequence */ + HAWK_EFMTCNV, /**< recursion detected in format conversion */ + HAWK_ECONVFMTCHR, /**< invalid character in CONVFMT */ + HAWK_EOFMTCHR, /**< invalid character in OFMT */ + + /* regular expression error */ + HAWK_EREXBL, /**< failed to build regular expression */ + HAWK_EREXMA, /**< failed to match regular expression */ + HAWK_EREXRECUR, /**< recursion too deep */ + HAWK_EREXRPAREN, /**< a right parenthesis is expected */ + HAWK_EREXRBRACK, /**< a right bracket is expected */ + HAWK_EREXRBRACE, /**< a right brace is expected */ + HAWK_EREXCOLON, /**< a colon is expected */ + HAWK_EREXCRANGE, /**< invalid character range */ + HAWK_EREXCCLASS, /**< invalid character class */ + HAWK_EREXBOUND, /**< invalid occurrence bound */ + HAWK_EREXSPCAWP, /**< special character at wrong position */ + HAWK_EREXPREEND, /**< premature end of regular expression */ + + /* the number of error numbers, internal use only */ + HAWK_NUMERRNUM +}; +typedef enum hawk_errnum_t hawk_errnum_t; + +struct hawk_gem_t +{ + hawk_mmgr_t* mmgr; + hawk_cmgr_t* cmgr; + hawk_errnum_t errnum; + hawk_ooch_t errmsg[HAWK_ERRMSG_CAPA]; +}; + +/* ========================================================================= + * MACROS THAT CHANGES THE BEHAVIORS OF THE C COMPILER/LINKER + * =========================================================================*/ + +#if defined(EMSCRIPTEN) +# define HAWK_IMPORT +# define HAWK_EXPORT EMSCRIPTEN_KEEPALIVE +# define HAWK_PRIVATE +#elif defined(__BORLANDC__) && (__BORLANDC__ < 0x500) +# define HAWK_IMPORT +# define HAWK_EXPORT +# define HAWK_PRIVATE +#elif defined(_WIN32) || (defined(__WATCOMC__) && (__WATCOMC__ >= 1000) && !defined(__WINDOWS_386__)) +# define HAWK_IMPORT __declspec(dllimport) +# define HAWK_EXPORT __declspec(dllexport) +# define HAWK_PRIVATE +#elif defined(__GNUC__) && ((__GNUC__>= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) +# define HAWK_IMPORT __attribute__((visibility("default"))) +# define HAWK_EXPORT __attribute__((visibility("default"))) +# define HAWK_PRIVATE __attribute__((visibility("hidden"))) +/*# define HAWK_PRIVATE __attribute__((visibility("internal")))*/ +#else +# define HAWK_IMPORT +# define HAWK_EXPORT +# define HAWK_PRIVATE +#endif + +#if defined(__cplusplus) || (defined(__STDC_VERSION__) && (__STDC_VERSION__>=199901L)) + /* C++/C99 has inline */ +# define HAWK_INLINE inline +# define HAWK_HAVE_INLINE +#elif defined(__GNUC__) && defined(__GNUC_GNU_INLINE__) + /* gcc disables inline when -std=c89 or -ansi is used. + * so use __inline__ supported by gcc regardless of the options */ +# define HAWK_INLINE /*extern*/ __inline__ +# define HAWK_HAVE_INLINE +#else +# define HAWK_INLINE +# undef HAWK_HAVE_INLINE +#endif + +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)) +# define HAWK_UNUSED __attribute__((__unused__)) +#else +# define HAWK_UNUSED +#endif + +/** + * The HAWK_TYPE_IS_SIGNED() macro determines if a type is signed. + * \code + * printf ("%d\n", (int)HAWK_TYPE_IS_SIGNED(int)); + * printf ("%d\n", (int)HAWK_TYPE_IS_SIGNED(unsigned int)); + * \endcode + */ +#define HAWK_TYPE_IS_SIGNED(type) (((type)0) > ((type)-1)) + +/** + * The HAWK_TYPE_IS_SIGNED() macro determines if a type is unsigned. + * \code + * printf ("%d\n", HAWK_TYPE_IS_UNSIGNED(int)); + * printf ("%d\n", HAWK_TYPE_IS_UNSIGNED(unsigned int)); + * \endcode + */ +#define HAWK_TYPE_IS_UNSIGNED(type) (((type)0) < ((type)-1)) + +#define HAWK_TYPE_SIGNED_MAX(type) \ + ((type)~((type)1 << ((type)HAWK_BITSOF(type) - 1))) +#define HAWK_TYPE_UNSIGNED_MAX(type) ((type)(~(type)0)) + +#define HAWK_TYPE_SIGNED_MIN(type) \ + ((type)((type)1 << ((type)HAWK_BITSOF(type) - 1))) +#define HAWK_TYPE_UNSIGNED_MIN(type) ((type)0) + +#define HAWK_TYPE_MAX(type) \ + ((HAWK_TYPE_IS_SIGNED(type)? HAWK_TYPE_SIGNED_MAX(type): HAWK_TYPE_UNSIGNED_MAX(type))) +#define HAWK_TYPE_MIN(type) \ + ((HAWK_TYPE_IS_SIGNED(type)? HAWK_TYPE_SIGNED_MIN(type): HAWK_TYPE_UNSIGNED_MIN(type))) + +/* round up a positive integer x to the nearst multiple of y */ +#define HAWK_ALIGN(x,y) ((((x) + (y) - 1) / (y)) * (y)) + +/* round up a positive integer x to the nearst multiple of y where + * y must be a multiple of a power of 2*/ +#define HAWK_ALIGN_POW2(x,y) ((((x) + (y) - 1)) & ~((y) - 1)) + +#define HAWK_IS_UNALIGNED_POW2(x,y) ((x) & ((y) - 1)) +#define HAWK_IS_ALIGNED_POW2(x,y) (!HAWK_IS_UNALIGNED_POW2(x,y)) + +/* ========================================================================= + * COMPILER FEATURE TEST MACROS + * =========================================================================*/ +#if !defined(__has_builtin) && defined(_INTELC32_) + /* intel c code builder 1.0 ended up with an error without this override */ + #define __has_builtin(x) 0 +#endif + +/* +#if !defined(__is_identifier) + #define __is_identifier(x) 0 +#endif + +#if !defined(__has_attribute) + #define __has_attribute(x) 0 +#endif +*/ + +#if defined(__has_builtin) + #if __has_builtin(__builtin_ctz) + #define HAWK_HAVE_BUILTIN_CTZ + #endif + #if __has_builtin(__builtin_ctzl) + #define HAWK_HAVE_BUILTIN_CTZL + #endif + #if __has_builtin(__builtin_ctzll) + #define HAWK_HAVE_BUILTIN_CTZLL + #endif + + #if __has_builtin(__builtin_clz) + #define HAWK_HAVE_BUILTIN_CLZ + #endif + #if __has_builtin(__builtin_clzl) + #define HAWK_HAVE_BUILTIN_CLZL + #endif + #if __has_builtin(__builtin_clzll) + #define HAWK_HAVE_BUILTIN_CLZLL + #endif + + #if __has_builtin(__builtin_uadd_overflow) + #define HAWK_HAVE_BUILTIN_UADD_OVERFLOW + #endif + #if __has_builtin(__builtin_uaddl_overflow) + #define HAWK_HAVE_BUILTIN_UADDL_OVERFLOW + #endif + #if __has_builtin(__builtin_uaddll_overflow) + #define HAWK_HAVE_BUILTIN_UADDLL_OVERFLOW + #endif + #if __has_builtin(__builtin_umul_overflow) + #define HAWK_HAVE_BUILTIN_UMUL_OVERFLOW + #endif + #if __has_builtin(__builtin_umull_overflow) + #define HAWK_HAVE_BUILTIN_UMULL_OVERFLOW + #endif + #if __has_builtin(__builtin_umulll_overflow) + #define HAWK_HAVE_BUILTIN_UMULLL_OVERFLOW + #endif + + #if __has_builtin(__builtin_sadd_overflow) + #define HAWK_HAVE_BUILTIN_SADD_OVERFLOW + #endif + #if __has_builtin(__builtin_saddl_overflow) + #define HAWK_HAVE_BUILTIN_SADDL_OVERFLOW + #endif + #if __has_builtin(__builtin_saddll_overflow) + #define HAWK_HAVE_BUILTIN_SADDLL_OVERFLOW + #endif + #if __has_builtin(__builtin_smul_overflow) + #define HAWK_HAVE_BUILTIN_SMUL_OVERFLOW + #endif + #if __has_builtin(__builtin_smull_overflow) + #define HAWK_HAVE_BUILTIN_SMULL_OVERFLOW + #endif + #if __has_builtin(__builtin_smulll_overflow) + #define HAWK_HAVE_BUILTIN_SMULLL_OVERFLOW + #endif + + #if __has_builtin(__builtin_expect) + #define HAWK_HAVE_BUILTIN_EXPECT + #endif + + + #if __has_builtin(__sync_lock_test_and_set) + #define HAWK_HAVE_SYNC_LOCK_TEST_AND_SET + #endif + #if __has_builtin(__sync_lock_release) + #define HAWK_HAVE_SYNC_LOCK_RELEASE + #endif + + #if __has_builtin(__sync_synchronize) + #define HAWK_HAVE_SYNC_SYNCHRONIZE + #endif + #if __has_builtin(__sync_bool_compare_and_swap) + #define HAWK_HAVE_SYNC_BOOL_COMPARE_AND_SWAP + #endif + #if __has_builtin(__sync_val_compare_and_swap) + #define HAWK_HAVE_SYNC_VAL_COMPARE_AND_SWAP + #endif + + + #if __has_builtin(__builtin_bswap16) + #define HAWK_HAVE_BUILTIN_BSWAP16 + #endif + #if __has_builtin(__builtin_bswap32) + #define HAWK_HAVE_BUILTIN_BSWAP32 + #endif + #if __has_builtin(__builtin_bswap64) + #define HAWK_HAVE_BUILTIN_BSWAP64 + #endif + #if __has_builtin(__builtin_bswap128) + #define HAWK_HAVE_BUILTIN_BSWAP128 + #endif +#elif defined(__GNUC__) && defined(__GNUC_MINOR__) + + #if (__GNUC__ >= 4) + #define HAWK_HAVE_SYNC_LOCK_TEST_AND_SET + #define HAWK_HAVE_SYNC_LOCK_RELEASE + + #define HAWK_HAVE_SYNC_SYNCHRONIZE + #define HAWK_HAVE_SYNC_BOOL_COMPARE_AND_SWAP + #define HAWK_HAVE_SYNC_VAL_COMPARE_AND_SWAP + #endif + + #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) + #define HAWK_HAVE_BUILTIN_CTZ + #define HAWK_HAVE_BUILTIN_CTZL + #define HAWK_HAVE_BUILTIN_CTZLL + #define HAWK_HAVE_BUILTIN_CLZ + #define HAWK_HAVE_BUILTIN_CLZL + #define HAWK_HAVE_BUILTIN_CLZLL + #define HAWK_HAVE_BUILTIN_EXPECT + #endif + + #if (__GNUC__ >= 5) + #define HAWK_HAVE_BUILTIN_UADD_OVERFLOW + #define HAWK_HAVE_BUILTIN_UADDL_OVERFLOW + #define HAWK_HAVE_BUILTIN_UADDLL_OVERFLOW + #define HAWK_HAVE_BUILTIN_UMUL_OVERFLOW + #define HAWK_HAVE_BUILTIN_UMULL_OVERFLOW + #define HAWK_HAVE_BUILTIN_UMULLL_OVERFLOW + + #define HAWK_HAVE_BUILTIN_SADD_OVERFLOW + #define HAWK_HAVE_BUILTIN_SADDL_OVERFLOW + #define HAWK_HAVE_BUILTIN_SADDLL_OVERFLOW + #define HAWK_HAVE_BUILTIN_SMUL_OVERFLOW + #define HAWK_HAVE_BUILTIN_SMULL_OVERFLOW + #define HAWK_HAVE_BUILTIN_SMULLL_OVERFLOW + #endif + + #if (__GNUC__ >= 5) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + /* 4.8.0 or later */ + #define HAWK_HAVE_BUILTIN_BSWAP16 + #endif + #if (__GNUC__ >= 5) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) + /* 4.3.0 or later */ + #define HAWK_HAVE_BUILTIN_BSWAP32 + #define HAWK_HAVE_BUILTIN_BSWAP64 + /*#define HAWK_HAVE_BUILTIN_BSWAP128*/ + #endif +#endif + +#if defined(HAWK_HAVE_BUILTIN_EXPECT) +# define HAWK_LIKELY(x) (__builtin_expect(!!(x),1)) +# define HAWK_UNLIKELY(x) (__builtin_expect(!!(x),0)) +#else +# define HAWK_LIKELY(x) (x) +# define HAWK_UNLIKELY(x) (x) +#endif + + +/* ========================================================================= + * STATIC ASSERTION + * =========================================================================*/ +#define HAWK_STATIC_JOIN_INNER(x, y) x ## y +#define HAWK_STATIC_JOIN(x, y) HAWK_STATIC_JOIN_INNER(x, y) + +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) +# define HAWK_STATIC_ASSERT(expr) _Static_assert (expr, "invalid assertion") +#elif defined(__cplusplus) && (__cplusplus >= 201103L) +# define HAWK_STATIC_ASSERT(expr) static_assert (expr, "invalid assertion") +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +# define HAWK_STATIC_ASSERT(expr) typedef char HAWK_STATIC_JOIN(HAWK_STATIC_ASSERT_T_, __LINE__)[(expr)? 1: -1] HAWK_UNUSED +#else +# define HAWK_STATIC_ASSERT(expr) do { typedef char HAWK_STATIC_JOIN(HAWK_STATIC_ASSERT_T_, __LINE__)[(expr)? 1: -1] HAWK_UNUSED; } while(0) +#endif + +#define HAWK_STATIC_ASSERT_EXPR(expr) ((void)HAWK_SIZEOF(char[(expr)? 1: -1])) + + +/* ========================================================================= + * CHARACTER/STRING LITERALS + * =========================================================================*/ +#define HAWK_MQ_I(val) #val +#define HAWK_MQ(val) HAWK_MQ_I(val) +/** + * The #HAWK_BT macro maps a multi-byte literal string literal as it is. + */ +#define HAWK_BT(txt) (txt) + +#if defined(HAWK_UCH_IS_CHAR16_T) +# define HAWK_WQ_I(val) (u ## #val) +# define HAWK_WQ(val) HAWK_WQ_I(val) +#else +# define HAWK_WQ_I(val) (L ## #val) +# define HAWK_WQ(val) HAWK_WQ_I(val) +#endif + +/** + * The #HAWK_UT macro maps a multi-byte literal string to a wide character + * string by prefixing it with \b L. + */ +#if (HAWK_SIZEOF_UCH_T == HAWK_SIZEOF_BCH_T) +# define HAWK_UT(txt) (txt) +#elif defined(HAWK_UCH_IS_CHAR16_T) +# define HAWK_UT(txt) (u ## txt) +#else +# define HAWK_UT(txt) (L ## txt) +#endif + +/** \def HAWK_T + * The #HAWK_T macro maps to #HAWK_BT if #HAWK_OOCH_IS_BCH is defined, and to + * #HAWK_UT if #HAWK_OOCH_IS_UCH is defined. + */ +#if defined(HAWK_OOCH_IS_BCH) +# define HAWK_Q(val) HAWK_MQ(val) +# define HAWK_T(txt) HAWK_BT(txt) +#else +# define HAWK_Q(val) HAWK_WQ(val) +# define HAWK_T(txt) HAWK_UT(txt) +#endif + + +/** + * The #hawk_foff_t type defines an integer that can represent a file offset. + * Depending on your system, it's defined to one of #hawk_int64_t, #hawk_int32_t, + * and #hawk_int16_t. + */ +#if defined(HAWK_HAVE_INT64_T) && (HAWK_SIZEOF_OFF64_T==8) + typedef hawk_int64_t hawk_foff_t; +# define HAWK_SIZEOF_FOFF_T HAWK_SIZEOF_INT64_T +#elif defined(HAWK_HAVE_INT64_T) && (HAWK_SIZEOF_OFF_T==8) + typedef hawk_int64_t hawk_foff_t; +# define HAWK_SIZEOF_FOFF_T HAWK_SIZEOF_INT64_T +#elif defined(HAWK_HAVE_INT32_T) && (HAWK_SIZEOF_OFF_T==4) + typedef hawk_int32_t hawk_foff_t; +# define HAWK_SIZEOF_FOFF_T HAWK_SIZEOF_INT32_T +#elif defined(HAWK_HAVE_INT16_T) && (HAWK_SIZEOF_OFF_T==2) + typedef hawk_int16_t hawk_foff_t; +# define HAWK_SIZEOF_FOFF_T HAWK_SIZEOF_INT16_T +#elif defined(HAWK_HAVE_INT8_T) && (HAWK_SIZEOF_OFF_T==1) + typedef hawk_int8_t hawk_foff_t; +# define HAWK_SIZEOF_FOFF_T HAWK_SIZEOF_INT16_T +#else + typedef hawk_int32_t hawk_foff_t; /* this line is for doxygen */ +# error Unsupported platform +#endif + + +/**** TODO ****/ +#define HAWK_ASSERT(hawk, x) + +#endif diff --git a/hawk/lib/hawk-ecs.h b/hawk/lib/hawk-ecs.h new file mode 100644 index 00000000..afd64a6e --- /dev/null +++ b/hawk/lib/hawk-ecs.h @@ -0,0 +1,631 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_ECS_H_ +#define _HAWK_ECS_H_ + +#include +#include + +/** string pointer and length as a aggregate */ +#define HAWK_BECS_BCS(s) (&((s)->val)) +/** string length */ +#define HAWK_BECS_LEN(s) ((s)->val.len) +/** string pointer */ +#define HAWK_BECS_PTR(s) ((s)->val.ptr) +/** pointer to a particular position */ +#define HAWK_BECS_CPTR(s,idx) (&(s)->val.ptr[idx]) +/** string capacity */ +#define HAWK_BECS_CAPA(s) ((s)->capa) +/** character at the given position */ +#define HAWK_BECS_CHAR(s,idx) ((s)->val.ptr[idx]) +/**< last character. unsafe if length <= 0 */ +#define HAWK_BECS_LASTCHAR(s) ((s)->val.ptr[(s)->val.len-1]) + +/** string pointer and length as a aggregate */ +#define HAWK_UECS_UCS(s) (&((s)->val)) +/** string length */ +#define HAWK_UECS_LEN(s) ((s)->val.len) +/** string pointer */ +#define HAWK_UECS_PTR(s) ((s)->val.ptr) +/** pointer to a particular position */ +#define HAWK_UECS_CPTR(s,idx) (&(s)->val.ptr[idx]) +/** string capacity */ +#define HAWK_UECS_CAPA(s) ((s)->capa) +/** character at the given position */ +#define HAWK_UECS_CHAR(s,idx) ((s)->val.ptr[idx]) +/**< last character. unsafe if length <= 0 */ +#define HAWK_UECS_LASTCHAR(s) ((s)->val.ptr[(s)->val.len-1]) + +typedef struct hawk_becs_t hawk_becs_t; +typedef struct hawk_uecs_t hawk_uecs_t; + +typedef hawk_oow_t (*hawk_becs_sizer_t) ( + hawk_becs_t* data, + hawk_oow_t hint +); + +typedef hawk_oow_t (*hawk_uecs_sizer_t) ( + hawk_uecs_t* data, + hawk_oow_t hint +); + +#if defined(HAWK_OOCH_IS_UCH) +# define HAWK_OOECS_OOCS(s) HAWK_UECS_UCS(s) +# define HAWK_OOECS_LEN(s) HAWK_UECS_LEN(s) +# define HAWK_OOECS_PTR(s) HAWK_UECS_PTR(s) +# define HAWK_OOECS_CPTR(s,idx) HAWK_UECS_CPTR(s,idx) +# define HAWK_OOECS_CAPA(s) HAWK_UECS_CAPA(s) +# define HAWK_OOECS_CHAR(s,idx) HAWK_UECS_CHAR(s,idx) +# define HAWK_OOECS_LASTCHAR(s) HAWK_UECS_LASTCHAR(s) +# define hawk_ooecs_t hawk_uecs_t +# define hawk_ooecs_sizer_t hawk_uecs_sizer_t +#else +# define HAWK_OOECS_OOCS(s) HAWK_BECS_BCS(s) +# define HAWK_OOECS_LEN(s) HAWK_BECS_LEN(s) +# define HAWK_OOECS_PTR(s) HAWK_BECS_PTR(s) +# define HAWK_OOECS_CPTR(s,idx) HAWK_BECS_CPTR(s,idx) +# define HAWK_OOECS_CAPA(s) HAWK_BECS_CAPA(s) +# define HAWK_OOECS_CHAR(s,idx) HAWK_BECS_CHAR(s,idx) +# define HAWK_OOECS_LASTCHAR(s) HAWK_BECS_LASTCHAR(s) +# define hawk_ooecs_t hawk_becs_t +# define hawk_ooecs_sizer_t hawk_becs_sizer_t +#endif + + +/** + * The hawk_becs_t type defines a dynamically resizable multi-byte string. + */ +struct hawk_becs_t +{ + hawk_t* hawk; + hawk_becs_sizer_t sizer; /**< buffer resizer function */ + hawk_bcs_t val; /**< buffer/string pointer and lengh */ + hawk_oow_t capa; /**< buffer capacity */ +}; + +/** + * The hawk_uecs_t type defines a dynamically resizable wide-character string. + */ +struct hawk_uecs_t +{ + hawk_t* hawk; + hawk_uecs_sizer_t sizer; /**< buffer resizer function */ + hawk_ucs_t val; /**< buffer/string pointer and lengh */ + hawk_oow_t capa; /**< buffer capacity */ +}; + + +#if defined(__cplusplus) +extern "C" { +#endif + +/** + * The hawk_becs_open() function creates a dynamically resizable multibyte string. + */ +HAWK_EXPORT hawk_becs_t* hawk_becs_open ( + hawk_t* hawk, + hawk_oow_t xtnsize, + hawk_oow_t capa +); + +HAWK_EXPORT void hawk_becs_close ( + hawk_becs_t* becs +); + +/** + * The hawk_becs_init() function initializes a dynamically resizable string + * If the parameter capa is 0, it doesn't allocate the internal buffer + * in advance and always succeeds. + * \return 0 on success, -1 on failure. + */ +HAWK_EXPORT int hawk_becs_init ( + hawk_becs_t* becs, + hawk_t* hawk, + hawk_oow_t capa +); + +/** + * The hawk_becs_fini() function finalizes a dynamically resizable string. + */ +HAWK_EXPORT void hawk_becs_fini ( + hawk_becs_t* becs +); + +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE void* hawk_becs_getxtn (hawk_becs_t* becs) { return (void*)(becs + 1); } +#else +#define hawk_becs_getxtn(awk) ((void*)((hawk_becs_t*)(becs) + 1)) +#endif + +/** + * The hawk_becs_yield() function assigns the buffer to an variable of the + * #hawk_bcs_t type and recreate a new buffer of the \a new_capa capacity. + * The function fails if it fails to allocate a new buffer. + * \return 0 on success, and -1 on failure. + */ +HAWK_EXPORT int hawk_becs_yield ( + hawk_becs_t* becs, /**< string */ + hawk_bcs_t* buf, /**< buffer pointer */ + hawk_oow_t newcapa /**< new capacity */ +); + +HAWK_EXPORT hawk_bch_t* hawk_becs_yieldptr ( + hawk_becs_t* becs, /**< string */ + hawk_oow_t newcapa /**< new capacity */ +); + +/** + * The hawk_becs_getsizer() function gets the sizer. + * \return sizer function set or HAWK_NULL if no sizer is set. + */ +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE hawk_becs_sizer_t hawk_becs_getsizer (hawk_becs_t* becs) { return becs->sizer; } +#else +# define hawk_becs_getsizer(becs) ((becs)->sizer) +#endif + +/** + * The hawk_becs_setsizer() function specify a new sizer for a dynamic string. + * With no sizer specified, the dynamic string doubles the current buffer + * when it needs to increase its size. The sizer function is passed a dynamic + * string and the minimum capacity required to hold data after resizing. + * The string is truncated if the sizer function returns a smaller number + * than the hint passed. + */ +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE void hawk_becs_setsizer (hawk_becs_t* becs, hawk_becs_sizer_t sizer) { becs->sizer = sizer; } +#else +# define hawk_becs_setsizer(becs,sizerfn) ((becs)->sizer = (sizerfn)) +#endif + +/** + * The hawk_becs_getcapa() function returns the current capacity. + * You may use HAWK_STR_CAPA(str) macro for performance sake. + * \return current capacity in number of characters. + */ +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE hawk_oow_t hawk_becs_getcapa (hawk_becs_t* becs) { return HAWK_BECS_CAPA(becs); } +#else +# define hawk_becs_getcapa(becs) HAWK_BECS_CAPA(becs) +#endif + +/** + * The hawk_becs_setcapa() function sets the new capacity. If the new capacity + * is smaller than the old, the overflowing characters are removed from + * from the buffer. + * \return (hawk_oow_t)-1 on failure, new capacity on success + */ +HAWK_EXPORT hawk_oow_t hawk_becs_setcapa ( + hawk_becs_t* becs, + hawk_oow_t capa +); + +/** + * The hawk_becs_getlen() function return the string length. + */ +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE hawk_oow_t hawk_becs_getlen (hawk_becs_t* becs) { return HAWK_BECS_LEN(becs); } +#else +# define hawk_becs_getlen(becs) HAWK_BECS_LEN(becs) +#endif + +/** + * The hawk_becs_setlen() function changes the string length. + * \return (hawk_oow_t)-1 on failure, new length on success + */ +HAWK_EXPORT hawk_oow_t hawk_becs_setlen ( + hawk_becs_t* becs, + hawk_oow_t len +); + +/** + * The hawk_becs_clear() funtion deletes all characters in a string and sets + * the length to 0. It doesn't resize the internal buffer. + */ +HAWK_EXPORT void hawk_becs_clear ( + hawk_becs_t* becs +); + +/** + * The hawk_becs_swap() function exchanges the pointers to a buffer between + * two strings. It updates the length and the capacity accordingly. + */ +HAWK_EXPORT void hawk_becs_swap ( + hawk_becs_t* becs1, + hawk_becs_t* becs2 +); + +HAWK_EXPORT hawk_oow_t hawk_becs_cpy ( + hawk_becs_t* becs, + const hawk_bch_t* s +); + +HAWK_EXPORT hawk_oow_t hawk_becs_ncpy ( + hawk_becs_t* becs, + const hawk_bch_t* s, + hawk_oow_t len +); + +HAWK_EXPORT hawk_oow_t hawk_becs_cat ( + hawk_becs_t* becs, + const hawk_bch_t* s +); + +HAWK_EXPORT hawk_oow_t hawk_becs_ncat ( + hawk_becs_t* becs, + const hawk_bch_t* s, + hawk_oow_t len +); + +HAWK_EXPORT hawk_oow_t hawk_becs_nrcat ( + hawk_becs_t* becs, + const hawk_bch_t* s, + hawk_oow_t len +); + +HAWK_EXPORT hawk_oow_t hawk_becs_ccat ( + hawk_becs_t* becs, + hawk_bch_t c +); + +HAWK_EXPORT hawk_oow_t hawk_becs_nccat ( + hawk_becs_t* becs, + hawk_bch_t c, + hawk_oow_t len +); + +HAWK_EXPORT hawk_oow_t hawk_becs_del ( + hawk_becs_t* becs, + hawk_oow_t index, + hawk_oow_t size +); + +HAWK_EXPORT hawk_oow_t hawk_becs_amend ( + hawk_becs_t* becs, + hawk_oow_t index, + hawk_oow_t size, + const hawk_bch_t* repl +); + +HAWK_EXPORT hawk_oow_t hawk_becs_vfcat ( + hawk_becs_t* str, + const hawk_bch_t* fmt, + va_list ap +); + +HAWK_EXPORT hawk_oow_t hawk_becs_fcat ( + hawk_becs_t* str, + const hawk_bch_t* fmt, + ... +); + +HAWK_EXPORT hawk_oow_t hawk_becs_vfmt ( + hawk_becs_t* str, + const hawk_bch_t* fmt, + va_list ap +); + +HAWK_EXPORT hawk_oow_t hawk_becs_fmt ( + hawk_becs_t* str, + const hawk_bch_t* fmt, + ... +); + +/* ------------------------------------------------------------------------ */ + +/** + * The hawk_uecs_open() function creates a dynamically resizable multibyte string. + */ +HAWK_EXPORT hawk_uecs_t* hawk_uecs_open ( + hawk_t* hawk, + hawk_oow_t xtnsize, + hawk_oow_t capa +); + +HAWK_EXPORT void hawk_uecs_close ( + hawk_uecs_t* uecs +); + +/** + * The hawk_uecs_init() function initializes a dynamically resizable string + * If the parameter capa is 0, it doesn't allocate the internal buffer + * in advance and always succeeds. + * \return 0 on success, -1 on failure. + */ +HAWK_EXPORT int hawk_uecs_init ( + hawk_uecs_t* uecs, + hawk_t* hawk, + hawk_oow_t capa +); + +/** + * The hawk_uecs_fini() function finalizes a dynamically resizable string. + */ +HAWK_EXPORT void hawk_uecs_fini ( + hawk_uecs_t* uecs +); + +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE void* hawk_uecs_getxtn (hawk_uecs_t* uecs) { return (void*)(uecs + 1); } +#else +#define hawk_uecs_getxtn(awk) ((void*)((hawk_uecs_t*)(uecs) + 1)) +#endif + +/** + * The hawk_uecs_yield() function assigns the buffer to an variable of the + * #hawk_ucs_t type and recreate a new buffer of the \a new_capa capacity. + * The function fails if it fails to allocate a new buffer. + * \return 0 on success, and -1 on failure. + */ +HAWK_EXPORT int hawk_uecs_yield ( + hawk_uecs_t* uecs, /**< string */ + hawk_ucs_t* buf, /**< buffer pointer */ + hawk_oow_t newcapa /**< new capacity */ +); + +HAWK_EXPORT hawk_uch_t* hawk_uecs_yieldptr ( + hawk_uecs_t* uecs, /**< string */ + hawk_oow_t newcapa /**< new capacity */ +); + +/** + * The hawk_uecs_getsizer() function gets the sizer. + * \return sizer function set or HAWK_NULL if no sizer is set. + */ +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE hawk_uecs_sizer_t hawk_uecs_getsizer (hawk_uecs_t* uecs) { return uecs->sizer; } +#else +# define hawk_uecs_getsizer(uecs) ((uecs)->sizer) +#endif + +/** + * The hawk_uecs_setsizer() function specify a new sizer for a dynamic string. + * With no sizer specified, the dynamic string doubles the current buffer + * when it needs to increase its size. The sizer function is passed a dynamic + * string and the minimum capacity required to hold data after resizing. + * The string is truncated if the sizer function returns a smaller number + * than the hint passed. + */ +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE void hawk_uecs_setsizer (hawk_uecs_t* uecs, hawk_uecs_sizer_t sizer) { uecs->sizer = sizer; } +#else +# define hawk_uecs_setsizer(uecs,sizerfn) ((uecs)->sizer = (sizerfn)) +#endif + +/** + * The hawk_uecs_getcapa() function returns the current capacity. + * You may use HAWK_STR_CAPA(str) macro for performance sake. + * \return current capacity in number of characters. + */ +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE hawk_oow_t hawk_uecs_getcapa (hawk_uecs_t* uecs) { return HAWK_UECS_CAPA(uecs); } +#else +# define hawk_uecs_getcapa(uecs) HAWK_UECS_CAPA(uecs) +#endif + +/** + * The hawk_uecs_setcapa() function sets the new capacity. If the new capacity + * is smaller than the old, the overflowing characters are removed from + * from the buffer. + * \return (hawk_oow_t)-1 on failure, new capacity on success + */ +HAWK_EXPORT hawk_oow_t hawk_uecs_setcapa ( + hawk_uecs_t* uecs, + hawk_oow_t capa +); + +/** + * The hawk_uecs_getlen() function return the string length. + */ +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE hawk_oow_t hawk_uecs_getlen (hawk_uecs_t* uecs) { return HAWK_UECS_LEN(uecs); } +#else +# define hawk_uecs_getlen(uecs) HAWK_UECS_LEN(uecs) +#endif + +/** + * The hawk_uecs_setlen() function changes the string length. + * \return (hawk_oow_t)-1 on failure, new length on success + */ +HAWK_EXPORT hawk_oow_t hawk_uecs_setlen ( + hawk_uecs_t* uecs, + hawk_oow_t len +); + + +/** + * The hawk_uecs_clear() funtion deletes all characters in a string and sets + * the length to 0. It doesn't resize the internal buffer. + */ +HAWK_EXPORT void hawk_uecs_clear ( + hawk_uecs_t* uecs +); + +/** + * The hawk_uecs_swap() function exchanges the pointers to a buffer between + * two strings. It updates the length and the capacity accordingly. + */ +HAWK_EXPORT void hawk_uecs_swap ( + hawk_uecs_t* uecs1, + hawk_uecs_t* uecs2 +); + +HAWK_EXPORT hawk_oow_t hawk_uecs_cpy ( + hawk_uecs_t* uecs, + const hawk_uch_t* s +); + +HAWK_EXPORT hawk_oow_t hawk_uecs_ncpy ( + hawk_uecs_t* uecs, + const hawk_uch_t* s, + hawk_oow_t len +); + +HAWK_EXPORT hawk_oow_t hawk_uecs_cat ( + hawk_uecs_t* uecs, + const hawk_uch_t* s +); + +HAWK_EXPORT hawk_oow_t hawk_uecs_ncat ( + hawk_uecs_t* uecs, + const hawk_uch_t* s, + hawk_oow_t len +); + +HAWK_EXPORT hawk_oow_t hawk_uecs_nrcat ( + hawk_uecs_t* uecs, + const hawk_uch_t* s, + hawk_oow_t len +); + +HAWK_EXPORT hawk_oow_t hawk_uecs_ccat ( + hawk_uecs_t* uecs, + hawk_uch_t c +); + +HAWK_EXPORT hawk_oow_t hawk_uecs_nccat ( + hawk_uecs_t* uecs, + hawk_uch_t c, + hawk_oow_t len +); + +HAWK_EXPORT hawk_oow_t hawk_uecs_del ( + hawk_uecs_t* uecs, + hawk_oow_t index, + hawk_oow_t size +); + +HAWK_EXPORT hawk_oow_t hawk_uecs_amend ( + hawk_uecs_t* uecs, + hawk_oow_t index, + hawk_oow_t size, + const hawk_uch_t* repl +); + +HAWK_EXPORT hawk_oow_t hawk_uecs_vfcat ( + hawk_uecs_t* str, + const hawk_uch_t* fmt, + va_list ap +); + +HAWK_EXPORT hawk_oow_t hawk_uecs_fcat ( + hawk_uecs_t* str, + const hawk_uch_t* fmt, + ... +); + +HAWK_EXPORT hawk_oow_t hawk_uecs_vfmt ( + hawk_uecs_t* str, + const hawk_uch_t* fmt, + va_list ap +); + +HAWK_EXPORT hawk_oow_t hawk_uecs_fmt ( + hawk_uecs_t* str, + const hawk_uch_t* fmt, + ... +); + +#if defined(HAWK_OOCH_IS_UCH) +# define hawk_ooecs_open hawk_uecs_open +# define hawk_ooecs_close hawk_uecs_close +# define hawk_ooecs_init hawk_uecs_init +# define hawk_ooecs_fini hawk_uecs_fini +# define hawk_ooecs_getxtn hawk_uecs_getxtn +# define hawk_ooecs_yield hawk_uecs_yield +# define hawk_ooecs_yieldptr hawk_uecs_yieldptr +# define hawk_ooecs_getsizer hawk_uecs_getsizer +# define hawk_ooecs_setsizer hawk_uecs_setsizer +# define hawk_ooecs_getcapa hawk_uecs_getcapa +# define hawk_ooecs_setcapa hawk_uecs_setcapa +# define hawk_ooecs_getlen hawk_uecs_getlen +# define hawk_ooecs_setlen hawk_uecs_setlen +# define hawk_ooecs_clear hawk_uecs_clear +# define hawk_ooecs_swap hawk_uecs_swap +# define hawk_ooecs_cpy hawk_uecs_cpy +# define hawk_ooecs_ncpy hawk_uecs_ncpy +# define hawk_ooecs_cat hawk_uecs_cat +# define hawk_ooecs_ncat hawk_uecs_ncat +# define hawk_ooecs_nrcat hawk_uecs_nrcat +# define hawk_ooecs_ccat hawk_uecs_ccat +# define hawk_ooecs_nccat hawk_uecs_nccat +# define hawk_ooecs_del hawk_uecs_del +# define hawk_ooecs_amend hawk_uecs_amend +# define hawk_ooecs_vfcat hawk_uecs_vfcat +# define hawk_ooecs_fcat hawk_uecs_fcat +# define hawk_ooecs_vfmt hawk_uecs_vfmt +# define hawk_ooecs_fmt hawk_uecs_fmt +#else +# define hawk_ooecs_open hawk_becs_open +# define hawk_ooecs_close hawk_becs_close +# define hawk_ooecs_init hawk_becs_init +# define hawk_ooecs_fini hawk_becs_fini +# define hawk_ooecs_getxtn hawk_becs_getxtn +# define hawk_ooecs_yield hawk_becs_yield +# define hawk_ooecs_yieldptr hawk_becs_yieldptr +# define hawk_ooecs_getsizer hawk_becs_getsizer +# define hawk_ooecs_setsizer hawk_becs_setsizer +# define hawk_ooecs_getcapa hawk_becs_getcapa +# define hawk_ooecs_setcapa hawk_becs_setcapa +# define hawk_ooecs_getlen hawk_becs_getlen +# define hawk_ooecs_setlen hawk_becs_setlen +# define hawk_ooecs_clear hawk_becs_clear +# define hawk_ooecs_swap hawk_becs_swap +# define hawk_ooecs_cpy hawk_becs_cpy +# define hawk_ooecs_ncpy hawk_becs_ncpy +# define hawk_ooecs_cat hawk_becs_cat +# define hawk_ooecs_ncat hawk_becs_ncat +# define hawk_ooecs_nrcat hawk_becs_nrcat +# define hawk_ooecs_ccat hawk_becs_ccat +# define hawk_ooecs_nccat hawk_becs_nccat +# define hawk_ooecs_del hawk_becs_del +# define hawk_ooecs_vfcat hawk_becs_vfcat +# define hawk_ooecs_fcat hawk_becs_fcat +# define hawk_ooecs_vfmt hawk_becs_vfmt +# define hawk_ooecs_fmt hawk_becs_fmt +#endif + +HAWK_EXPORT hawk_oow_t hawk_becs_ncatuchars ( + hawk_becs_t* str, + const hawk_uch_t* s, + hawk_oow_t len, + hawk_cmgr_t* cmgr +); + +HAWK_EXPORT hawk_oow_t hawk_uecs_ncatbchars ( + hawk_uecs_t* str, + const hawk_bch_t* s, + hawk_oow_t len, + hawk_cmgr_t* cmgr, + int all +); + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/hawk/lib/hawk-fio.h b/hawk/lib/hawk-fio.h new file mode 100644 index 00000000..f2c3abc3 --- /dev/null +++ b/hawk/lib/hawk-fio.h @@ -0,0 +1,325 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_FIO_H_ +#define _HAWK_FIO_H_ + +#include + +enum hawk_fio_flag_t +{ + /* (1 << 0) to (1 << 7) reserved for hawk_sio_flag_t. + * see . nerver use this value. */ + HAWK_FIO_RESERVED = 0xFF, + + /** treat the file name pointer as a handle pointer */ + HAWK_FIO_HANDLE = (1 << 8), + +#if 0 + /** treat the file name pointer as a pointer to file name + * template to use when making a temporary file name */ + HAWK_FIO_TEMPORARY = (1 << 9), +#endif + + /** don't close an I/O handle in hawk_fio_fini() and hawk_fio_close() */ + HAWK_FIO_NOCLOSE = (1 << 10), + + /** treat the path name as a multi-byte string */ + HAWK_FIO_MBSPATH = (1 << 11), + + /* normal open flags */ + HAWK_FIO_READ = (1 << 14), + HAWK_FIO_WRITE = (1 << 15), + HAWK_FIO_APPEND = (1 << 16), + + HAWK_FIO_CREATE = (1 << 17), + HAWK_FIO_TRUNCATE = (1 << 18), + HAWK_FIO_EXCLUSIVE = (1 << 19), + HAWK_FIO_SYNC = (1 << 20), + + /* do not follow a symbolic link, only on a supported platform */ + HAWK_FIO_NOFOLLOW = (1 << 23), + + /* for WIN32 only. harmless(no effect) when used on other platforms */ + HAWK_FIO_NOSHREAD = (1 << 24), + HAWK_FIO_NOSHWRITE = (1 << 25), + HAWK_FIO_NOSHDELETE = (1 << 26), + + /* hints to OS. harmless(no effect) when used on unsupported platforms */ + HAWK_FIO_RANDOM = (1 << 27), /* hint that access be random */ + HAWK_FIO_SEQUENTIAL = (1 << 28) /* hint that access is sequential */ +}; + +enum hawk_fio_errnum_t +{ + HAWK_FIO_ENOERR = 0, /**< no error */ + HAWK_FIO_EOTHER, /**< other error */ + HAWK_FIO_ENOIMPL, /**< not implemented */ + HAWK_FIO_ESYSERR, /**< subsystem(system call) error */ + HAWK_FIO_EINTERN, /**< internal error */ + + HAWK_FIO_ENOMEM, /**< out of memory */ + HAWK_FIO_EINVAL, /**< invalid parameter */ + HAWK_FIO_EACCES, /**< access denied */ + HAWK_FIO_EPERM, /**< operation not permitted */ + HAWK_FIO_ENOENT, /**< no such file */ + HAWK_FIO_EEXIST, /**< already exist */ + HAWK_FIO_ENOTDIR, /**< not a directory */ + HAWK_FIO_EINTR, /**< interrupted */ + HAWK_FIO_EPIPE, /**< broken pipe */ + HAWK_FIO_EINPROG, /**< in progress */ + HAWK_FIO_EAGAIN /**< resource not available temporarily */ +}; +typedef enum hawk_fio_errnum_t hawk_fio_errnum_t; + +enum hawk_fio_std_t +{ + HAWK_FIO_STDIN = 0, + HAWK_FIO_STDOUT = 1, + HAWK_FIO_STDERR = 2 +}; +typedef enum hawk_fio_std_t hawk_fio_std_t; + +/* seek origin */ +enum hawk_fio_ori_t +{ + HAWK_FIO_BEGIN = 0, + HAWK_FIO_CURRENT = 1, + HAWK_FIO_END = 2 +}; +/* file origin for seek */ +typedef enum hawk_fio_ori_t hawk_fio_ori_t; + +enum hawk_fio_mode_t +{ + HAWK_FIO_SUID = 04000, /* set UID */ + HAWK_FIO_SGID = 02000, /* set GID */ + HAWK_FIO_SVTX = 01000, /* sticky bit */ + HAWK_FIO_RUSR = 00400, /* can be read by owner */ + HAWK_FIO_WUSR = 00200, /* can be written by owner */ + HAWK_FIO_XUSR = 00100, /* can be executed by owner */ + HAWK_FIO_RGRP = 00040, /* can be read by group */ + HAWK_FIO_WGRP = 00020, /* can be written by group */ + HAWK_FIO_XGRP = 00010, /* can be executed by group */ + HAWK_FIO_ROTH = 00004, /* can be read by others */ + HAWK_FIO_WOTH = 00002, /* can be written by others */ + HAWK_FIO_XOTH = 00001 /* can be executed by others */ +}; + +#if defined(_WIN32) + /* => typedef PVOID HANDLE; */ + typedef void* hawk_fio_hnd_t; +#elif defined(__OS2__) + /* => typedef LHANDLE HFILE; + typedef unsigned long LHANDLE; */ + typedef unsigned long hawk_fio_hnd_t; +#elif defined(__DOS__) + typedef int hawk_fio_hnd_t; +#elif defined(vms) || defined(__vms) + typedef void* hawk_fio_hnd_t; /* struct FAB*, struct RAB* */ +#else + typedef int hawk_fio_hnd_t; +#endif + +/* file offset */ +typedef hawk_foff_t hawk_fio_off_t; + +typedef struct hawk_fio_t hawk_fio_t; +typedef struct hawk_fio_lck_t hawk_fio_lck_t; + +struct hawk_fio_t +{ + hawk_t* hawk; + hawk_fio_errnum_t errnum; + hawk_fio_hnd_t handle; + int status; +}; + +struct hawk_fio_lck_t +{ + int type; /* READ, WRITE */ + hawk_fio_off_t offset; /* starting offset */ + hawk_fio_off_t length; /* length */ + hawk_fio_ori_t origin; /* origin */ +}; + +#define HAWK_FIO_HANDLE(fio) ((fio)->handle) + +#if defined(__cplusplus) +extern "C" { +#endif + +/** + * The hawk_fio_open() function opens a file. + * To open a file, you should set the flags with at least one of + * HAWK_FIO_READ, HAWK_FIO_WRITE, HAWK_FIO_APPEND. + * + * If the #HAWK_FIO_HANDLE flag is set, the @a path parameter is interpreted + * as a pointer to hawk_fio_hnd_t. + * + * If the #HAWK_FIO_TEMPORARY flag is set, the @a path parameter is + * interpreted as a path name template and an actual file name to open + * is internally generated using the template. The @a path parameter + * is filled with the last actual path name attempted when the function + * returns. So, you must not pass a constant string to the @a path + * parameter when #HAWK_FIO_TEMPORARY is set. + */ +HAWK_EXPORT hawk_fio_t* hawk_fio_open ( + hawk_t* hawk, + hawk_oow_t xtnsize, + const hawk_ooch_t* path, + int flags, + int mode +); + +/** + * The hawk_fio_close() function closes a file. + */ +HAWK_EXPORT void hawk_fio_close ( + hawk_fio_t* fio +); + +/** + * The hawk_fio_close() function opens a file into @a fio. + */ +HAWK_EXPORT int hawk_fio_init ( + hawk_fio_t* fio, + hawk_t* hawk, + const hawk_ooch_t* path, + int flags, + int mode +); + +/** + * The hawk_fio_close() function finalizes a file by closing the handle + * stored in @a fio. + */ +HAWK_EXPORT void hawk_fio_fini ( + hawk_fio_t* fio +); + +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE void* hawk_fio_getxtn (hawk_fio_t* fio) { return (void*)(fio + 1); } +#else +#define hawk_fio_getxtn(awk) ((void*)((hawk_fio_t*)(fio) + 1)) +#endif + +HAWK_EXPORT hawk_fio_errnum_t hawk_fio_geterrnum ( + const hawk_fio_t* fio +); + +/** + * The hawk_fio_gethnd() function returns the native file handle. + */ +HAWK_EXPORT hawk_fio_hnd_t hawk_fio_gethnd ( + const hawk_fio_t* fio +); + + +/** + * The hawk_fio_seek() function changes the current file position. + */ +HAWK_EXPORT hawk_fio_off_t hawk_fio_seek ( + hawk_fio_t* fio, + hawk_fio_off_t offset, + hawk_fio_ori_t origin +); + +/** + * The hawk_fio_truncate() function truncates a file to @a size. + */ +HAWK_EXPORT int hawk_fio_truncate ( + hawk_fio_t* fio, + hawk_fio_off_t size +); + +/** + * The hawk_fio_read() function reads data. + */ +HAWK_EXPORT hawk_ooi_t hawk_fio_read ( + hawk_fio_t* fio, + void* buf, + hawk_oow_t size +); + +/** + * The hawk_fio_write() function writes data. + */ +HAWK_EXPORT hawk_ooi_t hawk_fio_write ( + hawk_fio_t* fio, + const void* data, + hawk_oow_t size +); + +/** + * The hawk_fio_chmod() function changes the file mode. + * + * @note + * On _WIN32, this function is implemented on the best-effort basis and + * returns an error on the following conditions: + * - The file size is 0. + * - The file is opened without #HAWK_FIO_READ. + */ +HAWK_EXPORT int hawk_fio_chmod ( + hawk_fio_t* fio, + int mode +); + +/** + * The hawk_fio_sync() function synchronizes file contents into storage media + * It is useful in determining the media error, without which hawk_fio_close() + * may succeed despite such an error. + */ +HAWK_EXPORT int hawk_fio_sync ( + hawk_fio_t* fio +); + +HAWK_EXPORT int hawk_fio_lock ( + hawk_fio_t* fio, + hawk_fio_lck_t* lck, + int flags +); + +HAWK_EXPORT int hawk_fio_unlock ( + hawk_fio_t* fio, + hawk_fio_lck_t* lck, + int flags +); + +/** + * The hawk_get_std_fio_handle() returns a low-level system handle to + * commonly used I/O channels. + */ +HAWK_EXPORT int hawk_get_std_fio_handle ( + hawk_fio_std_t std, + hawk_fio_hnd_t* hnd +); + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/hawk/lib/hawk-fmt.h b/hawk/lib/hawk-fmt.h new file mode 100644 index 00000000..8a7dca52 --- /dev/null +++ b/hawk/lib/hawk-fmt.h @@ -0,0 +1,386 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_FMT_H_ +#define _HAWK_FMT_H_ + +#include +#include + +/** \file + * This file defines various formatting functions. + */ + +/** + * The hawk_fmt_intmax_flag_t type defines enumerators to change the + * behavior of hawk_fmt_intmax() and hawk_fmt_uintmax(). + */ +enum hawk_fmt_intmax_flag_t +{ + /* Use lower 6 bits to represent base between 2 and 36 inclusive. + * Upper bits are used for these flag options */ + + /** Don't truncate if the buffer is not large enough */ + HAWK_FMT_INTMAX_NOTRUNC = (0x40 << 0), +#define HAWK_FMT_INTMAX_NOTRUNC HAWK_FMT_INTMAX_NOTRUNC +#define HAWK_FMT_UINTMAX_NOTRUNC HAWK_FMT_INTMAX_NOTRUNC +#define HAWK_FMT_INTMAX_TO_BCSTR_NOTRUNC HAWK_FMT_INTMAX_NOTRUNC +#define HAWK_FMT_UINTMAX_TO_BCSTR_NOTRUNC HAWK_FMT_INTMAX_NOTRUNC +#define HAWK_FMT_INTMAX_TO_UCSTR_NOTRUNC HAWK_FMT_INTMAX_NOTRUNC +#define HAWK_FMT_UINTMAX_TO_UCSTR_NOTRUNC HAWK_FMT_INTMAX_NOTRUNC +#define HAWK_FMT_INTMAX_TO_OOCSTR_NOTRUNC HAWK_FMT_INTMAX_NOTRUNC +#define HAWK_FMT_UINTMAX_TO_OOCSTR_NOTRUNC HAWK_FMT_INTMAX_NOTRUNC + + /** Don't append a terminating null */ + HAWK_FMT_INTMAX_NONULL = (0x40 << 1), +#define HAWK_FMT_INTMAX_NONULL HAWK_FMT_INTMAX_NONULL +#define HAWK_FMT_UINTMAX_NONULL HAWK_FMT_INTMAX_NONULL +#define HAWK_FMT_INTMAX_TO_BCSTR_NONULL HAWK_FMT_INTMAX_NONULL +#define HAWK_FMT_UINTMAX_TO_BCSTR_NONULL HAWK_FMT_INTMAX_NONULL +#define HAWK_FMT_INTMAX_TO_UCSTR_NONULL HAWK_FMT_INTMAX_NONULL +#define HAWK_FMT_UINTMAX_TO_UCSTR_NONULL HAWK_FMT_INTMAX_NONULL +#define HAWK_FMT_INTMAX_TO_OOCSTR_NONULL HAWK_FMT_INTMAX_NONULL +#define HAWK_FMT_UINTMAX_TO_OOCSTR_NONULL HAWK_FMT_INTMAX_NONULL + + /** Produce no digit for a value of zero */ + HAWK_FMT_INTMAX_NOZERO = (0x40 << 2), +#define HAWK_FMT_INTMAX_NOZERO HAWK_FMT_INTMAX_NOZERO +#define HAWK_FMT_UINTMAX_NOZERO HAWK_FMT_INTMAX_NOZERO +#define HAWK_FMT_INTMAX_TO_BCSTR_NOZERO HAWK_FMT_INTMAX_NOZERO +#define HAWK_FMT_UINTMAX_TO_BCSTR_NOZERO HAWK_FMT_INTMAX_NOZERO +#define HAWK_FMT_INTMAX_TO_UCSTR_NOZERO HAWK_FMT_INTMAX_NOZERO +#define HAWK_FMT_UINTMAX_TO_UCSTR_NOZERO HAWK_FMT_INTMAX_NOZERO +#define HAWK_FMT_INTMAX_TO_OOCSTR_NOZERO HAWK_FMT_INTMAX_NOZERO +#define HAWK_FMT_UINTMAX_TO_OOCSTR_NOZERO HAWK_FMT_INTMAX_NOZERO + + /** Produce a leading zero for a non-zero value */ + HAWK_FMT_INTMAX_ZEROLEAD = (0x40 << 3), +#define HAWK_FMT_INTMAX_ZEROLEAD HAWK_FMT_INTMAX_ZEROLEAD +#define HAWK_FMT_UINTMAX_ZEROLEAD HAWK_FMT_INTMAX_ZEROLEAD +#define HAWK_FMT_INTMAX_TO_BCSTR_ZEROLEAD HAWK_FMT_INTMAX_ZEROLEAD +#define HAWK_FMT_UINTMAX_TO_BCSTR_ZEROLEAD HAWK_FMT_INTMAX_ZEROLEAD +#define HAWK_FMT_INTMAX_TO_UCSTR_ZEROLEAD HAWK_FMT_INTMAX_ZEROLEAD +#define HAWK_FMT_UINTMAX_TO_UCSTR_ZEROLEAD HAWK_FMT_INTMAX_ZEROLEAD +#define HAWK_FMT_INTMAX_TO_OOCSTR_ZEROLEAD HAWK_FMT_INTMAX_ZEROLEAD +#define HAWK_FMT_UINTMAX_TO_OOCSTR_ZEROLEAD HAWK_FMT_INTMAX_ZEROLEAD + + /** Use uppercase letters for alphabetic digits */ + HAWK_FMT_INTMAX_UPPERCASE = (0x40 << 4), +#define HAWK_FMT_INTMAX_UPPERCASE HAWK_FMT_INTMAX_UPPERCASE +#define HAWK_FMT_UINTMAX_UPPERCASE HAWK_FMT_INTMAX_UPPERCASE +#define HAWK_FMT_INTMAX_TO_BCSTR_UPPERCASE HAWK_FMT_INTMAX_UPPERCASE +#define HAWK_FMT_UINTMAX_TO_BCSTR_UPPERCASE HAWK_FMT_INTMAX_UPPERCASE +#define HAWK_FMT_INTMAX_TO_UCSTR_UPPERCASE HAWK_FMT_INTMAX_UPPERCASE +#define HAWK_FMT_UINTMAX_TO_UCSTR_UPPERCASE HAWK_FMT_INTMAX_UPPERCASE +#define HAWK_FMT_INTMAX_TO_OOCSTR_UPPERCASE HAWK_FMT_INTMAX_UPPERCASE +#define HAWK_FMT_UINTMAX_TO_OOCSTR_UPPERCASE HAWK_FMT_INTMAX_UPPERCASE + + /** Insert a plus sign for a positive integer including 0 */ + HAWK_FMT_INTMAX_PLUSSIGN = (0x40 << 5), +#define HAWK_FMT_INTMAX_PLUSSIGN HAWK_FMT_INTMAX_PLUSSIGN +#define HAWK_FMT_UINTMAX_PLUSSIGN HAWK_FMT_INTMAX_PLUSSIGN +#define HAWK_FMT_INTMAX_TO_BCSTR_PLUSSIGN HAWK_FMT_INTMAX_PLUSSIGN +#define HAWK_FMT_UINTMAX_TO_BCSTR_PLUSSIGN HAWK_FMT_INTMAX_PLUSSIGN +#define HAWK_FMT_INTMAX_TO_UCSTR_PLUSSIGN HAWK_FMT_INTMAX_PLUSSIGN +#define HAWK_FMT_UINTMAX_TO_UCSTR_PLUSSIGN HAWK_FMT_INTMAX_PLUSSIGN +#define HAWK_FMT_INTMAX_TO_OOCSTR_PLUSSIGN HAWK_FMT_INTMAX_PLUSSIGN +#define HAWK_FMT_UINTMAX_TO_OOCSTR_PLUSSIGN HAWK_FMT_INTMAX_PLUSSIGN + + /** Insert a space for a positive integer including 0 */ + HAWK_FMT_INTMAX_EMPTYSIGN = (0x40 << 6), +#define HAWK_FMT_INTMAX_EMPTYSIGN HAWK_FMT_INTMAX_EMPTYSIGN +#define HAWK_FMT_UINTMAX_EMPTYSIGN HAWK_FMT_INTMAX_EMPTYSIGN +#define HAWK_FMT_INTMAX_TO_BCSTR_EMPTYSIGN HAWK_FMT_INTMAX_EMPTYSIGN +#define HAWK_FMT_UINTMAX_TO_BCSTR_EMPTYSIGN HAWK_FMT_INTMAX_EMPTYSIGN +#define HAWK_FMT_INTMAX_TO_UCSTR_EMPTYSIGN HAWK_FMT_INTMAX_EMPTYSIGN +#define HAWK_FMT_UINTMAX_TO_UCSTR_EMPTYSIGN HAWK_FMT_INTMAX_EMPTYSIGN + + /** Fill the right part of the string */ + HAWK_FMT_INTMAX_FILLRIGHT = (0x40 << 7), +#define HAWK_FMT_INTMAX_FILLRIGHT HAWK_FMT_INTMAX_FILLRIGHT +#define HAWK_FMT_UINTMAX_FILLRIGHT HAWK_FMT_INTMAX_FILLRIGHT +#define HAWK_FMT_INTMAX_TO_BCSTR_FILLRIGHT HAWK_FMT_INTMAX_FILLRIGHT +#define HAWK_FMT_UINTMAX_TO_BCSTR_FILLRIGHT HAWK_FMT_INTMAX_FILLRIGHT +#define HAWK_FMT_INTMAX_TO_UCSTR_FILLRIGHT HAWK_FMT_INTMAX_FILLRIGHT +#define HAWK_FMT_UINTMAX_TO_UCSTR_FILLRIGHT HAWK_FMT_INTMAX_FILLRIGHT +#define HAWK_FMT_INTMAX_TO_OOCSTR_FILLRIGHT HAWK_FMT_INTMAX_FILLRIGHT +#define HAWK_FMT_UINTMAX_TO_OOCSTR_FILLRIGHT HAWK_FMT_INTMAX_FILLRIGHT + + /** Fill between the sign chacter and the digit part */ + HAWK_FMT_INTMAX_FILLCENTER = (0x40 << 8) +#define HAWK_FMT_INTMAX_FILLCENTER HAWK_FMT_INTMAX_FILLCENTER +#define HAWK_FMT_UINTMAX_FILLCENTER HAWK_FMT_INTMAX_FILLCENTER +#define HAWK_FMT_INTMAX_TO_BCSTR_FILLCENTER HAWK_FMT_INTMAX_FILLCENTER +#define HAWK_FMT_UINTMAX_TO_BCSTR_FILLCENTER HAWK_FMT_INTMAX_FILLCENTER +#define HAWK_FMT_INTMAX_TO_UCSTR_FILLCENTER HAWK_FMT_INTMAX_FILLCENTER +#define HAWK_FMT_UINTMAX_TO_UCSTR_FILLCENTER HAWK_FMT_INTMAX_FILLCENTER +#define HAWK_FMT_INTMAX_TO_OOCSTR_FILLCENTER HAWK_FMT_INTMAX_FILLCENTER +#define HAWK_FMT_UINTMAX_TO_OOCSTR_FILLCENTER HAWK_FMT_INTMAX_FILLCENTER +}; + +/* ========================================================================= + * FORMATTED OUTPUT + * ========================================================================= */ +typedef struct hawk_fmtout_t hawk_fmtout_t; + +typedef int (*hawk_fmtout_putbchars_t) ( + hawk_fmtout_t* fmtout, + const hawk_bch_t* ptr, + hawk_oow_t len +); + +typedef int (*hawk_fmtout_putuchars_t) ( + hawk_fmtout_t* fmtout, + const hawk_uch_t* ptr, + hawk_oow_t len +); + +typedef int (*hawk_fmtout_putobj_t) ( + hawk_fmtout_t* fmtout, + hawk_val_t* val +); + +enum hawk_fmtout_fmt_type_t +{ + HAWK_FMTOUT_FMT_TYPE_BCH = 0, + HAWK_FMTOUT_FMT_TYPE_UCH +}; +typedef enum hawk_fmtout_fmt_type_t hawk_fmtout_fmt_type_t; + +struct hawk_fmtout_t +{ + hawk_oow_t count; /* out */ + + hawk_mmgr_t* mmgr; /* in */ + hawk_fmtout_putbchars_t putbchars; /* in */ + hawk_fmtout_putuchars_t putuchars; /* in */ + hawk_fmtout_putobj_t putobj; /* in - %O is not handled if it's not set. */ + hawk_bitmask_t mask; /* in */ + void* ctx; /* in */ + + /* internally set a input */ + hawk_fmtout_fmt_type_t fmt_type; + const void* fmt_str; +}; + +#if defined(__cplusplus) +extern "C" { +#endif + +/** + * The hawk_fmt_intmax_to_bcstr() function formats an integer \a value to a + * multibyte string according to the given base and writes it to a buffer + * pointed to by \a buf. It writes to the buffer at most \a size characters + * including the terminating null. The base must be between 2 and 36 inclusive + * and can be ORed with zero or more #hawk_fmt_intmax_to_bcstr_flag_t enumerators. + * This ORed value is passed to the function via the \a base_and_flags + * parameter. If the formatted string is shorter than \a bufsize, the redundant + * slots are filled with the fill character \a fillchar if it is not a null + * character. The filling behavior is determined by the flags shown below: + * + * - If #HAWK_FMT_INTMAX_TO_BCSTR_FILLRIGHT is set in \a base_and_flags, slots + * after the formatting string are filled. + * - If #HAWK_FMT_INTMAX_TO_BCSTR_FILLCENTER is set in \a base_and_flags, slots + * before the formatting string are filled. However, if it contains the + * sign character, the slots between the sign character and the digit part + * are filled. + * - If neither #HAWK_FMT_INTMAX_TO_BCSTR_FILLRIGHT nor #HAWK_FMT_INTMAX_TO_BCSTR_FILLCENTER + * , slots before the formatting string are filled. + * + * The \a precision parameter specified the minimum number of digits to + * produce from the \a value. If \a value produces fewer digits than + * \a precision, the actual digits are padded with '0' to meet the precision + * requirement. You can pass a negative number if you don't wish to specify + * precision. + * + * The terminating null is not added if #HAWK_FMT_INTMAX_TO_BCSTR_NONULL is set; + * The #HAWK_FMT_INTMAX_TO_BCSTR_UPPERCASE flag indicates that the function should + * use the uppercase letter for a alphabetic digit; + * You can set #HAWK_FMT_INTMAX_TO_BCSTR_NOTRUNC if you require lossless formatting. + * The #HAWK_FMT_INTMAX_TO_BCSTR_PLUSSIGN flag and #HAWK_FMT_INTMAX_TO_BCSTR_EMPTYSIGN + * ensures that the plus sign and a space is added for a positive integer + * including 0 respectively. + * The #HAWK_FMT_INTMAX_TO_BCSTR_ZEROLEAD flag ensures that the numeric string + * begins with '0' before applying the prefix. + * You can set the #HAWK_FMT_INTMAX_TO_BCSTR_NOZERO flag if you want the value of + * 0 to produce nothing. If both #HAWK_FMT_INTMAX_TO_BCSTR_NOZERO and + * #HAWK_FMT_INTMAX_TO_BCSTR_ZEROLEAD are specified, '0' is still produced. + * + * If \a prefix is not #HAWK_NULL, it is inserted before the digits. + * + * \return + * - -1 if the base is not between 2 and 36 inclusive. + * - negated number of characters required for lossless formatting + * - if \a bufsize is 0. + * - if #HAWK_FMT_INTMAX_TO_BCSTR_NOTRUNC is set and \a bufsize is less than + * the minimum required for lossless formatting. + * - number of characters written to the buffer excluding a terminating + * null in all other cases. + */ +HAWK_EXPORT int hawk_fmt_intmax_to_bcstr ( + hawk_bch_t* buf, /**< buffer pointer */ + int bufsize, /**< buffer size */ + hawk_intmax_t value, /**< integer to format */ + int base_and_flags, /**< base ORed with flags */ + int precision, /**< precision */ + hawk_bch_t fillchar, /**< fill character */ + const hawk_bch_t* prefix /**< prefix */ +); + +/** + * The hawk_fmt_intmax_to_ucstr() function formats an integer \a value to a + * wide-character string according to the given base and writes it to a buffer + * pointed to by \a buf. It writes to the buffer at most \a size characters + * including the terminating null. The base must be between 2 and 36 inclusive + * and can be ORed with zero or more #hawk_fmt_intmax_to_ucstr_flag_t enumerators. + * This ORed value is passed to the function via the \a base_and_flags + * parameter. If the formatted string is shorter than \a bufsize, the redundant + * slots are filled with the fill character \a fillchar if it is not a null + * character. The filling behavior is determined by the flags shown below: + * + * - If #HAWK_FMT_INTMAX_TO_UCSTR_FILLRIGHT is set in \a base_and_flags, slots + * after the formatting string are filled. + * - If #HAWK_FMT_INTMAX_TO_UCSTR_FILLCENTER is set in \a base_and_flags, slots + * before the formatting string are filled. However, if it contains the + * sign character, the slots between the sign character and the digit part + * are filled. + * - If neither #HAWK_FMT_INTMAX_TO_UCSTR_FILLRIGHT nor #HAWK_FMT_INTMAX_TO_UCSTR_FILLCENTER + * , slots before the formatting string are filled. + * + * The \a precision parameter specified the minimum number of digits to + * produce from the \ value. If \a value produces fewer digits than + * \a precision, the actual digits are padded with '0' to meet the precision + * requirement. You can pass a negative number if don't wish to specify + * precision. + * + * The terminating null is not added if #HAWK_FMT_INTMAX_TO_UCSTR_NONULL is set; + * The #HAWK_FMT_INTMAX_TO_UCSTR_UPPERCASE flag indicates that the function should + * use the uppercase letter for a alphabetic digit; + * You can set #HAWK_FMT_INTMAX_TO_UCSTR_NOTRUNC if you require lossless formatting. + * The #HAWK_FMT_INTMAX_TO_UCSTR_PLUSSIGN flag and #HAWK_FMT_INTMAX_TO_UCSTR_EMPTYSIGN + * ensures that the plus sign and a space is added for a positive integer + * including 0 respectively. + * The #HAWK_FMT_INTMAX_TO_UCSTR_ZEROLEAD flag ensures that the numeric string + * begins with 0 before applying the prefix. + * You can set the #HAWK_FMT_INTMAX_TO_UCSTR_NOZERO flag if you want the value of + * 0 to produce nothing. If both #HAWK_FMT_INTMAX_TO_UCSTR_NOZERO and + * #HAWK_FMT_INTMAX_TO_UCSTR_ZEROLEAD are specified, '0' is still produced. + * + * If \a prefix is not #HAWK_NULL, it is inserted before the digits. + * + * \return + * - -1 if the base is not between 2 and 36 inclusive. + * - negated number of characters required for lossless formatting + * - if \a bufsize is 0. + * - if #HAWK_FMT_INTMAX_TO_UCSTR_NOTRUNC is set and \a bufsize is less than + * the minimum required for lossless formatting. + * - number of characters written to the buffer excluding a terminating + * null in all other cases. + */ +HAWK_EXPORT int hawk_fmt_intmax_to_ucstr ( + hawk_uch_t* buf, /**< buffer pointer */ + int bufsize, /**< buffer size */ + hawk_intmax_t value, /**< integer to format */ + int base_and_flags, /**< base ORed with flags */ + int precision, /**< precision */ + hawk_uch_t fillchar, /**< fill character */ + const hawk_uch_t* prefix /**< prefix */ +); + + +/** + * The hawk_fmt_uintmax_to_bcstr() function formats an unsigned integer \a value + * to a multibyte string buffer. It behaves the same as hawk_fmt_intmax_to_bcstr() + * except that it handles an unsigned integer. + */ +HAWK_EXPORT int hawk_fmt_uintmax_to_bcstr ( + hawk_bch_t* buf, /**< buffer pointer */ + int bufsize, /**< buffer size */ + hawk_uintmax_t value, /**< integer to format */ + int base_and_flags, /**< base ORed with flags */ + int precision, /**< precision */ + hawk_bch_t fillchar, /**< fill character */ + const hawk_bch_t* prefix /**< prefix */ +); + +/** + * The hawk_fmt_uintmax_to_ucstr() function formats an unsigned integer \a value + * to a unicode string buffer. It behaves the same as hawk_fmt_intmax_to_ucstr() + * except that it handles an unsigned integer. + */ +HAWK_EXPORT int hawk_fmt_uintmax_to_ucstr ( + hawk_uch_t* buf, /**< buffer pointer */ + int bufsize, /**< buffer size */ + hawk_uintmax_t value, /**< integer to format */ + int base_and_flags, /**< base ORed with flags */ + int precision, /**< precision */ + hawk_uch_t fillchar, /**< fill character */ + const hawk_uch_t* prefix /**< prefix */ +); + +#if defined(HAWK_OOCH_IS_BCH) +# define hawk_fmt_intmax_to_oocstr hawk_fmt_intmax_to_bcstr +# define hawk_fmt_uintmax_to_oocstr hawk_fmt_uintmax_to_bcstr +#else +# define hawk_fmt_intmax_to_oocstr hawk_fmt_intmax_to_ucstr +# define hawk_fmt_uintmax_to_oocstr hawk_fmt_uintmax_to_ucstr +#endif + +/* TODO: hawk_fmt_fltmax_to_bcstr()... hawk_fmt_fltmax_to_ucstr() */ + +/* ========================================================================= + * FORMATTED OUTPUT + * ========================================================================= */ +HAWK_EXPORT int hawk_bfmt_outv ( + hawk_fmtout_t* fmtout, + const hawk_bch_t* fmt, + va_list ap +); + +HAWK_EXPORT int hawk_ufmt_outv ( + hawk_fmtout_t* fmtout, + const hawk_uch_t* fmt, + va_list ap +); + + +HAWK_EXPORT int hawk_bfmt_out ( + hawk_fmtout_t* fmtout, + const hawk_bch_t* fmt, + ... +); + +HAWK_EXPORT int hawk_ufmt_out ( + hawk_fmtout_t* fmtout, + const hawk_uch_t* fmt, + ... +); + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/hawk/lib/hawk-htb.h b/hawk/lib/hawk-htb.h new file mode 100644 index 00000000..35bdde20 --- /dev/null +++ b/hawk/lib/hawk-htb.h @@ -0,0 +1,671 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_HTB_H_ +#define _HAWK_HTB_H_ + +#include + +/**@file + * This file provides a hash table encapsulated in the #hawk_htb_t type that + * maintains buckets for key/value pairs with the same key hash chained under + * the same bucket. Its interface is very close to #hawk_rbt_t. + * + * This sample code adds a series of keys and values and print them + * in the randome order. + * @code + * #include + * + * static hawk_htb_walk_t walk (hawk_htb_t* htb, hawk_htb_pair_t* pair, void* ctx) + * { + * hawk_printf (HAWK_T("key = %d, value = %d\n"), + * *(int*)HAWK_HTB_KPTR(pair), *(int*)HAWK_HTB_VPTR(pair)); + * return HAWK_HTB_WALK_FORWARD; + * } + * + * int main () + * { + * hawk_htb_t* s1; + * int i; + * + * hawk_open_stdsios (); + * s1 = hawk_htb_open (HAWK_MMGR_GETDFL(), 0, 30, 75, 1, 1); // error handling skipped + * hawk_htb_setstyle (s1, hawk_get_htb_style(HAWK_HTB_STYLE_INLINE_COPIERS)); + * + * for (i = 0; i < 20; i++) + * { + * int x = i * 20; + * hawk_htb_insert (s1, &i, HAWK_SIZEOF(i), &x, HAWK_SIZEOF(x)); // eror handling skipped + * } + * + * hawk_htb_walk (s1, walk, HAWK_NULL); + * + * hawk_htb_close (s1); + * hawk_close_stdsios (); + * return 0; + * } + * @endcode + */ + +typedef struct hawk_htb_t hawk_htb_t; +typedef struct hawk_htb_pair_t hawk_htb_pair_t; + +/** + * The hawk_htb_walk_t type defines values that the callback function can + * return to control hawk_htb_walk(). + */ +enum hawk_htb_walk_t +{ + HAWK_HTB_WALK_STOP = 0, + HAWK_HTB_WALK_FORWARD = 1 +}; +typedef enum hawk_htb_walk_t hawk_htb_walk_t; + +/** + * The hawk_htb_id_t type defines IDs to indicate a key or a value in various + * functions. + */ +enum hawk_htb_id_t +{ + HAWK_HTB_KEY = 0, + HAWK_HTB_VAL = 1 +}; +typedef enum hawk_htb_id_t hawk_htb_id_t; + +/** + * The hawk_htb_copier_t type defines a pair contruction callback. + * A special copier #HAWK_HTB_COPIER_INLINE is provided. This copier enables + * you to copy the data inline to the internal node. No freeer is invoked + * when the node is freeed. + */ +typedef void* (*hawk_htb_copier_t) ( + hawk_htb_t* htb /* hash table */, + void* dptr /* pointer to a key or a value */, + hawk_oow_t dlen /* length of a key or a value */ +); + +/** + * The hawk_htb_freeer_t defines a key/value destruction callback + * The freeer is called when a node containing the element is destroyed. + */ +typedef void (*hawk_htb_freeer_t) ( + hawk_htb_t* htb, /**< hash table */ + void* dptr, /**< pointer to a key or a value */ + hawk_oow_t dlen /**< length of a key or a value */ +); + + +/** + * The hawk_htb_comper_t type defines a key comparator that is called when + * the htb needs to compare keys. A hash table is created with a default + * comparator which performs bitwise comparison of two keys. + * The comparator should return 0 if the keys are the same and a non-zero + * integer otherwise. + */ +typedef int (*hawk_htb_comper_t) ( + const hawk_htb_t* htb, /**< hash table */ + const void* kptr1, /**< key pointer */ + hawk_oow_t klen1, /**< key length */ + const void* kptr2, /**< key pointer */ + hawk_oow_t klen2 /**< key length */ +); + +/** + * The hawk_htb_keeper_t type defines a value keeper that is called when + * a value is retained in the context that it should be destroyed because + * it is identical to a new value. Two values are identical if their + * pointers and lengths are equal. + */ +typedef void (*hawk_htb_keeper_t) ( + hawk_htb_t* htb, /**< hash table */ + void* vptr, /**< value pointer */ + hawk_oow_t vlen /**< value length */ +); + +/** + * The hawk_htb_sizer_t type defines a bucket size claculator that is called + * when hash table should resize the bucket. The current bucket size + 1 is + * passed as the hint. + */ +typedef hawk_oow_t (*hawk_htb_sizer_t) ( + hawk_htb_t* htb, /**< htb */ + hawk_oow_t hint /**< sizing hint */ +); + +/** + * The hawk_htb_hasher_t type defines a key hash function + */ +typedef hawk_oow_t (*hawk_htb_hasher_t) ( + const hawk_htb_t* htb, /**< hash table */ + const void* kptr, /**< key pointer */ + hawk_oow_t klen /**< key length in bytes */ +); + +/** + * The hawk_htb_walker_t defines a pair visitor. + */ +typedef hawk_htb_walk_t (*hawk_htb_walker_t) ( + hawk_htb_t* htb, /**< htb */ + hawk_htb_pair_t* pair, /**< pointer to a key/value pair */ + void* ctx /**< pointer to user-defined data */ +); + +/** + * The hawk_htb_cbserter_t type defines a callback function for hawk_htb_cbsert(). + * The hawk_htb_cbserter() function calls it to allocate a new pair for the + * key pointed to by @a kptr of the length @a klen and the callback context + * @a ctx. The second parameter @a pair is passed the pointer to the existing + * pair for the key or #HAWK_NULL in case of no existing key. The callback + * must return a pointer to a new or a reallocated pair. When reallocating the + * existing pair, this callback must destroy the existing pair and return the + * newly reallocated pair. It must return #HAWK_NULL for failure. + */ +typedef hawk_htb_pair_t* (*hawk_htb_cbserter_t) ( + hawk_htb_t* htb, /**< hash table */ + hawk_htb_pair_t* pair, /**< pair pointer */ + void* kptr, /**< key pointer */ + hawk_oow_t klen, /**< key length */ + void* ctx /**< callback context */ +); + + +/** + * The hawk_htb_pair_t type defines hash table pair. A pair is composed of a key + * and a value. It maintains pointers to the beginning of a key and a value + * plus their length. The length is scaled down with the scale factor + * specified in an owning hash table. + */ +struct hawk_htb_pair_t +{ + hawk_ptl_t key; + hawk_ptl_t val; + + /* management information below */ + hawk_htb_pair_t* next; +}; + +typedef struct hawk_htb_style_t hawk_htb_style_t; + +struct hawk_htb_style_t +{ + hawk_htb_copier_t copier[2]; + hawk_htb_freeer_t freeer[2]; + hawk_htb_comper_t comper; /**< key comparator */ + hawk_htb_keeper_t keeper; /**< value keeper */ + hawk_htb_sizer_t sizer; /**< bucket capacity recalculator */ + hawk_htb_hasher_t hasher; /**< key hasher */ +}; + +/** + * The hawk_htb_style_kind_t type defines the type of predefined + * callback set for pair manipulation. + */ +enum hawk_htb_style_kind_t +{ + /** store the key and the value pointer */ + HAWK_HTB_STYLE_DEFAULT, + /** copy both key and value into the pair */ + HAWK_HTB_STYLE_INLINE_COPIERS, + /** copy the key into the pair but store the value pointer */ + HAWK_HTB_STYLE_INLINE_KEY_COPIER, + /** copy the value into the pair but store the key pointer */ + HAWK_HTB_STYLE_INLINE_VALUE_COPIER +}; + +typedef enum hawk_htb_style_kind_t hawk_htb_style_kind_t; + +/** + * The hawk_htb_t type defines a hash table. + */ +struct hawk_htb_t +{ + hawk_t* hawk; + + const hawk_htb_style_t* style; + + hawk_uint8_t scale[2]; /**< length scale */ + hawk_uint8_t factor; /**< load factor in percentage */ + + hawk_oow_t size; + hawk_oow_t capa; + hawk_oow_t threshold; + + hawk_htb_pair_t** bucket; +}; + +/** + * The HAWK_HTB_COPIER_SIMPLE macros defines a copier that remembers the + * pointer and length of data in a pair. + **/ +#define HAWK_HTB_COPIER_SIMPLE ((hawk_htb_copier_t)1) + +/** + * The HAWK_HTB_COPIER_INLINE macros defines a copier that copies data into + * a pair. + **/ +#define HAWK_HTB_COPIER_INLINE ((hawk_htb_copier_t)2) + +#define HAWK_HTB_COPIER_DEFAULT (HAWK_HTB_COPIER_SIMPLE) +#define HAWK_HTB_FREEER_DEFAULT (HAWK_NULL) +#define HAWK_HTB_COMPER_DEFAULT (hawk_htb_dflcomp) +#define HAWK_HTB_KEEPER_DEFAULT (HAWK_NULL) +#define HAWK_HTB_SIZER_DEFAULT (HAWK_NULL) +#define HAWK_HTB_HASHER_DEFAULT (hawk_htb_dflhash) + +/** + * The HAWK_HTB_SIZE() macro returns the number of pairs in a hash table. + */ +#define HAWK_HTB_SIZE(m) (*(const hawk_oow_t*)&(m)->size) + +/** + * The HAWK_HTB_CAPA() macro returns the maximum number of pairs that can be + * stored in a hash table without further reorganization. + */ +#define HAWK_HTB_CAPA(m) (*(const hawk_oow_t*)&(m)->capa) + +#define HAWK_HTB_FACTOR(m) (*(const int*)&(m)->factor) +#define HAWK_HTB_KSCALE(m) (*(const int*)&(m)->scale[HAWK_HTB_KEY]) +#define HAWK_HTB_VSCALE(m) (*(const int*)&(m)->scale[HAWK_HTB_VAL]) + +#define HAWK_HTB_KPTL(p) (&(p)->key) +#define HAWK_HTB_VPTL(p) (&(p)->val) + +#define HAWK_HTB_KPTR(p) ((p)->key.ptr) +#define HAWK_HTB_KLEN(p) ((p)->key.len) +#define HAWK_HTB_VPTR(p) ((p)->val.ptr) +#define HAWK_HTB_VLEN(p) ((p)->val.len) + +#define HAWK_HTB_NEXT(p) ((p)->next) + +#if defined(__cplusplus) +extern "C" { +#endif + +/** + * The hawk_get_htb_style() functions returns a predefined callback set for + * pair manipulation. + */ +HAWK_EXPORT const hawk_htb_style_t* hawk_get_htb_style ( + hawk_htb_style_kind_t kind +); + +/** + * The hawk_htb_open() function creates a hash table with a dynamic array + * bucket and a list of values chained. The initial capacity should be larger + * than 0. The load factor should be between 0 and 100 inclusive and the load + * factor of 0 disables bucket resizing. If you need extra space associated + * with hash table, you may pass a non-zero value for @a xtnsize. + * The HAWK_HTB_XTN() macro and the hawk_htb_getxtn() function return the + * pointer to the beginning of the extension. + * The @a kscale and @a vscale parameters specify the unit of the key and + * value size. + * @return #hawk_htb_t pointer on success, #HAWK_NULL on failure. + */ +HAWK_EXPORT hawk_htb_t* hawk_htb_open ( + hawk_t* hawk, /**< awk object */ + hawk_oow_t xtnsize, /**< extension size in bytes */ + hawk_oow_t capa, /**< initial capacity */ + int factor, /**< load factor */ + int kscale, /**< key scale - 1 to 255 */ + int vscale /**< value scale - 1 to 255 */ +); + + +/** + * The hawk_htb_close() function destroys a hash table. + */ +HAWK_EXPORT void hawk_htb_close ( + hawk_htb_t* htb /**< hash table */ +); + +/** + * The hawk_htb_init() function initializes a hash table + */ +HAWK_EXPORT int hawk_htb_init ( + hawk_htb_t* htb, /**< hash table */ + hawk_t* hawk, /**< awk object */ + hawk_oow_t capa, /**< initial capacity */ + int factor, /**< load factor */ + int kscale, /**< key scale */ + int vscale /**< value scale */ +); + +/** + * The hawk_htb_fini() funtion finalizes a hash table + */ +HAWK_EXPORT void hawk_htb_fini ( + hawk_htb_t* htb +); + +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE void* hawk_htb_getxtn (hawk_htb_t* htb) { return (void*)(htb + 1); } +#else +#define hawk_htb_getxtn(awk) ((void*)((hawk_htb_t*)(htb) + 1)) +#endif + +/** + * The hawk_htb_getstyle() function gets manipulation callback function set. + */ +HAWK_EXPORT const hawk_htb_style_t* hawk_htb_getstyle ( + const hawk_htb_t* htb /**< hash table */ +); + +/** + * The hawk_htb_setstyle() function sets internal manipulation callback + * functions for data construction, destruction, resizing, hashing, etc. + * The callback structure pointed to by \a style must outlive the hash + * table pointed to by \a htb as the hash table doesn't copy the contents + * of the structure. + */ +HAWK_EXPORT void hawk_htb_setstyle ( + hawk_htb_t* htb, /**< hash table */ + const hawk_htb_style_t* style /**< callback function set */ +); + +/** + * The hawk_htb_getsize() function gets the number of pairs in hash table. + */ +HAWK_EXPORT hawk_oow_t hawk_htb_getsize ( + const hawk_htb_t* htb +); + +/** + * The hawk_htb_getcapa() function gets the number of slots allocated + * in a hash bucket. + */ +HAWK_EXPORT hawk_oow_t hawk_htb_getcapa ( + const hawk_htb_t* htb /**< hash table */ +); + +/** + * The hawk_htb_search() function searches a hash table to find a pair with a + * matching key. It returns the pointer to the pair found. If it fails + * to find one, it returns HAWK_NULL. + * @return pointer to the pair with a maching key, + * or #HAWK_NULL if no match is found. + */ +HAWK_EXPORT hawk_htb_pair_t* hawk_htb_search ( + const hawk_htb_t* htb, /**< hash table */ + const void* kptr, /**< key pointer */ + hawk_oow_t klen /**< key length */ +); + +/** + * The hawk_htb_upsert() function searches a hash table for the pair with a + * matching key. If one is found, it updates the pair. Otherwise, it inserts + * a new pair with the key and value given. It returns the pointer to the + * pair updated or inserted. + * @return pointer to the updated or inserted pair on success, + * #HAWK_NULL on failure. + */ +HAWK_EXPORT hawk_htb_pair_t* hawk_htb_upsert ( + hawk_htb_t* htb, /**< hash table */ + void* kptr, /**< key pointer */ + hawk_oow_t klen, /**< key length */ + void* vptr, /**< value pointer */ + hawk_oow_t vlen /**< value length */ +); + +/** + * The hawk_htb_ensert() function inserts a new pair with the key and the value + * given. If there exists a pair with the key given, the function returns + * the pair containing the key. + * @return pointer to a pair on success, #HAWK_NULL on failure. + */ +HAWK_EXPORT hawk_htb_pair_t* hawk_htb_ensert ( + hawk_htb_t* htb, /**< hash table */ + void* kptr, /**< key pointer */ + hawk_oow_t klen, /**< key length */ + void* vptr, /**< value pointer */ + hawk_oow_t vlen /**< value length */ +); + +/** + * The hawk_htb_insert() function inserts a new pair with the key and the value + * given. If there exists a pair with the key given, the function returns + * #HAWK_NULL without channging the value. + * @return pointer to the pair created on success, #HAWK_NULL on failure. + */ +HAWK_EXPORT hawk_htb_pair_t* hawk_htb_insert ( + hawk_htb_t* htb, /**< hash table */ + void* kptr, /**< key pointer */ + hawk_oow_t klen, /**< key length */ + void* vptr, /**< value pointer */ + hawk_oow_t vlen /**< value length */ +); + +/** + * The hawk_htb_update() function updates the value of an existing pair + * with a matching key. + * @return pointer to the pair on success, #HAWK_NULL on no matching pair + */ +HAWK_EXPORT hawk_htb_pair_t* hawk_htb_update ( + hawk_htb_t* htb, /**< hash table */ + void* kptr, /**< key pointer */ + hawk_oow_t klen, /**< key length */ + void* vptr, /**< value pointer */ + hawk_oow_t vlen /**< value length */ +); + +/** + * The hawk_htb_cbsert() function inserts a key/value pair by delegating pair + * allocation to a callback function. Depending on the callback function, + * it may behave like hawk_htb_insert(), hawk_htb_upsert(), hawk_htb_update(), + * hawk_htb_ensert(), or totally differently. The sample code below inserts + * a new pair if the key is not found and appends the new value to the + * existing value delimited by a comma if the key is found. + * + * @code + * #include + * + * hawk_htb_walk_t print_map_pair (hawk_htb_t* map, hawk_htb_pair_t* pair, void* ctx) + * { + * hawk_printf (HAWK_T("%.*s[%d] => %.*s[%d]\n"), + * (int)HAWK_HTB_KLEN(pair), HAWK_HTB_KPTR(pair), (int)HAWK_HTB_KLEN(pair), + * (int)HAWK_HTB_VLEN(pair), HAWK_HTB_VPTR(pair), (int)HAWK_HTB_VLEN(pair)); + * return HAWK_HTB_WALK_FORWARD; + * } + * + * hawk_htb_pair_t* cbserter ( + * hawk_htb_t* htb, hawk_htb_pair_t* pair, + * void* kptr, hawk_oow_t klen, void* ctx) + * { + * hawk_cstr_t* v = (hawk_cstr_t*)ctx; + * if (pair == HAWK_NULL) + * { + * // no existing key for the key + * return hawk_htb_allocpair (htb, kptr, klen, v->ptr, v->len); + * } + * else + * { + * // a pair with the key exists. + * // in this sample, i will append the new value to the old value + * // separated by a comma + * hawk_htb_pair_t* new_pair; + * hawk_ooch_t comma = HAWK_T(','); + * hawk_uint8_t* vptr; + * + * // allocate a new pair, but without filling the actual value. + * // note vptr is given HAWK_NULL for that purpose + * new_pair = hawk_htb_allocpair ( + * htb, kptr, klen, HAWK_NULL, HAWK_HTB_VLEN(pair) + 1 + v->len); + * if (new_pair == HAWK_NULL) return HAWK_NULL; + * + * // fill in the value space + * vptr = HAWK_HTB_VPTR(new_pair); + * hawk_memcpy (vptr, HAWK_HTB_VPTR(pair), HAWK_HTB_VLEN(pair)*HAWK_SIZEOF(hawk_ooch_t)); + * vptr += HAWK_HTB_VLEN(pair)*HAWK_SIZEOF(hawk_ooch_t); + * hawk_memcpy (vptr, &comma, HAWK_SIZEOF(hawk_ooch_t)); + * vptr += HAWK_SIZEOF(hawk_ooch_t); + * hawk_memcpy (vptr, v->ptr, v->len*HAWK_SIZEOF(hawk_ooch_t)); + * + * // this callback requires the old pair to be destroyed + * hawk_htb_freepair (htb, pair); + * + * // return the new pair + * return new_pair; + * } + * } + * + * int main () + * { + * hawk_htb_t* s1; + * int i; + * hawk_ooch_t* keys[] = { HAWK_T("one"), HAWK_T("two"), HAWK_T("three") }; + * hawk_ooch_t* vals[] = { HAWK_T("1"), HAWK_T("2"), HAWK_T("3"), HAWK_T("4"), HAWK_T("5") }; + * + * hawk_open_stdsios (); + * s1 = hawk_htb_open ( + * HAWK_MMGR_GETDFL(), 0, 10, 70, + * HAWK_SIZEOF(hawk_ooch_t), HAWK_SIZEOF(hawk_ooch_t) + * ); // note error check is skipped + * hawk_htb_setstyle (s1, hawk_get_htb_style(HAWK_HTB_STYLE_INLINE_COPIERS)); + * + * for (i = 0; i < HAWK_COUNTOF(vals); i++) + * { + * hawk_cstr_t ctx; + * ctx.ptr = vals[i]; ctx.len = hawk_strlen(vals[i]); + * hawk_htb_cbsert (s1, + * keys[i%HAWK_COUNTOF(keys)], hawk_strlen(keys[i%HAWK_COUNTOF(keys)]), + * cbserter, &ctx + * ); // note error check is skipped + * } + * hawk_htb_walk (s1, print_map_pair, HAWK_NULL); + * + * hawk_htb_close (s1); + * hawk_close_stdsios (); + * return 0; + * } + * @endcode + */ +HAWK_EXPORT hawk_htb_pair_t* hawk_htb_cbsert ( + hawk_htb_t* htb, /**< hash table */ + void* kptr, /**< key pointer */ + hawk_oow_t klen, /**< key length */ + hawk_htb_cbserter_t cbserter, /**< callback function */ + void* ctx /**< callback context */ +); + +/** + * The hawk_htb_delete() function deletes a pair with a matching key + * @return 0 on success, -1 on failure + */ +HAWK_EXPORT int hawk_htb_delete ( + hawk_htb_t* htb, /**< hash table */ + const void* kptr, /**< key pointer */ + hawk_oow_t klen /**< key length */ +); + +/** + * The hawk_htb_clear() function empties a hash table + */ +HAWK_EXPORT void hawk_htb_clear ( + hawk_htb_t* htb /**< hash table */ +); + +/** + * The hawk_htb_walk() function traverses a hash table. + */ +HAWK_EXPORT void hawk_htb_walk ( + hawk_htb_t* htb, /**< hash table */ + hawk_htb_walker_t walker, /**< callback function for each pair */ + void* ctx /**< pointer to user-specific data */ +); + +/** + * The hawk_htb_getfirstpair() function returns the pointer to the first pair + * in a hash table. + */ +HAWK_EXPORT hawk_htb_pair_t* hawk_htb_getfirstpair ( + hawk_htb_t* htb, /**< hash table */ + hawk_oow_t* buckno /**< bucket number */ +); + +/** + * The hawk_htb_getnextpair() function returns the pointer to the next pair + * to the current pair @a pair in a hash table. + */ +HAWK_EXPORT hawk_htb_pair_t* hawk_htb_getnextpair ( + hawk_htb_t* htb, /**< hash table */ + hawk_htb_pair_t* pair, /**< current pair */ + hawk_oow_t* buckno /**< bucket number */ +); + +/** + * The hawk_htb_allocpair() function allocates a pair for a key and a value + * given. But it does not chain the pair allocated into the hash table @a htb. + * Use this function at your own risk. + * + * Take note of he following special behavior when the copier is + * #HAWK_HTB_COPIER_INLINE. + * - If @a kptr is #HAWK_NULL, the key space of the size @a klen is reserved but + * not propagated with any data. + * - If @a vptr is #HAWK_NULL, the value space of the size @a vlen is reserved + * but not propagated with any data. + */ +HAWK_EXPORT hawk_htb_pair_t* hawk_htb_allocpair ( + hawk_htb_t* htb, + void* kptr, + hawk_oow_t klen, + void* vptr, + hawk_oow_t vlen +); + +/** + * The hawk_htb_freepair() function destroys a pair. But it does not detach + * the pair destroyed from the hash table @a htb. Use this function at your + * own risk. + */ +HAWK_EXPORT void hawk_htb_freepair ( + hawk_htb_t* htb, + hawk_htb_pair_t* pair +); + +/** + * The hawk_htb_dflhash() function is a default hash function. + */ +HAWK_EXPORT hawk_oow_t hawk_htb_dflhash ( + const hawk_htb_t* htb, + const void* kptr, + hawk_oow_t klen +); + +/** + * The hawk_htb_dflcomp() function is default comparator. + */ +HAWK_EXPORT int hawk_htb_dflcomp ( + const hawk_htb_t* htb, + const void* kptr1, + hawk_oow_t klen1, + const void* kptr2, + hawk_oow_t klen2 +); + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/hawk/lib/hawk-mtx.h b/hawk/lib/hawk-mtx.h new file mode 100644 index 00000000..6ca8411e --- /dev/null +++ b/hawk/lib/hawk-mtx.h @@ -0,0 +1,134 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EQSERESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#ifndef _HAWK_BTX_H_ +#define _HAWK_BTX_H_ + +#include + +typedef struct hawk_mtx_t hawk_mtx_t; + +#if defined(_WIN32) + /* => typedef PVOID HANDLE; */ + typedef void* hawk_mtx_hnd_t; + +#elif defined(__OS2__) + + /* typdef unsigned long ULONG; + * typedef ULONG HMTX; */ + typedef unsigned long hawk_mtx_hnd_t; + +#elif defined(__DOS__) + /* not implemented */ +# error not implemented + +#elif defined(__BEOS__) + /* typedef int32 sem_id; + * typedef sem_id hawk_mtx_hnd_t; */ + typdef hawk_int32_t hawk_mtx_hnd_t; + +#else + +# if (HAWK_SIZEOF_PTHREAD_MUTEX_T == 0) +# error unsupported + +# elif (HAWK_SIZEOF_PTHREAD_MUTEX_T == HAWK_SIZEOF_INT) +# if defined(HAWK_PTHREAD_MUTEX_T_IS_SIGNED) + typedef int hawk_mtx_hnd_t; +# else + typedef unsigned int hawk_mtx_hnd_t; +# endif +# elif (HAWK_SIZEOF_PTHREAD_MUTEX_T == HAWK_SIZEOF_LONG) +# if defined(HAWK_PTHREAD_MUTEX_T_IS_SIGNED) + typedef long hawk_mtx_hnd_t; +# else + typedef unsigned long hawk_mtx_hnd_t; +# endif +# else +# include + struct hawk_mtx_hnd_t + { + hawk_uint8_t b[HAWK_SIZEOF_PTHREAD_MUTEX_T]; + }; + typedef struct hawk_mtx_hnd_t hawk_mtx_hnd_t; +# include +# endif + +#endif + +struct hawk_mtx_t +{ + hawk_t* hawk; + hawk_mtx_hnd_t hnd; +}; + +#ifdef __cplusplus +extern "C" { +#endif + +HAWK_EXPORT hawk_mtx_t* hawk_mtx_open ( + hawk_t* hawk, + hawk_oow_t xtnsize +); + +HAWK_EXPORT void hawk_mtx_close ( + hawk_mtx_t* mtx +); + +HAWK_EXPORT int hawk_mtx_init ( + hawk_mtx_t* mtx, + hawk_t* hawk +); + +HAWK_EXPORT void hawk_mtx_fini ( + hawk_mtx_t* mtx +); + +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE void* hawk_mtx_getxtn (hawk_mtx_t* mtx) { return (void*)(mtx + 1); } +#else +#define hawk_mtx_getxtn(awk) ((void*)((hawk_mtx_t*)(mtx) + 1)) +#endif + +HAWK_EXPORT int hawk_mtx_lock ( + hawk_mtx_t* mtx, + const hawk_ntime_t* waiting_time +); + +HAWK_EXPORT int hawk_mtx_unlock ( + hawk_mtx_t* mtx +); + +HAWK_EXPORT int hawk_mtx_trylock ( + hawk_mtx_t* mtx +); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/hawk/lib/hawk-pack1.h b/hawk/lib/hawk-pack1.h new file mode 100644 index 00000000..dbe29480 --- /dev/null +++ b/hawk/lib/hawk-pack1.h @@ -0,0 +1,37 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#if defined(__GNUC__) +# pragma pack(1) +#elif defined(__HP_aCC) || defined(__HP_cc) +# pragma PACK 1 +#elif defined(_MSC_VER) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0500)) +# pragma pack(push,1) +#elif defined(__DECC) +# pragma pack(push,1) +#else +# pragma pack(1) +#endif diff --git a/hawk/lib/hawk-pio.h b/hawk/lib/hawk-pio.h new file mode 100644 index 00000000..7967ed3d --- /dev/null +++ b/hawk/lib/hawk-pio.h @@ -0,0 +1,427 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_PIO_H_ +#define _HAWK_PIO_H_ + +#include +#include + +/** \file + * This file defines a piped interface to a child process. You can execute + * a child process, read and write to its stdin, stdout, stderr, and terminate + * it. It provides more advanced interface than popen() and pclose(). + */ + +/** + * The hawk_pio_flag_t defines enumerators to compose flags to hawk_pio_open(). + */ +enum hawk_pio_flag_t +{ + /** enable text based I/O. */ + HAWK_PIO_TEXT = (1 << 0), + HAWK_PIO_IGNOREECERR = (1 << 1), + HAWK_PIO_NOAUTOFLUSH = (1 << 2), + + /** execute the command via a system shell + * (/bin/sh on unix/linux, cmd.exe on windows and os2) */ + HAWK_PIO_SHELL = (1 << 3), + + /** indicate that the command to hawk_pio_open() is a multi-byte string. + * it is useful if #HAWK_OOCH_IS_UCH is defined. */ + HAWK_PIO_MBSCMD = (1 << 4), + + /** don't attempt to close open file descriptors unknown to pio. + * it is useful only on a unix-like systems where file descriptors + * not set with FD_CLOEXEC are inherited by a child process. + * you're advised to set this option if all normal file descriptors + * in your application are open with FD_CLOEXEC set. it can skip + * checking a bunch of file descriptors and arranging to close + * them to prevent inheritance. */ + HAWK_PIO_NOCLOEXEC = (1 << 5), + + /** indidate that the command to hawk_pio_open()/hawk_pio_init() is + * a pointer to a #hawk_pio_fnc_t structure. supported on unix/linux + * only */ + HAWK_PIO_FNCCMD = (1 << 6), + + /** write to stdin of a child process */ + HAWK_PIO_WRITEIN = (1 << 8), + /** read stdout of a child process */ + HAWK_PIO_READOUT = (1 << 9), + /** read stderr of a child process */ + HAWK_PIO_READERR = (1 << 10), + + /** redirect stderr to stdout (2>&1, require #HAWK_PIO_READOUT) */ + HAWK_PIO_ERRTOOUT = (1 << 11), + /** redirect stdout to stderr (1>&2, require #HAWK_PIO_READERR) */ + HAWK_PIO_OUTTOERR = (1 << 12), + + /** redirect stdin to the null device (/dev/null, >NUL) */ + HAWK_PIO_ERRTONUL = (1 << 14), + /** redirect stderr to the null device (2>/dev/null, 2>NUL) */ + HAWK_PIO_OUTTONUL = (1 << 15), + + /** drop stdin */ + HAWK_PIO_DROPIN = (1 << 16), + /** drop stdout */ + HAWK_PIO_DROPOUT = (1 << 17), + /** drop stderr */ + HAWK_PIO_DROPERR = (1 << 18), + + /** do not reread if read has been interrupted */ + HAWK_PIO_READNORETRY = (1 << 21), + /** do not rewrite if write has been interrupted */ + HAWK_PIO_WRITENORETRY = (1 << 22), + /** return immediately from hawk_pio_wait() if a child has not exited */ + HAWK_PIO_WAITNOBLOCK = (1 << 23), + /** do not wait again if waitpid has been interrupted */ + HAWK_PIO_WAITNORETRY = (1 << 24), + + /** put stdin to non-blocking mode (only on supported platforms) */ + HAWK_PIO_INNOBLOCK = (1 << 25), + /** put stdout to non-blocking mode (only on supported platforms)*/ + HAWK_PIO_OUTNOBLOCK = (1 << 26), + /** put stderr to non-blocking mode (only on supported platforms) */ + HAWK_PIO_ERRNOBLOCK = (1 << 27) +}; + +/** + * The hawk_pio_hid_t type defines pipe IDs established to a child process. + */ +enum hawk_pio_hid_t +{ + HAWK_PIO_IN = 0, /**< stdin of a child process */ + HAWK_PIO_OUT = 1, /**< stdout of a child process */ + HAWK_PIO_ERR = 2 /**< stderr of a child process */ +}; +typedef enum hawk_pio_hid_t hawk_pio_hid_t; + + +typedef int (*hawk_pio_fncptr_t) (void* ctx); + +/** + * The hawk_pio_fnc_t type defines a structure to point to the function + * executed in a child process when #HAWK_PIO_FNCCMD is specified. + */ +typedef struct hawk_pio_fnc_t hawk_pio_fnc_t; +struct hawk_pio_fnc_t +{ + hawk_pio_fncptr_t ptr; + void* ctx; +}; + +/** + * The hawk_pio_errnum_t type defines error numbers. + */ +enum hawk_pio_errnum_t +{ + HAWK_PIO_ENOERR = 0, /**< no error */ + HAWK_PIO_EOTHER, /**< unknown error */ + HAWK_PIO_ENOIMPL, /**< not implemented */ + HAWK_PIO_ESYSERR, /**< subsystem error */ + HAWK_PIO_EINTERN, /**< internal error */ + + HAWK_PIO_ENOMEM, /**< out of memory */ + HAWK_PIO_EINVAL, /**< invalid parameter */ + HAWK_PIO_EACCES, /**< access denied */ + HAWK_PIO_EPERM, /**< operation not permitted */ + HAWK_PIO_ENOENT, /**< no such file */ + HAWK_PIO_EEXIST, /**< already exist */ + HAWK_PIO_ENOTDIR, /**< not a directory */ + HAWK_PIO_EINTR, /**< interrupted */ + HAWK_PIO_EPIPE, /**< broken pipe */ + HAWK_PIO_EINPROG, /**< in progress */ + HAWK_PIO_EAGAIN, /**< resource not available temporarily */ + + HAWK_PIO_ENOHND, /**< no handle available */ + HAWK_PIO_ECHILD, /**< the child is not valid */ + HAWK_PIO_EILSEQ, /**< illegal sequence */ + HAWK_PIO_EICSEQ, /**< incomplete sequence */ + HAWK_PIO_EILCHR /**< illegal character */ +}; +typedef enum hawk_pio_errnum_t hawk_pio_errnum_t; + +#if defined(_WIN32) + /* => typedef PVOID HANDLE; */ + typedef void* hawk_pio_hnd_t; /**< defines a pipe handle type */ + typedef void* hawk_pio_pid_t; /**< defines a process handle type */ +# define HAWK_PIO_HND_NIL ((hawk_pio_hnd_t)HAWK_NULL) +# define HAWK_PIO_PID_NIL ((hawk_pio_pid_t)HAWK_NULL) +#elif defined(__OS2__) + /* => typedef LHANDLE HFILE; + typedef LHANDLE PID; + typedef unsigned long LHANDLE; */ + typedef unsigned long hawk_pio_hnd_t; /**< defines a pipe handle type */ + typedef unsigned long hawk_pio_pid_t; /**< defined a process handle type */ +# define HAWK_PIO_HND_NIL ((hawk_pio_hnd_t)-1) +# define HAWK_PIO_PID_NIL ((hawk_pio_pid_t)-1) +#elif defined(__DOS__) + typedef int hawk_pio_hnd_t; /**< defines a pipe handle type */ + typedef int hawk_pio_pid_t; /**< defines a process handle type */ +# define HAWK_PIO_HND_NIL ((hawk_pio_hnd_t)-1) +# define HAWK_PIO_PID_NIL ((hawk_pio_pid_t)-1) +#else + typedef int hawk_pio_hnd_t; /**< defines a pipe handle type */ + typedef int hawk_pio_pid_t; /**< defines a process handle type */ +# define HAWK_PIO_HND_NIL ((hawk_pio_hnd_t)-1) +# define HAWK_PIO_PID_NIL ((hawk_pio_pid_t)-1) +#endif + +typedef struct hawk_pio_t hawk_pio_t; +typedef struct hawk_pio_pin_t hawk_pio_pin_t; + +struct hawk_pio_pin_t +{ + hawk_pio_hnd_t handle; + hawk_tio_t* tio; + hawk_pio_t* self; +}; + + +/** + * The hawk_pio_t type defines a structure to store status for piped I/O + * to a child process. The hawk_pio_xxx() funtions are written around this + * type. Do not change the value of each field directly. + */ +struct hawk_pio_t +{ + hawk_t* hawk; + int flags; /**< options */ + hawk_pio_errnum_t errnum; /**< error number */ + hawk_pio_pid_t child; /**< handle to a child process */ + hawk_pio_pin_t pin[3]; +}; + +/** access the \a errnum field of the #hawk_pio_t structure */ +#define HAWK_PIO_ERRNUM(pio) ((pio)->errnum) +/** access the \a child field of the #hawk_pio_t structure */ +#define HAWK_PIO_CHILD(pio) ((pio)->child) +/** get the native handle from the #hawk_pio_t structure */ +#define HAWK_PIO_HANDLE(pio,hid) ((pio)->pin[hid].handle) + +#if defined(__cplusplus) +extern "C" { +#endif + +/** + * The hawk_pio_open() function executes a command \a cmd and establishes + * pipes to it. #HAWK_PIO_SHELL causes the function to execute \a cmd via + * the default shell of an underlying system: /bin/sh on *nix, cmd.exe on win32. + * On *nix systems, a full path to the command is needed if it is not specified. + * If \a env is #HAWK_NULL, the environment of \a cmd inherits that of the + * calling process. If you want to pass an empty environment, you can pass + * an empty \a env object with no items inserted. If #HAWK_PIO_MBSCMD is + * specified in \a flags, \a cmd is treated as a multi-byte string whose + * character type is #hawk_bch_t. + * \return #hawk_pio_t object on success, #HAWK_NULL on failure + */ +HAWK_EXPORT hawk_pio_t* hawk_pio_open ( + hawk_t* hawk, /**< hawk */ + hawk_oow_t ext, /**< extension size */ + const hawk_ooch_t* cmd, /**< command to execute */ + int flags /**< 0 or a number OR'ed of the + #hawk_pio_flag_t enumerators*/ +); + +/** + * The hawk_pio_close() function closes pipes to a child process and waits for + * the child process to exit. + */ +HAWK_EXPORT void hawk_pio_close ( + hawk_pio_t* pio /**< pio object */ +); + +/** + * The hawk_pio_init() functions performs the same task as the hawk_pio_open() + * except that you need to allocate a #hawk_pio_t structure and pass it to the + * function. + * \return 0 on success, -1 on failure + */ +HAWK_EXPORT int hawk_pio_init ( + hawk_pio_t* pio, /**< pio object */ + hawk_t* hawk, /**< hawk */ + const hawk_ooch_t* cmd, /**< command to execute */ + int flags /**< 0 or a number OR'ed of the + #hawk_pio_flag_t enumerators*/ +); + +/** + * The hawk_pio_fini() function performs the same task as hawk_pio_close() + * except that it does not destroy a #hawk_pio_t structure pointed to by \a pio. + */ +HAWK_EXPORT void hawk_pio_fini ( + hawk_pio_t* pio /**< pio object */ +); + +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE void* hawk_pio_getxtn (hawk_pio_t* pio) { return (void*)(pio + 1); } +#else +#define hawk_pio_getxtn(awk) ((void*)((hawk_pio_t*)(pio) + 1)) +#endif + +/** + * The hawk_pio_geterrnum() function returns the number of the last error + * occurred. + * \return error number + */ +HAWK_EXPORT hawk_pio_errnum_t hawk_pio_geterrnum ( + const hawk_pio_t* pio /**< pio object */ +); + +/** + * The hawk_pio_getcmgr() function returns the current character manager. + * It returns #HAWK_NULL is \a pio is not opened with #HAWK_PIO_TEXT. + */ +HAWK_EXPORT hawk_cmgr_t* hawk_pio_getcmgr ( + hawk_pio_t* pio, + hawk_pio_hid_t hid +); + +/** + * The hawk_pio_setcmgr() function changes the character manager to \a cmgr. + * The character manager is used only if \a pio is opened with #HAWK_PIO_TEXT. + */ +HAWK_EXPORT void hawk_pio_setcmgr ( + hawk_pio_t* pio, + hawk_pio_hid_t hid, + hawk_cmgr_t* cmgr +); + +/** + * The hawk_pio_gethnd() function gets a pipe handle. + * \return pipe handle + */ +HAWK_EXPORT hawk_pio_hnd_t hawk_pio_gethnd ( + const hawk_pio_t* pio, /**< pio object */ + hawk_pio_hid_t hid /**< handle ID */ +); + +/** + * The hawk_pio_getchild() function gets a process handle. + * \return process handle + */ +HAWK_EXPORT hawk_pio_pid_t hawk_pio_getchild ( + const hawk_pio_t* pio /**< pio object */ +); + +/** + * The hawk_pio_read() fucntion reads at most \a size bytes/characters + * and stores them to the buffer pointed to by \a buf. + * \return -1 on failure, 0 on EOF, data length read on success + */ +HAWK_EXPORT hawk_ooi_t hawk_pio_read ( + hawk_pio_t* pio, /**< pio object */ + hawk_pio_hid_t hid, /**< handle ID */ + void* buf, /**< buffer to fill */ + hawk_oow_t size /**< buffer size */ +); + +/** + * The hawk_pio_write() function writes up \a size bytes/characters + * from the buffer pointed to by \a data. If #HAWK_PIO_TEXT is used + * and the \a size parameter is (hawk_oow_t)-1, the function treats + * the \a data parameter as a pointer to a null-terminated string. + * (hawk_oow_t)-1 into \a size is not treated specially if #HAWK_PIO_TEXT + * is not set. + * + * \return -1 on failure, data length written on success + */ +HAWK_EXPORT hawk_ooi_t hawk_pio_write ( + hawk_pio_t* pio, /**< pio object */ + hawk_pio_hid_t hid, /**< handle ID */ + const void* data, /**< data to write */ + hawk_oow_t size /**< data size */ +); + +HAWK_EXPORT hawk_ooi_t hawk_pio_writebytes ( + hawk_pio_t* pio, /**< pio object */ + hawk_pio_hid_t hid, /**< handle ID */ + const void* data, /**< data to write */ + hawk_oow_t size /**< data size */ +); + +/** + * The hawk_pio_flush() flushes buffered data if #HAWK_PIO_TEXT has been + * specified to hawk_pio_open() and hawk_pio_init(). + */ +HAWK_EXPORT hawk_ooi_t hawk_pio_flush ( + hawk_pio_t* pio, /**< pio object */ + hawk_pio_hid_t hid /**< handle ID */ +); + +/** + * The hawk_pio_drain() drops unflushed input and output data in the + * buffer. + */ +HAWK_EXPORT void hawk_pio_drain ( + hawk_pio_t* pio, /**< pio object */ + hawk_pio_hid_t hid /**< handle ID */ +); + +/** + * The hawk_pio_end() function closes a pipe to a child process + */ +HAWK_EXPORT void hawk_pio_end ( + hawk_pio_t* pio, /**< pio object */ + hawk_pio_hid_t hid /**< handle ID */ +); + +/** + * The hawk_pio_wait() function waits for a child process to terminate. + * #HAWK_PIO_WAIT_NORETRY causes the function to return an error and set the + * \a pio->errnum field to #HAWK_PIO_EINTR if the underlying system call has + * been interrupted. If #HAWK_PIO_WAIT_NOBLOCK is used, the return value of 256 + * indicates that the child process has not terminated. Otherwise, 256 is never + * returned. + * + * \return + * -1 on error, 256 if the child is alive and #HAWK_PIO_WAIT_NOBLOCK is used, + * a number between 0 and 255 inclusive if the child process ends normally, + * 256 + signal number if the child process is terminated by a signal. + */ +HAWK_EXPORT int hawk_pio_wait ( + hawk_pio_t* pio /**< pio object */ +); + +/** + * The hawk_pio_kill() function terminates a child process by force. + * You should know the danger of calling this function as the function can + * kill a process that is not your child process if it has terminated but + * there is a new process with the same process handle. + * \return 0 on success, -1 on failure + */ +HAWK_EXPORT int hawk_pio_kill ( + hawk_pio_t* pio /**< pio object */ +); + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/hawk/lib/hawk-pma.h b/hawk/lib/hawk-pma.h new file mode 100644 index 00000000..877ccceb --- /dev/null +++ b/hawk/lib/hawk-pma.h @@ -0,0 +1,154 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + tre-mem.h - TRE memory allocator interface + + This software is released under a BSD-style license. + See the file LICENSE for details and copyright. + + */ + +#ifndef _HAWK_PMA_H_ +#define _HAWK_PMA_H_ + +/** @file + * This file defines a pool-based block allocator. + */ + +#include + +#define HAWK_PMA_BLOCK_SIZE 1024 + +typedef struct hawk_pma_blk_t hawk_pma_blk_t; + +struct hawk_pma_blk_t +{ + void *data; + hawk_pma_blk_t* next; +}; + +/** + * The hawk_pma_t type defines a pool-based block allocator. You can allocate + * blocks of memories but you can't resize or free individual blocks allocated. + * Instead, you can destroy the whole pool once you're done with all the + * blocks allocated. + */ +typedef struct hawk_pma_t hawk_pma_t; + +struct hawk_pma_t +{ + hawk_t* hawk; + + hawk_pma_blk_t* blocks; + hawk_pma_blk_t* current; + + char *ptr; + hawk_oow_t n; + int failed; +}; + +#if defined(__cplusplus) +extern "C" { +#endif + +/** + * The hawk_pma_open() function creates a pool-based memory allocator. + */ +HAWK_EXPORT hawk_pma_t* hawk_pma_open ( + hawk_t* hawk, /**< hawk */ + hawk_oow_t xtnsize /**< extension size in bytes */ +); + +/** + * The hawk_pma_close() function destroys a pool-based memory allocator. + */ +HAWK_EXPORT void hawk_pma_close ( + hawk_pma_t* pma /**< memory allocator */ +); + +HAWK_EXPORT int hawk_pma_init ( + hawk_pma_t* pma, /**< memory allocator */ + hawk_t* hawk /**< hawk */ +); + +HAWK_EXPORT void hawk_pma_fini ( + hawk_pma_t* pma /**< memory allocator */ +); + +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE void* hawk_pma_getxtn (hawk_pma_t* pma) { return (void*)(pma + 1); } +#else +#define hawk_pma_getxtn(awk) ((void*)((hawk_pma_t*)(pma) + 1)) +#endif + +/** + * The hawk_pma_clear() function frees all the allocated memory blocks + * by freeing the entire memory pool. + */ +HAWK_EXPORT void hawk_pma_clear ( + hawk_pma_t* pma /**< memory allocator */ +); + +/** + * The hawk_pma_alloc() function allocates a memory block of the @a size bytes. + * @return pointer to a allocated block on success, #HAWK_NULL on failure. + */ +HAWK_EXPORT void* hawk_pma_alloc ( + hawk_pma_t* pma, /**< memory allocator */ + hawk_oow_t size /**< block size */ +); + +/** + * The hawk_pma_alloc() function allocates a memory block of the @a size bytes + * and initializes the whole block with 0. + * @return pointer to a allocated block on success, #HAWK_NULL on failure. + */ +HAWK_EXPORT void* hawk_pma_calloc ( + hawk_pma_t* pma, /**< memory allocator */ + hawk_oow_t size /**< block size */ +); + +/** + * The hawk_pma_free() function is provided for completeness, and doesn't + * resize an individual block @a blk. + */ +HAWK_EXPORT void* hawk_pma_realloc ( + hawk_pma_t* pma, /**< memory allocator */ + void* blk, /**< memory block */ + hawk_oow_t size /**< new size in bytes */ +); + +/** + * The hawk_pma_free() function is provided for completeness, and doesn't + * free an individual block @a blk. + */ +HAWK_EXPORT void hawk_pma_free ( + hawk_pma_t* pma, /**< memory allocator */ + void* blk /**< memory block */ +); + +#endif diff --git a/hawk/lib/hawk-prv.h b/hawk/lib/hawk-prv.h new file mode 100644 index 00000000..73572f64 --- /dev/null +++ b/hawk/lib/hawk-prv.h @@ -0,0 +1,495 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_PRV_H_ +#define _HAWK_PRV_H_ + +#include +#include +#include +#include +#include +#include +#include + +typedef struct hawk_chain_t hawk_chain_t; +typedef struct hawk_tree_t hawk_tree_t; + +#include +#include "tree-prv.h" +#include "fnc-prv.h" +#include "parse-prv.h" +#include "run-prv.h" +#include "rio-prv.h" +#include "val-prv.h" +#include "err-prv.h" +#include "misc-prv.h" + +#define ENABLE_FEATURE_SCACHE +#define FEATURE_SCACHE_NUM_BLOCKS 16 +#define FEATURE_SCACHE_BLOCK_UNIT 16 +#define FEATURE_SCACHE_BLOCK_SIZE 128 + +/* [NOTE] the function value support implemented is very limited. + * it supports very primitive way to call a function via a variable. + * only user-defined functions are supported. neither builtin functions + * nor module functions are not supported yet. + * ----------------------------------------------------- + * function x(a,b,c) { print a, b, c; } + * BEGIN { q = x; q(1, 2, 3); } # this works + * BEGIN { q[1]=x; q[1](1,2,3); } # this doesn't work. same as q[1] %% (1, 2, 3) or q[1] %% 3 + * BEGIN { q[1]=x; y=q[1]; y(1,2,3); } # this works. + * ----------------------------------------------------- + * function __printer(a,b,c) { print a, b, c; } + * function show(printer, a,b,c) { printer(a, b, c); } + * BEGIN { show(__printer, 10, 20, 30); } ## passing the function value as an argumnet is ok. + */ +#define ENABLE_FEATURE_FUN_AS_VALUE + +#define HAWK_MAX_GBLS 9999 +#define HAWK_MAX_LCLS 9999 +#define HAWK_MAX_PARAMS 9999 + +#define HAWK_DFL_RTX_STACK_LIMIT 5120 +#define HAWK_MIN_RTX_STACK_LIMIT 512 +#if (HAWK_SIZEOF_VOID_P <= 4) +# define HAWK_MAX_RTX_STACK_LIMIT ((hawk_oow_t)1 << (HAWK_SIZEOF_VOID_P * 4 + 1)) +#else +# define HAWK_MAX_RTX_STACK_LIMIT ((hawk_oow_t)1 << (HAWK_SIZEOF_VOID_P * 4)) +#endif + +#define HAWK_BYTE_PRINTABLE(x) ((x) <= 0x7F && (x) != '\\' && hawk_is_bch_print(x)) + +#if defined(__has_builtin) + +# if (!__has_builtin(__builtin_memset) || !__has_builtin(__builtin_memcpy) || !__has_builtin(__builtin_memmove) || !__has_builtin(__builtin_memcmp)) +# include +# endif + +# if __has_builtin(__builtin_memset) +# define HAWK_MEMSET(dst,src,size) __builtin_memset(dst,src,size) +# else +# define HAWK_MEMSET(dst,src,size) memset(dst,src,size) +# endif +# if __has_builtin(__builtin_memcpy) +# define HAWK_MEMCPY(dst,src,size) __builtin_memcpy(dst,src,size) +# else +# define HAWK_MEMCPY(dst,src,size) memcpy(dst,src,size) +# endif +# if __has_builtin(__builtin_memmove) +# define HAWK_MEMMOVE(dst,src,size) __builtin_memmove(dst,src,size) +# else +# define HAWK_MEMMOVE(dst,src,size) memmove(dst,src,size) +# endif +# if __has_builtin(__builtin_memcmp) +# define HAWK_MEMCMP(dst,src,size) __builtin_memcmp(dst,src,size) +# else +# define HAWK_MEMCMP(dst,src,size) memcmp(dst,src,size) +# endif + +#else + +# if !defined(HAVE___BUILTIN_MEMSET) || !defined(HAVE___BUILTIN_MEMCPY) || !defined(HAVE___BUILTIN_MEMMOVE) || !defined(HAVE___BUILTIN_MEMCMP) +# include +# endif + +# if defined(HAVE___BUILTIN_MEMSET) +# define HAWK_MEMSET(dst,src,size) __builtin_memset(dst,src,size) +# else +# define HAWK_MEMSET(dst,src,size) memset(dst,src,size) +# endif +# if defined(HAVE___BUILTIN_MEMCPY) +# define HAWK_MEMCPY(dst,src,size) __builtin_memcpy(dst,src,size) +# else +# define HAWK_MEMCPY(dst,src,size) memcpy(dst,src,size) +# endif +# if defined(HAVE___BUILTIN_MEMMOVE) +# define HAWK_MEMMOVE(dst,src,size) __builtin_memmove(dst,src,size) +# else +# define HAWK_MEMMOVE(dst,src,size) memmove(dst,src,size) +# endif +# if defined(HAVE___BUILTIN_MEMCMP) +# define HAWK_MEMCMP(dst,src,size) __builtin_memcmp(dst,src,size) +# else +# define HAWK_MEMCMP(dst,src,size) memcmp(dst,src,size) +# endif + +#endif + +enum hawk_rio_type_t +{ + /* rio types available */ + HAWK_RIO_PIPE, + HAWK_RIO_FILE, + HAWK_RIO_CONSOLE, + + /* reserved for internal use only */ + HAWK_RIO_NUM +}; + +struct hawk_tree_t +{ + hawk_oow_t ngbls; /* total number of globals */ + hawk_oow_t ngbls_base; /* number of intrinsic globals */ + hawk_oocs_t cur_fun; + hawk_htb_t* funs; /* awk function map */ + + hawk_nde_t* begin; + hawk_nde_t* begin_tail; + + hawk_nde_t* end; + hawk_nde_t* end_tail; + + hawk_chain_t* chain; + hawk_chain_t* chain_tail; + hawk_oow_t chain_size; /* number of nodes in the chain */ + + int ok; +}; + +typedef struct hawk_tok_t hawk_tok_t; +struct hawk_tok_t +{ + int type; + hawk_ooecs_t* name; + hawk_loc_t loc; +}; + +struct hawk_t +{ + /* exposed fields via hawk_alt_t */ + HAWK_HDR; + + /* primitive functions */ + hawk_prm_t prm; + + /* options */ + struct + { + int trait; + hawk_oocs_t mod[2]; + hawk_oocs_t incldirs; + + union + { + hawk_oow_t a[7]; + struct + { + hawk_oow_t incl; + hawk_oow_t block_parse; + hawk_oow_t block_run; + hawk_oow_t expr_parse; + hawk_oow_t expr_run; + hawk_oow_t rex_build; + hawk_oow_t rex_match; + } s; + } depth; + + hawk_oow_t rtx_stack_limit; + } opt; + + /* parse tree */ + hawk_tree_t tree; + + /* temporary information that the parser needs */ + struct + { + struct + { + int block; + int loop; + int stmt; /* statement */ + } id; + + struct + { + hawk_oow_t block; + hawk_oow_t loop; + hawk_oow_t expr; /* expression */ + hawk_oow_t incl; + } depth; + + /* current pragma values */ + struct + { + int trait; + hawk_oow_t rtx_stack_limit; + } pragma; + + /* function calls */ + hawk_htb_t* funs; + + /* named variables */ + hawk_htb_t* named; + + /* global variables */ + hawk_arr_t* gbls; + + /* local variables */ + hawk_arr_t* lcls; + + /* parameters to a function */ + hawk_arr_t* params; + + /* maximum number of local variables */ + hawk_oow_t nlcls_max; + + /* some data to find if an expression is + * enclosed in parentheses or not. + * see parse_primary_lparen() and parse_print() in parse.c + */ + hawk_oow_t lparen_seq; + hawk_oow_t lparen_last_closed; + + struct + { + hawk_uint8_t* ptr; + hawk_oow_t count; + hawk_oow_t capa; + } incl_hist; + } parse; + + /* source code management */ + struct + { + hawk_sio_impl_t inf; + hawk_sio_impl_t outf; + + hawk_sio_lxc_t last; + + hawk_oow_t nungots; + hawk_sio_lxc_t ungot[5]; + + hawk_sio_arg_t arg; /* for the top level source */ + hawk_sio_arg_t* inp; /* current input argument. */ + } sio; + hawk_link_t* sio_names; + + /* previous token */ + hawk_tok_t ptok; + /* current token */ + hawk_tok_t tok; + /* look-ahead token */ + hawk_tok_t ntok; + + /* intrinsic functions */ + struct + { + hawk_fnc_t* sys; + hawk_htb_t* user; + } fnc; + + struct + { + hawk_ooch_t fmt[1024]; + } tmp; + + /* housekeeping */ + hawk_errstr_t errstr; + hawk_loc_t errloc; + hawk_oow_t errmsg_len; /* used by errbfmt() and errufmt(). don't rely on this. some other funtions don't set this properly */ + hawk_ooch_t errmsg_backup[HAWK_ERRMSG_CAPA]; +#if defined(HAWK_OOCH_IS_BCH) + hawk_uch_t uerrmsg[HAWK_ERRMSG_CAPA]; +#else + hawk_bch_t berrmsg[HAWK_ERRMSG_CAPA * 2]; +#endif + + int haltall; + hawk_ecb_t* ecb; + + hawk_rbt_t* modtab; +}; + +struct hawk_chain_t +{ + hawk_nde_t* pattern; + hawk_nde_t* action; + hawk_chain_t* next; +}; + +#define RTX_STACK_AT(rtx,n) ((rtx)->stack[(rtx)->stack_base+(n)]) +#define RTX_STACK_NARGS(rtx) RTX_STACK_AT(rtx,3) +#define RTX_STACK_ARG(rtx,n) RTX_STACK_AT(rtx,3+1+(n)) +#define RTX_STACK_LCL(rtx,n) RTX_STACK_AT(rtx,3+(hawk_oow_t)RTX_STACK_NARGS(rtx)+1+(n)) +#define RTX_STACK_RETVAL(rtx) RTX_STACK_AT(rtx,2) +#define RTX_STACK_GBL(rtx,n) ((rtx)->stack[(n)]) +#define RTX_STACK_RETVAL_GBL(rtx) ((rtx)->stack[(rtx)->awk->tree.ngbls+2]) + +struct hawk_rtx_t +{ + HAWK_RTX_HDR; + + hawk_htb_t* named; + + void** stack; + hawk_oow_t stack_top; + hawk_oow_t stack_base; + hawk_oow_t stack_limit; + int exit_level; + + hawk_val_ref_t* rcache[128]; + hawk_oow_t rcache_count; + +#if defined(ENABLE_FEATURE_SCACHE) + hawk_val_str_t* scache[FEATURE_SCACHE_NUM_BLOCKS][FEATURE_SCACHE_BLOCK_SIZE]; + hawk_oow_t scache_count[FEATURE_SCACHE_NUM_BLOCKS]; +#endif + + struct + { + hawk_val_int_t* ifree; + hawk_val_chunk_t* ichunk; + hawk_val_flt_t* rfree; + hawk_val_chunk_t* rchunk; + } vmgr; + + hawk_nde_blk_t* active_block; + hawk_uint8_t* pattern_range_state; + + struct + { + hawk_ooch_t buf[1024]; + hawk_oow_t buf_pos; + hawk_oow_t buf_len; + int eof; + + hawk_ooecs_t line; /* entire line */ + hawk_ooecs_t linew; /* line for manipulation, if necessary */ + hawk_ooecs_t lineg; /* line buffer for getline */ + + hawk_val_t* d0; /* $0 */ + + hawk_oow_t maxflds; + hawk_oow_t nflds; /* NF */ + struct + { + const hawk_ooch_t* ptr; + hawk_oow_t len; + hawk_val_t* val; /* $1 .. $NF */ + }* flds; + } inrec; + + hawk_nrflt_t nrflt; + + struct + { + void* rs[2]; + void* fs[2]; + int ignorecase; + int striprecspc; + + hawk_int_t nr; + hawk_int_t fnr; + + hawk_oocs_t convfmt; + hawk_oocs_t ofmt; + hawk_oocs_t ofs; + hawk_oocs_t ors; + hawk_oocs_t subsep; + } gbl; + + /* rio chain */ + struct + { + hawk_rio_impl_t handler[HAWK_RIO_NUM]; + hawk_rio_arg_t* chain; + } rio; + + struct + { + hawk_ooecs_t fmt; + hawk_ooecs_t out; + + struct + { + hawk_ooch_t* ptr; + hawk_oow_t len; /* length */ + hawk_oow_t inc; /* increment */ + } tmp; + } format; + + struct + { + hawk_becs_t fmt; + hawk_becs_t out; + + struct + { + hawk_bch_t* ptr; + hawk_oow_t len; /* length */ + hawk_oow_t inc; /* increment */ + } tmp; + } formatmbs; + + struct + { + hawk_oow_t block; + hawk_oow_t expr; /* expression */ + } depth; + + hawk_loc_t errloc; + hawk_oow_t errmsg_len; /* used by errbfmt() and errufmt(). don't rely on this. some other funtions don't set this properly */ + hawk_ooch_t errmsg_backup[HAWK_ERRMSG_CAPA]; +#if defined(HAWK_OOCH_IS_BCH) + hawk_uch_t uerrmsg[HAWK_ERRMSG_CAPA]; +#else + hawk_bch_t berrmsg[HAWK_ERRMSG_CAPA * 2]; +#endif + + hawk_rtx_ecb_t* ecb; +}; + +typedef struct hawk_mod_data_t hawk_mod_data_t; +struct hawk_mod_data_t +{ + void* handle; + hawk_mod_t mod; +}; + +#define HAWK_RTX_INIT_REF_VAL(refval, _id, _adr, _nrefs) \ + do { \ + (refval)->v_type = HAWK_VAL_REF; \ + (refval)->ref = (_nrefs); \ + (refval)->stat = 0; \ + (refval)->nstr = 0; \ + (refval)->fcb = 0; \ + (refval)->id = (_id); \ + (refval)->adr = (_adr); \ + } while(0); + +#if defined(__cplusplus) +extern "C" { +#endif + +int hawk_init (hawk_t* awk, hawk_mmgr_t* mmgr, hawk_cmgr_t* cmgr, const hawk_prm_t* prm); +void hawk_fini (hawk_t* awk); + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/hawk/lib/hawk-rbt.h b/hawk/lib/hawk-rbt.h new file mode 100644 index 00000000..1aa7767f --- /dev/null +++ b/hawk/lib/hawk-rbt.h @@ -0,0 +1,606 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_RBT_H_ +#define _HAWK_RBT_H_ + +#include + +/** \file + * This file provides a red-black tree encapsulated in the #hawk_rbt_t type that + * implements a self-balancing binary search tree.Its interface is very close + * to #hawk_htb_t. + * + * This sample code adds a series of keys and values and print them + * in descending key order. + * \code + * #include + * + * static hawk_rbt_walk_t walk (hawk_rbt_t* rbt, hawk_rbt_pair_t* pair, void* ctx) + * { + * hawk_printf (HAWK_T("key = %d, value = %d\n"), + * *(int*)HAWK_RBT_KPTR(pair), *(int*)HAWK_RBT_VPTR(pair)); + * return HAWK_RBT_WALK_FORWARD; + * } + * + * int main () + * { + * hawk_rbt_t* s1; + * int i; + * + * s1 = hawk_rbt_open (HAWK_MMGR_GETDFL(), 0, 1, 1); // error handling skipped + * hawk_rbt_setstyle (s1, hawk_get_rbt_style(HAWK_RBT_STYLE_INLINE_COPIERS)); + * + * for (i = 0; i < 20; i++) + * { + * int x = i * 20; + * hawk_rbt_insert (s1, &i, HAWK_SIZEOF(i), &x, HAWK_SIZEOF(x)); // eror handling skipped + * } + * + * hawk_rbt_rwalk (s1, walk, HAWK_NULL); + * + * hawk_rbt_close (s1); + * return 0; + * } + * \endcode + */ + +typedef struct hawk_rbt_t hawk_rbt_t; +typedef struct hawk_rbt_pair_t hawk_rbt_pair_t; + +/** + * The hawk_rbt_walk_t type defines values that the callback function can + * return to control hawk_rbt_walk() and hawk_rbt_rwalk(). + */ +enum hawk_rbt_walk_t +{ + HAWK_RBT_WALK_STOP = 0, + HAWK_RBT_WALK_FORWARD = 1 +}; +typedef enum hawk_rbt_walk_t hawk_rbt_walk_t; + +/** + * The hawk_rbt_id_t type defines IDs to indicate a key or a value in various + * functions + */ +enum hawk_rbt_id_t +{ + HAWK_RBT_KEY = 0, /**< indicate a key */ + HAWK_RBT_VAL = 1 /**< indicate a value */ +}; +typedef enum hawk_rbt_id_t hawk_rbt_id_t; + +/** + * The hawk_rbt_copier_t type defines a pair contruction callback. + */ +typedef void* (*hawk_rbt_copier_t) ( + hawk_rbt_t* rbt /**< red-black tree */, + void* dptr /**< pointer to a key or a value */, + hawk_oow_t dlen /**< length of a key or a value */ +); + +/** + * The hawk_rbt_freeer_t defines a key/value destruction callback. + */ +typedef void (*hawk_rbt_freeer_t) ( + hawk_rbt_t* rbt, /**< red-black tree */ + void* dptr, /**< pointer to a key or a value */ + hawk_oow_t dlen /**< length of a key or a value */ +); + +/** + * The hawk_rbt_comper_t type defines a key comparator that is called when + * the rbt needs to compare keys. A red-black tree is created with a default + * comparator which performs bitwise comparison of two keys. + * The comparator should return 0 if the keys are the same, 1 if the first + * key is greater than the second key, -1 otherwise. + */ +typedef int (*hawk_rbt_comper_t) ( + const hawk_rbt_t* rbt, /**< red-black tree */ + const void* kptr1, /**< key pointer */ + hawk_oow_t klen1, /**< key length */ + const void* kptr2, /**< key pointer */ + hawk_oow_t klen2 /**< key length */ +); + +/** + * The hawk_rbt_keeper_t type defines a value keeper that is called when + * a value is retained in the context that it should be destroyed because + * it is identical to a new value. Two values are identical if their + * pointers and lengths are equal. + */ +typedef void (*hawk_rbt_keeper_t) ( + hawk_rbt_t* rbt, /**< red-black tree */ + void* vptr, /**< value pointer */ + hawk_oow_t vlen /**< value length */ +); + +/** + * The hawk_rbt_walker_t defines a pair visitor. + */ +typedef hawk_rbt_walk_t (*hawk_rbt_walker_t) ( + hawk_rbt_t* rbt, /**< red-black tree */ + hawk_rbt_pair_t* pair, /**< pointer to a key/value pair */ + void* ctx /**< pointer to user-defined data */ +); + +/** + * The hawk_rbt_cbserter_t type defines a callback function for hawk_rbt_cbsert(). + * The hawk_rbt_cbserter() function calls it to allocate a new pair for the + * key pointed to by \a kptr of the length \a klen and the callback context + * \a ctx. The second parameter \a pair is passed the pointer to the existing + * pair for the key or #HAWK_NULL in case of no existing key. The callback + * must return a pointer to a new or a reallocated pair. When reallocating the + * existing pair, this callback must destroy the existing pair and return the + * newly reallocated pair. It must return #HAWK_NULL for failure. + */ +typedef hawk_rbt_pair_t* (*hawk_rbt_cbserter_t) ( + hawk_rbt_t* rbt, /**< red-black tree */ + hawk_rbt_pair_t* pair, /**< pair pointer */ + void* kptr, /**< key pointer */ + hawk_oow_t klen, /**< key length */ + void* ctx /**< callback context */ +); + +enum hawk_rbt_pair_color_t +{ + HAWK_RBT_RED, + HAWK_RBT_BLACK +}; +typedef enum hawk_rbt_pair_color_t hawk_rbt_pair_color_t; + +/** + * The hawk_rbt_pair_t type defines red-black tree pair. A pair is composed + * of a key and a value. It maintains pointers to the beginning of a key and + * a value plus their length. The length is scaled down with the scale factor + * specified in an owning tree. Use macros defined in the + */ +struct hawk_rbt_pair_t +{ + struct + { + void* ptr; + hawk_oow_t len; + } key; + + struct + { + void* ptr; + hawk_oow_t len; + } val; + + /* management information below */ + hawk_rbt_pair_color_t color; + hawk_rbt_pair_t* parent; + hawk_rbt_pair_t* child[2]; /* left and right */ +}; + +typedef struct hawk_rbt_style_t hawk_rbt_style_t; + +/** + * The hawk_rbt_style_t type defines callback function sets for key/value + * pair manipulation. + */ +struct hawk_rbt_style_t +{ + hawk_rbt_copier_t copier[2]; /**< key and value copier */ + hawk_rbt_freeer_t freeer[2]; /**< key and value freeer */ + hawk_rbt_comper_t comper; /**< key comparator */ + hawk_rbt_keeper_t keeper; /**< value keeper */ +}; + +/** + * The hawk_rbt_style_kind_t type defines the type of predefined + * callback set for pair manipulation. + */ +enum hawk_rbt_style_kind_t +{ + /** store the key and the value pointer */ + HAWK_RBT_STYLE_DEFAULT, + /** copy both key and value into the pair */ + HAWK_RBT_STYLE_INLINE_COPIERS, + /** copy the key into the pair but store the value pointer */ + HAWK_RBT_STYLE_INLINE_KEY_COPIER, + /** copy the value into the pair but store the key pointer */ + HAWK_RBT_STYLE_INLINE_VALUE_COPIER +}; + +typedef enum hawk_rbt_style_kind_t hawk_rbt_style_kind_t; + +/** + * The hawk_rbt_t type defines a red-black tree. + */ +struct hawk_rbt_t +{ + hawk_t* hawk; + const hawk_rbt_style_t* style; + hawk_oob_t scale[2]; /**< length scale */ + hawk_rbt_pair_t xnil; /**< internal nil node */ + hawk_oow_t size; /**< number of pairs */ + hawk_rbt_pair_t* root; /**< root pair */ +}; + +/** + * The HAWK_RBT_COPIER_SIMPLE macros defines a copier that remembers the + * pointer and length of data in a pair. + */ +#define HAWK_RBT_COPIER_SIMPLE ((hawk_rbt_copier_t)1) + +/** + * The HAWK_RBT_COPIER_INLINE macros defines a copier that copies data into + * a pair. + */ +#define HAWK_RBT_COPIER_INLINE ((hawk_rbt_copier_t)2) + +#define HAWK_RBT_COPIER_DEFAULT (HAWK_RBT_COPIER_SIMPLE) +#define HAWK_RBT_FREEER_DEFAULT (HAWK_NULL) +#define HAWK_RBT_COMPER_DEFAULT (hawk_rbt_dflcomp) +#define HAWK_RBT_KEEPER_DEFAULT (HAWK_NULL) + +/** + * The HAWK_RBT_SIZE() macro returns the number of pairs in red-black tree. + */ +#define HAWK_RBT_SIZE(m) ((const hawk_oow_t)(m)->size) +#define HAWK_RBT_KSCALE(m) ((const int)(m)->scale[HAWK_RBT_KEY]) +#define HAWK_RBT_VSCALE(m) ((const int)(m)->scale[HAWK_RBT_VAL]) + +#define HAWK_RBT_KPTL(p) (&(p)->key) +#define HAWK_RBT_VPTL(p) (&(p)->val) + +#define HAWK_RBT_KPTR(p) ((p)->key.ptr) +#define HAWK_RBT_KLEN(p) ((p)->key.len) +#define HAWK_RBT_VPTR(p) ((p)->val.ptr) +#define HAWK_RBT_VLEN(p) ((p)->val.len) + +#define HAWK_RBT_NEXT(p) ((p)->next) + +#if defined(__cplusplus) +extern "C" { +#endif + +/** + * The hawk_get_rbt_style() functions returns a predefined callback set for + * pair manipulation. + */ +HAWK_EXPORT const hawk_rbt_style_t* hawk_get_rbt_style ( + hawk_rbt_style_kind_t kind +); + +/** + * The hawk_rbt_open() function creates a red-black tree. + * \return hawk_rbt_t pointer on success, HAWK_NULL on failure. + */ +HAWK_EXPORT hawk_rbt_t* hawk_rbt_open ( + hawk_t* hawk, + hawk_oow_t xtnsize, /**< extension size in bytes */ + int kscale, /**< key scale */ + int vscale /**< value scale */ +); + +/** + * The hawk_rbt_close() function destroys a red-black tree. + */ +HAWK_EXPORT void hawk_rbt_close ( + hawk_rbt_t* rbt /**< red-black tree */ +); + +/** + * The hawk_rbt_init() function initializes a red-black tree + */ +HAWK_EXPORT int hawk_rbt_init ( + hawk_rbt_t* rbt, /**< red-black tree */ + hawk_t* hawk, + int kscale, /**< key scale */ + int vscale /**< value scale */ +); + +/** + * The hawk_rbt_fini() funtion finalizes a red-black tree + */ +HAWK_EXPORT void hawk_rbt_fini ( + hawk_rbt_t* rbt /**< red-black tree */ +); + +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE void* hawk_rbt_getxtn (hawk_rbt_t* rbt) { return (void*)(rbt + 1); } +#else +#define hawk_rbt_getxtn(awk) ((void*)((hawk_rbt_t*)(rbt) + 1)) +#endif + +/** + * The hawk_rbt_getstyle() function gets manipulation callback function set. + */ +HAWK_EXPORT const hawk_rbt_style_t* hawk_rbt_getstyle ( + const hawk_rbt_t* rbt /**< red-black tree */ +); + +/** + * The hawk_rbt_setstyle() function sets internal manipulation callback + * functions for data construction, destruction, comparison, etc. + * The callback structure pointed to by \a style must outlive the tree + * pointed to by \a htb as the tree doesn't copy the contents of the + * structure. + */ +HAWK_EXPORT void hawk_rbt_setstyle ( + hawk_rbt_t* rbt, /**< red-black tree */ + const hawk_rbt_style_t* style /**< callback function set */ +); + +/** + * The hawk_rbt_getsize() function gets the number of pairs in red-black tree. + */ +HAWK_EXPORT hawk_oow_t hawk_rbt_getsize ( + const hawk_rbt_t* rbt /**< red-black tree */ +); + +/** + * The hawk_rbt_search() function searches red-black tree to find a pair with a + * matching key. It returns the pointer to the pair found. If it fails + * to find one, it returns HAWK_NULL. + * \return pointer to the pair with a maching key, + * or HAWK_NULL if no match is found. + */ +HAWK_EXPORT hawk_rbt_pair_t* hawk_rbt_search ( + const hawk_rbt_t* rbt, /**< red-black tree */ + const void* kptr, /**< key pointer */ + hawk_oow_t klen /**< the size of the key */ +); + +/** + * The hawk_rbt_upsert() function searches red-black tree for the pair with a + * matching key. If one is found, it updates the pair. Otherwise, it inserts + * a new pair with the key and the value given. It returns the pointer to the + * pair updated or inserted. + * \return a pointer to the updated or inserted pair on success, + * HAWK_NULL on failure. + */ +HAWK_EXPORT hawk_rbt_pair_t* hawk_rbt_upsert ( + hawk_rbt_t* rbt, /**< red-black tree */ + void* kptr, /**< key pointer */ + hawk_oow_t klen, /**< key length */ + void* vptr, /**< value pointer */ + hawk_oow_t vlen /**< value length */ +); + +/** + * The hawk_rbt_ensert() function inserts a new pair with the key and the value + * given. If there exists a pair with the key given, the function returns + * the pair containing the key. + * \return pointer to a pair on success, HAWK_NULL on failure. + */ +HAWK_EXPORT hawk_rbt_pair_t* hawk_rbt_ensert ( + hawk_rbt_t* rbt, /**< red-black tree */ + void* kptr, /**< key pointer */ + hawk_oow_t klen, /**< key length */ + void* vptr, /**< value pointer */ + hawk_oow_t vlen /**< value length */ +); + +/** + * The hawk_rbt_insert() function inserts a new pair with the key and the value + * given. If there exists a pair with the key given, the function returns + * HAWK_NULL without channging the value. + * \return pointer to the pair created on success, HAWK_NULL on failure. + */ +HAWK_EXPORT hawk_rbt_pair_t* hawk_rbt_insert ( + hawk_rbt_t* rbt, /**< red-black tree */ + void* kptr, /**< key pointer */ + hawk_oow_t klen, /**< key length */ + void* vptr, /**< value pointer */ + hawk_oow_t vlen /**< value length */ +); + +/** + * The hawk_rbt_update() function updates the value of an existing pair + * with a matching key. + * \return pointer to the pair on success, HAWK_NULL on no matching pair + */ +HAWK_EXPORT hawk_rbt_pair_t* hawk_rbt_update ( + hawk_rbt_t* rbt, /**< red-black tree */ + void* kptr, /**< key pointer */ + hawk_oow_t klen, /**< key length */ + void* vptr, /**< value pointer */ + hawk_oow_t vlen /**< value length */ +); + +/** + * The hawk_rbt_cbsert() function inserts a key/value pair by delegating pair + * allocation to a callback function. Depending on the callback function, + * it may behave like hawk_rbt_insert(), hawk_rbt_upsert(), hawk_rbt_update(), + * hawk_rbt_ensert(), or totally differently. The sample code below inserts + * a new pair if the key is not found and appends the new value to the + * existing value delimited by a comma if the key is found. + * + * \code + * hawk_rbt_walk_t print_map_pair (hawk_rbt_t* map, hawk_rbt_pair_t* pair, void* ctx) + * { + * hawk_printf (HAWK_T("%.*s[%d] => %.*s[%d]\n"), + * (int)HAWK_RBT_KLEN(pair), HAWK_RBT_KPTR(pair), (int)HAWK_RBT_KLEN(pair), + * (int)HAWK_RBT_VLEN(pair), HAWK_RBT_VPTR(pair), (int)HAWK_RBT_VLEN(pair)); + * return HAWK_RBT_WALK_FORWARD; + * } + * + * hawk_rbt_pair_t* cbserter ( + * hawk_rbt_t* rbt, hawk_rbt_pair_t* pair, + * void* kptr, hawk_oow_t klen, void* ctx) + * { + * hawk_cstr_t* v = (hawk_cstr_t*)ctx; + * if (pair == HAWK_NULL) + * { + * // no existing key for the key + * return hawk_rbt_allocpair (rbt, kptr, klen, v->ptr, v->len); + * } + * else + * { + * // a pair with the key exists. + * // in this sample, i will append the new value to the old value + * // separated by a comma + * hawk_rbt_pair_t* new_pair; + * hawk_ooch_t comma = HAWK_T(','); + * hawk_oob_t* vptr; + * + * // allocate a new pair, but without filling the actual value. + * // note vptr is given HAWK_NULL for that purpose + * new_pair = hawk_rbt_allocpair ( + * rbt, kptr, klen, HAWK_NULL, pair->vlen + 1 + v->len); + * if (new_pair == HAWK_NULL) return HAWK_NULL; + * + * // fill in the value space + * vptr = new_pair->vptr; + * hawk_memcpy (vptr, pair->vptr, pair->vlen*HAWK_SIZEOF(hawk_ooch_t)); + * vptr += pair->vlen*HAWK_SIZEOF(hawk_ooch_t); + * hawk_memcpy (vptr, &comma, HAWK_SIZEOF(hawk_ooch_t)); + * vptr += HAWK_SIZEOF(hawk_ooch_t); + * hawk_memcpy (vptr, v->ptr, v->len*HAWK_SIZEOF(hawk_ooch_t)); + * + * // this callback requires the old pair to be destroyed + * hawk_rbt_freepair (rbt, pair); + * + * // return the new pair + * return new_pair; + * } + * } + * + * int main () + * { + * hawk_rbt_t* s1; + * int i; + * hawk_ooch_t* keys[] = { HAWK_T("one"), HAWK_T("two"), HAWK_T("three") }; + * hawk_ooch_t* vals[] = { HAWK_T("1"), HAWK_T("2"), HAWK_T("3"), HAWK_T("4"), HAWK_T("5") }; + * + * s1 = hawk_rbt_open ( + * HAWK_MMGR_GETDFL(), 0, + * HAWK_SIZEOF(hawk_ooch_t), HAWK_SIZEOF(hawk_ooch_t) + * ); // note error check is skipped + * hawk_rbt_setstyle (s1, &style1); + * + * for (i = 0; i < HAWK_COUNTOF(vals); i++) + * { + * hawk_cstr_t ctx; + * ctx.ptr = vals[i]; ctx.len = hawk_strlen(vals[i]); + * hawk_rbt_cbsert (s1, + * keys[i%HAWK_COUNTOF(keys)], hawk_strlen(keys[i%HAWK_COUNTOF(keys)]), + * cbserter, &ctx + * ); // note error check is skipped + * } + * hawk_rbt_walk (s1, print_map_pair, HAWK_NULL); + * + * hawk_rbt_close (s1); + * return 0; + * } + * \endcode + */ +HAWK_EXPORT hawk_rbt_pair_t* hawk_rbt_cbsert ( + hawk_rbt_t* rbt, /**< red-black tree */ + void* kptr, /**< key pointer */ + hawk_oow_t klen, /**< key length */ + hawk_rbt_cbserter_t cbserter, /**< callback function */ + void* ctx /**< callback context */ +); + +/** + * The hawk_rbt_delete() function deletes a pair with a matching key + * \return 0 on success, -1 on failure + */ +HAWK_EXPORT int hawk_rbt_delete ( + hawk_rbt_t* rbt, /**< red-black tree */ + const void* kptr, /**< key pointer */ + hawk_oow_t klen /**< key size */ +); + +/** + * The hawk_rbt_clear() function empties a red-black tree. + */ +HAWK_EXPORT void hawk_rbt_clear ( + hawk_rbt_t* rbt /**< red-black tree */ +); + +/** + * The hawk_rbt_walk() function traverses a red-black tree in preorder + * from the leftmost child. + */ +HAWK_EXPORT void hawk_rbt_walk ( + hawk_rbt_t* rbt, /**< red-black tree */ + hawk_rbt_walker_t walker, /**< callback function for each pair */ + void* ctx /**< pointer to user-specific data */ +); + +/** + * The hawk_rbt_walk() function traverses a red-black tree in preorder + * from the rightmost child. + */ +HAWK_EXPORT void hawk_rbt_rwalk ( + hawk_rbt_t* rbt, /**< red-black tree */ + hawk_rbt_walker_t walker, /**< callback function for each pair */ + void* ctx /**< pointer to user-specific data */ +); + +/** + * The hawk_rbt_allocpair() function allocates a pair for a key and a value + * given. But it does not chain the pair allocated into the red-black tree \a rbt. + * Use this function at your own risk. + * + * Take note of he following special behavior when the copier is + * #HAWK_RBT_COPIER_INLINE. + * - If \a kptr is #HAWK_NULL, the key space of the size \a klen is reserved but + * not propagated with any data. + * - If \a vptr is #HAWK_NULL, the value space of the size \a vlen is reserved + * but not propagated with any data. + */ +HAWK_EXPORT hawk_rbt_pair_t* hawk_rbt_allocpair ( + hawk_rbt_t* rbt, + void* kptr, + hawk_oow_t klen, + void* vptr, + hawk_oow_t vlen +); + +/** + * The hawk_rbt_freepair() function destroys a pair. But it does not detach + * the pair destroyed from the red-black tree \a rbt. Use this function at your + * own risk. + */ +HAWK_EXPORT void hawk_rbt_freepair ( + hawk_rbt_t* rbt, + hawk_rbt_pair_t* pair +); + +/** + * The hawk_rbt_dflcomp() function defines the default key comparator. + */ +HAWK_EXPORT int hawk_rbt_dflcomp ( + const hawk_rbt_t* rbt, + const void* kptr1, + hawk_oow_t klen1, + const void* kptr2, + hawk_oow_t klen2 +); + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/hawk/lib/hawk-sio.h b/hawk/lib/hawk-sio.h new file mode 100644 index 00000000..07f6d298 --- /dev/null +++ b/hawk/lib/hawk-sio.h @@ -0,0 +1,364 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_SIO_H_ +#define _HAWK_SIO_H_ + +#include +#include +#include +#include +#include + +enum hawk_sio_flag_t +{ + /* ensure that these enumerators never overlap with + * hawk_fio_flag_t enumerators. you can use values between + * (1<<0) and (1<<7) inclusive reserved in hawk_fio_flag_t. + * the range is represented by HAWK_FIO_RESERVED. */ + HAWK_SIO_LINEBREAK = (1 << 0), /* expand \n to a system line-break convention if necessary */ + HAWK_SIO_IGNOREECERR = (1 << 1), + HAWK_SIO_NOAUTOFLUSH = (1 << 2), + HAWK_SIO_KEEPPATH = (1 << 3), + HAWK_SIO_REENTRANT = (1 << 4), + + /* ensure that the following enumerators are one of + * hawk_fio_flags_t enumerators */ + HAWK_SIO_HANDLE = HAWK_FIO_HANDLE, + HAWK_SIO_NOCLOSE = HAWK_FIO_NOCLOSE, + HAWK_SIO_READ = HAWK_FIO_READ, + HAWK_SIO_WRITE = HAWK_FIO_WRITE, + HAWK_SIO_APPEND = HAWK_FIO_APPEND, + HAWK_SIO_CREATE = HAWK_FIO_CREATE, + HAWK_SIO_TRUNCATE = HAWK_FIO_TRUNCATE, + HAWK_SIO_EXCLUSIVE = HAWK_FIO_EXCLUSIVE, + HAWK_SIO_SYNC = HAWK_FIO_SYNC, + HAWK_SIO_NOFOLLOW = HAWK_FIO_NOFOLLOW, + HAWK_SIO_NOSHREAD = HAWK_FIO_NOSHREAD, + HAWK_SIO_NOSHWRITE = HAWK_FIO_NOSHWRITE, + HAWK_SIO_NOSHDELETE = HAWK_FIO_NOSHDELETE, + HAWK_SIO_RANDOM = HAWK_FIO_RANDOM, + HAWK_SIO_SEQUENTIAL = HAWK_FIO_SEQUENTIAL +}; + +enum hawk_sio_errnum_t +{ + HAWK_SIO_ENOERR = 0, /**< no error */ + HAWK_SIO_EOTHER, /**< other error */ + HAWK_SIO_ENOIMPL, /**< not implemented */ + HAWK_SIO_ESYSERR, /**< subsystem(system call) error */ + HAWK_SIO_EINTERN, /**< internal error */ + + HAWK_SIO_ENOMEM, /**< out of memory */ + HAWK_SIO_EINVAL, /**< invalid parameter */ + HAWK_SIO_EACCES, /**< access denied */ + HAWK_SIO_EPERM, /**< operation not permitted */ + HAWK_SIO_ENOENT, /**< no such file */ + HAWK_SIO_EEXIST, /**< already exist */ + HAWK_SIO_ENOTDIR, /**< not a directory */ + HAWK_SIO_EINTR, /**< interrupted */ + HAWK_SIO_EPIPE, /**< broken pipe */ + HAWK_SIO_EAGAIN, /**< resource not available temporarily */ + + HAWK_SIO_EILSEQ, /**< illegal sequence */ + HAWK_SIO_EICSEQ, /**< incomplete sequence */ + HAWK_SIO_EILCHR /**< illegal character */ +}; +typedef enum hawk_sio_errnum_t hawk_sio_errnum_t; + +typedef hawk_fio_off_t hawk_sio_pos_t; +typedef hawk_fio_hnd_t hawk_sio_hnd_t; +typedef hawk_fio_std_t hawk_sio_std_t; +typedef hawk_fio_ori_t hawk_sio_ori_t; + +#define HAWK_SIO_STDIN HAWK_FIO_STDIN +#define HAWK_SIO_STDOUT HAWK_FIO_STDOUT +#define HAWK_SIO_STDERR HAWK_FIO_STDERR + +#define HAWK_SIO_BEGIN HAWK_FIO_BEGIN +#define HAWK_SIO_CURRENT HAWK_FIO_CURRENT +#define HAWK_SIO_END HAWK_FIO_END + +/** + * The hawk_sio_t type defines a simple text stream over a file. It also + * provides predefined streams for standard input, output, and error. + */ +typedef struct hawk_sio_t hawk_sio_t; + +struct hawk_sio_t +{ + hawk_t* hawk; + hawk_sio_errnum_t errnum; + + hawk_fio_t file; + + struct + { + hawk_tio_t io; + hawk_sio_t* xtn; /* static extension for tio */ + } tio; + + hawk_bch_t inbuf[2048]; + hawk_bch_t outbuf[2048]; + + hawk_ooch_t* path; + hawk_mtx_t* mtx; + +#if defined(_WIN32) || defined(__OS2__) + int status; +#endif +}; + +/** access the @a errnum field of the #hawk_sio_t structure */ +#define HAWK_SIO_ERRNUM(sio) ((sio)->errnum) + +#if defined(__cplusplus) +extern "C" { +#endif + +/** + * The hawk_sio_open() fucntion creates a stream object. + */ +HAWK_EXPORT hawk_sio_t* hawk_sio_open ( + hawk_t* hawk, /**< memory manager */ + hawk_oow_t xtnsize, /**< extension size in bytes */ + const hawk_ooch_t* file, /**< file name */ + int flags /**< number OR'ed of #hawk_sio_flag_t */ +); + +HAWK_EXPORT hawk_sio_t* hawk_sio_openstd ( + hawk_t* hawk, /**< memory manager */ + hawk_oow_t xtnsize, /**< extension size in bytes */ + hawk_sio_std_t std, /**< standard I/O identifier */ + int flags /**< number OR'ed of #hawk_sio_flag_t */ +); + +/** + * The hawk_sio_close() function destroys a stream object. + */ +HAWK_EXPORT void hawk_sio_close ( + hawk_sio_t* sio /**< stream */ +); + +HAWK_EXPORT int hawk_sio_init ( + hawk_sio_t* sio, + hawk_t* hawk, + const hawk_ooch_t* file, + int flags +); + +HAWK_EXPORT int hawk_sio_initstd ( + hawk_sio_t* sio, + hawk_t* hawk, + hawk_sio_std_t std, + int flags +); + +HAWK_EXPORT void hawk_sio_fini ( + hawk_sio_t* sio +); + +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE void* hawk_sio_getxtn (hawk_sio_t* sio) { return (void*)(sio + 1); } +#else +#define hawk_sio_getxtn(awk) ((void*)((hawk_sio_t*)(sio) + 1)) +#endif + +HAWK_EXPORT hawk_sio_errnum_t hawk_sio_geterrnum ( + const hawk_sio_t* sio +); + +HAWK_EXPORT hawk_cmgr_t* hawk_sio_getcmgr ( + hawk_sio_t* sio +); + +HAWK_EXPORT void hawk_sio_setcmgr ( + hawk_sio_t* sio, + hawk_cmgr_t* cmgr +); + +HAWK_EXPORT hawk_sio_hnd_t hawk_sio_gethnd ( + const hawk_sio_t* sio +); + +/** + * The hawk_sio_getpath() returns the file path used to open the stream. + * It returns #HAWK_NULL if #HAWK_SIO_HANDLE was on or #HAWK_SIO_KEEPPATH + * was off at the time of opening. + */ +HAWK_EXPORT const hawk_ooch_t* hawk_sio_getpath ( + hawk_sio_t* sio +); + +HAWK_EXPORT hawk_ooi_t hawk_sio_flush ( + hawk_sio_t* sio +); + +/** + * The hawk_sio_drain() funtion purges all buffered data without writing. + */ +HAWK_EXPORT void hawk_sio_drain ( + hawk_sio_t* sio +); + +HAWK_EXPORT hawk_ooi_t hawk_sio_getbchar ( + hawk_sio_t* sio, + hawk_bch_t* c +); + +HAWK_EXPORT hawk_ooi_t hawk_sio_getuchar ( + hawk_sio_t* sio, + hawk_uch_t* c +); + +HAWK_EXPORT hawk_ooi_t hawk_sio_getbcstr ( + hawk_sio_t* sio, + hawk_bch_t* buf, + hawk_oow_t size +); + +HAWK_EXPORT hawk_ooi_t hawk_sio_getbchars ( + hawk_sio_t* sio, + hawk_bch_t* buf, + hawk_oow_t size +); + +/** + * The hawk_sio_getucstr() function reads at most @a size - 1 characters + * from the stream @a sio into the buffer @a buf. If a new line or EOF + * is encountered, it stops reading from the stream. It null-terminates + * the buffer if @a size is greater than 0. + */ +HAWK_EXPORT hawk_ooi_t hawk_sio_getucstr ( + hawk_sio_t* sio, + hawk_uch_t* buf, + hawk_oow_t size +); + +/** + * The hawk_sio_getuchars() function reads at most @a size characters + * from the stream @a sio into the buffer @a buf. If a new line or EOF + * is encountered, it stops reading from the stream. + */ +HAWK_EXPORT hawk_ooi_t hawk_sio_getuchars ( + hawk_sio_t* sio, + hawk_uch_t* buf, + hawk_oow_t size +); + +#if defined(HAWK_OOCH_IS_BCH) +# define hawk_sio_getoochar hawk_sio_getbchar +# define hawk_sio_getoocstr hawk_sio_getbcstr +# define hawk_sio_getoochars hawk_sio_getbchars +#else +# define hawk_sio_getoochar hawk_sio_getuchar +# define hawk_sio_getoocstr hawk_sio_getucstr +# define hawk_sio_getoochars hawk_sio_getuchars +#endif + +HAWK_EXPORT hawk_ooi_t hawk_sio_putbchar ( + hawk_sio_t* sio, + hawk_bch_t c +); + +HAWK_EXPORT hawk_ooi_t hawk_sio_putuchar ( + hawk_sio_t* sio, + hawk_uch_t c +); + +HAWK_EXPORT hawk_ooi_t hawk_sio_putbcstr ( + hawk_sio_t* sio, + const hawk_bch_t* str +); + +HAWK_EXPORT hawk_ooi_t hawk_sio_putucstr ( + hawk_sio_t* sio, + const hawk_uch_t* str +); + + +HAWK_EXPORT hawk_ooi_t hawk_sio_putbchars ( + hawk_sio_t* sio, + const hawk_bch_t* str, + hawk_oow_t size +); + +HAWK_EXPORT hawk_ooi_t hawk_sio_putuchars ( + hawk_sio_t* sio, + const hawk_uch_t* str, + hawk_oow_t size +); + +#if defined(HAWK_OOCH_IS_BCH) +# define hawk_sio_putoochar hawk_sio_putbchar +# define hawk_sio_putoocstr hawk_sio_putbcstr +# define hawk_sio_putoochars hawk_sio_putbchars +#else +# define hawk_sio_putoochar hawk_sio_putuchar +# define hawk_sio_putoocstr hawk_sio_putucstr +# define hawk_sio_putoochars hawk_sio_putuchars +#endif + +/** + * The hawk_sio_getpos() function gets the current position in a stream. + * Note that it may not return the desired postion due to buffering. + * @return 0 on success, -1 on failure + */ +HAWK_EXPORT int hawk_sio_getpos ( + hawk_sio_t* sio, /**< stream */ + hawk_sio_pos_t* pos /**< position */ +); + +/** + * The hawk_sio_setpos() function changes the current position in a stream. + * @return 0 on success, -1 on failure + */ +HAWK_EXPORT int hawk_sio_setpos ( + hawk_sio_t* sio, /**< stream */ + hawk_sio_pos_t pos /**< position */ +); + +HAWK_EXPORT int hawk_sio_truncate ( + hawk_sio_t* sio, + hawk_sio_pos_t pos +); + +/** + * The hawk_sio_seek() function repositions the current file offset. + * Upon success, \a pos is adjusted to the new offset from the beginning + * of the file. + */ +HAWK_EXPORT int hawk_sio_seek ( + hawk_sio_t* sio, + hawk_sio_pos_t* pos, + hawk_sio_ori_t origin +); + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/hawk/lib/hawk-std.h b/hawk/lib/hawk-std.h new file mode 100644 index 00000000..cb8866cf --- /dev/null +++ b/hawk/lib/hawk-std.h @@ -0,0 +1,228 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_STD_H_ +#define _HAWK_STD_H_ + +#include + +/** \file + * This file defines functions and data types that help you create + * an awk interpreter with less effort. It is designed to be as close + * to conventional awk implementations as possible. + * + * The source script handler does not evaluate a file name of the "var=val" + * form as an assignment expression. Instead, it just treats it as a + * normal file name. + */ + +/** + * The hawk_parsestd_type_t type defines standard source I/O types. + */ +enum hawk_parsestd_type_t +{ + HAWK_PARSESTD_NULL = 0, /**< pseudo-value to indicate no script */ + HAWK_PARSESTD_FILE = 1, /**< file path */ + HAWK_PARSESTD_FILEB = 2, /**< file path */ + HAWK_PARSESTD_FILEU = 3, /**< file path */ + HAWK_PARSESTD_OOCS = 4, /**< length-bounded string */ + HAWK_PARSESTD_BCS = 5, + HAWK_PARSESTD_UCS = 6 + +}; +typedef enum hawk_parsestd_type_t hawk_parsestd_type_t; + +/** + * The hawk_parsestd_t type defines a source I/O. + */ +struct hawk_parsestd_t +{ + hawk_parsestd_type_t type; + + union + { + struct + { + /** file path to open. #HAWK_NULL or '-' for stdin/stdout. */ + const hawk_ooch_t* path; + + /** a stream created with the file path is set with this + * cmgr if it is not #HAWK_NULL. */ + hawk_cmgr_t* cmgr; + } file; + + struct + { + /** file path to open. #HAWK_NULL or '-' for stdin/stdout. */ + const hawk_bch_t* path; + + /** a stream created with the file path is set with this + * cmgr if it is not #HAWK_NULL. */ + hawk_cmgr_t* cmgr; + } fileb; + + struct + { + /** file path to open. #HAWK_NULL or '-' for stdin/stdout. */ + const hawk_uch_t* path; + + /** a stream created with the file path is set with this + * cmgr if it is not #HAWK_NULL. */ + hawk_cmgr_t* cmgr; + } fileu; + + /** + * input string or dynamically allocated output string + * + * For input, the ptr and the len field of str indicates the + * pointer and the length of a string to read. You must set + * these fields before calling hawk_parsestd(). + * + * For output, the ptr and the len field of str indicates the + * pointer and the length of a deparsed source string. The output + * string is dynamically allocated. You don't need to set these + * fields before calling hawk_parsestd() because they are set + * by hawk_parsestd() and valid while the relevant awk object + * is alive. You must free the memory chunk pointed to by the + * ptr field with hawk_freemem() once you're done with it to + * avoid memory leaks. + */ + hawk_oocs_t oocs; + hawk_bcs_t bcs; + hawk_ucs_t ucs; + } u; +}; + +typedef struct hawk_parsestd_t hawk_parsestd_t; + +#if defined(__cplusplus) +extern "C" { +#endif + +/** + * The hawk_openstd() function creates an awk object using the default + * memory manager and primitive functions. Besides, it adds a set of + * standard intrinsic functions like atan, system, etc. Use this function + * over hawk_open() if you don't need finer-grained customization. + */ +HAWK_EXPORT hawk_t* hawk_openstd ( + hawk_oow_t xtnsize, /**< extension size in bytes */ + hawk_errnum_t* errnum /**< pointer to an error number variable */ +); + +/** + * The hawk_openstdwithmmgr() function creates an awk object with a + * user-defined memory manager. It is equivalent to hawk_openstd(), + * except that you can specify your own memory manager. + */ +HAWK_EXPORT hawk_t* hawk_openstdwithmmgr ( + hawk_mmgr_t* mmgr, /**< memory manager */ + hawk_oow_t xtnsize, /**< extension size in bytes */ + hawk_cmgr_t* cmgr, /**< character encoding manager */ + hawk_errnum_t* errnum /**< pointer to an error number variable */ +); + +/** + * The hawk_parsestd() functions parses source script. + * The code below shows how to parse a literal string 'BEGIN { print 10; }' + * and deparses it out to a buffer 'buf'. + * \code + * int n; + * hawk_parsestd_t in[2]; + * hawk_parsestd_t out; + * + * in[0].type = HAWK_PARSESTD_OOCS; + * in[0].u.str.ptr = HAWK_T("BEGIN { print 10; }"); + * in[0].u.str.len = hawk_strlen(in.u.str.ptr); + * in[1].type = HAWK_PARSESTD_NULL; + * out.type = HAWK_PARSESTD_OOCS; + * n = hawk_parsestd (awk, in, &out); + * if (n >= 0) + * { + * hawk_printf (HAWK_T("%s\n"), out.u.str.ptr); + * HAWK_MMGR_FREE (out.u.str.ptr); + * } + * \endcode + */ +HAWK_EXPORT int hawk_parsestd ( + hawk_t* awk, + hawk_parsestd_t in[], + hawk_parsestd_t* out +); + +/** + * The hawk_rtx_openstdwithbcstr() function creates a standard runtime context. + * The caller should keep the contents of \a icf and \a ocf valid throughout + * the lifetime of the runtime context created. The \a cmgr is set to the + * streams created with \a icf and \a ocf if it is not #HAWK_NULL. + */ +HAWK_EXPORT hawk_rtx_t* hawk_rtx_openstdwithbcstr ( + hawk_t* awk, + hawk_oow_t xtnsize, + const hawk_bch_t* id, + const hawk_bch_t* icf[], + const hawk_bch_t* ocf[], + hawk_cmgr_t* cmgr +); + +/** + * The hawk_rtx_openstdwithucstr() function creates a standard runtime context. + * The caller should keep the contents of \a icf and \a ocf valid throughout + * the lifetime of the runtime context created. The \a cmgr is set to the + * streams created with \a icf and \a ocf if it is not #HAWK_NULL. + */ +HAWK_EXPORT hawk_rtx_t* hawk_rtx_openstdwithucstr ( + hawk_t* awk, + hawk_oow_t xtnsize, + const hawk_uch_t* id, + const hawk_uch_t* icf[], + const hawk_uch_t* ocf[], + hawk_cmgr_t* cmgr +); + +#if defined(HAWK_OOCH_IS_BCH) +# define hawk_rtx_openstd hawk_rtx_openstdwithbcstr +#else +# define hawk_rtx_openstd hawk_rtx_openstdwithucstr +#endif + +/** + * The hawk_rtx_getiocmgrstd() function gets the current character + * manager associated with a particular I/O target indicated by the name + * \a ioname if #HAWK_OOCH_IS_UCH is defined. It always returns #HAWK_NULL + * if #HAWK_OOCH_IS_BCH is defined. + */ +HAWK_EXPORT hawk_cmgr_t* hawk_rtx_getiocmgrstd ( + hawk_rtx_t* rtx, + const hawk_ooch_t* ioname +); + +#if defined(__cplusplus) +} +#endif + + +#endif diff --git a/hawk/lib/hawk-tio.h b/hawk/lib/hawk-tio.h new file mode 100644 index 00000000..02c41125 --- /dev/null +++ b/hawk/lib/hawk-tio.h @@ -0,0 +1,316 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_TIO_H_ +#define _HAWK_TIO_H_ + +#include + +enum hawk_tio_errnum_t +{ + HAWK_TIO_ENOERR = 0, /**< no error */ + HAWK_TIO_EOTHER, /**< other error */ + HAWK_TIO_ENOIMPL, /**< not implmeneted */ + HAWK_TIO_ESYSERR, /**< subsystem error */ + HAWK_TIO_EINTERN, /**< internal error */ + + HAWK_TIO_ENOMEM, /**< out of memory */ + HAWK_TIO_EINVAL, /**< invalid parameter */ + HAWK_TIO_EACCES, /**< access denied */ + HAWK_TIO_EPERM, /**< operation not permitted */ + HAWK_TIO_ENOENT, /**< no such file */ + HAWK_TIO_ENOSPC, /**< no more space */ + HAWK_TIO_EILSEQ, /**< illegal sequence */ + HAWK_TIO_EICSEQ, /**< incomplete sequence */ + HAWK_TIO_EILCHR, /**< illegal character */ + HAWK_TIO_ENINPF, /**< no input function attached */ + HAWK_TIO_ENOUTF /**< no output function attached */ +}; + +typedef enum hawk_tio_errnum_t hawk_tio_errnum_t; + +enum hawk_tio_cmd_t +{ + HAWK_TIO_OPEN, + HAWK_TIO_CLOSE, + HAWK_TIO_DATA +}; +typedef enum hawk_tio_cmd_t hawk_tio_cmd_t; + +enum hawk_tio_flag_t +{ + /**< ignore multibyte/wide-character conversion error by + * inserting a question mark for each error occurrence */ + HAWK_TIO_IGNOREECERR = (1 << 0), + + /**< do not flush data in the buffer until the buffer gets full. */ + HAWK_TIO_NOAUTOFLUSH = (1 << 1) +}; + +enum hawk_tio_misc_t +{ + HAWK_TIO_MININBUFCAPA = 32, + HAWK_TIO_MINOUTBUFCAPA = 32 +}; + +#define HAWK_TIO_ERRNUM(tio) ((const hawk_tio_errnum_t)(tio)->errnum) + +typedef struct hawk_tio_t hawk_tio_t; + +/** + * The hawk_tio_io_impl_t types define a text I/O handler. + */ +typedef hawk_ooi_t (*hawk_tio_io_impl_t) ( + hawk_tio_t* tio, + hawk_tio_cmd_t cmd, + void* data, + hawk_oow_t size +); + +struct hawk_tio_io_t +{ + hawk_tio_io_impl_t fun; + struct + { + hawk_oow_t capa; + hawk_bch_t* ptr; + } buf; +}; + +typedef struct hawk_tio_io_t hawk_tio_io_t; + +/** + * The hawk_tio_t type defines a generic type for text IO. If #hawk_ooch_t is + * #hawk_bch_t, it handles any byte streams. If hawk_ooch_t is #hawk_uch_t, + * it handles a multi-byte stream converted to a wide character stream. + */ +struct hawk_tio_t +{ + hawk_t* hawk; + hawk_tio_errnum_t errnum; + int flags; + hawk_cmgr_t* cmgr; + + hawk_tio_io_t in; + hawk_tio_io_t out; + + /* for house keeping from here */ + int status; + hawk_oow_t inbuf_cur; + hawk_oow_t inbuf_len; + hawk_oow_t outbuf_len; +}; + +#if defined(__cplusplus) +extern "C" { +#endif + +/** + * The hawk_tio_open() function creates an text stream processoor. + */ +HAWK_EXPORT hawk_tio_t* hawk_tio_open ( + hawk_t* hawk, /**< hawk */ + hawk_oow_t xtnsize, /**< extension size in bytes */ + int flags /**< ORed of hawk_tio_flag_t enumerators */ +); + +/** + * The hawk_tio_close() function destroys an text stream processor. + */ +HAWK_EXPORT int hawk_tio_close ( + hawk_tio_t* tio +); + +/** + * The hawk_tio_init() function initialize a statically declared + * text stream processor. + */ +HAWK_EXPORT int hawk_tio_init ( + hawk_tio_t* tio, + hawk_t* hawk, + int flags +); + +/** + * The hawk_tio_fini() function finalizes a text stream processor + */ +HAWK_EXPORT int hawk_tio_fini ( + hawk_tio_t* tio +); + +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE void* hawk_tio_getxtn (hawk_tio_t* tio) { return (void*)(tio + 1); } +#else +#define hawk_tio_getxtn(awk) ((void*)((hawk_tio_t*)(tio) + 1)) +#endif + +/** + * The hawk_tio_geterrnum() function returns the current error code. + */ +HAWK_EXPORT hawk_tio_errnum_t hawk_tio_geterrnum ( + const hawk_tio_t* tio +); + +/** + * The hawk_tio_geterrnum() function changes the current error code. + * typically from within the I/O handler attached. + */ +HAWK_EXPORT void hawk_tio_seterrnum ( + hawk_tio_t* tio, + hawk_tio_errnum_t errnum +); + +/** + * The hawk_tio_getcmgr() function returns the character manager. + */ +HAWK_EXPORT hawk_cmgr_t* hawk_tio_getcmgr ( + hawk_tio_t* tio +); + +/** + * The hawk_tio_setcmgr() function changes the character manager. + */ +HAWK_EXPORT void hawk_tio_setcmgr ( + hawk_tio_t* tio, + hawk_cmgr_t* cmgr +); + +/** + * The hawk_tio_attachin() function attachs an input handler . + * @return 0 on success, -1 on failure + */ +HAWK_EXPORT int hawk_tio_attachin ( + hawk_tio_t* tio, + hawk_tio_io_impl_t input, + hawk_bch_t* bufptr, + hawk_oow_t bufcapa +); + +/** + * The hawk_tio_detachin() function detaches an input handler . + * @return 0 on success, -1 on failure + */ +HAWK_EXPORT int hawk_tio_detachin ( + hawk_tio_t* tio +); + +/** + * The hawk_tio_attachout() function attaches an output handler. + * @return 0 on success, -1 on failure + */ +HAWK_EXPORT int hawk_tio_attachout ( + hawk_tio_t* tio, + hawk_tio_io_impl_t output, + hawk_bch_t* bufptr, + hawk_oow_t bufcapa +); + +/** + * The hawk_tio_detachout() function detaches an output handler . + * @return 0 on success, -1 on failure + */ +HAWK_EXPORT int hawk_tio_detachout ( + hawk_tio_t* tio +); + +/** + * The hawk_tio_flush() function flushes the output buffer. It returns the + * number of bytes written on success, -1 on failure. + */ +HAWK_EXPORT hawk_ooi_t hawk_tio_flush ( + hawk_tio_t* tio +); + +/** + * The hawk_tio_drain() function empties input and output buffers. + */ +HAWK_EXPORT void hawk_tio_drain ( + hawk_tio_t* tio +); + +HAWK_EXPORT hawk_ooi_t hawk_tio_readbchars ( + hawk_tio_t* tio, + hawk_bch_t* buf, + hawk_oow_t size +); + +HAWK_EXPORT hawk_ooi_t hawk_tio_readuchars ( + hawk_tio_t* tio, + hawk_uch_t* buf, + hawk_oow_t size +); + +/** + * The hawk_tio_read() macro is character-type neutral. It maps + * to hawk_tio_readbchars() or hawk_tio_readuchars(). + */ +#ifdef HAWK_OOCH_IS_BCH +# define hawk_tio_read(tio,buf,size) hawk_tio_readbchars(tio,buf,size) +#else +# define hawk_tio_read(tio,buf,size) hawk_tio_readuchars(tio,buf,size) +#endif + +/** + * The hawk_tio_writebchars() function writes the @a size characters + * from a multibyte string @a str. If @a size is (hawk_oow_t)-1, + * it writes on until a terminating null is found. It doesn't + * write more than HAWK_TYPE_MAX(hawk_ooi_t) characters. + * @return number of characters written on success, -1 on failure. + */ +HAWK_EXPORT hawk_ooi_t hawk_tio_writebchars ( + hawk_tio_t* tio, + const hawk_bch_t* str, + hawk_oow_t size +); + +/** + * The hawk_tio_writebchars() function writes the @a size characters + * from a wide-character string @a str. If @a size is (hawk_oow_t)-1, + * it writes on until a terminating null is found. It doesn't write + * more than HAWK_TYPE_MAX(hawk_ooi_t) characters. + * @return number of characters written on success, -1 on failure. + */ +HAWK_EXPORT hawk_ooi_t hawk_tio_writeuchars ( + hawk_tio_t* tio, + const hawk_uch_t* str, + hawk_oow_t size +); + +/** + * The hawk_tio_write() macro is character-type neutral. It maps + * to hawk_tio_writebchars() or hawk_tio_writeuchars(). + */ +#ifdef HAWK_OOCH_IS_BCH +# define hawk_tio_write(tio,str,size) hawk_tio_writebchars(tio,str,size) +#else +# define hawk_tio_write(tio,str,size) hawk_tio_writeuchars(tio,str,size) +#endif + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/hawk/lib/hawk-tre.h b/hawk/lib/hawk-tre.h new file mode 100644 index 00000000..388144e2 --- /dev/null +++ b/hawk/lib/hawk-tre.h @@ -0,0 +1,180 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_TRE_H_ +#define _HAWK_TRE_H_ + +#include + +enum hawk_tre_errnum_t +{ + HAWK_TRE_ENOERR, + HAWK_TRE_EOTHER, + HAWK_TRE_ENOIMPL, + HAWK_TRE_ESYSERR, + HAWK_TRE_EINTERN, + + HAWK_TRE_ENOMEM, /* Out of memory */ + HAWK_TRE_ENOMATCH, /* No match */ + HAWK_TRE_EBADPAT, /* Invalid regular expression */ + HAWK_TRE_ECOLLATE, /* Unknown collating element */ + HAWK_TRE_ECTYPE, /* Unknown character class name */ + HAWK_TRE_EESCAPE, /* Traling backslash */ + HAWK_TRE_ESUBREG, /* Invalid backreference */ + HAWK_TRE_EBRACK, /* "[]" imbalance */ + HAWK_TRE_EPAREN, /* "\(\)" or "()" imbalance */ + HAWK_TRE_EBRACE, /* "\{\}" or "{}" imbalance */ + HAWK_TRE_EBADBR, /* Invalid content of {} */ + HAWK_TRE_ERANGE, /* Invalid use of range operator */ + HAWK_TRE_EBADRPT /* Invalid use of repetition operators */ +}; +typedef enum hawk_tre_errnum_t hawk_tre_errnum_t; + +typedef struct hawk_tre_t hawk_tre_t; +struct hawk_tre_t +{ + hawk_t* hawk; + hawk_tre_errnum_t errnum; + + hawk_oow_t re_nsub; /* Number of parenthesized subexpressions. */ + void* value; /* For internal use only. */ +}; + +#define HAWK_TRE_ERRNUM(tre) ((const hawk_tre_errnum_t)((tre)->errnum)) + +typedef int hawk_tre_off_t; + +typedef struct hawk_tre_match_t hawk_tre_match_t; +struct hawk_tre_match_t +{ + hawk_tre_off_t rm_so; + hawk_tre_off_t rm_eo; +}; + +enum hawk_tre_cflag_t +{ + HAWK_TRE_EXTENDED = (1 << 0), + HAWK_TRE_IGNORECASE = (1 << 1), + HAWK_TRE_NEWLINE = (1 << 2), + HAWK_TRE_NOSUBREG = (1 << 3), + HAWK_TRE_LITERAL = (1 << 4), + HAWK_TRE_RIGHTASSOC = (1 << 5), + HAWK_TRE_UNGREEDY = (1 << 6), + + /* Disable {n,m} occrrence specifier + * in the HAWK_TRE_EXTENDED mode. + * it doesn't affect the BRE's \{\}. */ + HAWK_TRE_NOBOUND = (1 << 7), + + /* Enable non-standard extensions: + * - Enable (?:text) for no submatch backreference. + * - Enable perl-like (?...) extensions like (?i) + * if HAWK_TRE_EXTENDED is also set. + */ + HAWK_TRE_NONSTDEXT = (1 << 8) +}; + +enum hawk_tre_eflag_t +{ + HAWK_TRE_BACKTRACKING = (1 << 0), + HAWK_TRE_NOTBOL = (1 << 1), + HAWK_TRE_NOTEOL = (1 << 2) +}; + +#if defined(__cplusplus) +extern "C" { +#endif + +HAWK_EXPORT hawk_tre_t* hawk_tre_open ( + hawk_t* hawk, + hawk_oow_t xtnsize +); + +HAWK_EXPORT void hawk_tre_close ( + hawk_tre_t* tre +); + +HAWK_EXPORT int hawk_tre_init ( + hawk_tre_t* tre, + hawk_t* hawk +); + +HAWK_EXPORT void hawk_tre_fini ( + hawk_tre_t* tre +); + +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE void* hawk_tre_getxtn (hawk_tre_t* tre) { return (void*)(tre + 1); } +#else +#define hawk_tre_getxtn(awk) ((void*)((hawk_tre_t*)(tre) + 1)) +#endif + + +HAWK_EXPORT hawk_tre_errnum_t hawk_tre_geterrnum ( + hawk_tre_t* tre +); + +HAWK_EXPORT const hawk_ooch_t* hawk_tre_geterrmsg ( + hawk_tre_t* tre +); + +HAWK_EXPORT int hawk_tre_compx ( + hawk_tre_t* tre, + const hawk_ooch_t* regex, + hawk_oow_t n, + unsigned int* nsubmat, + int cflags +); + +HAWK_EXPORT int hawk_tre_comp ( + hawk_tre_t* tre, + const hawk_ooch_t* regex, + unsigned int* nsubmat, + int cflags +); + +HAWK_EXPORT int hawk_tre_execx ( + hawk_tre_t* tre, + const hawk_ooch_t* str, + hawk_oow_t len, + hawk_tre_match_t* pmatch, + hawk_oow_t nmatch, + int eflags +); + +HAWK_EXPORT int hawk_tre_exec ( + hawk_tre_t* tre, + const hawk_ooch_t* str, + hawk_tre_match_t* pmatch, + hawk_oow_t nmatch, + int eflags +); + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/hawk/lib/hawk-unpack.h b/hawk/lib/hawk-unpack.h new file mode 100644 index 00000000..585ba214 --- /dev/null +++ b/hawk/lib/hawk-unpack.h @@ -0,0 +1,37 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#if defined(__GNUC__) +# pragma pack() +#elif defined(__HP_aCC) || defined(__HP_cc) +# pragma PACK +#elif defined(_MSC_VER) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0500)) +# pragma pack(pop) +#elif defined(__DECC) +# pragma pack(pop) +#else +# pragma pack() +#endif diff --git a/hawk/lib/hawk-utl.h b/hawk/lib/hawk-utl.h new file mode 100644 index 00000000..63b34db5 --- /dev/null +++ b/hawk/lib/hawk-utl.h @@ -0,0 +1,1443 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_UTL_H_ +#define _HAWK_UTL_H_ + +#include "hawk-cmn.h" +#include + +/* ========================================================================= + * DOUBLY LINKED LIST + * ========================================================================= */ +#define HAWK_APPEND_TO_LIST(list, node) do { \ + (node)->next = HAWK_NULL; \ + (node)->prev = (list)->last; \ + if ((list)->first) (list)->last->next = (node); \ + else (list)->first = (node); \ + (list)->last = (node); \ +} while(0) + +#define HAWK_PREPPEND_TO_LIST(list, node) do { \ + (node)->prev = HAWK_NULL; \ + (node)->next = (list)->first; \ + if ((list)->last) (list)->first->prev = (node); \ + else (list)->last = (node); \ + (list)->first = (node); \ +} while(0) + +#define HAWK_DELETE_FROM_LIST(list, node) do { \ + if ((node)->prev) (node)->prev->next = (node)->next; \ + else (list)->first = (node)->next; \ + if ((node)->next) (node)->next->prev = (node)->prev; \ + else (list)->last = (node)->prev; \ +} while(0) + + +#define HAWK_APPEND_TO_OOP_LIST(hawk, list, node_type, node, _link) do { \ + (node)->_link.next = (node_type)(hawk)->_nil; \ + (node)->_link.prev = (list)->last; \ + if ((hawk_oop_t)(list)->last != (hawk)->_nil) (list)->last->_link.next = (node); \ + else (list)->first = (node); \ + (list)->last = (node); \ +} while(0) + +#define HAWK_PREPPEND_TO_OOP_LIST(hawk, list, node_type, node, _link) do { \ + (node)->_link.prev = (node_type)(hawk)->_nil; \ + (node)->_link.next = (list)->first; \ + if ((hawk_oop_t)(list)->first != (hawk)->_nil) (list)->first->_link.prev = (node); \ + else (list)->last = (node); \ + (list)->first = (node); \ +} while(0) + +#define HAWK_DELETE_FROM_OOP_LIST(hawk, list, node, _link) do { \ + if ((hawk_oop_t)(node)->_link.prev != (hawk)->_nil) (node)->_link.prev->_link.next = (node)->_link.next; \ + else (list)->first = (node)->_link.next; \ + if ((hawk_oop_t)(node)->_link.next != (hawk)->_nil) (node)->_link.next->_link.prev = (node)->_link.prev; \ + else (list)->last = (node)->_link.prev; \ +} while(0) + +/* +#define HAWK_CLEANUP_FROM_OOP_LIST(hawk, list, node, _link) do { \ + HAWK_DELETE_FROM_OOP_LIST (hawk, list, node, _link); \ + (node)->_link.prev = (node_type)(hawk)->_nil; \ + (node)->_link.next = (node_type)(hawk)->_nil; \ +} while(0); +*/ + +/* ========================================================================= + * ENDIAN CHANGE OF A CONSTANT + * ========================================================================= */ +#define HAWK_CONST_BSWAP16(x) \ + ((hawk_uint16_t)((((hawk_uint16_t)(x) & ((hawk_uint16_t)0xff << 0)) << 8) | \ + (((hawk_uint16_t)(x) & ((hawk_uint16_t)0xff << 8)) >> 8))) + +#define HAWK_CONST_BSWAP32(x) \ + ((hawk_uint32_t)((((hawk_uint32_t)(x) & ((hawk_uint32_t)0xff << 0)) << 24) | \ + (((hawk_uint32_t)(x) & ((hawk_uint32_t)0xff << 8)) << 8) | \ + (((hawk_uint32_t)(x) & ((hawk_uint32_t)0xff << 16)) >> 8) | \ + (((hawk_uint32_t)(x) & ((hawk_uint32_t)0xff << 24)) >> 24))) + +#if defined(HAWK_HAVE_UINT64_T) +#define HAWK_CONST_BSWAP64(x) \ + ((hawk_uint64_t)((((hawk_uint64_t)(x) & ((hawk_uint64_t)0xff << 0)) << 56) | \ + (((hawk_uint64_t)(x) & ((hawk_uint64_t)0xff << 8)) << 40) | \ + (((hawk_uint64_t)(x) & ((hawk_uint64_t)0xff << 16)) << 24) | \ + (((hawk_uint64_t)(x) & ((hawk_uint64_t)0xff << 24)) << 8) | \ + (((hawk_uint64_t)(x) & ((hawk_uint64_t)0xff << 32)) >> 8) | \ + (((hawk_uint64_t)(x) & ((hawk_uint64_t)0xff << 40)) >> 24) | \ + (((hawk_uint64_t)(x) & ((hawk_uint64_t)0xff << 48)) >> 40) | \ + (((hawk_uint64_t)(x) & ((hawk_uint64_t)0xff << 56)) >> 56))) +#endif + +#if defined(HAWK_HAVE_UINT128_T) +#define HAWK_CONST_BSWAP128(x) \ + ((hawk_uint128_t)((((hawk_uint128_t)(x) & ((hawk_uint128_t)0xff << 0)) << 120) | \ + (((hawk_uint128_t)(x) & ((hawk_uint128_t)0xff << 8)) << 104) | \ + (((hawk_uint128_t)(x) & ((hawk_uint128_t)0xff << 16)) << 88) | \ + (((hawk_uint128_t)(x) & ((hawk_uint128_t)0xff << 24)) << 72) | \ + (((hawk_uint128_t)(x) & ((hawk_uint128_t)0xff << 32)) << 56) | \ + (((hawk_uint128_t)(x) & ((hawk_uint128_t)0xff << 40)) << 40) | \ + (((hawk_uint128_t)(x) & ((hawk_uint128_t)0xff << 48)) << 24) | \ + (((hawk_uint128_t)(x) & ((hawk_uint128_t)0xff << 56)) << 8) | \ + (((hawk_uint128_t)(x) & ((hawk_uint128_t)0xff << 64)) >> 8) | \ + (((hawk_uint128_t)(x) & ((hawk_uint128_t)0xff << 72)) >> 24) | \ + (((hawk_uint128_t)(x) & ((hawk_uint128_t)0xff << 80)) >> 40) | \ + (((hawk_uint128_t)(x) & ((hawk_uint128_t)0xff << 88)) >> 56) | \ + (((hawk_uint128_t)(x) & ((hawk_uint128_t)0xff << 96)) >> 72) | \ + (((hawk_uint128_t)(x) & ((hawk_uint128_t)0xff << 104)) >> 88) | \ + (((hawk_uint128_t)(x) & ((hawk_uint128_t)0xff << 112)) >> 104) | \ + (((hawk_uint128_t)(x) & ((hawk_uint128_t)0xff << 120)) >> 120))) +#endif + +#if defined(HAWK_ENDIAN_LITTLE) + +# if defined(HAWK_HAVE_UINT16_T) +# define HAWK_CONST_NTOH16(x) HAWK_CONST_BSWAP16(x) +# define HAWK_CONST_HTON16(x) HAWK_CONST_BSWAP16(x) +# define HAWK_CONST_HTOBE16(x) HAWK_CONST_BSWAP16(x) +# define HAWK_CONST_HTOLE16(x) (x) +# define HAWK_CONST_BE16TOH(x) HAWK_CONST_BSWAP16(x) +# define HAWK_CONST_LE16TOH(x) (x) +# endif + +# if defined(HAWK_HAVE_UINT32_T) +# define HAWK_CONST_NTOH32(x) HAWK_CONST_BSWAP32(x) +# define HAWK_CONST_HTON32(x) HAWK_CONST_BSWAP32(x) +# define HAWK_CONST_HTOBE32(x) HAWK_CONST_BSWAP32(x) +# define HAWK_CONST_HTOLE32(x) (x) +# define HAWK_CONST_BE32TOH(x) HAWK_CONST_BSWAP32(x) +# define HAWK_CONST_LE32TOH(x) (x) +# endif + +# if defined(HAWK_HAVE_UINT64_T) +# define HAWK_CONST_NTOH64(x) HAWK_CONST_BSWAP64(x) +# define HAWK_CONST_HTON64(x) HAWK_CONST_BSWAP64(x) +# define HAWK_CONST_HTOBE64(x) HAWK_CONST_BSWAP64(x) +# define HAWK_CONST_HTOLE64(x) (x) +# define HAWK_CONST_BE64TOH(x) HAWK_CONST_BSWAP64(x) +# define HAWK_CONST_LE64TOH(x) (x) +# endif + +# if defined(HAWK_HAVE_UINT128_T) +# define HAWK_CONST_NTOH128(x) HAWK_CONST_BSWAP128(x) +# define HAWK_CONST_HTON128(x) HAWK_CONST_BSWAP128(x) +# define HAWK_CONST_HTOBE128(x) HAWK_CONST_BSWAP128(x) +# define HAWK_CONST_HTOLE128(x) (x) +# define HAWK_CONST_BE128TOH(x) HAWK_CONST_BSWAP128(x) +# define HAWK_CONST_LE128TOH(x) (x) +#endif + +#elif defined(HAWK_ENDIAN_BIG) + +# if defined(HAWK_HAVE_UINT16_T) +# define HAWK_CONST_NTOH16(x) (x) +# define HAWK_CONST_HTON16(x) (x) +# define HAWK_CONST_HTOBE16(x) (x) +# define HAWK_CONST_HTOLE16(x) HAWK_CONST_BSWAP16(x) +# define HAWK_CONST_BE16TOH(x) (x) +# define HAWK_CONST_LE16TOH(x) HAWK_CONST_BSWAP16(x) +# endif + +# if defined(HAWK_HAVE_UINT32_T) +# define HAWK_CONST_NTOH32(x) (x) +# define HAWK_CONST_HTON32(x) (x) +# define HAWK_CONST_HTOBE32(x) (x) +# define HAWK_CONST_HTOLE32(x) HAWK_CONST_BSWAP32(x) +# define HAWK_CONST_BE32TOH(x) (x) +# define HAWK_CONST_LE32TOH(x) HAWK_CONST_BSWAP32(x) +# endif + +# if defined(HAWK_HAVE_UINT64_T) +# define HAWK_CONST_NTOH64(x) (x) +# define HAWK_CONST_HTON64(x) (x) +# define HAWK_CONST_HTOBE64(x) (x) +# define HAWK_CONST_HTOLE64(x) HAWK_CONST_BSWAP64(x) +# define HAWK_CONST_BE64TOH(x) (x) +# define HAWK_CONST_LE64TOH(x) HAWK_CONST_BSWAP64(x) +# endif + +# if defined(HAWK_HAVE_UINT128_T) +# define HAWK_CONST_NTOH128(x) (x) +# define HAWK_CONST_HTON128(x) (x) +# define HAWK_CONST_HTOBE128(x) (x) +# define HAWK_CONST_HTOLE128(x) HAWK_CONST_BSWAP128(x) +# define HAWK_CONST_BE128TOH(x) (x) +# define HAWK_CONST_LE128TOH(x) HAWK_CONST_BSWAP128(x) +# endif + +#else +# error UNKNOWN ENDIAN +#endif + + +/* ========================================================================= + * HASH + * ========================================================================= */ +#if (HAWK_SIZEOF_OOW_T == 4) +# define HAWK_HASH_FNV_MAGIC_INIT (0x811c9dc5) +# define HAWK_HASH_FNV_MAGIC_PRIME (0x01000193) +#elif (HAWK_SIZEOF_OOW_T == 8) +# define HAWK_HASH_FNV_MAGIC_INIT (0xCBF29CE484222325) +# define HAWK_HASH_FNV_MAGIC_PRIME (0x100000001B3l) +#elif (HAWK_SIZEOF_OOW_T == 16) +# define HAWK_HASH_FNV_MAGIC_INIT (0x6C62272E07BB014262B821756295C58D) +# define HAWK_HASH_FNV_MAGIC_PRIME (0x1000000000000000000013B) +#endif + +#if defined(HAWK_HASH_FNV_MAGIC_INIT) + /* FNV-1 hash */ +# define HAWK_HASH_INIT HAWK_HASH_FNV_MAGIC_INIT +# define HAWK_HASH_VALUE(hv,v) (((hv) ^ (v)) * HAWK_HASH_FNV_MAGIC_PRIME) + +#else + /* SDBM hash */ +# define HAWK_HASH_INIT 0 +# define HAWK_HASH_VALUE(hv,v) (((hv) << 6) + ((hv) << 16) - (hv) + (v)) +#endif + +#define HAWK_HASH_VPTL(hv, ptr, len, type) do { \ + hv = HAWK_HASH_INIT; \ + HAWK_HASH_MORE_VPTL (hv, ptr, len, type); \ +} while(0) + +#define HAWK_HASH_MORE_VPTL(hv, ptr, len, type) do { \ + type* __hawk_hash_more_vptl_p = (type*)(ptr); \ + type* __hawk_hash_more_vptl_q = (type*)__hawk_hash_more_vptl_p + (len); \ + while (__hawk_hash_more_vptl_p < __hawk_hash_more_vptl_q) \ + { \ + hv = HAWK_HASH_VALUE(hv, *__hawk_hash_more_vptl_p); \ + __hawk_hash_more_vptl_p++; \ + } \ +} while(0) + +#define HAWK_HASH_VPTR(hv, ptr, type) do { \ + hv = HAWK_HASH_INIT; \ + HAWK_HASH_MORE_VPTR (hv, ptr, type); \ +} while(0) + +#define HAWK_HASH_MORE_VPTR(hv, ptr, type) do { \ + type* __hawk_hash_more_vptr_p = (type*)(ptr); \ + while (*__hawk_hash_more_vptr_p) \ + { \ + hv = HAWK_HASH_VALUE(hv, *__hawk_hash_more_vptr_p); \ + __hawk_hash_more_vptr_p++; \ + } \ +} while(0) + +#define HAWK_HASH_BYTES(hv, ptr, len) HAWK_HASH_VPTL(hv, ptr, len, const hawk_uint8_t) +#define HAWK_HASH_MORE_BYTES(hv, ptr, len) HAWK_HASH_MORE_VPTL(hv, ptr, len, const hawk_uint8_t) + +#define HAWK_HASH_BCHARS(hv, ptr, len) HAWK_HASH_VPTL(hv, ptr, len, const hawk_bch_t) +#define HAWK_HASH_MORE_BCHARS(hv, ptr, len) HAWK_HASH_MORE_VPTL(hv, ptr, len, const hawk_bch_t) + +#define HAWK_HASH_UCHARS(hv, ptr, len) HAWK_HASH_VPTL(hv, ptr, len, const hawk_uch_t) +#define HAWK_HASH_MORE_UCHARS(hv, ptr, len) HAWK_HASH_MORE_VPTL(hv, ptr, len, const hawk_uch_t) + +#define HAWK_HASH_BCSTR(hv, ptr) HAWK_HASH_VPTR(hv, ptr, const hawk_bch_t) +#define HAWK_HASH_MORE_BCSTR(hv, ptr) HAWK_HASH_MORE_VPTR(hv, ptr, const hawk_bch_t) + +#define HAWK_HASH_UCSTR(hv, ptr) HAWK_HASH_VPTR(hv, ptr, const hawk_uch_t) +#define HAWK_HASH_MORE_UCSTR(hv, ptr) HAWK_HASH_MORE_VPTR(hv, ptr, const hawk_uch_t) + +/* ========================================================================= + * STRING + * ========================================================================= */ + +enum hawk_trim_oochars_flag_t +{ + HAWK_TRIM_OOCHARS_LEFT = (1 << 0), /**< trim leading spaces */ +#define HAWK_TRIM_OOCHARS_LEFT HAWK_TRIM_OOCHARS_LEFT +#define HAWK_TRIM_UCHARS_LEFT HAWK_TRIM_OOCHARS_LEFT +#define HAWK_TRIM_BCHARS_LEFT HAWK_TRIM_OOCHARS_LEFT + HAWK_TRIM_OOCHARS_RIGHT = (1 << 1) /**< trim trailing spaces */ +#define HAWK_TRIM_OOCHARS_RIGHT HAWK_TRIM_OOCHARS_RIGHT +#define HAWK_TRIM_UCHARS_RIGHT HAWK_TRIM_OOCHARS_RIGHT +#define HAWK_TRIM_BCHARS_RIGHT HAWK_TRIM_OOCHARS_RIGHT +}; + + +/* ========================================================================= + * CMGR + * ========================================================================= */ +enum hawk_cmgr_id_t +{ + HAWK_CMGR_UTF8, + HAWK_CMGR_UTF16, + HAWK_CMGR_MB8 +}; +typedef enum hawk_cmgr_id_t hawk_cmgr_id_t; + +/* ========================================================================= + * QUICK SORT + * ========================================================================= */ + +/** + * The hawk_sort_comper_t type defines a sort callback function. + * The callback function is called by sort functions for each comparison + * performed. It should return 0 if \a ptr1 and \a ptr2 are + * euqal, a positive integer if \a ptr1 is greater than \a ptr2, a negative + * if \a ptr2 is greater than \a ptr1. Both \a ptr1 and \a ptr2 are + * pointers to any two items in the array. \a ctx which is a pointer to + * user-defined data passed to a sort function is passed to the callback + * with no modification. + */ +typedef int (*hawk_sort_comper_t) ( + const void* ptr1, + const void* ptr2, + void* ctx +); + +/** + * The hawk_sort_comperx_t type defines a sort callback function. + * It should return 0 on success and -1 on failure. the comparsion + * result must be put back into the variable pointed to by \a cv. + */ +typedef int (*hawk_sort_comperx_t) ( + const void* ptr1, + const void* ptr2, + void* ctx, + int* cv +); + + +#if defined(__cplusplus) +extern "C" { +#endif + +/* ========================================================================= + * HASH + * ========================================================================= */ +#if 0 +HAWK_EXPORT hawk_oow_t hawk_hash_bytes_ ( + const hawk_oob_t* ptr, + hawk_oow_t len +); + +#if defined(HAWK_HAVE_INLINE) + static HAWK_INLINE hawk_oow_t hawk_hash_bytes (const hawk_oob_t* ptr, hawk_oow_t len) + { + hawk_oow_t hv; + HAWK_HASH_BYTES (hv, ptr, len); + /* constrain the hash value to be representable in a small integer + * for convenience sake */ + return hv % ((hawk_oow_t)HAWK_SMOOI_MAX + 1); + } + + static HAWK_INLINE hawk_oow_t hawk_hash_bchars (const hawk_bch_t* ptr, hawk_oow_t len) + { + return hawk_hash_bytes((const hawk_oob_t*)ptr, len * HAWK_SIZEOF(hawk_bch_t)); + } + + static HAWK_INLINE hawk_oow_t hawk_hash_uchars (const hawk_uch_t* ptr, hawk_oow_t len) + { + return hawk_hash_bytes((const hawk_oob_t*)ptr, len * HAWK_SIZEOF(hawk_uch_t)); + } + + static HAWK_INLINE hawk_oow_t hawk_hash_words (const hawk_oow_t* ptr, hawk_oow_t len) + { + return hawk_hash_bytes((const hawk_oob_t*)ptr, len * HAWK_SIZEOF(hawk_oow_t)); + } + + static HAWK_INLINE hawk_oow_t hawk_hash_halfwords (const hawk_oohw_t* ptr, hawk_oow_t len) + { + return hawk_hash_bytes((const hawk_oob_t*)ptr, len * HAWK_SIZEOF(hawk_oohw_t)); + } +#else +# define hawk_hash_bytes(ptr,len) hawk_hash_bytes_(ptr, len) +# define hawk_hash_bchars(ptr,len) hawk_hash_bytes_((const hawk_oob_t*)(ptr), (len) * HAWK_SIZEOF(hawk_bch_t)) +# define hawk_hash_uchars(ptr,len) hawk_hash_bytes_((const hawk_oob_t*)(ptr), (len) * HAWK_SIZEOF(hawk_uch_t)) +# define hawk_hash_words(ptr,len) hawk_hash_bytes_((const hawk_oob_t*)(ptr), (len) * HAWK_SIZEOF(hawk_oow_t)) +# define hawk_hash_halfwords(ptr,len) hawk_hash_bytes_((const hawk_oob_t*)(ptr), (len) * HAWK_SIZEOF(hawk_oohw_t)) +#endif + +#if defined(HAWK_OOCH_IS_UCH) +# define hawk_hash_oochars(ptr,len) hawk_hash_uchars(ptr,len) +#else +# define hawk_hash_oochars(ptr,len) hawk_hash_bchars(ptr,len) +#endif + +#endif + +/* ========================================================================= + * STRING + * ========================================================================= */ + +/** + * The hawk_equal_uchars() function determines equality of two strings + * of the same length \a len. + */ +HAWK_EXPORT int hawk_equal_uchars ( + const hawk_uch_t* str1, + const hawk_uch_t* str2, + hawk_oow_t len +); + +HAWK_EXPORT int hawk_equal_bchars ( + const hawk_bch_t* str1, + const hawk_bch_t* str2, + hawk_oow_t len +); + +HAWK_EXPORT int hawk_comp_uchars ( + const hawk_uch_t* str1, + hawk_oow_t len1, + const hawk_uch_t* str2, + hawk_oow_t len2, + int ignorecase +); + +HAWK_EXPORT int hawk_comp_bchars ( + const hawk_bch_t* str1, + hawk_oow_t len1, + const hawk_bch_t* str2, + hawk_oow_t len2, + int ignorecase +); + +HAWK_EXPORT int hawk_comp_ucstr ( + const hawk_uch_t* str1, + const hawk_uch_t* str2, + int ignorecase +); + +HAWK_EXPORT int hawk_comp_bcstr ( + const hawk_bch_t* str1, + const hawk_bch_t* str2, + int ignorecase +); + +HAWK_EXPORT int hawk_comp_ucstr_limited ( + const hawk_uch_t* str1, + const hawk_uch_t* str2, + hawk_oow_t maxlen +); + +HAWK_EXPORT int hawk_comp_bcstr_limited ( + const hawk_bch_t* str1, + const hawk_bch_t* str2, + hawk_oow_t maxlen +); + +HAWK_EXPORT int hawk_comp_ucstr_bcstr ( + const hawk_uch_t* str1, + const hawk_bch_t* str2 +); + +HAWK_EXPORT int hawk_comp_uchars_ucstr ( + const hawk_uch_t* str1, + hawk_oow_t len, + const hawk_uch_t* str2 +); + +HAWK_EXPORT int hawk_comp_uchars_bcstr ( + const hawk_uch_t* str1, + hawk_oow_t len, + const hawk_bch_t* str2 +); + +HAWK_EXPORT int hawk_comp_bchars_bcstr ( + const hawk_bch_t* str1, + hawk_oow_t len, + const hawk_bch_t* str2 +); + +HAWK_EXPORT int hawk_comp_bchars_ucstr ( + const hawk_bch_t* str1, + hawk_oow_t len, + const hawk_uch_t* str2 +); + +HAWK_EXPORT void hawk_copy_uchars ( + hawk_uch_t* dst, + const hawk_uch_t* src, + hawk_oow_t len +); + +HAWK_EXPORT void hawk_copy_bchars ( + hawk_bch_t* dst, + const hawk_bch_t* src, + hawk_oow_t len +); + +HAWK_EXPORT void hawk_copy_bchars_to_uchars ( + hawk_uch_t* dst, + const hawk_bch_t* src, + hawk_oow_t len +); +HAWK_EXPORT void hawk_copy_uchars_to_bchars ( + hawk_bch_t* dst, + const hawk_uch_t* src, + hawk_oow_t len +); + +HAWK_EXPORT hawk_oow_t hawk_copy_uchars_to_ucstr_unlimited ( + hawk_uch_t* dst, + const hawk_uch_t* src, + hawk_oow_t len +); + +HAWK_EXPORT hawk_oow_t hawk_copy_bchars_to_bcstr_unlimited ( + hawk_bch_t* dst, + const hawk_bch_t* src, + hawk_oow_t len +); + +HAWK_EXPORT hawk_oow_t hawk_copy_ucstr ( + hawk_uch_t* dst, + hawk_oow_t len, + const hawk_uch_t* src +); + +HAWK_EXPORT hawk_oow_t hawk_copy_bcstr ( + hawk_bch_t* dst, + hawk_oow_t len, + const hawk_bch_t* src +); + +HAWK_EXPORT hawk_oow_t hawk_copy_uchars_to_ucstr ( + hawk_uch_t* dst, + hawk_uch_t dlen, + const hawk_uch_t* src, + hawk_oow_t slen +); + +HAWK_EXPORT hawk_oow_t hawk_copy_bchars_to_bcstr ( + hawk_bch_t* dst, + hawk_bch_t dlen, + const hawk_bch_t* src, + hawk_oow_t slen +); + +HAWK_EXPORT hawk_oow_t hawk_copy_ucstr_unlimited ( + hawk_uch_t* dst, + const hawk_uch_t* src +); + +HAWK_EXPORT hawk_oow_t hawk_copy_bcstr_unlimited ( + hawk_bch_t* dst, + const hawk_bch_t* src +); + +HAWK_EXPORT hawk_oow_t hawk_count_ucstr ( + const hawk_uch_t* str +); + +HAWK_EXPORT hawk_oow_t hawk_count_ucstr_limited ( + const hawk_uch_t* str, + hawk_oow_t maxlen +); + +HAWK_EXPORT hawk_oow_t hawk_count_bcstr ( + const hawk_bch_t* str +); + +HAWK_EXPORT hawk_oow_t hawk_count_bcstr_limited ( + const hawk_bch_t* str, + hawk_oow_t maxlen +); + + +HAWK_EXPORT void hawk_fill_uchars ( + hawk_uch_t* dst, + const hawk_uch_t ch, + hawk_oow_t len +); + +HAWK_EXPORT void hawk_fill_bchars ( + hawk_bch_t* dst, + const hawk_bch_t ch, + hawk_oow_t len +); + +HAWK_EXPORT hawk_uch_t* hawk_find_uchar ( + const hawk_uch_t* ptr, + hawk_oow_t len, + hawk_uch_t c +); + +HAWK_EXPORT hawk_bch_t* hawk_find_bchar ( + const hawk_bch_t* ptr, + hawk_oow_t len, + hawk_bch_t c +); + +HAWK_EXPORT hawk_uch_t* hawk_rfind_uchar ( + const hawk_uch_t* ptr, + hawk_oow_t len, + hawk_uch_t c +); + +HAWK_EXPORT hawk_bch_t* hawk_rfind_bchar ( + const hawk_bch_t* ptr, + hawk_oow_t len, + hawk_bch_t c +); + +HAWK_EXPORT hawk_uch_t* hawk_find_uchar_in_ucstr ( + const hawk_uch_t* ptr, + hawk_uch_t c +); + +HAWK_EXPORT hawk_bch_t* hawk_find_bchar_in_bcstr ( + const hawk_bch_t* ptr, + hawk_bch_t c +); + +HAWK_EXPORT hawk_uch_t* hawk_find_uchars_in_uchars ( + const hawk_uch_t* str, + hawk_oow_t strsz, + const hawk_uch_t* sub, + hawk_oow_t subsz, + int ignorecase +); + +HAWK_EXPORT hawk_bch_t* hawk_find_bchars_in_bchars ( + const hawk_bch_t* str, + hawk_oow_t strsz, + const hawk_bch_t* sub, + hawk_oow_t subsz, + int ignorecase +); + +HAWK_EXPORT hawk_uch_t* hawk_rfind_uchars_in_uchars ( + const hawk_uch_t* str, + hawk_oow_t strsz, + const hawk_uch_t* sub, + hawk_oow_t subsz, + int ignorecase +); + +HAWK_EXPORT hawk_bch_t* hawk_rfind_bchars_in_bchars ( + const hawk_bch_t* str, + hawk_oow_t strsz, + const hawk_bch_t* sub, + hawk_oow_t subsz, + int ignorecase +); + +HAWK_EXPORT hawk_oow_t hawk_compact_uchars ( + hawk_uch_t* str, + hawk_oow_t len +); + +HAWK_EXPORT hawk_oow_t hawk_compact_bchars ( + hawk_bch_t* str, + hawk_oow_t len +); + +HAWK_EXPORT hawk_oow_t hawk_rotate_uchars ( + hawk_uch_t* str, + hawk_oow_t len, + int dir, + hawk_oow_t n +); + +HAWK_EXPORT hawk_oow_t hawk_rotate_bchars ( + hawk_bch_t* str, + hawk_oow_t len, + int dir, + hawk_oow_t n +); + +HAWK_EXPORT hawk_uch_t* hawk_trim_uchars ( + hawk_uch_t* str, + hawk_oow_t* len, + int flags +); + +HAWK_EXPORT hawk_bch_t* hawk_trim_bchars ( + hawk_bch_t* str, + hawk_oow_t* len, + int flags +); + +HAWK_EXPORT int hawk_split_ucstr ( + hawk_uch_t* s, + const hawk_uch_t* delim, + hawk_uch_t lquote, + hawk_uch_t rquote, + hawk_uch_t escape +); + +HAWK_EXPORT int hawk_split_bcstr ( + hawk_bch_t* s, + const hawk_bch_t* delim, + hawk_bch_t lquote, + hawk_bch_t rquote, + hawk_bch_t escape +); + +#if defined(HAWK_OOCH_IS_UCH) +# define hawk_equal_oochars hawk_equal_uchars +# define hawk_comp_oochars hawk_comp_uchars +# define hawk_comp_oocstr_bcstr hawk_comp_ucstr_bcstr +# define hawk_comp_oochars_bcstr hawk_comp_uchars_bcstr +# define hawk_comp_oochars_ucstr hawk_comp_uchars_ucstr +# define hawk_comp_oochars_oocstr hawk_comp_uchars_ucstr +# define hawk_comp_oocstr hawk_comp_ucstr + +# define hawk_copy_oochars(dst,src,len) hawk_copy_uchars(dst,src,len) +# define hawk_copy_bchars_to_oochars(dst,src,len) hawk_copy_bchars_to_uchars(dst,src,len) +# define hawk_copy_oochars_to_bchars(dst,src,len) hawk_copy_uchars_to_bchars(dst,src,len) +# define hawk_copy_uchars_to_oochars(dst,src,len) hawk_copy_uchars(dst,src,len) +# define hawk_copy_oochars_to_uchars(dst,src,len) hawk_copy_uchars(dst,src,len) + +# define hawk_copy_oochars_to_oocstr(dst,dlen,src,slen) hawk_copy_uchars_to_ucstr(dst,dlen,src,slen) +# define hawk_copy_oochars_to_oocstr_unlimited(dst,src,len) hawk_copy_uchars_to_ucstr_unlimited(dst,src,len) +# define hawk_copy_oocstr(dst,len,src) hawk_copy_ucstr(dst,len,src) +# define hawk_copy_oocstr_unlimited(dst,src) hawk_copy_ucstr_unlimited(dst,src) + +# define hawk_count_oocstr hawk_count_ucstr +# define hawk_count_oocstr_limited hawk_count_ucstr_limited + +# define hawk_fill_oochars(dst,ch,len) hawk_fill_uchars(dst,ch,len) +# define hawk_find_oochar(ptr,len,c) hawk_find_uchar(ptr,len,c) +# define hawk_rfind_oochar(ptr,len,c) hawk_rfind_uchar(ptr,len,c) +# define hawk_find_oochar_in_oocstr(ptr,c) hawk_find_uchar_in_ucstr(ptr,c) + +# define hawk_find_oochars_in_oochars hawk_find_uchars_in_uchars +# define hawk_rfind_oochars_in_oochars hawk_rfind_uchars_in_uchars + +# define hawk_compact_oochars hawk_compact_uchars +# define hawk_rotate_oochars hawk_rotate_uchars +# define hawk_trim_oochars hawk_trim_uchars + +# define hawk_split_oocstr hawk_split_ucstr +#else +# define hawk_equal_oochars hawk_equal_bchars +# define hawk_comp_oochars hawk_comp_bchars +# define hawk_comp_oocstr_bcstr hawk_comp_bcstr +# define hawk_comp_oochars_bcstr hawk_comp_bchars_bcstr +# define hawk_comp_oochars_ucstr hawk_comp_bchars_ucstr +# define hawk_comp_oochars_oocstr hawk_comp_bchars_bcstr +# define hawk_comp_oocstr hawk_comp_bcstr + +# define hawk_copy_oochars(dst,src,len) hawk_copy_bchars(dst,src,len) +# define hawk_copy_bchars_to_oochars(dst,src,len) hawk_copy_bchars(dst,src,len) +# define hawk_copy_oochars_to_bchars(dst,src,len) hawk_copy_bchars(dst,src,len) +# define hawk_copy_uchars_to_oochars(dst,src,len) hawk_copy_uchars_to_bchars(dst,src,len) +# define hawk_copy_oochars_to_uchars(dst,src,len) hawk_copy_bchars_to_uchars(dst,src,len) + +# define hawk_copy_oochars_to_oocstr(dst,dlen,src,slen) hawk_copy_bchars_to_bcstr(dst,dlen,src,slen) +# define hawk_copy_oochars_to_oocstr_unlimited(dst,src,len) hawk_copy_bchars_to_bcstr_unlimited(dst,src,len) +# define hawk_copy_oocstr(dst,len,src) hawk_copy_bcstr(dst,len,src) +# define hawk_copy_oocstr_unlimited(dst,src) hawk_copy_bcstr_unlimited(dst,src) + +# define hawk_count_oocstr hawk_count_bcstr +# define hawk_count_oocstr_limited hawk_count_bcstr_limited + +# define hawk_fill_oochars(dst,ch,len) hawk_fill_bchars(dst,ch,len) +# define hawk_find_oochar(ptr,len,c) hawk_find_bchar(ptr,len,c) +# define hawk_rfind_oochar(ptr,len,c) hawk_rfind_bchar(ptr,len,c) +# define hawk_find_oochar_in_oocstr(ptr,c) hawk_find_bchar_in_bcstr(ptr,c) + +# define hawk_find_oochars_in_oochars hawk_find_uchars_in_bchars +# define hawk_rfind_oochars_in_oochars hawk_rfind_uchars_in_bchars + +# define hawk_compact_oochars hawk_compact_bchars +# define hawk_rotate_oochars hawk_rotate_bchars +# define hawk_trim_oochars hawk_trim_bchars + +# define hawk_split_oocstr hawk_split_bcstr +#endif + +/* ------------------------------------------------------------------------- */ + +HAWK_EXPORT int hawk_conv_bcstr_to_ucstr_with_cmgr ( + const hawk_bch_t* bcs, + hawk_oow_t* bcslen, + hawk_uch_t* ucs, + hawk_oow_t* ucslen, + hawk_cmgr_t* cmgr, + int all +); + +HAWK_EXPORT int hawk_conv_ucstr_to_bcstr_with_cmgr ( + const hawk_uch_t* ucs, + hawk_oow_t* ucslen, + hawk_bch_t* bcs, + hawk_oow_t* bcslen, + hawk_cmgr_t* cmgr +); + +HAWK_EXPORT int hawk_conv_bchars_to_uchars_with_cmgr ( + const hawk_bch_t* bcs, + hawk_oow_t* bcslen, + hawk_uch_t* ucs, + hawk_oow_t* ucslen, + hawk_cmgr_t* cmgr, + int all +); + +HAWK_EXPORT int hawk_conv_uchars_to_bchars_with_cmgr ( + const hawk_uch_t* ucs, + hawk_oow_t* ucslen, + hawk_bch_t* bcs, + hawk_oow_t* bcslen, + hawk_cmgr_t* cmgr +); + +HAWK_EXPORT int hawk_conv_bchars_to_uchars_upto_stopper_with_cmgr ( + const hawk_bch_t* bcs, + hawk_oow_t* bcslen, + hawk_uch_t* ucs, + hawk_oow_t* ucslen, + hawk_uch_t stopper, + hawk_cmgr_t* cmgr +); + +/* ------------------------------------------------------------------------- */ + +HAWK_EXPORT hawk_oow_t hawk_int_to_oocstr ( + hawk_int_t value, + int radix, + const hawk_ooch_t* prefix, + hawk_ooch_t* buf, + hawk_oow_t size +); + +/* ------------------------------------------------------------------------- */ + +HAWK_EXPORT hawk_cmgr_t* hawk_get_cmgr_by_id ( + hawk_cmgr_id_t id +); + +HAWK_EXPORT hawk_cmgr_t* hawk_get_cmgr_by_bcstr ( + const hawk_bch_t* name +); + +HAWK_EXPORT hawk_cmgr_t* hawk_get_cmgr_by_ucstr ( + const hawk_uch_t* name +); + +#if defined(HAWK_OOCH_IS_UCH) +# define hawk_get_cmgr_by_name(name) hawk_get_cmgr_by_ucstr(name) +#else +# define hawk_get_cmgr_by_name(name) hawk_get_cmgr_by_bcstr(name) +#endif + +#define hawk_get_utf8_cmgr() hawk_get_cmgr_by_id(HAWK_CMGR_UTF8) +#define hawk_get_utf16_cmgr() hawk_get_cmgr_by_id(HAWK_CMGR_UTF16) +#define hawk_get_mb8_cmgr() hawk_get_cmgr_by_id(HAWK_CMGR_MB8) + +/* ------------------------------------------------------------------------- */ + +/** + * The hawk_conv_uchars_to_utf8() function converts a unicode character string \a ucs + * to a UTF8 string and writes it into the buffer pointed to by \a bcs, but + * not more than \a bcslen bytes including the terminating null. + * + * Upon return, \a bcslen is modified to the actual number of bytes written to + * \a bcs excluding the terminating null; \a ucslen is modified to the number of + * wide characters converted. + * + * You may pass #HAWK_NULL for \a bcs to dry-run conversion or to get the + * required buffer size for conversion. -2 is never returned in this case. + * + * \return + * - 0 on full conversion, + * - -1 on no or partial conversion for an illegal character encountered, + * - -2 on no or partial conversion for a small buffer. + * + * \code + * const hawk_uch_t ucs[] = { 'H', 'e', 'l', 'l', 'o' }; + * hawk_bch_t bcs[10]; + * hawk_oow_t ucslen = 5; + * hawk_oow_t bcslen = HAWK_COUNTOF(bcs); + * n = hawk_conv_uchars_to_utf8 (ucs, &ucslen, bcs, &bcslen); + * if (n <= -1) + * { + * // conversion error + * } + * \endcode + */ +HAWK_EXPORT int hawk_conv_uchars_to_utf8 ( + const hawk_uch_t* ucs, + hawk_oow_t* ucslen, + hawk_bch_t* bcs, + hawk_oow_t* bcslen +); + +/** + * The hawk_conv_utf8_to_uchars() function converts a UTF8 string to a uncide string. + * + * It never returns -2 if \a ucs is #HAWK_NULL. + * + * \code + * const hawk_bch_t* bcs = "test string"; + * hawk_uch_t ucs[100]; + * hawk_oow_t ucslen = HAWK_COUNTOF(buf), n; + * hawk_oow_t bcslen = 11; + * int n; + * n = hawk_conv_utf8_to_uchars (bcs, &bcslen, ucs, &ucslen); + * if (n <= -1) { invalid/incomplenete sequence or buffer to small } + * \endcode + * + * The resulting \a ucslen can still be greater than 0 even if the return + * value is negative. The value indiates the number of characters converted + * before the error has occurred. + * + * \return 0 on success. + * -1 if \a bcs contains an illegal character. + * -2 if the wide-character string buffer is too small. + * -3 if \a bcs is not a complete sequence. + */ +HAWK_EXPORT int hawk_conv_utf8_to_uchars ( + const hawk_bch_t* bcs, + hawk_oow_t* bcslen, + hawk_uch_t* ucs, + hawk_oow_t* ucslen +); + + +HAWK_EXPORT int hawk_conv_ucstr_to_utf8 ( + const hawk_uch_t* ucs, + hawk_oow_t* ucslen, + hawk_bch_t* bcs, + hawk_oow_t* bcslen +); + +HAWK_EXPORT int hawk_conv_utf8_to_ucs ( + const hawk_bch_t* bcs, + hawk_oow_t* bcslen, + hawk_uch_t* ucs, + hawk_oow_t* ucslen +); + +/* ------------------------------------------------------------------------- */ + +HAWK_EXPORT int hawk_conv_uchars_to_utf16 ( + const hawk_uch_t* ucs, + hawk_oow_t* ucslen, + hawk_bch_t* bcs, + hawk_oow_t* bcslen +); + +HAWK_EXPORT int hawk_conv_utf16_to_uchars ( + const hawk_bch_t* bcs, + hawk_oow_t* bcslen, + hawk_uch_t* ucs, + hawk_oow_t* ucslen +); + + +HAWK_EXPORT int hawk_conv_ucstr_to_utf16 ( + const hawk_uch_t* ucs, + hawk_oow_t* ucslen, + hawk_bch_t* bcs, + hawk_oow_t* bcslen +); + +HAWK_EXPORT int hawk_conv_utf16_to_ucs ( + const hawk_bch_t* bcs, + hawk_oow_t* bcslen, + hawk_uch_t* ucs, + hawk_oow_t* ucslen +); + +/* ------------------------------------------------------------------------- */ + +HAWK_EXPORT int hawk_conv_uchars_to_mb8 ( + const hawk_uch_t* ucs, + hawk_oow_t* ucslen, + hawk_bch_t* bcs, + hawk_oow_t* bcslen +); + +HAWK_EXPORT int hawk_conv_mb8_to_uchars ( + const hawk_bch_t* bcs, + hawk_oow_t* bcslen, + hawk_uch_t* ucs, + hawk_oow_t* ucslen +); + +HAWK_EXPORT int hawk_conv_ucstr_to_mb8 ( + const hawk_uch_t* ucs, + hawk_oow_t* ucslen, + hawk_bch_t* bcs, + hawk_oow_t* bcslen +); + +HAWK_EXPORT int hawk_conv_mb8_to_ucs ( + const hawk_bch_t* bcs, + hawk_oow_t* bcslen, + hawk_uch_t* ucs, + hawk_oow_t* ucslen +); + +/* ========================================================================= + * NUMBER TO STRING CONVERSION + * ========================================================================= */ + +#define HAWK_BYTE_TO_OOCSTR_RADIXMASK (0xFF) +#define HAWK_BYTE_TO_OOCSTR_LOWERCASE (1 << 8) + +#define HAWK_BYTE_TO_UCSTR_RADIXMASK HAWK_BYTE_TO_OOCSTR_RADIXMASK +#define HAWK_BYTE_TO_UCSTR_LOWERCASE HAWK_BYTE_TO_OOCSTR_LOWERCASE + +#define HAWK_BYTE_TO_BCSTR_RADIXMASK HAWK_BYTE_TO_OOCSTR_RADIXMASK +#define HAWK_BYTE_TO_BCSTR_LOWERCASE HAWK_BYTE_TO_OOCSTR_LOWERCASE + +hawk_oow_t hawk_byte_to_ucstr ( + hawk_oob_t byte, + hawk_uch_t* buf, + hawk_oow_t size, + int flagged_radix, + hawk_uch_t fill +); + +hawk_oow_t hawk_byte_to_bcstr ( + hawk_uint8_t byte, + hawk_bch_t* buf, + hawk_oow_t size, + int flagged_radix, + hawk_bch_t fill +); + +#if defined(HAWK_OOCH_IS_UCH) +# define hawk_byte_to_oocstr hawk_byte_to_ucstr +#else +# define hawk_byte_to_oocstr hawk_byte_to_bcstr +#endif + +/* ========================================================================= + * PATH STRING + * ========================================================================= */ +HAWK_EXPORT const hawk_uch_t* hawk_get_base_name_ucstr ( + const hawk_uch_t* path +); + +HAWK_EXPORT const hawk_bch_t* hawk_get_base_name_bcstr ( + const hawk_bch_t* path +); + +#if defined(HAWK_OOCH_IS_UCH) +# define hawk_get_base_name_oocstr hawk_get_base_name_ucstr +#else +# define hawk_get_base_name_oocstr hawk_get_base_name_bcstr +#endif + +/* ========================================================================= + * BIT SWAP + * ========================================================================= */ +#if defined(HAWK_HAVE_INLINE) + +#if defined(HAWK_HAVE_UINT16_T) +static HAWK_INLINE hawk_uint16_t hawk_bswap16 (hawk_uint16_t x) +{ +#if defined(HAWK_HAVE_BUILTIN_BSWAP16) + return __builtin_bswap16(x); +#elif defined(__GNUC__) && (defined(__x86_64) || defined(__amd64) || defined(__i386) || defined(i386)) + __asm__ /*volatile*/ ("xchgb %b0, %h0" : "=Q"(x): "0"(x)); + return x; +#elif defined(__GNUC__) && defined(__arm__) && (defined(__ARM_ARCH) && (__ARM_ARCH >= 6)) + __asm__ /*volatile*/ ("rev16 %0, %0" : "+r"(x)); + return x; +#else + return (x << 8) | (x >> 8); +#endif +} +#endif + +#if defined(HAWK_HAVE_UINT32_T) +static HAWK_INLINE hawk_uint32_t hawk_bswap32 (hawk_uint32_t x) +{ +#if defined(HAWK_HAVE_BUILTIN_BSWAP32) + return __builtin_bswap32(x); +#elif defined(__GNUC__) && (defined(__x86_64) || defined(__amd64) || defined(__i386) || defined(i386)) + __asm__ /*volatile*/ ("bswapl %0" : "=r"(x) : "0"(x)); + return x; +#elif defined(__GNUC__) && defined(__aarch64__) + __asm__ /*volatile*/ ("rev32 %0, %0" : "+r"(x)); + return x; +#elif defined(__GNUC__) && defined(__arm__) && (defined(__ARM_ARCH) && (__ARM_ARCH >= 6)) + __asm__ /*volatile*/ ("rev %0, %0" : "+r"(x)); + return x; +#elif defined(__GNUC__) && defined(__ARM_ARCH) + hawk_uint32_t tmp; + __asm__ /*volatile*/ ( + "eor %1, %0, %0, ror #16\n\t" + "bic %1, %1, #0x00ff0000\n\t" + "mov %0, %0, ror #8\n\t" + "eor %0, %0, %1, lsr #8\n\t" + :"+r"(x), "=&r"(tmp) + ); + return x; +#else + return ((x >> 24)) | + ((x >> 8) & ((hawk_uint32_t)0xff << 8)) | + ((x << 8) & ((hawk_uint32_t)0xff << 16)) | + ((x << 24)); +#endif +} +#endif + +#if defined(HAWK_HAVE_UINT64_T) +static HAWK_INLINE hawk_uint64_t hawk_bswap64 (hawk_uint64_t x) +{ +#if defined(HAWK_HAVE_BUILTIN_BSWAP64) + return __builtin_bswap64(x); +#elif defined(__GNUC__) && (defined(__x86_64) || defined(__amd64)) + __asm__ /*volatile*/ ("bswapq %0" : "=r"(x) : "0"(x)); + return x; +#elif defined(__GNUC__) && defined(__aarch64__) + __asm__ /*volatile*/ ("rev %0, %0" : "+r"(x)); + return x; +#else + return ((x >> 56)) | + ((x >> 40) & ((hawk_uint64_t)0xff << 8)) | + ((x >> 24) & ((hawk_uint64_t)0xff << 16)) | + ((x >> 8) & ((hawk_uint64_t)0xff << 24)) | + ((x << 8) & ((hawk_uint64_t)0xff << 32)) | + ((x << 24) & ((hawk_uint64_t)0xff << 40)) | + ((x << 40) & ((hawk_uint64_t)0xff << 48)) | + ((x << 56)); +#endif +} +#endif + +#if defined(HAWK_HAVE_UINT128_T) +static HAWK_INLINE hawk_uint128_t hawk_bswap128 (hawk_uint128_t x) +{ +#if defined(HAWK_HAVE_BUILTIN_BSWAP128) + return __builtin_bswap128(x); +#else + return ((x >> 120)) | + ((x >> 104) & ((hawk_uint128_t)0xff << 8)) | + ((x >> 88) & ((hawk_uint128_t)0xff << 16)) | + ((x >> 72) & ((hawk_uint128_t)0xff << 24)) | + ((x >> 56) & ((hawk_uint128_t)0xff << 32)) | + ((x >> 40) & ((hawk_uint128_t)0xff << 40)) | + ((x >> 24) & ((hawk_uint128_t)0xff << 48)) | + ((x >> 8) & ((hawk_uint128_t)0xff << 56)) | + ((x << 8) & ((hawk_uint128_t)0xff << 64)) | + ((x << 24) & ((hawk_uint128_t)0xff << 72)) | + ((x << 40) & ((hawk_uint128_t)0xff << 80)) | + ((x << 56) & ((hawk_uint128_t)0xff << 88)) | + ((x << 72) & ((hawk_uint128_t)0xff << 96)) | + ((x << 88) & ((hawk_uint128_t)0xff << 104)) | + ((x << 104) & ((hawk_uint128_t)0xff << 112)) | + ((x << 120)); +#endif +} +#endif + +#else + +#if defined(HAWK_HAVE_UINT16_T) +# if defined(HAWK_HAVE_BUILTIN_BSWAP16) +# define hawk_bswap16(x) ((hawk_uint16_t)__builtin_bswap16((hawk_uint16_t)(x))) +# else +# define hawk_bswap16(x) ((hawk_uint16_t)(((hawk_uint16_t)(x)) << 8) | (((hawk_uint16_t)(x)) >> 8)) +# endif +#endif + +#if defined(HAWK_HAVE_UINT32_T) +# if defined(HAWK_HAVE_BUILTIN_BSWAP32) +# define hawk_bswap32(x) ((hawk_uint32_t)__builtin_bswap32((hawk_uint32_t)(x))) +# else +# define hawk_bswap32(x) ((hawk_uint32_t)(((((hawk_uint32_t)(x)) >> 24)) | \ + ((((hawk_uint32_t)(x)) >> 8) & ((hawk_uint32_t)0xff << 8)) | \ + ((((hawk_uint32_t)(x)) << 8) & ((hawk_uint32_t)0xff << 16)) | \ + ((((hawk_uint32_t)(x)) << 24)))) +# endif +#endif + +#if defined(HAWK_HAVE_UINT64_T) +# if defined(HAWK_HAVE_BUILTIN_BSWAP64) +# define hawk_bswap64(x) ((hawk_uint64_t)__builtin_bswap64((hawk_uint64_t)(x))) +# else +# define hawk_bswap64(x) ((hawk_uint64_t)(((((hawk_uint64_t)(x)) >> 56)) | \ + ((((hawk_uint64_t)(x)) >> 40) & ((hawk_uint64_t)0xff << 8)) | \ + ((((hawk_uint64_t)(x)) >> 24) & ((hawk_uint64_t)0xff << 16)) | \ + ((((hawk_uint64_t)(x)) >> 8) & ((hawk_uint64_t)0xff << 24)) | \ + ((((hawk_uint64_t)(x)) << 8) & ((hawk_uint64_t)0xff << 32)) | \ + ((((hawk_uint64_t)(x)) << 24) & ((hawk_uint64_t)0xff << 40)) | \ + ((((hawk_uint64_t)(x)) << 40) & ((hawk_uint64_t)0xff << 48)) | \ + ((((hawk_uint64_t)(x)) << 56)))) +# endif +#endif + +#if defined(HAWK_HAVE_UINT128_T) +# if defined(HAWK_HAVE_BUILTIN_BSWAP128) +# define hawk_bswap128(x) ((hawk_uint128_t)__builtin_bswap128((hawk_uint128_t)(x))) +# else +# define hawk_bswap128(x) ((hawk_uint128_t)(((((hawk_uint128_t)(x)) >> 120)) | \ + ((((hawk_uint128_t)(x)) >> 104) & ((hawk_uint128_t)0xff << 8)) | \ + ((((hawk_uint128_t)(x)) >> 88) & ((hawk_uint128_t)0xff << 16)) | \ + ((((hawk_uint128_t)(x)) >> 72) & ((hawk_uint128_t)0xff << 24)) | \ + ((((hawk_uint128_t)(x)) >> 56) & ((hawk_uint128_t)0xff << 32)) | \ + ((((hawk_uint128_t)(x)) >> 40) & ((hawk_uint128_t)0xff << 40)) | \ + ((((hawk_uint128_t)(x)) >> 24) & ((hawk_uint128_t)0xff << 48)) | \ + ((((hawk_uint128_t)(x)) >> 8) & ((hawk_uint128_t)0xff << 56)) | \ + ((((hawk_uint128_t)(x)) << 8) & ((hawk_uint128_t)0xff << 64)) | \ + ((((hawk_uint128_t)(x)) << 24) & ((hawk_uint128_t)0xff << 72)) | \ + ((((hawk_uint128_t)(x)) << 40) & ((hawk_uint128_t)0xff << 80)) | \ + ((((hawk_uint128_t)(x)) << 56) & ((hawk_uint128_t)0xff << 88)) | \ + ((((hawk_uint128_t)(x)) << 72) & ((hawk_uint128_t)0xff << 96)) | \ + ((((hawk_uint128_t)(x)) << 88) & ((hawk_uint128_t)0xff << 104)) | \ + ((((hawk_uint128_t)(x)) << 104) & ((hawk_uint128_t)0xff << 112)) | \ + ((((hawk_uint128_t)(x)) << 120)))) +# endif +#endif + +#endif /* HAWK_HAVE_INLINE */ + + +#if defined(HAWK_ENDIAN_LITTLE) + +# if defined(HAWK_HAVE_UINT16_T) +# define hawk_hton16(x) hawk_bswap16(x) +# define hawk_ntoh16(x) hawk_bswap16(x) +# define hawk_htobe16(x) hawk_bswap16(x) +# define hawk_be16toh(x) hawk_bswap16(x) +# define hawk_htole16(x) ((hawk_uint16_t)(x)) +# define hawk_le16toh(x) ((hawk_uint16_t)(x)) +# endif + +# if defined(HAWK_HAVE_UINT32_T) +# define hawk_hton32(x) hawk_bswap32(x) +# define hawk_ntoh32(x) hawk_bswap32(x) +# define hawk_htobe32(x) hawk_bswap32(x) +# define hawk_be32toh(x) hawk_bswap32(x) +# define hawk_htole32(x) ((hawk_uint32_t)(x)) +# define hawk_le32toh(x) ((hawk_uint32_t)(x)) +# endif + +# if defined(HAWK_HAVE_UINT64_T) +# define hawk_hton64(x) hawk_bswap64(x) +# define hawk_ntoh64(x) hawk_bswap64(x) +# define hawk_htobe64(x) hawk_bswap64(x) +# define hawk_be64toh(x) hawk_bswap64(x) +# define hawk_htole64(x) ((hawk_uint64_t)(x)) +# define hawk_le64toh(x) ((hawk_uint64_t)(x)) +# endif + +# if defined(HAWK_HAVE_UINT128_T) + +# define hawk_hton128(x) hawk_bswap128(x) +# define hawk_ntoh128(x) hawk_bswap128(x) +# define hawk_htobe128(x) hawk_bswap128(x) +# define hawk_be128toh(x) hawk_bswap128(x) +# define hawk_htole128(x) ((hawk_uint128_t)(x)) +# define hawk_le128toh(x) ((hawk_uint128_t)(x)) +# endif + +#elif defined(HAWK_ENDIAN_BIG) + +# if defined(HAWK_HAVE_UINT16_T) +# define hawk_hton16(x) ((hawk_uint16_t)(x)) +# define hawk_ntoh16(x) ((hawk_uint16_t)(x)) +# define hawk_htobe16(x) ((hawk_uint16_t)(x)) +# define hawk_be16toh(x) ((hawk_uint16_t)(x)) +# define hawk_htole16(x) hawk_bswap16(x) +# define hawk_le16toh(x) hawk_bswap16(x) +# endif + +# if defined(HAWK_HAVE_UINT32_T) +# define hawk_hton32(x) ((hawk_uint32_t)(x)) +# define hawk_ntoh32(x) ((hawk_uint32_t)(x)) +# define hawk_htobe32(x) ((hawk_uint32_t)(x)) +# define hawk_be32toh(x) ((hawk_uint32_t)(x)) +# define hawk_htole32(x) hawk_bswap32(x) +# define hawk_le32toh(x) hawk_bswap32(x) +# endif + +# if defined(HAWK_HAVE_UINT64_T) +# define hawk_hton64(x) ((hawk_uint64_t)(x)) +# define hawk_ntoh64(x) ((hawk_uint64_t)(x)) +# define hawk_htobe64(x) ((hawk_uint64_t)(x)) +# define hawk_be64toh(x) ((hawk_uint64_t)(x)) +# define hawk_htole64(x) hawk_bswap64(x) +# define hawk_le64toh(x) hawk_bswap64(x) +# endif + +# if defined(HAWK_HAVE_UINT128_T) +# define hawk_hton128(x) ((hawk_uint128_t)(x)) +# define hawk_ntoh128(x) ((hawk_uint128_t)(x)) +# define hawk_htobe128(x) ((hawk_uint128_t)(x)) +# define hawk_be128toh(x) ((hawk_uint128_t)(x)) +# define hawk_htole128(x) hawk_bswap128(x) +# define hawk_le128toh(x) hawk_bswap128(x) +# endif + +#else +# error UNKNOWN ENDIAN +#endif + +/* ========================================================================= + * BIT POSITION + * ========================================================================= */ +static HAWK_INLINE int hawk_get_pos_of_msb_set_pow2 (hawk_oow_t x) +{ + /* the caller must ensure that x is power of 2. if x happens to be zero, + * the return value is undefined as each method used may give different result. */ +#if defined(HAWK_HAVE_BUILTIN_CTZLL) && (HAWK_SIZEOF_OOW_T == HAWK_SIZEOF_LONG_LONG) + return __builtin_ctzll(x); /* count the number of trailing zeros */ +#elif defined(HAWK_HAVE_BUILTIN_CTZL) && (HAWK_SIZEOF_OOW_T == HAWK_SIZEOF_LONG) + return __builtin_ctzl(x); /* count the number of trailing zeros */ +#elif defined(HAWK_HAVE_BUILTIN_CTZ) && (HAWK_SIZEOF_OOW_T == HAWK_SIZEOF_INT) + return __builtin_ctz(x); /* count the number of trailing zeros */ +#elif defined(__GNUC__) && (defined(__x86_64) || defined(__amd64) || defined(__i386) || defined(i386)) + hawk_oow_t pos; + /* use the Bit Scan Forward instruction */ +#if 1 + __asm__ volatile ( + "bsf %1,%0\n\t" + : "=r"(pos) /* output */ + : "r"(x) /* input */ + ); +#else + __asm__ volatile ( + "bsf %[X],%[EXP]\n\t" + : [EXP]"=r"(pos) /* output */ + : [X]"r"(x) /* input */ + ); +#endif + return (int)pos; +#elif defined(__GNUC__) && defined(__aarch64__) || (defined(__arm__) && (defined(__ARM_ARCH) && (__ARM_ARCH >= 5))) + hawk_oow_t n; + /* CLZ is available in ARMv5T and above. there is no instruction to + * count trailing zeros or something similar. using RBIT with CLZ + * would be good in ARMv6T2 and above to avoid further calculation + * afte CLZ */ + __asm__ volatile ( + "clz %0,%1\n\t" + : "=r"(n) /* output */ + : "r"(x) /* input */ + ); + return (int)(HAWK_OOW_BITS - n - 1); + /* TODO: PPC - use cntlz, cntlzw, cntlzd, SPARC - use lzcnt, MIPS clz */ +#else + int pos = 0; + while (x >>= 1) pos++; + return pos; +#endif +} + +static HAWK_INLINE int hawk_get_pos_of_msb_set (hawk_oow_t x) +{ + /* x doesn't have to be power of 2. if x is zero, the result is undefined */ +#if defined(HAWK_HAVE_BUILTIN_CLZLL) && (HAWK_SIZEOF_OOW_T == HAWK_SIZEOF_LONG_LONG) + return HAWK_OOW_BITS - __builtin_clzll(x) - 1; /* count the number of leading zeros */ +#elif defined(HAWK_HAVE_BUILTIN_CLZL) && (HAWK_SIZEOF_OOW_T == HAWK_SIZEOF_LONG) + return HAWK_OOW_BITS - __builtin_clzl(x) - 1; /* count the number of leading zeros */ +#elif defined(HAWK_HAVE_BUILTIN_CLZ) && (HAWK_SIZEOF_OOW_T == HAWK_SIZEOF_INT) + return HAWK_OOW_BITS - __builtin_clz(x) - 1; /* count the number of leading zeros */ +#elif defined(__GNUC__) && (defined(__x86_64) || defined(__amd64) || defined(__i386) || defined(i386)) + /* bit scan reverse. not all x86 CPUs have LZCNT. */ + hawk_oow_t pos; + __asm__ volatile ( + "bsr %1,%0\n\t" + : "=r"(pos) /* output */ + : "r"(x) /* input */ + ); + return (int)pos; +#elif defined(__GNUC__) && defined(__aarch64__) || (defined(__arm__) && (defined(__ARM_ARCH) && (__ARM_ARCH >= 5))) + hawk_oow_t n; + __asm__ volatile ( + "clz %0,%1\n\t" + : "=r"(n) /* output */ + : "r"(x) /* input */ + ); + return (int)(HAWK_OOW_BITS - n - 1); + /* TODO: PPC - use cntlz, cntlzw, cntlzd, SPARC - use lzcnt, MIPS clz */ +#else + int pos = 0; + while (x >>= 1) pos++; + return pos; +#endif +} + +/* ========================================================================= + * QUICK SORT + * ========================================================================= */ + +HAWK_EXPORT void hawk_qsort ( + void* base, + hawk_oow_t nmemb, + hawk_oow_t size, + hawk_sort_comper_t comper, + void* ctx +); + +HAWK_EXPORT int hawk_qsortx ( + void* base, + hawk_oow_t nmemb, + hawk_oow_t size, + hawk_sort_comperx_t comper, + void* ctx +); + +/* ========================================================================= + * TIME + * ========================================================================= */ +HAWK_EXPORT int hawk_get_time ( + hawk_ntime_t* t +); + +HAWK_EXPORT int hawk_set_time ( + const hawk_ntime_t* t +); + +HAWK_EXPORT void hawk_add_time ( + const hawk_ntime_t* x, + const hawk_ntime_t* y, + hawk_ntime_t* z +); + +HAWK_EXPORT void hawk_sub_time ( + const hawk_ntime_t* x, + const hawk_ntime_t* y, + hawk_ntime_t* z +); + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/hawk/lib/hawk.c b/hawk/lib/hawk.c new file mode 100644 index 00000000..2bfee6c0 --- /dev/null +++ b/hawk/lib/hawk.c @@ -0,0 +1,1026 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "hawk-prv.h" + +static void free_fun (hawk_htb_t* map, void* vptr, hawk_oow_t vlen) +{ + hawk_t* awk = *(hawk_t**)(map + 1); + hawk_fun_t* f = (hawk_fun_t*)vptr; + + /* f->name doesn't have to be freed */ + /*hawk_freemem (awk, f->name);*/ + + if (f->argspec) hawk_freemem (awk, f->argspec); + hawk_clrpt (awk, f->body); + hawk_freemem (awk, f); +} + +static void free_fnc (hawk_htb_t* map, void* vptr, hawk_oow_t vlen) +{ + hawk_t* awk = *(hawk_t**)(map + 1); + hawk_fnc_t* f = (hawk_fnc_t*)vptr; + hawk_freemem (awk, f); +} + +static int init_token (hawk_t* awk, hawk_tok_t* tok) +{ + tok->name = hawk_ooecs_open(awk, 0, 128); + if (!tok->name) return -1; + + tok->type = 0; + tok->loc.file = HAWK_NULL; + tok->loc.line = 0; + tok->loc.colm = 0; + + return 0; +} + +static void fini_token (hawk_tok_t* tok) +{ + if (tok->name) + { + hawk_ooecs_close (tok->name); + tok->name = HAWK_NULL; + } +} + +static void clear_token (hawk_tok_t* tok) +{ + if (tok->name) hawk_ooecs_clear (tok->name); + tok->type = 0; + tok->loc.file = HAWK_NULL; + tok->loc.line = 0; + tok->loc.colm = 0; +} + +hawk_t* hawk_open (hawk_mmgr_t* mmgr, hawk_oow_t xtnsize, hawk_cmgr_t* cmgr, const hawk_prm_t* prm, hawk_errnum_t* errnum) +{ + hawk_t* awk; + + awk = (hawk_t*)HAWK_MMGR_ALLOC(mmgr, HAWK_SIZEOF(hawk_t) + xtnsize); + if (awk) + { + int xret; + + xret = hawk_init(awk, mmgr, cmgr, prm); + if (xret <= -1) + { + if (errnum) *errnum = hawk_geterrnum(awk); + HAWK_MMGR_FREE (mmgr, awk); + awk = HAWK_NULL; + } + else HAWK_MEMSET (awk + 1, 0, xtnsize); + } + else if (errnum) *errnum = HAWK_ENOMEM; + + return awk; +} + +void hawk_close (hawk_t* hawk) +{ + hawk_fini (hawk); + HAWK_MMGR_FREE (hawk_getmmgr(hawk), hawk); +} + +int hawk_init (hawk_t* awk, hawk_mmgr_t* mmgr, hawk_cmgr_t* cmgr, const hawk_prm_t* prm) +{ + static hawk_htb_style_t treefuncbs = + { + { + HAWK_HTB_COPIER_INLINE, + HAWK_HTB_COPIER_DEFAULT + }, + { + HAWK_HTB_FREEER_DEFAULT, + free_fun + }, + HAWK_HTB_COMPER_DEFAULT, + HAWK_HTB_KEEPER_DEFAULT, + HAWK_HTB_SIZER_DEFAULT, + HAWK_HTB_HASHER_DEFAULT + }; + + static hawk_htb_style_t fncusercbs = + { + { + HAWK_HTB_COPIER_INLINE, + HAWK_HTB_COPIER_DEFAULT + }, + { + HAWK_HTB_FREEER_DEFAULT, + free_fnc + }, + HAWK_HTB_COMPER_DEFAULT, + HAWK_HTB_KEEPER_DEFAULT, + HAWK_HTB_SIZER_DEFAULT, + HAWK_HTB_HASHER_DEFAULT + }; + + /* zero out the object */ + HAWK_MEMSET (awk, 0, HAWK_SIZEOF(*awk)); + + /* remember the memory manager */ + awk->_instsize = HAWK_SIZEOF(*awk); + awk->_gem.mmgr = mmgr; + awk->_gem.cmgr = cmgr; + + /* initialize error handling fields */ + awk->_gem.errnum = HAWK_ENOERR; + awk->_gem.errmsg[0] = '\0'; + awk->errloc.line = 0; + awk->errloc.colm = 0; + awk->errloc.file = HAWK_NULL; + awk->errstr = hawk_dflerrstr; + awk->haltall = 0; + + /* progagate the primitive functions */ + HAWK_ASSERT (awk, prm != HAWK_NULL); + HAWK_ASSERT (awk, prm->math.pow != HAWK_NULL); + HAWK_ASSERT (awk, prm->math.mod != HAWK_NULL); + if (prm == HAWK_NULL || + prm->math.pow == HAWK_NULL || + prm->math.mod == HAWK_NULL) + { + hawk_seterrnum (awk, HAWK_EINVAL, HAWK_NULL); + goto oops; + } + awk->prm = *prm; + + if (init_token(awk, &awk->ptok) <= -1 || + init_token(awk, &awk->tok) <= -1 || + init_token(awk, &awk->ntok) <= -1) + { + hawk_seterrnum (awk, HAWK_ENOMEM, HAWK_NULL); + goto oops; + } + + awk->opt.trait = HAWK_MODERN; +#if defined(__OS2__) || defined(_WIN32) || defined(__DOS__) + awk->opt.trait |= HAWK_CRLF; +#endif + awk->opt.rtx_stack_limit = HAWK_DFL_RTX_STACK_LIMIT; + + awk->tree.ngbls = 0; + awk->tree.ngbls_base = 0; + awk->tree.begin = HAWK_NULL; + awk->tree.begin_tail = HAWK_NULL; + awk->tree.end = HAWK_NULL; + awk->tree.end_tail = HAWK_NULL; + awk->tree.chain = HAWK_NULL; + awk->tree.chain_tail = HAWK_NULL; + awk->tree.chain_size = 0; + + /* TODO: initial map size?? */ + awk->tree.funs = hawk_htb_open(awk, HAWK_SIZEOF(awk), 512, 70, HAWK_SIZEOF(hawk_ooch_t), 1); + awk->parse.funs = hawk_htb_open(awk, HAWK_SIZEOF(awk), 256, 70, HAWK_SIZEOF(hawk_ooch_t), 1); + awk->parse.named = hawk_htb_open(awk, HAWK_SIZEOF(awk), 256, 70, HAWK_SIZEOF(hawk_ooch_t), 1); + + awk->parse.gbls = hawk_arr_open(awk, HAWK_SIZEOF(awk), 128); + awk->parse.lcls = hawk_arr_open(awk, HAWK_SIZEOF(awk), 64); + awk->parse.params = hawk_arr_open(awk, HAWK_SIZEOF(awk), 32); + + awk->fnc.sys = HAWK_NULL; + awk->fnc.user = hawk_htb_open(awk, HAWK_SIZEOF(awk), 512, 70, HAWK_SIZEOF(hawk_ooch_t), 1); + awk->modtab = hawk_rbt_open(awk, 0, HAWK_SIZEOF(hawk_ooch_t), 1); + + if (awk->tree.funs == HAWK_NULL || + awk->parse.funs == HAWK_NULL || + awk->parse.named == HAWK_NULL || + awk->parse.gbls == HAWK_NULL || + awk->parse.lcls == HAWK_NULL || + awk->parse.params == HAWK_NULL || + awk->fnc.user == HAWK_NULL || + awk->modtab == HAWK_NULL) + { + hawk_seterrnum (awk, HAWK_ENOMEM, HAWK_NULL); + goto oops; + } + + *(hawk_t**)(awk->tree.funs + 1) = awk; + hawk_htb_setstyle (awk->tree.funs, &treefuncbs); + + *(hawk_t**)(awk->parse.funs + 1) = awk; + hawk_htb_setstyle (awk->parse.funs, hawk_get_htb_style(HAWK_HTB_STYLE_INLINE_KEY_COPIER)); + + *(hawk_t**)(awk->parse.named + 1) = awk; + hawk_htb_setstyle (awk->parse.named, hawk_get_htb_style(HAWK_HTB_STYLE_INLINE_KEY_COPIER)); + + *(hawk_t**)(awk->parse.gbls + 1) = awk; + hawk_arr_setscale (awk->parse.gbls, HAWK_SIZEOF(hawk_ooch_t)); + hawk_arr_setcopier (awk->parse.gbls, HAWK_ARR_COPIER_INLINE); + + *(hawk_t**)(awk->parse.lcls + 1) = awk; + hawk_arr_setscale (awk->parse.lcls, HAWK_SIZEOF(hawk_ooch_t)); + hawk_arr_setcopier (awk->parse.lcls, HAWK_ARR_COPIER_INLINE); + + *(hawk_t**)(awk->parse.params + 1) = awk; + hawk_arr_setscale (awk->parse.params, HAWK_SIZEOF(hawk_ooch_t)); + hawk_arr_setcopier (awk->parse.params, HAWK_ARR_COPIER_INLINE); + + *(hawk_t**)(awk->fnc.user + 1) = awk; + hawk_htb_setstyle (awk->fnc.user, &fncusercbs); + + hawk_rbt_setstyle (awk->modtab, hawk_get_rbt_style(HAWK_RBT_STYLE_INLINE_COPIERS)); + + if (hawk_initgbls(awk) <= -1) + { + hawk_seterrnum (awk, HAWK_ENOMEM, HAWK_NULL); + goto oops; + } + + return 0; + +oops: + if (awk->modtab) hawk_rbt_close (awk->modtab); + if (awk->fnc.user) hawk_htb_close (awk->fnc.user); + if (awk->parse.params) hawk_arr_close (awk->parse.params); + if (awk->parse.lcls) hawk_arr_close (awk->parse.lcls); + if (awk->parse.gbls) hawk_arr_close (awk->parse.gbls); + if (awk->parse.named) hawk_htb_close (awk->parse.named); + if (awk->parse.funs) hawk_htb_close (awk->parse.funs); + if (awk->tree.funs) hawk_htb_close (awk->tree.funs); + fini_token (&awk->ntok); + fini_token (&awk->tok); + fini_token (&awk->ptok); + + return -1; +} + +void hawk_fini (hawk_t* awk) +{ + hawk_ecb_t* ecb; + int i; + + hawk_clear (awk); + /*hawk_clrfnc (awk);*/ + + for (ecb = awk->ecb; ecb; ecb = ecb->next) + if (ecb->close) ecb->close (awk); + + hawk_rbt_close (awk->modtab); + hawk_htb_close (awk->fnc.user); + + hawk_arr_close (awk->parse.params); + hawk_arr_close (awk->parse.lcls); + hawk_arr_close (awk->parse.gbls); + hawk_htb_close (awk->parse.named); + hawk_htb_close (awk->parse.funs); + + hawk_htb_close (awk->tree.funs); + + fini_token (&awk->ntok); + fini_token (&awk->tok); + fini_token (&awk->ptok); + + if (awk->parse.incl_hist.ptr) hawk_freemem (awk, awk->parse.incl_hist.ptr); + hawk_clearsionames (awk); + + /* destroy dynamically allocated options */ + for (i = 0; i < HAWK_COUNTOF(awk->opt.mod); i++) + { + if (awk->opt.mod[i].ptr) hawk_freemem (awk, awk->opt.mod[i].ptr); + } +} + +static hawk_rbt_walk_t unload_module (hawk_rbt_t* rbt, hawk_rbt_pair_t* pair, void* ctx) +{ + hawk_t* awk = (hawk_t*)ctx; + hawk_mod_data_t* md; + + md = HAWK_RBT_VPTR(pair); + if (md->mod.unload) md->mod.unload (&md->mod, awk); + if (md->handle) awk->prm.modclose (awk, md->handle); + + return HAWK_RBT_WALK_FORWARD; +} + +void hawk_clear (hawk_t* awk) +{ + hawk_ecb_t* ecb; + + for (ecb = awk->ecb; ecb; ecb = ecb->next) + { + if (ecb->clear) ecb->clear (awk); + } + + awk->haltall = 0; + + clear_token (&awk->tok); + clear_token (&awk->ntok); + clear_token (&awk->ptok); + + /* clear all loaded modules */ + hawk_rbt_walk (awk->modtab, unload_module, awk); + hawk_rbt_clear (awk->modtab); + + HAWK_ASSERT (awk, HAWK_ARR_SIZE(awk->parse.gbls) == awk->tree.ngbls); + /* delete all non-builtin global variables */ + hawk_arr_delete ( + awk->parse.gbls, awk->tree.ngbls_base, + HAWK_ARR_SIZE(awk->parse.gbls) - awk->tree.ngbls_base); + + hawk_arr_clear (awk->parse.lcls); + hawk_arr_clear (awk->parse.params); + hawk_htb_clear (awk->parse.named); + hawk_htb_clear (awk->parse.funs); + + awk->parse.nlcls_max = 0; + awk->parse.depth.block = 0; + awk->parse.depth.loop = 0; + awk->parse.depth.expr = 0; + awk->parse.depth.incl = 0; + awk->parse.pragma.trait = (awk->opt.trait & HAWK_IMPLICIT); + awk->parse.pragma.rtx_stack_limit = 0; + + awk->parse.incl_hist.count =0; + + /* clear parse trees */ + /*awk->tree.ngbls_base = 0; + awk->tree.ngbls = 0; */ + awk->tree.ngbls = awk->tree.ngbls_base; + + awk->tree.cur_fun.ptr = HAWK_NULL; + awk->tree.cur_fun.len = 0; + hawk_htb_clear (awk->tree.funs); + + if (awk->tree.begin) + { + /*HAWK_ASSERT (awk, awk->tree.begin->next == HAWK_NULL);*/ + hawk_clrpt (awk, awk->tree.begin); + awk->tree.begin = HAWK_NULL; + awk->tree.begin_tail = HAWK_NULL; + } + + if (awk->tree.end) + { + /*HAWK_ASSERT (awk, awk->tree.end->next == HAWK_NULL);*/ + hawk_clrpt (awk, awk->tree.end); + awk->tree.end = HAWK_NULL; + awk->tree.end_tail = HAWK_NULL; + } + + while (awk->tree.chain) + { + hawk_chain_t* next = awk->tree.chain->next; + if (awk->tree.chain->pattern) hawk_clrpt (awk, awk->tree.chain->pattern); + if (awk->tree.chain->action) hawk_clrpt (awk, awk->tree.chain->action); + hawk_freemem (awk, awk->tree.chain); + awk->tree.chain = next; + } + + awk->tree.chain_tail = HAWK_NULL; + awk->tree.chain_size = 0; + + /* this table must not be cleared here as there can be a reference + * to an entry of this table from errinf.loc.file when hawk_parse() + * failed. this table is cleared in hawk_parse(). + * hawk_claersionames (awk); + */ +} + +void hawk_getprm (hawk_t* awk, hawk_prm_t* prm) +{ + *prm = awk->prm; +} + +void hawk_setprm (hawk_t* awk, const hawk_prm_t* prm) +{ + awk->prm = *prm; +} + +static int dup_str_opt (hawk_t* awk, const void* value, hawk_oocs_t* tmp) +{ + if (value) + { + tmp->ptr = hawk_dupoocstr(awk, value, &tmp->len); + if (!tmp->ptr) return -1; + } + else + { + tmp->ptr = HAWK_NULL; + tmp->len = 0; + } + + return 0; +} + +int hawk_setopt (hawk_t* awk, hawk_opt_t id, const void* value) +{ + switch (id) + { + case HAWK_TRAIT: + awk->opt.trait = *(const int*)value; + return 0; + + case HAWK_MODPREFIX: + case HAWK_MODPOSTFIX: + { + hawk_oocs_t tmp; + int idx; + + if (dup_str_opt (awk, value, &tmp) <= -1) return -1; + + idx = id - HAWK_MODPREFIX; + if (awk->opt.mod[idx].ptr) hawk_freemem (awk, awk->opt.mod[idx].ptr); + + awk->opt.mod[idx] = tmp; + return 0; + } + + case HAWK_INCLUDEDIRS: + { + hawk_oocs_t tmp; + if (dup_str_opt (awk, value, &tmp) <= -1) return -1; + if (awk->opt.incldirs.ptr) hawk_freemem (awk, awk->opt.incldirs.ptr); + awk->opt.incldirs = tmp; + return 0; + } + + case HAWK_DEPTH_INCLUDE: + case HAWK_DEPTH_BLOCK_PARSE: + case HAWK_DEPTH_BLOCK_RUN: + case HAWK_DEPTH_EXPR_PARSE: + case HAWK_DEPTH_EXPR_RUN: + case HAWK_DEPTH_REX_BUILD: + case HAWK_DEPTH_REX_MATCH: + awk->opt.depth.a[id - HAWK_DEPTH_INCLUDE] = *(const hawk_oow_t*)value; + return 0; + + case HAWK_RTX_STACK_LIMIT: + awk->opt.rtx_stack_limit = *(const hawk_oow_t*)value; + if (awk->opt.rtx_stack_limit < HAWK_MIN_RTX_STACK_LIMIT) awk->opt.rtx_stack_limit = HAWK_MIN_RTX_STACK_LIMIT; + else if (awk->opt.rtx_stack_limit > HAWK_MAX_RTX_STACK_LIMIT) awk->opt.rtx_stack_limit = HAWK_MAX_RTX_STACK_LIMIT; + return 0; + } + + hawk_seterrnum (awk, HAWK_EINVAL, HAWK_NULL); + return -1; +} + +int hawk_getopt (hawk_t* awk, hawk_opt_t id, void* value) +{ + switch (id) + { + case HAWK_TRAIT: + *(int*)value = awk->opt.trait; + return 0; + + case HAWK_MODPREFIX: + case HAWK_MODPOSTFIX: + *(const hawk_ooch_t**)value = awk->opt.mod[id - HAWK_MODPREFIX].ptr; + return 0; + + case HAWK_INCLUDEDIRS: + *(const hawk_ooch_t**)value = awk->opt.incldirs.ptr; + return 0; + + case HAWK_DEPTH_INCLUDE: + case HAWK_DEPTH_BLOCK_PARSE: + case HAWK_DEPTH_BLOCK_RUN: + case HAWK_DEPTH_EXPR_PARSE: + case HAWK_DEPTH_EXPR_RUN: + case HAWK_DEPTH_REX_BUILD: + case HAWK_DEPTH_REX_MATCH: + *(hawk_oow_t*)value = awk->opt.depth.a[id - HAWK_DEPTH_INCLUDE]; + return 0; + + case HAWK_RTX_STACK_LIMIT: + *(hawk_oow_t*)value = awk->opt.rtx_stack_limit; + return 0; + }; + + hawk_seterrnum (awk, HAWK_EINVAL, HAWK_NULL); + return -1; +} + +void hawk_haltall (hawk_t* awk) +{ + awk->haltall = 1; + hawk_seterrnum (awk, HAWK_EINVAL, HAWK_NULL); +} + +hawk_ecb_t* hawk_popecb (hawk_t* awk) +{ + hawk_ecb_t* top = awk->ecb; + if (top) awk->ecb = top->next; + return top; +} + +void hawk_pushecb (hawk_t* awk, hawk_ecb_t* ecb) +{ + ecb->next = awk->ecb; + awk->ecb = ecb; +} + + +/* ------------------------------------------------------------------------ */ + +void* hawk_allocmem (hawk_t* awk, hawk_oow_t size) +{ + void* ptr = HAWK_MMGR_ALLOC(hawk_getmmgr(awk), size); + if (!ptr) hawk_seterrnum (awk, HAWK_ENOMEM, HAWK_NULL); + return ptr; +} + +void* hawk_callocmem (hawk_t* awk, hawk_oow_t size) +{ + void* ptr = HAWK_MMGR_ALLOC(hawk_getmmgr(awk), size); + if (ptr) HAWK_MEMSET (ptr, 0, size); + else hawk_seterrnum (awk, HAWK_ENOMEM, HAWK_NULL); + return ptr; +} + +void* hawk_reallocmem (hawk_t* awk, void* ptr, hawk_oow_t size) +{ + void* nptr = HAWK_MMGR_REALLOC(hawk_getmmgr(awk), ptr, size); + if (!nptr) hawk_seterrnum (awk, HAWK_ENOMEM, HAWK_NULL); + return nptr; +} + +/* ----------------------------------------------------------------------- */ + +hawk_uch_t* hawk_dupucstr (hawk_t* hawk, const hawk_uch_t* ucs, hawk_oow_t* _ucslen) +{ + hawk_uch_t* ptr; + hawk_oow_t ucslen; + + ucslen = hawk_count_ucstr(ucs); + ptr = (hawk_uch_t*)hawk_allocmem(hawk, (ucslen + 1) * HAWK_SIZEOF(hawk_uch_t)); + if (!ptr) return HAWK_NULL; + + hawk_copy_uchars (ptr, ucs, ucslen); + ptr[ucslen] = '\0'; + + if (_ucslen) *_ucslen = ucslen; + return ptr; +} + +hawk_bch_t* hawk_dupbcstr (hawk_t* hawk, const hawk_bch_t* bcs, hawk_oow_t* _bcslen) +{ + hawk_bch_t* ptr; + hawk_oow_t bcslen; + + bcslen = hawk_count_bcstr(bcs); + ptr = (hawk_bch_t*)hawk_allocmem(hawk, (bcslen + 1) * HAWK_SIZEOF(hawk_bch_t)); + if (!ptr) return HAWK_NULL; + + hawk_copy_bchars (ptr, bcs, bcslen); + ptr[bcslen] = '\0'; + + if (_bcslen) *_bcslen = bcslen; + return ptr; +} + +hawk_uch_t* hawk_dupuchars (hawk_t* hawk, const hawk_uch_t* ucs, hawk_oow_t ucslen) +{ + hawk_uch_t* ptr; + + ptr = (hawk_uch_t*)hawk_allocmem(hawk, (ucslen + 1) * HAWK_SIZEOF(hawk_uch_t)); + if (!ptr) return HAWK_NULL; + + hawk_copy_uchars (ptr, ucs, ucslen); + ptr[ucslen] = '\0'; + return ptr; +} + +hawk_bch_t* hawk_dupbchars (hawk_t* hawk, const hawk_bch_t* bcs, hawk_oow_t bcslen) +{ + hawk_bch_t* ptr; + + ptr = (hawk_bch_t*)hawk_allocmem(hawk, (bcslen + 1) * HAWK_SIZEOF(hawk_bch_t)); + if (!ptr) return HAWK_NULL; + + hawk_copy_bchars (ptr, bcs, bcslen); + ptr[bcslen] = '\0'; + return ptr; +} + +hawk_uch_t* hawk_dupucs (hawk_t* hawk, const hawk_ucs_t* ucs) +{ + hawk_uch_t* ptr; + + ptr = (hawk_uch_t*)hawk_allocmem(hawk, (ucs->len + 1) * HAWK_SIZEOF(hawk_uch_t)); + if (!ptr) return HAWK_NULL; + + hawk_copy_uchars (ptr, ucs->ptr, ucs->len); + ptr[ucs->len] = '\0'; + return ptr; +} + +hawk_bch_t* hawk_dupbcs (hawk_t* hawk, const hawk_bcs_t* bcs) +{ + hawk_bch_t* ptr; + + ptr = (hawk_bch_t*)hawk_allocmem(hawk, (bcs->len + 1) * HAWK_SIZEOF(hawk_bch_t)); + if (!ptr) return HAWK_NULL; + + hawk_copy_bchars (ptr, bcs->ptr, bcs->len); + ptr[bcs->len] = '\0'; + return ptr; +} + +hawk_uch_t* hawk_dupucstrarr (hawk_t* hawk, const hawk_uch_t* str[], hawk_oow_t* len) +{ + hawk_uch_t* buf, * ptr; + hawk_oow_t i; + hawk_oow_t capa = 0; + + for (i = 0; str[i]; i++) capa += hawk_count_ucstr(str[i]); + + buf = (hawk_uch_t*)hawk_allocmem(hawk, (capa + 1) * HAWK_SIZEOF(*buf)); + if (!buf) return HAWK_NULL; + + ptr = buf; + for (i = 0; str[i]; i++) ptr += hawk_copy_ucstr_unlimited(ptr, str[i]); + + if (len) *len = capa; + return buf; +} + +hawk_bch_t* hawk_dupbcstrarr (hawk_t* hawk, const hawk_bch_t* str[], hawk_oow_t* len) +{ + hawk_bch_t* buf, * ptr; + hawk_oow_t i; + hawk_oow_t capa = 0; + + for (i = 0; str[i]; i++) capa += hawk_count_bcstr(str[i]); + + buf = (hawk_bch_t*)hawk_allocmem(hawk, (capa + 1) * HAWK_SIZEOF(*buf)); + if (!buf) return HAWK_NULL; + + ptr = buf; + for (i = 0; str[i]; i++) ptr += hawk_copy_bcstr_unlimited(ptr, str[i]); + + if (len) *len = capa; + return buf; +} + +/* ----------------------------------------------------------------------- */ + +int hawk_convbtouchars (hawk_t* hawk, const hawk_bch_t* bcs, hawk_oow_t* bcslen, hawk_uch_t* ucs, hawk_oow_t* ucslen, int all) +{ + /* length bound */ + int n; + n = hawk_conv_bchars_to_uchars_with_cmgr(bcs, bcslen, ucs, ucslen, hawk_getcmgr(hawk), all); + /* -1: illegal character, -2: buffer too small, -3: incomplete sequence */ + if (n <= -1) hawk_seterrnum (hawk, (n == -2)? HAWK_EBUFFULL: HAWK_EECERR, HAWK_NULL); + return n; +} + +int hawk_convutobchars (hawk_t* hawk, const hawk_uch_t* ucs, hawk_oow_t* ucslen, hawk_bch_t* bcs, hawk_oow_t* bcslen) +{ + /* length bound */ + int n; + n = hawk_conv_uchars_to_bchars_with_cmgr(ucs, ucslen, bcs, bcslen, hawk_getcmgr(hawk)); + if (n <= -1) hawk_seterrnum (hawk, (n == -2)? HAWK_EBUFFULL: HAWK_EECERR, HAWK_NULL); + return n; +} + +int hawk_convbtoucstr (hawk_t* hawk, const hawk_bch_t* bcs, hawk_oow_t* bcslen, hawk_uch_t* ucs, hawk_oow_t* ucslen, int all) +{ + /* null-terminated. */ + int n; + n = hawk_conv_bcstr_to_ucstr_with_cmgr(bcs, bcslen, ucs, ucslen, hawk_getcmgr(hawk), all); + if (n <= -1) hawk_seterrnum (hawk, (n == -2)? HAWK_EBUFFULL: HAWK_EECERR, HAWK_NULL); + return n; +} + +int hawk_convutobcstr (hawk_t* hawk, const hawk_uch_t* ucs, hawk_oow_t* ucslen, hawk_bch_t* bcs, hawk_oow_t* bcslen) +{ + /* null-terminated */ + int n; + n = hawk_conv_ucstr_to_bcstr_with_cmgr(ucs, ucslen, bcs, bcslen, hawk_getcmgr(hawk)); + if (n <= -1) hawk_seterrnum (hawk, (n == -2)? HAWK_EBUFFULL: HAWK_EECERR, HAWK_NULL); + return n; +} + +/* ----------------------------------------------------------------------- */ + +hawk_uch_t* hawk_dupbtoucharswithheadroom (hawk_t* hawk, hawk_oow_t headroom_bytes, const hawk_bch_t* bcs, hawk_oow_t bcslen, hawk_oow_t* ucslen, int all) +{ + hawk_oow_t inlen, outlen; + hawk_uch_t* ptr; + + inlen = bcslen; + if (hawk_convbtouchars(hawk, bcs, &inlen, HAWK_NULL, &outlen, all) <= -1) + { + /* note it's also an error if no full conversion is made in this function */ + return HAWK_NULL; + } + + ptr = (hawk_uch_t*)hawk_allocmem(hawk, headroom_bytes + ((outlen + 1) * HAWK_SIZEOF(*ptr))); + if (!ptr) return HAWK_NULL; + + inlen = bcslen; + + ptr = (hawk_uch_t*)((hawk_oob_t*)ptr + headroom_bytes); + hawk_convbtouchars (hawk, bcs, &inlen, ptr, &outlen, all); + + /* hawk_convbtouchars() doesn't null-terminate the target. + * but in hawk_dupbtouchars(), i allocate space. so i don't mind + * null-terminating it with 1 extra character overhead */ + ptr[outlen] = '\0'; + if (ucslen) *ucslen = outlen; + return ptr; +} + +hawk_bch_t* hawk_duputobcharswithheadroom (hawk_t* hawk, hawk_oow_t headroom_bytes, const hawk_uch_t* ucs, hawk_oow_t ucslen, hawk_oow_t* bcslen) +{ + hawk_oow_t inlen, outlen; + hawk_bch_t* ptr; + + inlen = ucslen; + if (hawk_convutobchars(hawk, ucs, &inlen, HAWK_NULL, &outlen) <= -1) + { + /* note it's also an error if no full conversion is made in this function */ + return HAWK_NULL; + } + + ptr = (hawk_bch_t*)hawk_allocmem(hawk, headroom_bytes + ((outlen + 1) * HAWK_SIZEOF(*ptr))); + if (!ptr) return HAWK_NULL; + + inlen = ucslen; + ptr = (hawk_bch_t*)((hawk_oob_t*)ptr + headroom_bytes); + hawk_convutobchars (hawk, ucs, &inlen, ptr, &outlen); + + ptr[outlen] = '\0'; + if (bcslen) *bcslen = outlen; + return ptr; +} + +/* ----------------------------------------------------------------------- */ + +hawk_uch_t* hawk_dupbtoucstrwithheadroom (hawk_t* hawk, hawk_oow_t headroom_bytes, const hawk_bch_t* bcs, hawk_oow_t* ucslen, int all) +{ + hawk_oow_t inlen, outlen; + hawk_uch_t* ptr; + + if (hawk_convbtoucstr(hawk, bcs, &inlen, HAWK_NULL, &outlen, all) <= -1) + { + /* note it's also an error if no full conversion is made in this function */ + return HAWK_NULL; + } + + outlen++; + ptr = (hawk_uch_t*)hawk_allocmem(hawk, headroom_bytes + (outlen * HAWK_SIZEOF(hawk_uch_t))); + if (!ptr) return HAWK_NULL; + + hawk_convbtoucstr (hawk, bcs, &inlen, ptr, &outlen, all); + if (ucslen) *ucslen = outlen; + return ptr; +} + +hawk_bch_t* hawk_duputobcstrwithheadroom (hawk_t* hawk, hawk_oow_t headroom_bytes, const hawk_uch_t* ucs, hawk_oow_t* bcslen) +{ + hawk_oow_t inlen, outlen; + hawk_bch_t* ptr; + + if (hawk_convutobcstr(hawk, ucs, &inlen, HAWK_NULL, &outlen) <= -1) + { + /* note it's also an error if no full conversion is made in this function */ + return HAWK_NULL; + } + + outlen++; + ptr = (hawk_bch_t*)hawk_allocmem(hawk, headroom_bytes + (outlen * HAWK_SIZEOF(hawk_bch_t))); + if (!ptr) return HAWK_NULL; + + ptr = (hawk_bch_t*)((hawk_oob_t*)ptr + headroom_bytes); + + hawk_convutobcstr (hawk, ucs, &inlen, ptr, &outlen); + if (bcslen) *bcslen = outlen; + return ptr; +} + +/* ----------------------------------------------------------------------- */ + +hawk_bch_t* hawk_dupucstrarrtobcstr (hawk_t* hawk, const hawk_uch_t* ucs[], hawk_oow_t* bcslen) +{ + hawk_oow_t wl, ml, capa, pos, i; + hawk_bch_t* bcs; + + for (capa = 0, i = 0; ucs[i]; i++) + { + if (hawk_convutobcstr(hawk, ucs[i], &wl, HAWK_NULL, &ml) <= -1) return HAWK_NULL; + capa += ml; + } + + bcs = (hawk_bch_t*)hawk_allocmem(hawk, (capa + 1) * HAWK_SIZEOF(*bcs)); + if (!bcs) return HAWK_NULL; + + for (pos = 0, i = 0; ucs[i]; i++) + { + ml = capa - pos + 1; + hawk_convutobcstr (hawk, ucs[i], &wl, &bcs[pos], &ml); + pos += ml; + } + + if (bcslen) *bcslen = capa; + return bcs; +} + +/* ----------------------------------------------------------------------- */ + +struct fmt_uch_buf_t +{ + hawk_t* hawk; + hawk_uch_t* ptr; + hawk_oow_t len; + hawk_oow_t capa; +}; +typedef struct fmt_uch_buf_t fmt_uch_buf_t; + +static int fmt_put_bchars_to_uch_buf (hawk_fmtout_t* fmtout, const hawk_bch_t* ptr, hawk_oow_t len) +{ + fmt_uch_buf_t* b = (fmt_uch_buf_t*)fmtout->ctx; + hawk_oow_t bcslen, ucslen; + int n; + + bcslen = b->capa - b->len; + ucslen = len; + n = hawk_conv_bchars_to_uchars_with_cmgr(ptr, &bcslen, &b->ptr[b->len], &ucslen, hawk_getcmgr(b->hawk), 1); + if (n <= -1) + { + if (n == -2) + { + return 0; /* buffer full. stop */ + } + else + { + hawk_seterrnum (b->hawk, HAWK_EECERR, HAWK_NULL); + return -1; + } + } + + return 1; /* success. carry on */ +} + +static int fmt_put_uchars_to_uch_buf (hawk_fmtout_t* fmtout, const hawk_uch_t* ptr, hawk_oow_t len) +{ + fmt_uch_buf_t* b = (fmt_uch_buf_t*)fmtout->ctx; + hawk_oow_t n; + + /* this function null-terminates the destination. so give the restored buffer size */ + n = hawk_copy_uchars_to_ucstr(&b->ptr[b->len], b->capa - b->len + 1, ptr, len); + b->len += n; + if (n < len) + { + hawk_seterrnum (b->hawk, HAWK_EBUFFULL, HAWK_NULL); + return 0; /* stop. insufficient buffer */ + } + + return 1; /* success */ +} + +hawk_oow_t hawk_vfmttoucstr (hawk_t* hawk, hawk_uch_t* buf, hawk_oow_t bsz, const hawk_uch_t* fmt, va_list ap) +{ + hawk_fmtout_t fo; + fmt_uch_buf_t fb; + + if (bsz <= 0) return 0; + + HAWK_MEMSET (&fo, 0, HAWK_SIZEOF(fo)); + fo.mmgr = hawk_getmmgr(hawk); + fo.putbchars = fmt_put_bchars_to_uch_buf; + fo.putuchars = fmt_put_uchars_to_uch_buf; + fo.ctx = &fb; + + HAWK_MEMSET (&fb, 0, HAWK_SIZEOF(fb)); + fb.hawk = hawk; + fb.ptr = buf; + fb.capa = bsz - 1; + + if (hawk_ufmt_outv(&fo, fmt, ap) <= -1) return -1; + + buf[fb.len] = '\0'; + return fb.len; +} + +hawk_oow_t hawk_fmttoucstr (hawk_t* hawk, hawk_uch_t* buf, hawk_oow_t bufsz, const hawk_uch_t* fmt, ...) +{ + hawk_oow_t x; + va_list ap; + + va_start (ap, fmt); + x = hawk_vfmttoucstr(hawk, buf, bufsz, fmt, ap); + va_end (ap); + + return x; +} + +/* ----------------------------------------------------------------------- */ + +struct fmt_bch_buf_t +{ + hawk_t* hawk; + hawk_bch_t* ptr; + hawk_oow_t len; + hawk_oow_t capa; +}; +typedef struct fmt_bch_buf_t fmt_bch_buf_t; + + +static int fmt_put_bchars_to_bch_buf (hawk_fmtout_t* fmtout, const hawk_bch_t* ptr, hawk_oow_t len) +{ + fmt_bch_buf_t* b = (fmt_bch_buf_t*)fmtout->ctx; + hawk_oow_t n; + + /* this function null-terminates the destination. so give the restored buffer size */ + n = hawk_copy_bchars_to_bcstr(&b->ptr[b->len], b->capa - b->len + 1, ptr, len); + b->len += n; + if (n < len) + { + hawk_seterrnum (b->hawk, HAWK_EBUFFULL, HAWK_NULL); + return 0; /* stop. insufficient buffer */ + } + + return 1; /* success */ +} + + +static int fmt_put_uchars_to_bch_buf (hawk_fmtout_t* fmtout, const hawk_uch_t* ptr, hawk_oow_t len) +{ + fmt_bch_buf_t* b = (fmt_bch_buf_t*)fmtout->ctx; + hawk_oow_t bcslen, ucslen; + int n; + + bcslen = b->capa - b->len; + ucslen = len; + n = hawk_conv_uchars_to_bchars_with_cmgr(ptr, &ucslen, &b->ptr[b->len], &bcslen, hawk_getcmgr(b->hawk)); + b->len += bcslen; + if (n <= -1) + { + if (n == -2) + { + return 0; /* buffer full. stop */ + } + else + { + hawk_seterrnum (b->hawk, HAWK_EECERR, HAWK_NULL); + return -1; + } + } + + return 1; /* success. carry on */ +} + +hawk_oow_t hawk_vfmttobcstr (hawk_t* hawk, hawk_bch_t* buf, hawk_oow_t bsz, const hawk_bch_t* fmt, va_list ap) +{ + hawk_fmtout_t fo; + fmt_bch_buf_t fb; + + if (bsz <= 0) return 0; + + HAWK_MEMSET (&fo, 0, HAWK_SIZEOF(fo)); + fo.mmgr = hawk_getmmgr(hawk); + fo.putbchars = fmt_put_bchars_to_bch_buf; + fo.putuchars = fmt_put_uchars_to_bch_buf; + fo.ctx = &fb; + + HAWK_MEMSET (&fb, 0, HAWK_SIZEOF(fb)); + fb.hawk = hawk; + fb.ptr = buf; + fb.capa = bsz - 1; + + if (hawk_bfmt_outv(&fo, fmt, ap) <= -1) return -1; + + buf[fb.len] = '\0'; + return fb.len; +} + +hawk_oow_t hawk_fmttobcstr (hawk_t* hawk, hawk_bch_t* buf, hawk_oow_t bufsz, const hawk_bch_t* fmt, ...) +{ + hawk_oow_t x; + va_list ap; + + va_start (ap, fmt); + x = hawk_vfmttobcstr(hawk, buf, bufsz, fmt, ap); + va_end (ap); + + return x; +} + diff --git a/hawk/lib/hawk.h b/hawk/lib/hawk.h new file mode 100644 index 00000000..c2ce6b3f --- /dev/null +++ b/hawk/lib/hawk.h @@ -0,0 +1,3541 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_H_ +#define _HAWK_H_ + +#include +#include +#include +#include +#include + +/** \file + * An embeddable AWK interpreter is defined in this header file. + * + * \todo + * - make enhancement to treat a function as a value + * - improve performance of hawk_rtx_readio() if RS is logner than 2 chars. + * - consider something like ${1:3,5} => $1, $2, $3, and $5 concatenated + */ + +/** \struct hawk_t + * The #hawk_t type defines an AWK interpreter. It provides an interface + * to parse an AWK script and run it to manipulate input and output data. + * + * In brief, you need to call APIs with user-defined handlers to run a typical + * AWK script as shown below: + * + * \code + * hawk_t* awk; + * hawk_rtx_t* rtx; + * hawk_sio_cbs_t sio; // need to initialize it with callback functions + * hawk_rio_cbs_t rio; // need to initialize it with callback functions + * + * awk = hawk_open (mmgr, 0, prm); // create an interpreter + * hawk_parse (awk, &sio); // parse a script + * rtx = hawk_rtx_open (awk, 0, &rio); // create a runtime context + * retv = hawk_rtx_loop (rtx); // run a standard AWK loop + * if (retv != HAWK_NULL) + * hawk_rtx_refdownval (rtx, retv); // free return value + * hawk_rtx_close (rtx); // destroy the runtime context + * hawk_close (awk); // destroy the interpreter + * \endcode + * + * It provides an interface to change the conventional behavior of the + * interpreter; most notably, you can call a particular function with + * hawk_rtx_call() instead of entering the BEGIN, pattern-action blocks, END + * loop. By doing this, you may utilize a script in an event-driven way. + * + * \sa hawk_rtx_t hawk_open hawk_close + */ +typedef struct hawk_t hawk_t; + +#define HAWK_HDR \ + hawk_oow_t _instsize; \ + hawk_gem_t _gem; + +typedef struct hawk_alt_t hawk_alt_t; +struct hawk_alt_t +{ + /* ensure that hawk_alt_t matches the beginning part of hawk_t */ + HAWK_HDR; +}; + +/** \struct hawk_rtx_t + * The #hawk_rtx_t type defines a runtime context. A runtime context + * maintains runtime state for a running script. You can create multiple + * runtime contexts out of a single AWK interpreter; in other words, you + * can run the same script with different input and output data by providing + * customized I/O handlers when creating a runtime context with + * hawk_rtx_open(). + * + * I/O handlers are categoriezed into three kinds: console, file, pipe. + * The #hawk_rio_t type defines as a callback a set of I/O handlers + * to handle runtime I/O: + * - getline piped in from a command reads from a pipe. + * ("ls -l" | getline line) + * - print and printf piped out to a command write to a pipe. + * (print 2 | "sort") + * - getline redirected in reads from a file. + * (getline line < "file") + * - print and printf redirected out write to a file. + * (print num > "file") + * - The pattern-action loop and getline with no redirected input + * read from a console. (/susie/ { ... }) + * - print and printf write to a console. (print "hello, world") + * + * \sa hawk_t hawk_rtx_open hawk_rio_t + */ +typedef struct hawk_rtx_t hawk_rtx_t; + +#define HAWK_RTX_HDR \ + hawk_oow_t _instsize; \ + hawk_gem_t _gem; \ + int id; \ + hawk_t* awk + +typedef struct hawk_rtx_alt_t hawk_rtx_alt_t; +struct hawk_rtx_alt_t +{ + /* ensure that hawk_rtx_alt_t matches the beginning part of hawk_rtx_t */ + HAWK_RTX_HDR; +}; + +/** + * The hawk_loc_t type defines a structure to hold location. + */ +struct hawk_loc_t +{ + hawk_oow_t line; /**< line */ + hawk_oow_t colm; /**< column */ + const hawk_ooch_t* file; /**< file specified in @include */ +}; +typedef struct hawk_loc_t hawk_loc_t; + +/** + * The #HAWK_VAL_HDR defines the common header for a value. + * Three common fields are: + * - type - type of a value from #hawk_val_type_t + * - ref - reference count + * - stat - static value + * - nstr - numeric string marker, 1 -> integer, 2 -> floating-point number + */ +/* +#define HAWK_VAL_HDR \ + unsigned int type: 4; \ + unsigned int ref: 24; \ + unsigned int stat: 1; \ + unsigned int nstr: 2; \ + unsigned int fcb: 1 +*/ +#define HAWK_VAL_HDR \ + hawk_uintptr_t v_type: 4; \ + hawk_uintptr_t ref: ((HAWK_SIZEOF_UINTPTR_T * 8) - 8); \ + hawk_uintptr_t stat: 1; \ + hawk_uintptr_t nstr: 2; \ + hawk_uintptr_t fcb: 1 + +/** + * The hawk_val_t type is an abstract value type. A value commonly contains: + * - type of a value + * - reference count + * - indicator for a numeric string + */ +struct hawk_val_t +{ + HAWK_VAL_HDR; +}; + +/** + * The hawk_val_nil_t type is a nil value type. The type field is + * #HAWK_VAL_NIL. + */ +struct hawk_val_nil_t +{ + HAWK_VAL_HDR; +}; +typedef struct hawk_val_nil_t hawk_val_nil_t; + +/** + * The hawk_val_int_t type is an integer number type. The type field is + * #HAWK_VAL_INT. + */ +struct hawk_val_int_t +{ + HAWK_VAL_HDR; + hawk_int_t i_val; + void* nde; +}; +typedef struct hawk_val_int_t hawk_val_int_t; + +/** + * The hawk_val_flt_t type is a floating-point number type. The type field + * is #HAWK_VAL_FLT. + */ +struct hawk_val_flt_t +{ + HAWK_VAL_HDR; + hawk_flt_t val; + void* nde; +}; +typedef struct hawk_val_flt_t hawk_val_flt_t; + +/** + * The hawk_val_str_t type is a string type. The type field is + * #HAWK_VAL_STR. + */ +struct hawk_val_str_t +{ + HAWK_VAL_HDR; + hawk_oocs_t val; +}; +typedef struct hawk_val_str_t hawk_val_str_t; + +/** + * The hawk_val_str_t type is a string type. The type field is + * #HAWK_VAL_MBS. + */ +struct hawk_val_mbs_t +{ + HAWK_VAL_HDR; + hawk_bcs_t val; +}; +typedef struct hawk_val_mbs_t hawk_val_mbs_t; + +/** + * The hawk_val_rex_t type is a regular expression type. The type field + * is #HAWK_VAL_REX. + */ +struct hawk_val_rex_t +{ + HAWK_VAL_HDR; + hawk_oocs_t str; + void* code[2]; +}; +typedef struct hawk_val_rex_t hawk_val_rex_t; + +/** + * The hawk_val_map_t type defines a map type. The type field is + * #HAWK_VAL_MAP. + */ +struct hawk_val_map_t +{ + HAWK_VAL_HDR; + + /* TODO: make val_map to array if the indices used are all + * integers switch to map dynamically once the + * non-integral index is seen. + */ + hawk_htb_t* map; +}; +typedef struct hawk_val_map_t hawk_val_map_t; + +/** + * The hawk_val_ref_t type defines a reference type that is used + * internally only. The type field is #HAWK_VAL_REF. + */ +struct hawk_val_ref_t +{ + HAWK_VAL_HDR; + + enum + { + /* keep these items in the same order as corresponding items + * in hawk_nde_type_t. */ + HAWK_VAL_REF_NAMED, /**< plain named variable */ + HAWK_VAL_REF_GBL, /**< plain global variable */ + HAWK_VAL_REF_LCL, /**< plain local variable */ + HAWK_VAL_REF_ARG, /**< plain function argument */ + HAWK_VAL_REF_NAMEDIDX, /**< member of named map variable */ + HAWK_VAL_REF_GBLIDX, /**< member of global map variable */ + HAWK_VAL_REF_LCLIDX, /**< member of local map variable */ + HAWK_VAL_REF_ARGIDX, /**< member of map argument */ + HAWK_VAL_REF_POS /**< positional variable */ + } id; + + /* if id is HAWK_VAL_REF_POS, adr holds the index of a + * positional variable. If id is HAWK_VAL_REF_GBL, adr hold + * the index of a global variable. Otherwise, adr points to the value + * directly. */ + hawk_val_t** adr; +}; +typedef struct hawk_val_ref_t hawk_val_ref_t; + +/** + * The hawk_val_map_itr_t type defines the iterator to map value fields. + */ +struct hawk_val_map_itr_t +{ + hawk_htb_pair_t* pair; + hawk_oow_t buckno; +}; +typedef struct hawk_val_map_itr_t hawk_val_map_itr_t; + +/** + * The #HAWK_VAL_MAP_ITR_KEY macro get the pointer to the key part + * of a map value. + */ +#define HAWK_VAL_MAP_ITR_KEY(itr) \ + ((const hawk_oocs_t*)HAWK_HTB_KPTL((itr)->pair)) + +/** + * The #HAWK_VAL_MAP_ITR_VAL macro get the pointer to the value part + * of a map value. + */ +#define HAWK_VAL_MAP_ITR_VAL(itr) \ + ((const hawk_val_t*)HAWK_HTB_VPTR((itr)->pair)) + + +/** + * The hawk_val_map_data_type_t type defines the type of + * map value data for the #hawk_val_map_data_t structure. + */ +enum hawk_val_map_data_type_t +{ + HAWK_VAL_MAP_DATA_INT = 0, + HAWK_VAL_MAP_DATA_FLT, + HAWK_VAL_MAP_DATA_STR, + HAWK_VAL_MAP_DATA_MBS, + HAWK_VAL_MAP_DATA_WCS, + HAWK_VAL_MAP_DATA_CSTR, + HAWK_VAL_MAP_DATA_XSTR, + HAWK_VAL_MAP_DATA_MCSTR, + HAWK_VAL_MAP_DATA_MXSTR, + HAWK_VAL_MAP_DATA_WCSTR, + HAWK_VAL_MAP_DATA_WXSTR +}; +typedef enum hawk_val_map_data_type_t hawk_val_map_data_type_t; + +/** + * The hawk_val_map_data_t type defines a structure that + * describes a key/value pair for a map value to be created + * with hawk_makemapvalwithdata(). + */ +struct hawk_val_map_data_t +{ + hawk_oocs_t key; + hawk_val_map_data_type_t type; + void* vptr; +}; + +typedef struct hawk_val_map_data_t hawk_val_map_data_t; + + +/* ------------------------------------------------------------------------ */ + +/** + * The hawk_nde_type_t defines the node types. + */ +enum hawk_nde_type_t +{ + HAWK_NDE_NULL, + + /* statement */ + HAWK_NDE_BLK, + HAWK_NDE_IF, + HAWK_NDE_WHILE, + HAWK_NDE_DOWHILE, + HAWK_NDE_FOR, + HAWK_NDE_FOREACH, + HAWK_NDE_BREAK, + HAWK_NDE_CONTINUE, + HAWK_NDE_RETURN, + HAWK_NDE_EXIT, + HAWK_NDE_NEXT, + HAWK_NDE_NEXTFILE, + HAWK_NDE_DELETE, + HAWK_NDE_RESET, + + /* expression */ + /* if you change the following values including their order, + * you should change __evaluator of __eval_expression + * in run.c accordingly */ + HAWK_NDE_GRP, + HAWK_NDE_ASS, + HAWK_NDE_EXP_BIN, + HAWK_NDE_EXP_UNR, + HAWK_NDE_EXP_INCPRE, + HAWK_NDE_EXP_INCPST, + HAWK_NDE_CND, + HAWK_NDE_FNCALL_FNC, + HAWK_NDE_FNCALL_FUN, + HAWK_NDE_FNCALL_VAR, + HAWK_NDE_INT, + HAWK_NDE_FLT, + HAWK_NDE_STR, + HAWK_NDE_MBS, + HAWK_NDE_REX, + HAWK_NDE_FUN, + + /* keep this order for the following items otherwise, you may have + * to change eval_incpre and eval_incpst in run.c as well as + * HAWK_VAL_REF_XXX in hawk_val_ref_t. also do_assignment_map() + * in run.c converts HAWK_NDE_XXXIDX to HAWK_NDE_XXX by + * decrementing by 4. */ + HAWK_NDE_NAMED, + HAWK_NDE_GBL, + HAWK_NDE_LCL, + HAWK_NDE_ARG, + HAWK_NDE_NAMEDIDX, + HAWK_NDE_GBLIDX, + HAWK_NDE_LCLIDX, + HAWK_NDE_ARGIDX, + HAWK_NDE_POS, + /* ---------------------------------- */ + + HAWK_NDE_GETLINE, + HAWK_NDE_PRINT, + HAWK_NDE_PRINTF +}; +typedef enum hawk_nde_type_t hawk_nde_type_t; + +#define HAWK_NDE_HDR \ + hawk_nde_type_t type; \ + hawk_loc_t loc; \ + hawk_nde_t* next + +/** \struct hawk_nde_t + * The hawk_nde_t type defines a common part of a node. + */ +typedef struct hawk_nde_t hawk_nde_t; +struct hawk_nde_t +{ + HAWK_NDE_HDR; +}; + +/* ------------------------------------------------------------------------ */ + +/** + * The hawk_fun_t type defines a structure to maintain functions + * defined with the keyword 'function'. + */ +struct hawk_fun_t +{ + hawk_oocs_t name; + hawk_oow_t nargs; + hawk_ooch_t* argspec; /* similar to the argument spec of hawk_fnc_arg_t. supports v & r only. */ + hawk_nde_t* body; +}; +typedef struct hawk_fun_t hawk_fun_t; + +struct hawk_val_fun_t +{ + HAWK_VAL_HDR; + hawk_fun_t* fun; +}; +typedef struct hawk_val_fun_t hawk_val_fun_t; + +/* ------------------------------------------------------------------------ */ + +typedef hawk_flt_t (*hawk_math1_t) ( + hawk_t* awk, + hawk_flt_t x +); + +typedef hawk_flt_t (*hawk_math2_t) ( + hawk_t* awk, + hawk_flt_t x, + hawk_flt_t y +); + +/* ------------------------------------------------------------------------ */ + +typedef struct hawk_mod_spec_t hawk_mod_spec_t; + +struct hawk_mod_spec_t +{ + const hawk_ooch_t* prefix; + const hawk_ooch_t* postfix; + const hawk_ooch_t* name; +}; + +typedef void* (*hawk_mod_open_t) ( + hawk_t* awk, + const hawk_mod_spec_t* spec +); + +typedef void* (*hawk_mod_getsym_t) ( + hawk_t* awk, + void* handle, + const hawk_ooch_t* name +); + +typedef void (*hawk_mod_close_t) ( + hawk_t* awk, + void* handle +); + +/* ------------------------------------------------------------------------ */ + +#if 0 +typedef void* (*hawk_buildrex_t) ( + hawk_t* awk, + const hawk_ooch_t* ptn, + hawk_oow_t len +); + +typedef int (*hawk_matchrex_t) ( + hawk_t* awk, + void* code, + int option, + const hawk_ooch_t* str, + hawk_oow_t len, + const hawk_ooch_t** mptr, + hawk_oow_t* mlen +); + +typedef void (*hawk_freerex_t) ( + hawk_t* awk, + void* code +); + +typedef int (*hawk_isemptyrex_t) ( + hawk_t* awk, + void* code +); +#endif + +/** + * The hawk_sio_cmd_t type defines I/O commands for a script stream. + */ +enum hawk_sio_cmd_t +{ + HAWK_SIO_CMD_OPEN = 0, /**< open a script stream */ + HAWK_SIO_CMD_CLOSE = 1, /**< close a script stream */ + HAWK_SIO_CMD_READ = 2, /**< read text from an input script stream */ + HAWK_SIO_CMD_WRITE = 3 /**< write text to an output script stream */ +}; +typedef enum hawk_sio_cmd_t hawk_sio_cmd_t; + +/** + * The hawk_sio_lxc_t type defines a structure to store a character + * with its location information. + */ +struct hawk_sio_lxc_t +{ + hawk_ooci_t c; /**< character */ + hawk_oow_t line; /**< line */ + hawk_oow_t colm; /**< column */ + const hawk_ooch_t* file; /**< file */ +}; +typedef struct hawk_sio_lxc_t hawk_sio_lxc_t; + +typedef struct hawk_sio_arg_t hawk_sio_arg_t; + +/** + * The hawk_sio_arg_t type defines a structure to describe the source + * stream. + */ +struct hawk_sio_arg_t +{ + /** + * [IN/OUT] name of I/O object. + * It is #HAWK_NULL for the top-level stream. It points to a stream name + * for an included stream. This can be changed by an I/O handler. + */ + const hawk_ooch_t* name; + + /** + * [OUT] I/O handle set by a handler. + * The source stream handler can set this field when it opens a stream. + * All subsequent operations on the stream see this field as set + * during opening. + */ + void* handle; + + /** + * [OUT] unique id set by an input handler. it is used for a single time inclusion check. + */ + hawk_uint8_t unique_id[HAWK_SIZEOF_INTPTR_T * 2]; + + /** + * [IN] points to the includer. #HAWK_NULL for the toplevel. + * + */ + hawk_sio_arg_t* prev; + + /*-- from here down, internal use only --*/ + struct + { + hawk_ooch_t buf[1024]; + hawk_oow_t pos; + hawk_oow_t len; + } b; + + hawk_oow_t line; + hawk_oow_t colm; + + hawk_sio_lxc_t last; + int pragma_trait; +}; + +/** + * The hawk_sio_impl_t type defines a source IO function + */ +typedef hawk_ooi_t (*hawk_sio_impl_t) ( + hawk_t* awk, + hawk_sio_cmd_t cmd, + hawk_sio_arg_t* arg, + hawk_ooch_t* data, + hawk_oow_t count +); + +/** + * The hawk_rio_cmd_t type defines runtime I/O request types. + */ +enum hawk_rio_cmd_t +{ + HAWK_RIO_CMD_OPEN = 0, /**< open a stream */ + HAWK_RIO_CMD_CLOSE = 1, /**< close a stream */ + HAWK_RIO_CMD_READ = 2, /**< read a stream */ + HAWK_RIO_CMD_WRITE = 3, /**< write to a stream */ + /*HAWK_RIO_CMD_READ_BYTES = 4,*/ + HAWK_RIO_CMD_WRITE_BYTES = 5, + HAWK_RIO_CMD_FLUSH = 6, /**< flush buffered data to a stream */ + HAWK_RIO_CMD_NEXT = 7 /**< close the current stream and + open the next stream (only for console) */ +}; +typedef enum hawk_rio_cmd_t hawk_rio_cmd_t; + +/** + * The hawk_rio_mode_t type defines the I/O modes used by I/O handlers. + * Each I/O handler should inspect the requested mode and open an I/O + * stream accordingly for subsequent operations. + */ +enum hawk_rio_mode_t +{ + HAWK_RIO_PIPE_READ = 0, /**< open a pipe for read */ + HAWK_RIO_PIPE_WRITE = 1, /**< open a pipe for write */ + HAWK_RIO_PIPE_RW = 2, /**< open a pipe for read and write */ + + HAWK_RIO_FILE_READ = 0, /**< open a file for read */ + HAWK_RIO_FILE_WRITE = 1, /**< open a file for write */ + HAWK_RIO_FILE_APPEND = 2, /**< open a file for append */ + + HAWK_RIO_CONSOLE_READ = 0, /**< open a console for read */ + HAWK_RIO_CONSOLE_WRITE = 1 /**< open a console for write */ +}; +typedef enum hawk_rio_mode_t hawk_rio_mode_t; + +/* + * The hawk_rio_rwcmode_t type defines I/O closing modes, especially for + * a two-way pipe. + */ +enum hawk_rio_rwcmode_t +{ + HAWK_RIO_CMD_CLOSE_FULL = 0, /**< close both read and write end */ + HAWK_RIO_CMD_CLOSE_READ = 1, /**< close the read end */ + HAWK_RIO_CMD_CLOSE_WRITE = 2 /**< close the write end */ +}; +typedef enum hawk_rio_rwcmode_t hawk_rio_rwcmode_t; + +/** + * The hawk_rio_arg_t defines the data structure passed to a runtime + * I/O handler. An I/O handler should inspect the \a mode field and the + * \a name field and store an open handle to the \a handle field when + * #HAWK_RIO_CMD_OPEN is requested. For other request type, it can refer + * to the \a handle field set previously. + */ +struct hawk_rio_arg_t +{ + /* read-only. a user handler shouldn't change any of these fields */ + hawk_rio_mode_t mode; /**< opening mode */ + hawk_ooch_t* name; /**< name of I/O object */ + hawk_rio_rwcmode_t rwcmode; /**< closing mode for rwpipe */ + + /* read-write. a user handler can do whatever it likes to do with these. */ + void* handle; /**< I/O handle set by a handler */ + int uflags; /**< user-flags set by a handler */ + + /*-- from here down, internal use only --*/ + int type; + int rwcstate; /* closing state for rwpipe */ + + struct + { + hawk_ooch_t buf[2048]; + hawk_oow_t pos; + hawk_oow_t len; + int eof; + int eos; + } in; + + struct + { + int eof; + int eos; + } out; + + struct hawk_rio_arg_t* next; +}; +typedef struct hawk_rio_arg_t hawk_rio_arg_t; + +/** + * The hawk_rio_impl_t type defines a runtime I/O handler. + */ +typedef hawk_ooi_t (*hawk_rio_impl_t) ( + hawk_rtx_t* rtx, + hawk_rio_cmd_t cmd, + hawk_rio_arg_t* arg, + void* data, + hawk_oow_t count +); + +/** + * The hawk_prm_t type defines primitive functions required to perform + * a set of primitive operations. + */ +struct hawk_prm_t +{ + struct + { + hawk_math2_t pow; /**< floating-point power function */ + hawk_math2_t mod; /**< floating-point remainder function */ + } math; + + hawk_mod_open_t modopen; + hawk_mod_close_t modclose; + hawk_mod_getsym_t modgetsym; + +#if 0 + struct + { + /* TODO: accept regular expression handling functions */ + hawk_buildrex_t build; + hawk_matchrex_t match; + hawk_freerex_t free; + hawk_isemptyrex_t isempty; + } rex; +#endif +}; +typedef struct hawk_prm_t hawk_prm_t; + +/* ------------------------------------------------------------------------ */ + +/** + * The hawk_sio_cbs_t type defines a script stream handler set. + * The hawk_parse() function calls the input and output handler to parse + * a script and optionally deparse it. Typical input and output handlers + * are shown below: + * + * \code + * hawk_ooi_t in ( + * hawk_t* awk, hawk_sio_cmd_t cmd, + * hawk_sio_arg_t* arg, + * hawk_ooch_t* buf, hawk_oow_t size) + * { + * if (cmd == HAWK_SIO_CMD_OPEN) open input stream of arg->name; + * else if (cmd == HAWK_SIO_CMD_CLOSE) close input stream; + * else read input stream and fill buf up to size characters; + * } + * + * hawk_ooi_t out ( + * hawk_t* awk, hawk_sio_cmd_t cmd, + * hawk_sio_arg_t* arg, + * hawk_ooch_t* data, hawk_oow_t size) + * { + * if (cmd == HAWK_SIO_CMD_OPEN) open_output_stream of arg->name; + * else if (cmd == HAWK_SIO_CMD_CLOSE) close_output_stream; + * else write data of size characters to output stream; + * } + * \endcode + * + * For #HAWK_SIO_CMD_OPEN, a handler must return: + * - -1 if it failed to open a stream. + * - 0 if it has opened a stream but has reached the end. + * - 1 if it has successfully opened a stream. + * + * For #HAWK_SIO_CMD_CLOSE, a handler must return: + * - -1 if it failed to close a stream. + * - 0 if it has closed a stream. + * + * For #HAWK_SIO_CMD_READ and #HAWK_SIO_CMD_WRITE, a handler must return: + * - -1 if there was an error occurred during operation. + * - 0 if it has reached the end. + * - the number of characters read or written on success. + */ +struct hawk_sio_cbs_t +{ + hawk_sio_impl_t in; /**< input script stream handler */ + hawk_sio_impl_t out; /**< output script stream handler */ +}; +typedef struct hawk_sio_cbs_t hawk_sio_cbs_t; + +/* ------------------------------------------------------------------------ */ + +/** + * The hawk_rio_t type defines a runtime I/O handler set. + * \sa hawk_rtx_t + */ +struct hawk_rio_cbs_t +{ + hawk_rio_impl_t pipe; /**< pipe handler */ + hawk_rio_impl_t file; /**< file handler */ + hawk_rio_impl_t console; /**< console handler */ +}; +typedef struct hawk_rio_cbs_t hawk_rio_cbs_t; + +/* ------------------------------------------------------------------------ */ + +typedef struct hawk_fnc_t hawk_fnc_t; +typedef struct hawk_fnc_info_t hawk_fnc_info_t; + +/** + * The hawk_fnc_impl_t type defines a intrinsic function handler. + */ +typedef int (*hawk_fnc_impl_t) ( + hawk_rtx_t* rtx, /**< runtime context */ + const hawk_fnc_info_t* fi /**< function information */ +); + +/** + * The hawk_fnc_marg_t type defines a structure to describe arguments + * to an implicit function. + */ +struct hawk_fnc_marg_t +{ + /** minimum numbers of argument for a function */ + hawk_oow_t min; + + /** maximum numbers of argument for a function */ + hawk_oow_t max; + + /** + * if min is greater than max, spec points to an external module + * name where the function is found. otherwise, spec can be #HAWK_NULL + * to indicate all arguments are passed by value or point to a + * argument specification string composed of 'max' characters. + * Each character can be one of: + * - v: value + * - r: reference + * - x: regular expression + */ + const hawk_bch_t* spec; +}; +typedef struct hawk_fnc_marg_t hawk_fnc_marg_t; + +/** + * The hawk_fnc_warg_t type defines a structure to describe arguments + * to an implicit function. + */ +struct hawk_fnc_warg_t +{ + hawk_oow_t min; + hawk_oow_t max; + const hawk_uch_t* spec; +}; +typedef struct hawk_fnc_warg_t hawk_fnc_warg_t; + +/** + * The hawk_fnc_mspec_t type defines a structure to hold the specification + * of an intrinsic function or a module function. + */ +struct hawk_fnc_mspec_t +{ + /** argument descriptor */ + hawk_fnc_marg_t arg; + + /** pointer to the function implementing this function */ + hawk_fnc_impl_t impl; + + /** + * when this field is set to a non-zero value bitwise-ORed of + * #hawk_trait_t enumerators, the function is available if + * this field bitwise-ANDed with the global trait option produces + * this field itself. + * + * this field doesn't take effect for a module function. + */ + int trait; +}; +typedef struct hawk_fnc_mspec_t hawk_fnc_mspec_t; + +/** + * The hawk_fnc_wspec_t type defines a structure to hold the specification + * of an intrinsic function or a module function. + */ +struct hawk_fnc_wspec_t +{ + /** argument descriptor */ + hawk_fnc_warg_t arg; + + /** pointer to the function implementing this function */ + hawk_fnc_impl_t impl; + + /** + * when this field is set to a non-zero value bitwise-ORed of + * #hawk_trait_t enumerators, the function is available if + * this field bitwise-ANDed with the global trait option produces + * this field itself. + * + * this field doesn't take effect for a module function. + */ + int trait; +}; +typedef struct hawk_fnc_wspec_t hawk_fnc_wspec_t; + +#if defined(HAWK_OOCH_IS_BCH) +typedef hawk_fnc_marg_t hawk_fnc_arg_t; +typedef hawk_fnc_mspec_t hawk_fnc_spec_t; +#else +typedef hawk_fnc_warg_t hawk_fnc_arg_t; +typedef hawk_fnc_wspec_t hawk_fnc_spec_t; +#endif + +/* ------------------------------------------------------------------------ */ + +typedef struct hawk_mod_t hawk_mod_t; +typedef struct hawk_mod_sym_t hawk_mod_sym_t; + +struct hawk_fnc_info_t +{ + hawk_oocs_t name; + + /** #HAWK_NULL if the function is not registered from module */ + hawk_mod_t* mod; +}; + + +typedef int (*hawk_mod_load_t) ( + hawk_mod_t* mod, + hawk_t* awk +); + +typedef int (*hawk_mod_query_t) ( + hawk_mod_t* mod, + hawk_t* awk, + const hawk_ooch_t* name, + hawk_mod_sym_t* sym +); + +typedef void (*hawk_mod_unload_t) ( + hawk_mod_t* mod, + hawk_t* awk +); + +typedef int (*hawk_mod_init_t) ( + hawk_mod_t* mod, + hawk_rtx_t* rtx +); + +typedef void (*hawk_mod_fini_t) ( + hawk_mod_t* mod, + hawk_rtx_t* rtx +); + +struct hawk_mod_t +{ + hawk_mod_query_t query; + hawk_mod_unload_t unload; /* unload the module */ + + hawk_mod_init_t init; /* per-rtx initialization */ + hawk_mod_fini_t fini; /* per-rtx finalization */ + + void* ctx; +}; + +enum hawk_mod_sym_type_t +{ + HAWK_MOD_FNC = 0, + HAWK_MOD_INT, /* constant */ + HAWK_MOD_FLT /* constant */ + /*HAWK_MOD_STR, + HAWK_MOD_VAR, + */ +}; +typedef enum hawk_mod_sym_type_t hawk_mod_sym_type_t; +typedef hawk_fnc_spec_t hawk_mod_sym_fnc_t; +typedef struct hawk_mod_sym_int_t hawk_mod_sym_int_t; +typedef struct hawk_mod_sym_flt_t hawk_mod_sym_flt_t; + +struct hawk_mod_sym_int_t +{ + hawk_int_t val; +}; + +struct hawk_mod_sym_flt_t +{ + hawk_flt_t val; +}; + +struct hawk_mod_sym_t +{ + hawk_mod_sym_type_t type; + union + { + hawk_mod_sym_fnc_t fnc; + hawk_mod_sym_int_t in; + hawk_mod_sym_flt_t flt; + } u; +}; + + +/* ------------------------------------------------------------------------ */ + +/** + * The hawk_ecb_close_t type defines the callback function + * called when an awk object is closed. The hawk_close() function + * calls this callback function after having called hawk_clear() + * but before actual closing. + */ +typedef void (*hawk_ecb_close_t) ( + hawk_t* awk /**< awk */ +); + +/** + * The hawk_ecb_clear_t type defines the callback function + * called when an awk object is cleared. The hawk_clear() function + * calls this calllback function before it performs actual clearing. + */ +typedef void (*hawk_ecb_clear_t) ( + hawk_t* awk /**< awk */ +); + +/** + * The hawk_ecb_t type defines an event callback set. + * You can register a callback function set with + * hawk_pushecb(). The callback functions in the registered + * set are called in the reverse order of registration. + */ +typedef struct hawk_ecb_t hawk_ecb_t; +struct hawk_ecb_t +{ + /** + * called by hawk_close(). + */ + hawk_ecb_close_t close; + + /** + * called by hawk_clear(). + */ + hawk_ecb_clear_t clear; + + /* internal use only. don't touch this field */ + hawk_ecb_t* next; +}; + +/* ------------------------------------------------------------------------ */ + +/** + * The hawk_rtx_ecb_close_t type defines the callback function + * called when the runtime context is closed. + */ +typedef void (*hawk_rtx_ecb_close_t) ( + hawk_rtx_t* rtx /**< runtime context */ +); + + +/** + * The hawk_rtx_ecb_stmt_t type defines the callback function for each + * statement. + */ +typedef void (*hawk_rtx_ecb_stmt_t) ( + hawk_rtx_t* rtx, /**< runtime context */ + hawk_nde_t* nde /**< node */ +); + +/** + * The hawk_rtx_ecb_gblset_t type defines the callback function + * executed when a global variable is set with a value. It is not + * called when a global variable is changed implicitly. For example, + * it is not called when FNR is updated for each record read. + */ +typedef void (*hawk_rtx_ecb_gblset_t) ( + hawk_rtx_t* rtx, /**< runtime context */ + hawk_oow_t idx, /**< global variable index */ + hawk_val_t* val /**< value */ +); + +/** + * The hawk_rtx_ecb_t type defines an event callback set for a + * runtime context. You can register a callback function set with + * hawk_rtx_pushecb(). The callback functions in the registered + * set are called in the reverse order of registration. + */ +typedef struct hawk_rtx_ecb_t hawk_rtx_ecb_t; +struct hawk_rtx_ecb_t +{ + /** + * called by hawk_rtx_close(). + */ + hawk_rtx_ecb_close_t close; + + /** + * called by hawk_rtx_loop() and hawk_rtx_call() for + * each statement executed. + */ + hawk_rtx_ecb_stmt_t stmt; + + /** + * called when a global variable is set with a value. + */ + hawk_rtx_ecb_gblset_t gblset; + + /* internal use only. don't touch this field */ + hawk_rtx_ecb_t* next; +}; + +/* ------------------------------------------------------------------------ */ + +/** + * The hawk_opt_t type defines various option types. + */ +enum hawk_opt_t +{ + /** trait option. 0 or bitwise-ORed of ::hawk_trait_t values */ + HAWK_TRAIT, + + HAWK_MODPREFIX, + HAWK_MODPOSTFIX, + + HAWK_INCLUDEDIRS, + + HAWK_DEPTH_INCLUDE, + HAWK_DEPTH_BLOCK_PARSE, + HAWK_DEPTH_BLOCK_RUN, + HAWK_DEPTH_EXPR_PARSE, + HAWK_DEPTH_EXPR_RUN, + HAWK_DEPTH_REX_BUILD, + HAWK_DEPTH_REX_MATCH, + + HAWK_RTX_STACK_LIMIT +}; +typedef enum hawk_opt_t hawk_opt_t; + +/* ------------------------------------------------------------------------ */ + +/** + * The hawk_trait_t type defines various options to change the behavior + * of #hawk_t. + */ +enum hawk_trait_t +{ + /** allows undeclared variables */ + HAWK_IMPLICIT = (1 << 0), + + /** enables nextofile and NEXTOFILE */ + HAWK_NEXTOFILE = (1 << 1), + + /** supports \b getline, \b print, \b printf, \b close, \b fflush, + * piping, and file rediction */ + HAWK_RIO = (1 << 3), + + /** enables the two-way pipe if #HAWK_RIO is on */ + HAWK_RWPIPE = (1 << 4), + + /** a new line can terminate a statement */ + HAWK_NEWLINE = (1 << 5), + + /** + * removes empty fields when splitting a record if FS is a regular + * expression and the match is all spaces. + * + * \code + * BEGIN { FS="[[:space:]]+"; } + * { + * print "NF=" NF; + * for (i = 0; i < NF; i++) print i " [" $(i+1) "]"; + * } + * \endcode + * " a b c " is split to [a], [b], [c] if #HAWK_STRIPRECSPC is on. + * Otherwise, it is split to [], [a], [b], [c], []. + * + * \code + * BEGIN { + * n=split(" oh my noodle ", x, /[ o]+/); + * for (i=1;i<=n;i++) print "[" x[i] "]"; + * } + * \endcode + * This example splits the string to [], [h], [my], [n], [dle] + * if #HAWK_STRIPRECSPC is on. Otherwise, it results in + * [], [h], [my], [n], [dle], []. Note that the first empty field is not + * removed as the field separator is not all spaces. (space + 'o'). + */ + HAWK_STRIPRECSPC = (1 << 6), + + /** strips off leading spaces when converting a string to a number. */ + HAWK_STRIPSTRSPC = (1 << 7), + + /** enable implicit concatenation. + * if this is off, you need %% for concatenation. */ + HAWK_BLANKCONCAT = (1 << 8), + + /** CR + LF by default */ + HAWK_CRLF = (1 << 10), + + /** treats a map value more flexibly. a function can return + * a map. you can override a map with a scalar value without + * 'delete' or '\@reset'. + */ + HAWK_FLEXMAP = (1 << 11), + + /** allows \b BEGIN, \b END, pattern-action blocks */ + HAWK_PABLOCK = (1 << 12), + + /** allows {n,m} in a regular expression. */ + HAWK_REXBOUND = (1 << 13), + + /** + * performs numeric comparison when a string convertable + * to a number is compared with a number or vice versa. + * + * For an expression (9 > "10.9"), + * - 9 is greater if #HAWK_NCMPONSTR is off; + * - "10.9" is greater if #HAWK_NCMPONSTR is on + */ + HAWK_NCMPONSTR = (1 << 14), + + /** + * enables the strict naming rule. + * - a parameter name can not be the same as the owning function name. + * - a local variable name can not be the same as the owning + * function name. + */ + HAWK_STRICTNAMING = (1 << 15), + + /** + * makes AWK more fault-tolerant. + * - prevents termination due to print and printf failure. + * - achieves this by handling print and printf as if + * they are functions like getline. + * - allows an expression group in a normal context + * without the 'in' operator. the evaluation result + * of the last expression is returned as that of + * the expression group. + * - e.g.) a = (1, 3 * 3, 4, 5 + 1); # a is assigned 6. + */ + HAWK_TOLERANT = (1 << 17), + + /** + * makes #hawk_t to behave compatibly with classical AWK + * implementations + */ + HAWK_CLASSIC = + HAWK_IMPLICIT | HAWK_RIO | + HAWK_NEWLINE | HAWK_BLANKCONCAT | HAWK_PABLOCK | + HAWK_STRIPSTRSPC | HAWK_STRICTNAMING, + + HAWK_MODERN = + HAWK_CLASSIC | HAWK_FLEXMAP | + HAWK_RWPIPE | HAWK_TOLERANT | HAWK_NEXTOFILE /*| HAWK_NCMPONSTR*/ +}; +typedef enum hawk_trait_t hawk_trait_t; + +/* ------------------------------------------------------------------------ */ + +/** + * The hawk_errinf_t type defines a placeholder for error information. + */ +struct hawk_errinf_t +{ + hawk_errnum_t num; /**< error number */ + hawk_ooch_t msg[HAWK_ERRMSG_CAPA]; /**< error message */ + hawk_loc_t loc; /**< error location */ +}; +typedef struct hawk_errinf_t hawk_errinf_t; + +/** + * The hawk_errstr_t type defines an error string getter. It should return + * an error formatting string for an error number requested. A new string + * should contain the same number of positional parameters (${X}) as in the + * default error formatting string. You can set a new getter into an awk + * object with the hawk_seterrstr() function to customize an error string. + */ +typedef const hawk_ooch_t* (*hawk_errstr_t) ( + hawk_t* awk, /**< awk */ + hawk_errnum_t num /**< error number */ +); + +/** + * The hawk_gbl_id_t type defines intrinsic globals variable IDs. + */ +enum hawk_gbl_id_t +{ + /* this table should match gtab in parse.c. + * in addition, hawk_rtx_setgbl also counts + * on the order of these values. + * + * note that set_global() in run.c contains code + * preventing these global variables from being assigned + * with a map value. if you happen to add one that can + * be a map, don't forget to change code in set_global(). + * but is this check really necessary??? + */ + + HAWK_GBL_CONVFMT, + HAWK_GBL_FILENAME, + HAWK_GBL_FNR, + HAWK_GBL_FS, + HAWK_GBL_IGNORECASE, + HAWK_GBL_NF, + HAWK_GBL_NR, + HAWK_GBL_OFILENAME, + HAWK_GBL_OFMT, + HAWK_GBL_OFS, + HAWK_GBL_ORS, + HAWK_GBL_RLENGTH, + HAWK_GBL_RS, + HAWK_GBL_RSTART, + HAWK_GBL_STRIPRECSPC, + HAWK_GBL_SUBSEP, + + /* these are not not the actual IDs and are used internally only + * Make sure you update these values properly if you add more + * ID definitions, however */ + HAWK_MIN_GBL_ID = HAWK_GBL_CONVFMT, + HAWK_MAX_GBL_ID = HAWK_GBL_SUBSEP +}; +typedef enum hawk_gbl_id_t hawk_gbl_id_t; + +/** + * The hawk_val_type_t type defines types of AWK values. Each value + * allocated is tagged with a value type in the \a type field. + * \sa hawk_val_t HAWK_VAL_HDR + */ +enum hawk_val_type_t +{ + /* the values between HAWK_VAL_NIL and HAWK_VAL_FUN inclusive + * must be synchronized with an internal table of the __cmp_val + * function in run.c and the __val_type_name in val.c */ + HAWK_VAL_NIL = 0, /**< nil */ + HAWK_VAL_INT = 1, /**< integer */ + HAWK_VAL_FLT = 2, /**< floating-pointer number */ + HAWK_VAL_STR = 3, /**< string */ + HAWK_VAL_MBS = 4, /**< byte array */ + HAWK_VAL_FUN = 5, /**< function pointer */ + HAWK_VAL_MAP = 6, /**< map */ + + HAWK_VAL_REX = 7, /**< regular expression */ + HAWK_VAL_REF = 8 /**< reference to other types */ +}; +typedef enum hawk_val_type_t hawk_val_type_t; + +/** + * The values defined are used to set the type field of the + * #hawk_rtx_valtostr_out_t structure. The field should be one of the + * following values: + * + * - #HAWK_RTX_VALTOSTR_CPL + * - #HAWK_RTX_VALTOSTR_CPLCPY + * - #HAWK_RTX_VALTOSTR_CPLDUP + * - #HAWK_RTX_VALTOSTR_STRP + * - #HAWK_RTX_VALTOSTR_STRPCAT + * + * and it can optionally be ORed with #HAWK_RTX_VALTOSTR_PRINT. + */ +enum hawk_rtx_valtostr_type_t +{ + /** use u.cpl of #hawk_rtx_valtostr_out_t */ + HAWK_RTX_VALTOSTR_CPL = 0x00, + /** use u.cplcpy of #hawk_rtx_valtostr_out_t */ + HAWK_RTX_VALTOSTR_CPLCPY = 0x01, + /** use u.cpldup of #hawk_rtx_valtostr_out_t */ + HAWK_RTX_VALTOSTR_CPLDUP = 0x02, + /** use u.strp of #hawk_rtx_valtostr_out_t */ + HAWK_RTX_VALTOSTR_STRP = 0x03, + /** use u.strpcat of #hawk_rtx_valtostr_out_t */ + HAWK_RTX_VALTOSTR_STRPCAT = 0x04, + /** convert for print */ + HAWK_RTX_VALTOSTR_PRINT = 0x10 +}; + +/** + * The hawk_rtx_valtostr() function converts a value to a string as + * indicated in a parameter of the hawk_rtx_valtostr_out_t type. + */ +struct hawk_rtx_valtostr_out_t +{ + int type; /**< enum #hawk_rtx_valtostr_type_t */ + + union + { + hawk_oocs_t cpl; + hawk_oocs_t cplcpy; + hawk_oocs_t cpldup; /* need to free cpldup.ptr */ + hawk_ooecs_t* strp; + hawk_ooecs_t* strpcat; + } u; +}; +typedef struct hawk_rtx_valtostr_out_t hawk_rtx_valtostr_out_t; + +/* record filter using NR */ +struct hawk_nrflt_t +{ + hawk_int_t limit; + hawk_int_t size; + hawk_int_t rank; +}; +typedef struct hawk_nrflt_t hawk_nrflt_t; + +#if defined(__cplusplus) +extern "C" { +#endif + +/** + * The hawk_open() function creates a new #hawk_t object. The object + * created can be passed to other hawk_xxx() functions and is valid until + * it is destroyed with the hawk_close() function. The function saves the + * memory manager pointer while it copies the contents of the primitive + * function structures. Therefore, you should keep the memory manager valid + * during the whole life cycle of an hawk_t object. + * + * \code + * hawk_t* dummy() + * { + * hawk_mmgr_t mmgr; + * hawk_prm_t prm; + * return hawk_open ( + * &mmgr, // NOT OK because the contents of mmgr is + * // invalidated when dummy() returns. + * 0, + * &prm, // OK + * HAWK_NULL + * ); + * } + * \endcode + * + * Upon failure, it stores the error number to a variable pointed to + * by \a errnum. if \a errnum is #HAWK_NULL, no error number is stored. + * + * \return a pointer to a hawk_t object on success, #HAWK_NULL on failure. + */ +HAWK_EXPORT hawk_t* hawk_open ( + hawk_mmgr_t* mmgr, /**< memory manager */ + hawk_oow_t xtnsize, /**< extension size in bytes */ + hawk_cmgr_t* cmgr, /**< character conversion manager */ + const hawk_prm_t* prm, /**< pointer to a primitive function structure */ + hawk_errnum_t* errnum /**< pointer to an error number varaible */ +); + +/** + * The hawk_close() function destroys a hawk_t object. + */ +HAWK_EXPORT void hawk_close ( + hawk_t* awk /**< awk */ +); + +#if defined(HAWK_HAVE_INLINE) +/** + * The hawk_getxtn() function returns the pointer to the extension area + * placed behind the actual awk object. + */ +static HAWK_INLINE void* hawk_getxtn (hawk_t* awk) { return (void*)((hawk_uint8_t*)awk + ((hawk_alt_t*)awk)->_instsize); } +/** + * The hawk_getmmgr() function gets the memory manager used in + * hawk_open(). + */ +static HAWK_INLINE hawk_mmgr_t* hawk_getmmgr (hawk_t* awk) { return ((hawk_alt_t*)awk)->_gem.mmgr; } +static HAWK_INLINE hawk_cmgr_t* hawk_getcmgr (hawk_t* awk) { return ((hawk_alt_t*)awk)->_gem.cmgr; } +static HAWK_INLINE void hawk_setcmgr (hawk_t* awk, hawk_cmgr_t* cmgr) { ((hawk_alt_t*)awk)->_gem.cmgr = cmgr; } +#else +# define hawk_getxtn(awk) ((void*)((hawk_uint8_t*)awk + ((hawk_alt_t*)awk)->_instsize)) +# define hawk_getmmgr(awk) (((hawk_alt_t*)(awk))->_gem.mmgr) +# define hawk_getcmgr(awk) (((hawk_alt_t*)(awk))->_gem.cmgr) +# define hawk_setcmgr(awk,_cmgr) (((hawk_alt_t*)(awk))->_gem.cmgr = (_cmgr)) +#endif /* HAWK_HAVE_INLINE */ + +/** + * The hawk_getprm() function retrieves primitive functions + * associated. Actual function pointers are copied into a + * structure specified by \a prm. + */ +HAWK_EXPORT void hawk_getprm ( + hawk_t* awk, + hawk_prm_t* prm +); + +/** + * The hawk_setprm() function changes existing primitive + * functions. + */ +HAWK_EXPORT void hawk_setprm ( + hawk_t* awk, + const hawk_prm_t* prm +); + +/** + * The hawk_clear() clears the internal state of \a awk. If you want to + * reuse a hawk_t instance that finished being used, you may call + * hawk_clear() instead of destroying and creating a new + * #hawk_t instance using hawk_close() and hawk_open(). + + */ +HAWK_EXPORT void hawk_clear ( + hawk_t* awk +); + +/** + * The hawk_geterrstr() gets an error string getter. + */ +HAWK_EXPORT hawk_errstr_t hawk_geterrstr ( + hawk_t* awk /**< awk */ +); + +/** + * The hawk_seterrstr() sets an error string getter that is called to + * compose an error message when its retrieval is requested. + * + * Here is an example of changing the formatting string for the #HAWK_SED_ECMDNR + * error. + * \code + * hawk_errstr_t orgerrstr; + * + * const hawk_ooch_t* myerrstr (hawk_t* awk, hawk_errnum_t num) + * { + * if (num == HAWK_SED_ECMDNR) return HAWK_T("unrecognized command ${0}"); + * return orgerrstr (awk, num); + * } + * int main () + * { + * hawk_t* awk; + * ... + * orgerrstr = hawk_geterrstr (awk); + * hawk_seterrstr (awk, myerrstr); + * ... + * } + * \endcode + */ +HAWK_EXPORT void hawk_seterrstr ( + hawk_t* awk, /**< awk */ + hawk_errstr_t errstr /**< error string getter */ +); + +/** + * The hawk_geterrnum() function returns the number of the last error + * occurred. + * \return error number + */ + +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE hawk_errnum_t hawk_geterrnum (hawk_t* awk) { return ((hawk_alt_t*)awk)->_gem.errnum; } +#else +# define hawk_geterrnum(awk) (((hawk_alt_t*)(awk))->_gem.errnum) +#endif + +/** + * The hawk_geterrloc() function returns the location where the + * last error has occurred. + */ +HAWK_EXPORT const hawk_loc_t* hawk_geterrloc ( + hawk_t* awk /**< awk */ +); + +/** + * The hawk_geterrbmsg() function returns the error message describing + * the last error occurred. + * + * \return error message + */ +HAWK_EXPORT const hawk_bch_t* hawk_geterrbmsg ( + hawk_t* awk /**< awk */ +); + +/** + * The hawk_geterrumsg() function returns the error message describing + * the last error occurred. + * + * \return error message + */ +HAWK_EXPORT const hawk_uch_t* hawk_geterrumsg ( + hawk_t* awk /**< awk */ +); + + +#if defined(HAWK_OOCH_IS_BCH) +# define hawk_geterrmsg hawk_geterrbmsg +#else +# define hawk_geterrmsg hawk_geterrumsg +#endif + + +HAWK_EXPORT const hawk_ooch_t* hawk_backuperrmsg ( + hawk_t* awk /**< awk */ +); + + +/** + * The hawk_geterrinf() function copies error information into memory + * pointed to by \a errinf from \a awk. + */ +HAWK_EXPORT void hawk_geterrinf ( + hawk_t* awk, /**< awk */ + hawk_errinf_t* errinf /**< error information buffer */ +); + +/** + * The hawk_seterrnum() function sets the error information omitting + * error location. You must pass a non-NULL for \a errarg if the specified + * error number \a errnum requires one or more arguments to format an + * error message. + */ +HAWK_EXPORT void hawk_seterrnum ( + hawk_t* awk, /**< awk */ + hawk_errnum_t errnum, /**< error number */ + const hawk_oocs_t* errarg /**< argument array for formatting + * an error message */ +); + +HAWK_EXPORT void hawk_seterrbfmt ( + hawk_t* awk, + hawk_errnum_t errnum, + hawk_loc_t* errloc, + const hawk_bch_t* errfmt, + ... +); + +HAWK_EXPORT void hawk_seterrufmt ( + hawk_t* awk, + hawk_errnum_t errnum, + hawk_loc_t* errloc, + const hawk_uch_t* errfmt, + ... +); + +#if defined(HAWK_OOCH_IS_UCH) +# define hawk_seterrfmt hawk_seterrufmt +#else +# define hawk_seterrfmt hawk_seterrbfmt +#endif + +/** + * The hawk_seterrinf() function sets the error information. This function + * may be useful if you want to set a custom error message rather than letting + * it automatically formatted. + */ +HAWK_EXPORT void hawk_seterrinf ( + hawk_t* awk, /**< awk */ + const hawk_errinf_t* errinf /**< error information */ +); + + +/** + * The hawk_geterror() function gets error information via parameters. + */ +HAWK_EXPORT void hawk_geterror ( + hawk_t* awk, /**< awk */ + hawk_errnum_t* errnum, /**< error number */ + const hawk_ooch_t** errmsg, /**< error message */ + hawk_loc_t* errloc /**< error location */ +); + +/** + * The hawk_seterror() function sets error information. + */ +HAWK_EXPORT void hawk_seterror ( + hawk_t* awk, /**< awk */ + hawk_errnum_t errnum, /**< error number */ + const hawk_oocs_t* errarg, /**< argument array for formatting an error message */ + const hawk_loc_t* errloc /**< error location */ +); + +/** + * The hawk_getopt() function gets the value of an option + * specified by \a id into the buffer pointed to by \a value. + * + * \return 0 on success, -1 on failure + */ +HAWK_EXPORT int hawk_getopt ( + hawk_t* awk, + hawk_opt_t id, + void* value +); + +/** + * The hawk_setopt() function sets the value of an option + * specified by \a id to the value pointed to by \a value. + * + * \return 0 on success, -1 on failure + */ +HAWK_EXPORT int hawk_setopt ( + hawk_t* awk, + hawk_opt_t id, + const void* value +); + +/** + * The hawk_popecb() function pops an awk event callback set + * and returns the pointer to it. If no callback set can be popped, + * it returns #HAWK_NULL. + */ +HAWK_EXPORT hawk_ecb_t* hawk_popecb ( + hawk_t* awk /**< awk */ +); + +/** + * The hawk_pushecb() function register a runtime callback set. + */ +HAWK_EXPORT void hawk_pushecb ( + hawk_t* awk, /**< awk */ + hawk_ecb_t* ecb /**< callback set */ +); + +/** + * The hawk_addgblwithbcstr() function adds an intrinsic global variable. + * \return the ID of the global variable added on success, -1 on failure. + */ +HAWK_EXPORT int hawk_addgblwithbcstr ( + hawk_t* awk, /**< awk */ + const hawk_bch_t* name /**< variable name */ +); + +/** + * The hawk_addgblwithucstr() function adds an intrinsic global variable. + * \return the ID of the global variable added on success, -1 on failure. + */ +HAWK_EXPORT int hawk_addgblwithucstr ( + hawk_t* awk, /**< awk */ + const hawk_uch_t* name /**< variable name */ +); + +/** + * The hawk_delgblwithbcstr() function deletes an intrinsic global variable by name. + * \return 0 on success, -1 on failure + */ +HAWK_EXPORT int hawk_delgblwithbcstr ( + hawk_t* awk, /**< awk */ + const hawk_bch_t* name /**< variable name */ +); + +/** + * The hawk_delgblwithucstr() function deletes an intrinsic global variable by name. + * \return 0 on success, -1 on failure + */ +HAWK_EXPORT int hawk_delgblwithucstr ( + hawk_t* awk, /**< awk */ + const hawk_uch_t* name /**< variable name */ +); + +/** + * The hawk_findgblwithbcstr() function returns the numeric ID of an intrinsic global + * variable. + * \return number >= 0 on success, -1 on failure + */ +HAWK_EXPORT int hawk_findgblwithbcstr ( + hawk_t* awk, /**< awk */ + const hawk_bch_t* name /**< variable name */ +); + +/** + * The hawk_findgblwithucstr() function returns the numeric ID of an intrinsic global + * variable. + * \return number >= 0 on success, -1 on failure + */ +HAWK_EXPORT int hawk_findgblwithucstr ( + hawk_t* awk, /**< awk */ + const hawk_uch_t* name /**< variable name */ +); + +#if defined(HAWK_OOCH_IS_BCH) +# define hawk_addgbl hawk_addgblwithbcstr +# define hawk_delgbl hawk_delgblwithbcstr +# define hawk_findgbl hawk_findgblwithbcstr +#else +# define hawk_addgbl hawk_addgblwithucstr +# define hawk_delgbl hawk_delgblwithucstr +# define hawk_findgbl hawk_findgblwithucstr +#endif + +/** + * The hawk_addfncwithbcstr() function adds an intrinsic function. + */ +HAWK_EXPORT hawk_fnc_t* hawk_addfncwithbcstr ( + hawk_t* awk, + const hawk_bch_t* name, + const hawk_fnc_mspec_t* spec +); + +/** + * The hawk_addfncwithucstr() function adds an intrinsic function. + */ +HAWK_EXPORT hawk_fnc_t* hawk_addfncwithucstr ( + hawk_t* awk, + const hawk_uch_t* name, + const hawk_fnc_wspec_t* spec +); + +/** + * The hawk_delfncwithbcstr() function deletes an intrinsic function by name. + * \return 0 on success, -1 on failure + */ +HAWK_EXPORT int hawk_delfncwithbcstr ( + hawk_t* awk, /**< awk */ + const hawk_bch_t* name /**< function name */ +); + +/** + * The hawk_delfncwithucstr() function deletes an intrinsic function by name. + * \return 0 on success, -1 on failure + */ +HAWK_EXPORT int hawk_delfncwithucstr ( + hawk_t* awk, /**< awk */ + const hawk_uch_t* name /**< function name */ +); + +#if defined(HAWK_OOCH_IS_BCH) +# define hawk_addfnc hawk_addfncwithbcstr +# define hawk_delfnc hawk_delfncwithbcstr +#else +# define hawk_addfnc hawk_addfncwithucstr +# define hawk_delfnc hawk_delfncwithucstr +#endif + +/** + * The hawk_clrfnc() function deletes all intrinsic functions + */ +HAWK_EXPORT void hawk_clrfnc ( + hawk_t* awk /**< awk */ +); + +/** + * The hawk_parse() function parses a source script, and optionally + * deparses it back. + * + * It reads a source script by calling \a sio->in as shown in the pseudo code + * below: + * + * \code + * n = sio->in(awk, HAWK_SIO_CMD_OPEN); + * if (n >= 0) + * { + * while (n > 0) + * n = sio->in (awk, HAWK_SIO_CMD_READ, buf, buf_size); + * sio->in (awk, HAWK_SIO_CMD_CLOSE); + * } + * \endcode + * + * A negative number returned causes hawk_parse() to return failure; + * 0 returned indicates the end of a stream; A positive number returned + * indicates successful opening of a stream or the length of the text read. + * + * If \a sio->out is not #HAWK_NULL, it deparses the internal parse tree + * composed of a source script and writes back the deparsing result by + * calling \a sio->out as shown below: + * + * \code + * n = sio->out (awk, HAWK_SIO_CMD_OPEN); + * if (n >= 0) + * { + * while (n > 0) + * n = sio->out (awk, HAWK_SIO_CMD_WRITE, text, text_size); + * sio->out (awk, HAWK_SIO_CMD_CLOSE); + * } + * \endcode + * + * Unlike \a sf->in, the return value of 0 from \a sf->out is treated as + * premature end of a stream; therefore, it causes hawk_parse() to return + * failure. + * + * \return 0 on success, -1 on failure. + */ +HAWK_EXPORT int hawk_parse ( + hawk_t* awk, /**< awk */ + hawk_sio_cbs_t* sio /**< source script I/O handler */ +); + +/** + * The hawk_allocmem() function allocates dynamic memory. + * \return a pointer to a memory block on success, #HAWK_NULL on failure + */ +HAWK_EXPORT void* hawk_allocmem ( + hawk_t* awk, /**< awk */ + hawk_oow_t size /**< size of memory to allocate in bytes */ +); + +/** + * The hawk_reallocmem() function resizes a dynamic memory block. + * \return a pointer to a memory block on success, #HAWK_NULL on failure + */ +HAWK_EXPORT void* hawk_reallocmem ( + hawk_t* awk, /**< awk */ + void* ptr, /**< memory block */ + hawk_oow_t size /**< new block size in bytes */ +); + +/** + * The hawk_callocmem() function allocates a memory block of + * the size of \a size bytes and initializes it with 0. + * \return a pointer to a memory block on success, #HAWK_NULL on failure + */ +HAWK_EXPORT void* hawk_callocmem ( + hawk_t* awk, /**< awk */ + hawk_oow_t size /**< size of memory to allocate in bytes */ +); + +/** + * The hawk_freemem() function frees dynamic memory allocated. + */ +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE void hawk_freemem (hawk_t* awk, void* ptr) +{ + HAWK_MMGR_FREE (hawk_getmmgr(awk), ptr); +} +#else +# define hawk_freemem(awk, ptr) HAWK_MMGR_FREE(hawk_getmmgr(awk), ptr); +#endif + +/* ----------------------------------------------------------------------- */ + +HAWK_EXPORT hawk_uch_t* hawk_dupucstr ( + hawk_t* hawk, + const hawk_uch_t* ucs, + hawk_oow_t* _ucslen +); + +HAWK_EXPORT hawk_bch_t* hawk_dupbcstr ( + hawk_t* hawk, + const hawk_bch_t* bcs, + hawk_oow_t* _bcslen +); + +HAWK_EXPORT hawk_uch_t* hawk_dupuchars ( + hawk_t* hawk, + const hawk_uch_t* ucs, + hawk_oow_t ucslen +); + +HAWK_EXPORT hawk_bch_t* hawk_dupbchars ( + hawk_t* hawk, + const hawk_bch_t* bcs, + hawk_oow_t bcslen +); + +HAWK_EXPORT hawk_uch_t* hawk_dupucs ( + hawk_t* hawk, + const hawk_ucs_t* ucs +); + +HAWK_EXPORT hawk_bch_t* hawk_dupbcs ( + hawk_t* hawk, + const hawk_bcs_t* bcs +); + +HAWK_EXPORT hawk_uch_t* hawk_dupucstrarr ( + hawk_t* hawk, + const hawk_uch_t* str[], + hawk_oow_t* len +); + +hawk_bch_t* hawk_dupbcstrarr ( + hawk_t* hawk, + const hawk_bch_t* str[], + hawk_oow_t* len +); + +#if defined(HAWK_OOCH_IS_UCH) +# define hawk_dupoocstr hawk_dupucstr +# define hawk_dupoochars hawk_dupuchars +# define hawk_dupoocs hawk_dupucs +# define hawk_dupoocstrarr hawk_dupucstrarr +#else +# define hawk_dupoocstr hawk_dupbcstr +# define hawk_dupoochars hawk_dupbchars +# define hawk_dupoocs hawk_dupbcs +# define hawk_dupoocstrarr hawk_dupbcstrarr +#endif + +/* ----------------------------------------------------------------------- */ + +HAWK_EXPORT int hawk_convbtouchars ( + hawk_t* hawk, + const hawk_bch_t* bcs, + hawk_oow_t* bcslen, + hawk_uch_t* ucs, + hawk_oow_t* ucslen, + int all +); + +HAWK_EXPORT int hawk_convutobchars ( + hawk_t* hawk, + const hawk_uch_t* ucs, + hawk_oow_t* ucslen, + hawk_bch_t* bcs, + hawk_oow_t* bcslen +); + +HAWK_EXPORT int hawk_convbtoucstr ( + hawk_t* hawk, + const hawk_bch_t* bcs, + hawk_oow_t* bcslen, + hawk_uch_t* ucs, + hawk_oow_t* ucslen, + int all +); + +HAWK_EXPORT int hawk_convutobcstr ( + hawk_t* hawk, + const hawk_uch_t* ucs, + hawk_oow_t* ucslen, + hawk_bch_t* bcs, + hawk_oow_t* bcslen +); + +/* ----------------------------------------------------------------------- */ + +HAWK_EXPORT hawk_uch_t* hawk_dupbtoucharswithheadroom ( + hawk_t* hawk, + hawk_oow_t headroom_bytes, + const hawk_bch_t* bcs, + hawk_oow_t bcslen, + hawk_oow_t* ucslen, + int all +); + +HAWK_EXPORT hawk_bch_t* hawk_duputobcharswithheadroom ( + hawk_t* hawk, + hawk_oow_t headroom_bytes, + const hawk_uch_t* ucs, + hawk_oow_t ucslen, + hawk_oow_t* bcslen +); + +HAWK_EXPORT hawk_uch_t* hawk_dupbtoucstrwithheadroom ( + hawk_t* hawk, + hawk_oow_t headroom_bytes, + const hawk_bch_t* bcs, + hawk_oow_t* ucslen, + int all +); + +HAWK_EXPORT hawk_bch_t* hawk_duputobcstrwithheadroom ( + hawk_t* hawk, + hawk_oow_t headroom_bytes, + const hawk_uch_t* ucs, + hawk_oow_t* bcslen +); + +#define hawk_dupbtouchars(hawk,bcs,bcslen,ucslen,all) hawk_dupbtoucharswithheadroom(hawk,0,bcs,bcslen,ucslen,all) +#define hawk_duputobchars(hawk,ucs,ucslen,bcslen) hawk_duputobcharswithheadroom(hawk,0,ucs,ucslen,bcslen) +#define hawk_dupbtoucstr(hawk,bcs,ucslen,all) hawk_dupbtoucstrwithheadroom(hawk,0,bcs,ucslen,all) +#define hawk_duputobcstr(hawk,ucs,bcslen) hawk_duputobcstrwithheadroom(hawk,0,ucs,bcslen) + + +HAWK_EXPORT hawk_bch_t* hawk_dupucstrarrtobcstr ( + hawk_t* hawk, + const hawk_uch_t* ucs[], + hawk_oow_t* bcslen +); + +/* ----------------------------------------------------------------------- */ + +hawk_oow_t hawk_vfmttoucstr ( + hawk_t* hawk, + hawk_uch_t* buf, + hawk_oow_t bsz, + const hawk_uch_t* fmt, + va_list ap +); + +hawk_oow_t hawk_fmttoucstr ( + hawk_t* hawk, + hawk_uch_t* buf, + hawk_oow_t bsz, + const hawk_uch_t* fmt, + ... +); + +hawk_oow_t hawk_vfmttobcstr ( + hawk_t* hawk, + hawk_bch_t* buf, + hawk_oow_t bsz, + const hawk_bch_t* fmt, + va_list ap +); + +hawk_oow_t hawk_fmttobcstr ( + hawk_t* hawk, + hawk_bch_t* buf, + hawk_oow_t bsz, + const hawk_bch_t* fmt, + ... +); + +#if defined(HAWK_OOCH_IS_UCH) +# define hawk_vfmttooocstr hawk_vfmttoucstr +# define hawk_fmttooocstr hawk_fmttoucstr +#else +# define hawk_vfmttooocstr hawk_vfmttobcstr +# define hawk_fmttooocstr hawk_fmttobcstr +#endif + +/* ----------------------------------------------------------------------- */ + + +/** + * The hawk_bcharstoint() function converts a multi-byte string to an integer. + */ +HAWK_EXPORT hawk_int_t hawk_bcharstoint ( + hawk_t* awk, + const hawk_bch_t* str, + hawk_oow_t len, + int base, + const hawk_bch_t** endptr +); + +/** + * The hawk_ucharstoint() function converts a wide character string to an integer. + */ +HAWK_EXPORT hawk_int_t hawk_ucharstoint ( + hawk_t* awk, + const hawk_uch_t* str, + hawk_oow_t len, + int base, + const hawk_uch_t** endptr +); + +#if defined(HAWK_OOCH_IS_BCH) +# define hawk_strxtoint(awk,str,len,base,endptr) hawk_bcharstoint(awk,str,len,base,endptr) +#else +# define hawk_strxtoint(awk,str,len,base,endptr) hawk_ucharstoint(awk,str,len,base,endptr) +#endif + +/** + * The hawk_bcharstoflt() function converts a multi-byte string to a floating-point + * number. + */ +HAWK_EXPORT hawk_flt_t hawk_bcharstoflt ( + hawk_t* awk, + const hawk_bch_t* str, + hawk_oow_t len, + const hawk_bch_t** endptr +); + +/** + * The hawk_ucharstoflt() function converts a wide character string to a floating-point + * number. + */ +HAWK_EXPORT hawk_flt_t hawk_ucharstoflt ( + hawk_t* awk, + const hawk_uch_t* str, + hawk_oow_t len, + const hawk_uch_t** endptr +); + +#if defined(HAWK_OOCH_IS_BCH) +# define hawk_strxtoflt(awk,str,len,endptr) hawk_bcharstoflt(awk,str,len,endptr) +#else +# define hawk_strxtoflt(awk,str,len,endptr) hawk_ucharstoflt(awk,str,len,endptr) +#endif + +/* ----------------------------------------------------------------------- */ + +HAWK_EXPORT hawk_ooi_t hawk_logufmtv ( + hawk_t* hawk, + hawk_bitmask_t mask, + const hawk_uch_t* fmt, + va_list ap +); + +HAWK_EXPORT hawk_ooi_t hawk_logufmt ( + hawk_t* hawk, + hawk_bitmask_t mask, + const hawk_uch_t* fmt, + ... +); + + +HAWK_EXPORT hawk_ooi_t hawk_logbfmtv ( + hawk_t* hawk, + hawk_bitmask_t mask, + const hawk_bch_t* fmt, + va_list ap +); + +HAWK_EXPORT hawk_ooi_t hawk_logbfmt ( + hawk_t* hawk, + hawk_bitmask_t mask, + const hawk_bch_t* fmt, + ... +); + +#if defined(HAWK_OOCH_IS_UCH) +# define hawk_logfmtv hawk_logufmtv +# define hawk_logfmt hawk_logufmt +#else +# define hawk_logfmtv hawk_logbfmtv +# define hawk_logfmt hawk_logbfmt +#endif + +/* ----------------------------------------------------------------------- */ + + +/** + * The hawk_rtx_open() creates a runtime context associated with \a awk. + * It also allocates an extra memory block as large as the \a xtn bytes. + * You can get the pointer to the beginning of the block with + * hawk_rtx_getxtn(). The block is destroyed when the runtime context is + * destroyed. + * + * \return new runtime context on success, #HAWK_NULL on failure + */ +HAWK_EXPORT hawk_rtx_t* hawk_rtx_open ( + hawk_t* awk, /**< awk */ + hawk_oow_t xtn, /**< size of extension in bytes */ + hawk_rio_cbs_t* rio /**< runtime IO handlers */ +); + +/** + * The hawk_rtx_close() function destroys a runtime context. + */ +HAWK_EXPORT void hawk_rtx_close ( + hawk_rtx_t* rtx /**< runtime context */ +); + +/** + * The hawk_rtx_loop() function executes the BEGIN block, pattern-action + * blocks and the END blocks in an AWK program. It returns the global return + * value of which the reference count must be decremented when not necessary. + * Multiple invocations of the function for the lifetime of a runtime context + * is not desirable. + * + * The example shows typical usage of the function. + * \code + * rtx = hawk_rtx_open (awk, 0, rio); + * if (rtx) + * { + * retv = hawk_rtx_loop (rtx); + * if (retv) hawk_rtx_refdownval (rtx, retv); + * hawk_rtx_close (rtx); + * } + * \endcode + * + * \return return value on success, #HAWK_NULL on failure. + */ +HAWK_EXPORT hawk_val_t* hawk_rtx_loop ( + hawk_rtx_t* rtx /**< runtime context */ +); + +/** + * The hawk_rtx_findfunwithbcstr() function finds the function structure by + * name and returns the pointer to it if one is found. It returns #HAWK_NULL + * if it fails to find a function by the \a name. + */ +HAWK_EXPORT hawk_fun_t* hawk_rtx_findfunwithbcstr ( + hawk_rtx_t* rtx, /**< runtime context */ + const hawk_bch_t* name /**< function name */ +); + +/** + * The hawk_rtx_findfunwithucstr() function finds the function structure by + * name and returns the pointer to it if one is found. It returns #HAWK_NULL + * if it fails to find a function by the \a name. + */ +HAWK_EXPORT hawk_fun_t* hawk_rtx_findfunwithucstr ( + hawk_rtx_t* rtx, /**< runtime context */ + const hawk_uch_t* name /**< function name */ +); + +#if defined(HAWK_OOCH_IS_BCH) +# define hawk_rtx_findfun hawk_rtx_findfunwithbcstr +#else +# define hawk_rtx_findfun hawk_rtx_findfunwithucstr +#endif + +/** + * The hawk_rtx_callfun() function invokes an AWK function described by + * the structure pointed to by \a fun. + * \sa hawk_rtx_call + */ +HAWK_EXPORT hawk_val_t* hawk_rtx_callfun ( + hawk_rtx_t* rtx, /**< runtime context */ + hawk_fun_t* fun, /**< function */ + hawk_val_t* args[], /**< arguments to the function */ + hawk_oow_t nargs /**< the number of arguments */ +); + +/** + * The hawk_rtx_callwithucstr() function invokes an AWK function named \a name. + * However, it is not able to invoke an intrinsic function such as split(). + * The #HAWK_PABLOCK option can be turned off to make illegal the BEGIN + * blocks, the pattern-action blocks, and the END blocks. + * + * The example shows typical usage of the function. + * \code + * rtx = hawk_rtx_open (awk, 0, rio); + * if (rtx) + * { + * v = hawk_rtx_callwithucstr (rtx, HAWK_UT("init"), HAWK_NULL, 0); + * if (v) hawk_rtx_refdownval (rtx, v); + * hawk_rtx_callwithucstr (rtx, HAWK_UT("fini"), HAWK_NULL, 0); + * if (v) hawk_rtx_refdownval (rtx, v); + * hawk_rtx_close (rtx); + * } + * \endcode + * + * \return 0 on success, -1 on failure + */ +HAWK_EXPORT hawk_val_t* hawk_rtx_callwithucstr ( + hawk_rtx_t* rtx, /**< runtime context */ + const hawk_uch_t* name, /**< function name */ + hawk_val_t* args[], /**< arguments to the function */ + hawk_oow_t nargs /**< the number of arguments */ +); + +/** + * The hawk_rtx_callwithbcstr() function invokes an AWK function named \a name. + * However, it is not able to invoke an intrinsic function such as split(). + * The #HAWK_PABLOCK option can be turned off to make illegal the BEGIN + * blocks, the pattern-action blocks, and the END blocks. + * + * The example shows typical usage of the function. + * \code + * rtx = hawk_rtx_open (awk, 0, rio); + * if (rtx) + * { + * v = hawk_rtx_callwithbcstr (rtx, HAWK_BT("init"), HAWK_NULL, 0); + * if (v) hawk_rtx_refdownval (rtx, v); + * hawk_rtx_callwithbcstr (rtx, HAWK_BT("fini"), HAWK_NULL, 0); + * if (v) hawk_rtx_refdownval (rtx, v); + * hawk_rtx_close (rtx); + * } + * \endcode + * + * \return 0 on success, -1 on failure + */ +HAWK_EXPORT hawk_val_t* hawk_rtx_callwithbcstr ( + hawk_rtx_t* rtx, /**< runtime context */ + const hawk_bch_t* name, /**< function name */ + hawk_val_t* args[], /**< arguments to the function */ + hawk_oow_t nargs /**< the number of arguments */ +); + +/** + * The hawk_rtx_callwithargarr() function is the same as hawk_rtx_call() + * except that you pass pointers to null-terminated strings. It creates values + * from the null-terminated strings and calls hawk_rtx_call() with the + * values created. + */ +HAWK_EXPORT hawk_val_t* hawk_rtx_callwithucstrarr ( + hawk_rtx_t* rtx, /**< runtime context */ + const hawk_uch_t* name, /**< function name */ + const hawk_uch_t* args[], /**< arguments to the function */ + hawk_oow_t nargs /**< the number of arguments */ +); + +HAWK_EXPORT hawk_val_t* hawk_rtx_callwithbcstrarr ( + hawk_rtx_t* rtx, /**< runtime context */ + const hawk_bch_t* name, /**< function name */ + const hawk_bch_t* args[], /**< arguments to the function */ + hawk_oow_t nargs /**< the number of arguments */ +); + +#if defined(HAWK_OOCH_IS_UCH) +# define hawk_rtx_callwithoocstr hawk_rtx_callwithucstr +# define hawk_rtx_callwithoocstrarr hawk_rtx_callwithucstrarr +#else +# define hawk_rtx_callwithoocstr hawk_rtx_callwithbcstr +# define hawk_rtx_callwithoocstrarr hawk_rtx_callwithbcstrarr +#endif + +/** + * The hawk_haltall() function aborts all active runtime contexts + * associated with \a awk. + */ +HAWK_EXPORT void hawk_haltall ( + hawk_t* awk /**< awk */ +); + +/** + * The hawk_rtx_ishalt() function tests if hawk_rtx_halt() has been + * called. + */ +HAWK_EXPORT int hawk_rtx_ishalt ( + hawk_rtx_t* rtx /**< runtime context */ +); + +/** + * The hawk_rtx_halt() function causes an active runtime context \a rtx to + * be aborted. + */ +HAWK_EXPORT void hawk_rtx_halt ( + hawk_rtx_t* rtx /**< runtime context */ +); + +/** + * The hawk_rtx_getrio() function copies runtime I/O handlers + * to the memory buffer pointed to by \a rio. + */ +HAWK_EXPORT void hawk_rtx_getrio ( + hawk_rtx_t* rtx, + hawk_rio_cbs_t* rio +); + +/** + * The hawk_rtx_getrio() function sets runtime I/O handlers + * with the functions pointed to by \a rio. + */ +HAWK_EXPORT void hawk_rtx_setrio ( + hawk_rtx_t* rtx, + const hawk_rio_cbs_t* rio +); + +/** + * The hawk_rtx_popecb() function pops a runtime callback set + * and returns the pointer to it. If no callback set can be popped, + * it returns #HAWK_NULL. + */ +HAWK_EXPORT hawk_rtx_ecb_t* hawk_rtx_popecb ( + hawk_rtx_t* rtx /**< runtime context */ +); + +/** + * The hawk_rtx_pushecb() function register a runtime callback set. + */ +HAWK_EXPORT void hawk_rtx_pushecb ( + hawk_rtx_t* rtx, /**< runtime context */ + hawk_rtx_ecb_t* ecb /**< callback set */ +); + +/** + * The hawk_rtx_getnargs() gets the number of arguments passed to an + * intrinsic functon. + */ +HAWK_EXPORT hawk_oow_t hawk_rtx_getnargs ( + hawk_rtx_t* rtx +); + +/** + * The hawk_rtx_getarg() function gets an argument passed to an intrinsic + * function. it doesn't touch the reference count of the value. + */ +HAWK_EXPORT hawk_val_t* hawk_rtx_getarg ( + hawk_rtx_t* rtx, + hawk_oow_t idx +); + +/** + * The hawk_rtx_getsubsep() function returns the + * pointer to the internal value of SUBSEP. It's a specialized + * version of hawk_rtx_getgbl (rtx, HAWK_GBL_SUBSEP). + */ +HAWK_EXPORT const hawk_oocs_t* hawk_rtx_getsubsep ( + hawk_rtx_t* rtx /**< runtime context */ +); + +/** + * The hawk_rtx_getgbl() gets the value of a global variable. + * The global variable ID \a id is one of the predefined global + * variable IDs or a value returned by hawk_addgbl(). + * This function never fails so long as the ID is valid. Otherwise, + * you may get into trouble. + * + * \return value pointer + */ +HAWK_EXPORT hawk_val_t* hawk_rtx_getgbl ( + hawk_rtx_t* rtx, /**< runtime context */ + int id /**< global variable ID */ +); + +/** + * The hawk_rtx_setgbl() sets the value of a global variable. + */ +HAWK_EXPORT int hawk_rtx_setgbl ( + hawk_rtx_t* rtx, + int id, + hawk_val_t* val +); + +/** + * The hawk_rtx_setretval() sets the return value of a function + * when called from within a function handler. The caller doesn't + * have to invoke hawk_rtx_refupval() and hawk_rtx_refdownval() + * with the value to be passed to hawk_rtx_setretval(). + * The hawk_rtx_setretval() will update its reference count properly + * once the return value is set. + */ +HAWK_EXPORT void hawk_rtx_setretval ( + hawk_rtx_t* rtx, /**< runtime context */ + hawk_val_t* val /**< return value */ +); + +/** + * The hawk_rtx_setfilename() function sets FILENAME. + */ +HAWK_EXPORT int hawk_rtx_setfilename ( + hawk_rtx_t* rtx, /**< runtime context */ + const hawk_ooch_t* str, /**< name pointer */ + hawk_oow_t len /**< name length */ +); + +/** + * The hawk_rtx_setofilename() function sets OFILENAME. + */ +HAWK_EXPORT int hawk_rtx_setofilename ( + hawk_rtx_t* rtx, /**< runtime context */ + const hawk_ooch_t* str, /**< name pointer */ + hawk_oow_t len /**< name length */ +); + + +#if defined(HAWK_HAVE_INLINE) + +/** + * The hawk_rtx_getxtn() function gets the pointer to the extension area + * created with hawk_rtx_open(). + */ +static HAWK_INLINE void* hawk_rtx_getxtn (hawk_rtx_t* rtx) +{ + return (void*)((hawk_uint8_t*)rtx + ((hawk_rtx_alt_t*)rtx)->_instsize); +} + +/** + * The hawk_rtx_getawk() function gets the owner of a runtime context \a rtx. + * \return owner of a runtime context \a rtx. + */ +static HAWK_INLINE hawk_t* hawk_rtx_getawk (hawk_rtx_t* rtx) +{ + return ((hawk_rtx_alt_t*)rtx)->awk; +} + +/** + * The hawk_rtx_getmmgr() function gets the memory manager of a runtime + * context. + */ +static HAWK_INLINE hawk_mmgr_t* hawk_rtx_getmmgr (hawk_rtx_t* rtx) +{ + return hawk_getmmgr(hawk_rtx_getawk(rtx)); +} + +static HAWK_INLINE hawk_cmgr_t* hawk_rtx_getcmgr (hawk_rtx_t* rtx) +{ + return hawk_getcmgr(hawk_rtx_getawk(rtx)); +} + +#else +# define hawk_rtx_getxtn(rtx) ((void*)((hawk_uint8_t*)rtx + ((hawk_rtx_alt_t*)rtx)->_instsize)) +# define hawk_rtx_getawk(rtx) (((hawk_rtx_alt_t*)(rtx))->awk) +# define hawk_rtx_getmmgr(rtx) (hawk_getmmgr(hawk_rtx_getawk(rtx))) +# define hawk_rtx_getcmgr(rtx) (hawk_getcmgr(hawk_rtx_getawk(rtx))) + +#endif /* HAWK_HAVE_INLINE */ + +/** + * The hawk_rtx_getnvmap() gets the map of named variables + */ +HAWK_EXPORT hawk_htb_t* hawk_rtx_getnvmap ( + hawk_rtx_t* rtx /**< runtime context */ +); + +/** + * The hawk_rtx_geterrnum() function gets the number of the last error + * occurred during runtime. + * \return error number + */ +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE hawk_errnum_t hawk_rtx_geterrnum (hawk_rtx_t* rtx) { return ((hawk_rtx_alt_t*)rtx)->_gem.errnum; } +#else +# define hawk_rtx_geterrnum(awk) (((hawk_rtx_alt_t*)(rtx))->_gem.errnum) +#endif + +/** + * The hawk_rtx_geterrloc() function gets the location of the last error + * occurred during runtime. The + * \return error location + */ +HAWK_EXPORT const hawk_loc_t* hawk_rtx_geterrloc ( + hawk_rtx_t* rtx /**< runtime context */ +); + +/** + * The hawk_rtx_geterrbmsg() function gets the string describing the last + * error occurred during runtime. + * \return error message + */ +HAWK_EXPORT const hawk_bch_t* hawk_rtx_geterrbmsg ( + hawk_rtx_t* rtx /**< runtime context */ +); + +/** + * The hawk_rtx_geterrumsg() function gets the string describing the last + * error occurred during runtime. + * \return error message + */ +HAWK_EXPORT const hawk_uch_t* hawk_rtx_geterrumsg ( + hawk_rtx_t* rtx /**< runtime context */ +); + +#if defined(HAWK_OOCH_IS_BCH) +# define hawk_rtx_geterrmsg hawk_rtx_geterrbmsg +#else +# define hawk_rtx_geterrmsg hawk_rtx_geterrumsg +#endif + +HAWK_EXPORT const hawk_ooch_t* hawk_rtx_backuperrmsg ( + hawk_rtx_t* rtx /**< runtime context */ +); + +/** + * The hawk_rtx_geterrinf() function copies error information into memory + * pointed to by \a errinf from a runtime context \a rtx. + */ +HAWK_EXPORT void hawk_rtx_geterrinf ( + hawk_rtx_t* rtx, /**< runtime context */ + hawk_errinf_t* errinf /**< error information */ +); + +/** + * The hawk_rtx_geterror() function retrieves error information from a + * runtime context \a rtx. The error number is stored into memory pointed + * to by \a errnum; the error message pointer into memory pointed to by + * \a errmsg; the error line into memory pointed to by \a errlin. + */ +HAWK_EXPORT void hawk_rtx_geterror ( + hawk_rtx_t* rtx, /**< runtime context */ + hawk_errnum_t* errnum, /**< error number */ + const hawk_ooch_t** errmsg, /**< error message */ + hawk_loc_t* errloc /**< error location */ +); + +/** + * The hawk_rtx_seterrnum() function sets the error information omitting + * the error location. + */ +HAWK_EXPORT void hawk_rtx_seterrnum ( + hawk_rtx_t* rtx, /**< runtime context */ + hawk_errnum_t errnum, /**< error number */ + const hawk_oocs_t* errarg /**< arguments to format error message */ +); + +/** + * The hawk_rtx_seterrinf() function sets error information. + */ +HAWK_EXPORT void hawk_rtx_seterrinf ( + hawk_rtx_t* rtx, /**< runtime context */ + const hawk_errinf_t* errinf /**< error information */ +); + +HAWK_EXPORT void hawk_rtx_seterrbfmt ( + hawk_rtx_t* rtx, + hawk_errnum_t errnum, + const hawk_loc_t* errloc, + const hawk_bch_t* errfmt, + ... +); + +HAWK_EXPORT void hawk_rtx_seterrufmt ( + hawk_rtx_t* rtx, + hawk_errnum_t errnum, + const hawk_loc_t* errloc, + const hawk_uch_t* errfmt, + ... +); + +#if defined(HAWK_OOCH_IS_UCH) +# define hawk_rtx_seterrfmt hawk_rtx_seterrufmt +#else +# define hawk_rtx_seterrfmt hawk_rtx_seterrbfmt +#endif + +/** + * The hawk_rtx_seterror() function sets error information. + */ +HAWK_EXPORT void hawk_rtx_seterror ( + hawk_rtx_t* rtx, /**< runtime context */ + hawk_errnum_t errnum, /**< error number */ + const hawk_oocs_t* errarg, /**< argument array for formatting an error message */ + const hawk_loc_t* errloc /**< error line */ +); + +HAWK_EXPORT void hawk_rtx_errortohawk ( + hawk_rtx_t* rtx, + hawk_t* hawk +); + +/** + * The hawk_rtx_clrrec() function clears the input record ($0) + * and fields ($1 to $N). + */ +HAWK_EXPORT int hawk_rtx_clrrec ( + hawk_rtx_t* rtx, /**< runtime context */ + int skip_inrec_line +); + +/** + * The hawk_rtx_setrec() function sets the input record ($0) or + * input fields ($1 to $N). + */ +HAWK_EXPORT int hawk_rtx_setrec ( + hawk_rtx_t* rtx, /**< runtime context */ + hawk_oow_t idx, /**< 0 for $0, N for $N */ + const hawk_oocs_t* str /**< string */ +); + +/** + * The hawk_rtx_isnilval() function determines if a value + * is a nil value. + */ +HAWK_EXPORT int hawk_rtx_isnilval ( + hawk_rtx_t* rtx, + hawk_val_t* val +); + +/** + * The hawk_rtx_makenilval() function creates a nil value. + * It always returns the pointer to the statically allocated + * nil value. So it never fails. + */ +HAWK_EXPORT hawk_val_t* hawk_rtx_makenilval ( + hawk_rtx_t* rtx +); + +/** + * The hawk_rtx_makeintval() function creates an integer value. + * If \a v is one of -1, 0, 1, this function never fails. + * \return value on success, #HAWK_NULL on failure + */ +HAWK_EXPORT hawk_val_t* hawk_rtx_makeintval ( + hawk_rtx_t* rtx, + hawk_int_t v +); + +/** + * The hawk_rtx_makefltval() function creates a floating-point value. + * \return value on success, #HAWK_NULL on failure + */ +HAWK_EXPORT hawk_val_t* hawk_rtx_makefltval ( + hawk_rtx_t* rtx, + hawk_flt_t v +); + +/* -------------------------------------------------------------------------- */ + + +HAWK_EXPORT hawk_val_t* hawk_rtx_makestrvalwithuchars ( + hawk_rtx_t* rtx, + const hawk_uch_t* ucs, + hawk_oow_t len +); + +HAWK_EXPORT hawk_val_t* hawk_rtx_makestrvalwithbchars ( + hawk_rtx_t* rtx, + const hawk_bch_t* bcs, + hawk_oow_t len +); + +/** + * The hawk_rtx_makestrvalwithbcstr() function creates a string value + * from a null-terminated multibyte string. + * \return value on success, #HAWK_NULL on failure + */ +HAWK_EXPORT hawk_val_t* hawk_rtx_makestrvalwithbcstr ( + hawk_rtx_t* rtx, + const hawk_bch_t* bcs +); + +/** + * The hawk_rtx_makestrvalwithucstr() function creates a string value + * from a null-terminated wide-character string. + * \return value on success, #HAWK_NULL on failure + */ +HAWK_EXPORT hawk_val_t* hawk_rtx_makestrvalwithucstr ( + hawk_rtx_t* rtx, + const hawk_uch_t* ucs +); + +HAWK_EXPORT hawk_val_t* hawk_rtx_makestrvalwithbcs ( + hawk_rtx_t* rtx, + const hawk_bcs_t* bcs +); + +HAWK_EXPORT hawk_val_t* hawk_rtx_makestrvalwithucs ( + hawk_rtx_t* rtx, + const hawk_ucs_t* ucs +); + + +HAWK_EXPORT hawk_val_t* hawk_rtx_makestrvalwithuchars2 ( + hawk_rtx_t* rtx, + const hawk_uch_t* str1, + hawk_oow_t len1, + const hawk_uch_t* str2, + hawk_oow_t len2 +); + +HAWK_EXPORT hawk_val_t* hawk_rtx_makestrvalwithbchars2 ( + hawk_rtx_t* rtx, + const hawk_bch_t* str1, + hawk_oow_t len1, + const hawk_bch_t* str2, + hawk_oow_t len2 +); + +/* -------------------------------------------------------------------------- */ + +HAWK_EXPORT hawk_val_t* hawk_rtx_makenstrvalwithuchars ( + hawk_rtx_t* rtx, + const hawk_uch_t* ptr, + hawk_oow_t len +); + +HAWK_EXPORT hawk_val_t* hawk_rtx_makenstrvalwithbchars ( + hawk_rtx_t* rtx, + const hawk_bch_t* ptr, + hawk_oow_t len +); + +/** + * The hawk_rtx_makenstrvalwithucstr() function creates a numeric string + * value from a null-terminated string. A numeric string is a string value + * whose one of the header fields \b nstr is 1. + * \return value on success, #HAWK_NULL on failure + */ +HAWK_EXPORT hawk_val_t* hawk_rtx_makenstrvalwithucstr ( + hawk_rtx_t* rtx, + const hawk_uch_t* str +); + +HAWK_EXPORT hawk_val_t* hawk_rtx_makenstrvalwithbcstr ( + hawk_rtx_t* rtx, + const hawk_bch_t* str +); + +/** + * The hawk_rtx_makenstrvalwithucs() function creates a numeric string + * value. A numeric string is a string value whose one of the header fields + * \b nstr is 1. + * \return value on success, #HAWK_NULL on failure + */ +HAWK_EXPORT hawk_val_t* hawk_rtx_makenstrvalwithucs ( + hawk_rtx_t* rtx, + const hawk_ucs_t* str +); + +HAWK_EXPORT hawk_val_t* hawk_rtx_makenstrvalwithbcs ( + hawk_rtx_t* rtx, + const hawk_bcs_t* str +); + +#if defined (HAWK_OOCH_IS_UCH) +# define hawk_rtx_makestrvalwithoochars hawk_rtx_makestrvalwithuchars +# define hawk_rtx_makestrvalwithoocstr hawk_rtx_makestrvalwithucstr +# define hawk_rtx_makestrvalwithoocs hawk_rtx_makestrvalwithucs +# define hawk_rtx_makestrvalwithoochars2 hawk_rtx_makestrvalwithuchars2 + +# define hawk_rtx_makenstrvalwithoocstr hawk_rtx_makenstrvalwithucstr +# define hawk_rtx_makenstrvalwithoocs hawk_rtx_makenstrvalwithucs +#else +# define hawk_rtx_makestrvalwithoochars hawk_rtx_makestrvalwithbchars +# define hawk_rtx_makestrvalwithoocstr hawk_rtx_makestrvalwithbcstr +# define hawk_rtx_makestrvalwithoocs hawk_rtx_makestrvalwithbcs +# define hawk_rtx_makestrvalwithoochars2 hawk_rtx_makestrvalwithbchars2 + +# define hawk_rtx_makenstrvalwithoocstr hawk_rtx_makenstrvalwithbcstr +# define hawk_rtx_makenstrvalwithoocs hawk_rtx_makenstrvalwithbcs +#endif + +/* -------------------------------------------------------------------------- */ + +/** + * The hawk_rtx_makebytearrvaal() function create a byte array value. + * \return value on success, #HAWK_NULL on failure + */ +hawk_val_t* hawk_rtx_makembsval ( + hawk_rtx_t* rtx, + const hawk_bch_t* ptr, + hawk_oow_t len +); + +hawk_val_t* hawk_rtx_makembsvalwithbcs ( + hawk_rtx_t* rtx, + const hawk_bcs_t* bcs +); + +/* -------------------------------------------------------------------------- */ + +/** + * The hawk_rtx_makerexval() function creates a regular expression value. + * \return value on success, #HAWK_NULL on failure + */ +HAWK_EXPORT hawk_val_t* hawk_rtx_makerexval ( + hawk_rtx_t* rtx, + const hawk_oocs_t* str, + void* code[2] +); + +/** + * The hawk_rtx_makemapval() function creates an empty map value. + * \return value on success, #HAWK_NULL on failure + */ +HAWK_EXPORT hawk_val_t* hawk_rtx_makemapval ( + hawk_rtx_t* rtx +); + +/** + * The hawk_rtx_makemapvalwithdata() function creates a map value + * containing key/value pairs described in the structure array \a data. + * It combines hawk_rtx_makemapval() an hawk_rtx_setmapvalfld() + * for convenience sake. + * \return value on success, #HAWK_NULL on failure + */ +HAWK_EXPORT hawk_val_t* hawk_rtx_makemapvalwithdata ( + hawk_rtx_t* rtx, + hawk_val_map_data_t data[] +); + +/** + * The hawk_rtx_setmapvalfld() function sets a field value in a map. + * You must make sure that the type of \a map is #HAWK_VAL_MAP. + * \return value \a v on success, #HAWK_NULL on failure. + */ +HAWK_EXPORT hawk_val_t* hawk_rtx_setmapvalfld ( + hawk_rtx_t* rtx, + hawk_val_t* map, + const hawk_ooch_t* kptr, + hawk_oow_t klen, + hawk_val_t* v +); + +/** + * The hawk_rtx_setmapvalfld() function gets the field value in a map. + * You must make sure that the type of \a map is #HAWK_VAL_MAP. + * If the field is not found, the function fails and sets the error number + * to #HAWK_EINVAL. The function does not fail for other reasons. + * \return field value on success, #HAWK_NULL on failure. + */ +HAWK_EXPORT hawk_val_t* hawk_rtx_getmapvalfld ( + hawk_rtx_t* rtx, + hawk_val_t* map, + const hawk_ooch_t* kptr, + hawk_oow_t klen +); + +/** + * The hawk_rtx_getfirstmapvalitr() returns the iterator to the + * first pair in the map. It returns #HAWK_NULL and sets the pair field of + * \a itr to #HAWK_NULL if the map contains no pair. Otherwise, it returns + * \a itr pointing to the first pair. + */ +HAWK_EXPORT hawk_val_map_itr_t* hawk_rtx_getfirstmapvalitr ( + hawk_rtx_t* rtx, + hawk_val_t* map, + hawk_val_map_itr_t* itr +); + +/** + * The hawk_rtx_getnextmapvalitr() returns the iterator to the + * next pair to \a itr in the map. It returns #HAWK_NULL and sets the pair + * field of \a itr to #HAWK_NULL if \a itr points to the last pair. + * Otherwise, it returns \a itr pointing to the next pair. + */ +HAWK_EXPORT hawk_val_map_itr_t* hawk_rtx_getnextmapvalitr ( + hawk_rtx_t* rtx, + hawk_val_t* map, + hawk_val_map_itr_t* itr +); + +/** + * The hawk_rtx_makerefval() function creates a reference value. + * \return value on success, #HAWK_NULL on failure + */ +HAWK_EXPORT hawk_val_t* hawk_rtx_makerefval ( + hawk_rtx_t* rtx, + int id, + hawk_val_t** adr +); + +HAWK_EXPORT hawk_val_t* hawk_rtx_makefunval ( + hawk_rtx_t* rtx, + const hawk_fun_t* fun +); + +/** + * The hawk_rtx_isstaticval() function determines if a value is static. + * A static value is allocated once and reused until a runtime context @ rtx + * is closed. + * \return HAWK_TRUE if \a val is static, HAWK_FALSE if \a val is false + */ +HAWK_EXPORT int hawk_rtx_isstaticval ( + hawk_rtx_t* rtx, /**< runtime context */ + hawk_val_t* val /**< value to check */ +); + +HAWK_EXPORT int hawk_rtx_getvaltype ( + hawk_rtx_t* rtx, + hawk_val_t* val +); + +HAWK_EXPORT const hawk_ooch_t* hawk_rtx_getvaltypename ( + hawk_rtx_t* rtx, + hawk_val_t* val +); + +HAWK_EXPORT int hawk_rtx_getintfromval ( + hawk_rtx_t* rtx, + hawk_val_t* val +); + +/** + * The hawk_rtx_refupval() function increments a reference count of a + * value \a val. + */ +HAWK_EXPORT void hawk_rtx_refupval ( + hawk_rtx_t* rtx, /**< runtime context */ + hawk_val_t* val /**< value */ +); + +/** + * The hawk_rtx_refdownval() function decrements a reference count of + * a value \a val. It destroys the value if it has reached the count of 0. + */ +HAWK_EXPORT void hawk_rtx_refdownval ( + hawk_rtx_t* rtx, /**< runtime context */ + hawk_val_t* val /**< value pointer */ +); + +/** + * The hawk_rtx_refdownval() function decrements a reference count of + * a value \a val. It does not destroy the value if it has reached the + * count of 0. + */ +HAWK_EXPORT void hawk_rtx_refdownval_nofree ( + hawk_rtx_t* rtx, /**< runtime context */ + hawk_val_t* val /**< value pointer */ +); + +/** + * The hawk_rtx_valtobool() function converts a value \a val to a boolean + * value. + */ +HAWK_EXPORT int hawk_rtx_valtobool ( + hawk_rtx_t* rtx, /**< runtime context */ + const hawk_val_t* val /**< value pointer */ +); + +/** + * The hawk_rtx_valtostr() function converts a value \a val to a string as + * instructed in the parameter out. Before the call to the function, you + * should initialize a variable of the #hawk_rtx_valtostr_out_t type. + * + * The type field is one of the following hawk_rtx_valtostr_type_t values: + * + * - #HAWK_RTX_VALTOSTR_CPL + * - #HAWK_RTX_VALTOSTR_CPLCPY + * - #HAWK_RTX_VALTOSTR_CPLDUP + * - #HAWK_RTX_VALTOSTR_STRP + * - #HAWK_RTX_VALTOSTR_STRPCAT + * + * It can optionally be ORed with #HAWK_RTX_VALTOSTR_PRINT. The option + * causes the function to use OFMT for real number conversion. Otherwise, + * it uses \b CONVFMT. + * + * You should initialize or free other fields before and after the call + * depending on the type field as shown below: + * + * If you have a static buffer, use #HAWK_RTX_VALTOSTR_CPLCPY. + * the resulting string is copied to the buffer. + * \code + * hawk_rtx_valtostr_out_t out; + * hawk_ooch_t buf[100]; + * out.type = HAWK_RTX_VALTOSTR_CPLCPY; + * out.u.cplcpy.ptr = buf; + * out.u.cplcpy.len = HAWK_COUNTOF(buf); + * if (hawk_rtx_valtostr (rtx, v, &out) <= -1) goto oops; + * hawk_printf (HAWK_T("%.*s\n"), (int)out.u.cplcpy.len, out.u.cplcpy.ptr); + * \endcode + * + * #HAWK_RTX_VALTOSTR_CPL is different from #HAWK_RTX_VALTOSTR_CPLCPY + * in that it doesn't copy the string to the buffer if the type of the value + * is #HAWK_VAL_STR. It copies the resulting string to the buffer if + * the value type is not #HAWK_VAL_STR. + * \code + * hawk_rtx_valtostr_out_t out; + * hawk_ooch_t buf[100]; + * out.type = HAWK_RTX_VALTOSTR_CPL; + * out.u.cpl.ptr = buf; + * out.u.cpl.len = HAWK_COUNTOF(buf); + * if (hawk_rtx_valtostr (rtx, v, &out) <= -1) goto oops; + * hawk_printf (HAWK_T("%.*s\n"), (int)out.u.cpl.len, out.u.cpl.ptr); + * \endcode + * + * When unsure of the size of the string after conversion, you can use + * #HAWK_RTX_VALTOSTR_CPLDUP. However, you should free the memory block + * pointed to by the u.cpldup.ptr field after use. + * \code + * hawk_rtx_valtostr_out_t out; + * out.type = HAWK_RTX_VALTOSTR_CPLDUP; + * if (hawk_rtx_valtostr (rtx, v, &out) <= -1) goto oops; + * hawk_printf (HAWK_T("%.*s\n"), (int)out.u.cpldup.len, out.u.cpldup.ptr); + * hawk_rtx_free (rtx, out.u.cpldup.ptr); + * \endcode + * + * You may like to store the result in a dynamically resizable string. + * Consider #HAWK_RTX_VALTOSTR_STRP. + * \code + * hawk_rtx_valtostr_out_t out; + * hawk_ooecs_t str; + * hawk_str_init (&str, hawk_rtx_getmmgr(rtx), 100); + * out.type = HAWK_RTX_VALTOSTR_STRP; + * out.u.strp = str; + * if (hawk_rtx_valtostr (rtx, v, &out) <= -1) goto oops; + * hawk_printf (HAWK_T("%.*s\n"), + * (int)HAWK_STR_LEN(out.u.strp), HAWK_STR_PTR(out.u.strp)); + * hawk_str_fini (&str); + * \endcode + * + * If you want to append the converted string to an existing dynamically + * resizable string, #HAWK_RTX_VALTOSTR_STRPCAT is the answer. The usage is + * the same as #HAWK_RTX_VALTOSTR_STRP except that you have to use the + * u.strpcat field instead of the u.strp field. + * + * In the context where \a val is determined to be of the type + * #HAWK_VAL_STR, you may access its string pointer and length directly + * instead of calling this function. + * + * \return 0 on success, -1 on failure + */ +HAWK_EXPORT int hawk_rtx_valtostr ( + hawk_rtx_t* rtx, /**< runtime context */ + const hawk_val_t* val, /**< value to convert */ + hawk_rtx_valtostr_out_t* out /**< output buffer */ +); + +/** + * The hawk_rtx_valtooocstrdupwithcmgr() function duplicates a string value and returns + * the pointer to it. If the given value is not a string, it converts the non-string + * value to a string and duplicates it. It stores the length of the resulting + * string in memory pointed to by \a len. + * You should free the returned memory block after use. See the code snippet below + * for a simple usage. + * + * \code + * ptr = hawk_rtx_valtoucstrdupwithcmgr(rtx, v, &len, hawk_rtx_getcmgr(rtx)); + * if (!str) handle_error(); + * hawk_printf (HAWK_T("%.*ls\n"), (int)len, ptr); + * hawk_rtx_free (rtx, ptr); + * \endcode + * + * \return character pointer to a duplicated string on success, + * #HAWK_NULL on failure + */ + +HAWK_EXPORT hawk_bch_t* hawk_rtx_valtobcstrdupwithcmgr ( + hawk_rtx_t* rtx, /**< runtime context */ + const hawk_val_t* val, /**< value to convert */ + hawk_oow_t* len, /**< result length */ + hawk_cmgr_t* cmgr +); + +HAWK_EXPORT hawk_uch_t* hawk_rtx_valtoucstrdupwithcmgr ( + hawk_rtx_t* rtx, /**< runtime context */ + const hawk_val_t* val, /**< value to convert */ + hawk_oow_t* len, /**< result length */ + hawk_cmgr_t* cmgr +); + + +#define hawk_rtx_valtobcstrdup(rtx, val, len) hawk_rtx_valtobcstrdupwithcmgr(rtx, val, len, hawk_rtx_getcmgr(rtx)) +#define hawk_rtx_valtoucstrdup(rtx, val, len) hawk_rtx_valtoucstrdupwithcmgr(rtx, val, len, hawk_rtx_getcmgr(rtx)) + +#if defined(HAWK_OOCH_IS_BCH) +# define hawk_rtx_valtooocstrdupwithcmgr(rtx, val, len, cmgr) hawk_rtx_valtobcstrdupwithcmgr(rtx, val, len, cmgr) +# define hawk_rtx_valtooocstrdup(rtx, val, len) hawk_rtx_valtobcstrdup(rtx, val, len) +#else +# define hawk_rtx_valtooocstrdupwithcmgr(rtx, val, len, cmgr) hawk_rtx_valtoucstrdupwithcmgr(rtx, val, len, cmgr) +# define hawk_rtx_valtooocstrdup(rtx, val, len) hawk_rtx_valtoucstrdup(rtx, val, len) +#endif + +/** + * The hawk_rtx_getvaloocstr() function returns a string + * pointer converted from a value \a val. If the value + * type is #HAWK_VAL_STR, it simply returns the internal + * pointer without duplication. Otherwise, it calls + * hawk_rtx_valtooocstrdup(). The length of the returned + * string is stored into the location pointed to by \a len. + */ +HAWK_EXPORT hawk_ooch_t* hawk_rtx_getvaloocstrwithcmgr ( + hawk_rtx_t* rtx, /**< runtime context */ + const hawk_val_t* val, /**< value to convert */ + hawk_oow_t* len, /**< result length */ + hawk_cmgr_t* cmgr +); + +#define hawk_rtx_getvaloocstr(rtx,val,len) hawk_rtx_getvaloocstrwithcmgr(rtx, val, len, hawk_rtx_getcmgr(rtx)) + +/** + * The hawk_rtx_freevaloocstr() function frees the memory pointed + * to by \a str if \a val is not of the #HAWK_VAL_STR type. + * This function expects a value pointer and a string pointer + * passed to and returned by hawk_rtx_getvaloocstr() respectively. + */ +HAWK_EXPORT void hawk_rtx_freevaloocstr ( + hawk_rtx_t* rtx, /**< runtime context */ + const hawk_val_t* val, /**< value to convert */ + hawk_ooch_t* str /**< string pointer */ +); + + +HAWK_EXPORT hawk_bch_t* hawk_rtx_getvalbcstrwithcmgr ( + hawk_rtx_t* rtx, /**< runtime context */ + const hawk_val_t* val, /**< value to convert */ + hawk_oow_t* len, /**< result length */ + hawk_cmgr_t* cmgr +); + +#define hawk_rtx_getvalbcstr(rtx, val, len) hawk_rtx_getvalbcstrwithcmgr(rtx, val, len, hawk_rtx_getcmgr(rtx)) + +HAWK_EXPORT void hawk_rtx_freevalbcstr ( + hawk_rtx_t* rtx, /**< runtime context */ + const hawk_val_t* val, /**< value to convert */ + hawk_bch_t* str /**< string pointer */ +); + +/** + * The hawk_rtx_valtonum() function converts a value to a number. + * If the value is converted to an integer, it is stored in the memory + * pointed to by l and 0 is returned. If the value is converted to a real + * number, it is stored in the memory pointed to by r and 1 is returned. + * The function never fails as long as \a val points to a valid value. + * + * The code below shows how to convert a value to a number and determine + * if it is an integer or a floating-point number. + * + * \code + * hawk_int_t l; + * hawk_flt_t r; + * int n; + * n = hawk_rtx_valtonum (v, &l, &r); + * if (n <= -1) error (); + * else if (n == 0) print_int (l); + * else if (n >= 1) print_flt (r); + * \endcode + * + * \return -1 on failure, 0 if converted to an integer, 1 if converted to + * a floating-point number. + */ +HAWK_EXPORT int hawk_rtx_valtonum ( + hawk_rtx_t* rtx, + const hawk_val_t* val, + hawk_int_t* l, + hawk_flt_t* r +); + +HAWK_EXPORT int hawk_rtx_valtoint ( + hawk_rtx_t* rtx, + const hawk_val_t* val, + hawk_int_t* l +); + +HAWK_EXPORT int hawk_rtx_valtoflt ( + hawk_rtx_t* rtx, + const hawk_val_t* val, + hawk_flt_t* r +); + +/** + * The hawk_rtx_oocharstonum() function converts a string to a number. + * A numeric string in the valid decimal, hexadecimal(0x), binary(0b), + * octal(0) notation is converted to an integer and it is stored into + * memory pointed to by \a l; A string containng '.', 'E', or 'e' is + * converted to a floating-pointer number and it is stored into memory + * pointed to by \a r. If \a strict is 0, the function takes up to the last + * valid character and never fails. If \a strict is 1, an invalid + * character causes the function to return an error. + * + * \return 0 if converted to an integer, + * 1 if converted to a floating-point number + * -1 on error. + */ +#define HAWK_RTX_OOCSTRTONUM_MAKE_OPTION(strict,base) (((strict) & 1) | ((base) << 8)) +#define HAWK_RTX_OOCSTRTONUM_GET_OPTION_STRICT(option) ((option) & 1) +#define HAWK_RTX_STRTONUN_GET_OPTION_BASE(option) ((option) >> 8) + +HAWK_EXPORT int hawk_rtx_bcharstonum ( + hawk_rtx_t* rtx, /**< runtime context */ + int strict, /**< determines to perform strict check */ + const hawk_bch_t* ptr, /**< points to a string to convert */ + hawk_oow_t len, /**< number of characters in a string */ + hawk_int_t* l, /**< stores a converted integer */ + hawk_flt_t* r /**< stores a converted floating-poing number */ +); + +HAWK_EXPORT int hawk_rtx_ucharstonum ( + hawk_rtx_t* rtx, /**< runtime context */ + int strict, /**< determines to perform strict check */ + const hawk_uch_t* ptr, /**< points to a string to convert */ + hawk_oow_t len, /**< number of characters in a string */ + hawk_int_t* l, /**< stores a converted integer */ + hawk_flt_t* r /**< stores a converted floating-poing number */ +); + +#if defined(HAWK_OOCH_IS_BCH) +# define hawk_rtx_oocharstonum(rtx,strict,ptr,len,l,r) hawk_rtx_bcharstonum(rtx,strict,ptr,len,l,r) +#else +# define hawk_rtx_oocharstonum(rtx,strict,ptr,len,l,r) hawk_rtx_ucharstonum(rtx,strict,ptr,len,l,r) +#endif +/** + * The hawk_rtx_hashval() function hashes a simple value + * to a positive integer. It returns -1 for a inhashable value. + */ +HAWK_EXPORT hawk_int_t hawk_rtx_hashval ( + hawk_rtx_t* rtx, + hawk_val_t* v +); + + +/** + * The hawk_rtx_getrefvaltype() function returns the type of the value + * that the given reference points to. + */ +HAWK_EXPORT hawk_val_type_t hawk_rtx_getrefvaltype ( + hawk_rtx_t* rtx, + hawk_val_ref_t* ref +); + +HAWK_EXPORT hawk_val_t* hawk_rtx_getrefval ( + hawk_rtx_t* rtx, + hawk_val_ref_t* ref +); + +/** + * The hawk_rtx_setrefval() function changes the value + * of a variable referenced in \a ref. + * \return 0 on success, -1 on failure. + */ +HAWK_EXPORT int hawk_rtx_setrefval ( + hawk_rtx_t* rtx, + hawk_val_ref_t* ref, + hawk_val_t* val +); + +HAWK_EXPORT void hawk_rtx_setnrflt ( + hawk_rtx_t* rtx, + const hawk_nrflt_t* nrflt +); + +HAWK_EXPORT void hawk_rtx_getnrflt ( + hawk_rtx_t* rtx, + hawk_nrflt_t* nrflt +); + +/** + * The hawk_rtx_allocmem() function allocats a memory block of \a size bytes + * using the memory manager associated with a runtime context \a rtx. + * \return the pointer to a memory block on success, #HAWK_NULL on failure. + */ +HAWK_EXPORT void* hawk_rtx_allocmem ( + hawk_rtx_t* rtx, /**< runtime context */ + hawk_oow_t size /**< block size in bytes */ +); + +/** + * The hawk_rtx_reallocmem() function resizes a memory block pointed to + * by \a ptr to \a size bytes using the memory manager associated with + * a runtime context \a rtx. + * \return the pointer to a memory block on success, #HAWK_NULL on failure. + */ +HAWK_EXPORT void* hawk_rtx_reallocmem ( + hawk_rtx_t* rtx, /**< runtime context */ + void* ptr, /**< memory block */ + hawk_oow_t size /**< block size in bytes */ +); + +/** + * The hawk_rtx_callocmem() function allocates a memory block of + * the size of \a size bytes and initializes it with 0. + * \return a pointer to a memory block on success, #HAWK_NULL on failure + */ +HAWK_EXPORT void* hawk_rtx_callocmem ( + hawk_rtx_t* rtx, /**< runtime context */ + hawk_oow_t size /**< block size in bytes */ +); + +/** + * The hawk_rtx_freemem() function frees a memory block pointed to by \a ptr + * using the memory manager of a runtime ocntext \a rtx. + */ +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE void hawk_rtx_freemem (hawk_rtx_t* rtx, void* ptr) +{ + hawk_freemem (((hawk_rtx_alt_t*)rtx)->awk, ptr); +} +#else +# define hawk_rtx_freemem(rtx,ptr) hawk_freemem(((hawk_rtx_alt_t*)rtx)->awk, ptr) +#endif + +/* ----------------------------------------------------------------------- */ + +HAWK_EXPORT hawk_uch_t* hawk_rtx_dupucstr ( + hawk_rtx_t* hawk, + const hawk_uch_t* ucs, + hawk_oow_t* _ucslen +); + +HAWK_EXPORT hawk_bch_t* hawk_rtx_dupbcstr ( + hawk_rtx_t* hawk, + const hawk_bch_t* bcs, + hawk_oow_t* _bcslen +); + +HAWK_EXPORT hawk_uch_t* hawk_rtx_dupuchars ( + hawk_rtx_t* hawk, + const hawk_uch_t* ucs, + hawk_oow_t ucslen +); + +HAWK_EXPORT hawk_bch_t* hawk_rtx_dupbchars ( + hawk_rtx_t* rtx, + const hawk_bch_t* bcs, + hawk_oow_t bcslen +); + +HAWK_EXPORT hawk_uch_t* hawk_rtx_dupucs ( + hawk_rtx_t* rtx, + const hawk_ucs_t* ucs +); + +HAWK_EXPORT hawk_bch_t* hawk_rtx_dupbcs ( + hawk_rtx_t* rtx, + const hawk_bcs_t* bcs +); + +#if defined(HAWK_OOCH_IS_UCH) +# define hawk_rtx_dupoocstr hawk_rtx_dupucstr +# define hawk_rtx_dupoochars hawk_rtx_dupuchars +# define hawk_rtx_dupoocs hawk_rtx_dupucs +#else +# define hawk_rtx_dupoocstr hawk_rtx_dupbcstr +# define hawk_rtx_dupoochars hawk_rtx_dupbchars +# define hawk_rtx_dupoocs hawk_rtx_dupbcs +#endif + +/* ----------------------------------------------------------------------- */ + +HAWK_EXPORT int hawk_rtx_convbtouchars ( + hawk_rtx_t* rtx, + const hawk_bch_t* bcs, + hawk_oow_t* bcslen, + hawk_uch_t* ucs, + hawk_oow_t* ucslen, + int all +); + +HAWK_EXPORT int hawk_rtx_convutobchars ( + hawk_rtx_t* rtx, + const hawk_uch_t* ucs, + hawk_oow_t* ucslen, + hawk_bch_t* bcs, + hawk_oow_t* bcslen +); + +HAWK_EXPORT int hawk_rtx_convbtoucstr ( + hawk_rtx_t* rtx, + const hawk_bch_t* bcs, + hawk_oow_t* bcslen, + hawk_uch_t* ucs, + hawk_oow_t* ucslen, + int all +); + +HAWK_EXPORT int hawk_rtx_convutobcstr ( + hawk_rtx_t* rtx, + const hawk_uch_t* ucs, + hawk_oow_t* ucslen, + hawk_bch_t* bcs, + hawk_oow_t* bcslen +); + +/* ----------------------------------------------------------------------- */ + +HAWK_EXPORT hawk_uch_t* hawk_rtx_dupbtouchars ( + hawk_rtx_t* rtx, + const hawk_bch_t* bcs, + hawk_oow_t bcslen, + hawk_oow_t* ucslen, + int all +); + +HAWK_EXPORT hawk_bch_t* hawk_rtx_duputobchars ( + hawk_rtx_t* rtx, + const hawk_uch_t* ucs, + hawk_oow_t ucslen, + hawk_oow_t* bcslen +); + +HAWK_EXPORT hawk_uch_t* hawk_rtx_dupb2touchars ( + hawk_rtx_t* rtx, + const hawk_bch_t* bcs1, + hawk_oow_t bcslen1, + const hawk_bch_t* bcs2, + hawk_oow_t bcslen2, + hawk_oow_t* ucslen, + int all +); + +HAWK_EXPORT hawk_bch_t* hawk_rtx_dupu2tobchars ( + hawk_rtx_t* rtx, + const hawk_uch_t* ucs1, + hawk_oow_t ucslen1, + const hawk_uch_t* ucs2, + hawk_oow_t ucslen2, + hawk_oow_t* bcslen +); + +HAWK_EXPORT hawk_uch_t* hawk_rtx_dupbtoucstr ( + hawk_rtx_t* rtx, + const hawk_bch_t* bcs, + hawk_oow_t* ucslen, + int all +); + +HAWK_EXPORT hawk_bch_t* hawk_rtx_duputobcstr ( + hawk_rtx_t* rtx, + const hawk_uch_t* ucs, + hawk_oow_t* bcslen +); + + +HAWK_EXPORT hawk_uch_t* hawk_rtx_dupbtoucharswithcmgr ( + hawk_rtx_t* rtx, + const hawk_bch_t* bcs, + hawk_oow_t _bcslen, + hawk_oow_t* _ucslen, + hawk_cmgr_t* cmgr, + int all +); + +HAWK_EXPORT hawk_bch_t* hawk_rtx_duputobcharswithcmgr ( + hawk_rtx_t* rtx, + const hawk_uch_t* ucs, + hawk_oow_t _ucslen, + hawk_oow_t* _bcslen, + hawk_cmgr_t* cmgr +); + +/* ----------------------------------------------------------------------- */ + +/** + * The hawk_get_awk_nil_val() function returns the pointer to the predefined + * nil value. you can call this without creating a runtime context. + */ +HAWK_EXPORT hawk_val_t* hawk_get_awk_nil_val ( + void +); + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/hawk/lib/hawk.txt b/hawk/lib/hawk.txt new file mode 100644 index 00000000..3287584c --- /dev/null +++ b/hawk/lib/hawk.txt @@ -0,0 +1,71 @@ +Programs + + pattern { action } + function name (parameter-list) { statement } + +Patterns + BEGIN + END + expresion + /regular expression/ + pattern && pattern + pattern || pattern + !pattern + (pattern) + pattern, pattern -> range pattern + +Actions + break + continue + delete array-element + do statement while (expression) + exit [expression] + expression + if (expression) statement [else statement] + input-output statement + for (expression; expression; expression) statement + for (variable in array) statement + next + return [expression] + while (expression) statement + { statements } + +Variables + +global variables (enabled when awk->opt & HAWK_AWK_OPT_VARDCL) + + global x; + global x, y; + +local variables (enabled when awk->opt & HAWK_AWK_OPT_VARDCL) + + local x; + local x, y; + +function arguments (enabled always) + + function funca (x, y) + + +local variables in function declaration (enabled when awk->opt & HAWK_AWK_OPT_FUNCLOCAL) + + function funca (x, y, v1, v2) + + +variables without any declarations (enabled when awk->opt & HAWK_AWK_OPT_NAMEDVAR) + + x = 10; // x is put into the global hash table. + + +Optimization + +constant folding + 2 * 10 => 20 + +loop + remove while (0) { ... } + +if + remove if (0) {} + use else_part only + diff --git a/hawk/lib/htb.c b/hawk/lib/htb.c new file mode 100644 index 00000000..a995ecae --- /dev/null +++ b/hawk/lib/htb.c @@ -0,0 +1,721 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include "hawk-prv.h" + +#define pair_t hawk_htb_pair_t +#define copier_t hawk_htb_copier_t +#define freeer_t hawk_htb_freeer_t +#define hasher_t hawk_htb_hasher_t +#define comper_t hawk_htb_comper_t +#define keeper_t hawk_htb_keeper_t +#define sizer_t hawk_htb_sizer_t +#define walker_t hawk_htb_walker_t +#define cbserter_t hawk_htb_cbserter_t +#define style_t hawk_htb_style_t +#define style_kind_t hawk_htb_style_kind_t + +#define KPTR(p) HAWK_HTB_KPTR(p) +#define KLEN(p) HAWK_HTB_KLEN(p) +#define VPTR(p) HAWK_HTB_VPTR(p) +#define VLEN(p) HAWK_HTB_VLEN(p) +#define NEXT(p) HAWK_HTB_NEXT(p) + +#define KTOB(htb,len) ((len)*(htb)->scale[HAWK_HTB_KEY]) +#define VTOB(htb,len) ((len)*(htb)->scale[HAWK_HTB_VAL]) + +HAWK_INLINE pair_t* hawk_htb_allocpair (hawk_htb_t* htb, void* kptr, hawk_oow_t klen, void* vptr, hawk_oow_t vlen) +{ + pair_t* n; + copier_t kcop, vcop; + hawk_oow_t as; + + kcop = htb->style->copier[HAWK_HTB_KEY]; + vcop = htb->style->copier[HAWK_HTB_VAL]; + + as = HAWK_SIZEOF(pair_t); + if (kcop == HAWK_HTB_COPIER_INLINE) as += HAWK_ALIGN_POW2(KTOB(htb,klen), HAWK_SIZEOF_VOID_P); + if (vcop == HAWK_HTB_COPIER_INLINE) as += VTOB(htb,vlen); + + n = (pair_t*) hawk_allocmem(htb->hawk, as); + if (n == HAWK_NULL) return HAWK_NULL; + + NEXT(n) = HAWK_NULL; + + KLEN(n) = klen; + if (kcop == HAWK_HTB_COPIER_SIMPLE) + { + KPTR(n) = kptr; + } + else if (kcop == HAWK_HTB_COPIER_INLINE) + { + KPTR(n) = n + 1; + /* if kptr is HAWK_NULL, the inline copier does not fill + * the actual key area */ + if (kptr) HAWK_MEMCPY (KPTR(n), kptr, KTOB(htb,klen)); + } + else + { + KPTR(n) = kcop (htb, kptr, klen); + if (KPTR(n) == HAWK_NULL) + { + hawk_freemem (htb->hawk, n); + return HAWK_NULL; + } + } + + VLEN(n) = vlen; + if (vcop == HAWK_HTB_COPIER_SIMPLE) + { + VPTR(n) = vptr; + } + else if (vcop == HAWK_HTB_COPIER_INLINE) + { + VPTR(n) = n + 1; + if (kcop == HAWK_HTB_COPIER_INLINE) + VPTR(n) = (hawk_uint8_t*)VPTR(n) + HAWK_ALIGN_POW2(KTOB(htb,klen), HAWK_SIZEOF_VOID_P); + /* if vptr is HAWK_NULL, the inline copier does not fill + * the actual value area */ + if (vptr) HAWK_MEMCPY (VPTR(n), vptr, VTOB(htb,vlen)); + } + else + { + VPTR(n) = vcop (htb, vptr, vlen); + if (VPTR(n) != HAWK_NULL) + { + if (htb->style->freeer[HAWK_HTB_KEY] != HAWK_NULL) + htb->style->freeer[HAWK_HTB_KEY] (htb, KPTR(n), KLEN(n)); + hawk_freemem (htb->hawk, n); + return HAWK_NULL; + } + } + + return n; +} + +HAWK_INLINE void hawk_htb_freepair (hawk_htb_t* htb, pair_t* pair) +{ + if (htb->style->freeer[HAWK_HTB_KEY] != HAWK_NULL) + htb->style->freeer[HAWK_HTB_KEY] (htb, KPTR(pair), KLEN(pair)); + if (htb->style->freeer[HAWK_HTB_VAL] != HAWK_NULL) + htb->style->freeer[HAWK_HTB_VAL] (htb, VPTR(pair), VLEN(pair)); + hawk_freemem (htb->hawk, pair); +} + +static HAWK_INLINE pair_t* change_pair_val ( + hawk_htb_t* htb, pair_t* pair, void* vptr, hawk_oow_t vlen) +{ + if (VPTR(pair) == vptr && VLEN(pair) == vlen) + { + /* if the old value and the new value are the same, + * it just calls the handler for this condition. + * No value replacement occurs. */ + if (htb->style->keeper != HAWK_NULL) + { + htb->style->keeper (htb, vptr, vlen); + } + } + else + { + copier_t vcop = htb->style->copier[HAWK_HTB_VAL]; + void* ovptr = VPTR(pair); + hawk_oow_t ovlen = VLEN(pair); + + /* place the new value according to the copier */ + if (vcop == HAWK_HTB_COPIER_SIMPLE) + { + VPTR(pair) = vptr; + VLEN(pair) = vlen; + } + else if (vcop == HAWK_HTB_COPIER_INLINE) + { + if (ovlen == vlen) + { + if (vptr) HAWK_MEMCPY (VPTR(pair), vptr, VTOB(htb,vlen)); + } + else + { + /* need to reconstruct the pair */ + pair_t* p = hawk_htb_allocpair (htb, + KPTR(pair), KLEN(pair), + vptr, vlen); + if (p == HAWK_NULL) return HAWK_NULL; + hawk_htb_freepair (htb, pair); + return p; + } + } + else + { + void* nvptr = vcop (htb, vptr, vlen); + if (nvptr == HAWK_NULL) return HAWK_NULL; + VPTR(pair) = nvptr; + VLEN(pair) = vlen; + } + + /* free up the old value */ + if (htb->style->freeer[HAWK_HTB_VAL] != HAWK_NULL) + { + htb->style->freeer[HAWK_HTB_VAL] (htb, ovptr, ovlen); + } + } + + + return pair; +} + +static style_t style[] = +{ + /* == HAWK_HTB_STYLE_DEFAULT == */ + { + { + HAWK_HTB_COPIER_DEFAULT, + HAWK_HTB_COPIER_DEFAULT + }, + { + HAWK_HTB_FREEER_DEFAULT, + HAWK_HTB_FREEER_DEFAULT + }, + HAWK_HTB_COMPER_DEFAULT, + HAWK_HTB_KEEPER_DEFAULT, + HAWK_HTB_SIZER_DEFAULT, + HAWK_HTB_HASHER_DEFAULT + }, + + /* == HAWK_HTB_STYLE_INLINE_COPIERS == */ + { + { + HAWK_HTB_COPIER_INLINE, + HAWK_HTB_COPIER_INLINE + }, + { + HAWK_HTB_FREEER_DEFAULT, + HAWK_HTB_FREEER_DEFAULT + }, + HAWK_HTB_COMPER_DEFAULT, + HAWK_HTB_KEEPER_DEFAULT, + HAWK_HTB_SIZER_DEFAULT, + HAWK_HTB_HASHER_DEFAULT + }, + + /* == HAWK_HTB_STYLE_INLINE_KEY_COPIER == */ + { + { + HAWK_HTB_COPIER_INLINE, + HAWK_HTB_COPIER_DEFAULT + }, + { + HAWK_HTB_FREEER_DEFAULT, + HAWK_HTB_FREEER_DEFAULT + }, + HAWK_HTB_COMPER_DEFAULT, + HAWK_HTB_KEEPER_DEFAULT, + HAWK_HTB_SIZER_DEFAULT, + HAWK_HTB_HASHER_DEFAULT + }, + + /* == HAWK_HTB_STYLE_INLINE_VALUE_COPIER == */ + { + { + HAWK_HTB_COPIER_DEFAULT, + HAWK_HTB_COPIER_INLINE + }, + { + HAWK_HTB_FREEER_DEFAULT, + HAWK_HTB_FREEER_DEFAULT + }, + HAWK_HTB_COMPER_DEFAULT, + HAWK_HTB_KEEPER_DEFAULT, + HAWK_HTB_SIZER_DEFAULT, + HAWK_HTB_HASHER_DEFAULT + } +}; + +const style_t* hawk_get_htb_style (style_kind_t kind) +{ + return &style[kind]; +} + +hawk_htb_t* hawk_htb_open (hawk_t* hawk, hawk_oow_t xtnsize, hawk_oow_t capa, int factor, int kscale, int vscale) +{ + hawk_htb_t* htb; + + htb = (hawk_htb_t*)hawk_allocmem(hawk, HAWK_SIZEOF(hawk_htb_t) + xtnsize); + if (!htb) return HAWK_NULL; + + if (hawk_htb_init(htb, hawk, capa, factor, kscale, vscale) <= -1) + { + hawk_freemem (hawk, htb); + return HAWK_NULL; + } + + HAWK_MEMSET (htb + 1, 0, xtnsize); + return htb; +} + +void hawk_htb_close (hawk_htb_t* htb) +{ + hawk_htb_fini (htb); + hawk_freemem (htb->hawk, htb); +} + +int hawk_htb_init (hawk_htb_t* htb, hawk_t* hawk, hawk_oow_t capa, int factor, int kscale, int vscale) +{ + /* The initial capacity should be greater than 0. + * Otherwise, it is adjusted to 1 in the release mode */ + HAWK_ASSERT (hawk, capa > 0); + + /* The load factor should be between 0 and 100 inclusive. + * In the release mode, a value out of the range is adjusted to 100 */ + HAWK_ASSERT (hawk, factor >= 0 && factor <= 100); + + HAWK_ASSERT (hawk, kscale >= 0 && kscale <= HAWK_TYPE_MAX(hawk_uint8_t)); + HAWK_ASSERT (hawk, vscale >= 0 && vscale <= HAWK_TYPE_MAX(hawk_uint8_t)); + + /* some initial adjustment */ + if (capa <= 0) capa = 1; + if (factor > 100) factor = 100; + + /* do not zero out the extension */ + HAWK_MEMSET (htb, 0, HAWK_SIZEOF(*htb)); + htb->hawk = hawk; + + htb->bucket = hawk_allocmem(hawk, capa * HAWK_SIZEOF(pair_t*)); + if (htb->bucket == HAWK_NULL) return -1; + + /*for (i = 0; i < capa; i++) htb->bucket[i] = HAWK_NULL;*/ + HAWK_MEMSET (htb->bucket, 0, capa * HAWK_SIZEOF(pair_t*)); + + htb->factor = factor; + htb->scale[HAWK_HTB_KEY] = (kscale < 1)? 1: kscale; + htb->scale[HAWK_HTB_VAL] = (vscale < 1)? 1: vscale; + + htb->size = 0; + htb->capa = capa; + htb->threshold = htb->capa * htb->factor / 100; + if (htb->capa > 0 && htb->threshold <= 0) htb->threshold = 1; + + htb->style = &style[0]; + return 0; +} + +void hawk_htb_fini (hawk_htb_t* htb) +{ + hawk_htb_clear (htb); + hawk_freemem (htb->hawk, htb->bucket); +} + +const style_t* hawk_htb_getstyle (const hawk_htb_t* htb) +{ + return htb->style; +} + +void hawk_htb_setstyle (hawk_htb_t* htb, const style_t* style) +{ + HAWK_ASSERT (htb->hawk, style != HAWK_NULL); + htb->style = style; +} + +hawk_oow_t hawk_htb_getsize (const hawk_htb_t* htb) +{ + return htb->size; +} + +hawk_oow_t hawk_htb_getcapa (const hawk_htb_t* htb) +{ + return htb->capa; +} + +pair_t* hawk_htb_search (const hawk_htb_t* htb, const void* kptr, hawk_oow_t klen) +{ + pair_t* pair; + hawk_oow_t hc; + + hc = htb->style->hasher(htb,kptr,klen) % htb->capa; + pair = htb->bucket[hc]; + + while (pair != HAWK_NULL) + { + if (htb->style->comper (htb, KPTR(pair), KLEN(pair), kptr, klen) == 0) + { + return pair; + } + + pair = NEXT(pair); + } + + return HAWK_NULL; +} + +static HAWK_INLINE int reorganize (hawk_htb_t* htb) +{ + hawk_oow_t i, hc, new_capa; + pair_t** new_buck; + + if (htb->style->sizer) + { + new_capa = htb->style->sizer (htb, htb->capa + 1); + + /* if no change in capacity, return success + * without reorganization */ + if (new_capa == htb->capa) return 0; + + /* adjust to 1 if the new capacity is not reasonable */ + if (new_capa <= 0) new_capa = 1; + } + else + { + /* the bucket is doubled until it grows up to 65536 slots. + * once it has reached it, it grows by 65536 slots */ + new_capa = (htb->capa >= 65536)? (htb->capa + 65536): (htb->capa << 1); + } + + new_buck = (pair_t**)hawk_allocmem(htb->hawk, new_capa * HAWK_SIZEOF(pair_t*)); + if (new_buck == HAWK_NULL) + { + /* reorganization is disabled once it fails */ + htb->threshold = 0; + return -1; + } + + /*for (i = 0; i < new_capa; i++) new_buck[i] = HAWK_NULL;*/ + HAWK_MEMSET (new_buck, 0, new_capa*HAWK_SIZEOF(pair_t*)); + + for (i = 0; i < htb->capa; i++) + { + pair_t* pair = htb->bucket[i]; + + while (pair != HAWK_NULL) + { + pair_t* next = NEXT(pair); + + hc = htb->style->hasher(htb, KPTR(pair), KLEN(pair)) % new_capa; + + NEXT(pair) = new_buck[hc]; + new_buck[hc] = pair; + + pair = next; + } + } + + hawk_freemem (htb->hawk, htb->bucket); + htb->bucket = new_buck; + htb->capa = new_capa; + htb->threshold = htb->capa * htb->factor / 100; + + return 0; +} + +/* insert options */ +#define UPSERT 1 +#define UPDATE 2 +#define ENSERT 3 +#define INSERT 4 + +static HAWK_INLINE pair_t* insert (hawk_htb_t* htb, void* kptr, hawk_oow_t klen, void* vptr, hawk_oow_t vlen, int opt) +{ + pair_t* pair, * p, * prev, * next; + hawk_oow_t hc; + + hc = htb->style->hasher(htb,kptr,klen) % htb->capa; + pair = htb->bucket[hc]; + prev = HAWK_NULL; + + while (pair != HAWK_NULL) + { + next = NEXT(pair); + + if (htb->style->comper (htb, KPTR(pair), KLEN(pair), kptr, klen) == 0) + { + /* found a pair with a matching key */ + switch (opt) + { + case UPSERT: + case UPDATE: + p = change_pair_val (htb, pair, vptr, vlen); + if (p == HAWK_NULL) + { + /* error in changing the value */ + return HAWK_NULL; + } + if (p != pair) + { + /* old pair destroyed. new pair reallocated. + * relink to include the new pair but to drop + * the old pair. */ + if (prev == HAWK_NULL) + htb->bucket[hc] = p; + else NEXT(prev) = p; + NEXT(p) = next; + } + return p; + + case ENSERT: + /* return existing pair */ + return pair; + + case INSERT: + /* return failure */ + return HAWK_NULL; + } + } + + prev = pair; + pair = next; + } + + if (opt == UPDATE) return HAWK_NULL; + + if (htb->threshold > 0 && htb->size >= htb->threshold) + { + /* ingore reorganization error as it simply means + * more bucket collision and performance penalty. */ + if (reorganize(htb) == 0) + { + hc = htb->style->hasher(htb,kptr,klen) % htb->capa; + } + } + + HAWK_ASSERT (htb->hawk, pair == HAWK_NULL); + + pair = hawk_htb_allocpair (htb, kptr, klen, vptr, vlen); + if (pair == HAWK_NULL) return HAWK_NULL; /* error */ + + NEXT(pair) = htb->bucket[hc]; + htb->bucket[hc] = pair; + htb->size++; + + return pair; /* new key added */ +} + +pair_t* hawk_htb_upsert (hawk_htb_t* htb, void* kptr, hawk_oow_t klen, void* vptr, hawk_oow_t vlen) +{ + return insert (htb, kptr, klen, vptr, vlen, UPSERT); +} + +pair_t* hawk_htb_ensert (hawk_htb_t* htb, void* kptr, hawk_oow_t klen, void* vptr, hawk_oow_t vlen) +{ + return insert (htb, kptr, klen, vptr, vlen, ENSERT); +} + +pair_t* hawk_htb_insert (hawk_htb_t* htb, void* kptr, hawk_oow_t klen, void* vptr, hawk_oow_t vlen) +{ + return insert (htb, kptr, klen, vptr, vlen, INSERT); +} + + +pair_t* hawk_htb_update (hawk_htb_t* htb, void* kptr, hawk_oow_t klen, void* vptr, hawk_oow_t vlen) +{ + return insert (htb, kptr, klen, vptr, vlen, UPDATE); +} + +pair_t* hawk_htb_cbsert (hawk_htb_t* htb, void* kptr, hawk_oow_t klen, cbserter_t cbserter, void* ctx) +{ + pair_t* pair, * p, * prev, * next; + hawk_oow_t hc; + + hc = htb->style->hasher(htb,kptr,klen) % htb->capa; + pair = htb->bucket[hc]; + prev = HAWK_NULL; + + while (pair != HAWK_NULL) + { + next = NEXT(pair); + + if (htb->style->comper (htb, KPTR(pair), KLEN(pair), kptr, klen) == 0) + { + /* found a pair with a matching key */ + p = cbserter (htb, pair, kptr, klen, ctx); + if (p == HAWK_NULL) + { + /* error returned by the callback function */ + return HAWK_NULL; + } + if (p != pair) + { + /* old pair destroyed. new pair reallocated. + * relink to include the new pair but to drop + * the old pair. */ + if (prev == HAWK_NULL) + htb->bucket[hc] = p; + else NEXT(prev) = p; + NEXT(p) = next; + } + return p; + } + + prev = pair; + pair = next; + } + + if (htb->threshold > 0 && htb->size >= htb->threshold) + { + /* ingore reorganization error as it simply means + * more bucket collision and performance penalty. */ + if (reorganize(htb) == 0) + { + hc = htb->style->hasher(htb,kptr,klen) % htb->capa; + } + } + + HAWK_ASSERT (htb->hawk, pair == HAWK_NULL); + + pair = cbserter (htb, HAWK_NULL, kptr, klen, ctx); + if (pair == HAWK_NULL) return HAWK_NULL; /* error */ + + NEXT(pair) = htb->bucket[hc]; + htb->bucket[hc] = pair; + htb->size++; + + return pair; /* new key added */ +} + +int hawk_htb_delete (hawk_htb_t* htb, const void* kptr, hawk_oow_t klen) +{ + pair_t* pair, * prev; + hawk_oow_t hc; + + hc = htb->style->hasher(htb,kptr,klen) % htb->capa; + pair = htb->bucket[hc]; + prev = HAWK_NULL; + + while (pair != HAWK_NULL) + { + if (htb->style->comper (htb, KPTR(pair), KLEN(pair), kptr, klen) == 0) + { + if (prev == HAWK_NULL) + htb->bucket[hc] = NEXT(pair); + else NEXT(prev) = NEXT(pair); + + hawk_htb_freepair (htb, pair); + htb->size--; + + return 0; + } + + prev = pair; + pair = NEXT(pair); + } + + return -1; +} + +void hawk_htb_clear (hawk_htb_t* htb) +{ + hawk_oow_t i; + pair_t* pair, * next; + + for (i = 0; i < htb->capa; i++) + { + pair = htb->bucket[i]; + + while (pair != HAWK_NULL) + { + next = NEXT(pair); + hawk_htb_freepair (htb, pair); + htb->size--; + pair = next; + } + + htb->bucket[i] = HAWK_NULL; + } +} + +void hawk_htb_walk (hawk_htb_t* htb, walker_t walker, void* ctx) +{ + hawk_oow_t i; + pair_t* pair, * next; + + for (i = 0; i < htb->capa; i++) + { + pair = htb->bucket[i]; + + while (pair != HAWK_NULL) + { + next = NEXT(pair); + if (walker(htb, pair, ctx) == HAWK_HTB_WALK_STOP) return; + pair = next; + } + } +} + +pair_t* hawk_htb_getfirstpair (hawk_htb_t* htb, hawk_oow_t* buckno) +{ + hawk_oow_t i; + pair_t* pair; + + for (i = 0; i < htb->capa; i++) + { + pair = htb->bucket[i]; + if (pair != HAWK_NULL) + { + *buckno = i; + return pair; + } + } + + return HAWK_NULL; +} + +pair_t* hawk_htb_getnextpair (hawk_htb_t* htb, pair_t* pair, hawk_oow_t* buckno) +{ + hawk_oow_t i; + pair_t* next; + + next = NEXT(pair); + if (next != HAWK_NULL) + { + /* no change in bucket number */ + return next; + } + + for (i = (*buckno)+1; i < htb->capa; i++) + { + pair = htb->bucket[i]; + if (pair != HAWK_NULL) + { + *buckno = i; + return pair; + } + } + + return HAWK_NULL; +} + +hawk_oow_t hawk_htb_dflhash (const hawk_htb_t* htb, const void* kptr, hawk_oow_t klen) +{ + hawk_oow_t h; + HAWK_HASH_BYTES (h, kptr, klen); + return h ; +} + +int hawk_htb_dflcomp (const hawk_htb_t* htb, const void* kptr1, hawk_oow_t klen1, const void* kptr2, hawk_oow_t klen2) +{ + if (klen1 == klen2) return HAWK_MEMCMP (kptr1, kptr2, KTOB(htb,klen1)); + /* it just returns 1 to indicate that they are different. */ + return 1; +} + diff --git a/hawk/lib/imap-imp.h b/hawk/lib/imap-imp.h new file mode 100644 index 00000000..878f0cce --- /dev/null +++ b/hawk/lib/imap-imp.h @@ -0,0 +1,156 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* THIS FILE IS SUPPOSED TO BE INCLUDED BY MODULE SOURCE THAT MAINTAINS MAPPING BETWEEN ID AND DATA */ + +typedef struct __IMAP_NODE_T __IMAP_NODE_T; +struct __IMAP_NODE_T +{ + __IMAP_NODE_T* prev; + __IMAP_NODE_T* next; + int id; + + __IMAP_NODE_T_DATA +}; + +typedef struct __IMAP_LIST_T __IMAP_LIST_T; +struct __IMAP_LIST_T +{ + __IMAP_NODE_T* head; + __IMAP_NODE_T* tail; + __IMAP_NODE_T* free; + + /* mapping table to map 'id' to 'node' */ + struct + { + __IMAP_NODE_T** tab; + int capa; + int high; + } map; + + __IMAP_LIST_T_DATA +}; + +static __IMAP_NODE_T* __MAKE_IMAP_NODE (hawk_rtx_t* rtx, __IMAP_LIST_T* list) +{ + /* create a new context node and append it to the list tail */ + __IMAP_NODE_T* node; + + node = HAWK_NULL; + + if (list->free) + { + node = list->free; + list->free = node->next; + } + else + { + node = hawk_rtx_callocmem(rtx, HAWK_SIZEOF(*node)); + if (!node) goto oops; + + if (list->map.high <= list->map.capa) + { + hawk_oow_t newcapa, inc; + __IMAP_NODE_T** tmp; + + inc = HAWK_TYPE_MAX(int) - list->map.capa; + if (inc == 0) goto oops; /* too many nodes */ + + if (inc > 64) inc = 64; + newcapa = (hawk_oow_t)list->map.capa + inc; + + tmp = (__IMAP_NODE_T**)hawk_rtx_reallocmem(rtx, list->map.tab, HAWK_SIZEOF(*tmp) * newcapa); + if (!tmp) goto oops; + + HAWK_MEMSET (&tmp[list->map.capa], 0, HAWK_SIZEOF(*tmp) * (newcapa - list->map.capa)); + + list->map.tab = tmp; + list->map.capa = newcapa; + } + + node->id = list->map.high; + list->map.high++; + } + + HAWK_ASSERT (hawk_rtx_getawk(rtx), list->map.tab[node->id] == HAWK_NULL); + list->map.tab[node->id] = node; + + /* append it to the tail */ + node->next = HAWK_NULL; + node->prev = list->tail; + if (list->tail) list->tail->next = node; + else list->head = node; + list->tail = node; + + return node; + +oops: + if (node) hawk_rtx_freemem (rtx, node); + return HAWK_NULL; +} + +static void __FREE_IMAP_NODE (hawk_rtx_t* rtx, __IMAP_LIST_T* list, __IMAP_NODE_T* node) +{ + if (node->prev) node->prev->next = node->next; + if (node->next) node->next->prev = node->prev; + if (list->head == node) list->head = node->next; + if (list->tail == node) list->tail = node->prev; + + list->map.tab[node->id] = HAWK_NULL; + + if (list->map.high == node->id + 1) + { + /* destroy the actual node if the node to be freed has the + * highest id */ + hawk_rtx_freemem (rtx, node); + list->map.high--; + } + else + { + /* otherwise, chain the node to the free list */ + node->next = list->free; + list->free = node; + } + + /* however, i destroy the whole free list when all the nodes are + * chanined to the free list */ + if (list->head == HAWK_NULL) + { + __IMAP_NODE_T* curnode; + + while (list->free) + { + curnode = list->free; + list->free = list->free->next; + hawk_rtx_freemem (rtx, curnode); + } + + hawk_rtx_freemem (rtx, list->map.tab); + list->map.high = 0; + list->map.capa = 0; + list->map.tab = HAWK_NULL; + } +} diff --git a/hawk/lib/mb8.c b/hawk/lib/mb8.c new file mode 100644 index 00000000..a892d9b5 --- /dev/null +++ b/hawk/lib/mb8.c @@ -0,0 +1,41 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "hawk-prv.h" + +hawk_oow_t hawk_uc_to_mb8 (hawk_uch_t wc, hawk_bch_t* mb8, hawk_oow_t size) +{ + if (size <= 0) return size + 1; /* buffer too small */ + if (wc > HAWK_TYPE_MAX(hawk_uint8_t)) return 0; /* illegal character */ + if (mb8) *(hawk_uint8_t*)mb8 = wc; + return 1; +} + +hawk_oow_t hawk_mb8_to_uc (const hawk_bch_t* mb8, hawk_oow_t size, hawk_uch_t* wc) +{ + *wc = *(const hawk_uint8_t*)mb8; + return 1; +} diff --git a/hawk/lib/misc-imp.h b/hawk/lib/misc-imp.h new file mode 100644 index 00000000..e1e1520b --- /dev/null +++ b/hawk/lib/misc-imp.h @@ -0,0 +1,530 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* this file is supposed to be included by misc.c */ + + +hawk_int_t awk_strxtoint (hawk_t* awk, const char_t* str, hawk_oow_t len, int base, const char_t** endptr) +{ + hawk_int_t n = 0; + const char_t* p; + const char_t* end; + hawk_oow_t rem; + int digit, negative = 0; + + HAWK_ASSERT (awk, base < 37); + + p = str; + end = str + len; + + if (awk->opt.trait & HAWK_STRIPSTRSPC) + { + /* strip off leading spaces */ + while (p < end && AWK_IS_SPACE(*p)) p++; + } + + /* check for a sign */ + while (p < end) + { + if (*p == _T('-')) + { + negative = ~negative; + p++; + } + else if (*p == _T('+')) p++; + else break; + } + + /* check for a binary/octal/hexadecimal notation */ + rem = end - p; + if (base == 0) + { + if (rem >= 1 && *p == _T('0')) + { + p++; + + if (rem == 1) base = 8; + else if (*p == _T('x') || *p == _T('X')) + { + p++; base = 16; + } + else if (*p == _T('b') || *p == _T('B')) + { + p++; base = 2; + } + else base = 8; + } + else base = 10; + } + else if (rem >= 2 && base == 16) + { + if (*p == _T('0') && + (*(p+1) == _T('x') || *(p+1) == _T('X'))) p += 2; + } + else if (rem >= 2 && base == 2) + { + if (*p == _T('0') && + (*(p+1) == _T('b') || *(p+1) == _T('B'))) p += 2; + } + + /* process the digits */ + while (p < end) + { + if (*p >= _T('0') && *p <= _T('9')) + digit = *p - _T('0'); + else if (*p >= _T('A') && *p <= _T('Z')) + digit = *p - _T('A') + 10; + else if (*p >= _T('a') && *p <= _T('z')) + digit = *p - _T('a') + 10; + else break; + + if (digit >= base) break; + n = n * base + digit; + + p++; + } + + if (endptr) *endptr = p; + return (negative)? -n: n; +} + + + +/* + * hawk_strtoflt is almost a replica of strtod. + * + * strtod.c -- + * + * Source code for the "strtod" library procedure. + * + * Copyright (c) 1988-1993 The Regents of the University of California. + * Copyright (c) 1994 Sun Microsystems, Inc. + * + * Permission to use, copy, modify, and distribute this + * software and its documentation for any purpose and without + * fee is hereby granted, provided that the above copyright + * notice appear in all copies. The University of California + * makes no representations about the suitability of this + * software for any purpose. It is provided "as is" without + * express or implied warranty. + */ + +/* + * double(64bits) extended(80-bits) quadruple(128-bits) + * exponent 11 bits 15 bits 15 bits + * fraction 52 bits 63 bits 112 bits + * sign 1 bit 1 bit 1 bit + * integer 1 bit + */ +#define MAX_EXPONENT 511 + +hawk_flt_t awk_strtoflt (hawk_t* awk, const char_t* str) +{ + /* + * Table giving binary powers of 10. Entry is 10^2^i. + * Used to convert decimal exponents into floating-point numbers. + */ + static hawk_flt_t powers_of_10[] = + { + 10., 100., 1.0e4, 1.0e8, 1.0e16, + 1.0e32, 1.0e64, 1.0e128, 1.0e256 + }; + + hawk_flt_t fraction, dbl_exp, * d; + const char_t* p; + cint_t c; + int exp = 0; /* Exponent read from "EX" field */ + + /* + * Exponent that derives from the fractional part. Under normal + * circumstatnces, it is the negative of the number of digits in F. + * However, if I is very long, the last digits of I get dropped + * (otherwise a long I with a large negative exponent could cause an + * unnecessary overflow on I alone). In this case, frac_exp is + * incremented one for each dropped digit. + */ + + int frac_exp; + int mant_size; /* Number of digits in mantissa. */ + int dec_pt; /* Number of mantissa digits BEFORE decimal point */ + const char_t *pexp; /* Temporarily holds location of exponent in string */ + int negative = 0, exp_negative = 0; + + p = str; + + if (awk->opt.trait & HAWK_STRIPSTRSPC) + { + /* strip off leading spaces */ + while (AWK_IS_SPACE(*p)) p++; + } + + /* check for a sign */ + while (*p != _T('\0')) + { + if (*p == _T('-')) + { + negative = ~negative; + p++; + } + else if (*p == _T('+')) p++; + else break; + } + + /* Count the number of digits in the mantissa (including the decimal + * point), and also locate the decimal point. */ + dec_pt = -1; + for (mant_size = 0; ; mant_size++) + { + c = *p; + if (!AWK_IS_DIGIT(c)) + { + if ((c != _T('.')) || (dec_pt >= 0)) break; + dec_pt = mant_size; + } + p++; + } + + /* + * Now suck up the digits in the mantissa. Use two integers to + * collect 9 digits each (this is faster than using floating-point). + * If the mantissa has more than 18 digits, ignore the extras, since + * they can't affect the value anyway. + */ + pexp = p; + p -= mant_size; + if (dec_pt < 0) + { + dec_pt = mant_size; + } + else + { + mant_size--; /* One of the digits was the point */ + } + + if (mant_size > 18) + { + frac_exp = dec_pt - 18; + mant_size = 18; + } + else + { + frac_exp = dec_pt - mant_size; + } + + if (mant_size == 0) + { + fraction = 0.0; + /*p = str;*/ + p = pexp; + goto done; + } + else + { + int frac1, frac2; + frac1 = 0; + for ( ; mant_size > 9; mant_size--) + { + c = *p; + p++; + if (c == _T('.')) + { + c = *p; + p++; + } + frac1 = 10 * frac1 + (c - _T('0')); + } + frac2 = 0; + for (; mant_size > 0; mant_size--) { + c = *p; + p++; + if (c == _T('.')) + { + c = *p; + p++; + } + frac2 = 10*frac2 + (c - _T('0')); + } + fraction = (1.0e9 * frac1) + frac2; + } + + /* Skim off the exponent */ + p = pexp; + if ((*p == _T('E')) || (*p == _T('e'))) + { + p++; + if (*p == _T('-')) + { + exp_negative = 1; + p++; + } + else + { + if (*p == _T('+')) p++; + exp_negative = 0; + } + if (!AWK_IS_DIGIT(*p)) + { + /* p = pexp; */ + /* goto done; */ + goto no_exp; + } + while (AWK_IS_DIGIT(*p)) + { + exp = exp * 10 + (*p - _T('0')); + p++; + } + } + +no_exp: + if (exp_negative) exp = frac_exp - exp; + else exp = frac_exp + exp; + + /* + * Generate a floating-point number that represents the exponent. + * Do this by processing the exponent one bit at a time to combine + * many powers of 2 of 10. Then combine the exponent with the + * fraction. + */ + if (exp < 0) + { + exp_negative = 1; + exp = -exp; + } + else exp_negative = 0; + + if (exp > MAX_EXPONENT) exp = MAX_EXPONENT; + + dbl_exp = 1.0; + + for (d = powers_of_10; exp != 0; exp >>= 1, d++) + { + if (exp & 01) dbl_exp *= *d; + } + + if (exp_negative) fraction /= dbl_exp; + else fraction *= dbl_exp; + +done: + return (negative)? -fraction: fraction; +} + +hawk_flt_t awk_strxtoflt (hawk_t* awk, const char_t* str, hawk_oow_t len, const char_t** endptr) +{ + /* + * Table giving binary powers of 10. Entry is 10^2^i. + * Used to convert decimal exponents into floating-point numbers. + */ + static hawk_flt_t powers_of_10[] = + { + 10., 100., 1.0e4, 1.0e8, 1.0e16, + 1.0e32, 1.0e64, 1.0e128, 1.0e256 + }; + + hawk_flt_t fraction, dbl_exp, * d; + const char_t* p, * end; + cint_t c; + int exp = 0; /* Exponent read from "EX" field */ + + /* + * Exponent that derives from the fractional part. Under normal + * circumstatnces, it is the negative of the number of digits in F. + * However, if I is very long, the last digits of I get dropped + * (otherwise a long I with a large negative exponent could cause an + * unnecessary overflow on I alone). In this case, frac_exp is + * incremented one for each dropped digit. + */ + + int frac_exp; + int mant_size; /* Number of digits in mantissa. */ + int dec_pt; /* Number of mantissa digits BEFORE decimal point */ + const char_t *pexp; /* Temporarily holds location of exponent in string */ + int negative = 0, exp_negative = 0; + + p = str; + end = str + len; + + /* Strip off leading blanks and check for a sign */ + /*while (AWK_IS_SPACE(*p)) p++;*/ + + /*while (*p != _T('\0')) */ + while (p < end) + { + if (*p == _T('-')) + { + negative = ~negative; + p++; + } + else if (*p == _T('+')) p++; + else break; + } + + /* Count the number of digits in the mantissa (including the decimal + * point), and also locate the decimal point. */ + dec_pt = -1; + /*for (mant_size = 0; ; mant_size++) */ + for (mant_size = 0; p < end; mant_size++) + { + c = *p; + if (!AWK_IS_DIGIT(c)) + { + if (c != _T('.') || dec_pt >= 0) break; + dec_pt = mant_size; + } + p++; + } + + /* + * Now suck up the digits in the mantissa. Use two integers to + * collect 9 digits each (this is faster than using floating-point). + * If the mantissa has more than 18 digits, ignore the extras, since + * they can't affect the value anyway. + */ + pexp = p; + p -= mant_size; + if (dec_pt < 0) + { + dec_pt = mant_size; + } + else + { + mant_size--; /* One of the digits was the point */ + } + + if (mant_size > 18) /* TODO: is 18 correct for hawk_flt_t??? */ + { + frac_exp = dec_pt - 18; + mant_size = 18; + } + else + { + frac_exp = dec_pt - mant_size; + } + + if (mant_size == 0) + { + fraction = 0.0; + /*p = str;*/ + p = pexp; + goto done; + } + else + { + int frac1, frac2; + + frac1 = 0; + for ( ; mant_size > 9; mant_size--) + { + c = *p; + p++; + if (c == _T('.')) + { + c = *p; + p++; + } + frac1 = 10 * frac1 + (c - _T('0')); + } + + frac2 = 0; + for (; mant_size > 0; mant_size--) { + c = *p++; + if (c == _T('.')) + { + c = *p; + p++; + } + frac2 = 10 * frac2 + (c - _T('0')); + } + fraction = (1.0e9 * frac1) + frac2; + } + + /* Skim off the exponent */ + p = pexp; + if (p < end && (*p == _T('E') || *p == _T('e'))) + { + p++; + + if (p < end) + { + if (*p == _T('-')) + { + exp_negative = 1; + p++; + } + else + { + if (*p == _T('+')) p++; + exp_negative = 0; + } + } + else exp_negative = 0; + + if (!(p < end && AWK_IS_DIGIT(*p))) + { + /*p = pexp;*/ + /*goto done;*/ + goto no_exp; + } + + while (p < end && AWK_IS_DIGIT(*p)) + { + exp = exp * 10 + (*p - _T('0')); + p++; + } + } + +no_exp: + if (exp_negative) exp = frac_exp - exp; + else exp = frac_exp + exp; + + /* + * Generate a floating-point number that represents the exponent. + * Do this by processing the exponent one bit at a time to combine + * many powers of 2 of 10. Then combine the exponent with the + * fraction. + */ + if (exp < 0) + { + exp_negative = 1; + exp = -exp; + } + else exp_negative = 0; + + if (exp > MAX_EXPONENT) exp = MAX_EXPONENT; + + dbl_exp = 1.0; + + for (d = powers_of_10; exp != 0; exp >>= 1, d++) + { + if (exp & 01) dbl_exp *= *d; + } + + if (exp_negative) fraction /= dbl_exp; + else fraction *= dbl_exp; + +done: + if (endptr != HAWK_NULL) *endptr = p; + return (negative)? -fraction: fraction; +} diff --git a/hawk/lib/misc-prv.h b/hawk/lib/misc-prv.h new file mode 100644 index 00000000..11531ca5 --- /dev/null +++ b/hawk/lib/misc-prv.h @@ -0,0 +1,100 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_MISC_PRV_H_ +#define _HAWK_MISC_PRV_H_ + +#if defined(__cplusplus) +extern "C" { +#endif + +hawk_ooch_t* hawk_rtx_strtok ( + hawk_rtx_t* rtx, const hawk_ooch_t* s, + const hawk_ooch_t* delim, hawk_oocs_t* tok); + +hawk_ooch_t* hawk_rtx_strxtok ( + hawk_rtx_t* rtx, const hawk_ooch_t* s, hawk_oow_t len, + const hawk_ooch_t* delim, hawk_oocs_t* tok); + +hawk_ooch_t* hawk_rtx_strntok ( + hawk_rtx_t* rtx, const hawk_ooch_t* s, + const hawk_ooch_t* delim, hawk_oow_t delim_len, hawk_oocs_t* tok); + +hawk_ooch_t* hawk_rtx_strxntok ( + hawk_rtx_t* rtx, const hawk_ooch_t* s, hawk_oow_t len, + const hawk_ooch_t* delim, hawk_oow_t delim_len, hawk_oocs_t* tok); + +hawk_ooch_t* hawk_rtx_strxntokbyrex ( + hawk_rtx_t* rtx, + const hawk_ooch_t* str, + hawk_oow_t len, + const hawk_ooch_t* substr, + hawk_oow_t sublen, + void* rex, + hawk_oocs_t* tok, + hawk_errnum_t* errnum +); + +hawk_ooch_t* hawk_rtx_strxnfld ( + hawk_rtx_t* rtx, + hawk_ooch_t* str, + hawk_oow_t len, + hawk_ooch_t fs, + hawk_ooch_t lq, + hawk_ooch_t rq, + hawk_ooch_t ec, + hawk_oocs_t* tok +); + +int hawk_buildrex ( + hawk_t* awk, + const hawk_ooch_t* ptn, + hawk_oow_t len, + hawk_errnum_t* errnum, + void** code, + void** icode +); + +int hawk_matchrex ( + hawk_t* awk, void* code, int icase, + const hawk_oocs_t* str, const hawk_oocs_t* substr, + hawk_oocs_t* match, hawk_oocs_t submat[9], hawk_errnum_t* errnum +); + +void hawk_freerex (hawk_t* awk, void* code, void* icode); + +int hawk_rtx_matchrex ( + hawk_rtx_t* rtx, hawk_val_t* val, + const hawk_oocs_t* str, const hawk_oocs_t* substr, + hawk_oocs_t* match, hawk_oocs_t submat[9] +); + +#if defined(__cplusplus) +} +#endif + +#endif + diff --git a/hawk/lib/misc.c b/hawk/lib/misc.c new file mode 100644 index 00000000..78506f9c --- /dev/null +++ b/hawk/lib/misc.c @@ -0,0 +1,779 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "hawk-prv.h" + +/*#define USE_REX */ + +#if defined(USE_REX) +# include +#else +# include +#endif + +/* ========================================================================= */ +#undef awk_strxtoint +#undef awk_strtoflt +#undef awk_strxtoflt +#undef char_t +#undef cint_t +#undef AWK_IS_SPACE +#undef AWK_IS_DIGIT +#undef _T + +#define awk_strxtoint hawk_bcharstoint +#define awk_strtoflt hawk_mbstoflt +#define awk_strxtoflt hawk_bcharstoflt +#define char_t hawk_bch_t +#define cint_t hawk_bci_t +#define AWK_IS_SPACE hawk_is_bch_space +#define AWK_IS_DIGIT hawk_is_bch_digit +#define _T HAWK_BT +#include "misc-imp.h" + +/* ------------------------------------------------------------------------- */ +#undef awk_strxtoint +#undef awk_strtoflt +#undef awk_strxtoflt +#undef char_t +#undef cint_t +#undef AWK_IS_SPACE +#undef AWK_IS_DIGIT +#undef _T +/* ------------------------------------------------------------------------- */ + +#define awk_strxtoint hawk_ucharstoint +#define awk_strtoflt hawk_wcstoflt +#define awk_strxtoflt hawk_ucharstoflt +#define char_t hawk_uch_t +#define cint_t hawk_uci_t +#define AWK_IS_SPACE hawk_is_uch_space +#define AWK_IS_DIGIT hawk_is_uch_digit +#define _T HAWK_UT +#include "misc-imp.h" + +#undef awk_strxtoint +#undef awk_strtoflt +#undef awk_strxtoflt +#undef char_t +#undef cint_t +#undef AWK_ISSPACE +#undef AWK_ISDIGIT +#undef _T +/* ========================================================================= */ + + +hawk_ooch_t* hawk_rtx_strtok ( + hawk_rtx_t* rtx, const hawk_ooch_t* s, + const hawk_ooch_t* delim, hawk_oocs_t* tok) +{ + return hawk_rtx_strxntok(rtx, s, hawk_count_oocstr(s), delim, hawk_count_oocstr(delim), tok); +} + +hawk_ooch_t* hawk_rtx_strxtok ( + hawk_rtx_t* rtx, const hawk_ooch_t* s, hawk_oow_t len, + const hawk_ooch_t* delim, hawk_oocs_t* tok) +{ + return hawk_rtx_strxntok(rtx, s, len, delim, hawk_count_oocstr(delim), tok); +} + +hawk_ooch_t* hawk_rtx_strntok ( + hawk_rtx_t* rtx, const hawk_ooch_t* s, + const hawk_ooch_t* delim, hawk_oow_t delim_len, + hawk_oocs_t* tok) +{ + return hawk_rtx_strxntok(rtx, s, hawk_count_oocstr(s), delim, delim_len, tok); +} + +hawk_ooch_t* hawk_rtx_strxntok ( + hawk_rtx_t* rtx, const hawk_ooch_t* s, hawk_oow_t len, + const hawk_ooch_t* delim, hawk_oow_t delim_len, hawk_oocs_t* tok) +{ + const hawk_ooch_t* p = s, *d; + const hawk_ooch_t* end = s + len; + const hawk_ooch_t* sp = HAWK_NULL, * ep = HAWK_NULL; + const hawk_ooch_t* delim_end = delim + delim_len; + hawk_ooch_t c; + int delim_mode; + +#define __DELIM_NULL 0 +#define __DELIM_EMPTY 1 +#define __DELIM_SPACES 2 +#define __DELIM_NOSPACES 3 +#define __DELIM_COMPOSITE 4 + if (delim == HAWK_NULL) delim_mode = __DELIM_NULL; + else + { + delim_mode = __DELIM_EMPTY; + + for (d = delim; d < delim_end; d++) + { + if (hawk_is_ooch_space(*d)) + { + if (delim_mode == __DELIM_EMPTY) + delim_mode = __DELIM_SPACES; + else if (delim_mode == __DELIM_NOSPACES) + { + delim_mode = __DELIM_COMPOSITE; + break; + } + } + else + { + if (delim_mode == __DELIM_EMPTY) + delim_mode = __DELIM_NOSPACES; + else if (delim_mode == __DELIM_SPACES) + { + delim_mode = __DELIM_COMPOSITE; + break; + } + } + } + + /* TODO: verify the following statement... */ + if (delim_mode == __DELIM_SPACES && + delim_len == 1 && + delim[0] != HAWK_T(' ')) delim_mode = __DELIM_NOSPACES; + } + + if (delim_mode == __DELIM_NULL) + { + /* when HAWK_NULL is given as "delim", it trims off the + * leading and trailing spaces characters off the source + * string "s" eventually. */ + + while (p < end && hawk_is_ooch_space(*p)) p++; + while (p < end) + { + c = *p; + + if (!hawk_is_ooch_space(c)) + { + if (sp == HAWK_NULL) sp = p; + ep = p; + } + p++; + } + } + else if (delim_mode == __DELIM_EMPTY) + { + /* each character in the source string "s" becomes a token. */ + if (p < end) + { + c = *p; + sp = p; + ep = p++; + } + } + else if (delim_mode == __DELIM_SPACES) + { + /* each token is delimited by space characters. all leading + * and trailing spaces are removed. */ + + while (p < end && hawk_is_ooch_space(*p)) p++; + while (p < end) + { + c = *p; + if (hawk_is_ooch_space(c)) break; + if (sp == HAWK_NULL) sp = p; + ep = p++; + } + while (p < end && hawk_is_ooch_space(*p)) p++; + } + else if (delim_mode == __DELIM_NOSPACES) + { + /* each token is delimited by one of charaters + * in the delimeter set "delim". */ + if (rtx->gbl.ignorecase) + { + while (p < end) + { + c = hawk_to_ooch_upper(*p); + for (d = delim; d < delim_end; d++) + { + if (c == hawk_to_ooch_upper(*d)) goto exit_loop; + } + + if (sp == HAWK_NULL) sp = p; + ep = p++; + } + } + else + { + while (p < end) + { + c = *p; + for (d = delim; d < delim_end; d++) + { + if (c == *d) goto exit_loop; + } + + if (sp == HAWK_NULL) sp = p; + ep = p++; + } + } + } + else /* if (delim_mode == __DELIM_COMPOSITE) */ + { + /* each token is delimited by one of non-space charaters + * in the delimeter set "delim". however, all space characters + * surrounding the token are removed */ + while (p < end && hawk_is_ooch_space(*p)) p++; + if (rtx->gbl.ignorecase) + { + while (p < end) + { + c = hawk_to_ooch_upper(*p); + if (hawk_is_ooch_space(c)) + { + p++; + continue; + } + for (d = delim; d < delim_end; d++) + { + if (c == hawk_to_ooch_upper(*d)) + goto exit_loop; + } + if (sp == HAWK_NULL) sp = p; + ep = p++; + } + } + else + { + while (p < end) + { + c = *p; + if (hawk_is_ooch_space(c)) + { + p++; + continue; + } + for (d = delim; d < delim_end; d++) + { + if (c == *d) goto exit_loop; + } + if (sp == HAWK_NULL) sp = p; + ep = p++; + } + } + } + +exit_loop: + if (sp == HAWK_NULL) + { + tok->ptr = HAWK_NULL; + tok->len = (hawk_oow_t)0; + } + else + { + tok->ptr = (hawk_ooch_t*)sp; + tok->len = ep - sp + 1; + } + + /* if HAWK_NULL is returned, this function should not be called again */ + if (p >= end) return HAWK_NULL; + if (delim_mode == __DELIM_EMPTY || + delim_mode == __DELIM_SPACES) return (hawk_ooch_t*)p; + return (hawk_ooch_t*)++p; +} + +hawk_ooch_t* hawk_rtx_strxntokbyrex ( + hawk_rtx_t* rtx, + const hawk_ooch_t* str, hawk_oow_t len, + const hawk_ooch_t* substr, hawk_oow_t sublen, + void* rex, hawk_oocs_t* tok, + hawk_errnum_t* errnum) +{ + int n; + hawk_oow_t i; + hawk_oocs_t match, s, cursub, realsub; + + s.ptr = (hawk_ooch_t*)str; + s.len = len; + + cursub.ptr = (hawk_ooch_t*)substr; + cursub.len = sublen; + + realsub.ptr = (hawk_ooch_t*)substr; + realsub.len = sublen; + + while (cursub.len > 0) + { + n = hawk_matchrex ( + rtx->awk, rex, rtx->gbl.ignorecase, + &s, &cursub, &match, HAWK_NULL, errnum); + if (n == -1) return HAWK_NULL; + if (n == 0) + { + /* no match has been found. + * return the entire string as a token */ + tok->ptr = realsub.ptr; + tok->len = realsub.len; + *errnum = HAWK_ENOERR; + return HAWK_NULL; + } + + HAWK_ASSERT (hawk_rtx_getawk(rtx), n == 1); + + if (match.len == 0) + { + /* the match length is zero. */ + cursub.ptr++; + cursub.len--; + } + else if (rtx->gbl.striprecspc > 0 || (rtx->gbl.striprecspc < 0 && (rtx->awk->opt.trait & HAWK_STRIPRECSPC))) + { + /* match at the beginning of the input string */ + if (match.ptr == substr) + { + for (i = 0; i < match.len; i++) + { + if (!hawk_is_ooch_space(match.ptr[i])) goto exit_loop; + } + + /* the match that is all spaces at the + * beginning of the input string is skipped */ + cursub.ptr += match.len; + cursub.len -= match.len; + + /* adjust the substring by skipping the leading + * spaces and retry matching */ + realsub.ptr = (hawk_ooch_t*)substr + match.len; + realsub.len -= match.len; + } + else break; + } + else break; + } + +exit_loop: + if (cursub.len <= 0) + { + tok->ptr = realsub.ptr; + tok->len = realsub.len; + *errnum = HAWK_ENOERR; + return HAWK_NULL; + } + + tok->ptr = realsub.ptr; + tok->len = match.ptr - realsub.ptr; + + for (i = 0; i < match.len; i++) + { + if (!hawk_is_ooch_space(match.ptr[i])) + { + /* the match contains a non-space character. */ + *errnum = HAWK_ENOERR; + return (hawk_ooch_t*)match.ptr+match.len; + } + } + + /* the match is all spaces */ + *errnum = HAWK_ENOERR; + if (rtx->gbl.striprecspc > 0 || (rtx->gbl.striprecspc < 0 && (rtx->awk->opt.trait & HAWK_STRIPRECSPC))) + { + /* if the match reached the last character in the input string, + * it returns HAWK_NULL to terminate tokenization. */ + return (match.ptr+match.len >= substr+sublen)? + HAWK_NULL: ((hawk_ooch_t*)match.ptr+match.len); + } + else + { + /* if the match went beyond the the last character in the input + * string, it returns HAWK_NULL to terminate tokenization. */ + return (match.ptr+match.len > substr+sublen)? + HAWK_NULL: ((hawk_ooch_t*)match.ptr+match.len); + } +} + +hawk_ooch_t* hawk_rtx_strxnfld ( + hawk_rtx_t* rtx, hawk_ooch_t* str, hawk_oow_t len, + hawk_ooch_t fs, hawk_ooch_t ec, hawk_ooch_t lq, hawk_ooch_t rq, + hawk_oocs_t* tok) +{ + hawk_ooch_t* p = str; + hawk_ooch_t* end = str + len; + int escaped = 0, quoted = 0; + hawk_ooch_t* ts; /* token start */ + hawk_ooch_t* tp; /* points to one char past the last token char */ + hawk_ooch_t* xp; /* points to one char past the last effective char */ + + /* skip leading spaces */ + while (p < end && hawk_is_ooch_space(*p)) p++; + + /* initialize token pointers */ + ts = tp = xp = p; + + while (p < end) + { + char c = *p; + + if (escaped) + { + *tp++ = c; xp = tp; p++; + escaped = 0; + } + else + { + if (c == ec) + { + escaped = 1; + p++; + } + else if (quoted) + { + if (c == rq) + { + quoted = 0; + p++; + } + else + { + *tp++ = c; xp = tp; p++; + } + } + else + { + if (c == fs) + { + tok->ptr = ts; + tok->len = xp - ts; + p++; + + if (hawk_is_ooch_space(fs)) + { + while (p < end && *p == fs) p++; + if (p >= end) return HAWK_NULL; + } + + return p; + } + + if (c == lq) + { + quoted = 1; + p++; + } + else + { + *tp++ = c; p++; + if (!hawk_is_ooch_space(c)) xp = tp; + } + } + } + } + + if (escaped) + { + /* if it is still escaped, the last character must be + * the escaper itself. treat it as a normal character */ + *xp++ = ec; + } + + tok->ptr = ts; + tok->len = xp - ts; + return HAWK_NULL; +} + +#if defined(USE_REX) +static HAWK_INLINE int rexerr_to_errnum (int err) +{ + switch (err) + { + case HAWK_REX_ENOERR: return HAWK_ENOERR; + case HAWK_REX_ENOMEM: return HAWK_ENOMEM; + case HAWK_REX_ENOCOMP: return HAWK_EREXBL; + case HAWK_REX_ERECUR: return HAWK_EREXRECUR; + case HAWK_REX_ERPAREN: return HAWK_EREXRPAREN; + case HAWK_REX_ERBRACK: return HAWK_EREXRBRACK; + case HAWK_REX_ERBRACE: return HAWK_EREXRBRACE; + case HAWK_REX_ECOLON: return HAWK_EREXCOLON; + case HAWK_REX_ECRANGE: return HAWK_EREXCRANGE; + case HAWK_REX_ECCLASS: return HAWK_EREXCCLASS; + case HAWK_REX_EBOUND: return HAWK_EREXBOUND; + case HAWK_REX_ESPCAWP: return HAWK_EREXSPCAWP; + case HAWK_REX_EPREEND: return HAWK_EREXPREEND; + default: return HAWK_EINTERN; + } +} +#endif + +int hawk_buildrex ( + hawk_t* awk, const hawk_ooch_t* ptn, hawk_oow_t len, + hawk_errnum_t* errnum, void** code, void** icode) +{ +#if defined(USE_REX) + hawk_rex_errnum_t err; + void* p; + + if (code || icode) + { + p = hawk_buildrex ( + hawk_getmmgr(awk), awk->opt.depth.s.rex_build, + ((awk->opt.trait & HAWK_REXBOUND)? 0: HAWK_REX_NOBOUND), + ptn, len, &err + ); + if (p == HAWK_NULL) + { + *errnum = rexerr_to_errnum(err); + return -1; + } + + if (code) *code = p; + if (icode) *icode = p; + } + + return 0; +#else + hawk_tre_t* tre = HAWK_NULL; + hawk_tre_t* itre = HAWK_NULL; + int opt = HAWK_TRE_EXTENDED; + + if (code) + { + tre = hawk_tre_open(awk, 0); + if (tre == HAWK_NULL) + { + *errnum = HAWK_ENOMEM; + return -1; + } + + if (!(awk->opt.trait & HAWK_REXBOUND)) opt |= HAWK_TRE_NOBOUND; + + if (hawk_tre_compx (tre, ptn, len, HAWK_NULL, opt) <= -1) + { +#if 0 /* TODO */ + + if (HAWK_TRE_ERRNUM(tre) == HAWK_TRE_ENOMEM) *errnum = HAWK_ENOMEM; + else + SETERR1 (awk, HAWK_EREXBL, str->ptr, str->len, loc); +#endif + *errnum = (HAWK_TRE_ERRNUM(tre) == HAWK_TRE_ENOMEM)? + HAWK_ENOMEM: HAWK_EREXBL; + hawk_tre_close (tre); + return -1; + } + } + + if (icode) + { + itre = hawk_tre_open(awk, 0); + if (itre == HAWK_NULL) + { + if (tre) hawk_tre_close (tre); + *errnum = HAWK_ENOMEM; + return -1; + } + + /* ignorecase is a compile option for TRE */ + if (hawk_tre_compx (itre, ptn, len, HAWK_NULL, opt | HAWK_TRE_IGNORECASE) <= -1) + { +#if 0 /* TODO */ + + if (HAWK_TRE_ERRNUM(tre) == HAWK_TRE_ENOMEM) *errnum = HAWK_ENOMEM; + else + SETERR1 (awk, HAWK_EREXBL, str->ptr, str->len, loc); +#endif + *errnum = (HAWK_TRE_ERRNUM(tre) == HAWK_TRE_ENOMEM)? + HAWK_ENOMEM: HAWK_EREXBL; + hawk_tre_close (itre); + if (tre) hawk_tre_close (tre); + return -1; + } + } + + if (code) *code = tre; + if (icode) *icode = itre; + return 0; +#endif +} + +#if !defined(USE_REX) +static int matchtre ( + hawk_t* awk, hawk_tre_t* tre, int opt, + const hawk_oocs_t* str, hawk_oocs_t* mat, + hawk_oocs_t submat[9], hawk_errnum_t* errnum) +{ + int n; + /*hawk_tre_match_t match[10] = { { 0, 0 }, };*/ + hawk_tre_match_t match[10]; + + HAWK_MEMSET (match, 0, HAWK_SIZEOF(match)); + n = hawk_tre_execx(tre, str->ptr, str->len, match, HAWK_COUNTOF(match), opt); + if (n <= -1) + { + if (HAWK_TRE_ERRNUM(tre) == HAWK_TRE_ENOMATCH) return 0; + +#if 0 /* TODO: */ + *errnum = (HAWK_TRE_ERRNUM(tre) == HAWK_TRE_ENOMEM)? + HAWK_ENOMEM: HAWK_EREXMA; + SETERR0 (sed, errnum, loc); +#endif + *errnum = (HAWK_TRE_ERRNUM(tre) == HAWK_TRE_ENOMEM)? + HAWK_ENOMEM: HAWK_EREXMA; + return -1; + } + + HAWK_ASSERT (awk, match[0].rm_so != -1); + if (mat) + { + mat->ptr = &str->ptr[match[0].rm_so]; + mat->len = match[0].rm_eo - match[0].rm_so; + } + + if (submat) + { + int i; + + /* you must intialize submat before you pass into this + * function because it can abort filling */ + for (i = 1; i < HAWK_COUNTOF(match); i++) + { + if (match[i].rm_so != -1) + { + submat[i-1].ptr = &str->ptr[match[i].rm_so]; + submat[i-1].len = match[i].rm_eo - match[i].rm_so; + } + } + } + return 1; +} +#endif + +int hawk_matchrex ( + hawk_t* awk, void* code, int icase, + const hawk_oocs_t* str, const hawk_oocs_t* substr, + hawk_oocs_t* match, hawk_oocs_t submat[9], hawk_errnum_t* errnum) +{ +#if defined(USE_REX) + int x; + hawk_rex_errnum_t err; + + /* submatch is not supported */ + x = hawk_matchrex ( + hawk_getmmgr(awk), awk->opt.depth.s.rex_match, code, + (icase? HAWK_REX_IGNORECASE: 0), str, substr, match, &err); + if (x <= -1) *errnum = rexerr_to_errnum(err); + return x; +#else + int x; + int opt = HAWK_TRE_BACKTRACKING; /* TODO: option... HAWK_TRE_BACKTRACKING ??? */ + + x = matchtre ( + awk, code, + ((str->ptr == substr->ptr)? opt: (opt | HAWK_TRE_NOTBOL)), + substr, match, submat, errnum + ); + return x; +#endif +} + +void hawk_freerex (hawk_t* awk, void* code, void* icode) +{ + if (code) + { +#if defined(USE_REX) + hawk_freerex ((awk)->mmgr, code); +#else + hawk_tre_close (code); +#endif + } + + if (icode && icode != code) + { +#if defined(USE_REX) + hawk_freerex ((awk)->mmgr, icode); +#else + hawk_tre_close (icode); +#endif + } +} + +int hawk_rtx_matchrex ( + hawk_rtx_t* rtx, hawk_val_t* val, + const hawk_oocs_t* str, const hawk_oocs_t* substr, hawk_oocs_t* match, hawk_oocs_t submat[9]) +{ + void* code; + int icase, x; + hawk_errnum_t awkerr; +#if defined(USE_REX) + hawk_rex_errnum_t rexerr; +#endif + + icase = rtx->gbl.ignorecase; + + if (HAWK_RTX_GETVALTYPE (rtx, val) == HAWK_VAL_REX) + { + code = ((hawk_val_rex_t*)val)->code[icase]; + } + else + { + /* convert to a string and build a regular expression */ + hawk_oocs_t tmp; + + tmp.ptr = hawk_rtx_getvaloocstr (rtx, val, &tmp.len); + if (tmp.ptr == HAWK_NULL) return -1; + + x = icase? hawk_buildrex(rtx->awk, tmp.ptr, tmp.len, &awkerr, HAWK_NULL, &code): + hawk_buildrex(rtx->awk, tmp.ptr, tmp.len, &awkerr, &code, HAWK_NULL); + hawk_rtx_freevaloocstr (rtx, val, tmp.ptr); + if (x <= -1) + { + hawk_rtx_seterrnum (rtx, awkerr, HAWK_NULL); + return -1; + } + } + +#if defined(USE_REX) + /* submatch not supported */ + x = hawk_matchrex ( + hawk_rtx_getmmgr(rtx), rtx->awk->opt.depth.s.rex_match, + code, (icase? HAWK_REX_IGNORECASE: 0), + str, substr, match, &rexerr); + if (x <= -1) hawk_rtx_seterrnum (rtx, rexerr_to_errnum(rexerr), HAWK_NULL); +#else + x = matchtre ( + rtx->awk, code, + ((str->ptr == substr->ptr)? HAWK_TRE_BACKTRACKING: (HAWK_TRE_BACKTRACKING | HAWK_TRE_NOTBOL)), + substr, match, submat, &awkerr + ); + if (x <= -1) hawk_rtx_seterrnum (rtx, awkerr, HAWK_NULL); +#endif + + if (HAWK_RTX_GETVALTYPE(rtx, val) == HAWK_VAL_REX) + { + /* nothing to free */ + } + else + { + if (icase) + hawk_freerex (rtx->awk, HAWK_NULL, code); + else + hawk_freerex (rtx->awk, code, HAWK_NULL); + } + + return x; +} diff --git a/hawk/lib/mod-dir.c b/hawk/lib/mod-dir.c new file mode 100644 index 00000000..cceaadcf --- /dev/null +++ b/hawk/lib/mod-dir.c @@ -0,0 +1,566 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +/* +BEGIN { + x = dir::open ("/etc", dir::SORT); # dir::open ("/etc", 0) + if (x <= -1) { + print "cannot open"; + return -1; + } + + while (dir::read(x, q) > 0) { + print q; + } + dir::close (x); +} +*/ + +#include "mod-dir.h" +#include "hawk-prv.h" + +enum +{ + DIR_ENOERR, + DIR_EOTHER, + DIR_ESYSERR, + DIR_ENOMEM, + DIR_EINVAL, + DIR_EACCES, + DIR_EPERM, + DIR_ENOENT, + DIR_EMAPTOSCALAR +}; + +static int dir_err_to_errnum (qse_dir_errnum_t num) +{ + switch (num) + { + case HAWK_DIR_ESYSERR: + return DIR_ESYSERR; + case HAWK_DIR_ENOMEM: + return DIR_ENOMEM; + case HAWK_DIR_EINVAL: + return DIR_EINVAL; + case HAWK_DIR_EACCES: + return DIR_EACCES; + case HAWK_DIR_EPERM: + return DIR_EPERM; + case HAWK_DIR_ENOENT: + return DIR_ENOENT; + default: + return DIR_EOTHER; + } +} + +static int awk_err_to_errnum (hawk_errnum_t num) +{ + switch (num) + { + case HAWK_ESYSERR: + return DIR_ESYSERR; + case HAWK_ENOMEM: + return DIR_ENOMEM; + case HAWK_EINVAL: + return DIR_EINVAL; + case HAWK_EACCES: + return DIR_EACCES; + case HAWK_EPERM: + return DIR_EPERM; + case HAWK_ENOENT: + return DIR_ENOENT; + case HAWK_EMAPTOSCALAR: + return DIR_EMAPTOSCALAR; + default: + return DIR_EOTHER; + } +} + +#define __IMAP_NODE_T_DATA qse_dir_t* ctx; +#define __IMAP_LIST_T_DATA int errnum; +#define __IMAP_LIST_T dir_list_t +#define __IMAP_NODE_T dir_node_t +#define __MAKE_IMAP_NODE __new_dir_node +#define __FREE_IMAP_NODE __free_dir_node +#include "imap-imp.h" + +static dir_node_t* new_dir_node (hawk_rtx_t* rtx, dir_list_t* list, const hawk_ooch_t* path, hawk_int_t flags) +{ + dir_node_t* node; + qse_dir_errnum_t oe; + + node = __new_dir_node(rtx, list); + if (!node) + { + list->errnum = DIR_ENOMEM; + return HAWK_NULL; + } + + node->ctx = qse_dir_open(hawk_rtx_getmmgr(rtx), 0, path, flags, &oe); + if (!node->ctx) + { + list->errnum = dir_err_to_errnum(oe); + __free_dir_node (rtx, list, node); + return HAWK_NULL; + } + + return node; +} + +static void free_dir_node (hawk_rtx_t* rtx, dir_list_t* list, dir_node_t* node) +{ + if (node->ctx) + { + qse_dir_close(node->ctx); + node->ctx = HAWK_NULL; + } + __free_dir_node (rtx, list, node); +} +/* ------------------------------------------------------------------------ */ + +static int close_byid (hawk_rtx_t* rtx, dir_list_t* list, hawk_int_t id) +{ + if (id >= 0 && id < list->map.high && list->map.tab[id]) + { + free_dir_node (rtx, list, list->map.tab[id]); + return 0; + } + else + { + list->errnum = DIR_EINVAL; + return -1; + } +} + +static int reset_byid (hawk_rtx_t* rtx, dir_list_t* list, hawk_int_t id, const hawk_ooch_t* path) +{ + if (id >= 0 && id < list->map.high && list->map.tab[id]) + { + if (qse_dir_reset(list->map.tab[id]->ctx, path) <= -1) + { + list->errnum = dir_err_to_errnum (qse_dir_geterrnum (list->map.tab[id]->ctx)); + return -1; + } + return 0; + } + else + { + list->errnum = DIR_EINVAL; + return -1; + } +} + +static int read_byid (hawk_rtx_t* rtx, dir_list_t* list, hawk_int_t id, hawk_val_ref_t* ref) +{ + if (id >= 0 && id < list->map.high && list->map.tab[id]) + { + int y; + qse_dir_ent_t ent; + hawk_val_t* tmp; + + y = qse_dir_read(list->map.tab[id]->ctx, &ent); + if (y <= -1) + { + list->errnum = dir_err_to_errnum(qse_dir_geterrnum (list->map.tab[id]->ctx)); + return -1; + } + + if (y == 0) return 0; /* no more entry */ + + tmp = hawk_rtx_makestrvalwithoocstr(rtx, ent.name); + if (!tmp) + { + list->errnum = awk_err_to_errnum(hawk_rtx_geterrnum (rtx)); + return -1; + } + else + { + int n; + hawk_rtx_refupval (rtx, tmp); + n = hawk_rtx_setrefval (rtx, ref, tmp); + hawk_rtx_refdownval (rtx, tmp); + if (n <= -1) return -9999; + } + + return 1; /* has entry */ + } + else + { + list->errnum = DIR_EINVAL; + return -1; + } +} + +/* ------------------------------------------------------------------------ */ + +static HAWK_INLINE dir_list_t* rtx_to_list (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_rbt_pair_t* pair; + pair = hawk_rbt_search((hawk_rbt_t*)fi->mod->ctx, &rtx, HAWK_SIZEOF(rtx)); + HAWK_ASSERT (hawk_rtx_getawk(rtx), pair != HAWK_NULL); + return (dir_list_t*)HAWK_RBT_VPTR(pair); +} + +static int fnc_dir_errno (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + dir_list_t* list; + hawk_val_t* retv; + + list = rtx_to_list(rtx, fi); + + retv = hawk_rtx_makeintval (rtx, list->errnum); + if (retv == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static hawk_ooch_t* errmsg[] = +{ + HAWK_T("no error"), + HAWK_T("other error"), + HAWK_T("system error"), + HAWK_T("insufficient memory"), + HAWK_T("invalid data"), + HAWK_T("access denied"), + HAWK_T("operation not permitted"), + HAWK_T("no entry"), + HAWK_T("cannot change a map to a scalar"), + HAWK_T("unknown error") +}; + +static int fnc_dir_errstr (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + dir_list_t* list; + hawk_val_t* retv; + hawk_int_t errnum; + + list = rtx_to_list(rtx, fi); + + if (hawk_rtx_getnargs(rtx) <= 0 || + hawk_rtx_valtoint(rtx, hawk_rtx_getarg (rtx, 0), &errnum) <= -1) + { + errnum = list->errnum; + } + + if (errnum < 0 || errnum >= HAWK_COUNTOF(errmsg)) errnum = HAWK_COUNTOF(errmsg) - 1; + + retv = hawk_rtx_makestrvalwithoocstr(rtx, errmsg[errnum]); + if (retv == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_dir_open (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + dir_list_t* list; + dir_node_t* node = HAWK_NULL; + hawk_int_t ret; + hawk_ooch_t* path; + hawk_val_t* retv; + hawk_val_t* a0; + hawk_int_t flags = 0; + + list = rtx_to_list(rtx, fi); + + a0 = hawk_rtx_getarg(rtx, 0); + path = hawk_rtx_getvaloocstr(rtx, a0, HAWK_NULL); + if (path) + { + if (hawk_rtx_getnargs(rtx) >= 2 && + hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 1), &flags) <= -1) + { + hawk_rtx_freevaloocstr (rtx, a0, path); + goto oops; + } + + node = new_dir_node(rtx, list, path, flags); + if (node) ret = node->id; + else ret = -1; + hawk_rtx_freevaloocstr (rtx, a0, path); + } + else + { + oops: + list->errnum = awk_err_to_errnum(hawk_rtx_geterrnum(rtx)); + ret = -1; + } + + /* ret may not be a statically managed number. + * error checking is required */ + retv = hawk_rtx_makeintval(rtx, ret); + if (retv == HAWK_NULL) + { + if (node) free_dir_node (rtx, list, node); + return -1; + } + + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_dir_close (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + dir_list_t* list; + hawk_int_t id; + int ret; + + list = rtx_to_list(rtx, fi); + + ret = hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 0), &id); + if (ret <= -1) + { + list->errnum = awk_err_to_errnum(hawk_rtx_geterrnum(rtx)); + ret = -1; + } + else + { + ret = close_byid(rtx, list, id); + } + + hawk_rtx_setretval (rtx, hawk_rtx_makeintval(rtx, ret)); + return 0; +} + +static int fnc_dir_reset (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + dir_list_t* list; + hawk_int_t id; + int ret; + hawk_ooch_t* path; + + list = rtx_to_list(rtx, fi); + + ret = hawk_rtx_valtoint (rtx, hawk_rtx_getarg (rtx, 0), &id); + if (ret <= -1) + { + list->errnum = awk_err_to_errnum (hawk_rtx_geterrnum (rtx)); + } + else + { + hawk_val_t* a1; + + a1 = hawk_rtx_getarg (rtx, 1); + path = hawk_rtx_getvaloocstr (rtx, a1, HAWK_NULL); + if (path) + { + ret = reset_byid (rtx, list, id, path); + hawk_rtx_freevaloocstr (rtx, a1, path); + } + else + { + list->errnum = awk_err_to_errnum (hawk_rtx_geterrnum (rtx)); + ret = -1; + } + } + + /* no error check for hawk_rtx_makeintval() here since ret + * is 0 or -1. it will never fail for those numbers */ + hawk_rtx_setretval (rtx, hawk_rtx_makeintval (rtx, ret)); + return 0; +} + +static int fnc_dir_read (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + dir_list_t* list; + hawk_int_t id; + int ret; + + list = rtx_to_list(rtx, fi); + + ret = hawk_rtx_valtoint(rtx, hawk_rtx_getarg (rtx, 0), &id); + if (ret <= -1) + { + list->errnum = awk_err_to_errnum(hawk_rtx_geterrnum (rtx)); + } + else + { + ret = read_byid(rtx, list, id, (hawk_val_ref_t*)hawk_rtx_getarg(rtx, 1)); + if (ret == -9999) return -1; + } + + /* no error check for hawk_rtx_makeintval() here since ret + * is 0, 1, -1. it will never fail for those numbers */ + hawk_rtx_setretval (rtx, hawk_rtx_makeintval(rtx, ret)); + return 0; +} + +/* ------------------------------------------------------------------------ */ + +typedef struct fnctab_t fnctab_t; +struct fnctab_t +{ + const hawk_ooch_t* name; + hawk_mod_sym_fnc_t info; +}; + +typedef struct inttab_t inttab_t; +struct inttab_t +{ + const hawk_ooch_t* name; + hawk_mod_sym_int_t info; +}; + + +static fnctab_t fnctab[] = +{ + { HAWK_T("close"), { { 1, 1, HAWK_NULL }, fnc_dir_close, 0 } }, + { HAWK_T("errno"), { { 0, 0, HAWK_NULL }, fnc_dir_errno, 0 } }, + { HAWK_T("errstr"), { { 0, 1, HAWK_NULL }, fnc_dir_errstr, 0 } }, + { HAWK_T("open"), { { 1, 2, HAWK_NULL }, fnc_dir_open, 0 } }, + { HAWK_T("read"), { { 2, 2, HAWK_T("vr") }, fnc_dir_read, 0 } }, + { HAWK_T("reset"), { { 2, 2, HAWK_NULL }, fnc_dir_reset, 0 } }, +}; + +static inttab_t inttab[] = +{ + /* keep this table sorted for binary search in query(). */ + { HAWK_T("SORT"), { HAWK_DIR_SORT } } +}; + +/* ------------------------------------------------------------------------ */ + +static int query (hawk_mod_t* mod, hawk_t* awk, const hawk_ooch_t* name, hawk_mod_sym_t* sym) +{ + hawk_oocs_t ea; + int left, right, mid, n; + + left = 0; right = HAWK_COUNTOF(fnctab) - 1; + + while (left <= right) + { + mid = left + (right - left) / 2; + + n = qse_strcmp (fnctab[mid].name, name); + if (n > 0) right = mid - 1; + else if (n < 0) left = mid + 1; + else + { + sym->type = HAWK_MOD_FNC; + sym->u.fnc = fnctab[mid].info; + return 0; + } + } + + left = 0; right = HAWK_COUNTOF(inttab) - 1; + while (left <= right) + { + mid = left + (right - left) / 2; + + n = qse_strcmp (inttab[mid].name, name); + if (n > 0) right = mid - 1; + else if (n < 0) left = mid + 1; + else + { + sym->type = HAWK_MOD_INT; + sym->u.in = inttab[mid].info; + return 0; + } + } + + ea.ptr = (hawk_ooch_t*)name; + ea.len = hawk_count_oocstr(name); + hawk_seterror (awk, HAWK_ENOENT, &ea, HAWK_NULL); + return -1; +} + +static int init (hawk_mod_t* mod, hawk_rtx_t* rtx) +{ + hawk_rbt_t* rbt; + dir_list_t list; + + rbt = (hawk_rbt_t*)mod->ctx; + + HAWK_MEMSET (&list, 0, HAWK_SIZEOF(list)); + if (hawk_rbt_insert (rbt, &rtx, HAWK_SIZEOF(rtx), &list, HAWK_SIZEOF(list)) == HAWK_NULL) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + + return 0; +} + +static void fini (hawk_mod_t* mod, hawk_rtx_t* rtx) +{ + hawk_rbt_t* rbt; + hawk_rbt_pair_t* pair; + + rbt = (hawk_rbt_t*)mod->ctx; + + /* garbage clean-up */ + pair = hawk_rbt_search(rbt, &rtx, HAWK_SIZEOF(rtx)); + if (pair) + { + dir_list_t* list; + dir_node_t* node, * next; + + list = HAWK_RBT_VPTR(pair); + node = list->head; + while (node) + { + next = node->next; + free_dir_node (rtx, list, node); + node = next; + } + + hawk_rbt_delete (rbt, &rtx, HAWK_SIZEOF(rtx)); + } +} + +static void unload (hawk_mod_t* mod, hawk_t* awk) +{ + hawk_rbt_t* rbt; + + rbt = (hawk_rbt_t*)mod->ctx; + + HAWK_ASSERT (awk, HAWK_RBT_SIZE(rbt) == 0); + hawk_rbt_close (rbt); +} + +int hawk_mod_dir (hawk_mod_t* mod, hawk_t* awk) +{ + hawk_rbt_t* rbt; + + mod->query = query; + mod->unload = unload; + + mod->init = init; + mod->fini = fini; + + rbt = hawk_rbt_open(hawk_getmmgr(awk), 0, 1, 1); + if (rbt == HAWK_NULL) + { + hawk_seterrnum (awk, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + hawk_rbt_setstyle (rbt, hawk_get_rbt_style(HAWK_RBT_STYLE_INLINE_COPIERS)); + + mod->ctx = rbt; + return 0; +} diff --git a/hawk/lib/mod-dir.h b/hawk/lib/mod-dir.h new file mode 100644 index 00000000..27c85032 --- /dev/null +++ b/hawk/lib/mod-dir.h @@ -0,0 +1,43 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_LIB_MOD_DIR_H_ +#define _HAWK_LIB_MOD_DIR_H_ + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +HAWK_EXPORT int hawk_mod_dir (hawk_mod_t* mod, hawk_t* awk); + +#if defined(__cplusplus) +} +#endif + +#endif + diff --git a/hawk/lib/mod-math.c b/hawk/lib/mod-math.c new file mode 100644 index 00000000..293cc37d --- /dev/null +++ b/hawk/lib/mod-math.c @@ -0,0 +1,708 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "mod-math.h" +#include "hawk-prv.h" + +#include +#include +#include +#if defined(HAVE_QUADMATH_H) +# include +#elif defined(HAWK_USE_AWK_FLTMAX) && (HAWK_SIZEOF_FLT_T == 16) && defined(HAWK_FLTMAX_REQUIRE_QUADMATH) +# error QUADMATH.H NOT AVAILABLE or NOT COMPILABLE +#endif + +#if !defined(HAWK_HAVE_CONFIG_H) +# if defined(_WIN32) || defined(__OS2__) || defined(__DOS__) +# define HAVE_CEIL +# define HAVE_FLOOR +# if !defined(__WATCOMC__) && !defined(__BORLANDC__) +# define HAVE_ROUND +# endif +# define HAVE_SINH +# define HAVE_COSH +# define HAVE_TANH +# define HAVE_ASIN +# define HAVE_ACOS + +# define HAVE_SIN +# define HAVE_COS +# define HAVE_TAN +# define HAVE_ATAN +# define HAVE_ATAN2 +# define HAVE_LOG +# define HAVE_LOG10 +# define HAVE_EXP +# define HAVE_SQRT +# endif +#endif + +typedef struct modctx_t +{ + unsigned int seed; + struct random_data prand; +} modctx_t; + +static int fnc_math_1 (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi, hawk_math1_t f) +{ + hawk_oow_t nargs; + hawk_val_t* a0; + hawk_flt_t rv; + hawk_val_t* r; + int n; + + nargs = hawk_rtx_getnargs (rtx); + HAWK_ASSERT (hawk_rtx_getawk(rtx), nargs == 1); + + a0 = hawk_rtx_getarg(rtx, 0); + + n = hawk_rtx_valtoflt(rtx, a0, &rv); + if (n <= -1) return -1; + + r = hawk_rtx_makefltval (rtx, f (hawk_rtx_getawk(rtx), rv)); + if (r == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, r); + return 0; +} + +static int fnc_math_2 (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi, hawk_math2_t f) +{ + hawk_oow_t nargs; + hawk_val_t* a0, * a1; + hawk_flt_t rv0, rv1; + hawk_val_t* r; + int n; + + nargs = hawk_rtx_getnargs (rtx); + HAWK_ASSERT (hawk_rtx_getawk(rtx), nargs == 2); + + a0 = hawk_rtx_getarg(rtx, 0); + a1 = hawk_rtx_getarg(rtx, 1); + + n = hawk_rtx_valtoflt(rtx, a0, &rv0); + if (n <= -1) return -1; + + n = hawk_rtx_valtoflt (rtx, a1, &rv1); + if (n <= -1) return -1; + + r = hawk_rtx_makefltval (rtx, f (hawk_rtx_getawk(rtx), rv0, rv1)); + if (r == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, r); + return 0; +} + + +static hawk_flt_t math_ceil (hawk_t* awk, hawk_flt_t x) +{ +#if defined(HAWK_USE_AWK_FLTMAX) && defined(HAVE_CEILQ) + return ceilq (x); +#elif defined(HAVE_CEILL) && (HAWK_SIZEOF_LONG_DOUBLE > HAWK_SIZEOF_DOUBLE) + return ceill (x); +#elif defined(HAVE_CEIL) + return ceil (x); +#elif defined(HAVE_CEILF) + return ceilf (x); +#else + #error ### no ceil function available ### +#endif +} + +static hawk_flt_t math_floor (hawk_t* awk, hawk_flt_t x) +{ +#if defined(HAWK_USE_AWK_FLTMAX) && defined(HAVE_FLOORQ) + return floorq (x); +#elif defined(HAVE_FLOORL) && (HAWK_SIZEOF_LONG_DOUBLE > HAWK_SIZEOF_DOUBLE) + return floorl (x); +#elif defined(HAVE_FLOOR) + return floor (x); +#elif defined(HAVE_FLOORF) + return floorf (x); +#else + #error ### no floor function available ### +#endif +} + +static hawk_flt_t math_round (hawk_t* awk, hawk_flt_t x) +{ +#if defined(HAWK_USE_AWK_FLTMAX) && defined(HAVE_ROUNDQ) + return roundq (x); +#elif defined(HAVE_ROUNDL) && (HAWK_SIZEOF_LONG_DOUBLE > HAWK_SIZEOF_DOUBLE) + return roundl (x); +#elif defined(HAVE_ROUND) + return round (x); +#elif defined(HAVE_ROUNDF) + return roundf (x); +#else + + hawk_flt_t f, d; + + f = math_floor (awk, x); + d = x - f; /* get fraction */ + + if (d > (hawk_flt_t)0.5) + { + /* round up to the nearest */ + f = f + (hawk_flt_t)1.0; + } + else if (d == (hawk_flt_t)0.5) + { + #if 1 + /* round half away from zero */ + if (x >= 0) + { + f = x + (hawk_flt_t)0.5; + } + else + { + f = x - (hawk_flt_t)0.5; + } + #else + /* round half to even - C99's rint() does this, i guess. */ + d = f - (hawk_flt_t)2.0 * math_floor(awk, f * (hawk_flt_t)0.5); + if (d == (hawk_flt_t)1.0) f = f + (hawk_flt_t)1.0; + #endif + } + + /* this implementation doesn't keep the signbit for -0.0. + * The signbit() function defined in C99 may get used to + * preserve the sign bit. but this is a fall-back rountine + * for a system without round also defined in C99. + * don't get annoyed by the lost sign bit for the value of 0.0. + */ + + return f; + +#endif +} + +static hawk_flt_t math_sinh (hawk_t* awk, hawk_flt_t x) +{ +#if defined(HAWK_USE_AWK_FLTMAX) && defined(HAVE_SINHQ) + return sinhq (x); +#elif defined(HAVE_SINHL) && (HAWK_SIZEOF_LONG_DOUBLE > HAWK_SIZEOF_DOUBLE) + return sinhl (x); +#elif defined(HAVE_SINH) + return sinh (x); +#elif defined(HAVE_SINHF) + return sinhf (x); +#else + #error ### no sinh function available ### +#endif +} + +static hawk_flt_t math_cosh (hawk_t* awk, hawk_flt_t x) +{ +#if defined(HAWK_USE_AWK_FLTMAX) && defined(HAVE_COSHQ) + return coshq (x); +#elif defined(HAVE_COSHL) && (HAWK_SIZEOF_LONG_DOUBLE > HAWK_SIZEOF_DOUBLE) + return coshl (x); +#elif defined(HAVE_COSH) + return cosh (x); +#elif defined(HAVE_COSHF) + return coshf (x); +#else + #error ### no cosh function available ### +#endif +} + +static hawk_flt_t math_tanh (hawk_t* awk, hawk_flt_t x) +{ +#if defined(HAWK_USE_AWK_FLTMAX) && defined(HAVE_TANHQ) + return tanhq (x); +#elif defined(HAVE_TANHL) && (HAWK_SIZEOF_LONG_DOUBLE > HAWK_SIZEOF_DOUBLE) + return tanhl (x); +#elif defined(HAVE_TANH) + return tanh (x); +#elif defined(HAVE_TANHF) + return tanhf (x); +#else + #error ### no tanh function available ### +#endif +} + +static hawk_flt_t math_asin (hawk_t* awk, hawk_flt_t x) +{ +#if defined(HAWK_USE_AWK_FLTMAX) && defined(HAVE_ASINQ) + return asinq (x); +#elif defined(HAVE_ASINL) && (HAWK_SIZEOF_LONG_DOUBLE > HAWK_SIZEOF_DOUBLE) + return asinl (x); +#elif defined(HAVE_ASIN) + return asin (x); +#elif defined(HAVE_ASINF) + return asinf (x); +#else + #error ### no asin function available ### +#endif +} + +static hawk_flt_t math_acos (hawk_t* awk, hawk_flt_t x) +{ +#if defined(HAWK_USE_AWK_FLTMAX) && defined(HAVE_ACOSQ) + return acosq (x); +#elif defined(HAVE_ACOSL) && (HAWK_SIZEOF_LONG_DOUBLE > HAWK_SIZEOF_DOUBLE) + return acosl (x); +#elif defined(HAVE_ACOS) + return acos (x); +#elif defined(HAVE_ACOSF) + return acosf (x); +#else + #error ### no acos function available ### +#endif +} + +/* ----------------------------------------------------------------------- */ + + +static hawk_flt_t math_sin (hawk_t* awk, hawk_flt_t x) +{ +#if defined(HAWK_USE_AWK_FLTMAX) && defined(HAVE_SINQ) + return sinq (x); +#elif defined(HAVE_SINL) && (HAWK_SIZEOF_LONG_DOUBLE > HAWK_SIZEOF_DOUBLE) + return sinl (x); +#elif defined(HAVE_SIN) + return sin (x); +#elif defined(HAVE_SINF) + return sinf (x); +#else + #error ### no sin function available ### +#endif +} + +static hawk_flt_t math_cos (hawk_t* awk, hawk_flt_t x) +{ +#if defined(HAWK_USE_AWK_FLTMAX) && defined(HAVE_COSQ) + return cosq (x); +#elif defined(HAVE_COSL) && (HAWK_SIZEOF_LONG_DOUBLE > HAWK_SIZEOF_DOUBLE) + return cosl (x); +#elif defined(HAVE_COS) + return cos (x); +#elif defined(HAVE_COSF) + return cosf (x); +#else + #error ### no cos function available ### +#endif +} + +static hawk_flt_t math_tan (hawk_t* awk, hawk_flt_t x) +{ +#if defined(HAWK_USE_AWK_FLTMAX) && defined(HAVE_TANQ) + return tanq (x); +#elif defined(HAVE_TANL) && (HAWK_SIZEOF_LONG_DOUBLE > HAWK_SIZEOF_DOUBLE) + return tanl (x); +#elif defined(HAVE_TAN) + return tan (x); +#elif defined(HAVE_TANF) + return tanf (x); +#else + #error ### no tan function available ### +#endif +} + +static hawk_flt_t math_atan (hawk_t* awk, hawk_flt_t x) +{ +#if defined(HAWK_USE_AWK_FLTMAX) && defined(HAVE_ATANQ) + return atanq (x); +#elif defined(HAVE_ATANL) && (HAWK_SIZEOF_LONG_DOUBLE > HAWK_SIZEOF_DOUBLE) + return atanl (x); +#elif defined(HAVE_ATAN) + return atan (x); +#elif defined(HAVE_ATANF) + return atanf (x); +#else + #error ### no atan function available ### +#endif +} + +static hawk_flt_t math_atan2 (hawk_t* awk, hawk_flt_t x, hawk_flt_t y) +{ +#if defined(HAWK_USE_AWK_FLTMAX) && defined(HAVE_ATAN2Q) + return atan2q (x, y); +#elif defined(HAVE_ATAN2L) && (HAWK_SIZEOF_LONG_DOUBLE > HAWK_SIZEOF_DOUBLE) + return atan2l (x, y); +#elif defined(HAVE_ATAN2) + return atan2 (x, y); +#elif defined(HAVE_ATAN2F) + return atan2f (x, y); +#else + #error ### no atan2 function available ### +#endif +} + +static HAWK_INLINE hawk_flt_t math_log (hawk_t* awk, hawk_flt_t x) +{ +#if defined(HAWK_USE_AWK_FLTMAX) && defined(HAVE_LOGQ) + return logq (x); +#elif defined(HAVE_LOGL) && (HAWK_SIZEOF_LONG_DOUBLE > HAWK_SIZEOF_DOUBLE) + return logl (x); +#elif defined(HAVE_LOG) + return log (x); +#elif defined(HAVE_LOGF) + return logf (x); +#else + #error ### no log function available ### +#endif +} + +static hawk_flt_t math_log2 (hawk_t* awk, hawk_flt_t x) +{ +#if defined(HAWK_USE_AWK_FLTMAX) && defined(HAVE_LOG2Q) + return log2q (x); +#elif defined(HAVE_LOG2L) && (HAWK_SIZEOF_LONG_DOUBLE > HAWK_SIZEOF_DOUBLE) + return log2l (x); +#elif defined(HAVE_LOG2) + return log2 (x); +#elif defined(HAVE_LOG2F) + return log2f (x); +#else + return math_log(awk, x) / math_log(awk, 2.0); +#endif +} + +static hawk_flt_t math_log10 (hawk_t* awk, hawk_flt_t x) +{ +#if defined(HAWK_USE_AWK_FLTMAX) && defined(HAVE_LOG10Q) + return log10q (x); +#elif defined(HAVE_LOG10L) && (HAWK_SIZEOF_LONG_DOUBLE > HAWK_SIZEOF_DOUBLE) + return log10l (x); +#elif defined(HAVE_LOG10) + return log10 (x); +#elif defined(HAVE_LOG10F) + return log10f (x); +#else + #error ### no log10 function available ### +#endif +} + +static hawk_flt_t math_exp (hawk_t* awk, hawk_flt_t x) +{ +#if defined(HAWK_USE_AWK_FLTMAX) && defined(HAVE_EXPQ) + return expq (x); +#elif defined(HAVE_EXPL) && (HAWK_SIZEOF_LONG_DOUBLE > HAWK_SIZEOF_DOUBLE) + return expl (x); +#elif defined(HAVE_EXP) + return exp (x); +#elif defined(HAVE_EXPF) + return expf (x); +#else + #error ### no exp function available ### +#endif +} + +static hawk_flt_t math_sqrt (hawk_t* awk, hawk_flt_t x) +{ +#if defined(HAWK_USE_AWK_FLTMAX) && defined(HAVE_SQRTQ) + return sqrtq (x); +#elif defined(HAVE_SQRTL) && (HAWK_SIZEOF_LONG_DOUBLE > HAWK_SIZEOF_DOUBLE) + return sqrtl (x); +#elif defined(HAVE_SQRT) + return sqrt (x); +#elif defined(HAVE_SQRTF) + return sqrtf (x); +#else + #error ### no sqrt function available ### +#endif +} + +/* ----------------------------------------------------------------------- */ + +static int fnc_ceil (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return fnc_math_1 (rtx, fi, math_ceil); +} + +static int fnc_floor (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return fnc_math_1 (rtx, fi, math_floor); +} + +static int fnc_round (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return fnc_math_1 (rtx, fi, math_round); +} + +static int fnc_sinh (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return fnc_math_1 (rtx, fi, math_sinh); +} + +static int fnc_cosh (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return fnc_math_1 (rtx, fi, math_cosh); +} + +static int fnc_tanh (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return fnc_math_1 (rtx, fi, math_tanh); +} + +static int fnc_asin (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return fnc_math_1 (rtx, fi, math_asin); +} + +static int fnc_acos (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return fnc_math_1 (rtx, fi, math_acos); +} + + +/* ----------------------------------------------------------------------- */ + +static int fnc_sin (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return fnc_math_1 (rtx, fi, math_sin); +} + +static int fnc_cos (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return fnc_math_1 (rtx, fi, math_cos); +} + +static int fnc_tan (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return fnc_math_1 (rtx, fi, math_tan); +} + +static int fnc_atan (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return fnc_math_1 (rtx, fi, math_atan); +} + +static int fnc_atan2 (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return fnc_math_2 (rtx, fi, math_atan2); +} + +static int fnc_log (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return fnc_math_1 (rtx, fi, math_log); +} + +static int fnc_log2 (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return fnc_math_1 (rtx, fi, math_log2); +} + +static int fnc_log10 (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return fnc_math_1 (rtx, fi, math_log10); +} + +static int fnc_exp (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return fnc_math_1 (rtx, fi, math_exp); +} + +static int fnc_sqrt (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return fnc_math_1 (rtx, fi, math_sqrt); +} + +/* ----------------------------------------------------------------------- */ + +static int fnc_rand (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ +#define RANDV_MAX HAWK_TYPE_MAX(hawk_int_t) + hawk_val_t* r; + hawk_int32_t randv; + modctx_t* modctx; + + modctx = (modctx_t*)fi->mod->ctx; + random_r (&modctx->prand, &randv); + + r = hawk_rtx_makefltval(rtx, (hawk_flt_t)randv / RANDV_MAX); + if (r == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, r); + return 0; +#undef RANDV_MAX +} + +static int fnc_srand (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_oow_t nargs; + hawk_val_t* a0; + hawk_int_t lv; + hawk_val_t* r; + int n; + hawk_int_t prev; + modctx_t* modctx; + + modctx = (modctx_t*)fi->mod->ctx; + nargs = hawk_rtx_getnargs(rtx); + HAWK_ASSERT (hawk_rtx_getawk(rtx), nargs == 0 || nargs == 1); + + prev = modctx->seed; + + if (nargs <= 0) + { + struct timeval tv; + gettimeofday (&tv, HAWK_NULL); + modctx->seed = tv.tv_sec * tv.tv_usec; + srandom_r (modctx->seed, &modctx->prand); + } + else + { + a0 = hawk_rtx_getarg(rtx, 0); + n = hawk_rtx_valtoint(rtx, a0, &lv); + if (n <= -1) return -1; + srandom_r (lv, &modctx->prand); + } + + r = hawk_rtx_makeintval (rtx, prev); + if (r == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, r); + return 0; +} + +/* ----------------------------------------------------------------------- */ + +typedef struct fnctab_t fnctab_t; +struct fnctab_t +{ + const hawk_ooch_t* name; + hawk_mod_sym_fnc_t info; +}; + +static fnctab_t fnctab[] = +{ + /* keep this table sorted for binary search in query(). */ + { HAWK_T("acos"), { { 1, 1, HAWK_NULL }, fnc_acos, 0 } }, + { HAWK_T("asin"), { { 1, 1, HAWK_NULL }, fnc_asin, 0 } }, + { HAWK_T("atan"), { { 1, 1, HAWK_NULL }, fnc_atan, 0 } }, + { HAWK_T("atan2"), { { 2, 2, HAWK_NULL }, fnc_atan2, 0 } }, + { HAWK_T("ceil"), { { 1, 1, HAWK_NULL }, fnc_ceil, 0 } }, + { HAWK_T("cos"), { { 1, 1, HAWK_NULL }, fnc_cos, 0 } }, + { HAWK_T("cosh"), { { 1, 1, HAWK_NULL }, fnc_cosh, 0 } }, + { HAWK_T("exp"), { { 1, 1, HAWK_NULL }, fnc_exp, 0 } }, + { HAWK_T("floor"), { { 1, 1, HAWK_NULL }, fnc_floor, 0 } }, + { HAWK_T("log"), { { 1, 1, HAWK_NULL }, fnc_log, 0 } }, + { HAWK_T("log10"), { { 1, 1, HAWK_NULL }, fnc_log10, 0 } }, + { HAWK_T("log2"), { { 1, 1, HAWK_NULL }, fnc_log2, 0 } }, + { HAWK_T("rand"), { { 0, 0, HAWK_NULL }, fnc_rand, 0 } }, + { HAWK_T("round"), { { 1, 1, HAWK_NULL }, fnc_round, 0 } }, + { HAWK_T("sin"), { { 1, 1, HAWK_NULL }, fnc_sin, 0 } }, + { HAWK_T("sinh"), { { 1, 1, HAWK_NULL }, fnc_sinh, 0 } }, + { HAWK_T("sqrt"), { { 1, 1, HAWK_NULL }, fnc_sqrt, 0 } }, + { HAWK_T("srand"), { { 0, 1, HAWK_NULL }, fnc_srand, 0 } }, + { HAWK_T("tan"), { { 1, 1, HAWK_NULL }, fnc_tan, 0 } }, + { HAWK_T("tanh"), { { 1, 1, HAWK_NULL }, fnc_tanh, 0 } } +}; + +static int query (hawk_mod_t* mod, hawk_t* awk, const hawk_ooch_t* name, hawk_mod_sym_t* sym) +{ + hawk_oocs_t ea; + int left, right, mid, n; + + left = 0; right = HAWK_COUNTOF(fnctab) - 1; + + while (left <= right) + { + mid = left + (right - left) / 2; + + n = hawk_comp_oocstr(fnctab[mid].name, name, 0); + if (n > 0) right = mid - 1; + else if (n < 0) left = mid + 1; + else + { + sym->type = HAWK_MOD_FNC; + sym->u.fnc = fnctab[mid].info; + return 0; + } + } + +#if 0 + left = 0; right = HAWK_COUNTOF(inttab) - 1; + while (left <= right) + { + mid = left + (right - left) / 2; + + n = hawk_comp_oocstr(inttab[mid].name, name, 0); + if (n > 0) right = mid - 1; + else if (n < 0) left = mid + 1; + else + { + sym->type = HAWK_MOD_INT; + sym->u.in = inttab[mid].info; + return 0; + } + } +#endif + + ea.ptr = (hawk_ooch_t*)name; + ea.len = hawk_count_oocstr(name); + hawk_seterror (awk, HAWK_ENOENT, &ea, HAWK_NULL); + return -1; +} + +/* TODO: proper resource management */ + +static int init (hawk_mod_t* mod, hawk_rtx_t* rtx) +{ + return 0; +} + +static void fini (hawk_mod_t* mod, hawk_rtx_t* rtx) +{ + /* TODO: anything */ +} + +static void unload (hawk_mod_t* mod, hawk_t* awk) +{ + modctx_t* modctx; + + modctx = (modctx_t*)mod->ctx; + hawk_freemem (awk, modctx); +} + +int hawk_mod_math (hawk_mod_t* mod, hawk_t* awk) +{ + modctx_t* modctx; + struct timeval tv; + + modctx = hawk_allocmem(awk, HAWK_SIZEOF(*modctx)); + if (modctx == HAWK_NULL) return -1; + + HAWK_MEMSET (modctx, 0, HAWK_SIZEOF(*modctx)); + + gettimeofday (&tv, HAWK_NULL); + modctx->seed = tv.tv_sec * tv.tv_usec; + srandom_r (modctx->seed, &modctx->prand); + + mod->query = query; + mod->unload = unload; + + mod->init = init; + mod->fini = fini; + mod->ctx = modctx; + + return 0; +} + diff --git a/hawk/lib/mod-math.h b/hawk/lib/mod-math.h new file mode 100644 index 00000000..cf938c48 --- /dev/null +++ b/hawk/lib/mod-math.h @@ -0,0 +1,43 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_LIB_MOD_MATH_H_ +#define _HAWK_LIB_MOD_MATH_H_ + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +HAWK_EXPORT int hawk_mod_math (hawk_mod_t* mod, hawk_t* awk); + +#if defined(__cplusplus) +} +#endif + +#endif + diff --git a/hawk/lib/mod-str.c b/hawk/lib/mod-str.c new file mode 100644 index 00000000..d425e8b2 --- /dev/null +++ b/hawk/lib/mod-str.c @@ -0,0 +1,669 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "mod-str.h" +#include "hawk-prv.h" + +static int fnc_normspace (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + /* normalize spaces + * - trim leading and trailing spaces + * - replace a series of spaces to a single space + */ + hawk_val_t* retv; + hawk_val_t* a0; + + a0 = hawk_rtx_getarg(rtx, 0); + if (HAWK_RTX_GETVALTYPE(rtx, a0) == HAWK_VAL_MBS) + { + hawk_bch_t* str0; + hawk_oow_t len0; + + str0 = hawk_rtx_valtobcstrdup(rtx, a0, &len0); + if (!str0) return -1; + len0 = hawk_compact_bchars(str0, len0); + retv = hawk_rtx_makembsval(rtx, str0, len0); + hawk_rtx_freemem (rtx, str0); + } + else + { + hawk_ooch_t* str0; + hawk_oow_t len0; + + str0 = hawk_rtx_valtooocstrdup(rtx, a0, &len0); + if (!str0) return -1; + len0 = hawk_compact_oochars(str0, len0); + retv = hawk_rtx_makestrvalwithoochars(rtx, str0, len0); + hawk_rtx_freemem (rtx, str0); + } + + if (!retv) return -1; + hawk_rtx_setretval (rtx, retv); + + return 0; +} + +static int trim (hawk_rtx_t* rtx, int flags) +{ + hawk_val_t* retv; + hawk_val_t* a0; + + a0 = hawk_rtx_getarg(rtx, 0); + + if (HAWK_RTX_GETVALTYPE(rtx, a0) == HAWK_VAL_MBS) + { + hawk_bcs_t path; + hawk_bch_t* npath; + path.ptr = ((hawk_val_mbs_t*)a0)->val.ptr; + path.len = ((hawk_val_mbs_t*)a0)->val.len; + npath = hawk_trim_bchars(path.ptr, &path.len, flags); + retv = hawk_rtx_makembsval(rtx, npath, path.len); + } + else + { + hawk_oocs_t path; + hawk_ooch_t* npath; + path.ptr = hawk_rtx_getvaloocstr(rtx, a0, &path.len); + if (!path.ptr) return -1; + /* because qse_strxtrmx() returns the pointer and the length without + * affecting the string given, it's safe to pass the original value. + * hawk_rtx_getvaloocstr() doesn't duplicate the value if it's of + * the string type. */ + npath = hawk_trim_oochars(path.ptr, &path.len, flags); + retv = hawk_rtx_makestrvalwithoochars(rtx, npath, path.len); + hawk_rtx_freevaloocstr (rtx, a0, path.ptr); + } + + if (!retv) return -1; + hawk_rtx_setretval (rtx, retv); + return 0; +} + +#define TRIM_FLAG_PAC_SPACES (1 << 0) + +static int fnc_trim (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + if (hawk_rtx_getnargs(rtx) >= 2) + { + hawk_int_t iv; + if (hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 1), &iv) <= -1) return -1; + if (iv & TRIM_FLAG_PAC_SPACES) return fnc_normspace(rtx, fi); + } + + return trim(rtx, HAWK_TRIM_OOCHARS_LEFT | HAWK_TRIM_OOCHARS_RIGHT); +} +static int fnc_ltrim (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return trim(rtx, HAWK_TRIM_OOCHARS_LEFT); +} +static int fnc_rtrim (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return trim(rtx, HAWK_TRIM_OOCHARS_RIGHT); +} + +static int is_class (hawk_rtx_t* rtx, hawk_ooch_prop_t ctype) +{ + hawk_val_t* a0; + int tmp; + + a0 = hawk_rtx_getarg (rtx, 0); + + if (HAWK_RTX_GETVALTYPE(rtx, a0) == HAWK_VAL_MBS) + { + hawk_bch_t* str0; + hawk_oow_t len0; + + str0 = ((hawk_val_mbs_t*)a0)->val.ptr; + len0 = ((hawk_val_mbs_t*)a0)->val.len; + + if (len0 <= 0) tmp = 0; + else + { + tmp = 1; + do + { + len0--; + if (!hawk_is_bch_type(str0[len0], ctype)) + { + tmp = 0; + break; + } + } + while (len0 > 0); + } + } + else + { + hawk_ooch_t* str0; + hawk_oow_t len0; + + str0 = hawk_rtx_getvaloocstr(rtx, a0, &len0); + if (!str0) return -1; + + if (len0 <= 0) tmp = 0; + else + { + tmp = 1; + do + { + len0--; + if (!hawk_is_ooch_type(str0[len0], ctype)) + { + tmp = 0; + break; + } + } + while (len0 > 0); + } + hawk_rtx_freevaloocstr (rtx, a0, str0); + } + + a0 = hawk_rtx_makeintval (rtx, tmp); + if (!a0) return -1; + + hawk_rtx_setretval (rtx, a0); + return 0; +} + +static int fnc_isalnum (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return is_class(rtx, HAWK_OOCH_PROP_ALNUM); +} + +static int fnc_isalpha (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return is_class(rtx, HAWK_OOCH_PROP_ALPHA); +} + +static int fnc_isblank (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return is_class(rtx, HAWK_OOCH_PROP_BLANK); +} + +static int fnc_iscntrl (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return is_class(rtx, HAWK_OOCH_PROP_CNTRL); +} + +static int fnc_isdigit (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return is_class(rtx, HAWK_OOCH_PROP_DIGIT); +} + +static int fnc_isgraph (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return is_class(rtx, HAWK_OOCH_PROP_GRAPH); +} + +static int fnc_islower (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return is_class(rtx, HAWK_OOCH_PROP_LOWER); +} + +static int fnc_isprint (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return is_class(rtx, HAWK_OOCH_PROP_PRINT); +} + +static int fnc_ispunct (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return is_class(rtx, HAWK_OOCH_PROP_PUNCT); +} + +static int fnc_isspace (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return is_class(rtx, HAWK_OOCH_PROP_SPACE); +} + +static int fnc_isupper (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return is_class(rtx, HAWK_OOCH_PROP_UPPER); +} + +static int fnc_isxdigit (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + return is_class(rtx, HAWK_OOCH_PROP_XDIGIT); +} + +static int fnc_fromcharcode (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + /* create a string from a series of charcter codes */ + + hawk_val_t* retv; + hawk_oow_t nargs, i; + hawk_oochu_t* ptr0; /* to guarantee the unsigned code conversion */ + + nargs = hawk_rtx_getnargs(rtx); + + retv = hawk_rtx_makestrvalwithoochars(rtx, HAWK_NULL, nargs); + if (!retv) return -1; + + ptr0 = (hawk_oochu_t*)((hawk_val_str_t*)retv)->val.ptr; + + for (i = 0; i < nargs; i++) + { + hawk_val_t* a0; + hawk_int_t cc; + + a0 = hawk_rtx_getarg(rtx, i); + if (hawk_rtx_valtoint(rtx, a0, &cc) <= -1) + { + hawk_rtx_freeval (rtx, retv, 0); + return -1; + } + + ptr0[i] = cc; + } + + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_tocharcode (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + /* return the numeric value for the first character or the character of the given position. + * you can use sprintf("%c", num_val) or str::fromcharcode(num_val) for reverse conversion. */ + hawk_val_t* retv; + hawk_val_t* a0; + hawk_int_t iv = -1; + hawk_int_t pos = 0; + + a0 = hawk_rtx_getarg(rtx, 0); + if (hawk_rtx_getnargs(rtx) >= 2) + { + /* optional index. must be between 1 and the string length inclusive */ + hawk_val_t* a1; + a1 = hawk_rtx_getarg(rtx, 1); + if (hawk_rtx_valtoint(rtx, a1, &pos) <= -1) return -1; + pos--; /* 1 based indexing. range check to be done before accessing below */ + } + + if (HAWK_RTX_GETVALTYPE(rtx, a0) == HAWK_VAL_MBS) + { + hawk_bch_t* str0; + hawk_oow_t len0; + + str0 = ((hawk_val_mbs_t*)a0)->val.ptr; + len0 = ((hawk_val_mbs_t*)a0)->val.len; + + if (pos >= 0 && pos < len0) + { + #if defined(HAWK_OOCH_IS_BCH) + /* typecasting in case hawk_bch_t is signed */ + iv = (unsigned char)str0[pos]; + #else + iv = str0[pos]; + #endif + } + } + else + { + hawk_ooch_t* str0; + hawk_oow_t len0; + + str0 = hawk_rtx_getvaloocstr(rtx, a0, &len0); + if (!str0) return -1; + + if (pos >= 0 && pos < len0) + { + #if defined(HAWK_OOCH_IS_BCH) + /* typecasting in case hawk_bch_t is signed */ + iv = (unsigned char)str0[pos]; + #else + iv = str0[pos]; + #endif + } + + hawk_rtx_freevaloocstr(rtx, a0, str0); + } + + if (iv >= 0) + { + retv = hawk_rtx_makeintval(rtx, iv); + if (!retv) return -1; + hawk_rtx_setretval (rtx, retv); + } + + return 0; +} + + +static int fnc_frommbs (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + /* str::frommbs(B"byte-string" [, "encoding-name"]) + * + * if you use a supported encoding name, it may look like this: + * a = str::frommbs(B"\xC7\xD1\xB1\xDB", "cp949"); + * printf ("%K\n", a); + */ + hawk_val_t* a0, * r; + hawk_cmgr_t* cmgr = hawk_rtx_getcmgr(rtx); + + if (hawk_rtx_getnargs(rtx) >= 2) + { + hawk_val_t* a1; + hawk_oocs_t enc; + + + a1 = hawk_rtx_getarg(rtx, 1); + enc.ptr = hawk_rtx_getvaloocstr(rtx, a1, &enc.len); + if (!enc.ptr) return -1; + /* if encoding name is an empty string, qse_Findcmgr() returns the default cmgr. + * i don't want that behavior. */ + cmgr = (enc.len > 0 && enc.len == hawk_count_oocstr(enc.ptr))? hawk_get_cmgr_by_name(enc.ptr): HAWK_NULL; + hawk_rtx_freevaloocstr (rtx, a1, enc.ptr); + + if (!cmgr) + { + /* if the encoding name is not known, return a zero-length string */ + r = hawk_rtx_makestrvalwithoochars(rtx, HAWK_NULL, 0); /* this never fails for length 0 */ + goto done; + } + } + + a0 = hawk_rtx_getarg(rtx, 0); + switch (HAWK_RTX_GETVALTYPE(rtx, a0)) + { + case HAWK_VAL_STR: + r = a0; + break; + + default: + { + hawk_oocs_t str; + str.ptr = hawk_rtx_getvaloocstrwithcmgr(rtx, a0, &str.len, cmgr); + if (!str.ptr) return -1; + r = hawk_rtx_makestrvalwithoocs(rtx, &str); + hawk_rtx_freevaloocstr (rtx, a0, str.ptr); + if (!r) return -1; + break; + } + } + +done: + hawk_rtx_setretval (rtx, r); + return 0; +} + +static int fnc_tombs (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + /* str::tombs("string", [, "encoding-name"]) + * + * if you use a supported encoding name, it may look like this: + * a = str::tombs("\uD55C\uAE00", "cp949"); + * printf (B"%K\n", a); + */ + + hawk_val_t* a0, * r; + hawk_cmgr_t* cmgr = hawk_rtx_getcmgr(rtx); + + if (hawk_rtx_getnargs(rtx) >= 2) + { + hawk_val_t* a1; + hawk_oocs_t enc; + a1 = hawk_rtx_getarg(rtx, 1); + enc.ptr = hawk_rtx_getvaloocstr(rtx, a1, &enc.len); + if (!enc.ptr) return -1; + /* if encoding name is an empty string, qse_Findcmgr() returns the default cmgr. + * i don't want that behavior. */ + cmgr = (enc.len > 0 && enc.len == hawk_count_oocstr(enc.ptr))? hawk_get_cmgr_by_name(enc.ptr): HAWK_NULL; + hawk_rtx_freevaloocstr (rtx, a1, enc.ptr); + + if (!cmgr) + { + /* if the encoding name is not known, return a zero-length string */ + r = hawk_rtx_makembsval(rtx, HAWK_NULL, 0); /* this never fails for length 0 */ + goto done; + } + } + + a0 = hawk_rtx_getarg(rtx, 0); + switch (HAWK_RTX_GETVALTYPE(rtx, a0)) + { + case HAWK_VAL_MBS: + r = a0; + break; + + default: + { + hawk_bcs_t str; + str.ptr = hawk_rtx_getvalbcstrwithcmgr(rtx, a0, &str.len, cmgr); + if (!str.ptr) return -1; + r = hawk_rtx_makembsvalwithbcs(rtx, &str); + hawk_rtx_freevalbcstr (rtx, a0, str.ptr); + if (!r) return -1; + break; + } + } + +done: + hawk_rtx_setretval (rtx, r); + return 0; +} + +static int fnc_tonum (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + /* str::tonum(value) */ + /* str::tonum(string, base) */ + + hawk_val_t* retv; + hawk_val_t* a0; + hawk_int_t lv; + hawk_flt_t rv; + int rx; + + a0 = hawk_rtx_getarg(rtx, 0); + + if (HAWK_RTX_GETVALTYPE(rtx, a0) == HAWK_VAL_MBS && hawk_rtx_getnargs(rtx) >= 2) + { + /* if the value is known to be a byte string, it supports the optional + * base parameter */ + hawk_val_t* a1 = hawk_rtx_getarg(rtx, 1); + hawk_int_t base; + + if (hawk_rtx_valtoint(rtx, a1, &base) <= -1) return -1; + rx = hawk_rtx_bcharstonum( + rtx, + HAWK_RTX_OOCSTRTONUM_MAKE_OPTION(0, base), + ((hawk_val_mbs_t*)a0)->val.ptr, + ((hawk_val_mbs_t*)a0)->val.len, + &lv, &rv + ); + } + else if (HAWK_RTX_GETVALTYPE(rtx, a0) == HAWK_VAL_STR && hawk_rtx_getnargs(rtx) >= 2) + { + /* if the value is known to be a string, it supports the optional + * base parameter */ + hawk_val_t* a1 = hawk_rtx_getarg(rtx, 1); + hawk_int_t base; + + if (hawk_rtx_valtoint(rtx, a1, &base) <= -1) return -1; + rx = hawk_rtx_oocharstonum( + rtx, + HAWK_RTX_OOCSTRTONUM_MAKE_OPTION(0, base), + ((hawk_val_str_t*)a0)->val.ptr, + ((hawk_val_str_t*)a0)->val.len, + &lv, &rv + ); + } + else + { + rx = hawk_rtx_valtonum(rtx, a0, &lv, &rv); + } + + if (rx == 0) + { + retv = hawk_rtx_makeintval(rtx, lv); + } + else if (rx >= 1) + { + retv = hawk_rtx_makefltval(rtx, rv); + } + else + { + retv = hawk_rtx_makeintval(rtx, 0); + } + + if (!retv) return -1; + + hawk_rtx_setretval (rtx, retv); + return 0; +} + +typedef struct fnctab_t fnctab_t; +struct fnctab_t +{ + const hawk_ooch_t* name; + hawk_mod_sym_fnc_t info; +}; + +typedef struct inttab_t inttab_t; +struct inttab_t +{ + const hawk_ooch_t* name; + hawk_mod_sym_int_t info; +}; + +#define A_MAX HAWK_TYPE_MAX(int) + +static fnctab_t fnctab[] = +{ + /* keep this table sorted for binary search in query(). */ + { HAWK_T("fromcharcode"), { { 0, A_MAX, HAWK_NULL }, fnc_fromcharcode, 0 } }, + { HAWK_T("frommbs"), { { 1, 2, HAWK_NULL }, fnc_frommbs, 0 } }, + { HAWK_T("gsub"), { { 2, 3, HAWK_T("xvr")}, hawk_fnc_gsub, 0 } }, + { HAWK_T("index"), { { 2, 3, HAWK_NULL }, hawk_fnc_index, 0 } }, + { HAWK_T("isalnum"), { { 1, 1, HAWK_NULL }, fnc_isalnum, 0 } }, + { HAWK_T("isalpha"), { { 1, 1, HAWK_NULL }, fnc_isalpha, 0 } }, + { HAWK_T("isblank"), { { 1, 1, HAWK_NULL }, fnc_isblank, 0 } }, + { HAWK_T("iscntrl"), { { 1, 1, HAWK_NULL }, fnc_iscntrl, 0 } }, + { HAWK_T("isdigit"), { { 1, 1, HAWK_NULL }, fnc_isdigit, 0 } }, + { HAWK_T("isgraph"), { { 1, 1, HAWK_NULL }, fnc_isgraph, 0 } }, + { HAWK_T("islower"), { { 1, 1, HAWK_NULL }, fnc_islower, 0 } }, + { HAWK_T("isprint"), { { 1, 1, HAWK_NULL }, fnc_isprint, 0 } }, + { HAWK_T("ispunct"), { { 1, 1, HAWK_NULL }, fnc_ispunct, 0 } }, + { HAWK_T("isspace"), { { 1, 1, HAWK_NULL }, fnc_isspace, 0 } }, + { HAWK_T("isupper"), { { 1, 1, HAWK_NULL }, fnc_isupper, 0 } }, + { HAWK_T("isxdigit"), { { 1, 1, HAWK_NULL }, fnc_isxdigit, 0 } }, + { HAWK_T("length"), { { 1, 1, HAWK_NULL }, hawk_fnc_length, 0 } }, + { HAWK_T("ltrim"), { { 1, 1, HAWK_NULL }, fnc_ltrim, 0 } }, + { HAWK_T("match"), { { 2, 4, HAWK_T("vxvr") }, hawk_fnc_match, 0 } }, + { HAWK_T("normspace"), { { 1, 1, HAWK_NULL }, fnc_normspace, 0 } }, /* deprecated, use trim("xxx", str::TRIM_PAC_SPACES) */ + { HAWK_T("printf"), { { 1, A_MAX, HAWK_NULL }, hawk_fnc_sprintf, 0 } }, + { HAWK_T("rindex"), { { 2, 3, HAWK_NULL }, hawk_fnc_rindex, 0 } }, + { HAWK_T("rtrim"), { { 1, 1, HAWK_NULL }, fnc_rtrim, 0 } }, + { HAWK_T("split"), { { 2, 3, HAWK_T("vrx") }, hawk_fnc_split, 0 } }, + { HAWK_T("sub"), { { 2, 3, HAWK_T("xvr") }, hawk_fnc_sub, 0 } }, + { HAWK_T("substr"), { { 2, 3, HAWK_NULL }, hawk_fnc_substr, 0 } }, + { HAWK_T("tocharcode"), { { 1, 2, HAWK_NULL }, fnc_tocharcode, 0 } }, + { HAWK_T("tolower"), { { 1, 1, HAWK_NULL }, hawk_fnc_tolower, 0 } }, + { HAWK_T("tombs"), { { 1, 2, HAWK_NULL }, fnc_tombs, 0 } }, + { HAWK_T("tonum"), { { 1, 2, HAWK_NULL }, fnc_tonum, 0 } }, + { HAWK_T("toupper"), { { 1, 1, HAWK_NULL }, hawk_fnc_toupper, 0 } }, + { HAWK_T("trim"), { { 1, 2, HAWK_NULL }, fnc_trim, 0 } } +}; + +static inttab_t inttab[] = +{ + /* keep this table sorted for binary search in query(). */ + { HAWK_T("TRIM_PAC_SPACES"), { TRIM_FLAG_PAC_SPACES } } +}; + +static int query (hawk_mod_t* mod, hawk_t* awk, const hawk_ooch_t* name, hawk_mod_sym_t* sym) +{ + hawk_oocs_t ea; + int left, right, mid, n; + + left = 0; right = HAWK_COUNTOF(fnctab) - 1; + + while (left <= right) + { + mid = left + (right - left) / 2; + + n = hawk_comp_oocstr(fnctab[mid].name, name, 0); + if (n > 0) right = mid - 1; + else if (n < 0) left = mid + 1; + else + { + sym->type = HAWK_MOD_FNC; + sym->u.fnc = fnctab[mid].info; + return 0; + } + } + + left = 0; right = HAWK_COUNTOF(inttab) - 1; + while (left <= right) + { + mid = left + (right - left) / 2; + + n = hawk_comp_oocstr(inttab[mid].name, name, 0); + if (n > 0) right = mid - 1; + else if (n < 0) left = mid + 1; + else + { + sym->type = HAWK_MOD_INT; + sym->u.in = inttab[mid].info; + return 0; + } + } + + ea.ptr = (hawk_ooch_t*)name; + ea.len = hawk_count_oocstr(name); + hawk_seterror (awk, HAWK_ENOENT, &ea, HAWK_NULL); + return -1; +} + +/* TODO: proper resource management */ + +static int init (hawk_mod_t* mod, hawk_rtx_t* rtx) +{ + return 0; +} + +static void fini (hawk_mod_t* mod, hawk_rtx_t* rtx) +{ + /* TODO: anything */ +} + +static void unload (hawk_mod_t* mod, hawk_t* awk) +{ + /* TODO: anything */ +} + +int hawk_mod_str (hawk_mod_t* mod, hawk_t* awk) +{ + mod->query = query; + mod->unload = unload; + + mod->init = init; + mod->fini = fini; + /* + mod->ctx... + */ + + return 0; +} + diff --git a/hawk/lib/mod-str.h b/hawk/lib/mod-str.h new file mode 100644 index 00000000..09538ccc --- /dev/null +++ b/hawk/lib/mod-str.h @@ -0,0 +1,43 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_MOD_STR_H_ +#define _HAWK_MOD_STR_H_ + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +HAWK_EXPORT int hawk_mod_str (hawk_mod_t* mod, hawk_t* awk); + +#if defined(__cplusplus) +} +#endif + +#endif + diff --git a/hawk/lib/mod-sys.c b/hawk/lib/mod-sys.c new file mode 100644 index 00000000..b38f2c1d --- /dev/null +++ b/hawk/lib/mod-sys.c @@ -0,0 +1,2806 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "mod-sys.h" +#include "hawk-prv.h" + +#if defined(_WIN32) +# include +# include +# include +#elif defined(__OS2__) +# define INCL_DOSPROCESS +# define INCL_DOSEXCEPTIONS +# define INCL_ERRORS +# include +#elif defined(__DOS__) +# include +#else +# include "../cmn/syscall.h" +# if defined(HAVE_SYS_SYSCALL_H) +# include +# endif + +# define ENABLE_SYSLOG +# include + +# include + +#endif + +#include /* getenv, system */ +#include +#include +#include + +#define DEFAULT_MODE (0777) + +#define CLOSE_KEEPFD (1 << 0) + +enum sys_rc_t +{ + RC_ERROR = -1, + RC_ENOIMPL = -2, + RC_ENOSYS = -3, + RC_ENOMEM = -4, + RC_EAGAIN = -5, + RC_EINTR = -6, + RC_EINVAL = -7, + RC_ECHILD = -8, + RC_EPERM = -9, + RC_EBADF = -10, + RC_ENOENT = -11, + RC_EEXIST = -12, + RC_ENOTDIR = -13 +}; +typedef enum sys_rc_t sys_rc_t; + +/* ------------------------------------------------------------------------ */ + +typedef enum syslog_type_t syslog_type_t; +enum syslog_type_t +{ + SYSLOG_LOCAL, + SYSLOG_REMOTE +}; + +struct mod_ctx_t +{ + hawk_rbt_t* rtxtab; + + struct + { + syslog_type_t type; + char* ident; + qse_skad_t skad; + int syslog_opened; // has openlog() been called? + int opt; + int fac; + int sck; + hawk_becs_t* dmsgbuf; + } log; +}; +typedef struct mod_ctx_t mod_ctx_t; + +/* ------------------------------------------------------------------------ */ + +enum sys_node_data_type_t +{ + SYS_NODE_DATA_FD, + SYS_NODE_DATA_DIR +}; +typedef enum sys_node_data_type_t sys_node_data_type_t; + +struct sys_node_data_t +{ + sys_node_data_type_t type; + union + { + int fd; + qse_dir_t* dir; + } u; +}; +typedef struct sys_node_data_t sys_node_data_t; + +struct sys_list_data_t +{ + hawk_ooch_t errmsg[256]; + hawk_bch_t* readbuf; + hawk_oow_t readbuf_capa; +}; +typedef struct sys_list_data_t sys_list_data_t; + +#define __IMAP_NODE_T_DATA sys_node_data_t ctx; +#define __IMAP_LIST_T_DATA sys_list_data_t ctx; +#define __IMAP_LIST_T sys_list_t +#define __IMAP_NODE_T sys_node_t +#define __MAKE_IMAP_NODE __new_sys_node +#define __FREE_IMAP_NODE __free_sys_node +#include "imap-imp.h" + +struct rtx_data_t +{ + sys_list_t sys_list; +}; +typedef struct rtx_data_t rtx_data_t; + +/* ------------------------------------------------------------------------ */ + +static HAWK_INLINE sys_rc_t syserr_to_rc (int syserr) +{ + switch (syserr) + { + #if defined(EAGAIN) && defined(EWOULDBLOCK) && (EAGAIN == EWOULDBLOCK) + case EAGAIN: return RC_EAGAIN; + #elif defined(EAGAIN) && defined(EWOULDBLOCK) && (EAGAIN != EWOULDBLOCK) + case EAGAIN: case EWOULDBLOCK: return RC_EAGAIN; + #elif defined(EAGAIN) + case EAGAIN: return RC_EAGAIN; + #elif defined(EWOULDBLOCK) + case EWOULDBLOCK: return RC_EAGAIN; + #endif + + case EBADF: return RC_EBADF; + case ECHILD: return RC_ECHILD; + case EINTR: return RC_EINTR; + case EINVAL: return RC_EINVAL; + case ENOMEM: return RC_ENOMEM; + case ENOSYS: return RC_ENOSYS; + case EPERM: return RC_EPERM; + + default: return RC_ERROR; + } +} + +static HAWK_INLINE sys_rc_t direrr_to_rc (qse_dir_errnum_t direrr) +{ + switch (direrr) + { + case HAWK_DIR_ENOIMPL: return RC_ENOIMPL; + case HAWK_DIR_ENOMEM: return RC_ENOMEM; + case HAWK_DIR_EINVAL: return RC_EINVAL; + case HAWK_DIR_EPERM: return RC_EPERM; + case HAWK_DIR_ENOENT: return RC_ENOENT; + case HAWK_DIR_EEXIST: return RC_EEXIST; + case HAWK_DIR_ENOTDIR: return RC_ENOTDIR; + case HAWK_DIR_EINTR: return RC_EINTR; + case HAWK_DIR_EAGAIN: return RC_EAGAIN; + + default: return RC_ERROR; + } +} + +static HAWK_INLINE sys_rc_t awkerr_to_rc (qse_dir_errnum_t awkerr) +{ + switch (awkerr) + { + case HAWK_ENOIMPL: return RC_ENOIMPL; + case HAWK_ENOMEM: return RC_ENOMEM; + case HAWK_EINVAL: return RC_EINVAL; + case HAWK_EPERM: return RC_EPERM; + case HAWK_ENOENT: return RC_ENOENT; + case HAWK_EEXIST: return RC_EEXIST; + + default: return RC_ERROR; + } +} + + +static const hawk_ooch_t* rc_to_errstr (sys_rc_t rc) +{ + switch (rc) + { + case RC_EAGAIN: return HAWK_T("resource temporarily unavailable"); + case RC_EBADF: return HAWK_T("bad file descriptor"); + case RC_ECHILD: return HAWK_T("no child processes"); + case RC_EEXIST: return HAWK_T("file exists"); + case RC_EINTR: return HAWK_T("interrupted"); + case RC_EINVAL: return HAWK_T("invalid argument"); + case RC_ENOENT: return HAWK_T("no such file or directory"); + case RC_ENOIMPL: return HAWK_T("not implemented"); /* not implemented in this module */ + case RC_ENOMEM: return HAWK_T("not enough space"); + case RC_ENOTDIR: return HAWK_T("not a directory"); + case RC_ENOSYS: return HAWK_T("not implemented in system"); + case RC_EPERM: return HAWK_T("operation not permitted"); + case RC_ERROR: return HAWK_T("error"); + default: return HAWK_T("unknown error"); + }; +} + +static void set_errmsg_on_sys_list (hawk_rtx_t* rtx, sys_list_t* sys_list, const hawk_ooch_t* errfmt, ...) +{ + if (errfmt) + { + va_list ap; + va_start (ap, errfmt); + qse_strxvfmt (sys_list->ctx.errmsg, HAWK_COUNTOF(sys_list->ctx.errmsg), errfmt, ap); + va_end (ap); + } + else + { + qse_strxcpy (sys_list->ctx.errmsg, HAWK_COUNTOF(sys_list->ctx.errmsg), hawk_rtx_geterrmsg(rtx)); + } +} + +static HAWK_INLINE void set_errmsg_on_sys_list_with_syserr (hawk_rtx_t* rtx, sys_list_t* sys_list) +{ + set_errmsg_on_sys_list (rtx, sys_list, HAWK_T("%hs"), strerror(errno)); +} + + +/* ------------------------------------------------------------------------ */ + +static sys_node_t* new_sys_node_fd (hawk_rtx_t* rtx, sys_list_t* list, int fd) +{ + sys_node_t* node; + + node = __new_sys_node(rtx, list); + if (!node) return HAWK_NULL; + + node->ctx.type = SYS_NODE_DATA_FD; + node->ctx.u.fd = fd; + return node; +} + +static sys_node_t* new_sys_node_dir (hawk_rtx_t* rtx, sys_list_t* list, qse_dir_t* dir) +{ + sys_node_t* node; + + node = __new_sys_node(rtx, list); + if (!node) return HAWK_NULL; + + node->ctx.type = SYS_NODE_DATA_DIR; + node->ctx.u.dir = dir; + return node; +} + +static void free_sys_node (hawk_rtx_t* rtx, sys_list_t* list, sys_node_t* node) +{ + switch (node->ctx.type) + { + case SYS_NODE_DATA_FD: + if (node->ctx.u.fd >= 0) + { + close (node->ctx.u.fd); + node->ctx.u.fd = -1; + } + break; + + case SYS_NODE_DATA_DIR: + if (node->ctx.u.dir) + { + qse_dir_close (node->ctx.u.dir); + node->ctx.u.dir = HAWK_NULL; + } + break; + } + __free_sys_node (rtx, list, node); +} + +/* ------------------------------------------------------------------------ */ + +static HAWK_INLINE sys_list_t* rtx_to_sys_list (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + mod_ctx_t* mctx = (mod_ctx_t*)fi->mod->ctx; + hawk_rbt_pair_t* pair; + + pair = hawk_rbt_search(mctx->rtxtab, &rtx, HAWK_SIZEOF(rtx)); + HAWK_ASSERT (pair != HAWK_NULL); + return (sys_list_t*)HAWK_RBT_VPTR(pair); +} + +static HAWK_INLINE sys_node_t* get_sys_list_node (sys_list_t* sys_list, hawk_int_t id) +{ + if (id < 0 || id >= sys_list->map.high || !sys_list->map.tab[id]) return HAWK_NULL; + return sys_list->map.tab[id]; +} + +/* ------------------------------------------------------------------------ */ + +static sys_node_t* get_sys_list_node_with_arg (hawk_rtx_t* rtx, sys_list_t* sys_list, hawk_val_t* arg) +{ + hawk_int_t id; + sys_node_t* sys_node; + + if (hawk_rtx_valtoint(rtx, arg, &id) <= -1) + { + set_errmsg_on_sys_list (rtx, sys_list, HAWK_T("illegal instance id")); + return HAWK_NULL; + } + else if (!(sys_node = get_sys_list_node(sys_list, id))) + { + set_errmsg_on_sys_list (rtx, sys_list, HAWK_T("invalid instance id - %zd"), (hawk_oow_t)id); + return HAWK_NULL; + } + + return sys_node; +} + +/* ------------------------------------------------------------------------ */ + +static int fnc_errmsg (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + sys_list_t* sys_list; + hawk_val_t* retv; + + sys_list = rtx_to_sys_list(rtx, fi); + retv = hawk_rtx_makestrvalwithoocstr(rtx, sys_list->ctx.errmsg); + if (!retv) return -1; + + hawk_rtx_setretval (rtx, retv); + return 0; +} + +/* ------------------------------------------------------------------------ */ + +static int fnc_close (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + sys_list_t* sys_list; + sys_node_t* sys_node; + int rx = RC_ERROR; + hawk_int_t cflags; + + sys_list = rtx_to_sys_list(rtx, fi); + sys_node = get_sys_list_node_with_arg(rtx, sys_list, hawk_rtx_getarg(rtx, 0)); + + if (hawk_rtx_getnargs(rtx) >= 2 && (hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 1), &cflags) <= -1 || cflags < 0)) cflags = 0; + + if (sys_node && sys_node->ctx.type == SYS_NODE_DATA_FD) + { + /* although free_sys_node can handle other types, sys::close() is allowed to + * close nodes of the SYS_NODE_DATA_FD type only */ + if (cflags & CLOSE_KEEPFD) /* this flag applies to file descriptors only */ + { + sys_node->ctx.u.fd = -1; /* you may leak the original file descriptor. */ + } + + free_sys_node (rtx, sys_list, sys_node); + rx = 0; + } + else + { + rx = RC_EINVAL; + set_errmsg_on_sys_list (rtx, sys_list, rc_to_errstr(rx)); + } + + hawk_rtx_setretval (rtx, hawk_rtx_makeintval(rtx, rx)); + return 0; +} + +/* + BEGIN { + f = sys::open ("/tmp/test.txt", sys::O_RDONLY); + while (sys::read(f, x, 10) > 0) printf (B"%s", x); + sys::close (f); + } +*/ + +static int fnc_open (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + sys_list_t* sys_list; + + hawk_int_t rx = RC_ERROR, oflags = 0, mode = DEFAULT_MODE; + int fd; + hawk_bch_t* pstr; + hawk_oow_t plen; + hawk_val_t* a0; + + sys_list = rtx_to_sys_list(rtx, fi); + + if (hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 1), &oflags) <= -1 || oflags < 0) oflags = O_RDONLY; + if (hawk_rtx_getnargs(rtx) >= 3 && (hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 2), &mode) <= -1 || mode < 0)) mode = DEFAULT_MODE; + +#if defined(O_LARGEFILE) + oflags |= O_LARGEFILE; +#endif + + a0 = hawk_rtx_getarg(rtx, 0); + pstr = hawk_rtx_getvalbcstr(rtx, a0, &plen); + if (!pstr) goto fail; + fd = open(pstr, oflags, mode); + hawk_rtx_freevalbcstr (rtx, a0, pstr); + + if (fd >= 0) + { + sys_node_t* new_node; + + new_node = new_sys_node_fd(rtx, sys_list, fd); + if (new_node) + { + rx = new_node->id; + } + else + { + close (fd); + fail: + rx = awkerr_to_rc(hawk_rtx_geterrnum(rtx)); + set_errmsg_on_sys_list (rtx, sys_list, HAWK_NULL); + } + } + else + { + rx = syserr_to_rc(errno); + set_errmsg_on_sys_list_with_syserr (rtx, sys_list); + } + + HAWK_ASSERT (HAWK_IN_QUICKINT_RANGE(rx)); + hawk_rtx_setretval (rtx, hawk_rtx_makeintval(rtx, rx)); + return 0; +} + +/* + a = sys::openfd(1); + sys::write (a, B"let me write something here\n"); + sys::close (a, sys::C_KEEPFD); ## set C_KEEPFD to release 1 without closing it. + ##sys::close (a); + print "done\n"; +*/ + +static int fnc_openfd (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + /* wrap a raw system file descriptor into the internal management node */ + + sys_list_t* sys_list; + hawk_int_t rx = RC_ERROR; + hawk_int_t fd; + + sys_list = rtx_to_sys_list(rtx, fi); + + if (hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 0), &fd) <= -1) + { + rx = awkerr_to_rc(hawk_rtx_geterrnum(rtx)); + set_errmsg_on_sys_list (rtx, sys_list, HAWK_NULL); + } + else if (fd >= 0 && fd <= HAWK_TYPE_MAX(int)) + { + sys_node_t* sys_node; + + sys_node = new_sys_node_fd(rtx, sys_list, fd); + if (sys_node) + { + rx = sys_node->id; + } + else + { + rx = awkerr_to_rc(hawk_rtx_geterrnum(rtx)); + set_errmsg_on_sys_list (rtx, sys_list, HAWK_NULL); + } + } + else + { + rx = RC_EINVAL; + set_errmsg_on_sys_list (rtx, sys_list, rc_to_errstr(rx)); + } + + HAWK_ASSERT (HAWK_IN_QUICKINT_RANGE(rx)); + hawk_rtx_setretval (rtx, hawk_rtx_makeintval(rtx, rx)); + return 0; +} + + +static int fnc_read (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + sys_list_t* sys_list; + sys_node_t* sys_node; + hawk_int_t rx = RC_ERROR; + hawk_int_t reqsize = 8192; + + if (hawk_rtx_getnargs(rtx) >= 3 && (hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 2), &reqsize) <= -1 || reqsize <= 0)) reqsize = 8192; + if (reqsize > HAWK_QUICKINT_MAX) reqsize = HAWK_QUICKINT_MAX; + + sys_list = rtx_to_sys_list(rtx, fi); + sys_node = get_sys_list_node_with_arg(rtx, sys_list, hawk_rtx_getarg(rtx, 0)); + if (sys_node && sys_node->ctx.type == SYS_NODE_DATA_FD) + { + if (reqsize > sys_list->ctx.readbuf_capa) + { + hawk_bch_t* tmp = hawk_rtx_reallocmem(rtx, sys_list->ctx.readbuf, reqsize); + if (!tmp) + { + set_errmsg_on_sys_list (rtx, sys_list, HAWK_NULL); + goto done; + } + sys_list->ctx.readbuf = tmp; + sys_list->ctx.readbuf_capa = reqsize; + } + + rx = read(sys_node->ctx.u.fd, sys_list->ctx.readbuf, reqsize); + if (rx <= 0) + { + if (rx <= -1) + { + rx = syserr_to_rc(errno); + set_errmsg_on_sys_list_with_syserr(rtx, sys_list); + } + goto done; + } + else + { + hawk_val_t* sv; + int x; + + sv = hawk_rtx_makembsval(rtx, sys_list->ctx.readbuf, rx); + if (!sv) return -1; + + hawk_rtx_refupval (rtx, sv); + x = hawk_rtx_setrefval(rtx, (hawk_val_ref_t*)hawk_rtx_getarg(rtx, 1), sv); + hawk_rtx_refdownval (rtx, sv); + if (x <= -1) return -1; + } + } + else + { + rx = RC_EINVAL; + set_errmsg_on_sys_list (rtx, sys_list, rc_to_errstr(rx)); + } + +done: + /* the value in 'rx' never exceeds HAWK_QUICKINT_MAX as 'reqsize' has been limited to + * it before the call to 'read'. so it's safe not to check the result of hawk_rtx_makeintval() */ + hawk_rtx_setretval (rtx, hawk_rtx_makeintval(rtx, rx)); + return 0; +} + +static int fnc_write (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + sys_list_t* sys_list; + sys_node_t* sys_node; + hawk_int_t rx = RC_ERROR; + + sys_list = rtx_to_sys_list(rtx, fi); + sys_node = get_sys_list_node_with_arg(rtx, sys_list, hawk_rtx_getarg(rtx, 0)); + if (sys_node && sys_node->ctx.type == SYS_NODE_DATA_FD) + { + hawk_bch_t* dptr; + hawk_oow_t dlen; + hawk_val_t* a1; + + a1 = hawk_rtx_getarg(rtx, 1); + dptr = hawk_rtx_getvalbcstr(rtx, a1, &dlen); + if (dptr) + { + rx = write(sys_node->ctx.u.fd, dptr, dlen); + if (rx <= -1) + { + rx = syserr_to_rc(errno); + set_errmsg_on_sys_list_with_syserr(rtx, sys_list); + } + hawk_rtx_freevalbcstr (rtx, a1, dptr); + } + else + { + set_errmsg_on_sys_list (rtx, sys_list, HAWK_NULL); + } + } + else + { + rx = RC_EINVAL; + set_errmsg_on_sys_list (rtx, sys_list, rc_to_errstr(rx)); + } + + hawk_rtx_setretval (rtx, hawk_rtx_makeintval(rtx, rx)); + return 0; +} + +/* ------------------------------------------------------------------------ */ + +/* + a = sys::open("/etc/inittab", sys::O_RDONLY); + x = sys::open("/etc/fstab", sys::O_RDONLY); + + b = sys::dup(a); + sys::close(a); + + while (sys::read(b, abc, 100) > 0) printf (B"%s", abc); + + print "-------------------------------"; + + c = sys::dup(x, b, sys::O_CLOEXEC); + ## assertion: b == c + sys::close (x); + + while (sys::read(c, abc, 100) > 0) printf (B"%s", abc); + sys::close (c); +*/ + +static int fnc_dup (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + sys_list_t* sys_list; + sys_node_t* sys_node, * sys_node2 = HAWK_NULL; + hawk_int_t rx = RC_ERROR; + hawk_int_t oflags = 0; + + sys_list = rtx_to_sys_list(rtx, fi); + sys_node = get_sys_list_node_with_arg(rtx, sys_list, hawk_rtx_getarg(rtx, 0)); + if (hawk_rtx_getnargs(rtx) >= 2) + { + sys_node2 = get_sys_list_node_with_arg(rtx, sys_list, hawk_rtx_getarg(rtx, 1)); + if (!sys_node2 || sys_node2->ctx.type != SYS_NODE_DATA_FD) goto fail_einval; + if (hawk_rtx_getnargs(rtx) >= 3 && (hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 2), &oflags) <= -1 || oflags < 0)) oflags = 0; + } + + if (sys_node && sys_node->ctx.type == SYS_NODE_DATA_FD) + { + int fd; + + if (sys_node2) + { + #if defined(HAVE_DUP3) + fd = dup3(sys_node->ctx.u.fd, sys_node2->ctx.u.fd, oflags); + #else + fd = dup2(sys_node->ctx.u.fd, sys_node2->ctx.u.fd); + #endif + if (fd >= 0) + { + #if defined(HAVE_DUP3) + /* nothing extra for dup3 */ + #else + if (oflags) + { + int nflags = 0; + #if defined(O_CLOEXEC) && defined(FD_CLOEXEC) + if (oflags & O_CLOEXEC) nflags |= FD_CLOEXEC; + #endif + #if defined(O_NONBLOCK) && defined(FD_NONBLOCK) + /*if (oflags & O_NONBLOCK) nflags |= FD_NONBLOCK; dup3() doesn't seem to support NONBLOCK. */ + #endif + if (nflags) fcntl (fd, F_SETFD, nflags); + + } + #endif + sys_node2->ctx.u.fd = fd; /* dup2 or dup3 closes the descriptor implicitly */ + rx = sys_node2->id; + } + else + { + rx = syserr_to_rc(errno); + set_errmsg_on_sys_list_with_syserr (rtx, sys_list); + } + } + else + { + fd = dup(sys_node->ctx.u.fd); + if (fd >= 0) + { + sys_node_t* new_node; + + new_node = new_sys_node_fd(rtx, sys_list, fd); + if (new_node) + { + rx = new_node->id; + } + else + { + close (fd); + rx = awkerr_to_rc(hawk_rtx_geterrnum(rtx)); + set_errmsg_on_sys_list (rtx, sys_list, HAWK_NULL); + } + } + else + { + rx = syserr_to_rc(errno); + set_errmsg_on_sys_list_with_syserr (rtx, sys_list); + } + } + } + else + { + fail_einval: + rx = RC_EINVAL; + set_errmsg_on_sys_list (rtx, sys_list, rc_to_errstr(rx)); + } + + hawk_rtx_setretval (rtx, hawk_rtx_makeintval(rtx, rx)); + return 0; +} + +/* ------------------------------------------------------------------------ */ + +/* + ##if (sys::pipe(p0, p1) <= -1) + if (sys::pipe(p0, p1, sys::O_NONBLOCK | sys::O_CLOEXEC) <= -1) + { + print "pipe error"; + return -1; + } + a = sys::fork(); + if (a <= -1) + { + print "fork error"; + sys::close (p0); + sys::close (p1); + } + else if (a == 0) + { + ## child + printf ("child.... %d %d %d\n", sys::getpid(), p0, p1); + sys::close (p1); + while (1) + { + n = sys::read (p0, k, 3); + if (n <= 0) + { + if (n == sys::RC_EAGAIN) continue; ## nonblock but data not available + if (n != 0) print "ERROR: " sys::errmsg(); + break; + } + print k; + } + sys::close (p0); + } + else + { + ## parent + printf ("parent.... %d %d %d\n", sys::getpid(), p0, p1); + sys::close (p0); + sys::write (p1, B"hello"); + sys::write (p1, B"world"); + sys::close (p1); + sys::wait(a); + } +*/ + +static int fnc_pipe (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + /* create low-level pipes */ + + sys_list_t* sys_list; + int rx = RC_ERROR; + int fds[2]; + hawk_int_t flags = 0; + + sys_list = rtx_to_sys_list(rtx, fi); + + if (hawk_rtx_getnargs(rtx) >= 3 && (hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 2), &flags) <= -1 || flags < 0)) flags = 0; + +#if defined(HAVE_PIPE2) + if (pipe2(fds, flags) >= 0) +#else + if (pipe(fds) >= 0) +#endif + { + sys_node_t* node1, * node2; + + #if defined(HAVE_PIPE2) + /* do nothing extra */ + #else + if (flags > 0) + { + int nflags = 0; + + /* needs translation from O_XXXX to FD_XXXX */ + #if defined(O_CLOEXEC) && defined(FD_CLOEXEC) + if (flags & O_CLOEXEC) nflags |= FD_CLOEXEC; + #endif + #if defined(O_NONBLOCK) && defined(FD_NONBLOCK) + if (flags & O_NONBLOCK) nflags |= FD_NONBLOCK; + #endif + + if (nflags > 0) + { + fcntl (fds[0], F_SETFD, nflags); + fcntl (fds[1], F_SETFD, nflags); + } + } + #endif + node1 = new_sys_node_fd(rtx, sys_list, fds[0]); + node2 = new_sys_node_fd(rtx, sys_list, fds[1]); + if (node1 && node2) + { + hawk_val_t* v; + int x; + + v = hawk_rtx_makeintval(rtx, node1->id); + if (!v) + { + fail: + free_sys_node (rtx, sys_list, node1); + free_sys_node (rtx, sys_list, node2); + return -1; + } + hawk_rtx_refupval (rtx, v); + x = hawk_rtx_setrefval (rtx, (hawk_val_ref_t*)hawk_rtx_getarg(rtx, 0), v); + hawk_rtx_refdownval (rtx, v); + if (x <= -1) goto fail; + + v = hawk_rtx_makeintval(rtx, node2->id); + if (!v) goto fail; + hawk_rtx_refupval (rtx, v); + x = hawk_rtx_setrefval (rtx, (hawk_val_ref_t*)hawk_rtx_getarg(rtx, 1), v); + hawk_rtx_refdownval (rtx, v); + if (x <= -1) goto fail; + + rx = 0; + } + else + { + set_errmsg_on_sys_list (rtx, sys_list, HAWK_NULL); + if (node2) free_sys_node (rtx, sys_list, node2); + if (node1) free_sys_node (rtx, sys_list, node1); + } + } + else + { + rx = syserr_to_rc(errno); + set_errmsg_on_sys_list_with_syserr (rtx, sys_list); + } + + hawk_rtx_setretval (rtx, hawk_rtx_makeintval(rtx, rx)); + return 0; +} + + +/* ------------------------------------------------------------------------ */ + +/* + d = sys::opendir("/etc", sys::DIR_SORT); + if (d >= 0) + { + while (sys::readdir(d,a) > 0) print a; + sys::closedir(d); + } +*/ + +static int fnc_opendir (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + sys_list_t* sys_list; + sys_node_t* sys_node = HAWK_NULL; + hawk_int_t rx = RC_ERROR, flags = 0; + hawk_ooch_t* pstr; + hawk_oow_t plen; + hawk_val_t* a0; + qse_dir_t* dir; + qse_dir_errnum_t oe; + + sys_list = rtx_to_sys_list(rtx, fi); + + if (hawk_rtx_getnargs(rtx) >= 2 && (hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 1), &flags) <= -1 || flags < 0)) flags = 0; + + a0 = hawk_rtx_getarg(rtx, 0); + pstr = hawk_rtx_getvaloocstr(rtx, a0, &plen); + if (!pstr) goto fail; + dir = qse_dir_open(hawk_rtx_getmmgr(rtx), 0, pstr, flags, &oe); + hawk_rtx_freevaloocstr (rtx, a0, pstr); + + if (dir) + { + sys_node = new_sys_node_dir(rtx, sys_list, dir); + if (sys_node) + { + rx = sys_node->id; + } + else + { + qse_dir_close(dir); + fail: + set_errmsg_on_sys_list (rtx, sys_list, HAWK_NULL); + } + } + else + { + rx = direrr_to_rc(oe); + set_errmsg_on_sys_list (rtx, sys_list, rc_to_errstr(rx)); + } + + HAWK_ASSERT (HAWK_IN_QUICKINT_RANGE(rx)); + hawk_rtx_setretval (rtx, hawk_rtx_makeintval(rtx, rx)); + return 0; +} + +static int fnc_closedir (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + sys_list_t* sys_list; + sys_node_t* sys_node; + int rx = RC_ERROR; + + sys_list = rtx_to_sys_list(rtx, fi); + sys_node = get_sys_list_node_with_arg(rtx, sys_list, hawk_rtx_getarg(rtx, 0)); + if (sys_node && sys_node->ctx.type == SYS_NODE_DATA_DIR) + { + /* although free_sys_node() can handle other types, sys::closedir() is allowed to + * close nodes of the SYS_NODE_DATA_DIR type only */ + free_sys_node (rtx, sys_list, sys_node); + rx = 0; + } + else + { + rx = RC_EINVAL; + set_errmsg_on_sys_list (rtx, sys_list, rc_to_errstr(rx)); + } + + hawk_rtx_setretval (rtx, hawk_rtx_makeintval(rtx, rx)); + return 0; +} + +static int fnc_readdir (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + sys_list_t* sys_list; + sys_node_t* sys_node; + hawk_int_t rx = RC_ERROR; + + sys_list = rtx_to_sys_list(rtx, fi); + sys_node = get_sys_list_node_with_arg(rtx, sys_list, hawk_rtx_getarg(rtx, 0)); + if (sys_node && sys_node->ctx.type == SYS_NODE_DATA_DIR) + { + int y; + qse_dir_ent_t ent; + hawk_val_t* tmp; + + y = qse_dir_read(sys_node->ctx.u.dir, &ent); + if (y <= -1) + { + rx = direrr_to_rc(qse_dir_geterrnum(sys_node->ctx.u.dir)); + set_errmsg_on_sys_list (rtx, sys_list, rc_to_errstr(rx)); + } + else if (y == 0) + { + rx = 0; /* no more entry */ + } + else + { + tmp = hawk_rtx_makestrvalwithoocstr(rtx, ent.name); + if (!tmp) + { + rx = awkerr_to_rc(hawk_rtx_geterrnum(rtx)); + set_errmsg_on_sys_list (rtx, sys_list, rc_to_errstr(rx)); + } + else + { + int n; + hawk_rtx_refupval (rtx, tmp); + n = hawk_rtx_setrefval (rtx, (hawk_val_ref_t*)hawk_rtx_getarg(rtx, 1), tmp); + hawk_rtx_refdownval (rtx, tmp); + if (n <= -1) return -1; + + rx = 1; /* has entry */ + } + } + } + else + { + rx = RC_EINVAL; + set_errmsg_on_sys_list (rtx, sys_list, rc_to_errstr(rx)); + } + + /* the value in 'rx' never exceeds HAWK_QUICKINT_MAX as 'reqsize' has been limited to + * it before the call to 'read'. so it's safe not to check the result of hawk_rtx_makeintval() */ + hawk_rtx_setretval (rtx, hawk_rtx_makeintval(rtx, rx)); + return 0; +} + +/* ------------------------------------------------------------------------ */ + +static int fnc_fork (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_int_t pid; + hawk_val_t* retv; + +#if defined(_WIN32) + /* TOOD: implement this*/ + pid = RC_ENOIMPL; + set_errmsg_on_sys_list (rtx, rtx_to_sys_list(rtx, fi), rc_to_errstr(pid)); +#elif defined(__OS2__) + /* TOOD: implement this*/ + pid = RC_ENOIMPL; + set_errmsg_on_sys_list (rtx, rtx_to_sys_list(rtx, fi), rc_to_errstr(pid)); +#elif defined(__DOS__) + /* TOOD: implement this*/ + pid = RC_ENOIMPL; + set_errmsg_on_sys_list (rtx, rtx_to_sys_list(rtx, fi), rc_to_errstr(pid)); +#else + pid = fork(); + if (pid <= -1) + { + pid = syserr_to_rc(errno); + set_errmsg_on_sys_list_with_syserr (rtx, rtx_to_sys_list(rtx, fi)); + } +#endif + + retv = hawk_rtx_makeintval(rtx, pid); + if (retv == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_wait (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_int_t pid; + hawk_val_t* retv; + int rx; + hawk_oow_t nargs; + hawk_int_t opts = 0; + int status; + + nargs = hawk_rtx_getnargs(rtx); + if (nargs >= 3) + { + if (hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 2), &opts) <= -1) return -1; + } + + rx = hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 0), &pid); + if (rx >= 0) + { +#if defined(_WIN32) + /* TOOD: implement this*/ + rx = RC_ENOIMPL; + set_errmsg_on_sys_list (rtx, rtx_to_sys_list(rtx, fi), rc_to_errstr(rx)); + status = 0; +#elif defined(__OS2__) + /* TOOD: implement this*/ + rx = RC_ENOIMPL; + set_errmsg_on_sys_list (rtx, rtx_to_sys_list(rtx, fi), rc_to_errstr(rx)); + status = 0; +#elif defined(__DOS__) + /* TOOD: implement this*/ + rx = RC_ENOIMPL; + set_errmsg_on_sys_list (rtx, rtx_to_sys_list(rtx, fi), rc_to_errstr(rx)); + status = 0; +#else + rx = waitpid(pid, &status, opts); + if (rx <= -1) + { + rx = syserr_to_rc(errno); + set_errmsg_on_sys_list_with_syserr (rtx, rtx_to_sys_list(rtx, fi)); + } +#endif + } + + retv = hawk_rtx_makeintval(rtx, rx); + if (!retv) return -1; + + if (nargs >= 2) + { + hawk_val_t* sv; + int x; + + sv = hawk_rtx_makeintval(rtx, status); + if (!sv) return -1; + + hawk_rtx_refupval (rtx, sv); + x = hawk_rtx_setrefval(rtx, (hawk_val_ref_t*)hawk_rtx_getarg(rtx, 1), sv); + hawk_rtx_refdownval (rtx, sv); + if (x <= -1) + { + hawk_rtx_freemem (rtx, retv); + return -1; + } + } + + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_wifexited (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_int_t wstatus; + hawk_val_t* retv; + if (hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 0), &wstatus) <= -1) return -1; + retv = hawk_rtx_makeintval(rtx, WIFEXITED(wstatus)); + if (!retv) return -1; + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_wexitstatus (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_int_t wstatus; + hawk_val_t* retv; + if (hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 0), &wstatus) <= -1) return -1; + retv = hawk_rtx_makeintval(rtx, WEXITSTATUS(wstatus)); + if (!retv) return -1; + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_wifsignaled (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_int_t wstatus; + hawk_val_t* retv; + if (hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 0), &wstatus) <= -1) return -1; + retv = hawk_rtx_makeintval(rtx, WIFSIGNALED(wstatus)); + if (!retv) return -1; + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_wtermsig (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_int_t wstatus; + hawk_val_t* retv; + if (hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 0), &wstatus) <= -1) return -1; + retv = hawk_rtx_makeintval(rtx, WTERMSIG(wstatus)); + if (!retv) return -1; + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_wcoredump (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_int_t wstatus; + hawk_val_t* retv; + if (hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 0), &wstatus) <= -1) return -1; + retv = hawk_rtx_makeintval(rtx, WCOREDUMP(wstatus)); + if (!retv) return -1; + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_kill (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_int_t pid, sig; + hawk_val_t* retv; + int rx; + + if (hawk_rtx_valtoint(rtx, hawk_rtx_getarg (rtx, 0), &pid) <= -1 || + hawk_rtx_valtoint(rtx, hawk_rtx_getarg (rtx, 1), &sig) <= -1) + { + rx = RC_ERROR; + } + else + { +#if defined(_WIN32) + /* TOOD: implement this*/ + rx = RC_ENOIMPL; + set_errmsg_on_sys_list (rtx, rtx_to_sys_list(rtx, fi), rc_to_errstr(rx)); +#elif defined(__OS2__) + /* TOOD: implement this*/ + rx = RC_ENOIMPL; + set_errmsg_on_sys_list (rtx, rtx_to_sys_list(rtx, fi), rc_to_errstr(rx)); +#elif defined(__DOS__) + /* TOOD: implement this*/ + rx = RC_ENOIMPL; + set_errmsg_on_sys_list (rtx, rtx_to_sys_list(rtx, fi), rc_to_errstr(rx)); +#else + rx = kill(pid, sig); + if (rx <= -1) + { + rx = syserr_to_rc(errno); + set_errmsg_on_sys_list_with_syserr (rtx, rtx_to_sys_list(rtx, fi)); + } +#endif + } + + retv = hawk_rtx_makeintval(rtx, rx); + if (retv == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_getpgid (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_int_t pid; + hawk_val_t* retv; + +#if defined(_WIN32) + /* TOOD: implement this*/ + pid = RC_ENOIMPL; + set_errmsg_on_sys_list (rtx, rtx_to_sys_list(rtx, fi), rc_to_errstr(pid)); +#elif defined(__OS2__) + /* TOOD: implement this*/ + pid = RC_ENOIMPL; + set_errmsg_on_sys_list (rtx, rtx_to_sys_list(rtx, fi), rc_to_errstr(pid)); +#elif defined(__DOS__) + /* TOOD: implement this*/ + pid = RC_ENOIMPL; + set_errmsg_on_sys_list (rtx, rtx_to_sys_list(rtx, fi), rc_to_errstr(pid)); +#else + /* TODO: support specifing calling process id other than 0 */ + #if defined(HAVE_GETPGID) + pid = getpgid(0); + if (pid <= -1) set_errmsg_on_sys_list_with_syserr (rtx, rtx_to_sys_list(rtx, fi)); + #elif defined(HAVE_GETPGRP) + pid = getpgrp(); + if (pid <= -1) set_errmsg_on_sys_list_with_syserr (rtx, rtx_to_sys_list(rtx, fi)); + #else + pid = RC_ENOIMPL; + set_errmsg_on_sys_list (rtx, rtx_to_sys_list(rtx, fi), rc_to_errstr(pid)); + #endif +#endif + + retv = hawk_rtx_makeintval(rtx, pid); + if (retv == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_getpid (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_int_t pid; + hawk_val_t* retv; + +#if defined(_WIN32) + pid = GetCurrentProcessId(); + +#elif defined(__OS2__) + PTIB tib; + PPIB pib; + + pid = (DosGetInfoBlocks(&tib, &pib) == NO_ERROR)? pib->pib_ulpid: -1; + +#elif defined(__DOS__) + /* TOOD: implement this*/ + pid = RC_ENOIMPL; + set_errmsg_on_sys_list (rtx, rtx_to_sys_list(rtx, fi), rc_to_errstr(pid)); + +#else + pid = getpid (); + /* getpid() never fails */ +#endif + + retv = hawk_rtx_makeintval (rtx, pid); + if (retv == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_gettid (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + qse_intptr_t pid; + hawk_val_t* retv; + +#if defined(_WIN32) + pid = GetCurrentThreadId(); + +#elif defined(__OS2__) + PTIB tib; + PPIB pib; + + pid = (DosGetInfoBlocks (&tib, &pib) == NO_ERROR && tib->tib_ptib2)? + tib->tib_ptib2->tib2_ultid: -1; + +#elif defined(__DOS__) + /* TOOD: implement this*/ + pid = -1; + +#else + #if defined(SYS_gettid) && defined(HAWK_SYSCALL0) + HAWK_SYSCALL0 (pid, SYS_gettid); + #elif defined(SYS_gettid) + pid = syscall(SYS_gettid); + #else + pid = -1; + #endif +#endif + + retv = hawk_rtx_makeintval (rtx, (hawk_int_t)pid); + if (retv == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_getppid (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_int_t pid; + hawk_val_t* retv; + +#if defined(_WIN32) + /* TOOD: implement this*/ + pid = -1; + +#elif defined(__OS2__) + /* TOOD: implement this*/ + pid = -1; + +#elif defined(__DOS__) + /* TOOD: implement this*/ + pid = -1; + +#else + pid = getppid (); +#endif + + retv = hawk_rtx_makeintval (rtx, pid); + if (retv == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_getuid (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_int_t uid; + hawk_val_t* retv; + +#if defined(_WIN32) + /* TOOD: implement this*/ + uid = -1; + +#elif defined(__OS2__) + /* TOOD: implement this*/ + uid = -1; + +#elif defined(__DOS__) + /* TOOD: implement this*/ + uid = -1; + +#else + uid = getuid (); +#endif + + retv = hawk_rtx_makeintval (rtx, uid); + if (retv == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_getgid (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_int_t gid; + hawk_val_t* retv; + +#if defined(_WIN32) + /* TOOD: implement this*/ + gid = -1; + +#elif defined(__OS2__) + /* TOOD: implement this*/ + gid = -1; + +#elif defined(__DOS__) + /* TOOD: implement this*/ + gid = -1; + +#else + gid = getgid (); +#endif + + retv = hawk_rtx_makeintval (rtx, gid); + if (retv == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_geteuid (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_int_t uid; + hawk_val_t* retv; + +#if defined(_WIN32) + /* TOOD: implement this*/ + uid = -1; + +#elif defined(__OS2__) + /* TOOD: implement this*/ + uid = -1; + +#elif defined(__DOS__) + /* TOOD: implement this*/ + uid = -1; + +#else + uid = geteuid (); +#endif + + retv = hawk_rtx_makeintval (rtx, uid); + if (retv == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_getegid (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_int_t gid; + hawk_val_t* retv; + +#if defined(_WIN32) + /* TOOD: implement this*/ + gid = -1; + +#elif defined(__OS2__) + /* TOOD: implement this*/ + gid = -1; + +#elif defined(__DOS__) + /* TOOD: implement this*/ + gid = -1; + +#else + gid = getegid (); +#endif + + retv = hawk_rtx_makeintval (rtx, gid); + if (retv == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_sleep (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_int_t lv; + hawk_flt_t fv; + hawk_val_t* retv; + int rx; + + rx = hawk_rtx_valtonum(rtx, hawk_rtx_getarg (rtx, 0), &lv, &fv); + if (rx == 0) + { +#if defined(_WIN32) + Sleep ((DWORD)HAWK_SEC_TO_MSEC(lv)); + rx = 0; +#elif defined(__OS2__) + DosSleep ((ULONG)HAWK_SEC_TO_MSEC(lv)); + rx = 0; +#elif defined(__DOS__) + #if (defined(__WATCOMC__) && (__WATCOMC__ < 1200)) + sleep (lv); + rx = 0; + #else + rx = sleep (lv); + #endif +#elif defined(HAVE_NANOSLEEP) + struct timespec req; + req.tv_sec = lv; + req.tv_nsec = 0; + rx = nanosleep(&req, HAWK_NULL); +#else + rx = sleep(lv); +#endif + } + else if (rx >= 1) + { +#if defined(_WIN32) + Sleep ((DWORD)HAWK_SEC_TO_MSEC(fv)); + rx = 0; +#elif defined(__OS2__) + DosSleep ((ULONG)HAWK_SEC_TO_MSEC(fv)); + rx = 0; +#elif defined(__DOS__) + /* no high-resolution sleep() is available */ + #if (defined(__WATCOMC__) && (__WATCOMC__ < 1200)) + sleep ((hawk_int_t)fv); + rx = 0; + #else + rx = sleep((hawk_int_t)fv); + #endif; +#elif defined(HAVE_NANOSLEEP) + struct timespec req; + req.tv_sec = (hawk_int_t)fv; + req.tv_nsec = HAWK_SEC_TO_NSEC(fv - req.tv_sec); + rx = nanosleep(&req, HAWK_NULL); +#elif defined(HAVE_SELECT) + struct timeval req; + req.tv_sec = (hawk_int_t)fv; + req.tv_usec = HAWK_SEC_TO_USEC(fv - req.tv_sec); + rx = select(0, HAWK_NULL, HAWK_NULL, HAWK_NULL, &req); +#else + /* no high-resolution sleep() is available */ + rx = sleep((hawk_int_t)fv); +#endif + } + + retv = hawk_rtx_makeintval(rtx, rx); + if (retv == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_gettime (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_val_t* retv; + qse_ntime_t now; + + if (qse_gettime (&now) <= -1) now.sec = 0; + + retv = hawk_rtx_makeintval (rtx, now.sec); + if (retv == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_settime (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_val_t* retv; + qse_ntime_t now; + hawk_int_t tmp; + int rx; + + now.nsec = 0; + + if (hawk_rtx_valtoint(rtx, hawk_rtx_getarg (rtx, 0), &tmp) <= -1) rx = -1; + else + { + now.sec = tmp; + if (qse_settime(&now) <= -1) rx = -1; + else rx = 0; + } + + retv = hawk_rtx_makeintval (rtx, rx); + if (retv == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_mktime (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + qse_ntime_t nt; + hawk_oow_t nargs; + hawk_val_t* retv; + + nargs = hawk_rtx_getnargs(rtx); + if (nargs >= 1) + { + int sign; + hawk_ooch_t* str, * p, * end; + hawk_oow_t len; + hawk_val_t* a0; + qse_btime_t bt; + + a0 = hawk_rtx_getarg (rtx, 0); + str = hawk_rtx_getvaloocstr (rtx, a0, &len); + if (str == HAWK_NULL) return -1; + + /* the string must be of the format YYYY MM DD HH MM SS[ DST] */ + p = str; + end = str + len; + HAWK_MEMSET (&bt, 0, HAWK_SIZEOF(bt)); + + sign = 1; + if (p < end && *p == HAWK_T('-')) { sign = -1; p++; } + while (p < end && HAWK_ISDIGIT(*p)) bt.year = bt.year * 10 + (*p++ - HAWK_T('0')); + bt.year *= sign; + bt.year -= 1900; + while (p < end && (HAWK_ISSPACE(*p) || *p == HAWK_T('\0'))) p++; + + sign = 1; + if (p < end && *p == HAWK_T('-')) { sign = -1; p++; } + while (p < end && HAWK_ISDIGIT(*p)) bt.mon = bt.mon * 10 + (*p++ - HAWK_T('0')); + bt.mon *= sign; + bt.mon -= 1; + while (p < end && (HAWK_ISSPACE(*p) || *p == HAWK_T('\0'))) p++; + + sign = 1; + if (p < end && *p == HAWK_T('-')) { sign = -1; p++; } + while (p < end && HAWK_ISDIGIT(*p)) bt.mday = bt.mday * 10 + (*p++ - HAWK_T('0')); + bt.mday *= sign; + while (p < end && (HAWK_ISSPACE(*p) || *p == HAWK_T('\0'))) p++; + + sign = 1; + if (p < end && *p == HAWK_T('-')) { sign = -1; p++; } + while (p < end && HAWK_ISDIGIT(*p)) bt.hour = bt.hour * 10 + (*p++ - HAWK_T('0')); + bt.hour *= sign; + while (p < end && (HAWK_ISSPACE(*p) || *p == HAWK_T('\0'))) p++; + + sign = 1; + if (p < end && *p == HAWK_T('-')) { sign = -1; p++; } + while (p < end && HAWK_ISDIGIT(*p)) bt.min = bt.min * 10 + (*p++ - HAWK_T('0')); + bt.min *= sign; + while (p < end && (HAWK_ISSPACE(*p) || *p == HAWK_T('\0'))) p++; + + sign = 1; + if (p < end && *p == HAWK_T('-')) { sign = -1; p++; } + while (p < end && HAWK_ISDIGIT(*p)) bt.sec = bt.sec * 10 + (*p++ - HAWK_T('0')); + bt.sec *= sign; + while (p < end && (HAWK_ISSPACE(*p) || *p == HAWK_T('\0'))) p++; + + sign = 1; + if (p < end && *p == HAWK_T('-')) { sign = -1; p++; } + while (p < end && HAWK_ISDIGIT(*p)) bt.isdst = bt.isdst * 10 + (*p++ - HAWK_T('0')); + bt.isdst *= sign; + while (p < end && (HAWK_ISSPACE(*p) || *p == HAWK_T('\0'))) p++; + + hawk_rtx_freevaloocstr (rtx, a0, str); + qse_timelocal (&bt, &nt); + } + else + { + /* get the current time when no argument is given */ + qse_gettime (&nt); + } + + retv = hawk_rtx_makeintval(rtx, nt.sec); + if (retv == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, retv); + return 0; +} + + +#define STRFTIME_UTC (1 << 0) + +static int fnc_strftime (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + + /* + sys::strftime("%Y-%m-%d %H:%M:%S %z", sys::gettime()); + sys::strftime("%Y-%m-%d %H:%M:%S %z", sys::gettime(), sys::STRFTIME_UTC); + */ + + hawk_bch_t* fmt; + hawk_oow_t len; + hawk_val_t* retv; + + fmt = hawk_rtx_valtobcstrdup(rtx, hawk_rtx_getarg(rtx, 0), &len); + if (fmt) + { + qse_ntime_t nt; + qse_btime_t bt; + hawk_int_t tmpsec, flags = 0; + + nt.nsec = 0; + if (hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 1), &tmpsec) <= -1) + { + nt.sec = 0; + } + else + { + nt.sec = tmpsec; + } + + + if (hawk_rtx_getnargs(rtx) >= 3 && (hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 2), &flags) <= -1 || flags < 0)) flags = 0; + + if (((flags & STRFTIME_UTC)? qse_gmtime(&nt, &bt): qse_localtime(&nt, &bt)) >= 0) + { + hawk_bch_t tmpbuf[64], * tmpptr; + struct tm tm; + hawk_oow_t sl; + + HAWK_MEMSET (&tm, 0, HAWK_SIZEOF(tm)); + tm.tm_year = bt.year; + tm.tm_mon = bt.mon; + tm.tm_mday = bt.mday; + tm.tm_hour = bt.hour; + tm.tm_min = bt.min; + tm.tm_sec = bt.sec; + tm.tm_isdst = bt.isdst; + #if defined(HAVE_STRUCT_TM_TM_GMTOFF) + tm.tm_gmtoff = bt.gmtoff; + #elif defined(HAVE_STRUCT_TM___TM_GMTOFF) + tm.__tm_gmtoff = bt.gmtoff; + #endif + if (flags & STRFTIME_UTC) + { + #if defined(HAVE_STRUCT_TM_TM_ZONE) + tm.tm_zone = "GMT"; + #elif defined(HAVE_STRUCT_TM___TM_ZONE) + tm.__tm_zone = "GMT"; + #endif + } + + sl = strftime(tmpbuf, HAWK_COUNTOF(tmpbuf), fmt, &tm); + if (sl <= 0 || sl >= HAWK_COUNTOF(tmpbuf)) + { + /* buffer too small */ + hawk_bch_t* tmp; + hawk_oow_t tmpcapa, i, count = 0; + +/* +man strftime >>> + +RETURN VALUE + The strftime() function returns the number of bytes placed in the array s, not including the terminating null byte, provided the + string, including the terminating null byte, fits. Otherwise, it returns 0, and the contents of the array is undefined. (This + behavior applies since at least libc 4.4.4; very old versions of libc, such as libc 4.4.1, would return max if the array was too + small.) + + Note that the return value 0 does not necessarily indicate an error; for example, in many locales %p yields an empty string. + +-------------------------------------------------------------------------------------- +* +I use 'count' to limit the maximum number of retries when 0 is returned. +*/ + + for (i = 0; i < len;) + { + if (fmt[i] == HAWK_BT('%')) + { + count++; /* the nubmer of % specifier */ + i++; + if (i < len) i++; + } + else i++; + } + + tmpptr = HAWK_NULL; + tmpcapa = HAWK_COUNTOF(tmpbuf); + if (tmpcapa < len) tmpcapa = len; + + do + { + if (count <= 0) + { + if (tmpptr) hawk_rtx_freemem (rtx, tmpptr); + tmpbuf[0] = HAWK_BT('\0'); + tmpptr = tmpbuf; + break; + } + count--; + + tmpcapa *= 2; + tmp = (hawk_bch_t*)hawk_rtx_reallocmem(rtx, tmpptr, tmpcapa * HAWK_SIZEOF(*tmpptr)); + if (!tmp) + { + if (tmpptr) hawk_rtx_freemem (rtx, tmpptr); + tmpbuf[0] = HAWK_BT('\0'); + tmpptr = tmpbuf; + break; + } + + tmpptr = tmp; + sl = strftime(tmpptr, tmpcapa, fmt, &tm); + } + while (sl <= 0 || sl >= tmpcapa); + } + else + { + tmpptr = tmpbuf; + } + hawk_rtx_freemem (rtx, fmt); + + retv = hawk_rtx_makestrvalwithbcstr(rtx, tmpptr); + if (tmpptr && tmpptr != tmpbuf) hawk_rtx_freemem (rtx, tmpptr); + if (retv == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, retv); + } + else + { + hawk_rtx_freemem (rtx, fmt); + } + } + return 0; +} + +static int fnc_getenv (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_bch_t* var; + hawk_oow_t len; + hawk_val_t* retv; + + var = hawk_rtx_valtobcstrdup(rtx, hawk_rtx_getarg (rtx, 0), &len); + if (var) + { + hawk_bch_t* val; + + val = getenv(var); + if (val) + { + retv = hawk_rtx_makestrvalwithbcstr(rtx, val); + if (retv == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, retv); + } + + hawk_rtx_freemem (rtx, var); + } + + return 0; +} + +static int fnc_getnwifcfg (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + qse_nwifcfg_t cfg; + hawk_rtx_valtostr_out_t out; + int ret = -1; + + out.type = HAWK_RTX_VALTOSTR_CPLCPY; + out.u.cplcpy.ptr = cfg.name; + out.u.cplcpy.len = HAWK_COUNTOF(cfg.name); + if (hawk_rtx_valtostr(rtx, hawk_rtx_getarg(rtx, 0), &out) >= 0) + { + hawk_int_t type; + int rx; + + rx = hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 1), &type); + if (rx >= 0) + { + cfg.type = type; + + if (qse_getnwifcfg(&cfg) >= 0) + { + /* make a map value containg configuration */ + hawk_int_t index, mtu; + hawk_ooch_t addr[128]; + hawk_ooch_t mask[128]; + hawk_ooch_t ethw[32]; + hawk_val_map_data_t md[7]; + hawk_val_t* tmp; + + HAWK_MEMSET (md, 0, HAWK_SIZEOF(md)); + + md[0].key.ptr = HAWK_T("index"); + md[0].key.len = 5; + md[0].type = HAWK_VAL_MAP_DATA_INT; + index = cfg.index; + md[0].vptr = &index; + + md[1].key.ptr = HAWK_T("mtu"); + md[1].key.len = 3; + md[1].type = HAWK_VAL_MAP_DATA_INT; + mtu = cfg.mtu; + md[1].vptr = &mtu; + + md[2].key.ptr = HAWK_T("addr"); + md[2].key.len = 4; + md[2].type = HAWK_VAL_MAP_DATA_STR; + qse_nwadtostr (&cfg.addr, addr, HAWK_COUNTOF(addr), HAWK_NWADTOSTR_ADDR); + md[2].vptr = addr; + + md[3].key.ptr = HAWK_T("mask"); + md[3].key.len = 4; + md[3].type = HAWK_VAL_MAP_DATA_STR; + qse_nwadtostr (&cfg.mask, mask, HAWK_COUNTOF(mask), HAWK_NWADTOSTR_ADDR); + md[3].vptr = mask; + + md[4].key.ptr = HAWK_T("ethw"); + md[4].key.len = 4; + md[4].type = HAWK_VAL_MAP_DATA_STR; + qse_strxfmt (ethw, HAWK_COUNTOF(ethw), HAWK_T("%02X:%02X:%02X:%02X:%02X:%02X"), + cfg.ethw[0], cfg.ethw[1], cfg.ethw[2], cfg.ethw[3], cfg.ethw[4], cfg.ethw[5]); + md[4].vptr = ethw; + + if (cfg.flags & (HAWK_NWIFCFG_LINKUP | HAWK_NWIFCFG_LINKDOWN)) + { + md[5].key.ptr = HAWK_T("link"); + md[5].key.len = 4; + md[5].type = HAWK_VAL_MAP_DATA_STR; + md[5].vptr = (cfg.flags & HAWK_NWIFCFG_LINKUP)? HAWK_T("up"): HAWK_T("down"); + } + + tmp = hawk_rtx_makemapvalwithdata (rtx, md); + if (tmp) + { + int x; + hawk_rtx_refupval (rtx, tmp); + x = hawk_rtx_setrefval (rtx, (hawk_val_ref_t*)hawk_rtx_getarg(rtx, 2), tmp); + hawk_rtx_refdownval (rtx, tmp); + if (x <= -1) return -1; + ret = 0; + } + } + } + } + + /* no error check for hawk_rtx_makeintval() since ret is 0 or -1 */ + hawk_rtx_setretval (rtx, hawk_rtx_makeintval (rtx, ret)); + return 0; +} +/* ------------------------------------------------------------ */ + +static int fnc_system (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_val_t* v, * a0; + hawk_ooch_t* str; + hawk_oow_t len; + int n = 0; + + a0 = hawk_rtx_getarg (rtx, 0); + str = hawk_rtx_getvaloocstr (rtx, a0, &len); + if (str == HAWK_NULL) return -1; + + /* the target name contains a null character. + * make system return -1 */ + if (qse_strxchr (str, len, HAWK_T('\0'))) + { + n = -1; + goto skip_system; + } + +#if defined(_WIN32) + n = _tsystem (str); +#elif defined(HAWK_OOCH_IS_BCH) + n = system (str); +#else + + { + hawk_bch_t* mbs; + mbs = qse_wcstombsdupwithcmgr(str, HAWK_NULL, hawk_rtx_getmmgr(rtx), hawk_rtx_getcmgr(rtx)); + if (mbs == HAWK_NULL) + { + n = -1; + goto skip_system; + } + n = system (mbs); + hawk_rtx_freemem (rtx, mbs); + } + +#endif + +skip_system: + hawk_rtx_freevaloocstr (rtx, a0, str); + + v = hawk_rtx_makeintval (rtx, (hawk_int_t)n); + if (v == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, v); + return 0; +} + +/* ------------------------------------------------------------ */ +static int fnc_chmod (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_val_t* v, * a0; + hawk_ooch_t* str; + hawk_oow_t len; + int n = 0; + hawk_int_t mode; + + a0 = hawk_rtx_getarg (rtx, 0); + str = hawk_rtx_getvaloocstr (rtx, a0, &len); + if (!str) return -1; + + /* the target name contains a null character. + * make system return -1 */ + if (qse_strxchr(str, len, HAWK_T('\0'))) + { + n = -1; + goto skip_mkdir; + } + + if (hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 1), &mode) <= -1 || mode < 0) mode = DEFAULT_MODE; + +#if defined(_WIN32) + n = _tchmod(str, mode); +#elif defined(HAWK_OOCH_IS_BCH) + n = chmod(str, mode); +#else + + { + hawk_bch_t* mbs; + mbs = qse_wcstombsdupwithcmgr(str, HAWK_NULL, hawk_rtx_getmmgr(rtx), hawk_rtx_getcmgr(rtx)); + if (mbs == HAWK_NULL) + { + n = -1; + goto skip_mkdir; + } + n = chmod(mbs, mode); + hawk_rtx_freemem (rtx, mbs); + } + +#endif + +skip_mkdir: + hawk_rtx_freevaloocstr (rtx, a0, str); + + v = hawk_rtx_makeintval (rtx, (hawk_int_t)n); + if (v == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, v); + return 0; +} + +static int fnc_mkdir (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_val_t* v, * a0; + hawk_ooch_t* str; + hawk_oow_t len; + int n = 0; + hawk_int_t mode; + + a0 = hawk_rtx_getarg (rtx, 0); + str = hawk_rtx_getvaloocstr (rtx, a0, &len); + if (!str) return -1; + + /* the target name contains a null character. + * make system return -1 */ + if (qse_strxchr(str, len, HAWK_T('\0'))) + { + n = -1; + goto skip_mkdir; + } + + if (hawk_rtx_getnargs(rtx) >= 2 && (hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 1), &mode) <= -1 || mode < 0)) mode = DEFAULT_MODE; + +#if defined(_WIN32) + n = _tmkdir(str); +#elif defined(HAWK_OOCH_IS_BCH) + n = mkdir(str, mode); +#else + + { + hawk_bch_t* mbs; + mbs = qse_wcstombsdupwithcmgr(str, HAWK_NULL, hawk_rtx_getmmgr(rtx), hawk_rtx_getcmgr(rtx)); + if (mbs == HAWK_NULL) + { + n = -1; + goto skip_mkdir; + } + n = mkdir(mbs, mode); + hawk_rtx_freemem (rtx, mbs); + } + +#endif + +skip_mkdir: + hawk_rtx_freevaloocstr (rtx, a0, str); + + v = hawk_rtx_makeintval (rtx, (hawk_int_t)n); + if (v == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, v); + return 0; +} + +static int fnc_unlink (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + hawk_val_t* v, * a0; + hawk_ooch_t* str; + hawk_oow_t len; + int n = 0; + + a0 = hawk_rtx_getarg (rtx, 0); + str = hawk_rtx_getvaloocstr(rtx, a0, &len); + if (!str) return -1; + + /* the target name contains a null character. + * make system return -1 */ + if (qse_strxchr(str, len, HAWK_T('\0'))) + { + n = -1; + goto skip_unlink; + } + +#if defined(_WIN32) + n = _tunlink(str); +#elif defined(HAWK_OOCH_IS_BCH) + n = unlink(str); +#else + + { + hawk_bch_t* mbs; + mbs = qse_wcstombsdupwithcmgr(str, HAWK_NULL, hawk_rtx_getmmgr(rtx), hawk_rtx_getcmgr(rtx)); + if (mbs == HAWK_NULL) + { + n = -1; + goto skip_unlink; + } + n = unlink(mbs); + hawk_rtx_freemem (rtx, mbs); + } + +#endif + +skip_unlink: + hawk_rtx_freevaloocstr (rtx, a0, str); + + v = hawk_rtx_makeintval (rtx, (hawk_int_t)n); + if (v == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, v); + return 0; +} + +/* ------------------------------------------------------------ */ +static void open_remote_log_socket (hawk_rtx_t* rtx, mod_ctx_t* mctx) +{ +#if defined(_WIN32) + /* TODO: implement this */ +#else + int sck, flags; + int domain = qse_skadfamily(&mctx->log.skad); + int type = SOCK_DGRAM; + + HAWK_ASSERT (mctx->log.sck <= -1); + + +#if defined(SOCK_NONBLOCK) && defined(SOCK_CLOEXEC) + type |= SOCK_NONBLOCK; + type |= SOCK_CLOEXEC; +open_socket: +#endif + sck = socket(domain, type, 0); + if (sck <= -1) + { + #if defined(SOCK_NONBLOCK) && defined(SOCK_CLOEXEC) + if (errno == EINVAL && (type & (SOCK_NONBLOCK | SOCK_CLOEXEC))) + { + type &= ~(SOCK_NONBLOCK | SOCK_CLOEXEC); + goto open_socket; + } + #endif + return; + } + else + { + #if defined(SOCK_NONBLOCK) && defined(SOCK_CLOEXEC) + if (type & (SOCK_NONBLOCK | SOCK_CLOEXEC)) goto done; + #endif + } + + flags = fcntl(sck, F_GETFD, 0); + if (flags <= -1) return; +#if defined(FD_CLOEXEC) + flags |= FD_CLOEXEC; +#endif +#if defined(O_NONBLOCK) + flags |= O_NONBLOCK; +#endif + if (fcntl(sck, F_SETFD, flags) <= -1) return; + +done: + mctx->log.sck = sck; + +#endif +} + +static int fnc_openlog (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + int rx = -1; + hawk_int_t opt, fac; + hawk_val_t* retv; + hawk_ooch_t* ident = HAWK_NULL, * actual_ident; + hawk_oow_t ident_len; + hawk_bch_t* mbs_ident; + mod_ctx_t* mctx = (mod_ctx_t*)fi->mod->ctx; + qse_nwad_t nwad; + syslog_type_t log_type = SYSLOG_LOCAL; + + + ident = hawk_rtx_getvaloocstr(rtx, hawk_rtx_getarg(rtx, 0), &ident_len); + if (!ident) goto done; + + /* the target name contains a null character. + * make system return -1 */ + if (qse_strxchr(ident, ident_len, HAWK_T('\0'))) goto done; + + if (hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 1), &opt) <= -1) goto done; + if (hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 2), &fac) <= -1) goto done; + + if (qse_strbeg(ident, HAWK_T("remote://"))) + { + hawk_ooch_t* slash; + /* "udp://remote-addr:remote-port/syslog-identifier" */ + + log_type = SYSLOG_REMOTE; + actual_ident = ident + 9; + slash = qse_strchr(actual_ident, HAWK_T('/')); + if (!slash) goto done; + if (qse_strntonwad(actual_ident, slash - actual_ident, &nwad) <= -1) goto done; + actual_ident = slash + 1; + } + else if (qse_strbeg(ident, HAWK_T("local://"))) + { + /* "local://syslog-identifier" */ + actual_ident = ident + 8; + } + else + { + actual_ident = ident; + } + +#if defined(HAWK_OOCH_IS_BCH) + mbs_ident = qse_mbsdup(actual_ident, hawk_rtx_getmmgr(rtx)); +#else + mbs_ident = qse_wcstombsdupwithcmgr(actual_ident, HAWK_NULL, hawk_rtx_getmmgr(rtx), hawk_rtx_getcmgr(rtx)); +#endif + if (!mbs_ident) goto done; + + if (mctx->log.ident) hawk_rtx_freemem (rtx, mctx->log.ident); + mctx->log.ident = mbs_ident; + +#if defined(ENABLE_SYSLOG) + if (mctx->log.syslog_opened) + { + closelog (); + mctx->log.syslog_opened = 0; + } +#endif + if (mctx->log.sck >= 0) + { + #if defined(_WIN32) + /* TODO: impelement this */ + #else + close (mctx->log.sck); + #endif + mctx->log.sck = -1; + } + + mctx->log.type = log_type; + mctx->log.opt = opt; + mctx->log.fac = fac; + if (mctx->log.type == SYSLOG_LOCAL) + { + #if defined(ENABLE_SYSLOG) + openlog(mbs_ident, opt, fac); + mctx->log.syslog_opened = 1; + #endif + } + else if (mctx->log.type == SYSLOG_REMOTE) + { + qse_nwadtoskad (&nwad, &mctx->log.skad); + if ((opt & LOG_NDELAY) && mctx->log.sck <= -1) open_remote_log_socket (rtx, mctx); + } + + rx = 0; + +done: + if (ident) hawk_rtx_freevaloocstr(rtx, hawk_rtx_getarg(rtx, 0), ident); + + retv = hawk_rtx_makeintval(rtx, rx); + if (retv == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_closelog (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + int rx = -1; + hawk_val_t* retv; + mod_ctx_t* mctx = (mod_ctx_t*)fi->mod->ctx; + + switch (mctx->log.type) + { + case SYSLOG_LOCAL: + #if defined(ENABLE_SYSLOG) + closelog (); + /* closelog() might be called without openlog(). so there is no + * check if syslog_opened is true. + * it is just used as an indicator to decide wheter closelog() + * should be called upon module finalization(fini). */ + mctx->log.syslog_opened = 0; + #endif + break; + + case SYSLOG_REMOTE: + if (mctx->log.sck >= 0) + { + #if defined(_WIN32) + /* TODO: impelement this */ + #else + close (mctx->log.sck); + #endif + mctx->log.sck = -1; + } + + if (mctx->log.dmsgbuf) + { + qse_mbs_close (mctx->log.dmsgbuf); + mctx->log.dmsgbuf = HAWK_NULL; + } + + break; + } + + if (mctx->log.ident) + { + hawk_rtx_freemem (rtx, mctx->log.ident); + mctx->log.ident = HAWK_NULL; + } + + /* back to the local syslog in case writelog() is called + * without another openlog() after this closelog() */ + mctx->log.type = SYSLOG_LOCAL; + + rx = 0; + + retv = hawk_rtx_makeintval(rtx, rx); + if (retv == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, retv); + return 0; +} + + +static int fnc_writelog (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + int rx = -1; + hawk_val_t* retv; + hawk_int_t pri; + hawk_ooch_t* msg = HAWK_NULL; + hawk_oow_t msglen; + mod_ctx_t* mctx = (mod_ctx_t*)fi->mod->ctx; + + if (hawk_rtx_valtoint(rtx, hawk_rtx_getarg(rtx, 0), &pri) <= -1) goto done; + + msg = hawk_rtx_getvaloocstr(rtx, hawk_rtx_getarg(rtx, 1), &msglen); + if (!msg) goto done; + + if (qse_strxchr(msg, msglen, HAWK_T('\0'))) goto done; + + if (mctx->log.type == SYSLOG_LOCAL) + { + #if defined(ENABLE_SYSLOG) + #if defined(HAWK_OOCH_IS_BCH) + syslog(pri, "%s", msg); + #else + { + hawk_bch_t* mbs; + mbs = qse_wcstombsdupwithcmgr(msg, HAWK_NULL, hawk_rtx_getmmgr(rtx), hawk_rtx_getcmgr(rtx)); + if (!mbs) goto done; + syslog(pri, "%s", mbs); + hawk_rtx_freemem (rtx, mbs); + } + #endif + #endif + } + else if (mctx->log.type == SYSLOG_REMOTE) + { + #if defined(_WIN32) + /* TODO: implement this */ + #else + qse_ntime_t now; + qse_btime_t cnow; + + static const hawk_bch_t* __syslog_month_names[] = + { + HAWK_BT("Jan"), + HAWK_BT("Feb"), + HAWK_BT("Mar"), + HAWK_BT("Apr"), + HAWK_BT("May"), + HAWK_BT("Jun"), + HAWK_BT("Jul"), + HAWK_BT("Aug"), + HAWK_BT("Sep"), + HAWK_BT("Oct"), + HAWK_BT("Nov"), + HAWK_BT("Dec"), + }; + + if (mctx->log.sck <= -1) open_remote_log_socket (rtx, mctx); + + if (mctx->log.sck >= 0) + { + if (!mctx->log.dmsgbuf) mctx->log.dmsgbuf = qse_mbs_open(hawk_rtx_getmmgr(rtx), 0, 0); + if (!mctx->log.dmsgbuf) goto done; + + if (qse_gettime(&now) || qse_localtime(&now, &cnow) <= -1) goto done; + + if (qse_mbs_fmt ( + mctx->log.dmsgbuf, HAWK_BT("<%d>%s %02d %02d:%02d:%02d "), + (int)(mctx->log.fac | pri), + __syslog_month_names[cnow.mon], cnow.mday, + cnow.hour, cnow.min, cnow.sec) == (hawk_oow_t)-1) goto done; + + if (mctx->log.ident || (mctx->log.opt & LOG_PID)) + { + /* if the identifier is set or LOG_PID is set, the produced tag won't be empty. + * so appending ':' is kind of ok */ + + if (qse_mbs_fcat(mctx->log.dmsgbuf, HAWK_BT("%hs"), (mctx->log.ident? mctx->log.ident: HAWK_BT(""))) == (hawk_oow_t)-1) goto done; + + if (mctx->log.opt & LOG_PID) + { + if (qse_mbs_fcat(mctx->log.dmsgbuf, HAWK_BT("[%d]"), (int)HAWK_GETPID()) == (hawk_oow_t)-1) goto done; + } + + if (qse_mbs_fcat(mctx->log.dmsgbuf, HAWK_BT(": ")) == (hawk_oow_t)-1) goto done; + } + + #if defined(HAWK_OOCH_IS_BCH) + if (qse_mbs_fcat(mctx->log.dmsgbuf, HAWK_BT("%hs"), msg) == (hawk_oow_t)-1) goto done; + #else + if (qse_mbs_fcat(mctx->log.dmsgbuf, HAWK_BT("%ls"), msg) == (hawk_oow_t)-1) goto done; + #endif + + /* don't care about output failure */ + sendto (mctx->log.sck, HAWK_MBS_PTR(mctx->log.dmsgbuf), HAWK_MBS_LEN(mctx->log.dmsgbuf), + 0, (struct sockaddr*)&mctx->log.skad, qse_skadsize(&mctx->log.skad)); + } + #endif + } + + rx = 0; + +done: + if (msg) hawk_rtx_freevaloocstr(rtx, hawk_rtx_getarg(rtx, 1), msg); + + retv = hawk_rtx_makeintval(rtx, rx); + if (retv == HAWK_NULL) return -1; + + hawk_rtx_setretval (rtx, retv); + return 0; +} + +/* ------------------------------------------------------------ */ + +typedef struct fnctab_t fnctab_t; +struct fnctab_t +{ + const hawk_ooch_t* name; + hawk_mod_sym_fnc_t info; +}; + +typedef struct inttab_t inttab_t; +struct inttab_t +{ + const hawk_ooch_t* name; + hawk_mod_sym_int_t info; +}; + +static fnctab_t fnctab[] = +{ + /* keep this table sorted for binary search in query(). */ + + { HAWK_T("WCOREDUMP"), { { 1, 1, HAWK_NULL }, fnc_wcoredump, 0 } }, + { HAWK_T("WEXITSTATUS"), { { 1, 1, HAWK_NULL }, fnc_wexitstatus, 0 } }, + { HAWK_T("WIFEXITED"), { { 1, 1, HAWK_NULL }, fnc_wifexited, 0 } }, + { HAWK_T("WIFSIGNALED"), { { 1, 1, HAWK_NULL }, fnc_wifsignaled, 0 } }, + { HAWK_T("WTERMSIG"), { { 1, 1, HAWK_NULL }, fnc_wtermsig, 0 } }, + { HAWK_T("chmod"), { { 2, 2, HAWK_NULL }, fnc_chmod, 0 } }, + { HAWK_T("close"), { { 1, 2, HAWK_NULL }, fnc_close, 0 } }, + { HAWK_T("closedir"), { { 1, 1, HAWK_NULL }, fnc_closedir, 0 } }, + { HAWK_T("closelog"), { { 0, 0, HAWK_NULL }, fnc_closelog, 0 } }, + { HAWK_T("dup"), { { 1, 3, HAWK_NULL }, fnc_dup, 0 } }, + { HAWK_T("errmsg"), { { 0, 0, HAWK_NULL }, fnc_errmsg, 0 } }, + { HAWK_T("fork"), { { 0, 0, HAWK_NULL }, fnc_fork, 0 } }, + { HAWK_T("getegid"), { { 0, 0, HAWK_NULL }, fnc_getegid, 0 } }, + { HAWK_T("getenv"), { { 1, 1, HAWK_NULL }, fnc_getenv, 0 } }, + { HAWK_T("geteuid"), { { 0, 0, HAWK_NULL }, fnc_geteuid, 0 } }, + { HAWK_T("getgid"), { { 0, 0, HAWK_NULL }, fnc_getgid, 0 } }, + { HAWK_T("getnwifcfg"), { { 3, 3, HAWK_T("vvr") }, fnc_getnwifcfg, 0 } }, + { HAWK_T("getpgid"), { { 0, 0, HAWK_NULL }, fnc_getpgid, 0 } }, + { HAWK_T("getpid"), { { 0, 0, HAWK_NULL }, fnc_getpid, 0 } }, + { HAWK_T("getppid"), { { 0, 0, HAWK_NULL }, fnc_getppid, 0 } }, + { HAWK_T("gettid"), { { 0, 0, HAWK_NULL }, fnc_gettid, 0 } }, + { HAWK_T("gettime"), { { 0, 0, HAWK_NULL }, fnc_gettime, 0 } }, + { HAWK_T("getuid"), { { 0, 0, HAWK_NULL }, fnc_getuid, 0 } }, + { HAWK_T("kill"), { { 2, 2, HAWK_NULL }, fnc_kill, 0 } }, + { HAWK_T("mkdir"), { { 1, 2, HAWK_NULL }, fnc_mkdir, 0 } }, + { HAWK_T("mktime"), { { 0, 1, HAWK_NULL }, fnc_mktime, 0 } }, + { HAWK_T("open"), { { 2, 3, HAWK_NULL }, fnc_open, 0 } }, + { HAWK_T("opendir"), { { 1, 2, HAWK_NULL }, fnc_opendir, 0 } }, + { HAWK_T("openfd"), { { 1, 1, HAWK_NULL }, fnc_openfd, 0 } }, + { HAWK_T("openlog"), { { 3, 3, HAWK_NULL }, fnc_openlog, 0 } }, + { HAWK_T("pipe"), { { 2, 3, HAWK_T("rrv") }, fnc_pipe, 0 } }, + { HAWK_T("read"), { { 2, 3, HAWK_T("vrv") }, fnc_read, 0 } }, + { HAWK_T("readdir"), { { 2, 2, HAWK_T("vr") }, fnc_readdir, 0 } }, + { HAWK_T("settime"), { { 1, 1, HAWK_NULL }, fnc_settime, 0 } }, + { HAWK_T("sleep"), { { 1, 1, HAWK_NULL }, fnc_sleep, 0 } }, + { HAWK_T("strftime"), { { 2, 3, HAWK_NULL }, fnc_strftime, 0 } }, + { HAWK_T("system"), { { 1, 1, HAWK_NULL }, fnc_system, 0 } }, + { HAWK_T("systime"), { { 0, 0, HAWK_NULL }, fnc_gettime, 0 } }, /* alias to gettime() */ + { HAWK_T("unlink"), { { 1, 1, HAWK_NULL }, fnc_unlink, 0 } }, + { HAWK_T("wait"), { { 1, 3, HAWK_T("vrv") }, fnc_wait, 0 } }, + { HAWK_T("write"), { { 2, 2, HAWK_NULL }, fnc_write, 0 } }, + { HAWK_T("writelog"), { { 2, 2, HAWK_NULL }, fnc_writelog, 0 } } +}; + +#if !defined(SIGHUP) +# define SIGHUP 1 +#endif +#if !defined(SIGINT) +# define SIGINT 2 +#endif +#if !defined(SIGQUIT) +# define SIGQUIT 3 +#endif +#if !defined(SIGABRT) +# define SIGABRT 6 +#endif +#if !defined(SIGKILL) +# define SIGKILL 9 +#endif +#if !defined(SIGSEGV) +# define SIGSEGV 11 +#endif +#if !defined(SIGALRM) +# define SIGALRM 14 +#endif +#if !defined(SIGTERM) +# define SIGTERM 15 +#endif + +static inttab_t inttab[] = +{ + /* keep this table sorted for binary search in query(). */ + { HAWK_T("C_KEEPFD"), { CLOSE_KEEPFD } }, + + { HAWK_T("DIR_SORT"), { HAWK_DIR_SORT } }, + +#if defined(ENABLE_SYSLOG) + { HAWK_T("LOG_FAC_AUTH"), { LOG_AUTH } }, + { HAWK_T("LOG_FAC_AUTHPRIV"), { LOG_AUTHPRIV } }, + { HAWK_T("LOG_FAC_CRON"), { LOG_CRON } }, + { HAWK_T("LOG_FAC_DAEMON"), { LOG_DAEMON } }, + { HAWK_T("LOG_FAC_FTP"), { LOG_FTP } }, + { HAWK_T("LOG_FAC_KERN"), { LOG_KERN } }, + { HAWK_T("LOG_FAC_LOCAL0"), { LOG_LOCAL0 } }, + { HAWK_T("LOG_FAC_LOCAL1"), { LOG_LOCAL1 } }, + { HAWK_T("LOG_FAC_LOCAL2"), { LOG_LOCAL2 } }, + { HAWK_T("LOG_FAC_LOCAL3"), { LOG_LOCAL3 } }, + { HAWK_T("LOG_FAC_LOCAL4"), { LOG_LOCAL4 } }, + { HAWK_T("LOG_FAC_LOCAL5"), { LOG_LOCAL5 } }, + { HAWK_T("LOG_FAC_LOCAL6"), { LOG_LOCAL6 } }, + { HAWK_T("LOG_FAC_LOCAL7"), { LOG_LOCAL7 } }, + { HAWK_T("LOG_FAC_LPR"), { LOG_LPR } }, + { HAWK_T("LOG_FAC_MAIL"), { LOG_MAIL } }, + { HAWK_T("LOG_FAC_NEWS"), { LOG_NEWS } }, + { HAWK_T("LOG_FAC_SYSLOG"), { LOG_SYSLOG } }, + { HAWK_T("LOG_FAC_USER"), { LOG_USER } }, + { HAWK_T("LOG_FAC_UUCP"), { LOG_UUCP } }, + + { HAWK_T("LOG_OPT_CONS"), { LOG_CONS } }, + { HAWK_T("LOG_OPT_NDELAY"), { LOG_NDELAY } }, + { HAWK_T("LOG_OPT_NOWAIT"), { LOG_NOWAIT } }, + { HAWK_T("LOG_OPT_PID"), { LOG_PID } }, + + { HAWK_T("LOG_PRI_ALERT"), { LOG_ALERT } }, + { HAWK_T("LOG_PRI_CRIT"), { LOG_CRIT } }, + { HAWK_T("LOG_PRI_DEBUG"), { LOG_DEBUG } }, + { HAWK_T("LOG_PRI_EMERG"), { LOG_EMERG } }, + { HAWK_T("LOG_PRI_ERR"), { LOG_ERR } }, + { HAWK_T("LOG_PRI_INFO"), { LOG_INFO } }, + { HAWK_T("LOG_PRI_NOTICE"), { LOG_NOTICE } }, + { HAWK_T("LOG_PRI_WARNING"), { LOG_WARNING } }, +#endif + + { HAWK_T("NWIFCFG_IN4"), { HAWK_NWIFCFG_IN4 } }, + { HAWK_T("NWIFCFG_IN6"), { HAWK_NWIFCFG_IN6 } }, + +#if defined(O_APPEND) + { HAWK_T("O_APPEND"), { O_APPEND } }, +#endif +#if defined(O_ASYNC) + { HAWK_T("O_ASYNC"), { O_ASYNC } }, +#endif +#if defined(O_CLOEXEC) + { HAWK_T("O_CLOEXEC"), { O_CLOEXEC } }, +#endif +#if defined(O_CREAT) + { HAWK_T("O_CREAT"), { O_CREAT } }, +#endif +#if defined(O_DIRECTORY) + { HAWK_T("O_DIRECTORY"), { O_DIRECTORY } }, +#endif +#if defined(O_DSYNC) + { HAWK_T("O_DSYNC"), { O_DSYNC } }, +#endif +#if defined(O_EXCL) + { HAWK_T("O_EXCL"), { O_EXCL } }, +#endif +#if defined(O_NOATIME) + { HAWK_T("O_NOATIME"), { O_NOATIME} }, +#endif +#if defined(O_NOCTTY) + { HAWK_T("O_NOCTTY"), { O_NOCTTY} }, +#endif +#if defined(O_NOFOLLOW) + { HAWK_T("O_NOFOLLOW"), { O_NOFOLLOW } }, +#endif +#if defined(O_NONBLOCK) + { HAWK_T("O_NONBLOCK"), { O_NONBLOCK } }, +#endif +#if defined(O_RDONLY) + { HAWK_T("O_RDONLY"), { O_RDONLY } }, +#endif +#if defined(O_RDWR) + { HAWK_T("O_RDWR"), { O_RDWR } }, +#endif +#if defined(O_SYNC) + { HAWK_T("O_SYNC"), { O_SYNC } }, +#endif +#if defined(O_TRUNC) + { HAWK_T("O_TRUNC"), { O_TRUNC } }, +#endif +#if defined(O_WRONLY) + { HAWK_T("O_WRONLY"), { O_WRONLY } }, +#endif + + { HAWK_T("RC_EAGAIN"), { RC_EAGAIN } }, + { HAWK_T("RC_EBADF"), { RC_EBADF } }, + { HAWK_T("RC_ECHILD"), { RC_ECHILD } }, + { HAWK_T("RC_EEXIST"), { RC_EEXIST } }, + { HAWK_T("RC_EINTR"), { RC_EINTR } }, + { HAWK_T("RC_EINVAL"), { RC_EINVAL } }, + { HAWK_T("RC_ENOENT"), { RC_ENOENT } }, + { HAWK_T("RC_ENOIMPL"), { RC_ENOIMPL } }, + { HAWK_T("RC_ENOMEM"), { RC_ENOMEM } }, + { HAWK_T("RC_ENOTDIR"), { RC_ENOTDIR } }, + { HAWK_T("RC_ENOSYS"), { RC_ENOSYS } }, + { HAWK_T("RC_EPERM"), { RC_EPERM } }, + { HAWK_T("RC_ERROR"), { RC_ERROR } }, + + { HAWK_T("SIGABRT"), { SIGABRT } }, + { HAWK_T("SIGALRM"), { SIGALRM } }, + { HAWK_T("SIGHUP"), { SIGHUP } }, + { HAWK_T("SIGINT"), { SIGINT } }, + { HAWK_T("SIGKILL"), { SIGKILL } }, + { HAWK_T("SIGQUIT"), { SIGQUIT } }, + { HAWK_T("SIGSEGV"), { SIGSEGV } }, + { HAWK_T("SIGTERM"), { SIGTERM } }, + + { HAWK_T("STRFTIME_UTC"), { STRFTIME_UTC } }, + + { HAWK_T("WNOHANG"), { WNOHANG } } +}; + +static int query (hawk_mod_t* mod, hawk_t* awk, const hawk_ooch_t* name, hawk_mod_sym_t* sym) +{ + hawk_oocs_t ea; + int left, right, mid, n; + + left = 0; right = HAWK_COUNTOF(fnctab) - 1; + + while (left <= right) + { + mid = left + (right - left) / 2; + + n = qse_strcmp (fnctab[mid].name, name); + if (n > 0) right = mid - 1; + else if (n < 0) left = mid + 1; + else + { + sym->type = HAWK_MOD_FNC; + sym->u.fnc = fnctab[mid].info; + return 0; + } + } + + left = 0; right = HAWK_COUNTOF(inttab) - 1; + while (left <= right) + { + mid = left + (right - left) / 2; + + n = qse_strcmp (inttab[mid].name, name); + if (n > 0) right = mid - 1; + else if (n < 0) left = mid + 1; + else + { + sym->type = HAWK_MOD_INT; + sym->u.in = inttab[mid].info; + return 0; + } + } + + ea.ptr = (hawk_ooch_t*)name; + ea.len = hawk_count_oocstr(name); + hawk_seterror (awk, HAWK_ENOENT, &ea, HAWK_NULL); + return -1; +} + +/* TODO: proper resource management */ + +static int init (hawk_mod_t* mod, hawk_rtx_t* rtx) +{ + mod_ctx_t* mctx = (mod_ctx_t*)mod->ctx; + rtx_data_t data; + + mctx->log.type = SYSLOG_LOCAL; + mctx->log.syslog_opened = 0; + mctx->log.sck = -1; + + HAWK_MEMSET (&data, 0, HAWK_SIZEOF(data)); + if (hawk_rbt_insert(mctx->rtxtab, &rtx, HAWK_SIZEOF(rtx), &data, HAWK_SIZEOF(data)) == HAWK_NULL) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + + return 0; +} + +static void fini (hawk_mod_t* mod, hawk_rtx_t* rtx) +{ + /* TODO: + for (each pid for rtx) kill (pid, SIGKILL); + for (each pid for rtx) waitpid (pid, HAWK_NULL, 0); + */ + + mod_ctx_t* mctx = (mod_ctx_t*)mod->ctx; + hawk_rbt_pair_t* pair; + + /* garbage clean-up */ + pair = hawk_rbt_search(mctx->rtxtab, &rtx, HAWK_SIZEOF(rtx)); + if (pair) + { + rtx_data_t* data; + sys_node_t* sys_node, * sys_next; + + data = (rtx_data_t*)HAWK_RBT_VPTR(pair); + + sys_node = data->sys_list.head; + while (sys_node) + { + sys_next = sys_node->next; + free_sys_node (rtx, &data->sys_list, sys_node); + sys_node = sys_next; + } + + if (data->sys_list.ctx.readbuf) + { + hawk_rtx_freemem (rtx, data->sys_list.ctx.readbuf); + data->sys_list.ctx.readbuf = HAWK_NULL; + data->sys_list.ctx.readbuf_capa = 0; + } + hawk_rbt_delete (mctx->rtxtab, &rtx, HAWK_SIZEOF(rtx)); + } + + +#if defined(ENABLE_SYSLOG) + if (mctx->log.syslog_opened) + { + /* closelog() only if openlog() has been called explicitly. + * if you call writelog() functions without openlog() and + * end yoru program without closelog(), the program may leak + * some resources created by the writelog() function. (e.g. + * socket to /dev/log) */ + closelog (); + mctx->log.syslog_opened = 0; + } +#endif + + if (mctx->log.sck >= 0) + { + #if defined(_WIN32) + /* TODO: implement this */ + #else + close (mctx->log.sck); + #endif + mctx->log.sck = -1; + } + + if (mctx->log.dmsgbuf) + { + qse_mbs_close (mctx->log.dmsgbuf); + mctx->log.dmsgbuf = HAWK_NULL; + } + + if (mctx->log.ident) + { + hawk_rtx_freemem (rtx, mctx->log.ident); + mctx->log.ident = HAWK_NULL; + } +} + +static void unload (hawk_mod_t* mod, hawk_t* awk) +{ + mod_ctx_t* mctx = (mod_ctx_t*)mod->ctx; + + HAWK_ASSERT (HAWK_RBT_SIZE(mctx->rtxtab) == 0); + hawk_rbt_close (mctx->rtxtab); + + hawk_freemem (awk, mctx); +} + +int hawk_mod_sys (hawk_mod_t* mod, hawk_t* awk) +{ + hawk_rbt_t* rbt; + + mod->query = query; + mod->unload = unload; + + mod->init = init; + mod->fini = fini; + + mod->ctx = hawk_callocmem(awk, HAWK_SIZEOF(mod_ctx_t)); + if (!mod->ctx) return -1; + + rbt = hawk_rbt_open(hawk_getmmgr(awk), 0, 1, 1); + if (rbt == HAWK_NULL) + { + hawk_freemem (awk, mod->ctx); + hawk_seterrnum (awk, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + hawk_rbt_setstyle (rbt, hawk_get_rbt_style(HAWK_RBT_STYLE_INLINE_COPIERS)); + + ((mod_ctx_t*)mod->ctx)->rtxtab = rbt; + return 0; +} diff --git a/hawk/lib/mod-sys.h b/hawk/lib/mod-sys.h new file mode 100644 index 00000000..46ebbe4c --- /dev/null +++ b/hawk/lib/mod-sys.h @@ -0,0 +1,43 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_LIB_MOD_SYS_H_ +#define _HAWK_LIB_MOD_SYS_H_ + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +HAWK_EXPORT int hawk_mod_sys (hawk_mod_t* mod, hawk_t* awk); + +#if defined(__cplusplus) +} +#endif + +#endif + diff --git a/hawk/lib/mtx.c b/hawk/lib/mtx.c new file mode 100644 index 00000000..62885520 --- /dev/null +++ b/hawk/lib/mtx.c @@ -0,0 +1,282 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include "hawk-prv.h" + +#if (!defined(__unix__) && !defined(__unix)) || defined(HAVE_PTHREAD) + +#if defined(_WIN32) +# include +# include + +#elif defined(__OS2__) +# define INCL_DOSSEMAPHORES +# define INCL_DOSERRORS +# include + +#elif defined(__DOS__) + /* implement this */ + +#elif defined(__BEOS__) +# include + +#else +# if defined(AIX) && defined(__GNUC__) + typedef int crid_t; + typedef unsigned int class_id_t; +# endif +# include +#endif + +hawk_mtx_t* hawk_mtx_open (hawk_t* hawk, hawk_oow_t xtnsize) +{ + hawk_mtx_t* mtx; + + mtx = (hawk_mtx_t*)hawk_allocmem(hawk, HAWK_SIZEOF(hawk_mtx_t) + xtnsize); + if (mtx) + { + if (hawk_mtx_init(mtx, hawk) <= -1) + { + hawk_freemem (hawk, mtx); + return HAWK_NULL; + } + else HAWK_MEMSET (mtx + 1, 0, xtnsize); + } + + return mtx; +} + +void hawk_mtx_close (hawk_mtx_t* mtx) +{ + hawk_mtx_fini (mtx); + hawk_freemem (mtx->hawk, mtx); +} + +int hawk_mtx_init (hawk_mtx_t* mtx, hawk_t* hawk) +{ + HAWK_MEMSET (mtx, 0, HAWK_SIZEOF(*mtx)); + mtx->hawk = hawk; + +#if defined(_WIN32) + mtx->hnd = CreateMutex(HAWK_NULL, FALSE, HAWK_NULL); + if (mtx->hnd == HAWK_NULL) return -1; + +#elif defined(__OS2__) + + { + APIRET rc; + HMTX m; + + rc = DosCreateMutexSem(HAWK_NULL, &m, DC_SEM_SHARED, FALSE); + if (rc != NO_ERROR) return -1; + + mtx->hnd = m; + } + +#elif defined(__DOS__) +# error not implemented + +#elif defined(__BEOS__) + mtx->hnd = create_sem(1, HAWK_NULL); + if (mtx->hnd < B_OK) return -1; + +#else + /* + hawk_ensure (pthread_mutexattr_init (&attr) == 0); + if (pthread_mutexattr_settype (&attr, type) != 0) + { + int num = hawk_geterrno(); + pthread_mutexattr_destroy (&attr); + if (mtx->__dynamic) hawk_free (mtx); + hawk_seterrno (num); + return HAWK_NULL; + } + hawk_ensure (pthread_mutex_init (&mtx->hnd, &attr) == 0); + hawk_ensure (pthread_mutexattr_destroy (&attr) == 0); + */ + if (pthread_mutex_init((pthread_mutex_t*)&mtx->hnd, HAWK_NULL) != 0) return -1; +#endif + + return 0; +} + +void hawk_mtx_fini (hawk_mtx_t* mtx) +{ +#if defined(_WIN32) + CloseHandle (mtx->hnd); + +#elif defined(__OS2__) + DosCloseMutexSem (mtx->hnd); + +#elif defined(__DOS__) +# error not implemented + +#elif defined(__BEOS__) + /*if (delete_sem(mtx->hnd) != B_NO_ERROR) return -1;*/ + delete_sem(mtx->hnd); + +#else + pthread_mutex_destroy ((pthread_mutex_t*)&mtx->hnd); +#endif +} + +int hawk_mtx_lock (hawk_mtx_t* mtx, const hawk_ntime_t* waiting_time) +{ +#if defined(_WIN32) + /* + * MSDN + * WAIT_ABANDONED The specified object is a mutex object that was + * not released by the thread that owned the mutex + * object before the owning thread terminated. + * Ownership of the mutex object is granted to the + * calling thread, and the mutex is set to nonsignaled. + * WAIT_OBJECT_0 The state of the specified object is signaled. + * WAIT_TIMEOUT The time-out interval elapsed, and the object's + * state is nonsignaled. + * WAIT_FAILED An error occurred + */ + if (waiting_time) + { + DWORD msec; + msec = HAWK_SECNSEC_TO_MSEC(waiting_time->sec, waiting_time->nsec); + if (WaitForSingleObject(mtx->hnd, msec) != WAIT_OBJECT_0) return -1; + } + else + { + if (WaitForSingleObject(mtx->hnd, INFINITE) == WAIT_FAILED) return -1; + } + +#elif defined(__OS2__) + if (waiting_time) + { + ULONG msec; + msec = HAWK_SECNSEC_TO_MSEC(waiting_time->sec, waiting_time->nsec); + if (DosRequestMutexSem(mtx->hnd, msec) != NO_ERROR) return -1; + } + else + { + if (DosRequestMutexSem(mtx->hnd, SEM_INDEFINITE_WAIT) != NO_ERROR) return -1; + } + +#elif defined(__DOS__) + + /* nothing to do */ + +#elif defined(__BEOS__) + if (waiting_time) + { + /* TODO: check for B_WOULD_BLOCK */ + /*if (acquire_sem_etc(mtx->hnd, 1, B_ABSOLUTE_TIMEOUT, 0) != B_NO_ERROR) return -1;*/ + bigtime_t usec; + usec = HAWK_SECNSEC_TO_USEC(waiting_time->sec, waiting_time->nsec); + if (acquire_sem_etc(mtx->hnd, 1, B_TIMEOUT, usec) != B_NO_ERROR) return -1; + } + else + { + if (acquire_sem(mtx->hnd) != B_NO_ERROR) return -1; + } + +#else + + /* if pthread_mutex_timedlock() isn't available, don't honor the waiting time. */ + #if defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK) + if (waiting_time) + { + hawk_ntime_t t; + struct timespec ts; + + hawk_get_time (&t); + hawk_add_time (&t, waiting_time, &t); + + ts.tv_sec = t.sec; + ts.tv_nsec = t.nsec; + if (pthread_mutex_timedlock((pthread_mutex_t*)&mtx->hnd, &ts) != 0) return -1; + } + else + { + #endif + if (pthread_mutex_lock((pthread_mutex_t*)&mtx->hnd) != 0) return -1; + + #if defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK) + } + #endif +#endif + + return 0; +} + +int hawk_mtx_unlock (hawk_mtx_t* mtx) +{ +#if defined(_WIN32) + if (ReleaseMutex (mtx->hnd) == FALSE) return -1; + +#elif defined(__OS2__) + if (DosReleaseMutexSem (mtx->hnd) != NO_ERROR) return -1; + +#elif defined(__DOS__) + + /* nothing to do */ + +#elif defined(__BEOS__) + if (release_sem(mtx->hnd) != B_NO_ERROR) return -1; + +#else + if (pthread_mutex_unlock ((pthread_mutex_t*)&mtx->hnd) != 0) return -1; +#endif + return 0; +} + +int hawk_mtx_trylock (hawk_mtx_t* mtx) +{ +#if defined(_WIN32) + if (WaitForSingleObject(mtx->hnd, 0) != WAIT_OBJECT_0) return -1; +#elif defined(__OS2__) + if (DosRequestMutexSem(mtx->hnd, 0) != NO_ERROR) return -1; +#elif defined(__DOS__) + /* nothing to do */ +#elif defined(__BEOS__) + if (acquire_sem_etc(mtx->hnd, 1, B_TIMEOUT, 0) != B_NO_ERROR) return -1; +#else + #if defined(HAVE_PTHREAD_MUTEX_TRYLOCK) + if (pthread_mutex_trylock((pthread_mutex_t*)&mtx->hnd) != 0) return -1; + #elif defined(HAVE_PTHREAD_MUTEX_TIMEDLOCK) + hawk_ntime_t t; + struct timespec ts; + + hawk_gettime (&t); + ts.tv_sec = t.sec; + ts.tv_nsec = t.nsec; + if (pthread_mutex_timedlock((pthread_mutex_t*)&mtx->hnd, &ts) != 0) return -1; + #else + /* not supported. fallback to normal pthread_mutex_lock(). <--- is this really desirable? */ + if (pthread_mutex_lock((pthread_mutex_t*)&mtx->hnd) != 0) return -1; + #endif +#endif + return 0; +} + +#endif diff --git a/hawk/lib/parse-prv.h b/hawk/lib/parse-prv.h new file mode 100644 index 00000000..895879b6 --- /dev/null +++ b/hawk/lib/parse-prv.h @@ -0,0 +1,103 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_PARSE_PRV_H_ +#define _HAWK_PARSE_PRV_H_ + +/* these enums should match kwtab in parse.c */ +enum hawk_kwid_t +{ + HAWK_KWID_XABORT, + HAWK_KWID_XGLOBAL, + HAWK_KWID_XINCLUDE, + HAWK_KWID_XINCLUDE_ONCE, + HAWK_KWID_XLOCAL, + HAWK_KWID_XPRAGMA, + HAWK_KWID_XRESET, + HAWK_KWID_BEGIN, + HAWK_KWID_END, + HAWK_KWID_BREAK, + HAWK_KWID_CONTINUE, + HAWK_KWID_DELETE, + HAWK_KWID_DO, + HAWK_KWID_ELSE, + HAWK_KWID_EXIT, + HAWK_KWID_FOR, + HAWK_KWID_FUNCTION, + HAWK_KWID_GETLINE, + HAWK_KWID_IF, + HAWK_KWID_IN, + HAWK_KWID_NEXT, + HAWK_KWID_NEXTFILE, + HAWK_KWID_NEXTOFILE, + HAWK_KWID_PRINT, + HAWK_KWID_PRINTF, + HAWK_KWID_RETURN, + HAWK_KWID_WHILE +}; + +typedef enum hawk_kwid_t hawk_kwid_t; + +#if defined(__cplusplus) +extern "C" { +#endif + +int hawk_putsroocs ( + hawk_t* awk, + const hawk_ooch_t* str +); + +int hawk_putsroocsn ( + hawk_t* awk, + const hawk_ooch_t* str, + hawk_oow_t len +); + +const hawk_ooch_t* hawk_getgblname ( + hawk_t* awk, + hawk_oow_t idx, + hawk_oow_t* len +); + +void hawk_getkwname ( + hawk_t* awk, + hawk_kwid_t id, + hawk_oocs_t* s +); + +int hawk_initgbls ( + hawk_t* awk +); + +void hawk_clearsionames ( + hawk_t* awk +); + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/hawk/lib/parse.c b/hawk/lib/parse.c new file mode 100644 index 00000000..bc350847 --- /dev/null +++ b/hawk/lib/parse.c @@ -0,0 +1,7250 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "hawk-prv.h" + +#if !defined(HAWK_DEFAULT_MODPREFIX) +# if defined(_WIN32) +# define HAWK_DEFAULT_MODPREFIX "hawkawk-" +# elif defined(__OS2__) +# define HAWK_DEFAULT_MODPREFIX "awk-" +# elif defined(__DOS__) +# define HAWK_DEFAULT_MODPREFIX "awk-" +# else +# define HAWK_DEFAULT_MODPREFIX "libhawkawk-" +# endif +#endif + +#if !defined(HAWK_DEFAULT_MODPOSTFIX) +# define HAWK_DEFAULT_MODPOSTFIX "" +#endif + +enum tok_t +{ + TOK_EOF, + TOK_NEWLINE, + + /* TOK_XXX_ASSNs should be in sync with assop in assign_to_opcode. + * it also should be in the order as hawk_assop_type_t in run.h */ + TOK_ASSN, + TOK_PLUS_ASSN, + TOK_MINUS_ASSN, + TOK_MUL_ASSN, + TOK_DIV_ASSN, + TOK_IDIV_ASSN, + TOK_MOD_ASSN, + TOK_EXP_ASSN, /* ^ - exponentiation */ + TOK_CONCAT_ASSN, + TOK_RS_ASSN, + TOK_LS_ASSN, + TOK_BAND_ASSN, + TOK_BXOR_ASSN, + TOK_BOR_ASSN, + /* end of TOK_XXX_ASSN */ + + TOK_TEQ, + TOK_TNE, + TOK_EQ, + TOK_NE, + TOK_LE, + TOK_LT, + TOK_GE, + TOK_GT, + TOK_MA, /* ~ - match */ + TOK_NM, /* !~ - not match */ + TOK_LNOT, /* ! - logical negation */ + TOK_PLUS, + TOK_PLUSPLUS, + TOK_MINUS, + TOK_MINUSMINUS, + TOK_MUL, + TOK_DIV, + TOK_IDIV, + TOK_MOD, + TOK_LOR, + TOK_LAND, + TOK_BOR, + TOK_BXOR, /* ^^ - bitwise-xor */ + TOK_BAND, + TOK_BNOT, /* ~~ - used for unary bitwise-not */ + TOK_RS, + TOK_LS, + TOK_IN, + TOK_EXP, + TOK_CONCAT, /* %% */ + + TOK_LPAREN, + TOK_RPAREN, + TOK_LBRACE, + TOK_RBRACE, + TOK_LBRACK, + TOK_RBRACK, + + TOK_DOLLAR, + TOK_COMMA, + TOK_SEMICOLON, + TOK_COLON, + TOK_DBLCOLON, + TOK_QUEST, + /*TOK_DBLAT,*/ + + /* == begin reserved words == */ + /* === extended reserved words === */ + TOK_XGLOBAL, + TOK_XLOCAL, + TOK_XINCLUDE, + TOK_XINCLUDE_ONCE, + TOK_XPRAGMA, + TOK_XABORT, + TOK_XRESET, + + /* === normal reserved words === */ + TOK_BEGIN, + TOK_END, + TOK_FUNCTION, + + TOK_IF, + TOK_ELSE, + TOK_WHILE, + TOK_FOR, + TOK_DO, + TOK_BREAK, + TOK_CONTINUE, + TOK_RETURN, + TOK_EXIT, + TOK_DELETE, + TOK_NEXT, + TOK_NEXTFILE, + TOK_NEXTOFILE, + + TOK_PRINT, + TOK_PRINTF, + TOK_GETLINE, + /* == end reserved words == */ + + TOK_IDENT, + TOK_INT, + TOK_FLT, + TOK_STR, + TOK_MBS, + TOK_REX, + + __TOKEN_COUNT__ +}; + +enum +{ + PARSE_GBL, + PARSE_FUNCTION, + PARSE_BEGIN, + PARSE_END, + PARSE_BEGIN_BLOCK, + PARSE_END_BLOCK, + PARSE_PATTERN, + PARSE_ACTION_BLOCK +}; + +enum +{ + PARSE_LOOP_NONE, + PARSE_LOOP_WHILE, + PARSE_LOOP_FOR, + PARSE_LOOP_DOWHILE +}; + +typedef struct binmap_t binmap_t; + +struct binmap_t +{ + int token; + int binop; +}; + +static int parse_progunit (hawk_t* awk); +static hawk_t* collect_globals (hawk_t* awk); +static void adjust_static_globals (hawk_t* awk); +static hawk_oow_t find_global (hawk_t* awk, const hawk_oocs_t* name); +static hawk_t* collect_locals (hawk_t* awk, hawk_oow_t nlcls, int istop); + +static hawk_nde_t* parse_function (hawk_t* awk); +static hawk_nde_t* parse_begin (hawk_t* awk); +static hawk_nde_t* parse_end (hawk_t* awk); +static hawk_chain_t* parse_action_block (hawk_t* awk, hawk_nde_t* ptn, int blockless); + +static hawk_nde_t* parse_block_dc (hawk_t* awk, const hawk_loc_t* xloc, int istop); + +static hawk_nde_t* parse_statement (hawk_t* awk, const hawk_loc_t* xloc); + +static hawk_nde_t* parse_expr_withdc (hawk_t* awk, const hawk_loc_t* xloc); + +static hawk_nde_t* parse_logical_or (hawk_t* awk, const hawk_loc_t* xloc); +static hawk_nde_t* parse_logical_and (hawk_t* awk, const hawk_loc_t* xloc); +static hawk_nde_t* parse_in (hawk_t* awk, const hawk_loc_t* xloc); +static hawk_nde_t* parse_regex_match (hawk_t* awk, const hawk_loc_t* xloc); +static hawk_nde_t* parse_bitwise_or (hawk_t* awk, const hawk_loc_t* xloc); +static hawk_nde_t* parse_bitwise_xor (hawk_t* awk, const hawk_loc_t* xloc); +static hawk_nde_t* parse_bitwise_and (hawk_t* awk, const hawk_loc_t* xloc); +static hawk_nde_t* parse_equality (hawk_t* awk, const hawk_loc_t* xloc); +static hawk_nde_t* parse_relational (hawk_t* awk, const hawk_loc_t* xloc); +static hawk_nde_t* parse_shift (hawk_t* awk, const hawk_loc_t* xloc); +static hawk_nde_t* parse_concat (hawk_t* awk, const hawk_loc_t* xloc); +static hawk_nde_t* parse_additive (hawk_t* awk, const hawk_loc_t* xloc); +static hawk_nde_t* parse_multiplicative (hawk_t* awk, const hawk_loc_t* xloc); + +static hawk_nde_t* parse_unary (hawk_t* awk, const hawk_loc_t* xloc); +static hawk_nde_t* parse_exponent (hawk_t* awk, const hawk_loc_t* xloc); +static hawk_nde_t* parse_unary_exp (hawk_t* awk, const hawk_loc_t* xloc); +static hawk_nde_t* parse_increment (hawk_t* awk, const hawk_loc_t* xloc); +static hawk_nde_t* parse_primary (hawk_t* awk, const hawk_loc_t* xloc); +static hawk_nde_t* parse_primary_ident (hawk_t* awk, const hawk_loc_t* xloc); +static hawk_nde_t* parse_hashidx (hawk_t* awk, const hawk_oocs_t* name, const hawk_loc_t* xloc); + +#define FNCALL_FLAG_NOARG (1 << 0) /* no argument */ +#define FNCALL_FLAG_VAR (1 << 1) +static hawk_nde_t* parse_fncall (hawk_t* awk, const hawk_oocs_t* name, hawk_fnc_t* fnc, const hawk_loc_t* xloc, int flags); + +static hawk_nde_t* parse_primary_ident_segs (hawk_t* awk, const hawk_loc_t* xloc, const hawk_oocs_t* full, const hawk_oocs_t segs[], int nsegs); + +static int get_token (hawk_t* awk); +static int preget_token (hawk_t* awk); +static int get_rexstr (hawk_t* awk, hawk_tok_t* tok); + +static int skip_spaces (hawk_t* awk); +static int skip_comment (hawk_t* awk); +static int classify_ident (hawk_t* awk, const hawk_oocs_t* name); + +static int deparse (hawk_t* awk); +static hawk_htb_walk_t deparse_func (hawk_htb_t* map, hawk_htb_pair_t* pair, void* arg); +static int put_char (hawk_t* awk, hawk_ooch_t c); +static int flush_out (hawk_t* awk); + +static hawk_mod_t* query_module ( + hawk_t* awk, const hawk_oocs_t segs[], int nsegs, + hawk_mod_sym_t* sym); + +typedef struct kwent_t kwent_t; + +struct kwent_t +{ + hawk_oocs_t name; + int type; + int trait; /* the entry is valid when this option is set */ +}; + +static kwent_t kwtab[] = +{ + /* keep this table in sync with the kw_t enums in . + * also keep it sorted by the first field for binary search */ + { { HAWK_T("@abort"), 6 }, TOK_XABORT, 0 }, + { { HAWK_T("@global"), 7 }, TOK_XGLOBAL, 0 }, + { { HAWK_T("@include"), 8 }, TOK_XINCLUDE, 0 }, + { { HAWK_T("@include_once"), 13 }, TOK_XINCLUDE_ONCE, 0 }, + { { HAWK_T("@local"), 6 }, TOK_XLOCAL, 0 }, + { { HAWK_T("@pragma"), 7 }, TOK_XPRAGMA, 0 }, + { { HAWK_T("@reset"), 6 }, TOK_XRESET, 0 }, + { { HAWK_T("BEGIN"), 5 }, TOK_BEGIN, HAWK_PABLOCK }, + { { HAWK_T("END"), 3 }, TOK_END, HAWK_PABLOCK }, + { { HAWK_T("break"), 5 }, TOK_BREAK, 0 }, + { { HAWK_T("continue"), 8 }, TOK_CONTINUE, 0 }, + { { HAWK_T("delete"), 6 }, TOK_DELETE, 0 }, + { { HAWK_T("do"), 2 }, TOK_DO, 0 }, + { { HAWK_T("else"), 4 }, TOK_ELSE, 0 }, + { { HAWK_T("exit"), 4 }, TOK_EXIT, 0 }, + { { HAWK_T("for"), 3 }, TOK_FOR, 0 }, + { { HAWK_T("function"), 8 }, TOK_FUNCTION, 0 }, + { { HAWK_T("getline"), 7 }, TOK_GETLINE, HAWK_RIO }, + { { HAWK_T("if"), 2 }, TOK_IF, 0 }, + { { HAWK_T("in"), 2 }, TOK_IN, 0 }, + { { HAWK_T("next"), 4 }, TOK_NEXT, HAWK_PABLOCK }, + { { HAWK_T("nextfile"), 8 }, TOK_NEXTFILE, HAWK_PABLOCK }, + { { HAWK_T("nextofile"), 9 }, TOK_NEXTOFILE, HAWK_PABLOCK | HAWK_NEXTOFILE }, + { { HAWK_T("print"), 5 }, TOK_PRINT, HAWK_RIO }, + { { HAWK_T("printf"), 6 }, TOK_PRINTF, HAWK_RIO }, + { { HAWK_T("return"), 6 }, TOK_RETURN, 0 }, + { { HAWK_T("while"), 5 }, TOK_WHILE, 0 } +}; + +typedef struct global_t global_t; + +struct global_t +{ + const hawk_ooch_t* name; + hawk_oow_t namelen; + int trait; +}; + +static global_t gtab[] = +{ + /* + * this table must match the order of the hawk_gbl_id_t enumerators + */ + + /* output real-to-str conversion format for other cases than 'print' */ + { HAWK_T("CONVFMT"), 7, 0 }, + + /* current input file name */ + { HAWK_T("FILENAME"), 8, HAWK_PABLOCK }, + + /* input record number in current file */ + { HAWK_T("FNR"), 3, HAWK_PABLOCK }, + + /* input field separator */ + { HAWK_T("FS"), 2, 0 }, + + /* ignore case in string comparison */ + { HAWK_T("IGNORECASE"), 10, 0 }, + + /* number of fields in current input record + * NF is also updated if you assign a value to $0. so it is not + * associated with HAWK_PABLOCK */ + { HAWK_T("NF"), 2, 0 }, + + /* input record number */ + { HAWK_T("NR"), 2, HAWK_PABLOCK }, + + /* current output file name */ + { HAWK_T("OFILENAME"), 9, HAWK_PABLOCK | HAWK_NEXTOFILE }, + + /* output real-to-str conversion format for 'print' */ + { HAWK_T("OFMT"), 4, HAWK_RIO }, + + /* output field separator for 'print' */ + { HAWK_T("OFS"), 3, HAWK_RIO }, + + /* output record separator. used for 'print' and blockless output */ + { HAWK_T("ORS"), 3, HAWK_RIO }, + + { HAWK_T("RLENGTH"), 7, 0 }, + { HAWK_T("RS"), 2, 0 }, + + { HAWK_T("RSTART"), 6, 0 }, + + /* it decides the field construction behavior when FS is a regular expression and + * the field splitter is composed of whitespaces only. e.g) FS="[ \t]*"; + * if set to a non-zero value, remove leading spaces and trailing spaces off a record + * before field splitting. + * if set to zero, leading spaces and trailing spaces result in 1 empty field respectively. + * if not set, the behavior is dependent on the awk->opt.trait & HAWK_STRIPRECSPC */ + { HAWK_T("STRIPRECSPC"), 11, 0 }, + + { HAWK_T("SUBSEP"), 6, 0 } +}; + +#define GET_CHAR(awk) \ + do { if (get_char(awk) <= -1) return -1; } while(0) + +#define GET_CHAR_TO(awk,c) \ + do { \ + if (get_char(awk) <= -1) return -1; \ + c = (awk)->sio.last.c; \ + } while(0) + +#define SET_TOKEN_TYPE(awk,tok,code) \ + do { (tok)->type = (code); } while (0) + +#define ADD_TOKEN_CHAR(awk,tok,c) \ + do { \ + if (hawk_ooecs_ccat((tok)->name,(c)) == (hawk_oow_t)-1) \ + { \ + hawk_seterror (awk, HAWK_ENOMEM, HAWK_NULL, &(tok)->loc); \ + return -1; \ + } \ + } while (0) + +#define ADD_TOKEN_STR(awk,tok,s,l) \ + do { \ + if (hawk_ooecs_ncat((tok)->name,(s),(l)) == (hawk_oow_t)-1) \ + { \ + hawk_seterror (awk, HAWK_ENOMEM, HAWK_NULL, &(tok)->loc); \ + return -1; \ + } \ + } while (0) + +#if defined(HAWK_OOCH_IS_BCH) + +# define ADD_TOKEN_UINT32(awk,tok,c) \ + do { \ + if (c <= 0xFF) ADD_TOKEN_CHAR(awk, tok, c); \ + else \ + { \ + hawk_bch_t __xbuf[HAWK_MBLEN_MAX + 1]; \ + hawk_oow_t __len, __i; \ + __len = hawk_uctoutf8(c, __xbuf, HAWK_COUNTOF(__xbuf)); /* use utf8 all the time */ \ + for (__i = 0; __i < __len; __i++) ADD_TOKEN_CHAR(awk, tok, __xbuf[__i]); \ + } \ + } while (0) +#else +# define ADD_TOKEN_UINT32(awk,tok,c) ADD_TOKEN_CHAR(awk,tok,c); +#endif + +#define MATCH(awk,tok_type) ((awk)->tok.type == (tok_type)) +#define MATCH_RANGE(awk,tok_type_start,tok_type_end) ((awk)->tok.type >= (tok_type_start) && (awk)->tok.type <= (tok_type_end)) + +#define MATCH_TERMINATOR_NORMAL(awk) \ + (MATCH((awk),TOK_SEMICOLON) || MATCH((awk),TOK_NEWLINE)) + +#define MATCH_TERMINATOR_RBRACE(awk) \ + ((awk->opt.trait & HAWK_NEWLINE) && MATCH((awk),TOK_RBRACE)) + +#define MATCH_TERMINATOR(awk) \ + (MATCH_TERMINATOR_NORMAL(awk) || MATCH_TERMINATOR_RBRACE(awk)) + +#define ISNOERR(awk) ((awk)->_gem.errnum == HAWK_ENOERR) + +#define CLRERR(awk) \ + hawk_seterror (awk, HAWK_ENOERR, HAWK_NULL, HAWK_NULL) + +#define SETERR_TOK(awk,code) \ + hawk_seterror (awk, code, HAWK_OOECS_OOCS((awk)->tok.name), &(awk)->tok.loc) + +#define SETERR_COD(awk,code) \ + hawk_seterror (awk, code, HAWK_NULL, HAWK_NULL) + +#define SETERR_LOC(awk,code,loc) \ + hawk_seterror (awk, code, HAWK_NULL, loc) + +#define SETERR_ARG_LOC(awk,code,ep,el,loc) \ + do { \ + hawk_oocs_t __ea; \ + __ea.len = (el); __ea.ptr = (ep); \ + hawk_seterror ((awk), (code), &__ea, (loc)); \ + } while (0) + +#define SETERR_ARG(awk,code,ep,el) SETERR_ARG_LOC(awk,code,ep,el,HAWK_NULL) + +#define ADJERR_LOC(rtx,l) do { (awk)->errloc = *(l); } while (0) + +static HAWK_INLINE int is_plain_var (hawk_nde_t* nde) +{ + return nde->type == HAWK_NDE_GBL || + nde->type == HAWK_NDE_LCL || + nde->type == HAWK_NDE_ARG || + nde->type == HAWK_NDE_NAMED; +} + +static HAWK_INLINE int is_var (hawk_nde_t* nde) +{ + return nde->type == HAWK_NDE_GBL || + nde->type == HAWK_NDE_LCL || + nde->type == HAWK_NDE_ARG || + nde->type == HAWK_NDE_NAMED || + nde->type == HAWK_NDE_GBLIDX || + nde->type == HAWK_NDE_LCLIDX || + nde->type == HAWK_NDE_ARGIDX || + nde->type == HAWK_NDE_NAMEDIDX; +} + +static int get_char (hawk_t* awk) +{ + hawk_ooi_t n; + + if (awk->sio.nungots > 0) + { + /* there are something in the unget buffer */ + awk->sio.last = awk->sio.ungot[--awk->sio.nungots]; + return 0; + } + + if (awk->sio.inp->b.pos >= awk->sio.inp->b.len) + { + CLRERR (awk); + n = awk->sio.inf ( + awk, HAWK_SIO_CMD_READ, awk->sio.inp, + awk->sio.inp->b.buf, HAWK_COUNTOF(awk->sio.inp->b.buf) + ); + if (n <= -1) + { + if (ISNOERR(awk)) + SETERR_ARG (awk, HAWK_EREAD, HAWK_T(""), 5); + return -1; + } + + if (n == 0) + { + awk->sio.inp->last.c = HAWK_OOCI_EOF; + awk->sio.inp->last.line = awk->sio.inp->line; + awk->sio.inp->last.colm = awk->sio.inp->colm; + awk->sio.inp->last.file = awk->sio.inp->name; + awk->sio.last = awk->sio.inp->last; + return 0; + } + + awk->sio.inp->b.pos = 0; + awk->sio.inp->b.len = n; + } + + if (awk->sio.inp->last.c == HAWK_T('\n')) + { + /* if the previous charater was a newline, + * increment the line counter and reset column to 1. + * incrementing it line number here instead of + * updating inp->last causes the line number for + * TOK_EOF to be the same line as the last newline. */ + awk->sio.inp->line++; + awk->sio.inp->colm = 1; + } + + awk->sio.inp->last.c = awk->sio.inp->b.buf[awk->sio.inp->b.pos++]; + awk->sio.inp->last.line = awk->sio.inp->line; + awk->sio.inp->last.colm = awk->sio.inp->colm++; + awk->sio.inp->last.file = awk->sio.inp->name; + awk->sio.last = awk->sio.inp->last; + return 0; +} + +static void unget_char (hawk_t* awk, const hawk_sio_lxc_t* c) +{ + /* Make sure that the unget buffer is large enough */ + HAWK_ASSERT (awk, awk->sio.nungots < HAWK_COUNTOF(awk->sio.ungot)); + awk->sio.ungot[awk->sio.nungots++] = *c; +} + +const hawk_ooch_t* hawk_getgblname (hawk_t* awk, hawk_oow_t idx, hawk_oow_t* len) +{ + HAWK_ASSERT (awk, idx < HAWK_ARR_SIZE(awk->parse.gbls)); + + *len = HAWK_ARR_DLEN(awk->parse.gbls,idx); + return HAWK_ARR_DPTR(awk->parse.gbls,idx); +} + +void hawk_getkwname (hawk_t* awk, hawk_kwid_t id, hawk_oocs_t* s) +{ + *s = kwtab[id].name; +} + +static int parse (hawk_t* awk) +{ + int ret = -1; + hawk_ooi_t op; + + HAWK_ASSERT (awk, awk->sio.inf != HAWK_NULL); + + CLRERR (awk); + op = awk->sio.inf(awk, HAWK_SIO_CMD_OPEN, awk->sio.inp, HAWK_NULL, 0); + if (op <= -1) + { + /* cannot open the source file. + * it doesn't even have to call CLOSE */ + if (ISNOERR(awk)) + SETERR_ARG (awk, HAWK_EOPEN, HAWK_T(""), 5); + return -1; + } + + adjust_static_globals (awk); + + /* get the first character and the first token */ + if (get_char (awk) <= -1 || get_token (awk)) goto oops; + + while (1) + { + while (MATCH(awk,TOK_NEWLINE)) + { + if (get_token (awk) <= -1) goto oops; + } + if (MATCH(awk,TOK_EOF)) break; + + if (parse_progunit (awk) <= -1) goto oops; + } + + if (!(awk->opt.trait & HAWK_IMPLICIT)) + { + /* ensure that all functions called are defined in the EXPLICIT-only mode. + * o therwise, the error detection will get delay until run-time. */ + + hawk_htb_pair_t* p; + hawk_oow_t buckno; + + p = hawk_htb_getfirstpair(awk->parse.funs, &buckno); + while (p != HAWK_NULL) + { + if (hawk_htb_search (awk->tree.funs, HAWK_HTB_KPTR(p), HAWK_HTB_KLEN(p)) == HAWK_NULL) + { + hawk_nde_t* nde; + + /* see parse_fncall() for what is + * stored into awk->tree.funs */ + nde = (hawk_nde_t*)HAWK_HTB_VPTR(p); + + SETERR_ARG_LOC (awk, HAWK_EFUNNF, HAWK_HTB_KPTR(p), HAWK_HTB_KLEN(p), &nde->loc); + + goto oops; + } + + p = hawk_htb_getnextpair (awk->parse.funs, p, &buckno); + } + } + + HAWK_ASSERT (awk, awk->tree.ngbls == HAWK_ARR_SIZE(awk->parse.gbls)); + ret = 0; + +oops: + if (ret <= -1) + { + /* an error occurred and control has reached here + * probably, some included files might not have been + * closed. close them */ + while (awk->sio.inp != &awk->sio.arg) + { + hawk_sio_arg_t* prev; + + /* nothing much to do about a close error */ + awk->sio.inf ( + awk, HAWK_SIO_CMD_CLOSE, + awk->sio.inp, HAWK_NULL, 0); + + prev = awk->sio.inp->prev; + + HAWK_ASSERT (awk, awk->sio.inp->name != HAWK_NULL); + hawk_freemem (awk, awk->sio.inp); + + awk->sio.inp = prev; + } + } + else if (ret == 0) + { + /* no error occurred so far */ + HAWK_ASSERT (awk, awk->sio.inp == &awk->sio.arg); + CLRERR (awk); + } + + if (awk->sio.inf(awk, HAWK_SIO_CMD_CLOSE, awk->sio.inp, HAWK_NULL, 0) != 0) + { + if (ret == 0) + { + /* this is to keep the earlier error above + * that might be more critical than this */ + if (ISNOERR(awk)) + SETERR_ARG (awk, HAWK_ECLOSE, HAWK_T(""), 5); + ret = -1; + } + } + + if (ret <= -1) + { + /* clear the parse tree partially constructed on error */ + hawk_clear (awk); + } + + return ret; +} + +void hawk_clearsionames (hawk_t* awk) +{ + hawk_link_t* cur; + while (awk->sio_names) + { + cur = awk->sio_names; + awk->sio_names = cur->link; + hawk_freemem (awk, cur); + } +} + +int hawk_parse (hawk_t* awk, hawk_sio_cbs_t* sio) +{ + int n; + + /* the source code istream must be provided */ + HAWK_ASSERT (awk, sio != HAWK_NULL); + + /* the source code input stream must be provided at least */ + HAWK_ASSERT (awk, sio->in != HAWK_NULL); + + if (!sio || !sio->in) + { + SETERR_COD (awk, HAWK_EINVAL); + return -1; + } + + HAWK_ASSERT (awk, awk->parse.depth.loop == 0); + HAWK_ASSERT (awk, awk->parse.depth.expr == 0); + + hawk_clear (awk); + hawk_clearsionames (awk); + + HAWK_MEMSET (&awk->sio, 0, HAWK_SIZEOF(awk->sio)); + awk->sio.inf = sio->in; + awk->sio.outf = sio->out; + awk->sio.last.c = HAWK_OOCI_EOF; + awk->sio.arg.line = 1; + awk->sio.arg.colm = 1; + awk->sio.arg.pragma_trait = 0; + awk->sio.inp = &awk->sio.arg; + + n = parse(awk); + if (n == 0 && awk->sio.outf != HAWK_NULL) n = deparse (awk); + + HAWK_ASSERT (awk, awk->parse.depth.loop == 0); + HAWK_ASSERT (awk, awk->parse.depth.expr == 0); + + return n; +} + +static int end_include (hawk_t* awk) +{ + int x; + hawk_sio_arg_t* cur; + + if (awk->sio.inp == &awk->sio.arg) return 0; /* no include */ + + /* if it is an included file, close it and + * retry to read a character from an outer file */ + + CLRERR (awk); + x = awk->sio.inf(awk, HAWK_SIO_CMD_CLOSE, awk->sio.inp, HAWK_NULL, 0); + + /* if closing has failed, still destroy the + * sio structure first as normal and return + * the failure below. this way, the caller + * does not call HAWK_SIO_CMD_CLOSE on + * awk->sio.inp again. */ + + cur = awk->sio.inp; + awk->sio.inp = awk->sio.inp->prev; + + HAWK_ASSERT (awk, cur->name != HAWK_NULL); + /* restore the pragma values */ + awk->parse.pragma.trait = cur->pragma_trait; + hawk_freemem (awk, cur); + awk->parse.depth.incl--; + + if (x != 0) + { + /* the failure mentioned above is returned here */ + if (ISNOERR(awk)) SETERR_ARG (awk, HAWK_ECLOSE, HAWK_T(""), 5); + return -1; + } + + awk->sio.last = awk->sio.inp->last; + return 1; /* ended the included file successfully */ +} + +static int ever_included (hawk_t* awk, hawk_sio_arg_t* arg) +{ + hawk_oow_t i; + for (i = 0; i < awk->parse.incl_hist.count; i++) + { + if (HAWK_MEMCMP(&awk->parse.incl_hist.ptr[i * HAWK_SIZEOF(arg->unique_id)], arg->unique_id, HAWK_SIZEOF(arg->unique_id)) == 0) return 1; + } + return 0; +} + +static int record_ever_included (hawk_t* awk, hawk_sio_arg_t* arg) +{ + if (awk->parse.incl_hist.count >= awk->parse.incl_hist.capa) + { + hawk_uint8_t* tmp; + hawk_oow_t newcapa; + + newcapa = awk->parse.incl_hist.capa + 128; + tmp = (hawk_uint8_t*)hawk_reallocmem(awk, awk->parse.incl_hist.ptr, newcapa * HAWK_SIZEOF(arg->unique_id)); + if (!tmp) return -1; + + awk->parse.incl_hist.ptr = tmp; + awk->parse.incl_hist.capa = newcapa; + } + + HAWK_MEMCPY (&awk->parse.incl_hist.ptr[awk->parse.incl_hist.count * HAWK_SIZEOF(arg->unique_id)], arg->unique_id, HAWK_SIZEOF(arg->unique_id)); + awk->parse.incl_hist.count++; + return 0; +} + +static int begin_include (hawk_t* awk, int once) +{ + hawk_sio_arg_t* arg = HAWK_NULL; + hawk_link_t* link; + + if (hawk_count_oocstr(HAWK_OOECS_PTR(awk->tok.name)) != HAWK_OOECS_LEN(awk->tok.name)) + { + /* a '\0' character included in the include file name. + * we don't support such a file name */ + SETERR_ARG_LOC ( + awk, + HAWK_EIONMNL, + HAWK_OOECS_PTR(awk->tok.name), + hawk_count_oocstr(HAWK_OOECS_PTR(awk->tok.name)), + &awk->tok.loc + ); + return -1; + } + + if (awk->opt.incldirs.ptr) + { + /* include directory is set... */ +/* TODO: search target files in these directories */ + } + + /* store the include-file name into a list + * and this list is not deleted after hawk_parse. + * the errinfo.loc.file can point to a include_oncestring here. */ + link = (hawk_link_t*)hawk_callocmem(awk, HAWK_SIZEOF(*link) + + HAWK_SIZEOF(*arg) + HAWK_SIZEOF(hawk_ooch_t) * (HAWK_OOECS_LEN(awk->tok.name) + 1)); + if (!link) + { + ADJERR_LOC (awk, &awk->ptok.loc); + goto oops; + } + + hawk_copy_oochars_to_oocstr_unlimited ((hawk_ooch_t*)(link + 1), HAWK_OOECS_PTR(awk->tok.name), HAWK_OOECS_LEN(awk->tok.name)); + link->link = awk->sio_names; + awk->sio_names = link; + + arg = (hawk_sio_arg_t*)hawk_callocmem(awk, HAWK_SIZEOF(*awk)); + if (!arg) + { + ADJERR_LOC (awk, &awk->ptok.loc); + goto oops; + } + + arg->name = (const hawk_ooch_t*)(link + 1); + arg->line = 1; + arg->colm = 1; + + /* let the argument's prev field point to the current */ + arg->prev = awk->sio.inp; + + CLRERR (awk); + if (awk->sio.inf(awk, HAWK_SIO_CMD_OPEN, arg, HAWK_NULL, 0) <= -1) + { + if (ISNOERR(awk)) SETERR_TOK (awk, HAWK_EOPEN); + else awk->errloc = awk->tok.loc; /* adjust error location */ + goto oops; + } + + /* store the pragma value */ + arg->pragma_trait = awk->parse.pragma.trait; + /* but don't change awk->parse.pragma.trait. it means the included file inherits + * the existing progma values. + awk->parse.pragma.trait = (awk->opt.trait & HAWK_IMPLICIT); + */ + + /* i update the current pointer after opening is successful */ + awk->sio.inp = arg; + awk->parse.depth.incl++; + + if (once && ever_included(awk, arg)) + { + end_include (awk); + /* it has been included previously. don't include this file again. */ + if (get_token(awk) <= -1) return -1; /* skip the include file name */ + if (MATCH(awk, TOK_SEMICOLON) || MATCH(awk, TOK_NEWLINE)) + { + + if (get_token(awk) <= -1) return -1; /* skip the semicolon */ + } + } + else + { + /* read in the first character in the included file. + * so the next call to get_token() sees the character read + * from this file. */ + if (record_ever_included(awk, arg) <= -1 || get_char(awk) <= -1 || get_token(awk) <= -1) + { + end_include (awk); + /* i don't jump to oops since i've called + * end_include() where awk->sio.inp/arg is freed. */ + return -1; + } + } + + return 0; + +oops: + /* i don't need to free 'link' here since it's linked to awk->sio_names + * that's freed at the beginning of hawk_parse() or by hawk_close(). */ + if (arg) hawk_freemem (awk, arg); + return -1; +} + +static int parse_progunit (hawk_t* awk) +{ + /* + @include "xxxx" + @global xxx, xxxx; + BEGIN { action } + END { action } + pattern { action } + function name (parameter-list) { statement } + */ + + HAWK_ASSERT (awk, awk->parse.depth.loop == 0); + + if (MATCH(awk, TOK_XGLOBAL)) + { + hawk_oow_t ngbls; + + awk->parse.id.block = PARSE_GBL; + + if (get_token(awk) <= -1) return -1; + + HAWK_ASSERT (awk, awk->tree.ngbls == HAWK_ARR_SIZE(awk->parse.gbls)); + ngbls = awk->tree.ngbls; + if (collect_globals(awk) == HAWK_NULL) + { + hawk_arr_delete (awk->parse.gbls, ngbls, HAWK_ARR_SIZE(awk->parse.gbls) - ngbls); + awk->tree.ngbls = ngbls; + return -1; + } + } + else if (MATCH(awk, TOK_XINCLUDE) || MATCH(awk, TOK_XINCLUDE_ONCE)) + { + int once; + + if (awk->opt.depth.s.incl > 0 && + awk->parse.depth.incl >= awk->opt.depth.s.incl) + { + SETERR_LOC (awk, HAWK_EINCLTD, &awk->ptok.loc); + return -1; + } + + once = MATCH(awk, TOK_XINCLUDE_ONCE); + if (get_token(awk) <= -1) return -1; + + if (!MATCH(awk, TOK_STR)) + { + SETERR_LOC (awk, HAWK_EINCLSTR, &awk->ptok.loc); + return -1; + } + + if (begin_include(awk, once) <= -1) return -1; + + /* i just return without doing anything special + * after having setting up the environment for file + * inclusion. the loop in parse() proceeds to call + * parse_progunit() */ + } + else if (MATCH(awk, TOK_XPRAGMA)) + { + hawk_oocs_t name; + + if (get_token(awk) <= -1) return -1; + if (!MATCH(awk, TOK_IDENT)) + { + hawk_seterrfmt (awk, HAWK_EIDENT, &awk->ptok.loc, HAWK_T("identifier expected for '@pragma'")); + return -1; + } + + name.len = HAWK_OOECS_LEN(awk->tok.name); + name.ptr = HAWK_OOECS_PTR(awk->tok.name); + + if (hawk_comp_oochars_oocstr(name.ptr, name.len, HAWK_T("implicit")) == 0) + { + /* @pragma implicit on + * @pragma implicit off */ + if (get_token(awk) <= -1) return -1; + if (!MATCH(awk, TOK_IDENT)) + { + error_ident_on_off_expected_for_implicit: + hawk_seterrfmt (awk, HAWK_EIDENT, &awk->ptok.loc, HAWK_T("identifier 'on' or 'off' expected for 'implicit'")); + return -1; + } + + name.len = HAWK_OOECS_LEN(awk->tok.name); + name.ptr = HAWK_OOECS_PTR(awk->tok.name); + if (hawk_comp_oochars_oocstr(name.ptr, name.len, HAWK_T("on")) == 0) + { + awk->parse.pragma.trait |= HAWK_IMPLICIT; + } + else if (hawk_comp_oochars_oocstr(name.ptr, name.len, HAWK_T("off")) == 0) + { + awk->parse.pragma.trait &= ~HAWK_IMPLICIT; + } + else + { + goto error_ident_on_off_expected_for_implicit; + } + } + else if (hawk_comp_oochars_oocstr(name.ptr, name.len, HAWK_T("stack_limit")) == 0) + { + hawk_int_t sl; + + /* @pragma stack_limit 99999 */ + if (get_token(awk) <= -1) return -1; + if (!MATCH(awk, TOK_INT)) + { + SETERR_TOK (awk, HAWK_EINTLIT); + return -1; + } + + sl = hawk_strxtoint(awk, HAWK_OOECS_PTR(awk->tok.name), HAWK_OOECS_LEN(awk->tok.name), 0, HAWK_NULL); + if (sl < HAWK_MIN_RTX_STACK_LIMIT) sl = HAWK_MIN_RTX_STACK_LIMIT; + else if (sl > HAWK_MAX_RTX_STACK_LIMIT) sl = HAWK_MAX_RTX_STACK_LIMIT; + /* take the specified value if it's greater than the existing value */ + if (sl > awk->parse.pragma.rtx_stack_limit) awk->parse.pragma.rtx_stack_limit = sl; + + } + else + { + hawk_seterrfmt (awk, HAWK_EIDENT, &awk->ptok.loc, HAWK_T("unknown @pragma identifier - %.*s"), (int)name.len, name.ptr); + return -1; + } + + if (get_token(awk) <= -1) return -1; + if (MATCH(awk,TOK_SEMICOLON) && get_token(awk) <= -1) return -1; + } + else if (MATCH(awk, TOK_FUNCTION)) + { + awk->parse.id.block = PARSE_FUNCTION; + if (parse_function(awk) == HAWK_NULL) return -1; + } + else if (MATCH(awk, TOK_BEGIN)) + { + if ((awk->opt.trait & HAWK_PABLOCK) == 0) + { + SETERR_TOK (awk, HAWK_EKWFNC); + return -1; + } + + awk->parse.id.block = PARSE_BEGIN; + if (get_token(awk) <= -1) return -1; + + if (MATCH(awk, TOK_NEWLINE) || MATCH(awk, TOK_EOF)) + { + /* when HAWK_NEWLINE is set, + * BEGIN and { should be located on the same line */ + SETERR_LOC (awk, HAWK_EBLKBEG, &awk->ptok.loc); + return -1; + } + + if (!MATCH(awk, TOK_LBRACE)) + { + SETERR_TOK (awk, HAWK_ELBRACE); + return -1; + } + + awk->parse.id.block = PARSE_BEGIN_BLOCK; + if (parse_begin(awk) == HAWK_NULL) return -1; + + /* skip a semicolon after an action block if any */ + if (MATCH(awk, TOK_SEMICOLON) && get_token(awk) <= -1) return -1; + } + else if (MATCH(awk, TOK_END)) + { + if ((awk->opt.trait & HAWK_PABLOCK) == 0) + { + SETERR_TOK (awk, HAWK_EKWFNC); + return -1; + } + + awk->parse.id.block = PARSE_END; + if (get_token(awk) <= -1) return -1; + + if (MATCH(awk, TOK_NEWLINE) || MATCH(awk, TOK_EOF)) + { + /* when HAWK_NEWLINE is set, + * END and { should be located on the same line */ + SETERR_LOC (awk, HAWK_EBLKEND, &awk->ptok.loc); + return -1; + } + + if (!MATCH(awk, TOK_LBRACE)) + { + SETERR_TOK (awk, HAWK_ELBRACE); + return -1; + } + + awk->parse.id.block = PARSE_END_BLOCK; + if (parse_end(awk) == HAWK_NULL) return -1; + + /* skip a semicolon after an action block if any */ + if (MATCH(awk,TOK_SEMICOLON) && get_token (awk) <= -1) return -1; + } + else if (MATCH(awk, TOK_LBRACE)) + { + /* patternless block */ + if ((awk->opt.trait & HAWK_PABLOCK) == 0) + { + SETERR_TOK (awk, HAWK_EKWFNC); + return -1; + } + + awk->parse.id.block = PARSE_ACTION_BLOCK; + if (parse_action_block(awk, HAWK_NULL, 0) == HAWK_NULL) return -1; + + /* skip a semicolon after an action block if any */ + if (MATCH(awk, TOK_SEMICOLON) && get_token(awk) <= -1) return -1; + } + else + { + /* + expressions + /regular expression/ + pattern && pattern + pattern || pattern + !pattern + (pattern) + pattern, pattern + */ + hawk_nde_t* ptn; + hawk_loc_t eloc; + + if ((awk->opt.trait & HAWK_PABLOCK) == 0) + { + SETERR_TOK (awk, HAWK_EKWFNC); + return -1; + } + + awk->parse.id.block = PARSE_PATTERN; + + eloc = awk->tok.loc; + ptn = parse_expr_withdc (awk, &eloc); + if (ptn == HAWK_NULL) return -1; + + HAWK_ASSERT (awk, ptn->next == HAWK_NULL); + + if (MATCH(awk,TOK_COMMA)) + { + if (get_token (awk) <= -1) + { + hawk_clrpt (awk, ptn); + return -1; + } + + eloc = awk->tok.loc; + ptn->next = parse_expr_withdc (awk, &eloc); + + if (ptn->next == HAWK_NULL) + { + hawk_clrpt (awk, ptn); + return -1; + } + } + + if (MATCH(awk,TOK_NEWLINE) || MATCH(awk,TOK_SEMICOLON) || MATCH(awk,TOK_EOF)) + { + /* blockless pattern */ + int eof; + hawk_loc_t ploc; + + + eof = MATCH(awk,TOK_EOF); + ploc = awk->ptok.loc; + + awk->parse.id.block = PARSE_ACTION_BLOCK; + if (parse_action_block (awk, ptn, 1) == HAWK_NULL) + { + hawk_clrpt (awk, ptn); + return -1; + } + + if (!eof) + { + if (get_token(awk) <= -1) + { + /* 'ptn' has been added to the chain. + * it doesn't have to be cleared here + * as hawk_clear does it */ + /*hawk_clrpt (awk, ptn);*/ + return -1; + } + } + + if ((awk->opt.trait & HAWK_RIO) != HAWK_RIO) + { + /* blockless pattern requires HAWK_RIO + * to be ON because the implicit block is + * "print $0" */ + SETERR_LOC (awk, HAWK_ENOSUP, &ploc); + return -1; + } + } + else + { + /* parse the action block */ + if (!MATCH(awk,TOK_LBRACE)) + { + hawk_clrpt (awk, ptn); + SETERR_TOK (awk, HAWK_ELBRACE); + return -1; + } + + awk->parse.id.block = PARSE_ACTION_BLOCK; + if (parse_action_block (awk, ptn, 0) == HAWK_NULL) + { + hawk_clrpt (awk, ptn); + return -1; + } + + /* skip a semicolon after an action block if any */ + if (MATCH(awk,TOK_SEMICOLON) && + get_token (awk) <= -1) return -1; + } + } + + return 0; +} + +static hawk_nde_t* parse_function (hawk_t* awk) +{ + hawk_oocs_t name; + hawk_nde_t* body = HAWK_NULL; + hawk_fun_t* fun = HAWK_NULL; + hawk_ooch_t* argspec = HAWK_NULL; + hawk_oow_t argspeccapa = 0; + hawk_oow_t nargs, g; + hawk_htb_pair_t* pair; + hawk_loc_t xloc; + int rederr; + + /* eat up the keyword 'function' and get the next token */ + HAWK_ASSERT (awk, MATCH(awk,TOK_FUNCTION)); + if (get_token(awk) <= -1) return HAWK_NULL; + + /* check if an identifier is in place */ + if (!MATCH(awk,TOK_IDENT)) + { + /* cannot find a valid identifier for a function name */ + SETERR_TOK (awk, HAWK_EFUNNAM); + return HAWK_NULL; + } + + name.len = HAWK_OOECS_LEN(awk->tok.name); + name.ptr = HAWK_OOECS_PTR(awk->tok.name); + + /* note that i'm assigning to rederr in the 'if' conditions below. + * i'm not checking equality */ + /* check if it is a builtin function */ + if ((hawk_findfncwithoocs(awk, &name) != HAWK_NULL && (rederr = HAWK_EFNCRED)) || + /* check if it has already been defined as a function */ + (hawk_htb_search (awk->tree.funs, name.ptr, name.len) != HAWK_NULL && (rederr = HAWK_EFUNRED)) || + /* check if it conflicts with a named variable */ + (hawk_htb_search (awk->parse.named, name.ptr, name.len) != HAWK_NULL && (rederr = HAWK_EVARRED)) || + /* check if it coincides to be a global variable name */ + (((g = find_global (awk, &name)) != HAWK_ARR_NIL) && (rederr = HAWK_EGBLRED))) + { + hawk_seterror (awk, rederr, &name, &awk->tok.loc); + return HAWK_NULL; + } + + /* duplicate the name before it's overridden by get_token() */ + name.ptr = hawk_dupoochars(awk, name.ptr, name.len); + if (!name.ptr) + { + ADJERR_LOC (awk, &awk->tok.loc); + return HAWK_NULL; + } + + /* get the next token */ + if (get_token(awk) <= -1) goto oops; + + /* match a left parenthesis */ + if (!MATCH(awk,TOK_LPAREN)) + { + /* a function name is not followed by a left parenthesis */ + SETERR_TOK (awk, HAWK_ELPAREN); + goto oops; + } + + /* get the next token */ + if (get_token(awk) <= -1) goto oops; + + /* make sure that parameter table is empty */ + HAWK_ASSERT (awk, HAWK_ARR_SIZE(awk->parse.params) == 0); + + /* read parameter list */ + if (MATCH(awk,TOK_RPAREN)) + { + /* no function parameter found. get the next token */ + if (get_token(awk) <= -1) goto oops; + } + else + { + while (1) + { + hawk_ooch_t* pa; + hawk_oow_t pal; + + if (MATCH(awk, TOK_BAND)) + { + /* pass-by-reference argument */ + nargs = HAWK_ARR_SIZE(awk->parse.params); + if (nargs >= argspeccapa) + { + hawk_oow_t i, newcapa = HAWK_ALIGN_POW2(nargs + 1, 64); + argspec = hawk_reallocmem(awk, argspec, newcapa * HAWK_SIZEOF(*argspec)); + if (!argspec) goto oops; + for (i = argspeccapa; i < newcapa; i++) argspec[i] = HAWK_T(' '); + argspeccapa = newcapa; + } + argspec[nargs] = HAWK_T('r'); + if (get_token(awk) <= -1) goto oops; + } + + if (!MATCH(awk,TOK_IDENT)) + { + SETERR_TOK (awk, HAWK_EBADPAR); + goto oops; + } + + pa = HAWK_OOECS_PTR(awk->tok.name); + pal = HAWK_OOECS_LEN(awk->tok.name); + + /* NOTE: the following is not a conflict. + * so the parameter is not checked against + * global variables. + * global x; + * function f (x) { print x; } + * x in print x is a parameter + */ + + /* check if a parameter conflicts with the function + * name or other parameters */ + if (((awk->opt.trait & HAWK_STRICTNAMING) && + hawk_comp_oochars(pa, pal, name.ptr, name.len, 0) == 0) || + hawk_arr_search(awk->parse.params, 0, pa, pal) != HAWK_ARR_NIL) + { + SETERR_ARG_LOC (awk, HAWK_EDUPPAR, pa, pal, &awk->tok.loc); + goto oops; + } + + /* push the parameter to the parameter list */ + if (HAWK_ARR_SIZE(awk->parse.params) >= HAWK_MAX_PARAMS) + { + SETERR_LOC (awk, HAWK_EPARTM, &awk->tok.loc); + goto oops; + } + + if (hawk_arr_insert(awk->parse.params, HAWK_ARR_SIZE(awk->parse.params), pa, pal) == HAWK_ARR_NIL) + { + SETERR_LOC (awk, HAWK_ENOMEM, &awk->tok.loc); + goto oops; + } + + if (get_token(awk) <= -1) goto oops; + + if (MATCH(awk,TOK_RPAREN)) break; + + if (!MATCH(awk,TOK_COMMA)) + { + SETERR_TOK (awk, HAWK_ECOMMA); + goto oops; + } + + do + { + if (get_token(awk) <= -1) goto oops; + } + while (MATCH(awk,TOK_NEWLINE)); + } + + if (get_token(awk) <= -1) goto oops; + } + + /* function body can be placed on a different line + * from a function name and the parameters even if + * HAWK_NEWLINE is set. note TOK_NEWLINE is + * available only when the option is set. */ + while (MATCH(awk,TOK_NEWLINE)) + { + if (get_token(awk) <= -1) goto oops; + } + + /* check if the function body starts with a left brace */ + if (!MATCH(awk,TOK_LBRACE)) + { + SETERR_TOK (awk, HAWK_ELBRACE); + goto oops; + } + if (get_token(awk) <= -1) goto oops; + + /* remember the current function name so that the body parser + * can know the name of the current function being parsed */ + awk->tree.cur_fun.ptr = name.ptr; + awk->tree.cur_fun.len = name.len; + + /* actual function body */ + xloc = awk->ptok.loc; + body = parse_block_dc(awk, &xloc, 1); + + /* clear the current function name remembered */ + awk->tree.cur_fun.ptr = HAWK_NULL; + awk->tree.cur_fun.len = 0; + + if (!body) goto oops; + + /* TODO: study furthur if the parameter names should be saved + * for some reasons - might be needed for better deparsing output */ + nargs = HAWK_ARR_SIZE(awk->parse.params); + /* parameter names are not required anymore. clear them */ + hawk_arr_clear (awk->parse.params); + + fun = (hawk_fun_t*)hawk_callocmem(awk, HAWK_SIZEOF(*fun)); + if (fun == HAWK_NULL) + { + ADJERR_LOC (awk, &awk->tok.loc); + goto oops; + } + + /*fun->name.ptr = HAWK_NULL;*/ /* function name is set below */ + fun->name.len = 0; + fun->nargs = nargs; + fun->argspec = argspec; + fun->body = body; + + pair = hawk_htb_insert(awk->tree.funs, name.ptr, name.len, fun, 0); + if (pair == HAWK_NULL) + { + /* if hawk_htb_insert() fails for other reasons than memory + * shortage, there should be implementaion errors as duplicate + * functions are detected earlier in this function */ + SETERR_LOC (awk, HAWK_ENOMEM, &awk->tok.loc); + goto oops; + } + + /* do some trick to save a string. make it back-point at the key part + * of the pair */ + fun->name.ptr = HAWK_HTB_KPTR(pair); + fun->name.len = HAWK_HTB_KLEN(pair); + hawk_freemem (awk, name.ptr); + + /* remove an undefined function call entry from the parse.fun table */ + hawk_htb_delete (awk->parse.funs, fun->name.ptr, name.len); + return body; + +oops: + if (body) hawk_clrpt (awk, body); + if (argspec) hawk_freemem (awk, argspec); + if (fun) hawk_freemem (awk, fun); + hawk_freemem (awk, name.ptr); + hawk_arr_clear (awk->parse.params); + return HAWK_NULL; +} + +static hawk_nde_t* parse_begin (hawk_t* awk) +{ + hawk_nde_t* nde; + hawk_loc_t xloc; + + xloc = awk->tok.loc; + HAWK_ASSERT (awk, MATCH(awk,TOK_LBRACE)); + + if (get_token(awk) <= -1) return HAWK_NULL; + nde = parse_block_dc (awk, &xloc, 1); + if (nde == HAWK_NULL) return HAWK_NULL; + + if (awk->tree.begin == HAWK_NULL) + { + awk->tree.begin = nde; + awk->tree.begin_tail = nde; + } + else + { + awk->tree.begin_tail->next = nde; + awk->tree.begin_tail = nde; + } + + return nde; +} + +static hawk_nde_t* parse_end (hawk_t* awk) +{ + hawk_nde_t* nde; + hawk_loc_t xloc; + + xloc = awk->tok.loc; + HAWK_ASSERT (awk, MATCH(awk,TOK_LBRACE)); + + if (get_token(awk) <= -1) return HAWK_NULL; + nde = parse_block_dc (awk, &xloc, 1); + if (nde == HAWK_NULL) return HAWK_NULL; + + if (awk->tree.end == HAWK_NULL) + { + awk->tree.end = nde; + awk->tree.end_tail = nde; + } + else + { + awk->tree.end_tail->next = nde; + awk->tree.end_tail = nde; + } + return nde; +} + +static hawk_chain_t* parse_action_block ( + hawk_t* awk, hawk_nde_t* ptn, int blockless) +{ + hawk_nde_t* nde; + hawk_chain_t* chain; + hawk_loc_t xloc; + + xloc = awk->tok.loc; + if (blockless) nde = HAWK_NULL; + else + { + HAWK_ASSERT (awk, MATCH(awk,TOK_LBRACE)); + if (get_token(awk) <= -1) return HAWK_NULL; + nde = parse_block_dc(awk, &xloc, 1); + if (nde == HAWK_NULL) return HAWK_NULL; + } + + chain = (hawk_chain_t*)hawk_callocmem(awk, HAWK_SIZEOF(*chain)); + if (chain == HAWK_NULL) + { + hawk_clrpt (awk, nde); + ADJERR_LOC (awk, &xloc); + return HAWK_NULL; + } + + chain->pattern = ptn; + chain->action = nde; + chain->next = HAWK_NULL; + + if (awk->tree.chain == HAWK_NULL) + { + awk->tree.chain = chain; + awk->tree.chain_tail = chain; + awk->tree.chain_size++; + } + else + { + awk->tree.chain_tail->next = chain; + awk->tree.chain_tail = chain; + awk->tree.chain_size++; + } + + return chain; +} + +static hawk_nde_t* parse_block (hawk_t* awk, const hawk_loc_t* xloc, int istop) +{ + hawk_nde_t* head, * curr, * nde; + hawk_nde_blk_t* block; + hawk_oow_t nlcls, nlcls_max, tmp; + + nlcls = HAWK_ARR_SIZE(awk->parse.lcls); + nlcls_max = awk->parse.nlcls_max; + + /* local variable declarations */ + while (1) + { + /* skip new lines before local declaration in a block*/ + while (MATCH(awk,TOK_NEWLINE)) + { + if (get_token(awk) <= -1) return HAWK_NULL; + } + + if (MATCH(awk,TOK_XINCLUDE) || MATCH(awk, TOK_XINCLUDE_ONCE)) + { + /* @include ... */ + int once; + + if (awk->opt.depth.s.incl > 0 && + awk->parse.depth.incl >= awk->opt.depth.s.incl) + { + SETERR_LOC (awk, HAWK_EINCLTD, &awk->ptok.loc); + return HAWK_NULL; + } + + once = MATCH(awk, TOK_XINCLUDE_ONCE); + if (get_token(awk) <= -1) return HAWK_NULL; + + if (!MATCH(awk,TOK_STR)) + { + SETERR_LOC (awk, HAWK_EINCLSTR, &awk->ptok.loc); + return HAWK_NULL; + } + + if (begin_include(awk, once) <= -1) return HAWK_NULL; + } + else if (MATCH(awk,TOK_XLOCAL)) + { + /* @local ... */ + if (get_token(awk) <= -1) + { + hawk_arr_delete (awk->parse.lcls, nlcls, HAWK_ARR_SIZE(awk->parse.lcls)-nlcls); + return HAWK_NULL; + } + + if (collect_locals (awk, nlcls, istop) == HAWK_NULL) + { + hawk_arr_delete (awk->parse.lcls, nlcls, HAWK_ARR_SIZE(awk->parse.lcls)-nlcls); + return HAWK_NULL; + } + } + else break; + } + + /* block body */ + head = HAWK_NULL; curr = HAWK_NULL; + + while (1) + { + /* skip new lines within a block */ + while (MATCH(awk,TOK_NEWLINE)) + { + if (get_token(awk) <= -1) return HAWK_NULL; + } + + /* if EOF is met before the right brace, this is an error */ + if (MATCH(awk,TOK_EOF)) + { + hawk_arr_delete ( + awk->parse.lcls, nlcls, + HAWK_ARR_SIZE(awk->parse.lcls) - nlcls); + if (head != HAWK_NULL) hawk_clrpt (awk, head); + SETERR_LOC (awk, HAWK_EEOF, &awk->tok.loc); + return HAWK_NULL; + } + + /* end the block when the right brace is met */ + if (MATCH(awk,TOK_RBRACE)) + { + if (get_token(awk) <= -1) + { + hawk_arr_delete ( + awk->parse.lcls, nlcls, + HAWK_ARR_SIZE(awk->parse.lcls)-nlcls); + if (head != HAWK_NULL) hawk_clrpt (awk, head); + return HAWK_NULL; + } + + break; + } + + else if (MATCH(awk, TOK_XINCLUDE) || MATCH(awk, TOK_XINCLUDE_ONCE)) + { + int once; + + if (awk->opt.depth.s.incl > 0 && + awk->parse.depth.incl >= awk->opt.depth.s.incl) + { + SETERR_LOC (awk, HAWK_EINCLTD, &awk->ptok.loc); + return HAWK_NULL; + } + + once = MATCH(awk, TOK_XINCLUDE_ONCE); + if (get_token(awk) <= -1) return HAWK_NULL; + + if (!MATCH(awk,TOK_STR)) + { + SETERR_LOC (awk, HAWK_EINCLSTR, &awk->ptok.loc); + return HAWK_NULL; + } + + if (begin_include(awk, once) <= -1) return HAWK_NULL; + } + else + { + /* parse an actual statement in a block */ + { + hawk_loc_t sloc; + sloc = awk->tok.loc; + nde = parse_statement (awk, &sloc); + } + + if (nde == HAWK_NULL) + { + hawk_arr_delete ( + awk->parse.lcls, nlcls, + HAWK_ARR_SIZE(awk->parse.lcls)-nlcls); + if (head != HAWK_NULL) hawk_clrpt (awk, head); + return HAWK_NULL; + } + + /* remove unnecessary statements such as adjacent + * null statements */ + if (nde->type == HAWK_NDE_NULL) + { + hawk_clrpt (awk, nde); + continue; + } + if (nde->type == HAWK_NDE_BLK && + ((hawk_nde_blk_t*)nde)->body == HAWK_NULL) + { + hawk_clrpt (awk, nde); + continue; + } + + if (curr == HAWK_NULL) head = nde; + else curr->next = nde; + curr = nde; + } + } + + block = (hawk_nde_blk_t*)hawk_callocmem(awk, HAWK_SIZEOF(*block)); + if (block == HAWK_NULL) + { + hawk_arr_delete (awk->parse.lcls, nlcls, HAWK_ARR_SIZE(awk->parse.lcls) - nlcls); + hawk_clrpt (awk, head); + ADJERR_LOC (awk, xloc); + return HAWK_NULL; + } + + tmp = HAWK_ARR_SIZE(awk->parse.lcls); + if (tmp > awk->parse.nlcls_max) awk->parse.nlcls_max = tmp; + + /* remove all lcls to move it up to the top level */ + hawk_arr_delete (awk->parse.lcls, nlcls, tmp - nlcls); + + /* adjust the number of lcls for a block without any statements */ + /* if (head == HAWK_NULL) tmp = 0; */ + + block->type = HAWK_NDE_BLK; + block->loc = *xloc; + block->body = head; + + /* TODO: not only local variables but also nested blocks, + unless it is part of other constructs such as if, can be promoted + and merged to top-level block */ + + /* migrate all block-local variables to a top-level block */ + if (istop) + { + block->nlcls = awk->parse.nlcls_max - nlcls; + awk->parse.nlcls_max = nlcls_max; + } + else + { + /*block->nlcls = tmp - nlcls;*/ + block->nlcls = 0; + } + + return (hawk_nde_t*)block; +} + +static hawk_nde_t* parse_block_dc (hawk_t* awk, const hawk_loc_t* xloc, int istop) +{ + hawk_nde_t* nde; + + if (awk->opt.depth.s.block_parse > 0 && + awk->parse.depth.block >= awk->opt.depth.s.block_parse) + { + SETERR_LOC (awk, HAWK_EBLKNST, xloc); + return HAWK_NULL; + } + + awk->parse.depth.block++; + nde = parse_block(awk, xloc, istop); + awk->parse.depth.block--; + + return nde; +} + +int hawk_initgbls (hawk_t* awk) +{ + int id; + + /* hawk_initgbls is not generic-purpose. call this from + * hawk_open only. */ + HAWK_ASSERT (awk, awk->tree.ngbls_base == 0 && awk->tree.ngbls == 0); + + awk->tree.ngbls_base = 0; + awk->tree.ngbls = 0; + + for (id = HAWK_MIN_GBL_ID; id <= HAWK_MAX_GBL_ID; id++) + { + hawk_oow_t g; + + g = hawk_arr_insert(awk->parse.gbls, HAWK_ARR_SIZE(awk->parse.gbls), (hawk_ooch_t*)gtab[id].name, gtab[id].namelen); + if (g == HAWK_ARR_NIL) return -1; + + HAWK_ASSERT (awk, (int)g == id); + + awk->tree.ngbls_base++; + awk->tree.ngbls++; + } + + HAWK_ASSERT (awk, awk->tree.ngbls_base == HAWK_MAX_GBL_ID-HAWK_MIN_GBL_ID+1); + return 0; +} + +static void adjust_static_globals (hawk_t* awk) +{ + int id; + + HAWK_ASSERT (awk, awk->tree.ngbls_base >= HAWK_MAX_GBL_ID - HAWK_MAX_GBL_ID + 1); + + for (id = HAWK_MIN_GBL_ID; id <= HAWK_MAX_GBL_ID; id++) + { + if ((awk->opt.trait & gtab[id].trait) != gtab[id].trait) + { + HAWK_ARR_DLEN(awk->parse.gbls,id) = 0; + } + else + { + HAWK_ARR_DLEN(awk->parse.gbls,id) = gtab[id].namelen; + } + } +} + +static hawk_oow_t get_global (hawk_t* awk, const hawk_oocs_t* name) +{ + hawk_oow_t i; + hawk_arr_t* gbls = awk->parse.gbls; + + for (i = HAWK_ARR_SIZE(gbls); i > 0; ) + { + i--; + if (hawk_comp_oochars(HAWK_ARR_DPTR(gbls,i), HAWK_ARR_DLEN(gbls,i), name->ptr, name->len, 0) == 0) return i; + } + + return HAWK_ARR_NIL; +} + +static hawk_oow_t find_global (hawk_t* awk, const hawk_oocs_t* name) +{ + hawk_oow_t i; + hawk_arr_t* gbls = awk->parse.gbls; + + for (i = 0; i < HAWK_ARR_SIZE(gbls); i++) + { + if (hawk_comp_oochars(HAWK_ARR_DPTR(gbls,i), HAWK_ARR_DLEN(gbls,i), name->ptr, name->len, 0) == 0) return i; + } + + return HAWK_ARR_NIL; +} + +static int add_global (hawk_t* awk, const hawk_oocs_t* name, hawk_loc_t* xloc, int disabled) +{ + hawk_oow_t ngbls; + + /* check if it is a keyword */ + if (classify_ident(awk, name) != TOK_IDENT) + { + SETERR_ARG_LOC (awk, HAWK_EKWRED, name->ptr, name->len, xloc); + return -1; + } + + /* check if it conflicts with a builtin function name */ + if (hawk_findfncwithoocs(awk, name) != HAWK_NULL) + { + SETERR_ARG_LOC (awk, HAWK_EFNCRED, name->ptr, name->len, xloc); + return -1; + } + + /* check if it conflicts with a function name */ + if (hawk_htb_search(awk->tree.funs, name->ptr, name->len) != HAWK_NULL) + { + SETERR_ARG_LOC (awk, HAWK_EFUNRED, name->ptr, name->len, xloc); + return -1; + } + + /* check if it conflicts with a function name + * caught in the function call table */ + if (hawk_htb_search(awk->parse.funs, name->ptr, name->len) != HAWK_NULL) + { + SETERR_ARG_LOC (awk, HAWK_EFUNRED, name->ptr, name->len, xloc); + return -1; + } + + /* check if it conflicts with other global variable names */ + if (find_global(awk, name) != HAWK_ARR_NIL) + { + SETERR_ARG_LOC (awk, HAWK_EDUPGBL, name->ptr, name->len, xloc); + return -1; + } + +#if 0 + /* TODO: need to check if it conflicts with a named variable to + * disallow such a program shown below (IMPLICIT & EXPLICIT on) + * BEGIN {X=20; x(); x(); x(); print X} + * global X; + * function x() { print X++; } + */ + if (hawk_htb_search (awk->parse.named, name, len) != HAWK_NULL) + { + SETERR_ARG_LOC (awk, HAWK_EVARRED, name, len, xloc); + return -1; + } +#endif + + ngbls = HAWK_ARR_SIZE (awk->parse.gbls); + if (ngbls >= HAWK_MAX_GBLS) + { + SETERR_LOC (awk, HAWK_EGBLTM, xloc); + return -1; + } + + if (hawk_arr_insert (awk->parse.gbls, + HAWK_ARR_SIZE(awk->parse.gbls), + (hawk_ooch_t*)name->ptr, name->len) == HAWK_ARR_NIL) + { + SETERR_LOC (awk, HAWK_ENOMEM, xloc); + return -1; + } + + HAWK_ASSERT (awk, ngbls == HAWK_ARR_SIZE(awk->parse.gbls) - 1); + + /* the disabled item is inserted normally but + * the name length is reset to zero. */ + if (disabled) HAWK_ARR_DLEN(awk->parse.gbls,ngbls) = 0; + + awk->tree.ngbls = HAWK_ARR_SIZE (awk->parse.gbls); + HAWK_ASSERT (awk, ngbls == awk->tree.ngbls-1); + + /* return the id which is the index to the gbl table. */ + return (int)ngbls; +} + +int hawk_addgblwithbcstr (hawk_t* awk, const hawk_bch_t* name) +{ + int n; + hawk_bcs_t ncs; + + if (awk->tree.ngbls > awk->tree.ngbls_base) + { + /* this function is not allowed after hawk_parse is called */ + SETERR_COD (awk, HAWK_EPERM); + return -1; + } + + ncs.ptr = (hawk_bch_t*)name; + ncs.len = hawk_count_bcstr(name);; + if (ncs.len <= 0) + { + SETERR_COD (awk, HAWK_EINVAL); + return -1; + } + +#if defined(HAWK_OOCH_IS_BCH) + n = add_global(awk, &ncs, HAWK_NULL, 0); +#else + { + hawk_ucs_t wcs; + wcs.ptr = hawk_dupbtoucstr(awk, ncs.ptr, &wcs.len, 0); + if (!wcs.ptr) return -1; + n = add_global(awk, &wcs, HAWK_NULL, 0); + hawk_freemem (awk, wcs.ptr); + } +#endif + + /* update the count of the static globals. + * the total global count has been updated inside add_global. */ + if (n >= 0) awk->tree.ngbls_base++; + + return n; +} + +int hawk_addgblwithucstr (hawk_t* awk, const hawk_uch_t* name) +{ + int n; + hawk_ucs_t ncs; + + if (awk->tree.ngbls > awk->tree.ngbls_base) + { + /* this function is not allowed after hawk_parse is called */ + SETERR_COD (awk, HAWK_EPERM); + return -1; + } + + ncs.ptr = (hawk_uch_t*)name; + ncs.len = hawk_count_ucstr(name);; + if (ncs.len <= 0) + { + SETERR_COD (awk, HAWK_EINVAL); + return -1; + } + +#if defined(HAWK_OOCH_IS_BCH) + { + hawk_bcs_t mbs; + mbs.ptr = hawk_duputobcstr(awk, ncs.ptr, &mbs.len); + if (!mbs.ptr) return -1; + n = add_global(awk, &mbs, HAWK_NULL, 0); + hawk_freemem (awk, mbs.ptr); + } +#else + n = add_global(awk, &ncs, HAWK_NULL, 0); +#endif + + /* update the count of the static globals. + * the total global count has been updated inside add_global. */ + if (n >= 0) awk->tree.ngbls_base++; + + return n; +} + +#define HAWK_NUM_STATIC_GBLS \ + (HAWK_MAX_GBL_ID-HAWK_MIN_GBL_ID+1) + +int hawk_delgblwithbcstr (hawk_t* awk, const hawk_bch_t* name) +{ + hawk_oow_t n; + hawk_bcs_t ncs; + hawk_ucs_t wcs; + + ncs.ptr = (hawk_bch_t*)name; + ncs.len = hawk_count_bcstr(name); + + if (awk->tree.ngbls > awk->tree.ngbls_base) + { + /* this function is not allow after hawk_parse is called */ + hawk_seterrnum (awk, HAWK_EPERM, HAWK_NULL); + return -1; + } + +#if defined(HAWK_OOCH_IS_BCH) + n = hawk_arr_search(awk->parse.gbls, HAWK_NUM_STATIC_GBLS, ncs.ptr, ncs.len); + if (n == HAWK_ARR_NIL) + { + hawk_seterrnum (awk, HAWK_ENOENT, &ncs); + return -1; + } +#else + wcs.ptr = hawk_dupbtoucstr(awk, ncs.ptr, &wcs.len, 0); + if (!wcs.ptr) return -1; + n = hawk_arr_search(awk->parse.gbls, HAWK_NUM_STATIC_GBLS, wcs.ptr, wcs.len); + if (n == HAWK_ARR_NIL) + { + hawk_seterrnum (awk, HAWK_ENOENT, &wcs); + hawk_freemem (awk, wcs.ptr); + return -1; + } + hawk_freemem (awk, wcs.ptr); +#endif + + /* invalidate the name if deletion is requested. + * this approach does not delete the entry. + * if hawk_delgbl() is called with the same name + * again, the entry will be appended again. + * never call this funciton unless it is really required. */ + /* + awk->parse.gbls.buf[n].name.ptr[0] = HAWK_T('\0'); + awk->parse.gbls.buf[n].name.len = 0; + */ + n = hawk_arr_uplete(awk->parse.gbls, n, 1); + HAWK_ASSERT (awk, n == 1); + + return 0; +} + +int hawk_delgblwithucstr (hawk_t* awk, const hawk_uch_t* name) +{ + hawk_oow_t n; + hawk_ucs_t ncs; + hawk_bcs_t mbs; + + ncs.ptr = (hawk_uch_t*)name; + ncs.len = hawk_count_ucstr(name); + + if (awk->tree.ngbls > awk->tree.ngbls_base) + { + /* this function is not allow after hawk_parse is called */ + hawk_seterrnum (awk, HAWK_EPERM, HAWK_NULL); + return -1; + } + +#if defined(HAWK_OOCH_IS_BCH) + mbs.ptr = hawk_duputobcstr(awk, ncs.ptr, &mbs.len); + if (!mbs.ptr) return -1; + n = hawk_arr_search(awk->parse.gbls, HAWK_NUM_STATIC_GBLS, mbs.ptr, mbs.len); + if (n == HAWK_ARR_NIL) + { + hawk_seterrnum (awk, HAWK_ENOENT, &mbs); + hawk_freemem (awk, mbs.ptr); + return -1; + } + hawk_freemem (awk, mbs.ptr); +#else + n = hawk_arr_search(awk->parse.gbls, HAWK_NUM_STATIC_GBLS, ncs.ptr, ncs.len); + if (n == HAWK_ARR_NIL) + { + hawk_seterrnum (awk, HAWK_ENOENT, &ncs); + return -1; + } +#endif + + /* invalidate the name if deletion is requested. + * this approach does not delete the entry. + * if hawk_delgbl() is called with the same name + * again, the entry will be appended again. + * never call this funciton unless it is really required. */ + /* + awk->parse.gbls.buf[n].name.ptr[0] = HAWK_T('\0'); + awk->parse.gbls.buf[n].name.len = 0; + */ + n = hawk_arr_uplete(awk->parse.gbls, n, 1); + HAWK_ASSERT (awk, n == 1); + + return 0; +} + +int hawk_findgblwithbcstr (hawk_t* awk, const hawk_bch_t* name) +{ + hawk_oow_t n; + hawk_bcs_t ncs; + hawk_ucs_t wcs; + + ncs.ptr = (hawk_bch_t*)name; + ncs.len = hawk_count_bcstr(name); + +#if defined(HAWK_OOCH_IS_BCH) + n = hawk_arr_search(awk->parse.gbls, HAWK_NUM_STATIC_GBLS, ncs.ptr, ncs.len); + if (n == HAWK_ARR_NIL) + { + hawk_seterrnum (awk, HAWK_ENOENT, &ncs); + return -1; + } +#else + wcs.ptr = hawk_dupbtoucstr(awk, ncs.ptr, &wcs.len, 0); + if (!wcs.ptr) return -1; + n = hawk_arr_search(awk->parse.gbls, HAWK_NUM_STATIC_GBLS, wcs.ptr, wcs.len); + if (n == HAWK_ARR_NIL) + { + hawk_seterrnum (awk, HAWK_ENOENT, &wcs); + hawk_freemem (awk, wcs.ptr); + return -1; + } + hawk_freemem (awk, wcs.ptr); +#endif + + return (int)n; +} + +int hawk_findgblwithucstr (hawk_t* awk, const hawk_uch_t* name) +{ + hawk_oow_t n; + hawk_ucs_t ncs; + hawk_bcs_t mbs; + + ncs.ptr = (hawk_uch_t*)name; + ncs.len = hawk_count_ucstr(name); + +#if defined(HAWK_OOCH_IS_BCH) + mbs.ptr = hawk_duputobcstr(awk, ncs.ptr, &mbs.len); + if (!mbs.ptr) return -1; + n = hawk_arr_search(awk->parse.gbls, HAWK_NUM_STATIC_GBLS, mbs.ptr, mbs.len); + if (n == HAWK_ARR_NIL) + { + hawk_seterrnum (awk, HAWK_ENOENT, &mbs); + hawk_freemem (awk, mbs.ptr); + return -1; + } + hawk_freemem (awk, mbs.ptr); +#else + n = hawk_arr_search(awk->parse.gbls, HAWK_NUM_STATIC_GBLS, ncs.ptr, ncs.len); + if (n == HAWK_ARR_NIL) + { + hawk_seterrnum (awk, HAWK_ENOENT, &ncs); + return -1; + } +#endif + + return (int)n; +} + + +static hawk_t* collect_globals (hawk_t* awk) +{ + if (MATCH(awk,TOK_NEWLINE)) + { + /* special check if the first name is on the + * same line when HAWK_NEWLINE is on */ + SETERR_COD (awk, HAWK_EVARMS); + return HAWK_NULL; + } + + while (1) + { + if (!MATCH(awk,TOK_IDENT)) + { + SETERR_TOK (awk, HAWK_EBADVAR); + return HAWK_NULL; + } + + if (add_global(awk, HAWK_OOECS_OOCS(awk->tok.name), &awk->tok.loc, 0) <= -1) return HAWK_NULL; + + if (get_token(awk) <= -1) return HAWK_NULL; + + if (MATCH_TERMINATOR_NORMAL(awk)) + { + /* skip a terminator (;, ) */ + if (get_token(awk) <= -1) return HAWK_NULL; + break; + } + + /* + * unlike collect_locals(), the right brace cannot + * terminate a global declaration as it can never be + * placed within a block. + * so do not perform MATCH_TERMINATOR_RBRACE(awk)) + */ + + if (!MATCH(awk,TOK_COMMA)) + { + SETERR_TOK (awk, HAWK_ECOMMA); + return HAWK_NULL; + } + + do + { + if (get_token(awk) <= -1) return HAWK_NULL; + } + while (MATCH(awk,TOK_NEWLINE)); + } + + return awk; +} + +static hawk_t* collect_locals (hawk_t* awk, hawk_oow_t nlcls, int istop) +{ + if (MATCH(awk,TOK_NEWLINE)) + { + /* special check if the first name is on the + * same line when HAWK_NEWLINE is on */ + SETERR_COD (awk, HAWK_EVARMS); + return HAWK_NULL; + } + + while (1) + { + hawk_oocs_t lcl; + hawk_oow_t n; + + if (!MATCH(awk,TOK_IDENT)) + { + SETERR_TOK (awk, HAWK_EBADVAR); + return HAWK_NULL; + } + + lcl = *HAWK_OOECS_OOCS(awk->tok.name); + + /* check if it conflicts with a builtin function name + * function f() { local length; } */ + if (hawk_findfncwithoocs(awk, &lcl) != HAWK_NULL) + { + SETERR_ARG_LOC (awk, HAWK_EFNCRED, lcl.ptr, lcl.len, &awk->tok.loc); + return HAWK_NULL; + } + + if (istop) + { + /* check if it conflicts with a parameter name. + * the first level declaration is treated as the same + * scope as the parameter list */ + n = hawk_arr_search(awk->parse.params, 0, lcl.ptr, lcl.len); + if (n != HAWK_ARR_NIL) + { + SETERR_ARG_LOC (awk, HAWK_EPARRED, lcl.ptr, lcl.len, &awk->tok.loc); + return HAWK_NULL; + } + } + + if (awk->opt.trait & HAWK_STRICTNAMING) + { + /* check if it conflicts with the owning function */ + if (awk->tree.cur_fun.ptr != HAWK_NULL) + { + if (hawk_comp_oochars(lcl.ptr, lcl.len, awk->tree.cur_fun.ptr, awk->tree.cur_fun.len, 0) == 0) + { + SETERR_ARG_LOC (awk, HAWK_EFUNRED, lcl.ptr, lcl.len, &awk->tok.loc); + return HAWK_NULL; + } + } + } + + /* check if it conflicts with other local variable names */ + n = hawk_arr_search(awk->parse.lcls, nlcls, lcl.ptr, lcl.len); + if (n != HAWK_ARR_NIL) + { + SETERR_ARG_LOC (awk, HAWK_EDUPLCL, lcl.ptr, lcl.len, &awk->tok.loc); + return HAWK_NULL; + } + + /* check if it conflicts with global variable names */ + n = find_global (awk, &lcl); + if (n != HAWK_ARR_NIL) + { + if (n < awk->tree.ngbls_base) + { + /* it is a conflict only if it is one of a + * static global variable */ + SETERR_ARG_LOC (awk, HAWK_EDUPLCL, lcl.ptr, lcl.len, &awk->tok.loc); + return HAWK_NULL; + } + } + + if (HAWK_ARR_SIZE(awk->parse.lcls) >= HAWK_MAX_LCLS) + { + SETERR_LOC (awk, HAWK_ELCLTM, &awk->tok.loc); + return HAWK_NULL; + } + + if (hawk_arr_insert (awk->parse.lcls, HAWK_ARR_SIZE(awk->parse.lcls), lcl.ptr, lcl.len) == HAWK_ARR_NIL) + { + SETERR_LOC (awk, HAWK_ENOMEM, &awk->tok.loc); + return HAWK_NULL; + } + + if (get_token(awk) <= -1) return HAWK_NULL; + + if (MATCH_TERMINATOR_NORMAL(awk)) + { + /* skip the terminator (;, ) */ + if (get_token(awk) <= -1) return HAWK_NULL; + break; + } + + if (MATCH_TERMINATOR_RBRACE(awk)) + { + /* should not skip } */ + break; + } + + if (!MATCH(awk,TOK_COMMA)) + { + SETERR_TOK (awk, HAWK_ECOMMA); + return HAWK_NULL; + } + + do + { + if (get_token(awk) <= -1) return HAWK_NULL; + } + while (MATCH(awk,TOK_NEWLINE)); + } + + return awk; +} + +static hawk_nde_t* parse_if (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_t* test = HAWK_NULL; + hawk_nde_t* then_part = HAWK_NULL; + hawk_nde_t* else_part = HAWK_NULL; + hawk_nde_if_t* nde; + hawk_loc_t eloc, tloc; + + if (!MATCH(awk,TOK_LPAREN)) + { + SETERR_TOK (awk, HAWK_ELPAREN); + return HAWK_NULL; + } + if (get_token(awk) <= -1) return HAWK_NULL; + + eloc = awk->tok.loc; + test = parse_expr_withdc(awk, &eloc); + if (test == HAWK_NULL) goto oops; + + if (!MATCH(awk,TOK_RPAREN)) + { + SETERR_TOK (awk, HAWK_ERPAREN); + goto oops; + } + +/* TODO: optimization. if you know 'test' evaluates to true or false, + * you can drop the 'if' statement and take either the 'then_part' + * or 'else_part'. */ + + if (get_token(awk) <= -1) goto oops; + + tloc = awk->tok.loc; + then_part = parse_statement(awk, &tloc); + if (then_part == HAWK_NULL) goto oops; + + /* skip any new lines before the else block */ + while (MATCH(awk,TOK_NEWLINE)) + { + if (get_token(awk) <= -1) goto oops; + } + + if (MATCH(awk,TOK_ELSE)) + { + if (get_token(awk) <= -1) goto oops; + + { + hawk_loc_t eloc; + eloc = awk->tok.loc; + else_part = parse_statement(awk, &eloc); + if (else_part == HAWK_NULL) goto oops; + } + } + + nde = (hawk_nde_if_t*)hawk_callocmem(awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) + { + ADJERR_LOC (awk, xloc); + goto oops; + } + + nde->type = HAWK_NDE_IF; + nde->loc = *xloc; + nde->test = test; + nde->then_part = then_part; + nde->else_part = else_part; + + return (hawk_nde_t*)nde; + +oops: + if (else_part) hawk_clrpt (awk, else_part); + if (then_part) hawk_clrpt (awk, then_part); + if (test) hawk_clrpt (awk, test); + return HAWK_NULL; +} + +static hawk_nde_t* parse_while (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_t* test = HAWK_NULL; + hawk_nde_t* body = HAWK_NULL; + hawk_nde_while_t* nde; + hawk_loc_t ploc; + + if (!MATCH(awk,TOK_LPAREN)) + { + SETERR_TOK (awk, HAWK_ELPAREN); + goto oops; + } + if (get_token(awk) <= -1) goto oops; + + ploc = awk->tok.loc; + test = parse_expr_withdc (awk, &ploc); + if (test == HAWK_NULL) goto oops; + + if (!MATCH(awk,TOK_RPAREN)) + { + SETERR_TOK (awk, HAWK_ERPAREN); + goto oops; + } + + if (get_token(awk) <= -1) goto oops; + + ploc = awk->tok.loc; + body = parse_statement (awk, &ploc); + if (body == HAWK_NULL) goto oops; + + nde = (hawk_nde_while_t*) hawk_callocmem (awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) + { + ADJERR_LOC (awk, xloc); + goto oops; + } + + nde->type = HAWK_NDE_WHILE; + nde->loc = *xloc; + nde->test = test; + nde->body = body; + + return (hawk_nde_t*)nde; + +oops: + if (body) hawk_clrpt (awk, body); + if (test) hawk_clrpt (awk, test); + return HAWK_NULL; +} + +static hawk_nde_t* parse_for (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_t* init = HAWK_NULL, * test = HAWK_NULL; + hawk_nde_t* incr = HAWK_NULL, * body = HAWK_NULL; + hawk_nde_for_t* nde_for; + hawk_nde_foreach_t* nde_foreach; + hawk_loc_t ploc; + + if (!MATCH(awk,TOK_LPAREN)) + { + SETERR_TOK (awk, HAWK_ELPAREN); + return HAWK_NULL; + } + if (get_token(awk) <= -1) return HAWK_NULL; + + if (!MATCH(awk,TOK_SEMICOLON)) + { + /* this line is very ugly. it checks the entire next + * expression or the first element in the expression + * is wrapped by a parenthesis */ + int no_foreach = MATCH(awk,TOK_LPAREN); + + ploc = awk->tok.loc; + init = parse_expr_withdc (awk, &ploc); + if (init == HAWK_NULL) goto oops; + + if (!no_foreach && init->type == HAWK_NDE_EXP_BIN && + ((hawk_nde_exp_t*)init)->opcode == HAWK_BINOP_IN && + is_plain_var(((hawk_nde_exp_t*)init)->left)) + { + /* switch to foreach - for (x in y) */ + + if (!MATCH(awk,TOK_RPAREN)) + { + SETERR_TOK (awk, HAWK_ERPAREN); + goto oops; + } + + if (get_token(awk) <= -1) goto oops; + + ploc = awk->tok.loc; + body = parse_statement (awk, &ploc); + if (body == HAWK_NULL) goto oops; + + nde_foreach = (hawk_nde_foreach_t*) hawk_callocmem ( + awk, HAWK_SIZEOF(*nde_foreach)); + if (nde_foreach == HAWK_NULL) + { + ADJERR_LOC (awk, xloc); + goto oops; + } + + nde_foreach->type = HAWK_NDE_FOREACH; + nde_foreach->loc = *xloc; + nde_foreach->test = init; + nde_foreach->body = body; + + return (hawk_nde_t*)nde_foreach; + } + + if (!MATCH(awk,TOK_SEMICOLON)) + { + SETERR_TOK (awk, HAWK_ESCOLON); + goto oops; + } + } + + do + { + if (get_token(awk) <= -1) goto oops; + /* skip new lines after the first semicolon */ + } + while (MATCH(awk,TOK_NEWLINE)); + + if (!MATCH(awk,TOK_SEMICOLON)) + { + ploc = awk->tok.loc; + test = parse_expr_withdc (awk, &ploc); + if (test == HAWK_NULL) goto oops; + + if (!MATCH(awk,TOK_SEMICOLON)) + { + SETERR_TOK (awk, HAWK_ESCOLON); + goto oops; + } + } + + do + { + if (get_token(awk) <= -1) goto oops; + /* skip new lines after the second semicolon */ + } + while (MATCH(awk,TOK_NEWLINE)); + + if (!MATCH(awk,TOK_RPAREN)) + { + { + hawk_loc_t eloc; + + eloc = awk->tok.loc; + incr = parse_expr_withdc (awk, &eloc); + if (incr == HAWK_NULL) goto oops; + } + + if (!MATCH(awk,TOK_RPAREN)) + { + SETERR_TOK (awk, HAWK_ERPAREN); + goto oops; + } + } + + if (get_token(awk) <= -1) goto oops; + + ploc = awk->tok.loc; + body = parse_statement (awk, &ploc); + if (body == HAWK_NULL) goto oops; + + nde_for = (hawk_nde_for_t*) hawk_callocmem (awk, HAWK_SIZEOF(*nde_for)); + if (nde_for == HAWK_NULL) + { + ADJERR_LOC (awk, xloc); + goto oops; + } + + nde_for->type = HAWK_NDE_FOR; + nde_for->loc = *xloc; + nde_for->init = init; + nde_for->test = test; + nde_for->incr = incr; + nde_for->body = body; + + return (hawk_nde_t*)nde_for; + +oops: + if (init) hawk_clrpt (awk, init); + if (test) hawk_clrpt (awk, test); + if (incr) hawk_clrpt (awk, incr); + if (body) hawk_clrpt (awk, body); + return HAWK_NULL; +} + +static hawk_nde_t* parse_dowhile (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_t* test = HAWK_NULL; + hawk_nde_t* body = HAWK_NULL; + hawk_nde_while_t* nde; + hawk_loc_t ploc; + + HAWK_ASSERT (awk, awk->ptok.type == TOK_DO); + + ploc = awk->tok.loc; + body = parse_statement (awk, &ploc); + if (body == HAWK_NULL) goto oops; + + while (MATCH(awk,TOK_NEWLINE)) + { + if (get_token(awk) <= -1) goto oops; + } + + if (!MATCH(awk,TOK_WHILE)) + { + SETERR_TOK (awk, HAWK_EKWWHL); + goto oops; + } + + if (get_token(awk) <= -1) goto oops; + + if (!MATCH(awk,TOK_LPAREN)) + { + SETERR_TOK (awk, HAWK_ELPAREN); + goto oops; + } + + if (get_token(awk) <= -1) goto oops; + + ploc = awk->tok.loc; + test = parse_expr_withdc (awk, &ploc); + if (test == HAWK_NULL) goto oops; + + if (!MATCH(awk,TOK_RPAREN)) + { + SETERR_TOK (awk, HAWK_ERPAREN); + goto oops; + } + + if (get_token(awk) <= -1) goto oops; + + nde = (hawk_nde_while_t*) hawk_callocmem (awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) + { + ADJERR_LOC (awk, xloc); + goto oops; + } + + nde->type = HAWK_NDE_DOWHILE; + nde->loc = *xloc; + nde->test = test; + nde->body = body; + + return (hawk_nde_t*)nde; + +oops: + if (body) hawk_clrpt (awk, body); + if (test) hawk_clrpt (awk, test); + HAWK_ASSERT (awk, nde == HAWK_NULL); + return HAWK_NULL; +} + +static hawk_nde_t* parse_break (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_break_t* nde; + + HAWK_ASSERT (awk, awk->ptok.type == TOK_BREAK); + if (awk->parse.depth.loop <= 0) + { + SETERR_LOC (awk, HAWK_EBREAK, xloc); + return HAWK_NULL; + } + + nde = (hawk_nde_break_t*) hawk_callocmem (awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) + { + ADJERR_LOC (awk, xloc); + return HAWK_NULL; + } + + nde->type = HAWK_NDE_BREAK; + nde->loc = *xloc; + + return (hawk_nde_t*)nde; +} + +static hawk_nde_t* parse_continue (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_continue_t* nde; + + HAWK_ASSERT (awk, awk->ptok.type == TOK_CONTINUE); + if (awk->parse.depth.loop <= 0) + { + SETERR_LOC (awk, HAWK_ECONTINUE, xloc); + return HAWK_NULL; + } + + nde = (hawk_nde_continue_t*) hawk_callocmem (awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) + { + ADJERR_LOC (awk, xloc); + return HAWK_NULL; + } + + nde->type = HAWK_NDE_CONTINUE; + nde->loc = *xloc; + + return (hawk_nde_t*)nde; +} + +static hawk_nde_t* parse_return (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_return_t* nde; + hawk_nde_t* val; + + HAWK_ASSERT (awk, awk->ptok.type == TOK_RETURN); + + nde = (hawk_nde_return_t*) hawk_callocmem ( awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) + { + ADJERR_LOC (awk, xloc); + return HAWK_NULL; + } + + nde->type = HAWK_NDE_RETURN; + nde->loc = *xloc; + + if (MATCH_TERMINATOR(awk)) + { + /* no return value */ + val = HAWK_NULL; + } + else + { + hawk_loc_t eloc; + + eloc = awk->tok.loc; + val = parse_expr_withdc (awk, &eloc); + if (val == HAWK_NULL) + { + hawk_freemem (awk, nde); + return HAWK_NULL; + } + } + + nde->val = val; + return (hawk_nde_t*)nde; +} + +static hawk_nde_t* parse_exit (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_exit_t* nde; + hawk_nde_t* val; + + HAWK_ASSERT (awk, awk->ptok.type == TOK_EXIT || awk->ptok.type == TOK_XABORT); + + nde = (hawk_nde_exit_t*) hawk_callocmem (awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) + { + ADJERR_LOC (awk, xloc); + return HAWK_NULL; + } + + nde->type = HAWK_NDE_EXIT; + nde->loc = *xloc; + nde->abort = (awk->ptok.type == TOK_XABORT); + + if (MATCH_TERMINATOR(awk)) + { + /* no exit code */ + val = HAWK_NULL; + } + else + { + hawk_loc_t eloc; + + eloc = awk->tok.loc; + val = parse_expr_withdc (awk, &eloc); + if (val == HAWK_NULL) + { + hawk_freemem (awk, nde); + return HAWK_NULL; + } + } + + nde->val = val; + return (hawk_nde_t*)nde; +} + +static hawk_nde_t* parse_next (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_next_t* nde; + + HAWK_ASSERT (awk, awk->ptok.type == TOK_NEXT); + + if (awk->parse.id.block == PARSE_BEGIN_BLOCK) + { + SETERR_LOC (awk, HAWK_ENEXTBEG, xloc); + return HAWK_NULL; + } + if (awk->parse.id.block == PARSE_END_BLOCK) + { + SETERR_LOC (awk, HAWK_ENEXTEND, xloc); + return HAWK_NULL; + } + + nde = (hawk_nde_next_t*) hawk_callocmem (awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) + { + ADJERR_LOC (awk, xloc); + return HAWK_NULL; + } + nde->type = HAWK_NDE_NEXT; + nde->loc = *xloc; + + return (hawk_nde_t*)nde; +} + +static hawk_nde_t* parse_nextfile ( + hawk_t* awk, const hawk_loc_t* xloc, int out) +{ + hawk_nde_nextfile_t* nde; + + if (!out && awk->parse.id.block == PARSE_BEGIN_BLOCK) + { + SETERR_LOC (awk, HAWK_ENEXTFBEG, xloc); + return HAWK_NULL; + } + if (!out && awk->parse.id.block == PARSE_END_BLOCK) + { + SETERR_LOC (awk, HAWK_ENEXTFEND, xloc); + return HAWK_NULL; + } + + nde = (hawk_nde_nextfile_t*) hawk_callocmem (awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) + { + ADJERR_LOC (awk, xloc); + return HAWK_NULL; + } + + nde->type = HAWK_NDE_NEXTFILE; + nde->loc = *xloc; + nde->out = out; + + return (hawk_nde_t*)nde; +} + +static hawk_nde_t* parse_delete (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_delete_t* nde; + hawk_nde_t* var = HAWK_NULL; + hawk_loc_t dloc; + hawk_nde_type_t type; + int inparen = 0; + + HAWK_ASSERT (awk, awk->ptok.type == TOK_DELETE || + awk->ptok.type == TOK_XRESET); + + type = (awk->ptok.type == TOK_DELETE)? + HAWK_NDE_DELETE: HAWK_NDE_RESET; + + if (MATCH(awk,TOK_LPAREN)) + { + if (get_token(awk) <= -1) goto oops; + inparen = 1; + } + + if (!MATCH(awk,TOK_IDENT)) + { + SETERR_TOK (awk, HAWK_EIDENT); + goto oops; + } + + dloc = awk->tok.loc; + var = parse_primary_ident (awk, &dloc); + if (var == HAWK_NULL) goto oops; + + if ((type == HAWK_NDE_DELETE && !is_var (var)) || + (type == HAWK_NDE_RESET && !is_plain_var (var))) + { + SETERR_LOC (awk, HAWK_EBADARG, &dloc); + goto oops; + } + + if (inparen) + { + if (!MATCH(awk,TOK_RPAREN)) + { + SETERR_TOK (awk, HAWK_ERPAREN); + goto oops; + } + + if (get_token(awk) <= -1) goto oops; + } + + nde = (hawk_nde_delete_t*) hawk_callocmem (awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) + { + ADJERR_LOC (awk, xloc); + goto oops; + } + + nde->type = type; + nde->loc = *xloc; + nde->var = var; + + return (hawk_nde_t*)nde; + +oops: + if (var) hawk_clrpt (awk, var); + return HAWK_NULL; +} + +static hawk_nde_t* parse_print (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_print_t* nde; + hawk_nde_t* args = HAWK_NULL; + hawk_nde_t* out = HAWK_NULL; + int out_type; + hawk_nde_type_t type; + hawk_loc_t eloc; + + HAWK_ASSERT (awk, awk->ptok.type == TOK_PRINT || + awk->ptok.type == TOK_PRINTF); + + type = (awk->ptok.type == TOK_PRINT)? + HAWK_NDE_PRINT: HAWK_NDE_PRINTF; + + if (!MATCH_TERMINATOR(awk) && + !MATCH(awk,TOK_GT) && + !MATCH(awk,TOK_RS) && + !MATCH(awk,TOK_BOR) && + !MATCH(awk,TOK_LOR)) + { + hawk_nde_t* args_tail; + hawk_nde_t* tail_prev; + + int in_parens = 0, gm_in_parens = 0; + hawk_oow_t opening_lparen_seq; + + if (MATCH(awk,TOK_LPAREN)) + { + /* just remember the sequence number of the left + * parenthesis before calling parse_expr_withdc() + * that eventually calls parse_primary_lparen() */ + opening_lparen_seq = awk->parse.lparen_seq; + in_parens = 1; /* maybe. not confirmed yet */ + + /* print and printf provide weird syntaxs. + * + * 1. print 10, 20; + * 2. print (10, 20); + * 3. print (10,20,30) in a; + * 4. print ((10,20,30) in a); + * + * Due to case 3, i can't consume LPAREN + * here and expect RPAREN later. + */ + } + + eloc = awk->tok.loc; + args = parse_expr_withdc (awk, &eloc); + if (args == HAWK_NULL) goto oops; + + args_tail = args; + tail_prev = HAWK_NULL; + + if (args->type != HAWK_NDE_GRP) + { + /* args->type == HAWK_NDE_GRP when print (a, b, c) + * args->type != HAWK_NDE_GRP when print a, b, c */ + hawk_oow_t group_opening_lparen_seq; + + while (MATCH(awk,TOK_COMMA)) + { + do + { + if (get_token(awk) <= -1) goto oops; + } + while (MATCH(awk,TOK_NEWLINE)); + + /* if it's grouped, i must check if the last group member + * is enclosed in parentheses. + * + * i set the condition to false whenever i see + * a new group member. */ + gm_in_parens = 0; + if (MATCH(awk,TOK_LPAREN)) + { + group_opening_lparen_seq = awk->parse.lparen_seq; + gm_in_parens = 1; /* maybe */ + } + + eloc = awk->tok.loc; + args_tail->next = parse_expr_withdc (awk, &eloc); + if (args_tail->next == HAWK_NULL) goto oops; + + tail_prev = args_tail; + args_tail = args_tail->next; + + if (gm_in_parens == 1 && awk->ptok.type == TOK_RPAREN && + awk->parse.lparen_last_closed == group_opening_lparen_seq) + { + /* confirm that the last group seen so far + * is parenthesized */ + gm_in_parens = 2; + } + } + } + + /* print 1 > 2 would print 1 to the file named 2. + * print (1 > 2) would print (1 > 2) on the console + * + * think of all these... there are many more possible combinations. + * + * print ((10,20,30) in a) > "x"; + * print ((10,20,30) in a) + * print ((10,20,30) in a) > ("x"); + * print ((10,20,30) in a) > (("x")); + * function abc() { return "abc"; } BEGIN { print (1 > abc()); } + * function abc() { return "abc"; } BEGIN { print 1 > abc(); } + * print 1, 2, 3 > 4; + * print (1, 2, 3) > 4; + * print ((1, 2, 3) > 4); + * print 1, 2, 3 > 4 + 5; + * print 1, 2, (3 > 4) > 5; + * print 1, 2, (3 > 4) > 5 + 6; + */ + if (in_parens == 1 && awk->ptok.type == TOK_RPAREN && + awk->parse.lparen_last_closed == opening_lparen_seq) + { + in_parens = 2; /* confirmed */ + } + + if (in_parens != 2 && gm_in_parens != 2 && args_tail->type == HAWK_NDE_EXP_BIN) + { + int i; + hawk_nde_exp_t* ep = (hawk_nde_exp_t*)args_tail; + static struct + { + int opc; + int out; + int opt; + } tab[] = + { + { + HAWK_BINOP_GT, + HAWK_OUT_FILE, + 0 + }, + { + HAWK_BINOP_RS, + HAWK_OUT_APFILE, + 0 + }, + { + HAWK_BINOP_BOR, + HAWK_OUT_PIPE, + 0 + }, + { + HAWK_BINOP_LOR, + HAWK_OUT_RWPIPE, + HAWK_RWPIPE + } + }; + + for (i = 0; i < HAWK_COUNTOF(tab); i++) + { + if (ep->opcode == tab[i].opc) + { + hawk_nde_t* tmp; + + if (tab[i].opt && !(awk->opt.trait & tab[i].opt)) break; + + tmp = args_tail; + + if (tail_prev != HAWK_NULL) + tail_prev->next = ep->left; + else args = ep->left; + + out = ep->right; + out_type = tab[i].out; + + hawk_freemem (awk, tmp); + break; + } + } + } + } + + if (!out) + { + out_type = MATCH(awk,TOK_GT)? HAWK_OUT_FILE: + MATCH(awk,TOK_RS)? HAWK_OUT_APFILE: + MATCH(awk,TOK_BOR)? HAWK_OUT_PIPE: + ((awk->opt.trait & HAWK_RWPIPE) && + MATCH(awk,TOK_LOR))? HAWK_OUT_RWPIPE: + HAWK_OUT_CONSOLE; + + if (out_type != HAWK_OUT_CONSOLE) + { + if (get_token(awk) <= -1) goto oops; + + eloc = awk->tok.loc; + out = parse_expr_withdc (awk, &eloc); + if (out == HAWK_NULL) goto oops; + } + } + + if (type == HAWK_NDE_PRINTF && !args) + { + SETERR_LOC (awk, HAWK_ENOARG, xloc); + goto oops; + } + + nde = (hawk_nde_print_t*) hawk_callocmem (awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) + { + ADJERR_LOC (awk, xloc); + goto oops; + } + + nde->type = type; + nde->loc = *xloc; + nde->args = args; + nde->out_type = out_type; + nde->out = out; + + return (hawk_nde_t*)nde; + +oops: + if (args) hawk_clrpt (awk, args); + if (out) hawk_clrpt (awk, out); + return HAWK_NULL; +} + +static hawk_nde_t* parse_statement_nb ( + hawk_t* awk, const hawk_loc_t* xloc) +{ + /* parse a non-block statement */ + hawk_nde_t* nde; + + /* keywords that don't require any terminating semicolon */ + if (MATCH(awk,TOK_IF)) + { + if (get_token(awk) <= -1) return HAWK_NULL; + return parse_if (awk, xloc); + } + else if (MATCH(awk,TOK_WHILE)) + { + if (get_token(awk) <= -1) return HAWK_NULL; + + awk->parse.depth.loop++; + nde = parse_while (awk, xloc); + awk->parse.depth.loop--; + + return nde; + } + else if (MATCH(awk,TOK_FOR)) + { + if (get_token(awk) <= -1) return HAWK_NULL; + + awk->parse.depth.loop++; + nde = parse_for (awk, xloc); + awk->parse.depth.loop--; + + return nde; + } + + /* keywords that require a terminating semicolon */ + if (MATCH(awk,TOK_DO)) + { + if (get_token(awk) <= -1) return HAWK_NULL; + + awk->parse.depth.loop++; + nde = parse_dowhile (awk, xloc); + awk->parse.depth.loop--; + + return nde; + } + else if (MATCH(awk,TOK_BREAK)) + { + if (get_token(awk) <= -1) return HAWK_NULL; + nde = parse_break (awk, xloc); + } + else if (MATCH(awk,TOK_CONTINUE)) + { + if (get_token(awk) <= -1) return HAWK_NULL; + nde = parse_continue (awk, xloc); + } + else if (MATCH(awk,TOK_RETURN)) + { + if (get_token(awk) <= -1) return HAWK_NULL; + nde = parse_return (awk, xloc); + } + else if (MATCH(awk,TOK_EXIT) || MATCH(awk,TOK_XABORT)) + { + if (get_token(awk) <= -1) return HAWK_NULL; + nde = parse_exit (awk, xloc); + } + else if (MATCH(awk,TOK_NEXT)) + { + if (get_token(awk) <= -1) return HAWK_NULL; + nde = parse_next (awk, xloc); + } + else if (MATCH(awk,TOK_NEXTFILE)) + { + if (get_token(awk) <= -1) return HAWK_NULL; + nde = parse_nextfile (awk, xloc, 0); + } + else if (MATCH(awk,TOK_NEXTOFILE)) + { + if (get_token(awk) <= -1) return HAWK_NULL; + nde = parse_nextfile (awk, xloc, 1); + } + else if (MATCH(awk,TOK_DELETE) || MATCH(awk,TOK_XRESET)) + { + if (get_token(awk) <= -1) return HAWK_NULL; + nde = parse_delete (awk, xloc); + } + else if (!(awk->opt.trait & HAWK_TOLERANT)) + { + /* in the non-tolerant mode, we treat print and printf + * as a separate statement */ + if (MATCH(awk,TOK_PRINT) || MATCH(awk,TOK_PRINTF)) + { + if (get_token(awk) <= -1) return HAWK_NULL; + nde = parse_print (awk, xloc); + } + else nde = parse_expr_withdc (awk, xloc); + } + else + { + nde = parse_expr_withdc (awk, xloc); + } + + if (nde == HAWK_NULL) return HAWK_NULL; + + if (MATCH_TERMINATOR_NORMAL(awk)) + { + /* check if a statement ends with a semicolon or */ + if (get_token(awk) <= -1) + { + if (nde != HAWK_NULL) hawk_clrpt (awk, nde); + return HAWK_NULL; + } + } + else if (MATCH_TERMINATOR_RBRACE(awk)) + { + /* do not skip the right brace as a statement terminator. + * is there anything to do here? */ + } + else + { + if (nde != HAWK_NULL) hawk_clrpt (awk, nde); + SETERR_LOC (awk, HAWK_ESTMEND, &awk->ptok.loc); + return HAWK_NULL; + } + + return nde; +} + +static hawk_nde_t* parse_statement (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_t* nde; + + /* skip new lines before a statement */ + while (MATCH(awk,TOK_NEWLINE)) + { + if (get_token(awk) <= -1) return HAWK_NULL; + } + + if (MATCH(awk,TOK_SEMICOLON)) + { + /* null statement */ + nde = (hawk_nde_t*)hawk_callocmem(awk, HAWK_SIZEOF(*nde)); + if (!nde) + { + ADJERR_LOC (awk, xloc); + return HAWK_NULL; + } + + nde->type = HAWK_NDE_NULL; + nde->loc = *xloc; + nde->next = HAWK_NULL; + + if (get_token(awk) <= -1) + { + hawk_freemem (awk, nde); + return HAWK_NULL; + } + } + else if (MATCH(awk,TOK_LBRACE)) + { + /* a block statemnt { ... } */ + hawk_loc_t tloc; + + tloc = awk->ptok.loc; + if (get_token(awk) <= -1) return HAWK_NULL; + nde = parse_block_dc (awk, &tloc, 0); + } + else + { + /* the statement id held in awk->parse.id.stmt denotes + * the token id of the statement currently being parsed. + * the current statement id is saved here because the + * statement id can be changed in parse_statement_nb. + * it will, in turn, call parse_statement which will + * eventually change the statement id. */ + int old_id; + hawk_loc_t tloc; + + old_id = awk->parse.id.stmt; + tloc = awk->tok.loc; + + /* set the current statement id */ + awk->parse.id.stmt = awk->tok.type; + + /* proceed parsing the statement */ + nde = parse_statement_nb (awk, &tloc); + + /* restore the statement id saved previously */ + awk->parse.id.stmt = old_id; + } + + return nde; +} + +static int assign_to_opcode (hawk_t* awk) +{ + /* synchronize it with hawk_assop_type_t in run.h */ + static int assop[] = + { + HAWK_ASSOP_NONE, + HAWK_ASSOP_PLUS, + HAWK_ASSOP_MINUS, + HAWK_ASSOP_MUL, + HAWK_ASSOP_DIV, + HAWK_ASSOP_IDIV, + HAWK_ASSOP_MOD, + HAWK_ASSOP_EXP, + HAWK_ASSOP_CONCAT, + HAWK_ASSOP_RS, + HAWK_ASSOP_LS, + HAWK_ASSOP_BAND, + HAWK_ASSOP_BXOR, + HAWK_ASSOP_BOR + }; + + if (awk->tok.type >= TOK_ASSN && + awk->tok.type <= TOK_BOR_ASSN) + { + return assop[awk->tok.type - TOK_ASSN]; + } + + return -1; +} + +static hawk_nde_t* parse_expr_basic (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_t* nde, * n1, * n2; + + nde = parse_logical_or (awk, xloc); + if (nde == HAWK_NULL) return HAWK_NULL; + + if (MATCH(awk,TOK_QUEST)) + if (MATCH(awk,TOK_QUEST)) + { + hawk_loc_t eloc; + hawk_nde_cnd_t* cnd; + + if (get_token(awk) <= -1) + { + hawk_clrpt (awk, nde); + return HAWK_NULL; + } + + eloc = awk->tok.loc; + n1 = parse_expr_withdc (awk, &eloc); + if (n1 == HAWK_NULL) + { + hawk_clrpt (awk, nde); + return HAWK_NULL; + } + + if (!MATCH(awk,TOK_COLON)) + { + hawk_clrpt (awk, nde); + hawk_clrpt (awk, n1); + SETERR_TOK (awk, HAWK_ECOLON); + return HAWK_NULL; + } + if (get_token(awk) <= -1) + { + hawk_clrpt (awk, nde); + hawk_clrpt (awk, n1); + return HAWK_NULL; + } + + eloc = awk->tok.loc; + n2 = parse_expr_withdc (awk, &eloc); + if (n2 == HAWK_NULL) + { + hawk_clrpt (awk, nde); + hawk_clrpt (awk, n1); + return HAWK_NULL; + } + + cnd = (hawk_nde_cnd_t*)hawk_callocmem(awk, HAWK_SIZEOF(*cnd)); + if (cnd == HAWK_NULL) + { + hawk_clrpt (awk, nde); + hawk_clrpt (awk, n1); + hawk_clrpt (awk, n2); + ADJERR_LOC (awk, xloc); + return HAWK_NULL; + } + + cnd->type = HAWK_NDE_CND; + cnd->loc = *xloc; + cnd->next = HAWK_NULL; + cnd->test = nde; + cnd->left = n1; + cnd->right = n2; + + nde = (hawk_nde_t*)cnd; + } + + return nde; +} + +static hawk_nde_t* parse_expr (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_t* x, * y; + hawk_nde_ass_t* nde; + int opcode; + + x = parse_expr_basic (awk, xloc); + if (x == HAWK_NULL) return HAWK_NULL; + + opcode = assign_to_opcode (awk); + if (opcode <= -1) + { + /* no assignment operator found. */ + return x; + } + + HAWK_ASSERT (awk, x->next == HAWK_NULL); + if (!is_var(x) && x->type != HAWK_NDE_POS) + { + hawk_clrpt (awk, x); + SETERR_LOC (awk, HAWK_EASSIGN, xloc); + return HAWK_NULL; + } + + if (get_token(awk) <= -1) + { + hawk_clrpt (awk, x); + return HAWK_NULL; + } + + { + hawk_loc_t eloc; + eloc = awk->tok.loc; + y = parse_expr_withdc (awk, &eloc); + } + if (y == HAWK_NULL) + { + hawk_clrpt (awk, x); + return HAWK_NULL; + } + + nde = (hawk_nde_ass_t*)hawk_callocmem(awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) + { + hawk_clrpt (awk, x); + hawk_clrpt (awk, y); + ADJERR_LOC (awk, xloc); + return HAWK_NULL; + } + + nde->type = HAWK_NDE_ASS; + nde->loc = *xloc; + nde->next = HAWK_NULL; + nde->opcode = opcode; + nde->left = x; + nde->right = y; + + return (hawk_nde_t*)nde; +} + +static hawk_nde_t* parse_expr_withdc (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_t* nde; + + /* perform depth check before parsing expression */ + + if (awk->opt.depth.s.expr_parse > 0 && + awk->parse.depth.expr >= awk->opt.depth.s.expr_parse) + { + SETERR_LOC (awk, HAWK_EEXPRNST, xloc); + return HAWK_NULL; + } + + awk->parse.depth.expr++; + nde = parse_expr(awk, xloc); + awk->parse.depth.expr--; + + return nde; +} + +#define INT_BINOP_INT(x,op,y) \ + (((hawk_nde_int_t*)x)->val op ((hawk_nde_int_t*)y)->val) + +#define INT_BINOP_FLT(x,op,y) \ + (((hawk_nde_int_t*)x)->val op ((hawk_nde_flt_t*)y)->val) + +#define FLT_BINOP_INT(x,op,y) \ + (((hawk_nde_flt_t*)x)->val op ((hawk_nde_int_t*)y)->val) + +#define FLT_BINOP_FLT(x,op,y) \ + (((hawk_nde_flt_t*)x)->val op ((hawk_nde_flt_t*)y)->val) + +union folded_t +{ + hawk_int_t l; + hawk_flt_t r; +}; +typedef union folded_t folded_t; + +static int fold_constants_for_binop ( + hawk_t* awk, hawk_nde_t* left, hawk_nde_t* right, + int opcode, folded_t* folded) +{ + int fold = -1; + + /* TODO: can i shorten various comparisons below? + * i hate to repeat similar code just for type difference */ + + if (left->type == HAWK_NDE_INT && + right->type == HAWK_NDE_INT) + { + fold = HAWK_NDE_INT; + switch (opcode) + { + case HAWK_BINOP_PLUS: + folded->l = INT_BINOP_INT(left,+,right); + break; + + case HAWK_BINOP_MINUS: + folded->l = INT_BINOP_INT(left,-,right); + break; + + case HAWK_BINOP_MUL: + folded->l = INT_BINOP_INT(left,*,right); + break; + + case HAWK_BINOP_DIV: + if (((hawk_nde_int_t*)right)->val == 0) + { + hawk_seterrnum (awk, HAWK_EDIVBY0, HAWK_NULL); + fold = -2; /* error */ + } + else if (INT_BINOP_INT(left,%,right)) + { + folded->r = (hawk_flt_t)((hawk_nde_int_t*)left)->val / + (hawk_flt_t)((hawk_nde_int_t*)right)->val; + fold = HAWK_NDE_FLT; + } + else + { + folded->l = INT_BINOP_INT(left,/,right); + } + break; + + case HAWK_BINOP_IDIV: + if (((hawk_nde_int_t*)right)->val == 0) + { + hawk_seterrnum (awk, HAWK_EDIVBY0, HAWK_NULL); + fold = -2; /* error */ + } + else + { + folded->l = INT_BINOP_INT(left,/,right); + } + break; + + case HAWK_BINOP_MOD: + folded->l = INT_BINOP_INT(left,%,right); + break; + + default: + fold = -1; /* no folding */ + break; + } + } + else if (left->type == HAWK_NDE_FLT && + right->type == HAWK_NDE_FLT) + { + fold = HAWK_NDE_FLT; + switch (opcode) + { + case HAWK_BINOP_PLUS: + folded->r = FLT_BINOP_FLT(left,+,right); + break; + + case HAWK_BINOP_MINUS: + folded->r = FLT_BINOP_FLT(left,-,right); + break; + + case HAWK_BINOP_MUL: + folded->r = FLT_BINOP_FLT(left,*,right); + break; + + case HAWK_BINOP_DIV: + folded->r = FLT_BINOP_FLT(left,/,right); + break; + + case HAWK_BINOP_IDIV: + folded->l = (hawk_int_t)FLT_BINOP_FLT(left,/,right); + fold = HAWK_NDE_INT; + break; + + case HAWK_BINOP_MOD: + folded->r = awk->prm.math.mod ( + awk, + ((hawk_nde_flt_t*)left)->val, + ((hawk_nde_flt_t*)right)->val + ); + break; + + default: + fold = -1; + break; + } + } + else if (left->type == HAWK_NDE_INT && + right->type == HAWK_NDE_FLT) + { + fold = HAWK_NDE_FLT; + switch (opcode) + { + case HAWK_BINOP_PLUS: + folded->r = INT_BINOP_FLT(left,+,right); + break; + + case HAWK_BINOP_MINUS: + folded->r = INT_BINOP_FLT(left,-,right); + break; + + case HAWK_BINOP_MUL: + folded->r = INT_BINOP_FLT(left,*,right); + break; + + case HAWK_BINOP_DIV: + folded->r = INT_BINOP_FLT(left,/,right); + break; + + case HAWK_BINOP_IDIV: + folded->l = (hawk_int_t) + ((hawk_flt_t)((hawk_nde_int_t*)left)->val / + ((hawk_nde_flt_t*)right)->val); + fold = HAWK_NDE_INT; + break; + + case HAWK_BINOP_MOD: + folded->r = awk->prm.math.mod ( + awk, + (hawk_flt_t)((hawk_nde_int_t*)left)->val, + ((hawk_nde_flt_t*)right)->val + ); + break; + + default: + fold = -1; + break; + } + } + else if (left->type == HAWK_NDE_FLT && + right->type == HAWK_NDE_INT) + { + fold = HAWK_NDE_FLT; + switch (opcode) + { + case HAWK_BINOP_PLUS: + folded->r = FLT_BINOP_INT(left,+,right); + break; + + case HAWK_BINOP_MINUS: + folded->r = FLT_BINOP_INT(left,-,right); + break; + + case HAWK_BINOP_MUL: + folded->r = FLT_BINOP_INT(left,*,right); + break; + + case HAWK_BINOP_DIV: + folded->r = FLT_BINOP_INT(left,/,right); + break; + + case HAWK_BINOP_IDIV: + folded->l = (hawk_int_t) + (((hawk_nde_int_t*)left)->val / + (hawk_flt_t)((hawk_nde_int_t*)right)->val); + fold = HAWK_NDE_INT; + break; + + case HAWK_BINOP_MOD: + folded->r = awk->prm.math.mod ( + awk, + ((hawk_nde_flt_t*)left)->val, + (hawk_flt_t)((hawk_nde_int_t*)right)->val + ); + break; + + default: + fold = -1; + break; + } + } + + return fold; +} + +static hawk_nde_t* new_exp_bin_node ( + hawk_t* awk, const hawk_loc_t* loc, + int opcode, hawk_nde_t* left, hawk_nde_t* right) +{ + hawk_nde_exp_t* tmp; + + tmp = (hawk_nde_exp_t*) hawk_callocmem (awk, HAWK_SIZEOF(*tmp)); + if (tmp) + { + tmp->type = HAWK_NDE_EXP_BIN; + tmp->loc = *loc; + tmp->opcode = opcode; + tmp->left = left; + tmp->right = right; + } + else ADJERR_LOC (awk, loc); + + return (hawk_nde_t*)tmp; +} + +static hawk_nde_t* new_int_node ( + hawk_t* awk, hawk_int_t lv, const hawk_loc_t* loc) +{ + hawk_nde_int_t* tmp; + + tmp = (hawk_nde_int_t*) hawk_callocmem (awk, HAWK_SIZEOF(*tmp)); + if (tmp) + { + tmp->type = HAWK_NDE_INT; + tmp->loc = *loc; + tmp->val = lv; + } + else ADJERR_LOC (awk, loc); + + return (hawk_nde_t*)tmp; +} + +static hawk_nde_t* new_flt_node ( + hawk_t* awk, hawk_flt_t rv, const hawk_loc_t* loc) +{ + hawk_nde_flt_t* tmp; + + tmp = (hawk_nde_flt_t*) hawk_callocmem (awk, HAWK_SIZEOF(*tmp)); + if (tmp) + { + tmp->type = HAWK_NDE_FLT; + tmp->loc = *loc; + tmp->val = rv; + } + else ADJERR_LOC (awk, loc); + + return (hawk_nde_t*)tmp; +} + +static HAWK_INLINE void update_int_node ( + hawk_t* awk, hawk_nde_int_t* node, hawk_int_t lv) +{ + node->val = lv; + if (node->str) + { + hawk_freemem (awk, node->str); + node->str = HAWK_NULL; + node->len = 0; + } +} + +static HAWK_INLINE void update_flt_node ( + hawk_t* awk, hawk_nde_flt_t* node, hawk_flt_t rv) +{ + node->val = rv; + if (node->str) + { + hawk_freemem (awk, node->str); + node->str = HAWK_NULL; + node->len = 0; + } +} + +static hawk_nde_t* parse_binary ( + hawk_t* awk, const hawk_loc_t* xloc, + int skipnl, const binmap_t* binmap, + hawk_nde_t*(*next_level_func)(hawk_t*,const hawk_loc_t*)) +{ + hawk_nde_t* left = HAWK_NULL; + hawk_nde_t* right = HAWK_NULL; + hawk_loc_t rloc; + + left = next_level_func (awk, xloc); + if (left == HAWK_NULL) goto oops; + + do + { + const binmap_t* p = binmap; + int matched = 0; + int opcode, fold; + folded_t folded; + + while (p->token != TOK_EOF) + { + if (MATCH(awk,p->token)) + { + opcode = p->binop; + matched = 1; + break; + } + p++; + } + if (!matched) break; + + do + { + if (get_token(awk) <= -1) goto oops; + } + while (skipnl && MATCH(awk,TOK_NEWLINE)); + + rloc = awk->tok.loc; + right = next_level_func (awk, &rloc); + if (right == HAWK_NULL) goto oops; + + fold = fold_constants_for_binop (awk, left, right, opcode, &folded); + switch (fold) + { + case HAWK_NDE_INT: + if (fold == left->type) + { + hawk_clrpt (awk, right); + right = HAWK_NULL; + update_int_node (awk, (hawk_nde_int_t*)left, folded.l); + } + else if (fold == right->type) + { + hawk_clrpt (awk, left); + update_int_node (awk, (hawk_nde_int_t*)right, folded.l); + left = right; + right = HAWK_NULL; + } + else + { + hawk_clrpt (awk, right); right = HAWK_NULL; + hawk_clrpt (awk, left); left = HAWK_NULL; + + left = new_int_node (awk, folded.l, xloc); + if (left == HAWK_NULL) goto oops; + } + + break; + + case HAWK_NDE_FLT: + if (fold == left->type) + { + hawk_clrpt (awk, right); + right = HAWK_NULL; + update_flt_node (awk, (hawk_nde_flt_t*)left, folded.r); + } + else if (fold == right->type) + { + hawk_clrpt (awk, left); + update_flt_node (awk, (hawk_nde_flt_t*)right, folded.r); + left = right; + right = HAWK_NULL; + } + else + { + hawk_clrpt (awk, right); right = HAWK_NULL; + hawk_clrpt (awk, left); left = HAWK_NULL; + + left = new_flt_node (awk, folded.r, xloc); + if (left == HAWK_NULL) goto oops; + } + + break; + + case -2: + goto oops; + + default: + { + hawk_nde_t* tmp; + + tmp = new_exp_bin_node (awk, xloc, opcode, left, right); + if (tmp == HAWK_NULL) goto oops; + left = tmp; right = HAWK_NULL; + break; + } + } + } + while (1); + + return left; + +oops: + if (right) hawk_clrpt (awk, right); + if (left) hawk_clrpt (awk, left); + return HAWK_NULL; +} + +static hawk_nde_t* parse_logical_or (hawk_t* awk, const hawk_loc_t* xloc) +{ + static binmap_t map[] = + { + { TOK_LOR, HAWK_BINOP_LOR }, + { TOK_EOF, 0 } + }; + + return parse_binary (awk, xloc, 1, map, parse_logical_and); +} + +static hawk_nde_t* parse_logical_and (hawk_t* awk, const hawk_loc_t* xloc) +{ + static binmap_t map[] = + { + { TOK_LAND, HAWK_BINOP_LAND }, + { TOK_EOF, 0 } + }; + + return parse_binary (awk, xloc, 1, map, parse_in); +} + +static hawk_nde_t* parse_in (hawk_t* awk, const hawk_loc_t* xloc) +{ + /* + static binmap_t map[] = + { + { TOK_IN, HAWK_BINOP_IN }, + { TOK_EOF, 0 } + }; + + return parse_binary (awk, xloc, 0, map, parse_regex_match); + */ + + hawk_nde_t* left = HAWK_NULL; + hawk_nde_t* right = HAWK_NULL; + hawk_loc_t rloc; + + left = parse_regex_match (awk, xloc); + if (left == HAWK_NULL) goto oops; + + do + { + hawk_nde_t* tmp; + + if (!MATCH(awk,TOK_IN)) break; + + if (get_token(awk) <= -1) goto oops; + + rloc = awk->tok.loc; + right = parse_regex_match (awk, &rloc); + if (right == HAWK_NULL) goto oops; + + if (!is_plain_var(right)) + { + SETERR_LOC (awk, HAWK_ENOTVAR, &rloc); + goto oops; + } + + tmp = new_exp_bin_node ( + awk, xloc, HAWK_BINOP_IN, left, right); + if (left == HAWK_NULL) goto oops; + + left = tmp; + right = HAWK_NULL; + } + while (1); + + return left; + +oops: + if (right) hawk_clrpt (awk, right); + if (left) hawk_clrpt (awk, left); + return HAWK_NULL; +} + +static hawk_nde_t* parse_regex_match (hawk_t* awk, const hawk_loc_t* xloc) +{ + static binmap_t map[] = + { + { TOK_MA, HAWK_BINOP_MA }, + { TOK_NM, HAWK_BINOP_NM }, + { TOK_EOF, 0 }, + }; + + return parse_binary (awk, xloc, 0, map, parse_bitwise_or); +} + +static hawk_nde_t* parse_bitwise_or (hawk_t* awk, const hawk_loc_t* xloc) +{ + static binmap_t map[] = + { + { TOK_BOR, HAWK_BINOP_BOR }, + { TOK_EOF, 0 } + }; + + return parse_binary (awk, xloc, 0, map, parse_bitwise_xor); +} + +static hawk_nde_t* parse_bitwise_xor (hawk_t* awk, const hawk_loc_t* xloc) +{ + static binmap_t map[] = + { + { TOK_BXOR, HAWK_BINOP_BXOR }, + { TOK_EOF, 0 } + }; + + return parse_binary (awk, xloc, 0, map, parse_bitwise_and); +} + +static hawk_nde_t* parse_bitwise_and (hawk_t* awk, const hawk_loc_t* xloc) +{ + static binmap_t map[] = + { + { TOK_BAND, HAWK_BINOP_BAND }, + { TOK_EOF, 0 } + }; + + return parse_binary (awk, xloc, 0, map, parse_equality); +} + +static hawk_nde_t* parse_equality (hawk_t* awk, const hawk_loc_t* xloc) +{ + static binmap_t map[] = + { + { TOK_TEQ, HAWK_BINOP_TEQ }, + { TOK_TNE, HAWK_BINOP_TNE }, + { TOK_EQ, HAWK_BINOP_EQ }, + { TOK_NE, HAWK_BINOP_NE }, + { TOK_EOF, 0 } + }; + + return parse_binary (awk, xloc, 0, map, parse_relational); +} + +static hawk_nde_t* parse_relational (hawk_t* awk, const hawk_loc_t* xloc) +{ + static binmap_t map[] = + { + { TOK_GT, HAWK_BINOP_GT }, + { TOK_GE, HAWK_BINOP_GE }, + { TOK_LT, HAWK_BINOP_LT }, + { TOK_LE, HAWK_BINOP_LE }, + { TOK_EOF, 0 } + }; + + return parse_binary (awk, xloc, 0, map, parse_shift); +} + +static hawk_nde_t* parse_shift (hawk_t* awk, const hawk_loc_t* xloc) +{ + static binmap_t map[] = + { + { TOK_LS, HAWK_BINOP_LS }, + { TOK_RS, HAWK_BINOP_RS }, + { TOK_EOF, 0 } + }; + + return parse_binary (awk, xloc, 0, map, parse_concat); +} + +static hawk_nde_t* parse_concat (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_t* left = HAWK_NULL; + hawk_nde_t* right = HAWK_NULL; + hawk_loc_t rloc; + + left = parse_additive (awk, xloc); + if (left == HAWK_NULL) goto oops; + + do + { + hawk_nde_t* tmp; + + if (MATCH(awk,TOK_CONCAT)) + { + if (get_token(awk) <= -1) goto oops; + } + else if (awk->opt.trait & HAWK_BLANKCONCAT) + { + if (MATCH(awk,TOK_LPAREN) || MATCH(awk,TOK_DOLLAR) || + /* unary operators */ + MATCH(awk,TOK_PLUS) || MATCH(awk,TOK_MINUS) || + MATCH(awk,TOK_LNOT) || MATCH(awk,TOK_BNOT) || + /* increment operators */ + MATCH(awk,TOK_PLUSPLUS) || MATCH(awk,TOK_MINUSMINUS) || + ((awk->opt.trait & HAWK_TOLERANT) && + (awk->tok.type == TOK_PRINT || awk->tok.type == TOK_PRINTF)) || + awk->tok.type >= TOK_GETLINE) + { + /* proceed to handle concatenation expression */ + /* nothing to to here. just fall through */ + } + else break; + } + else break; + + rloc = awk->tok.loc; + right = parse_additive (awk, &rloc); + if (right == HAWK_NULL) goto oops; + + tmp = new_exp_bin_node (awk, xloc, HAWK_BINOP_CONCAT, left, right); + if (tmp == HAWK_NULL) goto oops; + left = tmp; right = HAWK_NULL; + } + while (1); + + return left; + +oops: + if (right) hawk_clrpt (awk, right); + if (left) hawk_clrpt (awk, left); + return HAWK_NULL; +} + +static hawk_nde_t* parse_additive (hawk_t* awk, const hawk_loc_t* xloc) +{ + static binmap_t map[] = + { + { TOK_PLUS, HAWK_BINOP_PLUS }, + { TOK_MINUS, HAWK_BINOP_MINUS }, + { TOK_EOF, 0 } + }; + + return parse_binary (awk, xloc, 0, map, parse_multiplicative); +} + +static hawk_nde_t* parse_multiplicative (hawk_t* awk, const hawk_loc_t* xloc) +{ + static binmap_t map[] = + { + { TOK_MUL, HAWK_BINOP_MUL }, + { TOK_DIV, HAWK_BINOP_DIV }, + { TOK_IDIV, HAWK_BINOP_IDIV }, + { TOK_MOD, HAWK_BINOP_MOD }, + /* { TOK_EXP, HAWK_BINOP_EXP }, */ + { TOK_EOF, 0 } + }; + + return parse_binary (awk, xloc, 0, map, parse_unary); +} + +static hawk_nde_t* parse_unary (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_t* left; + hawk_loc_t uloc; + int opcode; + int fold; + folded_t folded; + + opcode = (MATCH(awk,TOK_PLUS))? HAWK_UNROP_PLUS: + (MATCH(awk,TOK_MINUS))? HAWK_UNROP_MINUS: + (MATCH(awk,TOK_LNOT))? HAWK_UNROP_LNOT: + (MATCH(awk,TOK_BNOT))? HAWK_UNROP_BNOT: -1; + + /*if (opcode <= -1) return parse_increment (awk);*/ + if (opcode <= -1) return parse_exponent (awk, xloc); + + if (awk->opt.depth.s.expr_parse > 0 && + awk->parse.depth.expr >= awk->opt.depth.s.expr_parse) + { + SETERR_LOC (awk, HAWK_EEXPRNST, xloc); + return HAWK_NULL; + } + + if (get_token(awk) <= -1) return HAWK_NULL; + + awk->parse.depth.expr++; + uloc = awk->tok.loc; + left = parse_unary (awk, &uloc); + awk->parse.depth.expr--; + if (left == HAWK_NULL) return HAWK_NULL; + + fold = -1; + if (left->type == HAWK_NDE_INT) + { + fold = HAWK_NDE_INT; + switch (opcode) + { + case HAWK_UNROP_PLUS: + folded.l = ((hawk_nde_int_t*)left)->val; + break; + + case HAWK_UNROP_MINUS: + folded.l = -((hawk_nde_int_t*)left)->val; + break; + + case HAWK_UNROP_LNOT: + folded.l = !((hawk_nde_int_t*)left)->val; + break; + + case HAWK_UNROP_BNOT: + folded.l = ~((hawk_nde_int_t*)left)->val; + break; + + default: + fold = -1; + break; + } + } + else if (left->type == HAWK_NDE_FLT) + { + fold = HAWK_NDE_FLT; + switch (opcode) + { + case HAWK_UNROP_PLUS: + folded.r = ((hawk_nde_flt_t*)left)->val; + break; + + case HAWK_UNROP_MINUS: + folded.r = -((hawk_nde_flt_t*)left)->val; + break; + + case HAWK_UNROP_LNOT: + folded.r = !((hawk_nde_flt_t*)left)->val; + break; + + case HAWK_UNROP_BNOT: + folded.l = ~((hawk_int_t)((hawk_nde_flt_t*)left)->val); + fold = HAWK_NDE_INT; + break; + + default: + fold = -1; + break; + } + } + + switch (fold) + { + case HAWK_NDE_INT: + if (left->type == fold) + { + update_int_node (awk, (hawk_nde_int_t*)left, folded.l); + return left; + } + else + { + HAWK_ASSERT (awk, left->type == HAWK_NDE_FLT); + hawk_clrpt (awk, left); + return new_int_node (awk, folded.l, xloc); + } + + case HAWK_NDE_FLT: + if (left->type == fold) + { + update_flt_node (awk, (hawk_nde_flt_t*)left, folded.r); + return left; + } + else + { + HAWK_ASSERT (awk, left->type == HAWK_NDE_INT); + hawk_clrpt (awk, left); + return new_flt_node (awk, folded.r, xloc); + } + + default: + { + hawk_nde_exp_t* nde; + + nde = (hawk_nde_exp_t*) hawk_callocmem (awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) + { + hawk_clrpt (awk, left); + SETERR_LOC (awk, HAWK_ENOMEM, xloc); + return HAWK_NULL; + } + + nde->type = HAWK_NDE_EXP_UNR; + nde->loc = *xloc; + nde->opcode = opcode; + nde->left = left; + /*nde->right = HAWK_NULL;*/ + + return (hawk_nde_t*)nde; + } + } +} + +static hawk_nde_t* parse_exponent (hawk_t* awk, const hawk_loc_t* xloc) +{ + static binmap_t map[] = + { + { TOK_EXP, HAWK_BINOP_EXP }, + { TOK_EOF, 0 } + }; + + return parse_binary (awk, xloc, 0, map, parse_unary_exp); +} + +static hawk_nde_t* parse_unary_exp (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_exp_t* nde; + hawk_nde_t* left; + hawk_loc_t uloc; + int opcode; + + opcode = (MATCH(awk,TOK_PLUS))? HAWK_UNROP_PLUS: + (MATCH(awk,TOK_MINUS))? HAWK_UNROP_MINUS: + (MATCH(awk,TOK_LNOT))? HAWK_UNROP_LNOT: + (MATCH(awk,TOK_BNOT))? HAWK_UNROP_BNOT: -1; + + if (opcode <= -1) return parse_increment (awk, xloc); + + if (awk->opt.depth.s.expr_parse > 0 && + awk->parse.depth.expr >= awk->opt.depth.s.expr_parse) + { + SETERR_LOC (awk, HAWK_EEXPRNST, xloc); + return HAWK_NULL; + } + + if (get_token(awk) <= -1) return HAWK_NULL; + + awk->parse.depth.expr++; + uloc = awk->tok.loc; + left = parse_unary (awk, &uloc); + awk->parse.depth.expr--; + if (left == HAWK_NULL) return HAWK_NULL; + + nde = (hawk_nde_exp_t*) hawk_callocmem (awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) + { + hawk_clrpt (awk, left); + ADJERR_LOC (awk, xloc); + return HAWK_NULL; + } + + nde->type = HAWK_NDE_EXP_UNR; + nde->loc = *xloc; + nde->opcode = opcode; + nde->left = left; + nde->right = HAWK_NULL; + + return (hawk_nde_t*)nde; +} + +static hawk_nde_t* parse_increment (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_exp_t* nde; + hawk_nde_t* left; + int type, opcode, opcode1, opcode2; + hawk_loc_t ploc; + + /* check for prefix increment operator */ + opcode1 = MATCH(awk,TOK_PLUSPLUS)? HAWK_INCOP_PLUS: + MATCH(awk,TOK_MINUSMINUS)? HAWK_INCOP_MINUS: -1; + + if (opcode1 != -1) + { + /* there is a prefix increment operator */ + if (get_token(awk) <= -1) return HAWK_NULL; + } + + ploc = awk->tok.loc; + left = parse_primary (awk, &ploc); + if (left == HAWK_NULL) return HAWK_NULL; + + /* check for postfix increment operator */ + opcode2 = MATCH(awk,TOK_PLUSPLUS)? HAWK_INCOP_PLUS: + MATCH(awk,TOK_MINUSMINUS)? HAWK_INCOP_MINUS: -1; + + if (!(awk->opt.trait & HAWK_BLANKCONCAT)) + { + if (opcode1 != -1 && opcode2 != -1) + { + /* both prefix and postfix increment operator. + * not allowed */ + hawk_clrpt (awk, left); + SETERR_LOC (awk, HAWK_EPREPST, xloc); + return HAWK_NULL; + } + } + + if (opcode1 == -1 && opcode2 == -1) + { + /* no increment operators */ + return left; + } + + if (opcode1 != -1) + { + /* prefix increment operator. + * ignore a potential postfix operator */ + type = HAWK_NDE_EXP_INCPRE; + opcode = opcode1; + } + else /*if (opcode2 != -1)*/ + { + HAWK_ASSERT (awk, opcode2 != -1); + + /* postfix increment operator */ + type = HAWK_NDE_EXP_INCPST; + opcode = opcode2; + + /* let's do it later + if (get_token(awk) <= -1) + { + hawk_clrpt (awk, left); + return HAWK_NULL; + } + */ + } + + if (!is_var(left) && left->type != HAWK_NDE_POS) + { + if (type == HAWK_NDE_EXP_INCPST) + { + /* For an expression like 1 ++y, + * left is 1. so we leave ++ for y. */ + return left; + } + else + { + hawk_clrpt (awk, left); + SETERR_LOC (awk, HAWK_EINCDECOPR, xloc); + return HAWK_NULL; + } + } + + if (type == HAWK_NDE_EXP_INCPST) + { + /* consume the postfix operator */ + if (get_token(awk) <= -1) + { + hawk_clrpt (awk, left); + return HAWK_NULL; + } + } + + nde = (hawk_nde_exp_t*) hawk_callocmem (awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) + { + hawk_clrpt (awk, left); + ADJERR_LOC (awk, xloc); + return HAWK_NULL; + } + + nde->type = type; + nde->loc = *xloc; + nde->opcode = opcode; + nde->left = left; + nde->right = HAWK_NULL; + + return (hawk_nde_t*)nde; +} + +#define FNTYPE_UNKNOWN 0 +#define FNTYPE_FNC 1 +#define FNTYPE_FUN 2 + +static HAWK_INLINE int isfunname (hawk_t* awk, const hawk_oocs_t* name, hawk_fun_t** fun) +{ + hawk_htb_pair_t* pair; + + /* check if it is an awk function being processed currently */ + if (awk->tree.cur_fun.ptr) + { + if (hawk_comp_oochars(awk->tree.cur_fun.ptr, awk->tree.cur_fun.len, name->ptr, name->len, 0) == 0) + { + /* the current function begin parsed */ + return FNTYPE_FUN; + } + } + + /* check the funtion name in the function table */ + pair = hawk_htb_search(awk->tree.funs, name->ptr, name->len); + if (pair) + { + /* one of the functions defined previously */ + if (fun) + { + *fun = (hawk_fun_t*)HAWK_HTB_VPTR(pair); + HAWK_ASSERT (awk, *fun != HAWK_NULL); + } + return FNTYPE_FUN; + } + + /* check if it is a function not resolved so far */ + if (hawk_htb_search(awk->parse.funs, name->ptr, name->len)) + { + /* one of the function calls not resolved so far. */ + return FNTYPE_FUN; + } + + return FNTYPE_UNKNOWN; +} + +static HAWK_INLINE int isfnname (hawk_t* awk, const hawk_oocs_t* name) +{ + if (hawk_findfncwithoocs(awk, name) != HAWK_NULL) + { + /* implicit function */ + return FNTYPE_FNC; + } + + return isfunname(awk, name, HAWK_NULL); +} + +static hawk_nde_t* parse_primary_int (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_int_t* nde; + + /* create the node for the literal */ + nde = (hawk_nde_int_t*)new_int_node ( + awk, + hawk_strxtoint (awk, + HAWK_OOECS_PTR(awk->tok.name), + HAWK_OOECS_LEN(awk->tok.name), + 0, HAWK_NULL + ), + xloc + ); + if (nde == HAWK_NULL) return HAWK_NULL; + + HAWK_ASSERT (awk, + HAWK_OOECS_LEN(awk->tok.name) == + hawk_count_oocstr(HAWK_OOECS_PTR(awk->tok.name))); + + /* remember the literal in the original form */ + nde->len = HAWK_OOECS_LEN(awk->tok.name); + nde->str = hawk_dupoocs(awk, HAWK_OOECS_OOCS(awk->tok.name)); + if (nde->str == HAWK_NULL || get_token(awk) <= -1) goto oops; + + return (hawk_nde_t*)nde; + +oops: + HAWK_ASSERT (awk, nde != HAWK_NULL); + if (nde->str) hawk_freemem (awk, nde->str); + hawk_freemem (awk, nde); + return HAWK_NULL; +} + +static hawk_nde_t* parse_primary_flt (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_flt_t* nde; + + /* create the node for the literal */ + nde = (hawk_nde_flt_t*) new_flt_node ( + awk, + hawk_strxtoflt (awk, + HAWK_OOECS_PTR(awk->tok.name), + HAWK_OOECS_LEN(awk->tok.name), + HAWK_NULL + ), + xloc + ); + if (nde == HAWK_NULL) return HAWK_NULL; + + HAWK_ASSERT (awk, + HAWK_OOECS_LEN(awk->tok.name) == + hawk_count_oocstr(HAWK_OOECS_PTR(awk->tok.name))); + + /* remember the literal in the original form */ + nde->len = HAWK_OOECS_LEN(awk->tok.name); + nde->str = hawk_dupoocs(awk, HAWK_OOECS_OOCS(awk->tok.name)); + if (nde->str == HAWK_NULL || get_token(awk) <= -1) goto oops; + + return (hawk_nde_t*)nde; + +oops: + HAWK_ASSERT (awk, nde != HAWK_NULL); + if (nde->str) hawk_freemem (awk, nde->str); + hawk_freemem (awk, nde); + return HAWK_NULL; +} + +static hawk_nde_t* parse_primary_str (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_str_t* nde; + + nde = (hawk_nde_str_t*) hawk_callocmem (awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) + { + ADJERR_LOC (awk, xloc); + return HAWK_NULL; + } + + nde->type = HAWK_NDE_STR; + nde->loc = *xloc; + nde->len = HAWK_OOECS_LEN(awk->tok.name); + nde->ptr = hawk_dupoocs(awk, HAWK_OOECS_OOCS(awk->tok.name)); + if (nde->ptr == HAWK_NULL || get_token(awk) <= -1) goto oops; + + return (hawk_nde_t*)nde; + +oops: + HAWK_ASSERT (awk, nde != HAWK_NULL); + if (nde->ptr) hawk_freemem (awk, nde->ptr); + hawk_freemem (awk, nde); + return HAWK_NULL; +} + +static hawk_nde_t* parse_primary_mbs (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_mbs_t* nde; + + nde = (hawk_nde_mbs_t*)hawk_callocmem(awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) + { + ADJERR_LOC (awk, xloc); + return HAWK_NULL; + } + + nde->type = HAWK_NDE_MBS; + nde->loc = *xloc; + +#if defined(HAWK_OOCH_IS_BCH) + nde->len = HAWK_OOECS_LEN(awk->tok.name); + nde->ptr = hawk_dupoocs(awk, HAWK_OOECS_OOCS(awk->tok.name)); + if (!nde->ptr) goto oops; +#else + { + /* the MBS token doesn't include a character greater than 0xFF in awk->tok.name + * even though it is a unicode string. simply copy over without conversion */ + nde->len = HAWK_OOECS_LEN(awk->tok.name); + nde->ptr = hawk_allocmem(awk, (nde->len + 1) * HAWK_SIZEOF(*nde->ptr)); + if (!nde->ptr) + { + hawk_seterror (awk, HAWK_ENOMEM, HAWK_NULL, xloc); + goto oops; + } + + hawk_copy_uchars_to_bchars (nde->ptr, HAWK_OOECS_PTR(awk->tok.name), nde->len); + nde->ptr[nde->len] = '\0'; + } +#endif + + if (get_token(awk) <= -1) goto oops; + + return (hawk_nde_t*)nde; + +oops: + HAWK_ASSERT (awk, nde != HAWK_NULL); + if (nde->ptr) hawk_freemem (awk, nde->ptr); + hawk_freemem (awk, nde); + return HAWK_NULL; +} + +static hawk_nde_t* parse_primary_rex (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_rex_t* nde; + hawk_errnum_t errnum; + + /* the regular expression is tokenized here because + * of the context-sensitivity of the slash symbol. + * if TOK_DIV is seen as a primary, it tries to compile + * it as a regular expression */ + hawk_ooecs_clear (awk->tok.name); + + if (MATCH(awk,TOK_DIV_ASSN) && + hawk_ooecs_ccat (awk->tok.name, HAWK_T('=')) == (hawk_oow_t)-1) + { + SETERR_LOC (awk, HAWK_ENOMEM, xloc); + return HAWK_NULL; + } + + SET_TOKEN_TYPE (awk, &awk->tok, TOK_REX); + if (get_rexstr (awk, &awk->tok) <= -1) return HAWK_NULL; + + HAWK_ASSERT (awk, MATCH(awk,TOK_REX)); + + nde = (hawk_nde_rex_t*) hawk_callocmem (awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) + { + ADJERR_LOC (awk, xloc); + return HAWK_NULL; + } + + nde->type = HAWK_NDE_REX; + nde->loc = *xloc; + nde->str.len = HAWK_OOECS_LEN(awk->tok.name); + nde->str.ptr = hawk_dupoocs(awk, HAWK_OOECS_OOCS(awk->tok.name)); + if (nde->str.ptr == HAWK_NULL) goto oops; + + if (hawk_buildrex (awk, HAWK_OOECS_PTR(awk->tok.name), HAWK_OOECS_LEN(awk->tok.name), &errnum, &nde->code[0], &nde->code[1]) <= -1) + { + SETERR_LOC (awk, errnum, xloc); + goto oops; + } + + if (get_token(awk) <= -1) goto oops; + + return (hawk_nde_t*)nde; + +oops: + HAWK_ASSERT (awk, nde != HAWK_NULL); + if (nde->code[0]) hawk_freerex (awk, nde->code[0], nde->code[1]); + if (nde->str.ptr) hawk_freemem (awk, nde->str.ptr); + hawk_freemem (awk, nde); + return HAWK_NULL; +} + +static hawk_nde_t* parse_primary_positional (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_pos_t* nde; + hawk_loc_t ploc; + + nde = (hawk_nde_pos_t*) hawk_callocmem (awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) + { + ADJERR_LOC (awk, xloc); + goto oops; + } + + nde->type = HAWK_NDE_POS; + nde->loc = *xloc; + + if (get_token(awk) <= -1) return HAWK_NULL; + + ploc = awk->tok.loc; + nde->val = parse_primary(awk, &ploc); + if (!nde->val) goto oops; + + return (hawk_nde_t*)nde; + +oops: + if (nde) + { + if (nde->val) hawk_clrpt (awk, nde->val); + hawk_freemem (awk, nde); + } + return HAWK_NULL; +} + +static hawk_nde_t* parse_primary_lparen (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_t* nde; + hawk_nde_t* last; + hawk_loc_t eloc; + hawk_oow_t opening_lparen_seq; + + opening_lparen_seq = awk->parse.lparen_seq++; + + /* eat up the left parenthesis */ + if (get_token(awk) <= -1) return HAWK_NULL; + + /* parse the sub-expression inside the parentheses */ + eloc = awk->tok.loc; + nde = parse_expr_withdc(awk, &eloc); + if (!nde) return HAWK_NULL; + + /* parse subsequent expressions separated by a comma, if any */ + last = nde; + HAWK_ASSERT (awk, last->next == HAWK_NULL); + + while (MATCH(awk,TOK_COMMA)) + { + hawk_nde_t* tmp; + + do + { + if (get_token(awk) <= -1) goto oops; + } + while (MATCH(awk,TOK_NEWLINE)); + + eloc = awk->tok.loc; + tmp = parse_expr_withdc(awk, &eloc); + if (!tmp) goto oops; + + HAWK_ASSERT (awk, tmp->next == HAWK_NULL); + last->next = tmp; + last = tmp; + } + /* ----------------- */ + + /* check for the closing parenthesis */ + if (!MATCH(awk,TOK_RPAREN)) + { + SETERR_TOK (awk, HAWK_ERPAREN); + goto oops; + } + + /* remember the sequence number of the left parenthesis + * that' been just closed by the matching right parenthesis */ + awk->parse.lparen_last_closed = opening_lparen_seq; + + if (get_token(awk) <= -1) goto oops; + + /* check if it is a chained node */ + if (nde->next) + { + /* if so, it is an expression group */ + /* (expr1, expr2, expr2) */ + + hawk_nde_grp_t* tmp; + + if ((awk->parse.id.stmt != TOK_PRINT && awk->parse.id.stmt != TOK_PRINTF) || awk->parse.depth.expr != 1) + { + if (!(awk->opt.trait & HAWK_TOLERANT) && !MATCH(awk,TOK_IN)) + { + SETERR_TOK (awk, HAWK_EKWIN); + goto oops; + } + } + + tmp = (hawk_nde_grp_t*)hawk_callocmem(awk, HAWK_SIZEOF(hawk_nde_grp_t)); + if (!tmp) + { + ADJERR_LOC (awk, xloc); + goto oops; + } + + tmp->type = HAWK_NDE_GRP; + tmp->loc = *xloc; + tmp->body = nde; + + nde = (hawk_nde_t*)tmp; + } + /* ----------------- */ + + return nde; + +oops: + if (nde) hawk_clrpt (awk, nde); + return HAWK_NULL; +} + +static hawk_nde_t* parse_primary_getline (hawk_t* awk, const hawk_loc_t* xloc) +{ + /* parse the statement-level getline. + * getline after the pipe symbols(|,||) is parsed + * by parse_primary(). + */ + + hawk_nde_getline_t* nde; + hawk_loc_t ploc; + + nde = (hawk_nde_getline_t*) hawk_callocmem (awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) goto oops; + + nde->type = HAWK_NDE_GETLINE; + nde->loc = *xloc; + nde->in_type = HAWK_IN_CONSOLE; + + if (get_token(awk) <= -1) goto oops; + + if (MATCH(awk,TOK_IDENT) || MATCH(awk,TOK_DOLLAR)) + { + /* getline var + * getline $XXX */ + + if ((awk->opt.trait & HAWK_BLANKCONCAT) && MATCH(awk,TOK_IDENT)) + { + /* i need to perform some precheck on if the identifier is + * really a variable */ + if (preget_token(awk) <= -1) goto oops; + + if (awk->ntok.type == TOK_DBLCOLON) goto novar; + if (awk->ntok.type == TOK_LPAREN) + { + if (awk->ntok.loc.line == awk->tok.loc.line && + awk->ntok.loc.colm == awk->tok.loc.colm + HAWK_OOECS_LEN(awk->tok.name)) + { + /* it's in the form of a function call since + * there is no spaces between the identifier + * and the left parenthesis. */ + goto novar; + } + } + + if (isfnname(awk, HAWK_OOECS_OOCS(awk->tok.name)) != FNTYPE_UNKNOWN) goto novar; + } + + ploc = awk->tok.loc; + nde->var = parse_primary (awk, &ploc); + if (nde->var == HAWK_NULL) goto oops; + + if (!is_var(nde->var) && nde->var->type != HAWK_NDE_POS) + { + /* this is 'getline' followed by an expression probably. + * getline a() + * getline sys::WNOHANG + */ + SETERR_LOC (awk, HAWK_EBADARG, &ploc); + goto oops; + } + } + +novar: + if (MATCH(awk, TOK_LT)) + { + /* getline [var] < file */ + if (get_token(awk) <= -1) goto oops; + + ploc = awk->tok.loc; + /* TODO: is this correct? */ + /*nde->in = parse_expr_withdc (awk, &ploc);*/ + nde->in = parse_primary (awk, &ploc); + if (nde->in == HAWK_NULL) goto oops; + + nde->in_type = HAWK_IN_FILE; + } + + return (hawk_nde_t*)nde; + +oops: + if (nde) + { + if (nde->in) hawk_clrpt (awk, nde->in); + if (nde->var) hawk_clrpt (awk, nde->var); + hawk_freemem (awk, nde); + } + return HAWK_NULL; +} + +static hawk_nde_t* parse_primary_nopipe (hawk_t* awk, const hawk_loc_t* xloc) +{ + switch (awk->tok.type) + { + case TOK_IDENT: + return parse_primary_ident(awk, xloc); + + case TOK_INT: + return parse_primary_int(awk, xloc); + + case TOK_FLT: + return parse_primary_flt(awk, xloc); + + case TOK_STR: + return parse_primary_str(awk, xloc); + + case TOK_MBS: + return parse_primary_mbs(awk, xloc); + + case TOK_DIV: + case TOK_DIV_ASSN: + return parse_primary_rex(awk, xloc); + + case TOK_DOLLAR: + return parse_primary_positional(awk, xloc); + + case TOK_LPAREN: + return parse_primary_lparen(awk, xloc); + + case TOK_GETLINE: + return parse_primary_getline(awk, xloc); + + default: + /* in the tolerant mode, we treat print and printf + * as a function like getline */ + if ((awk->opt.trait & HAWK_TOLERANT) && + (MATCH(awk,TOK_PRINT) || MATCH(awk,TOK_PRINTF))) + { + if (get_token(awk) <= -1) return HAWK_NULL; + return parse_print (awk, xloc); + } + + /* valid expression introducer is expected */ + if (MATCH(awk,TOK_NEWLINE)) + { + SETERR_ARG_LOC ( + awk, HAWK_EEXPRNR, + HAWK_OOECS_PTR(awk->ptok.name), + HAWK_OOECS_LEN(awk->ptok.name), + &awk->ptok.loc + ); + } + else + { + SETERR_TOK (awk, HAWK_EEXPRNR); + } + return HAWK_NULL; + } + +} + +static hawk_nde_t* parse_primary (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_t* left; + hawk_nde_getline_t* nde; + hawk_nde_t* var = HAWK_NULL; + hawk_loc_t ploc; + + left = parse_primary_nopipe(awk, xloc); + if (left == HAWK_NULL) goto oops; + + /* handle the piping part */ + do + { + int intype = -1; + + if (awk->opt.trait & HAWK_RIO) + { + if (MATCH(awk,TOK_BOR)) + { + intype = HAWK_IN_PIPE; + } + else if (MATCH(awk,TOK_LOR) && (awk->opt.trait & HAWK_RWPIPE)) + { + intype = HAWK_IN_RWPIPE; + } + } + + if (intype == -1) break; + + if (preget_token(awk) <= -1) goto oops; + if (awk->ntok.type != TOK_GETLINE) break; + + /* consume ntok('getline') */ + get_token(awk); /* no error check needed as it's guaranteeded to succeed for preget_token() above */ + + /* get the next token */ + if (get_token(awk) <= -1) goto oops; + + /* TODO: is this correct? */ + if (MATCH(awk,TOK_IDENT) || MATCH(awk,TOK_DOLLAR)) + { + /* command | getline var + * command || getline var */ + + if ((awk->opt.trait & HAWK_BLANKCONCAT) && MATCH(awk,TOK_IDENT)) + { + /* i need to perform some precheck on if the identifier is + * really a variable */ + if (preget_token(awk) <= -1) goto oops; + + if (awk->ntok.type == TOK_DBLCOLON) goto novar; + if (awk->ntok.type == TOK_LPAREN) + { + if (awk->ntok.loc.line == awk->tok.loc.line && + awk->ntok.loc.colm == awk->tok.loc.colm + HAWK_OOECS_LEN(awk->tok.name)) + { + /* it's in the form of a function call since + * there is no spaces between the identifier + * and the left parenthesis. */ + goto novar; + } + } + + if (isfnname(awk, HAWK_OOECS_OOCS(awk->tok.name)) != FNTYPE_UNKNOWN) goto novar; + } + + ploc = awk->tok.loc; + var = parse_primary (awk, &ploc); + if (var == HAWK_NULL) goto oops; + + if (!is_var(var) && var->type != HAWK_NDE_POS) + { + /* fucntion a() {} + * print ("ls -laF" | getline a()) */ + SETERR_LOC (awk, HAWK_EBADARG, &ploc); + goto oops; + } + } + + novar: + nde = (hawk_nde_getline_t*)hawk_callocmem(awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) + { + ADJERR_LOC (awk, xloc); + goto oops; + } + + nde->type = HAWK_NDE_GETLINE; + nde->loc = *xloc; + nde->var = var; + nde->in_type = intype; + nde->in = left; + + left = (hawk_nde_t*)nde; + var = HAWK_NULL; + } + while (1); + + return left; + +oops: + if (var) hawk_clrpt (awk, var); + hawk_clrpt (awk, left); + return HAWK_NULL; +} + +static hawk_nde_t* parse_variable (hawk_t* awk, const hawk_loc_t* xloc, hawk_nde_type_t type, const hawk_oocs_t* name, hawk_oow_t idxa) +{ + hawk_nde_var_t* nde; + int is_fcv = 0; + + if (MATCH(awk,TOK_LPAREN)) + { + #if defined(ENABLE_FEATURE_FUN_AS_VALUE) +/* + if (MATCH(awk,TOK_LPAREN) && + (!(awk->opt.trait & HAWK_BLANKCONCAT) || + (awk->tok.loc.line == xloc->line && + awk->tok.loc.colm == xloc->colm + name->len))) +*/ + if (awk->tok.loc.line == xloc->line && awk->tok.loc.colm == xloc->colm + name->len) + { + is_fcv = 1; + } + else + #endif + if (!(awk->opt.trait & HAWK_BLANKCONCAT)) + { + /* if concatenation by blanks is not allowed, the explicit + * concatenation operator(%%) must be used. so it is obvious + * that it is a function call, which is illegal for a variable. + * if implicit, "var_xxx (1)" may be concatenation of + * the value of var_xxx and 1. + */ + /* a variable is not a function */ + SETERR_ARG_LOC (awk, HAWK_EFUNNAM, name->ptr, name->len, xloc); + return HAWK_NULL; + } + } + + nde = (hawk_nde_var_t*)hawk_callocmem(awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) + { + ADJERR_LOC (awk, xloc); + return HAWK_NULL; + } + + nde->type = type; + nde->loc = *xloc; + /*nde->id.name.ptr = HAWK_NULL;*/ + nde->id.name.ptr = name->ptr; + nde->id.name.len = name->len; + nde->id.idxa = idxa; + nde->idx = HAWK_NULL; + +#if defined(ENABLE_FEATURE_FUN_AS_VALUE) + if (!is_fcv) return (hawk_nde_t*)nde; + return parse_fncall(awk, (const hawk_oocs_t*)nde, HAWK_NULL, xloc, FNCALL_FLAG_VAR); +#else + return (hawk_nde_t*)nde; +#endif +} + +static int dup_ident_and_get_next (hawk_t* awk, const hawk_loc_t* xloc, hawk_oocs_t* name, int max) +{ + int nsegs = 0; + + HAWK_ASSERT (awk, MATCH(awk,TOK_IDENT)); + + do + { + name[nsegs].ptr = HAWK_OOECS_PTR(awk->tok.name); + name[nsegs].len = HAWK_OOECS_LEN(awk->tok.name); + + /* duplicate the identifier */ + name[nsegs].ptr = hawk_dupoochars(awk, name[nsegs].ptr, name[nsegs].len); + if (!name[nsegs].ptr) + { + ADJERR_LOC (awk, xloc); + goto oops; + } + + nsegs++; + + if (get_token(awk) <= -1) goto oops; + + if (!MATCH(awk,TOK_DBLCOLON)) break; + + if (get_token(awk) <= -1) goto oops; + + /* the identifier after :: + * allow reserved words as well since i view the whole name(mod::ident) + * as one segment. however, i don't want the identifier part to begin + * with @. some extended keywords begin with @ like @include. + * TOK_XGLOBAL to TOK_XRESET are excuded from the check for that reason. */ + if (!MATCH(awk, TOK_IDENT) && !(MATCH_RANGE(awk, TOK_BEGIN, TOK_GETLINE))) + { + SETERR_TOK (awk, HAWK_EIDENT); + goto oops; + } + + if (nsegs >= max) + { + SETERR_LOC (awk, HAWK_ESEGTM, xloc); + goto oops; + } + } + while (1); + + return nsegs; + +oops: + while (nsegs > 0) hawk_freemem (awk, name[--nsegs].ptr); + return -1; +} + +#if defined(ENABLE_FEATURE_FUN_AS_VALUE) +static hawk_nde_t* parse_fun_as_value (hawk_t* awk, const hawk_oocs_t* name, const hawk_loc_t* xloc, hawk_fun_t* funptr) +{ + hawk_nde_fun_t* nde; + + /* create the node for the literal */ + nde = (hawk_nde_fun_t*)hawk_callocmem(awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) + { + ADJERR_LOC (awk, xloc); + return HAWK_NULL; + } + + nde->type = HAWK_NDE_FUN; + nde->loc = *xloc; + nde->name.ptr = name->ptr; + nde->name.len = name->len; + nde->funptr = funptr; + + return (hawk_nde_t*)nde; +} +#endif + +static hawk_nde_t* parse_primary_ident_noseg (hawk_t* awk, const hawk_loc_t* xloc, const hawk_oocs_t* name) +{ + hawk_fnc_t* fnc; + hawk_oow_t idxa; + hawk_nde_t* nde = HAWK_NULL; + + /* check if name is an intrinsic function name */ + fnc = hawk_findfncwithoocs(awk, name); + if (fnc) + { + if (MATCH(awk,TOK_LPAREN) || fnc->dfl0) + { + if (fnc->spec.arg.min > fnc->spec.arg.max) + { + /* this intrinsic function is located in the specificed module. + * convert the function call to a module call. i do this to + * exclude some instrinsic functions from the main engine. + * e.g) sin -> math::sin + * cos -> math::cos + */ + hawk_oocs_t segs[2]; + + HAWK_ASSERT (awk, fnc->spec.arg.spec != HAWK_NULL); + + segs[0].ptr = (hawk_ooch_t*)fnc->spec.arg.spec; + segs[0].len = hawk_count_oocstr(fnc->spec.arg.spec); + segs[1] = *name; + + return parse_primary_ident_segs (awk, xloc, name, segs, 2); + } + + /* fnc->dfl0 means that the function can be called without (). + * i.e. length */ + nde = parse_fncall(awk, name, fnc, xloc, ((!MATCH(awk,TOK_LPAREN) && fnc->dfl0)? FNCALL_FLAG_NOARG: 0)); + } + else + { + /* an intrinsic function should be in the form of the function call */ + SETERR_TOK (awk, HAWK_ELPAREN); + } + } + /* now we know that name is a normal identifier. */ + else if (MATCH(awk,TOK_LBRACK)) + { + nde = parse_hashidx(awk, name, xloc); + } + else if ((idxa = hawk_arr_rsearch(awk->parse.lcls, HAWK_ARR_SIZE(awk->parse.lcls), name->ptr, name->len)) != HAWK_ARR_NIL) + { + /* local variable */ + nde = parse_variable(awk, xloc, HAWK_NDE_LCL, name, idxa); + } + else if ((idxa = hawk_arr_search(awk->parse.params, 0, name->ptr, name->len)) != HAWK_ARR_NIL) + { + /* parameter */ + nde = parse_variable(awk, xloc, HAWK_NDE_ARG, name, idxa); + } + else if ((idxa = get_global(awk, name)) != HAWK_ARR_NIL) + { + /* global variable */ + nde = parse_variable(awk, xloc, HAWK_NDE_GBL, name, idxa); + } + else + { + int fntype; + hawk_fun_t* funptr = HAWK_NULL; + + fntype = isfunname(awk, name, &funptr); + + if (fntype) + { + HAWK_ASSERT (awk, fntype == FNTYPE_FUN); + + if (MATCH(awk,TOK_LPAREN)) + { + /* must be a function name */ + HAWK_ASSERT (awk, hawk_htb_search(awk->parse.named, name->ptr, name->len) == HAWK_NULL); + nde = parse_fncall(awk, name, HAWK_NULL, xloc, 0); + } + else + { + /* function name appeared without () */ + #if defined(ENABLE_FEATURE_FUN_AS_VALUE) + nde = parse_fun_as_value(awk, name, xloc, funptr); + #else + SETERR_ARG_LOC (awk, HAWK_EFUNRED, name->ptr, name->len, xloc); + #endif + } + } + /*else if (awk->opt.trait & HAWK_IMPLICIT) */ + else if (awk->parse.pragma.trait & HAWK_IMPLICIT) + { + /* if the name is followed by ( without spaces, + * it's considered a function call though the name + * has not been seen/resolved. + * + * it is a function call so long as it's followed + * by a left parenthesis if concatenation by blanks + * is not allowed. + */ + int is_fncall_var = 0; + + if (MATCH(awk,TOK_LPAREN) && + (!(awk->opt.trait & HAWK_BLANKCONCAT) || + (awk->tok.loc.line == xloc->line && + awk->tok.loc.colm == xloc->colm + name->len))) + { + /* it is a function call to an undefined function yet */ + if (hawk_htb_search(awk->parse.named, name->ptr, name->len) != HAWK_NULL) + { + /* the function call conflicts with a named variable */ + #if defined(ENABLE_FEATURE_FUN_AS_VALUE) + is_fncall_var = 1; + goto named_var; + #else + SETERR_ARG_LOC (awk, HAWK_EVARRED, name->ptr, name->len, xloc); + #endif + } + else + { + nde = parse_fncall(awk, name, HAWK_NULL, xloc, 0); + } + } + else + { + hawk_nde_var_t* tmp; + + #if defined(ENABLE_FEATURE_FUN_AS_VALUE) + named_var: + #endif + + /* if there is a space between the name and the left parenthesis + * while the name is not resolved to anything, we treat the space + * as concatention by blanks. so we handle the name as a named + * variable. */ + tmp = (hawk_nde_var_t*)hawk_callocmem(awk, HAWK_SIZEOF(*tmp)); + if (tmp == HAWK_NULL) ADJERR_LOC (awk, xloc); + else + { + /* collect unique instances of a named variable + * for reference */ + if (hawk_htb_upsert(awk->parse.named, name->ptr, name->len, HAWK_NULL, 0) == HAWK_NULL) + { + SETERR_LOC (awk, HAWK_ENOMEM, xloc); + hawk_freemem (awk, tmp); + } + else + { + tmp->type = HAWK_NDE_NAMED; + tmp->loc = *xloc; + tmp->id.name.ptr = name->ptr; + tmp->id.name.len = name->len; + tmp->id.idxa = (hawk_oow_t)-1; + tmp->idx = HAWK_NULL; + nde = (hawk_nde_t*)tmp; + + #if defined(ENABLE_FEATURE_FUN_AS_VALUE) + if (is_fncall_var) + nde = parse_fncall(awk, (const hawk_oocs_t*)nde, HAWK_NULL, xloc, FNCALL_FLAG_VAR); + #endif + } + } + } + } + else + { + if (MATCH(awk,TOK_LPAREN)) + { + /* it is a function call as the name is followed + * by ( with/without spaces and implicit variables are disabled. */ + nde = parse_fncall(awk, name, HAWK_NULL, xloc, 0); + } + else + { + /* undefined variable */ + SETERR_ARG_LOC (awk, HAWK_EUNDEF, name->ptr, name->len, xloc); + } + } + } + + return nde; +} + +static hawk_nde_t* parse_primary_ident_segs (hawk_t* awk, const hawk_loc_t* xloc, const hawk_oocs_t* full, const hawk_oocs_t segs[], int nsegs) +{ + /* parse xxx::yyy */ + + hawk_nde_t* nde = HAWK_NULL; + hawk_mod_t* mod; + hawk_mod_sym_t sym; + hawk_fnc_t fnc; + + CLRERR (awk); + mod = query_module(awk, segs, nsegs, &sym); + if (mod == HAWK_NULL) + { + if (ISNOERR(awk)) SETERR_LOC (awk, HAWK_ENOSUP, xloc); + else ADJERR_LOC (awk, xloc); + } + else + { + switch (sym.type) + { + case HAWK_MOD_FNC: + if ((awk->opt.trait & sym.u.fnc.trait) != sym.u.fnc.trait) + { + SETERR_ARG_LOC (awk, HAWK_EUNDEF, full->ptr, full->len, xloc); + break; + } + + if (MATCH(awk,TOK_LPAREN)) + { + HAWK_MEMSET (&fnc, 0, HAWK_SIZEOF(fnc)); + fnc.name.ptr = full->ptr; + fnc.name.len = full->len; + fnc.spec = sym.u.fnc; + fnc.mod = mod; + nde = parse_fncall (awk, full, &fnc, xloc, 0); + } + else + { + SETERR_TOK (awk, HAWK_ELPAREN); + } + break; + + case HAWK_MOD_INT: + nde = new_int_node(awk, sym.u.in.val, xloc); + /* i don't remember the symbol in the original form */ + break; + + case HAWK_MOD_FLT: + nde = new_flt_node(awk, sym.u.flt.val, xloc); + /* i don't remember the symbol in the original form */ + break; + + default: + /* TODO: support MOD_VAR */ + SETERR_ARG_LOC (awk, HAWK_EUNDEF, full->ptr, full->len, xloc); + break; + } + } + + return nde; +} + +static hawk_nde_t* parse_primary_ident (hawk_t* awk, const hawk_loc_t* xloc) +{ + hawk_nde_t* nde = HAWK_NULL; + hawk_oocs_t name[2]; /* TODO: support more than 2 segments??? */ + int nsegs; + + HAWK_ASSERT (awk, MATCH(awk,TOK_IDENT)); + + nsegs = dup_ident_and_get_next(awk, xloc, name, HAWK_COUNTOF(name)); + if (nsegs <= -1) return HAWK_NULL; + + if (nsegs <= 1) + { + nde = parse_primary_ident_noseg(awk, xloc, &name[0]); + if (!nde) hawk_freemem (awk, name[0].ptr); + } + else + { + hawk_oocs_t full; /* full name including :: */ + hawk_oow_t capa; + int i; + + for (capa = 0, i = 0; i < nsegs; i++) capa += name[i].len + 2; /* +2 for :: */ + full.ptr = hawk_allocmem(awk, HAWK_SIZEOF(*full.ptr) * (capa + 1)); + if (full.ptr) + { + capa = hawk_copy_oochars_to_oocstr_unlimited(&full.ptr[0], name[0].ptr, name[0].len); + for (i = 1; i < nsegs; i++) + { + capa += hawk_copy_oocstr_unlimited(&full.ptr[capa], HAWK_T("::")); + capa += hawk_copy_oochars_to_oocstr_unlimited(&full.ptr[capa], name[i].ptr, name[i].len); + } + full.ptr[capa] = HAWK_T('\0'); + full.len = capa; + + nde = parse_primary_ident_segs(awk, xloc, &full, name, nsegs); + if (!nde || nde->type != HAWK_NDE_FNCALL_FNC) + { + /* the FNC node takes the full name but other + * nodes don't. so i need to free it. i know it's ugly. */ + hawk_freemem (awk, full.ptr); + } + } + else + { + /* error number is set in hawk_allocmem */ + ADJERR_LOC (awk, xloc); + } + + /* i don't need the name segments */ + while (nsegs > 0) hawk_freemem (awk, name[--nsegs].ptr); + } + + return nde; +} + +static hawk_nde_t* parse_hashidx (hawk_t* awk, const hawk_oocs_t* name, const hawk_loc_t* xloc) +{ + hawk_nde_t* idx, * tmp, * last; + hawk_nde_var_t* nde; + hawk_oow_t idxa; + + idx = HAWK_NULL; + last = HAWK_NULL; + + do + { + if (get_token(awk) <= -1) + { + if (idx != HAWK_NULL) hawk_clrpt (awk, idx); + return HAWK_NULL; + } + + { + hawk_loc_t eloc; + + eloc = awk->tok.loc; + tmp = parse_expr_withdc (awk, &eloc); + } + if (tmp == HAWK_NULL) + { + if (idx != HAWK_NULL) hawk_clrpt (awk, idx); + return HAWK_NULL; + } + + if (idx == HAWK_NULL) + { + HAWK_ASSERT (awk, last == HAWK_NULL); + idx = tmp; last = tmp; + } + else + { + last->next = tmp; + last = tmp; + } + } + while (MATCH(awk,TOK_COMMA)); + + HAWK_ASSERT (awk, idx != HAWK_NULL); + + if (!MATCH(awk,TOK_RBRACK)) + { + hawk_clrpt (awk, idx); + SETERR_TOK (awk, HAWK_ERBRACK); + return HAWK_NULL; + } + + if (get_token(awk) <= -1) + { + hawk_clrpt (awk, idx); + return HAWK_NULL; + } + + nde = (hawk_nde_var_t*)hawk_callocmem(awk, HAWK_SIZEOF(*nde)); + if (nde == HAWK_NULL) + { + hawk_clrpt (awk, idx); + ADJERR_LOC (awk, xloc); + return HAWK_NULL; + } + + /* search the local variable list */ + idxa = hawk_arr_rsearch(awk->parse.lcls, HAWK_ARR_SIZE(awk->parse.lcls), name->ptr, name->len); + if (idxa != HAWK_ARR_NIL) + { + nde->type = HAWK_NDE_LCLIDX; + nde->loc = *xloc; + /*nde->id.name = HAWK_NULL; */ + nde->id.name.ptr = name->ptr; + nde->id.name.len = name->len; + nde->id.idxa = idxa; + nde->idx = idx; + + return (hawk_nde_t*)nde; + } + + /* search the parameter name list */ + idxa = hawk_arr_search(awk->parse.params, 0, name->ptr, name->len); + if (idxa != HAWK_ARR_NIL) + { + nde->type = HAWK_NDE_ARGIDX; + nde->loc = *xloc; + /*nde->id.name = HAWK_NULL; */ + nde->id.name.ptr = name->ptr; + nde->id.name.len = name->len; + nde->id.idxa = idxa; + nde->idx = idx; + + return (hawk_nde_t*)nde; + } + + /* gets the global variable index */ + idxa = get_global (awk, name); + if (idxa != HAWK_ARR_NIL) + { + nde->type = HAWK_NDE_GBLIDX; + nde->loc = *xloc; + /*nde->id.name = HAWK_NULL;*/ + nde->id.name.ptr = name->ptr; + nde->id.name.len = name->len; + nde->id.idxa = idxa; + nde->idx = idx; + + return (hawk_nde_t*)nde; + } + + /*if (awk->opt.trait & HAWK_IMPLICIT) */ + if (awk->parse.pragma.trait & HAWK_IMPLICIT) + { + int fnname = isfnname(awk, name); + switch (fnname) + { + case FNTYPE_FNC: + SETERR_ARG_LOC (awk, HAWK_EFNCRED, name->ptr, name->len, xloc); + goto exit_func; + + case FNTYPE_FUN: + SETERR_ARG_LOC (awk, HAWK_EFUNRED, name->ptr, name->len, xloc); + goto exit_func; + } + + HAWK_ASSERT (awk, fnname == 0); + + nde->type = HAWK_NDE_NAMEDIDX; + nde->loc = *xloc; + nde->id.name.ptr = name->ptr; + nde->id.name.len = name->len; + nde->id.idxa = (hawk_oow_t)-1; + nde->idx = idx; + + return (hawk_nde_t*)nde; + } + + /* undefined variable */ + SETERR_ARG_LOC (awk, HAWK_EUNDEF, name->ptr, name->len, xloc); + +exit_func: + hawk_clrpt (awk, idx); + hawk_freemem (awk, nde); + + return HAWK_NULL; +} + +static hawk_nde_t* parse_fncall (hawk_t* awk, const hawk_oocs_t* name, hawk_fnc_t* fnc, const hawk_loc_t* xloc, int flags) +{ + hawk_nde_t* head, * curr, * nde; + hawk_nde_fncall_t* call; + hawk_oow_t nargs; + hawk_loc_t eloc; + + head = curr = HAWK_NULL; + call = HAWK_NULL; + nargs = 0; + + if (flags & FNCALL_FLAG_NOARG) goto make_node; + if (get_token(awk) <= -1) goto oops; + + if (MATCH(awk,TOK_RPAREN)) + { + /* no parameters to the function call */ + if (get_token(awk) <= -1) goto oops; + } + else + { + /* parse function parameters */ + while (1) + { + eloc = awk->tok.loc; + nde = parse_expr_withdc(awk, &eloc); + if (!nde) goto oops; + + if (!head) head = nde; + else curr->next = nde; + curr = nde; + + nargs++; + + if (MATCH(awk,TOK_RPAREN)) + { + if (get_token(awk) <= -1) goto oops; + break; + } + + if (!MATCH(awk,TOK_COMMA)) + { + SETERR_TOK (awk, HAWK_ECOMMA); + goto oops; + } + + do + { + if (get_token(awk) <= -1) goto oops; + } + while (MATCH(awk,TOK_NEWLINE)); + } + + } + +make_node: + call = (hawk_nde_fncall_t*)hawk_callocmem(awk, HAWK_SIZEOF(*call)); + if (!call) + { + ADJERR_LOC (awk, xloc); + goto oops; + } + + if (flags & FNCALL_FLAG_VAR) + { + call->type = HAWK_NDE_FNCALL_VAR; + call->loc = *xloc; + call->u.var.var = (hawk_nde_var_t*)name; /* name is a pointer to a variable node */ + call->args = head; + call->nargs = nargs; + } + else if (fnc) + { + call->type = HAWK_NDE_FNCALL_FNC; + call->loc = *xloc; + + call->u.fnc.info.name.ptr = name->ptr; + call->u.fnc.info.name.len = name->len; + call->u.fnc.info.mod = fnc->mod; + call->u.fnc.spec = fnc->spec; + + call->args = head; + call->nargs = nargs; + + if (nargs > call->u.fnc.spec.arg.max) + { + SETERR_LOC (awk, HAWK_EARGTM, xloc); + goto oops; + } + else if (nargs < call->u.fnc.spec.arg.min) + { + SETERR_LOC (awk, HAWK_EARGTF, xloc); + goto oops; + } + } + else + { + call->type = HAWK_NDE_FNCALL_FUN; + call->loc = *xloc; + call->u.fun.name.ptr = name->ptr; + call->u.fun.name.len = name->len; + call->args = head; + call->nargs = nargs; + + /* store a non-builtin function call into the awk->parse.funs table */ + if (!hawk_htb_upsert(awk->parse.funs, name->ptr, name->len, call, 0)) + { + SETERR_LOC (awk, HAWK_ENOMEM, xloc); + goto oops; + } + } + + return (hawk_nde_t*)call; + +oops: + if (call) hawk_freemem (awk, call); + if (head) hawk_clrpt (awk, head); + return HAWK_NULL; +} + +static int get_number (hawk_t* awk, hawk_tok_t* tok) +{ + hawk_ooci_t c; + + HAWK_ASSERT (awk, HAWK_OOECS_LEN(tok->name) == 0); + SET_TOKEN_TYPE (awk, tok, TOK_INT); + + c = awk->sio.last.c; + + if (c == HAWK_T('0')) + { + ADD_TOKEN_CHAR (awk, tok, c); + GET_CHAR_TO (awk, c); + + if (c == HAWK_T('x') || c == HAWK_T('X')) + { + /* hexadecimal number */ + do + { + ADD_TOKEN_CHAR (awk, tok, c); + GET_CHAR_TO (awk, c); + } + while (hawk_is_ooch_xdigit(c)); + + return 0; + } + else if (c == HAWK_T('b') || c == HAWK_T('B')) + { + /* binary number */ + do + { + ADD_TOKEN_CHAR (awk, tok, c); + GET_CHAR_TO (awk, c); + } + while (c == HAWK_T('0') || c == HAWK_T('1')); + + return 0; + } + else if (c != '.') + { + /* octal number */ + while (c >= HAWK_T('0') && c <= HAWK_T('7')) + { + ADD_TOKEN_CHAR (awk, tok, c); + GET_CHAR_TO (awk, c); + } + + if (c == HAWK_T('8') || c == HAWK_T('9')) + { + hawk_ooch_t cc = (hawk_ooch_t)c; + SETERR_ARG_LOC (awk, HAWK_ELXDIG, &cc, 1, &awk->tok.loc); + return -1; + } + + return 0; + } + } + + while (hawk_is_ooch_digit(c)) + { + ADD_TOKEN_CHAR (awk, tok, c); + GET_CHAR_TO (awk, c); + } + + if (c == HAWK_T('.')) + { + /* floating-point number */ + SET_TOKEN_TYPE (awk, tok, TOK_FLT); + + ADD_TOKEN_CHAR (awk, tok, c); + GET_CHAR_TO (awk, c); + + while (hawk_is_ooch_digit(c)) + { + ADD_TOKEN_CHAR (awk, tok, c); + GET_CHAR_TO (awk, c); + } + } + + if (c == HAWK_T('E') || c == HAWK_T('e')) + { + SET_TOKEN_TYPE (awk, tok, TOK_FLT); + + ADD_TOKEN_CHAR (awk, tok, c); + GET_CHAR_TO (awk, c); + + if (c == HAWK_T('+') || c == HAWK_T('-')) + { + ADD_TOKEN_CHAR (awk, tok, c); + GET_CHAR_TO (awk, c); + } + + while (hawk_is_ooch_digit(c)) + { + ADD_TOKEN_CHAR (awk, tok, c); + GET_CHAR_TO (awk, c); + } + } + + return 0; +} + +/* i think allowing only up to 2 hexadigits is more useful though it + * may break compatibilty with other awk implementations. If you want + * more than 2, define HEX_DIGIT_LIMIT_FOR_X to HAWK_TYPE_MAX(hawk_oow_t). */ +/*#define HEX_DIGIT_LIMIT_FOR_X (HAWK_TYPE_MAX(hawk_oow_t))*/ +#define HEX_DIGIT_LIMIT_FOR_X (2) + +static int get_string ( + hawk_t* awk, hawk_ooch_t end_char, + hawk_ooch_t esc_char, int keep_esc_char, int byte_only, + hawk_oow_t preescaped, hawk_tok_t* tok) +{ + hawk_ooci_t c; + hawk_oow_t escaped = preescaped; + hawk_oow_t digit_count = 0; + hawk_uint32_t c_acc = 0; + + while (1) + { + GET_CHAR_TO (awk, c); + + if (c == HAWK_OOCI_EOF) + { + SETERR_LOC (awk, HAWK_ESTRNC, &awk->tok.loc); + return -1; + } + + #if defined(HAWK_OOCH_IS_BCH) + /* nothing extra to handle byte_only */ + #else + if (byte_only && c != HAWK_T('\\') && !HAWK_BYTE_PRINTABLE(c)) + { + hawk_ooch_t wc = c; + SETERR_ARG_LOC (awk, HAWK_EMBSCHR, &wc, 1, &awk->tok.loc); + return -1; + } + #endif + + if (escaped == 3) + { + if (c >= HAWK_T('0') && c <= HAWK_T('7')) + { + c_acc = c_acc * 8 + c - HAWK_T('0'); + digit_count++; + if (digit_count >= escaped) + { + /* should i limit the max to 0xFF/0377? + if (c_acc > 0377) c_acc = 0377; */ + ADD_TOKEN_UINT32 (awk, tok, c_acc); + escaped = 0; + } + continue; + } + else + { + ADD_TOKEN_UINT32 (awk, tok, c_acc); + escaped = 0; + } + } + else if (escaped == HEX_DIGIT_LIMIT_FOR_X || escaped == 4 || escaped == 8) + { + if (c >= HAWK_T('0') && c <= HAWK_T('9')) + { + c_acc = c_acc * 16 + c - HAWK_T('0'); + digit_count++; + if (digit_count >= escaped) + { + ADD_TOKEN_UINT32 (awk, tok, c_acc); + escaped = 0; + } + continue; + } + else if (c >= HAWK_T('A') && c <= HAWK_T('F')) + { + c_acc = c_acc * 16 + c - HAWK_T('A') + 10; + digit_count++; + if (digit_count >= escaped) + { + ADD_TOKEN_UINT32 (awk, tok, c_acc); + escaped = 0; + } + continue; + } + else if (c >= HAWK_T('a') && c <= HAWK_T('f')) + { + c_acc = c_acc * 16 + c - HAWK_T('a') + 10; + digit_count++; + if (digit_count >= escaped) + { + ADD_TOKEN_UINT32 (awk, tok, c_acc); + escaped = 0; + } + continue; + } + else + { + hawk_ooch_t rc; + + rc = (escaped == HEX_DIGIT_LIMIT_FOR_X)? HAWK_T('x'): + (escaped == 4)? HAWK_T('u'): HAWK_T('U'); + if (digit_count == 0) + { + /* no valid character after the escaper. + * keep the escaper as it is. consider this input: + * \xGG + * 'c' is at the first G. this part is to restore the + * \x part. since \x is not followed by any hexadecimal + * digits, it's literally 'x' */ + ADD_TOKEN_CHAR (awk, tok, rc); + } + else ADD_TOKEN_UINT32 (awk, tok, c_acc); + + escaped = 0; + } + } + + if (escaped == 0 && c == end_char) + { + /* terminating quote */ + /*GET_CHAR_TO (awk, c);*/ + GET_CHAR (awk); + break; + } + + if (escaped == 0 && c == esc_char) + { + escaped = 1; + continue; + } + + if (escaped == 1) + { + if (c == HAWK_T('n')) c = HAWK_T('\n'); + else if (c == HAWK_T('r')) c = HAWK_T('\r'); + else if (c == HAWK_T('t')) c = HAWK_T('\t'); + else if (c == HAWK_T('f')) c = HAWK_T('\f'); + else if (c == HAWK_T('b')) c = HAWK_T('\b'); + else if (c == HAWK_T('v')) c = HAWK_T('\v'); + else if (c == HAWK_T('a')) c = HAWK_T('\a'); + else if (c >= HAWK_T('0') && c <= HAWK_T('7') && end_char != HAWK_T('/')) + { + /* i don't support the octal notation for a regular expression. + * it conflicts with the backreference notation between \1 and \7 inclusive. */ + escaped = 3; + digit_count = 1; + c_acc = c - HAWK_T('0'); + continue; + } + else if (c == HAWK_T('x')) + { + escaped = HEX_DIGIT_LIMIT_FOR_X; + digit_count = 0; + c_acc = 0; + continue; + } + else if (!byte_only && c == HAWK_T('u')) + { + /* in the MCHAR mode, the \u letter will get converted to UTF-8 sequences. + * see ADD_TOKEN_UINT32(). */ + escaped = 4; + digit_count = 0; + c_acc = 0; + continue; + } + else if (!byte_only && c == HAWK_T('U')) + { + /* in the MCHAR mode, the \u letter will get converted to UTF-8 sequences + * see ADD_TOKEN_UINT32(). */ + escaped = 8; + digit_count = 0; + c_acc = 0; + continue; + } + else if (keep_esc_char) + { + /* if the following character doesn't compose a proper + * escape sequence, keep the escape character. + * an unhandled escape sequence can be handled + * outside this function since the escape character + * is preserved.*/ + ADD_TOKEN_CHAR (awk, tok, esc_char); + } + + escaped = 0; + } + + ADD_TOKEN_CHAR (awk, tok, c); + } + + return 0; +} + +static int get_rexstr (hawk_t* awk, hawk_tok_t* tok) +{ + if (awk->sio.last.c == HAWK_T('/')) + { + /* handle an empty regular expression. + * + * this condition is met when the input is //. + * the first / has been tokenized to TOK_DIV already. + * if TOK_DIV is seen as a primary, this function is called. + * as the token buffer has been cleared by the caller and + * the token type is set to TOK_REX, this function can + * just return after reading the next character. + * see parse_primary_rex(). */ + GET_CHAR (awk); + return 0; + } + else + { + hawk_oow_t preescaped = 0; + if (awk->sio.last.c == HAWK_T('\\')) + { + /* for input like /\//, this condition is met. + * the initial escape character is added when the + * second charater is handled in get_string() */ + preescaped = 1; + } + else + { + /* add other initial characters here as get_string() + * begins with reading the next character */ + ADD_TOKEN_CHAR (awk, tok, awk->sio.last.c); + } + return get_string(awk, HAWK_T('/'), HAWK_T('\\'), 1, 0, preescaped, tok); + } +} + + +static int get_single_quoted_string (hawk_t* awk, int byte_only, hawk_tok_t* tok) +{ + hawk_ooci_t c; + + while (1) + { + GET_CHAR_TO (awk, c); + + if (c == HAWK_OOCI_EOF) + { + SETERR_LOC (awk, HAWK_ESTRNC, &awk->tok.loc); + return -1; + } + + #if defined(HAWK_OOCH_IS_BCH) + /* nothing extra to handle byte_only */ + #else + if (byte_only && c != HAWK_T('\\') && !HAWK_BYTE_PRINTABLE(c)) + { + hawk_ooch_t wc = c; + SETERR_ARG_LOC (awk, HAWK_EMBSCHR, &wc, 1, &awk->tok.loc); + return -1; + } + #endif + + if (c == HAWK_T('\'')) + { + /* terminating quote */ + GET_CHAR (awk); + break; + } + + ADD_TOKEN_CHAR (awk, tok, c); + } + + return 0; +} + +static int skip_spaces (hawk_t* awk) +{ + hawk_ooci_t c = awk->sio.last.c; + + if (awk->opt.trait & HAWK_NEWLINE) + { + do + { + while (c != HAWK_T('\n') && hawk_is_ooch_space(c)) + GET_CHAR_TO (awk, c); + + if (c == HAWK_T('\\')) + { + hawk_sio_lxc_t bs; + hawk_sio_lxc_t cr; + int hascr = 0; + + bs = awk->sio.last; + GET_CHAR_TO (awk, c); + if (c == HAWK_T('\r')) + { + hascr = 1; + cr = awk->sio.last; + GET_CHAR_TO (awk, c); + } + + if (c == HAWK_T('\n')) + { + GET_CHAR_TO (awk, c); + continue; + } + else + { + /* push back the last character */ + unget_char (awk, &awk->sio.last); + /* push CR if any */ + if (hascr) unget_char (awk, &cr); + /* restore the orginal backslash */ + awk->sio.last = bs; + } + } + + break; + } + while (1); + } + else + { + while (hawk_is_ooch_space(c)) GET_CHAR_TO (awk, c); + } + + return 0; +} + +static int skip_comment (hawk_t* awk) +{ + hawk_ooci_t c = awk->sio.last.c; + hawk_sio_lxc_t lc; + + if (c == HAWK_T('#')) + { + /* skip up to \n */ + do { GET_CHAR_TO (awk, c); } + while (c != HAWK_T('\n') && c != HAWK_OOCI_EOF); + + if (!(awk->opt.trait & HAWK_NEWLINE)) GET_CHAR (awk); + return 1; /* comment by # */ + } + + /* handle c-style comment */ + if (c != HAWK_T('/')) return 0; /* not a comment */ + + /* save the last character */ + lc = awk->sio.last; + /* read a new character */ + GET_CHAR_TO (awk, c); + + if (c == HAWK_T('*')) + { + do + { + GET_CHAR_TO (awk, c); + if (c == HAWK_OOCI_EOF) + { + hawk_loc_t loc; + loc.line = awk->sio.inp->line; + loc.colm = awk->sio.inp->colm; + loc.file = awk->sio.inp->name; + SETERR_LOC (awk, HAWK_ECMTNC, &loc); + return -1; + } + + if (c == HAWK_T('*')) + { + GET_CHAR_TO (awk, c); + if (c == HAWK_OOCI_EOF) + { + hawk_loc_t loc; + loc.line = awk->sio.inp->line; + loc.colm = awk->sio.inp->colm; + loc.file = awk->sio.inp->name; + SETERR_LOC (awk, HAWK_ECMTNC, &loc); + return -1; + } + + if (c == HAWK_T('/')) + { + /*GET_CHAR_TO (awk, c);*/ + GET_CHAR (awk); + break; + } + } + } + while (1); + + return 1; /* c-style comment */ + } + + /* unget '*' */ + unget_char (awk, &awk->sio.last); + /* restore the previous state */ + awk->sio.last = lc; + + return 0; +} + +static int get_symbols (hawk_t* awk, hawk_ooci_t c, hawk_tok_t* tok) +{ + struct ops_t + { + const hawk_ooch_t* str; + hawk_oow_t len; + int tid; + int trait; + }; + + static struct ops_t ops[] = + { + { HAWK_T("==="), 3, TOK_TEQ, 0 }, + { HAWK_T("=="), 2, TOK_EQ, 0 }, + { HAWK_T("="), 1, TOK_ASSN, 0 }, + { HAWK_T("!=="), 3, TOK_TNE, 0 }, + { HAWK_T("!="), 2, TOK_NE, 0 }, + { HAWK_T("!~"), 2, TOK_NM, 0 }, + { HAWK_T("!"), 1, TOK_LNOT, 0 }, + { HAWK_T(">>="), 3, TOK_RS_ASSN, 0 }, + { HAWK_T(">>"), 2, TOK_RS, 0 }, + { HAWK_T(">="), 2, TOK_GE, 0 }, + { HAWK_T(">"), 1, TOK_GT, 0 }, + { HAWK_T("<<="), 3, TOK_LS_ASSN, 0 }, + { HAWK_T("<<"), 2, TOK_LS, 0 }, + { HAWK_T("<="), 2, TOK_LE, 0 }, + { HAWK_T("<"), 1, TOK_LT, 0 }, + { HAWK_T("||"), 2, TOK_LOR, 0 }, + { HAWK_T("|="), 2, TOK_BOR_ASSN, 0 }, + { HAWK_T("|"), 1, TOK_BOR, 0 }, + { HAWK_T("&&"), 2, TOK_LAND, 0 }, + { HAWK_T("&="), 2, TOK_BAND_ASSN, 0 }, + { HAWK_T("&"), 1, TOK_BAND, 0 }, + { HAWK_T("^^="), 3, TOK_BXOR_ASSN, 0 }, + { HAWK_T("^^"), 2, TOK_BXOR, 0 }, + { HAWK_T("^="), 2, TOK_EXP_ASSN, 0 }, + { HAWK_T("^"), 1, TOK_EXP, 0 }, + { HAWK_T("++"), 2, TOK_PLUSPLUS, 0 }, + { HAWK_T("+="), 2, TOK_PLUS_ASSN, 0 }, + { HAWK_T("+"), 1, TOK_PLUS, 0 }, + { HAWK_T("--"), 2, TOK_MINUSMINUS, 0 }, + { HAWK_T("-="), 2, TOK_MINUS_ASSN, 0 }, + { HAWK_T("-"), 1, TOK_MINUS, 0 }, + { HAWK_T("**="), 3, TOK_EXP_ASSN, 0 }, + { HAWK_T("**"), 2, TOK_EXP, 0 }, + { HAWK_T("*="), 2, TOK_MUL_ASSN, 0 }, + { HAWK_T("*"), 1, TOK_MUL, 0 }, + { HAWK_T("/="), 2, TOK_DIV_ASSN, 0 }, + { HAWK_T("/"), 1, TOK_DIV, 0 }, + { HAWK_T("\\="), 2, TOK_IDIV_ASSN, 0 }, + { HAWK_T("\\"), 1, TOK_IDIV, 0 }, + { HAWK_T("%%="), 3, TOK_CONCAT_ASSN, 0 }, + { HAWK_T("%%"), 2, TOK_CONCAT, 0 }, + { HAWK_T("%="), 2, TOK_MOD_ASSN, 0 }, + { HAWK_T("%"), 1, TOK_MOD, 0 }, + { HAWK_T("~~"), 2, TOK_BNOT, 0 }, + { HAWK_T("~"), 1, TOK_MA, 0 }, + { HAWK_T("("), 1, TOK_LPAREN, 0 }, + { HAWK_T(")"), 1, TOK_RPAREN, 0 }, + { HAWK_T("{"), 1, TOK_LBRACE, 0 }, + { HAWK_T("}"), 1, TOK_RBRACE, 0 }, + { HAWK_T("["), 1, TOK_LBRACK, 0 }, + { HAWK_T("]"), 1, TOK_RBRACK, 0 }, + { HAWK_T("$"), 1, TOK_DOLLAR, 0 }, + { HAWK_T(","), 1, TOK_COMMA, 0 }, + { HAWK_T(";"), 1, TOK_SEMICOLON, 0 }, + { HAWK_T("::"), 2, TOK_DBLCOLON, 0 }, + { HAWK_T(":"), 1, TOK_COLON, 0 }, + { HAWK_T("?"), 1, TOK_QUEST, 0 }, + { HAWK_NULL, 0, 0, 0 } + }; + + struct ops_t* p; + int idx = 0; + + /* note that the loop below is not generaic enough. + * you must keep the operators strings in a particular order */ + + + for (p = ops; p->str != HAWK_NULL; ) + { + if (p->trait == 0 || (awk->opt.trait & p->trait)) + { + if (p->str[idx] == HAWK_T('\0')) + { + ADD_TOKEN_STR (awk, tok, p->str, p->len); + SET_TOKEN_TYPE (awk, tok, p->tid); + return 1; + } + + if (c == p->str[idx]) + { + idx++; + GET_CHAR_TO (awk, c); + continue; + } + } + + p++; + } + + return 0; +} + +static int get_token_into (hawk_t* awk, hawk_tok_t* tok) +{ + hawk_ooci_t c; + int n; + int skip_semicolon_after_include = 0; + +retry: + do + { + if (skip_spaces(awk) <= -1) return -1; + if ((n = skip_comment(awk)) <= -1) return -1; + } + while (n >= 1); + + hawk_ooecs_clear (tok->name); + tok->loc.file = awk->sio.last.file; + tok->loc.line = awk->sio.last.line; + tok->loc.colm = awk->sio.last.colm; + + c = awk->sio.last.c; + + if (c == HAWK_OOCI_EOF) + { + n = end_include(awk); + if (n <= -1) return -1; + if (n >= 1) + { + /*awk->sio.last = awk->sio.inp->last;*/ + /* mark that i'm retrying after end of an included file */ + skip_semicolon_after_include = 1; + goto retry; + } + + ADD_TOKEN_STR (awk, tok, HAWK_T(""), 5); + SET_TOKEN_TYPE (awk, tok, TOK_EOF); + } + else if (c == HAWK_T('\n')) + { + /*ADD_TOKEN_CHAR (awk, tok, HAWK_T('\n'));*/ + ADD_TOKEN_STR (awk, tok, HAWK_T(""), 4); + SET_TOKEN_TYPE (awk, tok, TOK_NEWLINE); + GET_CHAR (awk); + } + else if (hawk_is_ooch_digit(c)/*|| c == HAWK_T('.')*/) + { + if (get_number (awk, tok) <= -1) return -1; + } + else if (c == HAWK_T('.')) + { + hawk_sio_lxc_t lc; + + lc = awk->sio.last; + GET_CHAR_TO (awk, c); + + unget_char (awk, &awk->sio.last); + awk->sio.last = lc; + + if (hawk_is_ooch_digit(c)) + { + /* for a token such as .123 */ + if (get_number(awk, tok) <= -1) return -1; + } + else + { + c = HAWK_T('.'); + goto try_get_symbols; + } + } + else if (c == HAWK_T('@')) + { + int type; + + ADD_TOKEN_CHAR (awk, tok, c); + GET_CHAR_TO (awk, c); + + /* + if (c == HAWK_T('@')) + { + SET_TOKEN_TYPE (awk, tok, TOK_DBLAT); + GET_CHAR (awk); + }*/ + /* other special extended operators here + else if (c == HAWK_T('*')) + { + }*/ + /*else*/ if (c != HAWK_T('_') && !hawk_is_ooch_alpha(c)) + { + /* this extended keyword is empty, + * not followed by a valid word */ + SETERR_LOC (awk, HAWK_EXKWEM, &(awk)->tok.loc); + return -1; + } + else + { + /* expect normal identifier starting with an alphabet */ + do + { + ADD_TOKEN_CHAR (awk, tok, c); + GET_CHAR_TO (awk, c); + } + while (c == HAWK_T('_') || hawk_is_ooch_alpha(c) || hawk_is_ooch_digit(c)); + + type = classify_ident(awk, HAWK_OOECS_OOCS(tok->name)); + if (type == TOK_IDENT) + { + SETERR_TOK (awk, HAWK_EXKWNR); + return -1; + } + SET_TOKEN_TYPE (awk, tok, type); + } + } + else if (c == HAWK_T('B')) + { + GET_CHAR_TO (awk, c); + if (c == HAWK_T('\"')) + { + /* multi-byte string/byte array */ + SET_TOKEN_TYPE (awk, tok, TOK_MBS); + if (get_string(awk, c, HAWK_T('\\'), 0, 1, 0, tok) <= -1) return -1; + } + else if (c == HAWK_T('\'')) + { + SET_TOKEN_TYPE (awk, tok, TOK_MBS); + if (get_single_quoted_string(awk, 1, tok) <= -1) return -1; + } + else + { + ADD_TOKEN_CHAR (awk, tok, HAWK_T('B')); + goto process_identifier; + } + } + else if (c == HAWK_T('_') || hawk_is_ooch_alpha(c)) + { + int type; + + process_identifier: + /* identifier */ + do + { + ADD_TOKEN_CHAR (awk, tok, c); + GET_CHAR_TO (awk, c); + } + while (c == HAWK_T('_') || hawk_is_ooch_alpha(c) || hawk_is_ooch_digit(c)); + + type = classify_ident(awk, HAWK_OOECS_OOCS(tok->name)); + SET_TOKEN_TYPE (awk, tok, type); + } + else if (c == HAWK_T('\"')) + { + /* double-quoted string */ + SET_TOKEN_TYPE (awk, tok, TOK_STR); + if (get_string(awk, c, HAWK_T('\\'), 0, 0, 0, tok) <= -1) return -1; + } + else if (c == HAWK_T('\'')) + { + /* single-quoted string - no escaping */ + SET_TOKEN_TYPE (awk, tok, TOK_STR); + if (get_single_quoted_string(awk, 0, tok) <= -1) return -1; + } + else + { + try_get_symbols: + n = get_symbols(awk, c, tok); + if (n <= -1) return -1; + if (n == 0) + { + /* not handled yet */ + if (c == HAWK_T('\0')) + { + SETERR_ARG_LOC ( + awk, HAWK_ELXCHR, + HAWK_T(""), 5, &tok->loc); + } + else + { + hawk_ooch_t cc = (hawk_ooch_t)c; + SETERR_ARG_LOC (awk, HAWK_ELXCHR, &cc, 1, &tok->loc); + } + return -1; + } + + if (skip_semicolon_after_include && (tok->type == TOK_SEMICOLON || tok->type == TOK_NEWLINE)) + { + /* this handles the optional semicolon after the + * included file named as in @include "file-name"; */ + skip_semicolon_after_include = 0; + goto retry; + } + } + + if (skip_semicolon_after_include && !(awk->opt.trait & HAWK_NEWLINE)) + { + /* semiclon has not been skipped yet and the + * newline option is not set. */ + hawk_seterror (awk, HAWK_ESCOLON, HAWK_OOECS_OOCS(tok->name), &tok->loc); + return -1; + } + + return 0; +} + +static int get_token (hawk_t* awk) +{ + awk->ptok.type = awk->tok.type; + awk->ptok.loc.file = awk->tok.loc.file; + awk->ptok.loc.line = awk->tok.loc.line; + awk->ptok.loc.colm = awk->tok.loc.colm; + hawk_ooecs_swap (awk->ptok.name, awk->tok.name); + + if (HAWK_OOECS_LEN(awk->ntok.name) > 0) + { + awk->tok.type = awk->ntok.type; + awk->tok.loc.file = awk->ntok.loc.file; + awk->tok.loc.line = awk->ntok.loc.line; + awk->tok.loc.colm = awk->ntok.loc.colm; + + hawk_ooecs_swap (awk->tok.name, awk->ntok.name); + hawk_ooecs_clear (awk->ntok.name); + + return 0; + } + + return get_token_into (awk, &awk->tok); +} + +static int preget_token (hawk_t* awk) +{ + /* LIMITATION: no more than one token can be pre-read in a row + without consumption. */ + + if (HAWK_OOECS_LEN(awk->ntok.name) > 0) + { + /* you can't read more than 1 token in advance. + * + * if there is a token already read in, it is just + * retained. + * + * parsing an expression like '$0 | a' causes this + * funtion to be called before get_token() consumes the + * pre-read token. + * + * Because the expression like this + * print $1 | getline x; + * must be parsed as + * print $(1 | getline x); + * preget_token() is called from parse_primary(). + * + * For the expression '$0 | $2', + * 1) parse_primary() calls parse_primary_positional() if $ is encountered. + * 2) parse_primary_positional() calls parse_primary() recursively for the positional part after $. + * 3) parse_primary() in #2 calls preget_token() + * 4) parse_primary() in #1 also calls preget_token(). + * + * this block is reached because no token is consumed between #3 and #4. + * + * in short, it happens if getline doesn't doesn't follow | after the positional. + * $1 | $2 + * $1 | abc + 20 + */ + return 0; + } + else + { + /* if there is no token pre-read, we get a new + * token and place it to awk->ntok. */ + return get_token_into (awk, &awk->ntok); + } +} + +static int classify_ident (hawk_t* awk, const hawk_oocs_t* name) +{ + /* perform binary search */ + + /* declaring left, right, mid to be the int type is ok + * because we know kwtab is small enough. */ + int left = 0, right = HAWK_COUNTOF(kwtab) - 1, mid; + + while (left <= right) + { + int n; + kwent_t* kwp; + + /*mid = (left + right) / 2;*/ + mid = left + (right - left) / 2; + kwp = &kwtab[mid]; + + n = hawk_comp_oochars(kwp->name.ptr, kwp->name.len, name->ptr, name->len, 0); + if (n > 0) + { + /* if left, right, mid were of hawk_oow_t, + * you would need the following line. + if (mid == 0) break; + */ + right = mid - 1; + } + else if (n < 0) left = mid + 1; + else + { + if ((awk->opt.trait & kwp->trait) != kwp->trait) break; + return kwp->type; + } + } + + return TOK_IDENT; +} + +struct deparse_func_t +{ + hawk_t* awk; + hawk_ooch_t* tmp; + hawk_oow_t tmp_len; + int ret; +}; + +static int deparse (hawk_t* awk) +{ + hawk_nde_t* nde; + hawk_chain_t* chain; + hawk_ooch_t tmp[HAWK_SIZEOF(hawk_oow_t)*8 + 32]; + struct deparse_func_t df; + int n = 0; + hawk_ooi_t op; + hawk_oocs_t kw; + + HAWK_ASSERT (awk, awk->sio.outf != HAWK_NULL); + + HAWK_MEMSET (&awk->sio.arg, 0, HAWK_SIZEOF(awk->sio.arg)); + + CLRERR (awk); + op = awk->sio.outf(awk, HAWK_SIO_CMD_OPEN, &awk->sio.arg, HAWK_NULL, 0); + if (op <= -1) + { + if (ISNOERR(awk)) SETERR_ARG (awk, HAWK_EOPEN, HAWK_T(""), 6); + return -1; + } + +#define EXIT_DEPARSE() do { n = -1; goto exit_deparse; } while(0) + + if (awk->parse.pragma.rtx_stack_limit > 0 && awk->parse.pragma.rtx_stack_limit != awk->opt.rtx_stack_limit) + { + hawk_oow_t len; + + len = hawk_int_to_oocstr((hawk_int_t)awk->parse.pragma.rtx_stack_limit, 10, HAWK_NULL, tmp, HAWK_COUNTOF(tmp)); + if (hawk_putsroocs(awk, HAWK_T("@pragma stack_limit ")) <= -1 || + hawk_putsroocsn (awk, tmp, len) <= -1 || + hawk_putsroocs(awk, HAWK_T(";\n")) <= -1) EXIT_DEPARSE (); + } + + if (awk->tree.ngbls > awk->tree.ngbls_base) + { + hawk_oow_t i, len; + + HAWK_ASSERT (awk, awk->tree.ngbls > 0); + + hawk_getkwname (awk, HAWK_KWID_XGLOBAL, &kw); + if (hawk_putsroocsn(awk, kw.ptr, kw.len) <= -1 || hawk_putsroocs (awk, HAWK_T(" ")) <= -1) EXIT_DEPARSE (); + + for (i = awk->tree.ngbls_base; i < awk->tree.ngbls - 1; i++) + { + if (!(awk->opt.trait & HAWK_IMPLICIT)) + { + /* use the actual name if no named variable is allowed */ + if (hawk_putsroocsn (awk, HAWK_ARR_DPTR(awk->parse.gbls, i), HAWK_ARR_DLEN(awk->parse.gbls, i)) <= -1) EXIT_DEPARSE (); + } + else + { + len = hawk_int_to_oocstr((hawk_int_t)i, 10, HAWK_T("__g"), tmp, HAWK_COUNTOF(tmp)); + HAWK_ASSERT (awk, len != (hawk_oow_t)-1); + if (hawk_putsroocsn (awk, tmp, len) <= -1) EXIT_DEPARSE (); + } + + if (hawk_putsroocs (awk, HAWK_T(", ")) <= -1) EXIT_DEPARSE (); + } + + if (!(awk->opt.trait & HAWK_IMPLICIT)) + { + /* use the actual name if no named variable is allowed */ + if (hawk_putsroocsn(awk, HAWK_ARR_DPTR(awk->parse.gbls,i), HAWK_ARR_DLEN(awk->parse.gbls,i)) <= -1) EXIT_DEPARSE (); + } + else + { + len = hawk_int_to_oocstr((hawk_int_t)i, 10, HAWK_T("__g"), tmp, HAWK_COUNTOF(tmp)); + HAWK_ASSERT (awk, len != (hawk_oow_t)-1); + if (hawk_putsroocsn (awk, tmp, len) <= -1) EXIT_DEPARSE (); + } + + if (awk->opt.trait & HAWK_CRLF) + { + if (hawk_putsroocs(awk, HAWK_T(";\r\n\r\n")) <= -1) EXIT_DEPARSE (); + } + else + { + if (hawk_putsroocs(awk, HAWK_T(";\n\n")) <= -1) EXIT_DEPARSE (); + } + } + + df.awk = awk; + df.tmp = tmp; + df.tmp_len = HAWK_COUNTOF(tmp); + df.ret = 0; + + hawk_htb_walk (awk->tree.funs, deparse_func, &df); + if (df.ret <= -1) EXIT_DEPARSE (); + + for (nde = awk->tree.begin; nde != HAWK_NULL; nde = nde->next) + { + hawk_oocs_t kw; + + hawk_getkwname (awk, HAWK_KWID_BEGIN, &kw); + + if (hawk_putsroocsn (awk, kw.ptr, kw.len) <= -1) EXIT_DEPARSE (); + if (hawk_putsroocs (awk, HAWK_T(" ")) <= -1) EXIT_DEPARSE (); + if (hawk_prnnde (awk, nde) <= -1) EXIT_DEPARSE (); + + if (awk->opt.trait & HAWK_CRLF) + { + if (put_char(awk, HAWK_T('\r')) <= -1) EXIT_DEPARSE (); + } + + if (put_char(awk, HAWK_T('\n')) <= -1) EXIT_DEPARSE (); + } + + chain = awk->tree.chain; + while (chain != HAWK_NULL) + { + if (chain->pattern != HAWK_NULL) + { + if (hawk_prnptnpt(awk, chain->pattern) <= -1) EXIT_DEPARSE (); + } + + if (chain->action == HAWK_NULL) + { + /* blockless pattern */ + if (awk->opt.trait & HAWK_CRLF) + { + if (put_char(awk, HAWK_T('\r')) <= -1) EXIT_DEPARSE (); + } + + if (put_char(awk, HAWK_T('\n')) <= -1) EXIT_DEPARSE (); + } + else + { + if (chain->pattern != HAWK_NULL) + { + if (put_char(awk, HAWK_T(' ')) <= -1) EXIT_DEPARSE (); + } + if (hawk_prnpt(awk, chain->action) <= -1) EXIT_DEPARSE (); + } + + if (awk->opt.trait & HAWK_CRLF) + { + if (put_char(awk, HAWK_T('\r')) <= -1) EXIT_DEPARSE (); + } + + if (put_char(awk, HAWK_T('\n')) <= -1) EXIT_DEPARSE (); + + chain = chain->next; + } + + for (nde = awk->tree.end; nde != HAWK_NULL; nde = nde->next) + { + hawk_oocs_t kw; + + hawk_getkwname (awk, HAWK_KWID_END, &kw); + + if (hawk_putsroocsn(awk, kw.ptr, kw.len) <= -1) EXIT_DEPARSE (); + if (hawk_putsroocs(awk, HAWK_T(" ")) <= -1) EXIT_DEPARSE (); + if (hawk_prnnde(awk, nde) <= -1) EXIT_DEPARSE (); + + /* + if (awk->opt.trait & HAWK_CRLF) + { + if (put_char (awk, HAWK_T('\r')) <= -1) EXIT_DEPARSE (); + } + + if (put_char (awk, HAWK_T('\n')) <= -1) EXIT_DEPARSE (); + */ + } + + if (flush_out (awk) <= -1) EXIT_DEPARSE (); + +exit_deparse: + if (n == 0) CLRERR (awk); + if (awk->sio.outf(awk, HAWK_SIO_CMD_CLOSE, &awk->sio.arg, HAWK_NULL, 0) != 0) + { + if (n == 0) + { + if (ISNOERR(awk)) SETERR_ARG (awk, HAWK_ECLOSE, HAWK_T(""), 6); + n = -1; + } + } + + return n; +} + +static hawk_htb_walk_t deparse_func (hawk_htb_t* map, hawk_htb_pair_t* pair, void* arg) +{ + struct deparse_func_t* df = (struct deparse_func_t*)arg; + hawk_fun_t* fun = (hawk_fun_t*)HAWK_HTB_VPTR(pair); + hawk_oow_t i, n; + hawk_oocs_t kw; + + HAWK_ASSERT (awk, hawk_comp_oochars(HAWK_HTB_KPTR(pair), HAWK_HTB_KLEN(pair), fun->name.ptr, fun->name.len) == 0); + +#define PUT_C(x,c) \ + if (put_char(x->awk,c)==-1) { \ + x->ret = -1; return HAWK_HTB_WALK_STOP; \ + } + +#define PUT_S(x,str) \ + if (hawk_putsroocs(x->awk,str) <= -1) { \ + x->ret = -1; return HAWK_HTB_WALK_STOP; \ + } + +#define PUT_SX(x,str,len) \ + if (hawk_putsroocsn (x->awk, str, len) <= -1) { \ + x->ret = -1; return HAWK_HTB_WALK_STOP; \ + } + + hawk_getkwname (df->awk, HAWK_KWID_FUNCTION, &kw); + PUT_SX (df, kw.ptr, kw.len); + + PUT_C (df, HAWK_T(' ')); + PUT_SX (df, fun->name.ptr, fun->name.len); + PUT_S (df, HAWK_T(" (")); + + for (i = 0; i < fun->nargs; ) + { + if (fun->argspec && fun->argspec[i] == 'r') PUT_S (df, HAWK_T("&")); + n = hawk_int_to_oocstr (i++, 10, HAWK_T("__p"), df->tmp, df->tmp_len); + HAWK_ASSERT (awk, n != (hawk_oow_t)-1); + PUT_SX (df, df->tmp, n); + + if (i >= fun->nargs) break; + PUT_S (df, HAWK_T(", ")); + } + + PUT_S (df, HAWK_T(")")); + if (df->awk->opt.trait & HAWK_CRLF) PUT_C (df, HAWK_T('\r')); + + PUT_C (df, HAWK_T('\n')); + + if (hawk_prnpt(df->awk, fun->body) <= -1) return -1; + if (df->awk->opt.trait & HAWK_CRLF) + { + PUT_C (df, HAWK_T('\r')); + } + PUT_C (df, HAWK_T('\n')); + + return HAWK_HTB_WALK_FORWARD; + +#undef PUT_C +#undef PUT_S +#undef PUT_SX +} + +static int put_char (hawk_t* awk, hawk_ooch_t c) +{ + awk->sio.arg.b.buf[awk->sio.arg.b.len++] = c; + if (awk->sio.arg.b.len >= HAWK_COUNTOF(awk->sio.arg.b.buf)) + { + if (flush_out (awk) <= -1) return -1; + } + return 0; +} + +static int flush_out (hawk_t* awk) +{ + hawk_ooi_t n; + + while (awk->sio.arg.b.pos < awk->sio.arg.b.len) + { + CLRERR (awk); + n = awk->sio.outf ( + awk, HAWK_SIO_CMD_WRITE, &awk->sio.arg, + &awk->sio.arg.b.buf[awk->sio.arg.b.pos], + awk->sio.arg.b.len - awk->sio.arg.b.pos + ); + if (n <= 0) + { + if (ISNOERR(awk)) + SETERR_ARG (awk, HAWK_EWRITE, HAWK_T(""), 6); + return -1; + } + + awk->sio.arg.b.pos += n; + } + + awk->sio.arg.b.pos = 0; + awk->sio.arg.b.len = 0; + return 0; +} + +int hawk_putsroocs (hawk_t* awk, const hawk_ooch_t* str) +{ + while (*str != HAWK_T('\0')) + { + if (put_char (awk, *str) <= -1) return -1; + str++; + } + + return 0; +} + +int hawk_putsroocsn ( + hawk_t* awk, const hawk_ooch_t* str, hawk_oow_t len) +{ + const hawk_ooch_t* end = str + len; + + while (str < end) + { + if (put_char (awk, *str) <= -1) return -1; + str++; + } + + return 0; +} + +#if defined(HAWK_ENABLE_STATIC_MODULE) + +/* let's hardcode module information */ +//#include "mod-dir.h" +#include "mod-math.h" +#include "mod-str.h" +//#include "mod-sys.h" + +#if defined(HAWK_ENABLE_MOD_MPI) +#include "../awkmod/mod-mpi.h" +#endif + +#if defined(HAWK_ENABLE_MOD_MYSQL) +#include "../awkmod/mod-mysql.h" +#endif + +#if defined(HAWK_ENABLE_MOD_SED) +#include "../awkmod/mod-sed.h" +#endif + +#if defined(HAWK_ENABLE_MOD_UCI) +#include "../awkmod/mod-uci.h" +#endif + +/* + * if modules are linked statically into the main awk module, + * this table is used to find the entry point of the modules. + * you must update this table if you add more modules + */ + +static struct +{ + hawk_ooch_t* modname; + int (*modload) (hawk_mod_t* mod, hawk_t* awk); +} static_modtab[] = +{ +// { HAWK_T("dir"), hawk_mod_dir }, + { HAWK_T("math"), hawk_mod_math }, +#if defined(HAWK_ENABLE_MOD_MPI) + { HAWK_T("mpi"), hawk_mod_mpi }, +#endif +#if defined(HAWK_ENABLE_MOD_MYSQL) + { HAWK_T("mysql"), hawk_mod_mysql }, +#endif +#if defined(HAWK_ENABLE_MOD_SED) + { HAWK_T("sed"), hawk_mod_sed }, +#endif + { HAWK_T("str"), hawk_mod_str }, +// { HAWK_T("sys"), hawk_mod_sys }, +#if defined(HAWK_ENABLE_MOD_UCI) + { HAWK_T("uci"), hawk_mod_uci } +#endif +}; +#endif + +static hawk_mod_t* query_module (hawk_t* awk, const hawk_oocs_t segs[], int nsegs, hawk_mod_sym_t* sym) +{ + + hawk_rbt_pair_t* pair; + hawk_mod_data_t* mdp; + hawk_oocs_t ea; + int n; + + HAWK_ASSERT (awk, nsegs == 2); + + pair = hawk_rbt_search (awk->modtab, segs[0].ptr, segs[0].len); + if (pair) + { + mdp = (hawk_mod_data_t*)HAWK_RBT_VPTR(pair); + } + else + { + hawk_mod_data_t md; + hawk_mod_load_t load = HAWK_NULL; + hawk_mod_spec_t spec; + hawk_oow_t buflen; + /*hawk_ooch_t buf[64 + 12] = HAWK_T("_hawk_mod_");*/ + + /* maximum module name length is 64. 15 is decomposed to 13 + 1 + 1. + * 10 for _hawk_mod_ + * 1 for _ at the end when hawk_mod_xxx_ is attempted. + * 1 for the terminating '\0' + */ + hawk_ooch_t buf[64 + 12]; + + /* the terminating null isn't needed in buf here */ + HAWK_MEMCPY (buf, HAWK_T("_hawk_mod_"), HAWK_SIZEOF(hawk_ooch_t) * 10); + if (segs[0].len > HAWK_COUNTOF(buf) - 15) + { + /* module name too long */ + ea.ptr = segs[0].ptr; + ea.len = segs[0].len; + hawk_seterror (awk, HAWK_ESEGTL, &ea, HAWK_NULL); + return HAWK_NULL; + } + +#if defined(HAWK_ENABLE_STATIC_MODULE) + /* attempt to find a statically linked module */ + + /* TODO: binary search ... */ + for (n = 0; n < HAWK_COUNTOF(static_modtab); n++) + { + if (hawk_comp_oocstr(static_modtab[n].modname, segs[0].ptr, 0) == 0) + { + load = static_modtab[n].modload; + break; + } + } + + /*if (n >= HAWK_COUNTOF(static_modtab)) + { + + ea.ptr = segs[0].ptr; + ea.len = segs[0].len; + hawk_seterror (awk, HAWK_ENOENT, &ea, HAWK_NULL); + return HAWK_NULL; + }*/ + + if (load) + { + /* found the module in the staic module table */ + + HAWK_MEMSET (&md, 0, HAWK_SIZEOF(md)); + /* Note md.handle is HAWK_NULL for a static module */ + + /* i copy-insert 'md' into the table before calling 'load'. + * to pass the same address to load(), query(), etc */ + pair = hawk_rbt_insert(awk->modtab, segs[0].ptr, segs[0].len, &md, HAWK_SIZEOF(md)); + if (pair == HAWK_NULL) + { + hawk_seterrnum (awk, HAWK_ENOMEM, HAWK_NULL); + return HAWK_NULL; + } + + mdp = (hawk_mod_data_t*)HAWK_RBT_VPTR(pair); + if (load (&mdp->mod, awk) <= -1) + { + hawk_rbt_delete (awk->modtab, segs[0].ptr, segs[0].len); + return HAWK_NULL; + } + + goto done; + } +#endif + hawk_seterrnum (awk, HAWK_ENOERR, HAWK_NULL); + + /* attempt to find an external module */ + HAWK_MEMSET (&spec, 0, HAWK_SIZEOF(spec)); + if (awk->opt.mod[0].len > 0) + spec.prefix = awk->opt.mod[0].ptr; + else spec.prefix = HAWK_T(HAWK_DEFAULT_MODPREFIX); + + if (awk->opt.mod[1].len > 0) + spec.postfix = awk->opt.mod[1].ptr; + else spec.postfix = HAWK_T(HAWK_DEFAULT_MODPOSTFIX); + + HAWK_MEMSET (&md, 0, HAWK_SIZEOF(md)); + if (awk->prm.modopen && awk->prm.modgetsym && awk->prm.modclose) + { + spec.name = segs[0].ptr; + md.handle = awk->prm.modopen (awk, &spec); + } + else md.handle = HAWK_NULL; + + if (md.handle == HAWK_NULL) + { + if (hawk_geterrnum(awk) == HAWK_ENOERR) + { + hawk_seterrfmt (awk, HAWK_ENOENT, HAWK_NULL, HAWK_T("module '%.*js' not found"), (int)segs[0].len, segs[0].ptr); + } + else + { + const hawk_ooch_t* olderrmsg = hawk_backuperrmsg(awk); + hawk_seterrfmt (awk, HAWK_ENOENT, HAWK_NULL, HAWK_T("module '%.*js' not found - %js"), (int)segs[0].len, segs[0].ptr, olderrmsg); + } + return HAWK_NULL; + } + + buflen = hawk_copy_oocstr_unlimited(&buf[13], segs[0].ptr); + /* attempt hawk_mod_xxx */ + load = awk->prm.modgetsym(awk, md.handle, &buf[1]); + if (!load) + { + /* attempt _hawk_mod_xxx */ + load = awk->prm.modgetsym(awk, md.handle, &buf[0]); + if (!load) + { + hawk_seterrnum (awk, HAWK_ENOERR, HAWK_NULL); + + /* attempt hawk_mod_xxx_ */ + buf[13 + buflen] = HAWK_T('_'); + buf[13 + buflen + 1] = HAWK_T('\0'); + load = awk->prm.modgetsym(awk, md.handle, &buf[1]); + if (!load) + { + if (hawk_geterrnum(awk) == HAWK_ENOERR) + { + hawk_seterrfmt (awk, HAWK_ENOENT, HAWK_NULL, HAWK_T("module '%.*js' not found"), (int)(12 + buflen)); + } + else + { + const hawk_ooch_t* olderrmsg = hawk_backuperrmsg(awk); + hawk_seterrfmt (awk, HAWK_ENOENT, HAWK_NULL, HAWK_T("module '%.*js' not found - %js"), (int)(12 + buflen), &buf[1], olderrmsg); + } + awk->prm.modclose (awk, md.handle); + return HAWK_NULL; + } + } + } + + /* i copy-insert 'md' into the table before calling 'load'. + * to pass the same address to load(), query(), etc */ + pair = hawk_rbt_insert (awk->modtab, segs[0].ptr, segs[0].len, &md, HAWK_SIZEOF(md)); + if (pair == HAWK_NULL) + { + hawk_seterrnum (awk, HAWK_ENOMEM, HAWK_NULL); + awk->prm.modclose (awk, md.handle); + return HAWK_NULL; + } + + mdp = (hawk_mod_data_t*)HAWK_RBT_VPTR(pair); + if (load(&mdp->mod, awk) <= -1) + { + hawk_rbt_delete (awk->modtab, segs[0].ptr, segs[0].len); + awk->prm.modclose (awk, mdp->handle); + return HAWK_NULL; + } + } + +done: + hawk_seterrnum (awk, HAWK_ENOERR, HAWK_NULL); + n = mdp->mod.query(&mdp->mod, awk, segs[1].ptr, sym); + if (n <= -1) + { + if (hawk_geterrnum(awk) == HAWK_ENOERR) + { + hawk_seterrfmt (awk, HAWK_ENOENT, HAWK_NULL, HAWK_T("unable to find '%.*js' in module '%.*js'"), (int)segs[1].len, segs[1].ptr, (int)segs[0].len, segs[0].ptr); + } + else + { + const hawk_ooch_t* olderrmsg = hawk_backuperrmsg(awk); + hawk_seterrfmt (awk, HAWK_ENOENT, HAWK_NULL, HAWK_T("unable to find '%.*js' in module '%.*js' - %js"), (int)segs[1].len, segs[1].ptr, (int)segs[0].len, segs[0].ptr, olderrmsg); + } + return HAWK_NULL; + } + return &mdp->mod; +} diff --git a/hawk/lib/pio.c b/hawk/lib/pio.c new file mode 100644 index 00000000..8838d781 --- /dev/null +++ b/hawk/lib/pio.c @@ -0,0 +1,2493 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include "hawk-prv.h" + +#if defined(_WIN32) +# include +# include +#elif defined(__OS2__) +# define INCL_DOSQUEUES +# define INCL_DOSPROCESS +# define INCL_DOSERRORS +# include +#elif defined(__DOS__) +# include +# include +#else +# include "syscall.h" +# if defined(HAVE_SPAWN_H) +# include +# endif +# if defined(HAVE_CRT_EXTERNS_H) +# include /* MacOSX/darwin. _NSGetEnviron() */ +# endif +#endif + +static hawk_ooi_t pio_input ( + hawk_tio_t* tio, hawk_tio_cmd_t cmd, void* buf, hawk_oow_t size); +static hawk_ooi_t pio_output ( + hawk_tio_t* tio, hawk_tio_cmd_t cmd, void* buf, hawk_oow_t size); + +#include "syserr.h" +IMPLEMENT_SYSERR_TO_ERRNUM (pio, PIO) + +static hawk_pio_errnum_t tio_errnum_to_pio_errnum (hawk_tio_t* tio) +{ + /* i only translate error codes that's relevant + * to pio. all other errors becom HAWK_PIO_EOTHER */ + switch (tio->errnum) + { + case HAWK_TIO_ENOMEM: + return HAWK_PIO_ENOMEM; + case HAWK_TIO_EINVAL: + return HAWK_PIO_EINVAL; + case HAWK_TIO_ENOENT: + return HAWK_PIO_ENOENT; + case HAWK_TIO_EACCES: + return HAWK_PIO_EACCES; + case HAWK_TIO_EILSEQ: + return HAWK_PIO_EILSEQ; + case HAWK_TIO_EICSEQ: + return HAWK_PIO_EICSEQ; + case HAWK_TIO_EILCHR: + return HAWK_PIO_EILCHR; + default: + return HAWK_PIO_EOTHER; + } +} + +static int get_highest_fd (hawk_pio_t* pio) +{ +#if defined(HAVE_GETRLIMIT) + struct rlimit rlim; +#endif + int fd = -1; + HAWK_DIR* d; + +#if defined(F_MAXFD) + fd = HAWK_FCNTL(0, F_MAXFD, 0); + if (fd >= 0) return fd; +#endif + + /* will getting the highest file descriptor be faster than + * attempting to close any files descriptors less than the + * system limit? */ + + d = HAWK_OPENDIR(HAWK_BT("/proc/self/fd")); + if (!d) + { + hawk_bch_t buf[64]; + hawk_fmttobcstr (pio->hawk, buf, HAWK_COUNTOF(buf), HAWK_BT("/proc/%d/fd"), HAWK_GETPID()); + d = HAWK_OPENDIR (buf); + if (!d) d = HAWK_OPENDIR(HAWK_BT("/dev/fd")); /* Darwin, FreeBSD */ + } + + if (d) + { + int maxfd = -1; + hawk_dirent_t* de; + while ((de = HAWK_READDIR(d))) + { + hawk_int_t l; + const hawk_bch_t* endptr; + + if (de->d_name[0] == HAWK_BT('.')) continue; + + l = hawk_bcharstoint(pio->hawk, de->d_name, hawk_count_bcstr(de->d_name), 10, &endptr); + if (*endptr == HAWK_BT('\0')) + { + fd = (int)l; + if ((hawk_intptr_t)fd == l && fd != HAWK_DIRFD(d)) + { + if (fd > maxfd) maxfd = fd; + } + } + } + + HAWK_CLOSEDIR (d); + return maxfd; + } + +/* TODO: should i also use getdtablesize() if available? */ + +#if defined(HAVE_GETRLIMIT) + if (HAWK_GETRLIMIT(RLIMIT_NOFILE, &rlim) <= -1 || + rlim.rlim_max == RLIM_INFINITY) + { + #if defined(HAVE_SYSCONF) + fd = sysconf(_SC_OPEN_MAX); + #endif + } + else fd = rlim.rlim_max; +#elif defined(HAVE_SYSCONF) + fd = sysconf(_SC_OPEN_MAX); +#endif + if (fd <= -1) fd = 1024; /* fallback */ + + /* F_MAXFD is the highest fd. but RLIMIT_NOFILE and + * _SC_OPEN_MAX returnes the maximum number of file + * descriptors. make adjustment */ + if (fd > 0) fd--; + + return fd; +} + +static int close_open_fds_using_proc (hawk_pio_t* pio, int* excepts, hawk_oow_t count) +{ + HAWK_DIR* d; + + /* will getting the highest file descriptor be faster than + * attempting to close any files descriptors less than the + * system limit? */ + + d = HAWK_OPENDIR(HAWK_BT("/proc/self/fd")); + if (!d) + { + hawk_bch_t buf[64]; + hawk_fmttobcstr (pio->hawk, buf, HAWK_COUNTOF(buf), HAWK_BT("/proc/%d/fd"), HAWK_GETPID()); + d = HAWK_OPENDIR(buf); + #if !defined(_SCO_DS) + /* on SCO OpenServer, a range of file descriptors starting from 0 are + * listed under /dev/fd regardless of opening state. And some high + * numbered descriptors are not listed. not reliable */ + + if (!d) d = HAWK_OPENDIR(HAWK_BT("/dev/fd")); /* Darwin, FreeBSD */ + #endif + } + + if (d) + { + hawk_dirent_t* de; + while ((de = HAWK_READDIR(d))) + { + hawk_int_t l; + const hawk_bch_t* endptr; + + if (de->d_name[0] == HAWK_BT('.')) continue; + + /*HAWK_MBSTONUM (l, de->d_name, &endptr, 10);*/ + l = hawk_bcharstoint(pio->hawk, de->d_name, hawk_count_bcstr(de->d_name), 10, &endptr); + if (*endptr == HAWK_BT('\0')) + { + int fd = (int)l; + if ((hawk_intptr_t)fd == l && fd != HAWK_DIRFD(d) && fd > 2) + { + hawk_oow_t i; + + for (i = 0; i < count; i++) + { + if (fd == excepts[i]) goto skip_close; + } + + HAWK_CLOSE (fd); + + skip_close: + ; + } + } + } + + HAWK_CLOSEDIR (d); + return 0; + } + + return -1; +} + +hawk_pio_t* hawk_pio_open (hawk_t* hawk, hawk_oow_t xtnsize, const hawk_ooch_t* cmd, int flags) +{ + hawk_pio_t* pio; + + pio = (hawk_pio_t*)hawk_allocmem(hawk, HAWK_SIZEOF(hawk_pio_t) + xtnsize); + if (pio) + { + if (hawk_pio_init(pio, hawk, cmd, flags) <= -1) + { + hawk_freemem (hawk, pio); + pio = HAWK_NULL; + } + else HAWK_MEMSET (pio + 1, 0, xtnsize); + } + + return pio; +} + +void hawk_pio_close (hawk_pio_t* pio) +{ + hawk_pio_fini (pio); + hawk_freemem (pio->hawk, pio); +} + +#if !defined(_WIN32) && !defined(__OS2__) && !defined(__DOS__) +struct param_t +{ + hawk_bch_t* mcmd; + hawk_bch_t* fixed_argv[4]; + hawk_bch_t** argv; + +#if defined(HAWK_OOCH_IS_BCH) + /* nothing extra */ +#else + hawk_bch_t fixed_mbuf[64]; +#endif +}; +typedef struct param_t param_t; + +static void free_param (hawk_pio_t* pio, param_t* param) +{ + if (param->argv && param->argv != param->fixed_argv) + hawk_freemem (pio->hawk, param->argv); + if (param->mcmd) hawk_freemem (pio->hawk, param->mcmd); +} + +static int make_param (hawk_pio_t* pio, const hawk_ooch_t* cmd, int flags, param_t* param) +{ +#if defined(HAWK_OOCH_IS_BCH) + hawk_bch_t* mcmd = HAWK_NULL; +#else + hawk_bch_t* mcmd = HAWK_NULL; + hawk_ooch_t* wcmd = HAWK_NULL; +#endif + int fcnt = 0; + + HAWK_MEMSET (param, 0, HAWK_SIZEOF(*param)); + +#if defined(HAWK_OOCH_IS_BCH) + if (flags & HAWK_PIO_SHELL) mcmd = (hawk_ooch_t*)cmd; + else + { + mcmd = hawk_strdup (cmd, pio->mmgr); + if (mcmd == HAWK_NULL) + { + pio->errnum = HAWK_PIO_ENOMEM; + goto oops; + } + + fcnt = hawk_split_oocstr(mcmd, HAWK_T(""), HAWK_T('\"'), HAWK_T('\"'), HAWK_T('\\')); + if (fcnt <= 0) + { + /* no field or an error */ + pio->errnum = HAWK_PIO_EINVAL; + goto oops; + } + } +#else + if (flags & HAWK_PIO_MBSCMD) + { + /* the cmd is flagged to be of hawk_bch_t + * while the default character type is hawk_uch_t. */ + + if (flags & HAWK_PIO_SHELL) mcmd = (hawk_bch_t*)cmd; + else + { + mcmd = hawk_dupbcstr(pio->hawk, (const hawk_bch_t*)cmd, HAWK_NULL); + if (mcmd == HAWK_NULL) + { + pio->errnum = HAWK_PIO_ENOMEM; + goto oops; + } + + fcnt = hawk_split_bcstr(mcmd, HAWK_BT(""), HAWK_BT('\"'), HAWK_BT('\"'), HAWK_BT('\\')); + if (fcnt <= 0) + { + /* no field or an error */ + pio->errnum = HAWK_PIO_EINVAL; + goto oops; + } + } + } + else + { + hawk_oow_t n, mn, wl; + + if (flags & HAWK_PIO_SHELL) + { + if (hawk_conv_ucstr_to_bcstr_with_cmgr(cmd, &wl, HAWK_NULL, &mn, hawk_getcmgr(pio->hawk)) <= -1) + { + /* cmd has illegal sequence */ + pio->errnum = HAWK_PIO_EINVAL; + goto oops; + } + } + else + { + wcmd = hawk_dupoocstr(pio->hawk, cmd, HAWK_NULL); + if (wcmd == HAWK_NULL) + { + pio->errnum = HAWK_PIO_ENOMEM; + goto oops; + } + + fcnt = hawk_split_oocstr(wcmd, HAWK_T(""), HAWK_T('\"'), HAWK_T('\"'), HAWK_T('\\')); + if (fcnt <= 0) + { + /* no field or an error */ + pio->errnum = HAWK_PIO_EINVAL; + goto oops; + } + + /* calculate the length of the string after splitting */ + for (wl = 0, n = fcnt; n > 0; ) + { + if (wcmd[wl++] == HAWK_T('\0')) n--; + } + + if (hawk_conv_uchars_to_bchars_with_cmgr(wcmd, &wl, HAWK_NULL, &mn, hawk_getcmgr(pio->hawk)) <= -1) + { + pio->errnum = HAWK_PIO_EINVAL; + goto oops; + } + } + + /* prepare to reserve 1 more slot for the terminating '\0' + * by incrementing mn by 1. */ + mn = mn + 1; + + if (mn <= HAWK_COUNTOF(param->fixed_mbuf)) + { + mcmd = param->fixed_mbuf; + mn = HAWK_COUNTOF(param->fixed_mbuf); + } + else + { + mcmd = hawk_allocmem(pio->hawk, mn * HAWK_SIZEOF(*mcmd)); + if (mcmd == HAWK_NULL) + { + pio->errnum = HAWK_PIO_ENOMEM; + goto oops; + } + } + + if (flags & HAWK_PIO_SHELL) + { + HAWK_ASSERT (pio->hawk, wcmd == HAWK_NULL); + /* hawk_wcstombs() should succeed as + * it was successful above */ + hawk_conv_ucstr_to_bcstr_with_cmgr (cmd, &wl, mcmd, &mn, hawk_getcmgr(pio->hawk)); + /* hawk_wcstombs() null-terminate mcmd */ + } + else + { + HAWK_ASSERT (pio->hawk, wcmd != HAWK_NULL); + /* hawk_wcsntombsn() should succeed as + * it was was successful above */ + hawk_conv_uchars_to_bchars_with_cmgr (wcmd, &wl, mcmd, &mn, hawk_getcmgr(pio->hawk)); + /* hawk_wcsntombsn() doesn't null-terminate mcmd */ + mcmd[mn] = HAWK_BT('\0'); + + hawk_freemem (pio->hawk, wcmd); + wcmd = HAWK_NULL; + } + } +#endif + + if (flags & HAWK_PIO_SHELL) + { + param->argv = param->fixed_argv; + param->argv[0] = HAWK_BT("/bin/sh"); + param->argv[1] = HAWK_BT("-c"); + param->argv[2] = mcmd; + param->argv[3] = HAWK_NULL; + } + else + { + int i; + hawk_bch_t** argv; + hawk_bch_t* mcmdptr; + + if (fcnt < HAWK_COUNTOF(param->fixed_argv)) + { + param->argv = param->fixed_argv; + } + else + { + param->argv = hawk_allocmem(pio->hawk, (fcnt + 1) * HAWK_SIZEOF(argv[0])); + if (param->argv == HAWK_NULL) + { + pio->errnum = HAWK_PIO_ENOMEM; + goto oops; + } + } + + mcmdptr = mcmd; + for (i = 0; i < fcnt; i++) + { + param->argv[i] = mcmdptr; + while (*mcmdptr != HAWK_BT('\0')) mcmdptr++; + mcmdptr++; + } + param->argv[i] = HAWK_NULL; + } + +#if defined(HAWK_OOCH_IS_BCH) + if (mcmd && mcmd != (hawk_bch_t*)cmd) param->mcmd = mcmd; +#else + if (mcmd && mcmd != (hawk_bch_t*)cmd && + mcmd != param->fixed_mbuf) param->mcmd = mcmd; +#endif + return 0; + +oops: +#if defined(HAWK_OOCH_IS_BCH) + if (mcmd && mcmd != cmd) hawk_freemem (pio->hawk, mcmd); +#else + if (mcmd && mcmd != (hawk_bch_t*)cmd && + mcmd != param->fixed_mbuf) hawk_freemem (pio->hawk, mcmd); + if (wcmd) hawk_freemem (pio->hawk, wcmd); +#endif + return -1; +} + +static int assert_executable (hawk_pio_t* pio, const hawk_bch_t* path) +{ + hawk_lstat_t st; + + if (HAWK_ACCESS(path, X_OK) <= -1) + { + pio->errnum = syserr_to_errnum (errno); + return -1; + } + + /*if (HAWK_LSTAT(path, &st) <= -1)*/ + if (HAWK_STAT(path, &st) <= -1) + { + pio->errnum = syserr_to_errnum (errno); + return -1; + } + + if (!S_ISREG(st.st_mode)) + { + pio->errnum = HAWK_PIO_EACCES; + return -1; + } + + return 0; +} + +static HAWK_INLINE int is_fd_valid (int fd) +{ + return HAWK_FCNTL (fd, F_GETFD, 0) != -1 || errno != EBADF; +} + +static HAWK_INLINE int is_fd_valid_and_nocloexec (int fd) +{ + int flags = HAWK_FCNTL (fd, F_GETFD, 0); + if (flags == -1) + { + if (errno == EBADF) return 0; /* invalid. return false */ + return -1; /* unknown. true but negative to indicate unknown */ + } + return !(flags & FD_CLOEXEC)? 1: 0; +} + +static hawk_pio_pid_t standard_fork_and_exec (hawk_pio_t* pio, int pipes[], param_t* param) +{ + hawk_pio_pid_t pid; + +#if defined(HAVE_CRT_EXTERNS_H) +# define environ (*(_NSGetEnviron())) +#else + extern char** environ; +#endif + + pid = HAWK_FORK(); + if (pid <= -1) + { + pio->errnum = HAWK_PIO_EINVAL; + return -1; + } + + if (pid == 0) + { + /* child */ + hawk_pio_hnd_t devnull = -1; + + if (!(pio->flags & HAWK_PIO_NOCLOEXEC)) + { + if (close_open_fds_using_proc(pio, pipes, 6) <= -1) + { + int fd = get_highest_fd(pio); + + /* close all other unknown open handles except + * stdin/out/err and the pipes. */ + while (fd > 2) + { + if (fd != pipes[0] && fd != pipes[1] && + fd != pipes[2] && fd != pipes[3] && + fd != pipes[4] && fd != pipes[5]) + { + HAWK_CLOSE (fd); + } + fd--; + } + } + } + + if (pio->flags & HAWK_PIO_WRITEIN) + { + /* child should read */ + HAWK_CLOSE (pipes[1]); + pipes[1] = HAWK_PIO_HND_NIL; + if (HAWK_DUP2 (pipes[0], 0) <= -1) goto child_oops; + HAWK_CLOSE (pipes[0]); + pipes[0] = HAWK_PIO_HND_NIL; + } + + if (pio->flags & HAWK_PIO_READOUT) + { + /* child should write */ + HAWK_CLOSE (pipes[2]); + pipes[2] = HAWK_PIO_HND_NIL; + if (HAWK_DUP2 (pipes[3], 1) <= -1) goto child_oops; + + if (pio->flags & HAWK_PIO_ERRTOOUT) + { + if (HAWK_DUP2 (pipes[3], 2) <= -1) goto child_oops; + } + + HAWK_CLOSE (pipes[3]); + pipes[3] = HAWK_PIO_HND_NIL; + } + + if (pio->flags & HAWK_PIO_READERR) + { + /* child should write */ + HAWK_CLOSE (pipes[4]); + pipes[4] = HAWK_PIO_HND_NIL; + if (HAWK_DUP2 (pipes[5], 2) <= -1) goto child_oops; + + if (pio->flags & HAWK_PIO_OUTTOERR) + { + if (HAWK_DUP2 (pipes[5], 1) <= -1) goto child_oops; + } + + HAWK_CLOSE (pipes[5]); + pipes[5] = HAWK_PIO_HND_NIL; + } + + if ((pio->flags & HAWK_PIO_INTONUL) || + (pio->flags & HAWK_PIO_OUTTONUL) || + (pio->flags & HAWK_PIO_ERRTONUL)) + { + #if defined(O_LARGEFILE) + devnull = HAWK_OPEN (HAWK_BT("/dev/null"), O_RDWR|O_LARGEFILE, 0); + #else + devnull = HAWK_OPEN (HAWK_BT("/dev/null"), O_RDWR, 0); + #endif + if (devnull <= -1) goto child_oops; + } + + if ((pio->flags & HAWK_PIO_INTONUL) && + HAWK_DUP2(devnull,0) <= -1) goto child_oops; + if ((pio->flags & HAWK_PIO_OUTTONUL) && + HAWK_DUP2(devnull,1) <= -1) goto child_oops; + if ((pio->flags & HAWK_PIO_ERRTONUL) && + HAWK_DUP2(devnull,2) <= -1) goto child_oops; + + if ((pio->flags & HAWK_PIO_INTONUL) || + (pio->flags & HAWK_PIO_OUTTONUL) || + (pio->flags & HAWK_PIO_ERRTONUL)) + { + HAWK_CLOSE (devnull); + devnull = -1; + } + + if (pio->flags & HAWK_PIO_DROPIN) HAWK_CLOSE(0); + if (pio->flags & HAWK_PIO_DROPOUT) HAWK_CLOSE(1); + if (pio->flags & HAWK_PIO_DROPERR) HAWK_CLOSE(2); + + + if (pio->flags & HAWK_PIO_FNCCMD) + { + /* ----------------------------------------------- + * the function pointer to execute has been given. + * -----------------------------------------------*/ + hawk_pio_fnc_t* fnc = (hawk_pio_fnc_t*)param; + int retx; + + retx = fnc->ptr(fnc->ctx); + if (devnull >= 0) HAWK_CLOSE (devnull); + HAWK_EXIT (retx); + } + else + { + HAWK_EXECVE (param->argv[0], param->argv, environ); + + /* if exec fails, free 'param' parameter which is an inherited pointer */ + free_param (pio, param); + } + + child_oops: + if (devnull >= 0) HAWK_CLOSE (devnull); + HAWK_EXIT (128); + } + + return pid; +} + +#endif + +static int set_pipe_nonblock (hawk_pio_t* pio, hawk_pio_hnd_t fd, int enabled) +{ +#if defined(O_NONBLOCK) + + int flag = HAWK_FCNTL (fd, F_GETFL, 0); + if (flag >= 0) flag = HAWK_FCNTL (fd, F_SETFL, (enabled? (flag | O_NONBLOCK): (flag & ~O_NONBLOCK))); + if (flag <= -1) pio->errnum = syserr_to_errnum (errno); + return flag; + +#else + pio->errnum = HAWK_PIO_ENOIMPL; + return -1; +#endif +} + + +int hawk_pio_init (hawk_pio_t* pio, hawk_t* hawk, const hawk_ooch_t* cmd, int flags) +{ + hawk_pio_hnd_t handle[6] /*= + { + HAWK_PIO_HND_NIL, + HAWK_PIO_HND_NIL, + HAWK_PIO_HND_NIL, + HAWK_PIO_HND_NIL, + HAWK_PIO_HND_NIL, + HAWK_PIO_HND_NIL + }*/; + + hawk_tio_t* tio[3] /*= + { + HAWK_NULL, + HAWK_NULL, + HAWK_NULL + }*/; + + int i, minidx = -1, maxidx = -1; + +#if defined(_WIN32) + SECURITY_ATTRIBUTES secattr; + PROCESS_INFORMATION procinfo; + STARTUPINFO startup; + HANDLE windevnul = INVALID_HANDLE_VALUE; + BOOL apiret; + hawk_ooch_t* dupcmd; + int create_retried; + +#elif defined(__OS2__) + APIRET rc; + ULONG pipe_size = 4096; + UCHAR load_error[CCHMAXPATH]; + RESULTCODES child_rc; + HFILE old_in = HAWK_PIO_HND_NIL; + HFILE old_out = HAWK_PIO_HND_NIL; + HFILE old_err = HAWK_PIO_HND_NIL; + HFILE std_in = 0, std_out = 1, std_err = 2; + hawk_bch_t* cmd_line = HAWK_NULL; + hawk_bch_t* cmd_file; + HFILE os2devnul = (HFILE)-1; + +#elif defined(__DOS__) + + /* DOS not multi-processed. can't support pio */ + +#elif defined(HAVE_POSIX_SPAWN) && !(defined(HAWK_SYSCALL0) && defined(SYS_vfork)) + posix_spawn_file_actions_t fa; + int fa_inited = 0; + int pserr; + posix_spawnattr_t psattr; + hawk_pio_pid_t pid; + param_t param; + #if defined(HAVE_CRT_EXTERNS_H) + #define environ (*(_NSGetEnviron())) + #else + extern char** environ; + #endif +#elif defined(HAWK_SYSCALL0) && defined(SYS_vfork) + hawk_pio_pid_t pid; + param_t param; + #if defined(HAVE_CRT_EXTERNS_H) + #define environ (*(_NSGetEnviron())) + #else + extern char** environ; + #endif + int highest_fd; + int dummy; +#else + hawk_pio_pid_t pid; + param_t param; + #if defined(HAVE_CRT_EXTERNS_H) + #define environ (*(_NSGetEnviron())) + #else + extern char** environ; + #endif +#endif + + HAWK_MEMSET (pio, 0, HAWK_SIZEOF(*pio)); + pio->hawk = hawk; + pio->flags = flags; + + handle[0] = HAWK_PIO_HND_NIL; + handle[1] = HAWK_PIO_HND_NIL; + handle[2] = HAWK_PIO_HND_NIL; + handle[3] = HAWK_PIO_HND_NIL; + handle[4] = HAWK_PIO_HND_NIL; + handle[5] = HAWK_PIO_HND_NIL; + + tio[0] = HAWK_NULL; + tio[1] = HAWK_NULL; + tio[2] = HAWK_NULL; + +#if defined(_WIN32) + /* http://msdn.microsoft.com/en-us/library/ms682499(VS.85).aspx */ + + secattr.nLength = HAWK_SIZEOF(secattr); + secattr.bInheritHandle = TRUE; + secattr.lpSecurityDescriptor = HAWK_NULL; + + if (flags & HAWK_PIO_WRITEIN) + { + /* child reads, parent writes */ + if (CreatePipe (&handle[0], &handle[1], &secattr, 0) == FALSE) + { + pio->errnum = syserr_to_errnum (GetLastError()); + goto oops; + } + + /* don't inherit write handle */ + if (SetHandleInformation (handle[1], HANDLE_FLAG_INHERIT, 0) == FALSE) + { + DWORD e = GetLastError(); + if (e != ERROR_CALL_NOT_IMPLEMENTED) + { + /* SetHandleInformation() is not implemented on win9x. + * so let's care only if it is implemented */ + pio->errnum = syserr_to_errnum (e); + goto oops; + } + } + + minidx = 0; maxidx = 1; + } + + if (flags & HAWK_PIO_READOUT) + { + /* child writes, parent reads */ + if (CreatePipe (&handle[2], &handle[3], &secattr, 0) == FALSE) + { + pio->errnum = syserr_to_errnum (GetLastError()); + goto oops; + } + + /* don't inherit read handle */ + if (SetHandleInformation (handle[2], HANDLE_FLAG_INHERIT, 0) == FALSE) + { + DWORD e = GetLastError(); + if (e != ERROR_CALL_NOT_IMPLEMENTED) + { + /* SetHandleInformation() is not implemented on win9x. + * so let's care only if it is implemented */ + pio->errnum = syserr_to_errnum (e); + goto oops; + } + } + + if (minidx == -1) minidx = 2; + maxidx = 3; + } + + if (flags & HAWK_PIO_READERR) + { + /* child writes, parent reads */ + if (CreatePipe (&handle[4], &handle[5], &secattr, 0) == FALSE) + { + pio->errnum = syserr_to_errnum (GetLastError()); + goto oops; + } + + /* don't inherit read handle */ + if (SetHandleInformation (handle[4], HANDLE_FLAG_INHERIT, 0) == FALSE) + { + DWORD e = GetLastError(); + if (e != ERROR_CALL_NOT_IMPLEMENTED) + { + /* SetHandleInformation() is not implemented on win9x. + * so let's care only if it is implemented */ + pio->errnum = syserr_to_errnum (e); + goto oops; + } + } + + if (minidx == -1) minidx = 4; + maxidx = 5; + } + + if (maxidx == -1) + { + pio->errnum = HAWK_PIO_EINVAL; + goto oops; + } + + if ((flags & HAWK_PIO_INTONUL) || + (flags & HAWK_PIO_OUTTONUL) || + (flags & HAWK_PIO_ERRTONUL)) + { + windevnul = CreateFile( + HAWK_T("NUL"), GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE, + &secattr, OPEN_EXISTING, 0, NULL + ); + if (windevnul == INVALID_HANDLE_VALUE) + { + pio->errnum = syserr_to_errnum (GetLastError()); + goto oops; + } + } + + HAWK_MEMSET (&procinfo, 0, HAWK_SIZEOF(procinfo)); + HAWK_MEMSET (&startup, 0, HAWK_SIZEOF(startup)); + + startup.cb = HAWK_SIZEOF(startup); + + /* + startup.hStdInput = INVALID_HANDLE_VALUE; + startup.hStdOutput = INVALID_HANDLE_VALUE; + startup.hStdOutput = INVALID_HANDLE_VALUE; + */ + + startup.hStdInput = GetStdHandle (STD_INPUT_HANDLE); + startup.hStdOutput = GetStdHandle (STD_OUTPUT_HANDLE); + startup.hStdOutput = GetStdHandle (STD_ERROR_HANDLE); + if (startup.hStdInput == INVALID_HANDLE_VALUE || + startup.hStdOutput == INVALID_HANDLE_VALUE || + startup.hStdError == INVALID_HANDLE_VALUE) + { + pio->errnum = syserr_to_errnum (GetLastError()); + goto oops; + } + + if (flags & HAWK_PIO_WRITEIN) + { + startup.hStdInput = handle[0]; + } + + if (flags & HAWK_PIO_READOUT) + { + startup.hStdOutput = handle[3]; + if (flags & HAWK_PIO_ERRTOOUT) startup.hStdError = handle[3]; + } + + if (flags & HAWK_PIO_READERR) + { + startup.hStdError = handle[5]; + if (flags & HAWK_PIO_OUTTOERR) startup.hStdOutput = handle[5]; + } + + if (flags & HAWK_PIO_INTONUL) startup.hStdInput = windevnul; + if (flags & HAWK_PIO_OUTTONUL) startup.hStdOutput = windevnul; + if (flags & HAWK_PIO_ERRTONUL) startup.hStdError = windevnul; + + if (flags & HAWK_PIO_DROPIN) startup.hStdInput = INVALID_HANDLE_VALUE; + if (flags & HAWK_PIO_DROPOUT) startup.hStdOutput = INVALID_HANDLE_VALUE; + if (flags & HAWK_PIO_DROPERR) startup.hStdError = INVALID_HANDLE_VALUE; + + startup.dwFlags |= STARTF_USESTDHANDLES; + + /* there is nothing to do for HAWK_PIO_SHELL as CreateProcess + * takes the entire command line */ + + create_retried = 0; + +create_process: + if (flags & HAWK_PIO_SHELL) + { + static const hawk_ooch_t* cmdname[] = + { + HAWK_T("cmd.exe /c "), + HAWK_T("command.com /c ") + }; + static const hawk_bch_t* mcmdname[] = + { + HAWK_BT("cmd.exe /c "), + HAWK_BT("command.com /c ") + }; + + #if defined(HAWK_OOCH_IS_UCH) + if (flags & HAWK_PIO_MBSCMD) + { + const hawk_bch_t* x[3]; + x[0] = mcmdname[create_retried]; + x[1] = (const hawk_bch_t*)cmd; + x[2] = HAWK_NULL; + dupcmd = hawk_mbsatowcsdup(x, HAWK_NULL, mmgr); + } + else + { + #endif + dupcmd = hawk_strdup2(cmdname[create_retried], cmd, mmgr); + #if defined(HAWK_OOCH_IS_UCH) + } + #endif + } + else + { + #if defined(HAWK_OOCH_IS_UCH) + if (flags & HAWK_PIO_MBSCMD) + { + dupcmd = hawk_mbstowcsdup((const hawk_bch_t*)cmd, HAWK_NULL, mmgr); + } + else + { + #endif + /* CreateProcess requires command buffer to be read-write. */ + dupcmd = hawk_strdup(cmd, mmgr); + #if defined(HAWK_OOCH_IS_UCH) + } + #endif + } + + if (dupcmd == HAWK_NULL) + { + pio->errnum = HAWK_PIO_ENOMEM; + goto oops; + } + + apiret = CreateProcess ( + HAWK_NULL, /* LPCTSTR lpApplicationName */ + dupcmd, /* LPTSTR lpCommandLine */ + HAWK_NULL, /* LPSECURITY_ATTRIBUTES lpProcessAttributes */ + HAWK_NULL, /* LPSECURITY_ATTRIBUTES lpThreadAttributes */ + TRUE, /* BOOL bInheritHandles */ + #if defined(HAWK_OOCH_IS_BCH) + 0, /* DWORD dwCreationFlags */ + #else + CREATE_UNICODE_ENVIRONMENT, /* DWORD dwCreationFlags */ + #endif + HAWK_NULL, /* LPVOID lpEnvironment */ + HAWK_NULL, /* LPCTSTR lpCurrentDirectory */ + &startup, /* LPSTARTUPINFO lpStartupInfo */ + &procinfo /* LPPROCESS_INFORMATION lpProcessInformation */ + ); + + hawk_freemem (hawk, dupcmd); + if (apiret == FALSE) + { + DWORD e = GetLastError(); + if (create_retried == 0 && (flags & HAWK_PIO_SHELL) && + e == ERROR_FILE_NOT_FOUND) + { + /* if it failed to exeucte cmd.exe, + * attempt to execute command.com. + * this is provision for old windows platforms */ + create_retried = 1; + goto create_process; + } + + pio->errnum = syserr_to_errnum (e); + goto oops; + } + + if (windevnul != INVALID_HANDLE_VALUE) + { + CloseHandle (windevnul); + windevnul = INVALID_HANDLE_VALUE; + } + + if (flags & HAWK_PIO_WRITEIN) + { + CloseHandle (handle[0]); + handle[0] = HAWK_PIO_HND_NIL; + } + if (flags & HAWK_PIO_READOUT) + { + CloseHandle (handle[3]); + handle[3] = HAWK_PIO_HND_NIL; + } + if (flags & HAWK_PIO_READERR) + { + CloseHandle (handle[5]); + handle[5] = HAWK_PIO_HND_NIL; + } + + CloseHandle (procinfo.hThread); + pio->child = procinfo.hProcess; + +#elif defined(__OS2__) + + #define DOS_DUP_HANDLE(x,y) HAWK_BLOCK ( \ + rc = DosDupHandle(x,y); \ + if (rc != NO_ERROR) \ + { \ + pio->errnum = syserr_to_errnum (rc); \ + goto oops; \ + } \ + ) + + if (flags & HAWK_PIO_WRITEIN) + { + /* child reads, parent writes */ + rc = DosCreatePipe (&handle[0], &handle[1], pipe_size); + if (rc != NO_ERROR) + { + pio->errnum = syserr_to_errnum (rc); + goto oops; + } + + /* the parent writes to handle[1] and the child reads from + * handle[0] inherited. set the flag not to inherit handle[1]. */ + rc = DosSetFHState (handle[1], OPEN_FLAGS_NOINHERIT); + if (rc != NO_ERROR) + { + pio->errnum = syserr_to_errnum (rc); + goto oops; + } + + /* Need to do somthing like this to set the flag instead? + ULONG state; + DosQueryFHState (handle[1], &state); + DosSetFHState (handle[1], state | OPEN_FLAGS_NOINHERIT); */ + + minidx = 0; maxidx = 1; + } + + if (flags & HAWK_PIO_READOUT) + { + /* child writes, parent reads */ + rc = DosCreatePipe (&handle[2], &handle[3], pipe_size); + if (rc != NO_ERROR) + { + pio->errnum = syserr_to_errnum (rc); + goto oops; + } + + /* the parent reads from handle[2] and the child writes to + * handle[3] inherited. set the flag not to inherit handle[2] */ + rc = DosSetFHState (handle[2], OPEN_FLAGS_NOINHERIT); + if (rc != NO_ERROR) + { + pio->errnum = syserr_to_errnum (rc); + goto oops; + } + + if (minidx == -1) minidx = 2; + maxidx = 3; + } + + if (flags & HAWK_PIO_READERR) + { + /* child writes, parent reads */ + rc = DosCreatePipe (&handle[4], &handle[5], pipe_size); + if (rc != NO_ERROR) + { + pio->errnum = syserr_to_errnum (rc); + goto oops; + } + + /* the parent reads from handle[4] and the child writes to + * handle[5] inherited. set the flag not to inherit handle[4] */ + rc = DosSetFHState (handle[4], OPEN_FLAGS_NOINHERIT); + if (rc != NO_ERROR) + { + pio->errnum = syserr_to_errnum (rc); + goto oops; + } + + if (minidx == -1) minidx = 4; + maxidx = 5; + } + + if (maxidx == -1) + { + pio->errnum = HAWK_PIO_EINVAL; + goto oops; + } + + if ((flags & HAWK_PIO_INTONUL) || + (flags & HAWK_PIO_OUTTONUL) || + (flags & HAWK_PIO_ERRTONUL)) + { + ULONG action_taken; + /* + LONGLONG zero; + + zero.ulLo = 0; + zero.ulHi = 0; + */ + + /* TODO: selective between DosOpenL and DosOpen */ + rc = DosOpen /*DosOpenL*/ ( + HAWK_BT("NUL"), + &os2devnul, + &action_taken, + 0, /*zero,*/ + FILE_NORMAL, + OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW, + OPEN_FLAGS_NOINHERIT | OPEN_SHARE_DENYNONE, + 0L + ); + if (rc != NO_ERROR) + { + pio->errnum = syserr_to_errnum (rc); + goto oops; + } + } + + /* duplicate the current stdin/out/err to old_in/out/err as a new handle */ + + rc = DosDupHandle (std_in, &old_in); + if (rc != NO_ERROR) + { + pio->errnum = syserr_to_errnum (rc); + goto oops; + } + rc = DosDupHandle (std_out, &old_out); + if (rc != NO_ERROR) + { + pio->errnum = syserr_to_errnum (rc); + DosClose (old_in); old_in = HAWK_PIO_HND_NIL; + goto oops; + } + rc = DosDupHandle (std_err, &old_err); + if (rc != NO_ERROR) + { + pio->errnum = syserr_to_errnum (rc); + DosClose (old_out); old_out = HAWK_PIO_HND_NIL; + DosClose (old_in); old_in = HAWK_PIO_HND_NIL; + goto oops; + } + + /* we must not let our own stdin/out/err duplicated + * into old_in/out/err be inherited */ + DosSetFHState (old_in, OPEN_FLAGS_NOINHERIT); + DosSetFHState (old_out, OPEN_FLAGS_NOINHERIT); + DosSetFHState (old_err, OPEN_FLAGS_NOINHERIT); + + if (flags & HAWK_PIO_WRITEIN) + { + /* the child reads from handle[0] inherited and expects it to + * be stdin(0). so we duplicate handle[0] to stdin */ + DOS_DUP_HANDLE (handle[0], &std_in); + + /* the parent writes to handle[1] but does not read from handle[0]. + * so we close it */ + DosClose (handle[0]); handle[0] = HAWK_PIO_HND_NIL; + } + + if (flags & HAWK_PIO_READOUT) + { + /* the child writes to handle[3] inherited and expects it to + * be stdout(1). so we duplicate handle[3] to stdout. */ + DOS_DUP_HANDLE (handle[3], &std_out); + if (flags & HAWK_PIO_ERRTOOUT) DOS_DUP_HANDLE (handle[3], &std_err); + /* the parent reads from handle[2] but does not write to handle[3]. + * so we close it */ + DosClose (handle[3]); handle[3] = HAWK_PIO_HND_NIL; + } + + if (flags & HAWK_PIO_READERR) + { + DOS_DUP_HANDLE (handle[5], &std_err); + if (flags & HAWK_PIO_OUTTOERR) DOS_DUP_HANDLE (handle[5], &std_out); + DosClose (handle[5]); handle[5] = HAWK_PIO_HND_NIL; + } + + if (flags & HAWK_PIO_INTONUL) DOS_DUP_HANDLE (os2devnul, &std_in); + if (flags & HAWK_PIO_OUTTONUL) DOS_DUP_HANDLE (os2devnul, &std_out); + if (flags & HAWK_PIO_ERRTONUL) DOS_DUP_HANDLE (os2devnul, &std_err); + + if (os2devnul != HAWK_PIO_HND_NIL) + { + /* close NUL early as we've duplicated it already */ + DosClose (os2devnul); + os2devnul = HAWK_PIO_HND_NIL; + } + + /* at this moment, stdin/out/err are already redirected to pipes + * if proper flags have been set. we close them selectively if + * dropping is requested */ + if (flags & HAWK_PIO_DROPIN) DosClose (std_in); + if (flags & HAWK_PIO_DROPOUT) DosClose (std_out); + if (flags & HAWK_PIO_DROPERR) DosClose (std_err); + + if (flags & HAWK_PIO_SHELL) + { + hawk_oow_t n, mn; + + #if defined(HAWK_OOCH_IS_BCH) + mn = hawk_strlen(cmd); + #else + if (flags & HAWK_PIO_MBSCMD) + { + mn = hawk_mbslen((const hawk_bch_t*)cmd); + } + else + { + if (hawk_wcstombs (cmd, &n, HAWK_NULL, &mn) <= -1) + { + pio->errnum = HAWK_PIO_EINVAL; + goto oops; /* illegal sequence found */ + } + } + #endif + cmd_line = hawk_allocmem(hawk, ((11+mn+1+1) * HAWK_SIZEOF(*cmd_line))); + if (cmd_line == HAWK_NULL) + { + pio->errnum = HAWK_PIO_ENOMEM; + goto oops; + } + + hawk_mbscpy (cmd_line, HAWK_BT("cmd.exe")); /* cmd.exe\0/c */ + hawk_mbscpy (&cmd_line[8], HAWK_BT("/c ")); + #if defined(HAWK_OOCH_IS_BCH) + hawk_mbscpy (&cmd_line[11], cmd); + #else + if (flags & HAWK_PIO_MBSCMD) + { + hawk_mbscpy (&cmd_line[11], (const hawk_bch_t*)cmd); + } + else + { + mn = mn + 1; /* update the buffer size */ + hawk_wcstombs (cmd, &n, &cmd_line[11], &mn); + } + #endif + cmd_line[11+mn+1] = HAWK_BT('\0'); /* additional \0 after \0 */ + + cmd_file = HAWK_BT("cmd.exe"); + } + else + { + hawk_bch_t* mptr; + hawk_oow_t mn; + + #if defined(HAWK_OOCH_IS_BCH) + mn = hawk_strlen(cmd); + cmd_line = hawk_strdup2 (cmd, HAWK_T(" "), pio->mmgr); + if (cmd_line == HAWK_NULL) + { + pio->errnum = HAWK_PIO_ENOMEM; + goto oops; + } + #else + if (flags & HAWK_PIO_MBSCMD) + { + mn = hawk_mbslen((const hawk_bch_t*)cmd); + cmd_line = hawk_mbsdup2 ((const hawk_bch_t*)cmd, HAWK_BT(" "), pio->mmgr); + if (cmd_line == HAWK_NULL) + { + pio->errnum = HAWK_PIO_ENOMEM; + goto oops; + } + } + else + { + hawk_oow_t n; + + if (hawk_wcstombs (cmd, &n, HAWK_NULL, &mn) <= -1) + { + pio->errnum = HAWK_PIO_EINVAL; + goto oops; /* illegal sequence in cmd */ + } + + mn = mn + 1; + cmd_line = hawk_allocmem(pio->hawk, mn * HAWK_SIZEOF(hawk_ooch_t)); + if (cmd_line == HAWK_NULL) + { + pio->errnum = HAWK_PIO_ENOMEM; + goto oops; + } + + hawk_wcstombs (cmd, &n, cmd_line, &mn); + } + #endif + + /* TODO: enhance this part by: + * supporting file names containing whitespaces. + * detecting the end of the file name better. + * doing better parsing of the command line. + */ + + /* NOTE: you must separate the command name and the parameters + * with a space. "pstat.exe /c" is ok while "pstat.exe/c" + * is not. */ + mptr = hawk_mbspbrk (cmd_line, HAWK_BT(" \t")); + if (mptr) *mptr = HAWK_BT('\0'); + cmd_line[mn+1] = HAWK_BT('\0'); /* the second '\0' at the end */ + cmd_file = cmd_line; + } + + /* execute the command line */ + rc = DosExecPgm ( + &load_error, + HAWK_SIZEOF(load_error), + EXEC_ASYNCRESULT, + cmd_line, + HAWK_NULL, + &child_rc, + cmd_file + ); + + hawk_freemem (hawk, cmd_line); + cmd_line = HAWK_NULL; + + /* Once execution is completed regardless of success or failure, + * Restore stdin/out/err using handles duplicated into old_in/out/err */ + DosDupHandle (old_in, &std_in); /* I can't do much if this fails */ + DosClose (old_in); old_in = HAWK_PIO_HND_NIL; + DosDupHandle (old_out, &std_out); + DosClose (old_out); old_out = HAWK_PIO_HND_NIL; + DosDupHandle (old_err, &std_err); + DosClose (old_err); old_err = HAWK_PIO_HND_NIL; + + if (rc != NO_ERROR) + { + pio->errnum = syserr_to_errnum (rc); + goto oops; + } + pio->child = child_rc.codeTerminate; + +#elif defined(__DOS__) + + /* DOS not multi-processed. can't support pio */ + pio->errnum = HAWK_PIO_ENOIMPL; + return -1; + +#else + + if (flags & HAWK_PIO_WRITEIN) + { + if (HAWK_PIPE(&handle[0]) <= -1) + { + pio->errnum = syserr_to_errnum (errno); + goto oops; + } + minidx = 0; maxidx = 1; + } + + if (flags & HAWK_PIO_READOUT) + { + if (HAWK_PIPE(&handle[2]) <= -1) + { + pio->errnum = syserr_to_errnum (errno); + goto oops; + } + if (minidx == -1) minidx = 2; + maxidx = 3; + } + + if (flags & HAWK_PIO_READERR) + { + if (HAWK_PIPE(&handle[4]) <= -1) + { + pio->errnum = syserr_to_errnum (errno); + goto oops; + } + if (minidx == -1) minidx = 4; + maxidx = 5; + } + + if (maxidx == -1) + { + pio->errnum = HAWK_PIO_EINVAL; + goto oops; + } + + if (pio->flags & HAWK_PIO_FNCCMD) + { + /* i know i'm abusing typecasting here. + * cmd is supposed to be hawk_pio_fnc_t*, anyway */ + pid = standard_fork_and_exec(pio, handle, (param_t*)cmd); + if (pid <= -1) goto oops; + pio->child = pid; + } + else + { + #if defined(HAVE_POSIX_SPAWN) && !(defined(HAWK_SYSCALL0) && defined(SYS_vfork)) + + if ((pserr = posix_spawn_file_actions_init(&fa)) != 0) + { + pio->errnum = syserr_to_errnum(pserr); + goto oops; + } + fa_inited = 1; + + if (flags & HAWK_PIO_WRITEIN) + { + /* child should read */ + if ((pserr = posix_spawn_file_actions_addclose(&fa, handle[1])) != 0) + { + pio->errnum = syserr_to_errnum(pserr); + goto oops; + } + if ((pserr = posix_spawn_file_actions_adddup2(&fa, handle[0], 0)) != 0) + { + pio->errnum = syserr_to_errnum(pserr); + goto oops; + } + if ((pserr = posix_spawn_file_actions_addclose(&fa, handle[0])) != 0) + { + pio->errnum = syserr_to_errnum(pserr); + goto oops; + } + } + + if (flags & HAWK_PIO_READOUT) + { + /* child should write */ + if ((pserr = posix_spawn_file_actions_addclose(&fa, handle[2])) != 0) + { + pio->errnum = syserr_to_errnum(pserr); + goto oops; + } + if ((pserr = posix_spawn_file_actions_adddup2(&fa, handle[3], 1)) != 0) + { + pio->errnum = syserr_to_errnum(pserr); + goto oops; + } + if ((flags & HAWK_PIO_ERRTOOUT) && + (pserr = posix_spawn_file_actions_adddup2 (&fa, handle[3], 2)) != 0) + { + pio->errnum = syserr_to_errnum(pserr); + goto oops; + } + if ((pserr = posix_spawn_file_actions_addclose(&fa, handle[3])) != 0) + { + pio->errnum = syserr_to_errnum (pserr); + goto oops; + } + } + + if (flags & HAWK_PIO_READERR) + { + /* child should write */ + if ((pserr = posix_spawn_file_actions_addclose (&fa, handle[4])) != 0) + { + pio->errnum = syserr_to_errnum (pserr); + goto oops; + } + if ((pserr = posix_spawn_file_actions_adddup2 (&fa, handle[5], 2)) != 0) + { + pio->errnum = syserr_to_errnum (pserr); + goto oops; + } + if ((flags & HAWK_PIO_OUTTOERR) && + (pserr = posix_spawn_file_actions_adddup2 (&fa, handle[5], 1)) != 0) + { + pio->errnum = syserr_to_errnum (pserr); + goto oops; + } + if ((pserr = posix_spawn_file_actions_addclose (&fa, handle[5])) != 0) + { + pio->errnum = syserr_to_errnum (pserr); + goto oops; + } + } + + { + int oflags = O_RDWR; + #if defined(O_LARGEFILE) + oflags |= O_LARGEFILE; + #endif + + if ((flags & HAWK_PIO_INTONUL) && + (pserr = posix_spawn_file_actions_addopen (&fa, 0, HAWK_BT("/dev/null"), oflags, 0)) != 0) + { + pio->errnum = syserr_to_errnum (pserr); + goto oops; + } + if ((flags & HAWK_PIO_OUTTONUL) && + (pserr = posix_spawn_file_actions_addopen (&fa, 1, HAWK_BT("/dev/null"), oflags, 0)) != 0) + { + pio->errnum = syserr_to_errnum (pserr); + goto oops; + } + if ((flags & HAWK_PIO_ERRTONUL) && + (pserr = posix_spawn_file_actions_addopen (&fa, 2, HAWK_BT("/dev/null"), oflags, 0)) != 0) + { + pio->errnum = syserr_to_errnum (pserr); + goto oops; + } + } + + /* there remains the chance of race condition that + * 0, 1, 2 can be closed between addclose() and posix_spawn(). + * so checking the file descriptors with is_fd_valid() is + * just on the best-effort basis. + */ + if ((flags & HAWK_PIO_DROPIN) && is_fd_valid(0) && + (pserr = posix_spawn_file_actions_addclose (&fa, 0)) != 0) + { + pio->errnum = syserr_to_errnum (pserr); + goto oops; + } + if ((flags & HAWK_PIO_DROPOUT) && is_fd_valid(1) && + (pserr = posix_spawn_file_actions_addclose (&fa, 1)) != 0) + { + pio->errnum = syserr_to_errnum (pserr); + goto oops; + } + if ((flags & HAWK_PIO_DROPERR) && is_fd_valid(2) && + (pserr = posix_spawn_file_actions_addclose (&fa, 2)) != 0) + { + pio->errnum = syserr_to_errnum (pserr); + goto oops; + } + + if (!(flags & HAWK_PIO_NOCLOEXEC)) + { + int fd = get_highest_fd(pio); + while (fd > 2) + { + if (fd != handle[0] && fd != handle[1] && + fd != handle[2] && fd != handle[3] && + fd != handle[4] && fd != handle[5]) + { + /* closing attempt on a best-effort basis. + * posix_spawn() fails if the file descriptor added + * with addclose() is closed before posix_spawn(). + * addclose() if no FD_CLOEXEC is set or it's unknown. */ + if (is_fd_valid_and_nocloexec(fd) && + (pserr = posix_spawn_file_actions_addclose (&fa, fd)) != 0) + { + pio->errnum = syserr_to_errnum (pserr); + goto oops; + } + } + fd--; + } + } + + if (make_param (pio, cmd, flags, ¶m) <= -1) goto oops; + + /* check if the command(the command requested or /bin/sh) is + * exectuable to return an error without trying to execute it + * though this check alone isn't sufficient */ + if (assert_executable (pio, param.argv[0]) <= -1) + { + free_param (pio, ¶m); + goto oops; + } + + posix_spawnattr_init (&psattr); + + #if defined(__linux) + #if !defined(POSIX_SPAWN_USEVFORK) + # define POSIX_SPAWN_USEVFORK 0x40 + #endif + posix_spawnattr_setflags (&psattr, POSIX_SPAWN_USEVFORK); + #endif + + pserr = posix_spawn(&pid, param.argv[0], &fa, &psattr, param.argv, environ); + + #if defined(__linux) + posix_spawnattr_destroy (&psattr); + #endif + + free_param (pio, ¶m); + if (fa_inited) + { + posix_spawn_file_actions_destroy (&fa); + fa_inited = 0; + } + if (pserr != 0) + { + pio->errnum = syserr_to_errnum (pserr); + goto oops; + } + + pio->child = pid; + + #elif defined(HAWK_SYSCALL0) && defined(SYS_vfork) + + if (make_param (pio, cmd, flags, ¶m) <= -1) goto oops; + + /* check if the command(the command requested or /bin/sh) is + * exectuable to return an error without trying to execute it + * though this check alone isn't sufficient */ + if (assert_executable (pio, param.argv[0]) <= -1) + { + free_param (pio, ¶m); + goto oops; + } + + /* prepare some data before vforking for vfork limitation. + * the child in vfork should not make function calls or + * change data shared with the parent. */ + if (!(flags & HAWK_PIO_NOCLOEXEC)) highest_fd = get_highest_fd (pio); + + HAWK_SYSCALL0 (pid, SYS_vfork); + if (pid <= -1) + { + pio->errnum = HAWK_PIO_EINVAL; + free_param (pio, ¶m); + goto oops; + } + + if (pid == 0) + { + /* the child after vfork should not make function calls. + * since the system call like close() are also normal + * functions, i have to use assembly macros to make + * system calls. */ + + hawk_pio_hnd_t devnull = -1; + + if (!(flags & HAWK_PIO_NOCLOEXEC)) + { + /* cannot call close_open_fds_using_proc() in the vfork() context */ + + int fd = highest_fd; + + /* close all other unknown open handles except + * stdin/out/err and the pipes. */ + while (fd > 2) + { + if (fd != handle[0] && fd != handle[1] && + fd != handle[2] && fd != handle[3] && + fd != handle[4] && fd != handle[5]) + { + HAWK_SYSCALL1 (dummy, SYS_close, fd); + } + fd--; + } + } + + if (flags & HAWK_PIO_WRITEIN) + { + /* child should read */ + HAWK_SYSCALL1 (dummy, SYS_close, handle[1]); + HAWK_SYSCALL2 (dummy, SYS_dup2, handle[0], 0); + if (dummy <= -1) goto child_oops; + HAWK_SYSCALL1 (dummy, SYS_close, handle[0]); + } + + if (flags & HAWK_PIO_READOUT) + { + /* child should write */ + HAWK_SYSCALL1 (dummy, SYS_close, handle[2]); + HAWK_SYSCALL2 (dummy, SYS_dup2, handle[3], 1); + if (dummy <= -1) goto child_oops; + + if (flags & HAWK_PIO_ERRTOOUT) + { + HAWK_SYSCALL2 (dummy, SYS_dup2, handle[3], 2); + if (dummy <= -1) goto child_oops; + } + + HAWK_SYSCALL1 (dummy, SYS_close, handle[3]); + } + + if (flags & HAWK_PIO_READERR) + { + /* child should write */ + HAWK_SYSCALL1 (dummy, SYS_close, handle[4]); + HAWK_SYSCALL2 (dummy, SYS_dup2, handle[5], 2); + if (dummy <= -1) goto child_oops; + + if (flags & HAWK_PIO_OUTTOERR) + { + HAWK_SYSCALL2 (dummy, SYS_dup2, handle[5], 1); + if (dummy <= -1) goto child_oops; + } + + HAWK_SYSCALL1 (dummy, SYS_close, handle[5]); + } + + if (flags & (HAWK_PIO_INTONUL | HAWK_PIO_OUTTONUL | HAWK_PIO_ERRTONUL)) + { + #if defined(O_LARGEFILE) + HAWK_SYSCALL3 (devnull, SYS_open, HAWK_BT("/dev/null"), O_RDWR|O_LARGEFILE, 0); + #else + HAWK_SYSCALL3 (devnull, SYS_open, HAWK_BT("/dev/null"), O_RDWR, 0); + #endif + if (devnull <= -1) goto child_oops; + } + + if (flags & HAWK_PIO_INTONUL) + { + HAWK_SYSCALL2 (dummy, SYS_dup2, devnull, 0); + if (dummy <= -1) goto child_oops; + } + if (flags & HAWK_PIO_OUTTONUL) + { + HAWK_SYSCALL2 (dummy, SYS_dup2, devnull, 1); + if (dummy <= -1) goto child_oops; + } + if (flags & HAWK_PIO_ERRTONUL) + { + HAWK_SYSCALL2 (dummy, SYS_dup2, devnull, 2); + if (dummy <= -1) goto child_oops; + } + + if (flags & (HAWK_PIO_INTONUL | HAWK_PIO_OUTTONUL | HAWK_PIO_ERRTONUL)) + { + HAWK_SYSCALL1 (dummy, SYS_close, devnull); + devnull = -1; + } + + if (flags & HAWK_PIO_DROPIN) HAWK_SYSCALL1 (dummy, SYS_close, 0); + if (flags & HAWK_PIO_DROPOUT) HAWK_SYSCALL1 (dummy, SYS_close, 1); + if (flags & HAWK_PIO_DROPERR) HAWK_SYSCALL1 (dummy, SYS_close, 2); + + HAWK_SYSCALL3 (dummy, SYS_execve, param.argv[0], param.argv, environ); + /*free_param (pio, ¶m); don't free this in the vfork version */ + + child_oops: + if (devnull >= 0) HAWK_SYSCALL1 (dummy, SYS_close, devnull); + HAWK_SYSCALL1 (dummy, SYS_exit, 128); + } + + /* parent */ + free_param (pio, ¶m); + pio->child = pid; + + #else + + if (make_param (pio, cmd, flags, ¶m) <= -1) goto oops; + + /* check if the command(the command requested or /bin/sh) is + * exectuable to return an error without trying to execute it + * though this check alone isn't sufficient */ + if (assert_executable (pio, param.argv[0]) <= -1) + { + free_param (pio, ¶m); + goto oops; + } + + pid = standard_fork_and_exec(pio, handle, ¶m); + if (pid <= -1) + { + free_param (pio, ¶m); + goto oops; + } + + /* parent */ + free_param (pio, ¶m); + pio->child = pid; + #endif + + } + + if (flags & HAWK_PIO_WRITEIN) + { + /* + * 012345 + * rw---- + * X + * WRITE => 1 + */ + HAWK_CLOSE (handle[0]); + handle[0] = HAWK_PIO_HND_NIL; + } + + if (flags & HAWK_PIO_READOUT) + { + /* + * 012345 + * --rw-- + * X + * READ => 2 + */ + HAWK_CLOSE (handle[3]); + handle[3] = HAWK_PIO_HND_NIL; + } + + if (flags & HAWK_PIO_READERR) + { + /* + * 012345 + * ----rw + * X + * READ => 4 + */ + HAWK_CLOSE (handle[5]); + handle[5] = HAWK_PIO_HND_NIL; + } +#endif + + if (((flags & HAWK_PIO_INNOBLOCK) && set_pipe_nonblock(pio, handle[1], 1) <= -1) || + ((flags & HAWK_PIO_OUTNOBLOCK) && set_pipe_nonblock(pio, handle[2], 1) <= -1) || + ((flags & HAWK_PIO_ERRNOBLOCK) && set_pipe_nonblock(pio, handle[4], 1) <= -1)) + { + goto oops; + } + + /* store back references */ + pio->pin[HAWK_PIO_IN].self = pio; + pio->pin[HAWK_PIO_OUT].self = pio; + pio->pin[HAWK_PIO_ERR].self = pio; + + /* store actual pipe handles */ + pio->pin[HAWK_PIO_IN].handle = handle[1]; + pio->pin[HAWK_PIO_OUT].handle = handle[2]; + pio->pin[HAWK_PIO_ERR].handle = handle[4]; + + + if (flags & HAWK_PIO_TEXT) + { + int topt = 0; + + if (flags & HAWK_PIO_IGNOREECERR) topt |= HAWK_TIO_IGNOREECERR; + if (flags & HAWK_PIO_NOAUTOFLUSH) topt |= HAWK_TIO_NOAUTOFLUSH; + + HAWK_ASSERT (pio->hawk, HAWK_COUNTOF(tio) == HAWK_COUNTOF(pio->pin)); + for (i = 0; i < HAWK_COUNTOF(tio); i++) + { + int r; + + tio[i] = hawk_tio_open (pio->hawk, HAWK_SIZEOF(&pio->pin[i]), topt); + if (tio[i] == HAWK_NULL) + { + pio->errnum = HAWK_PIO_ENOMEM; + goto oops; + } + + /**(hawk_pio_pin_t**)hawk_tio_getxtn(tio[i]) = &pio->pin[i]; */ + *(hawk_pio_pin_t**)hawk_tio_getxtn(tio[i]) = &pio->pin[i]; + + r = (i == HAWK_PIO_IN)? + hawk_tio_attachout (tio[i], pio_output, HAWK_NULL, 4096): + hawk_tio_attachin (tio[i], pio_input, HAWK_NULL, 4096); + if (r <= -1) + { + if (pio->errnum == HAWK_PIO_ENOERR) + pio->errnum = tio_errnum_to_pio_errnum (tio[i]); + goto oops; + } + + pio->pin[i].tio = tio[i]; + } + } + + return 0; + +oops: + if (pio->errnum == HAWK_PIO_ENOERR) pio->errnum = HAWK_PIO_ESYSERR; + +#if defined(_WIN32) + if (windevnul != INVALID_HANDLE_VALUE) CloseHandle (windevnul); + +#elif defined(__OS2__) + if (cmd_line) hawk_freemem (hawk, cmd_line); + if (old_in != HAWK_PIO_HND_NIL) + { + DosDupHandle (old_in, &std_in); + DosClose (old_in); + } + if (old_out != HAWK_PIO_HND_NIL) + { + DosDupHandle (old_out, &std_out); + DosClose (old_out); + } + if (old_err != HAWK_PIO_HND_NIL) + { + DosDupHandle (old_err, &std_err); + DosClose (old_err); + } + if (os2devnul != HAWK_PIO_HND_NIL) DosClose (os2devnul); +#endif + + for (i = 0; i < HAWK_COUNTOF(tio); i++) + { + if (tio[i]) hawk_tio_close (tio[i]); + } + +#if defined(_WIN32) + for (i = minidx; i < maxidx; i++) CloseHandle (handle[i]); +#elif defined(__OS2__) + for (i = minidx; i < maxidx; i++) + { + if (handle[i] != HAWK_PIO_HND_NIL) DosClose (handle[i]); + } +#elif defined(__DOS__) + + /* DOS not multi-processed. can't support pio */ +#elif defined(HAVE_POSIX_SPAWN) && !(defined(HAWK_SYSCALL0) && defined(SYS_vfork)) + if (fa_inited) + { + posix_spawn_file_actions_destroy (&fa); + fa_inited = 0; + } + for (i = minidx; i < maxidx; i++) + { + if (handle[i] != HAWK_PIO_HND_NIL) HAWK_CLOSE (handle[i]); + } +#elif defined(HAWK_SYSCALL0) && defined(SYS_vfork) + for (i = minidx; i < maxidx; i++) + { + if (handle[i] != HAWK_PIO_HND_NIL) HAWK_CLOSE (handle[i]); + } +#else + for (i = minidx; i < maxidx; i++) + { + if (handle[i] != HAWK_PIO_HND_NIL) HAWK_CLOSE (handle[i]); + } +#endif + + return -1; +} + +void hawk_pio_fini (hawk_pio_t* pio) +{ + hawk_pio_end (pio, HAWK_PIO_ERR); + hawk_pio_end (pio, HAWK_PIO_OUT); + hawk_pio_end (pio, HAWK_PIO_IN); + + /* when closing, enable blocking and retrying */ + pio->flags &= ~HAWK_PIO_WAITNOBLOCK; + pio->flags &= ~HAWK_PIO_WAITNORETRY; + hawk_pio_wait (pio); +} + +hawk_pio_errnum_t hawk_pio_geterrnum (const hawk_pio_t* pio) +{ + return pio->errnum; +} + +hawk_cmgr_t* hawk_pio_getcmgr (hawk_pio_t* pio, hawk_pio_hid_t hid) +{ + return pio->pin[hid].tio? + hawk_tio_getcmgr(pio->pin[hid].tio): HAWK_NULL; +} + +void hawk_pio_setcmgr (hawk_pio_t* pio, hawk_pio_hid_t hid, hawk_cmgr_t* cmgr) +{ + if (pio->pin[hid].tio) hawk_tio_setcmgr (pio->pin[hid].tio, cmgr); +} + +hawk_pio_hnd_t hawk_pio_gethnd (const hawk_pio_t* pio, hawk_pio_hid_t hid) +{ + return pio->pin[hid].handle; +} + +hawk_pio_pid_t hawk_pio_getchild (const hawk_pio_t* pio) +{ + return pio->child; +} + +static hawk_ooi_t pio_read (hawk_pio_t* pio, void* buf, hawk_oow_t size, hawk_pio_hnd_t hnd) +{ +#if defined(_WIN32) + DWORD count; +#elif defined(__OS2__) + ULONG count; + APIRET rc; +#elif defined(__DOS__) + int n; +#else + hawk_ooi_t n; +#endif + + if (hnd == HAWK_PIO_HND_NIL) + { + /* the stream is already closed */ + pio->errnum = HAWK_PIO_ENOHND; + return (hawk_ooi_t)-1; + } + +#if defined(_WIN32) + + if (size > (HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(DWORD))) + size = HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(DWORD); + + if (ReadFile(hnd, buf, (DWORD)size, &count, HAWK_NULL) == FALSE) + { + /* ReadFile receives ERROR_BROKEN_PIPE when the write end + * is closed in the child process */ + if (GetLastError() == ERROR_BROKEN_PIPE) return 0; + pio->errnum = syserr_to_errnum(GetLastError()); + return -1; + } + return (hawk_ooi_t)count; + +#elif defined(__OS2__) + + if (size > (HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(ULONG))) + size = HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(ULONG); + + rc = DosRead (hnd, buf, (ULONG)size, &count); + if (rc != NO_ERROR) + { + if (rc == ERROR_BROKEN_PIPE) return 0; /* TODO: check this */ + pio->errnum = syserr_to_errnum(rc); + return -1; + } + return (hawk_ooi_t)count; + +#elif defined(__DOS__) + /* TODO: verify this */ + + if (size > (HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(unsigned int))) + size = HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(unsigned int); + + n = read (hnd, buf, size); + if (n <= -1) pio->errnum = syserr_to_errnum(errno); + return n; + +#else + + if (size > (HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(size_t))) + size = HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(size_t); + +reread: + n = HAWK_READ(hnd, buf, size); + if (n <= -1) + { + if (errno == EINTR) + { + if (pio->flags & HAWK_PIO_READNORETRY) + pio->errnum = HAWK_PIO_EINTR; + else goto reread; + } + else + { + pio->errnum = syserr_to_errnum (errno); + } + } + + return n; +#endif +} + +hawk_ooi_t hawk_pio_read (hawk_pio_t* pio, hawk_pio_hid_t hid, void* buf, hawk_oow_t size) +{ + if (pio->pin[hid].tio == HAWK_NULL) + return pio_read(pio, buf, size, pio->pin[hid].handle); + else + { + hawk_ooi_t n; + + pio->errnum = HAWK_PIO_ENOERR; + n = hawk_tio_read(pio->pin[hid].tio, buf, size); + if (n <= -1 && pio->errnum == HAWK_PIO_ENOERR) + pio->errnum = tio_errnum_to_pio_errnum (pio->pin[hid].tio); + + return n; + } +} + +static hawk_ooi_t pio_write (hawk_pio_t* pio, const void* data, hawk_oow_t size, hawk_pio_hnd_t hnd) +{ +#if defined(_WIN32) + DWORD count; +#elif defined(__OS2__) + ULONG count; + APIRET rc; +#elif defined(__DOS__) + int n; +#else + hawk_ooi_t n; +#endif + + if (hnd == HAWK_PIO_HND_NIL) + { + /* the stream is already closed */ + pio->errnum = HAWK_PIO_ENOHND; + return (hawk_ooi_t)-1; + } + +#if defined(_WIN32) + + if (size > (HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(DWORD))) + size = HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(DWORD); + + if (WriteFile (hnd, data, (DWORD)size, &count, HAWK_NULL) == FALSE) + { + pio->errnum = syserr_to_errnum(GetLastError()); + return -1; + } + return (hawk_ooi_t)count; + +#elif defined(__OS2__) + + if (size > (HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(ULONG))) + size = HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(ULONG); + + rc = DosWrite (hnd, (PVOID)data, (ULONG)size, &count); + if (rc != NO_ERROR) + { + pio->errnum = syserr_to_errnum(rc); + return -1; + } + return (hawk_ooi_t)count; + +#elif defined(__DOS__) + + if (size > (HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(unsigned int))) + size = HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(unsigned int); + + n = write (hnd, data, size); + if (n <= -1) pio->errnum = syserr_to_errnum (errno); + return n; + +#else + + if (size > (HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(size_t))) + size = HAWK_TYPE_MAX(hawk_ooi_t) & HAWK_TYPE_MAX(size_t); + +rewrite: + n = HAWK_WRITE (hnd, data, size); + if (n <= -1) + { + if (errno == EINTR) + { + if (pio->flags & HAWK_PIO_WRITENORETRY) + pio->errnum = HAWK_PIO_EINTR; + else goto rewrite; + } + else + { + pio->errnum = syserr_to_errnum (errno); + } + } + return n; + +#endif +} + +hawk_ooi_t hawk_pio_write (hawk_pio_t* pio, hawk_pio_hid_t hid, const void* data, hawk_oow_t size) +{ + if (pio->pin[hid].tio == HAWK_NULL) + return pio_write(pio, data, size, pio->pin[hid].handle); + else + { + hawk_ooi_t n; + + pio->errnum = HAWK_PIO_ENOERR; + n = hawk_tio_write(pio->pin[hid].tio, data, size); + if (n <= -1 && pio->errnum == HAWK_PIO_ENOERR) + pio->errnum = tio_errnum_to_pio_errnum (pio->pin[hid].tio); + + return n; + } +} + +hawk_ooi_t hawk_pio_writebytes (hawk_pio_t* pio, hawk_pio_hid_t hid, const void* data, hawk_oow_t size) +{ + if (pio->pin[hid].tio == HAWK_NULL) + return pio_write(pio, data, size, pio->pin[hid].handle); + else + return hawk_tio_writebchars(pio->pin[hid].tio, data, size); +} + +hawk_ooi_t hawk_pio_flush (hawk_pio_t* pio, hawk_pio_hid_t hid) +{ + hawk_ooi_t n; + + if (pio->pin[hid].tio == HAWK_NULL) return 0; + + pio->errnum = HAWK_PIO_ENOERR; + n = hawk_tio_flush(pio->pin[hid].tio); + if (n <= -1 && pio->errnum == HAWK_PIO_ENOERR) + pio->errnum = tio_errnum_to_pio_errnum(pio->pin[hid].tio); + + return n; +} + +void hawk_pio_drain (hawk_pio_t* pio, hawk_pio_hid_t hid) +{ + if (pio->pin[hid].tio) hawk_tio_drain (pio->pin[hid].tio); +} + +void hawk_pio_end (hawk_pio_t* pio, hawk_pio_hid_t hid) +{ + if (pio->pin[hid].tio) + { + hawk_tio_close (pio->pin[hid].tio); + pio->pin[hid].tio = HAWK_NULL; + } + + if (pio->pin[hid].handle != HAWK_PIO_HND_NIL) + { +#if defined(_WIN32) + CloseHandle (pio->pin[hid].handle); +#elif defined(__OS2__) + DosClose (pio->pin[hid].handle); +#elif defined(__DOS__) + close (pio->pin[hid].handle); +#else + HAWK_CLOSE (pio->pin[hid].handle); +#endif + pio->pin[hid].handle = HAWK_PIO_HND_NIL; + } +} + +int hawk_pio_wait (hawk_pio_t* pio) +{ +#if defined(_WIN32) + + DWORD ecode, w; + + if (pio->child == HAWK_PIO_PID_NIL) + { + pio->errnum = HAWK_PIO_ECHILD; + return -1; + } + + w = WaitForSingleObject (pio->child, + ((pio->flags & HAWK_PIO_WAITNOBLOCK)? 0: INFINITE) + ); + if (w == WAIT_TIMEOUT) + { + /* the child process is still alive */ + return 255 + 1; + } + if (w != WAIT_OBJECT_0) + { + /* WAIT_FAILED, WAIT_ABANDONED */ + pio->errnum = HAWK_PIO_ESYSERR; + return -1; + } + + HAWK_ASSERT (pio->hawk, w == WAIT_OBJECT_0); + + if (GetExitCodeProcess(pio->child, &ecode) == FALSE) + { + /* close the handle anyway to prevent further + * errors when this function is called again */ + CloseHandle (pio->child); + pio->child = HAWK_PIO_PID_NIL; + + pio->errnum = HAWK_PIO_ESYSERR; + return -1; + } + + /* close handle here to emulate waitpid() as much as possible. */ + CloseHandle (pio->child); + pio->child = HAWK_PIO_PID_NIL; + + if (ecode == STILL_ACTIVE) + { + /* this should not happen as the control reaches here + * only when WaitforSingleObject() is successful. + * if it happends, close the handle and return an error */ + pio->errnum = HAWK_PIO_ESYSERR; + return -1; + } + + return ecode; + +#elif defined(__OS2__) + + APIRET rc; + RESULTCODES child_rc; + PID ppid; + + if (pio->child == HAWK_PIO_PID_NIL) + { + pio->errnum = HAWK_PIO_ECHILD; + return -1; + } + + rc = DosWaitChild ( + DCWA_PROCESSTREE, + ((pio->flags & HAWK_PIO_WAITNOBLOCK)? DCWW_NOWAIT: DCWW_WAIT), + &child_rc, + &ppid, + pio->child + ); + if (rc == ERROR_CHILD_NOT_COMPLETE) + { + /* the child process is still alive */ + return 255 + 1; + } + if (rc != NO_ERROR) + { + /* WAIT_FAILED, WAIT_ABANDONED */ + pio->errnum = HAWK_PIO_ESYSERR; + return -1; + } + + /* close handle here to emulate waitpid() as much as possible. */ + /*DosClose (pio->child);*/ + pio->child = HAWK_PIO_PID_NIL; + + return (child_rc.codeTerminate == TC_EXIT)? + child_rc.codeResult: (255 + 1 + child_rc.codeTerminate); + +#elif defined(__DOS__) + + pio->errnum = HAWK_PIO_ENOIMPL; + return -1; + +#else + + int opt = 0; + int ret = -1; + + if (pio->child == HAWK_PIO_PID_NIL) + { + pio->errnum = HAWK_PIO_ECHILD; + return -1; + } + + if (pio->flags & HAWK_PIO_WAITNOBLOCK) opt |= WNOHANG; + + while (1) + { + int status, n; + + n = HAWK_WAITPID (pio->child, &status, opt); + if (n <= -1) + { + if (errno == ECHILD) + { + /* most likely, the process has already been + * waitpid()ed on. */ + pio->child = HAWK_PIO_PID_NIL; + pio->errnum = HAWK_PIO_ECHILD; + } + else if (errno == EINTR) + { + if (pio->flags & HAWK_PIO_WAITNORETRY) + pio->errnum = HAWK_PIO_EINTR; + else continue; + } + else pio->errnum = syserr_to_errnum (errno); + + break; + } + + if (n == 0) + { + /* when WNOHANG is not specified, 0 can't be returned */ + HAWK_ASSERT (pio->hawk, pio->flags & HAWK_PIO_WAITNOBLOCK); + + ret = 255 + 1; + /* the child process is still alive */ + break; + } + + if (n == pio->child) + { + if (WIFEXITED(status)) + { + /* the child process ended normally */ + ret = WEXITSTATUS(status); + } + else if (WIFSIGNALED(status)) + { + /* the child process was killed by a signal */ + ret = 255 + 1 + WTERMSIG (status); + } + else + { + /* not interested in WIFSTOPPED & WIFCONTINUED. + * in fact, this else-block should not be reached + * as WIFEXITED or WIFSIGNALED must be true. + * anyhow, just set the return value to 0. */ + ret = 0; + } + + pio->child = HAWK_PIO_PID_NIL; + break; + } + } + + return ret; +#endif +} + +int hawk_pio_kill (hawk_pio_t* pio) +{ +#if defined(_WIN32) + DWORD n; +#elif defined(__OS2__) + APIRET rc; +#elif defined(__DOS__) + /* TODO: implement this */ +#else + int n; +#endif + + if (pio->child == HAWK_PIO_PID_NIL) + { + pio->errnum = HAWK_PIO_ECHILD; + return -1; + } + +#if defined(_WIN32) + /* 9 was chosen below to treat TerminateProcess as kill -KILL. */ + n = TerminateProcess(pio->child, 255 + 1 + 9); + if (n == FALSE) + { + pio->errnum = HAWK_PIO_ESYSERR; + return -1; + } + return 0; + +#elif defined(__OS2__) +/*TODO: must use DKP_PROCESS? */ + rc = DosKillProcess(pio->child, DKP_PROCESSTREE); + if (rc != NO_ERROR) + { + pio->errnum = HAWK_PIO_ESYSERR; + return -1; + } + return 0; + +#elif defined(__DOS__) + + pio->errnum = HAWK_PIO_ENOIMPL; + return -1; + +#else + n = HAWK_KILL (pio->child, SIGKILL); + if (n <= -1) pio->errnum = HAWK_PIO_ESYSERR; + return n; +#endif +} + +static hawk_ooi_t pio_input (hawk_tio_t* tio, hawk_tio_cmd_t cmd, void* buf, hawk_oow_t size) +{ + if (cmd == HAWK_TIO_DATA) + { + hawk_pio_pin_t* pin = (hawk_pio_pin_t*)hawk_tio_getxtn(tio); + HAWK_ASSERT (pio->hawk, pin != HAWK_NULL); + HAWK_ASSERT (pio->hawk, pin->self != HAWK_NULL); + return pio_read(pin->self, buf, size, pin->handle); + } + + /* take no actions for OPEN and CLOSE as they are handled + * by pio */ + return 0; +} + +static hawk_ooi_t pio_output (hawk_tio_t* tio, hawk_tio_cmd_t cmd, void* buf, hawk_oow_t size) +{ + if (cmd == HAWK_TIO_DATA) + { + hawk_pio_pin_t* pin = (hawk_pio_pin_t*)hawk_tio_getxtn(tio); + HAWK_ASSERT (pio->hawk, pin != HAWK_NULL); + HAWK_ASSERT (pio->hawk, pin->self != HAWK_NULL); + return pio_write(pin->self, buf, size, pin->handle); + } + + /* take no actions for OPEN and CLOSE as they are handled + * by pio */ + return 0; +} diff --git a/hawk/lib/pma.c b/hawk/lib/pma.c new file mode 100644 index 00000000..1f836548 --- /dev/null +++ b/hawk/lib/pma.c @@ -0,0 +1,173 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This is the TRE memory allocator modified for QSE. + * See the original license notice below. + */ + +/* + tre-mem.c - TRE memory allocator + + This software is released under a BSD-style license. + See the file LICENSE for details and copyright. + */ + +/* + This memory allocator is for allocating small memory blocks efficiently + in terms of memory overhead and execution speed. The allocated blocks + cannot be freed individually, only all at once. There can be multiple + allocators, though. + */ + +#include +#include "hawk-prv.h" + +/* Returns number of bytes to add to (char *)ptr to make it + properly aligned for the type. */ +#define ALIGN(ptr, type) \ + ((((hawk_uintptr_t)ptr) % HAWK_SIZEOF(type))? \ + (HAWK_SIZEOF(type) - (((hawk_uintptr_t)ptr) % HAWK_SIZEOF(type))) : 0) + + +hawk_pma_t* hawk_pma_open (hawk_t* hawk, hawk_oow_t xtnsize) +{ + hawk_pma_t* pma; + + pma = (hawk_pma_t*)hawk_allocmem(hawk, HAWK_SIZEOF(*pma) + xtnsize); + if (!pma) return HAWK_NULL; + + if (hawk_pma_init(pma, hawk) <= -1) + { + hawk_freemem (hawk, pma); + return HAWK_NULL; + } + + HAWK_MEMSET (pma + 1, 0, xtnsize); + return pma; +} + +void hawk_pma_close (hawk_pma_t* pma) +{ + hawk_pma_fini (pma); + hawk_freemem (pma->hawk, pma); +} + +int hawk_pma_init (hawk_pma_t* pma, hawk_t* hawk) +{ + HAWK_MEMSET (pma, 0, HAWK_SIZEOF(*pma)); + pma->hawk = hawk; + return 0; +} + +/* Frees the memory allocator and all memory allocated with it. */ +void hawk_pma_fini (hawk_pma_t* pma) +{ + hawk_pma_clear (pma); +} + +void hawk_pma_clear (hawk_pma_t* pma) +{ + hawk_t* hawk = pma->hawk; + hawk_pma_blk_t* tmp, * l = pma->blocks; + + while (l != HAWK_NULL) + { + tmp = l->next; + hawk_freemem (hawk, l); + l = tmp; + } + + HAWK_MEMSET (pma, 0, HAWK_SIZEOF(*pma)); + pma->hawk = hawk; +} +/* Returns a new memory allocator or NULL if out of memory. */ + +/* Allocates a block of `size' bytes from `mem'. Returns a pointer to the + allocated block or NULL if an underlying malloc() failed. */ +void* hawk_pma_alloc (hawk_pma_t* pma, hawk_oow_t size) +{ + void *ptr; + + if (pma->failed) return HAWK_NULL; + + if (pma->n < size) + { + /* We need more memory than is available in the current block. + Allocate a new block. */ + + hawk_pma_blk_t* l; + int block_size; + if (size * 8 > HAWK_PMA_BLOCK_SIZE) + block_size = size * 8; + else + block_size = HAWK_PMA_BLOCK_SIZE; + + l = hawk_allocmem(pma->hawk, HAWK_SIZEOF(*l) + block_size); + if (l == HAWK_NULL) + { + pma->failed = 1; + return HAWK_NULL; + } + l->data = (void*)(l + 1); + + l->next = HAWK_NULL; + if (pma->current != HAWK_NULL) pma->current->next = l; + if (pma->blocks == HAWK_NULL) pma->blocks = l; + pma->current = l; + pma->ptr = l->data; + pma->n = block_size; + } + + /* Make sure the next pointer will be aligned. */ + size += ALIGN((hawk_uintptr_t)(pma->ptr + size), hawk_uintptr_t); + + /* Allocate from current block. */ + ptr = pma->ptr; + pma->ptr += size; + pma->n -= size; + + return ptr; +} + +void* hawk_pma_calloc (hawk_pma_t* pma, hawk_oow_t size) +{ + void* ptr = hawk_pma_alloc (pma, size); + if (ptr) HAWK_MEMSET (ptr, 0, size); + return ptr; +} + +void* hawk_pma_realloc (hawk_pma_t* pma, void* blk, hawk_oow_t size) +{ + /* do nothing. you can't resize an individual memory chunk */ + return HAWK_NULL; +} + +void hawk_pma_free (hawk_pma_t* pma, void* blk) +{ + /* do nothing. you can't free an individual memory chunk */ +} + diff --git a/hawk/lib/rbt.c b/hawk/lib/rbt.c new file mode 100644 index 00000000..db5e0936 --- /dev/null +++ b/hawk/lib/rbt.c @@ -0,0 +1,992 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include "hawk-prv.h" + +#define copier_t hawk_rbt_copier_t +#define freeer_t hawk_rbt_freeer_t +#define comper_t hawk_rbt_comper_t +#define keeper_t hawk_rbt_keeper_t +#define walker_t hawk_rbt_walker_t +#define cbserter_t hawk_rbt_cbserter_t + +#define KPTR(p) HAWK_RBT_KPTR(p) +#define KLEN(p) HAWK_RBT_KLEN(p) +#define VPTR(p) HAWK_RBT_VPTR(p) +#define VLEN(p) HAWK_RBT_VLEN(p) + +#define KTOB(rbt,len) ((len)*(rbt)->scale[HAWK_RBT_KEY]) +#define VTOB(rbt,len) ((len)*(rbt)->scale[HAWK_RBT_VAL]) + +#define UPSERT 1 +#define UPDATE 2 +#define ENSERT 3 +#define INSERT 4 + +#define IS_NIL(rbt,x) ((x) == &((rbt)->xnil)) +#define LEFT 0 +#define RIGHT 1 +#define left child[LEFT] +#define right child[RIGHT] +#define rotate_left(rbt,pivot) rotate(rbt,pivot,1); +#define rotate_right(rbt,pivot) rotate(rbt,pivot,0); + +HAWK_INLINE hawk_rbt_pair_t* hawk_rbt_allocpair ( + hawk_rbt_t* rbt, void* kptr, hawk_oow_t klen, void* vptr, hawk_oow_t vlen) +{ + hawk_rbt_pair_t* pair; + + copier_t kcop = rbt->style->copier[HAWK_RBT_KEY]; + copier_t vcop = rbt->style->copier[HAWK_RBT_VAL]; + + hawk_oow_t as = HAWK_SIZEOF(hawk_rbt_pair_t); + if (kcop == HAWK_RBT_COPIER_INLINE) as += HAWK_ALIGN_POW2(KTOB(rbt,klen), HAWK_SIZEOF_VOID_P); + if (vcop == HAWK_RBT_COPIER_INLINE) as += VTOB(rbt,vlen); + + pair = (hawk_rbt_pair_t*)hawk_allocmem(rbt->hawk, as); + if (!pair) return HAWK_NULL; + + pair->color = HAWK_RBT_RED; + pair->parent = HAWK_NULL; + pair->child[LEFT] = &rbt->xnil; + pair->child[RIGHT] = &rbt->xnil; + + KLEN(pair) = klen; + if (kcop == HAWK_RBT_COPIER_SIMPLE) + { + KPTR(pair) = kptr; + } + else if (kcop == HAWK_RBT_COPIER_INLINE) + { + KPTR(pair) = pair + 1; + if (kptr) HAWK_MEMCPY (KPTR(pair), kptr, KTOB(rbt,klen)); + } + else + { + KPTR(pair) = kcop(rbt, kptr, klen); + if (KPTR(pair) == HAWK_NULL) + { + hawk_freemem (rbt->hawk, pair); + return HAWK_NULL; + } + } + + VLEN(pair) = vlen; + if (vcop == HAWK_RBT_COPIER_SIMPLE) + { + VPTR(pair) = vptr; + } + else if (vcop == HAWK_RBT_COPIER_INLINE) + { + VPTR(pair) = pair + 1; + if (kcop == HAWK_RBT_COPIER_INLINE) + VPTR(pair) = (hawk_oob_t*)VPTR(pair) + HAWK_ALIGN_POW2(KTOB(rbt,klen), HAWK_SIZEOF_VOID_P); + if (vptr) HAWK_MEMCPY (VPTR(pair), vptr, VTOB(rbt,vlen)); + } + else + { + VPTR(pair) = vcop (rbt, vptr, vlen); + if (VPTR(pair) != HAWK_NULL) + { + if (rbt->style->freeer[HAWK_RBT_KEY] != HAWK_NULL) + rbt->style->freeer[HAWK_RBT_KEY] (rbt, KPTR(pair), KLEN(pair)); + hawk_freemem (rbt->hawk, pair); + return HAWK_NULL; + } + } + + return pair; +} + +HAWK_INLINE void hawk_rbt_freepair (hawk_rbt_t* rbt, hawk_rbt_pair_t* pair) +{ + if (rbt->style->freeer[HAWK_RBT_KEY] != HAWK_NULL) + rbt->style->freeer[HAWK_RBT_KEY] (rbt, KPTR(pair), KLEN(pair)); + if (rbt->style->freeer[HAWK_RBT_VAL] != HAWK_NULL) + rbt->style->freeer[HAWK_RBT_VAL] (rbt, VPTR(pair), VLEN(pair)); + hawk_freemem (rbt->hawk, pair); +} + +static hawk_rbt_style_t style[] = +{ + { + { + HAWK_RBT_COPIER_DEFAULT, + HAWK_RBT_COPIER_DEFAULT + }, + { + HAWK_RBT_FREEER_DEFAULT, + HAWK_RBT_FREEER_DEFAULT + }, + HAWK_RBT_COMPER_DEFAULT, + HAWK_RBT_KEEPER_DEFAULT + }, + + { + { + HAWK_RBT_COPIER_INLINE, + HAWK_RBT_COPIER_INLINE + }, + { + HAWK_RBT_FREEER_DEFAULT, + HAWK_RBT_FREEER_DEFAULT + }, + HAWK_RBT_COMPER_DEFAULT, + HAWK_RBT_KEEPER_DEFAULT + }, + + { + { + HAWK_RBT_COPIER_INLINE, + HAWK_RBT_COPIER_DEFAULT + }, + { + HAWK_RBT_FREEER_DEFAULT, + HAWK_RBT_FREEER_DEFAULT + }, + HAWK_RBT_COMPER_DEFAULT, + HAWK_RBT_KEEPER_DEFAULT + }, + + { + { + HAWK_RBT_COPIER_DEFAULT, + HAWK_RBT_COPIER_INLINE + }, + { + HAWK_RBT_FREEER_DEFAULT, + HAWK_RBT_FREEER_DEFAULT + }, + HAWK_RBT_COMPER_DEFAULT, + HAWK_RBT_KEEPER_DEFAULT + } +}; + +const hawk_rbt_style_t* hawk_get_rbt_style (hawk_rbt_style_kind_t kind) +{ + return &style[kind]; +} + +hawk_rbt_t* hawk_rbt_open (hawk_t* hawk, hawk_oow_t xtnsize, int kscale, int vscale) +{ + hawk_rbt_t* rbt; + + rbt = (hawk_rbt_t*)hawk_allocmem(hawk, HAWK_SIZEOF(hawk_rbt_t) + xtnsize); + if (!rbt) return HAWK_NULL; + + if (hawk_rbt_init(rbt, hawk, kscale, vscale) <= -1) + { + hawk_freemem (hawk, rbt); + return HAWK_NULL; + } + + HAWK_MEMSET (rbt + 1, 0, xtnsize); + return rbt; +} + +void hawk_rbt_close (hawk_rbt_t* rbt) +{ + hawk_rbt_fini (rbt); + hawk_freemem (rbt->hawk, rbt); +} + +int hawk_rbt_init (hawk_rbt_t* rbt, hawk_t* hawk, int kscale, int vscale) +{ + /* do not zero out the extension */ + HAWK_MEMSET (rbt, 0, HAWK_SIZEOF(*rbt)); + rbt->hawk = hawk; + + rbt->scale[HAWK_RBT_KEY] = (kscale < 1)? 1: kscale; + rbt->scale[HAWK_RBT_VAL] = (vscale < 1)? 1: vscale; + rbt->size = 0; + + rbt->style = &style[0]; + + /* self-initializing nil */ + HAWK_MEMSET(&rbt->xnil, 0, HAWK_SIZEOF(rbt->xnil)); + rbt->xnil.color = HAWK_RBT_BLACK; + rbt->xnil.left = &rbt->xnil; + rbt->xnil.right = &rbt->xnil; + + /* root is set to nil initially */ + rbt->root = &rbt->xnil; + + return 0; +} + +void hawk_rbt_fini (hawk_rbt_t* rbt) +{ + hawk_rbt_clear (rbt); +} + +const hawk_rbt_style_t* hawk_rbt_getstyle (const hawk_rbt_t* rbt) +{ + return rbt->style; +} + +void hawk_rbt_setstyle (hawk_rbt_t* rbt, const hawk_rbt_style_t* style) +{ + HAWK_ASSERT (rbt->hawk, style != HAWK_NULL); + rbt->style = style; +} + +hawk_oow_t hawk_rbt_getsize (const hawk_rbt_t* rbt) +{ + return rbt->size; +} + +hawk_rbt_pair_t* hawk_rbt_search (const hawk_rbt_t* rbt, const void* kptr, hawk_oow_t klen) +{ + hawk_rbt_pair_t* pair = rbt->root; + + while (!IS_NIL(rbt,pair)) + { + int n = rbt->style->comper (rbt, kptr, klen, KPTR(pair), KLEN(pair)); + if (n == 0) return pair; + + if (n > 0) pair = pair->right; + else /* if (n < 0) */ pair = pair->left; + } + + return HAWK_NULL; +} + +static void rotate (hawk_rbt_t* rbt, hawk_rbt_pair_t* pivot, int leftwise) +{ + /* + * == leftwise rotation + * move the pivot pair down to the poistion of the pivot's original + * left child(x). move the pivot's right child(y) to the pivot's original + * position. as 'c1' is between 'y' and 'pivot', move it to the right + * of the new pivot position. + * parent parent + * | | (left or right?) | | + * pivot y + * / \ / \ + * x y =====> pivot c2 + * / \ / \ + * c1 c2 x c1 + * + * == rightwise rotation + * move the pivot pair down to the poistion of the pivot's original + * right child(y). move the pivot's left child(x) to the pivot's original + * position. as 'c2' is between 'x' and 'pivot', move it to the left + * of the new pivot position. + * + * parent parent + * | | (left or right?) | | + * pivot x + * / \ / \ + * x y =====> c1 pivot + * / \ / \ + * c1 c2 c2 y + * + * + * the actual implementation here resolves the pivot's relationship to + * its parent by comparaing pointers as it is not known if the pivot pair + * is the left child or the right child of its parent, + */ + + hawk_rbt_pair_t* parent, * z, * c; + int cid1, cid2; + + HAWK_ASSERT (rbt->hawk, pivot != HAWK_NULL); + + if (leftwise) + { + cid1 = RIGHT; + cid2 = LEFT; + } + else + { + cid1 = LEFT; + cid2 = RIGHT; + } + + parent = pivot->parent; + /* y for leftwise rotation, x for rightwise rotation */ + z = pivot->child[cid1]; + /* c1 for leftwise rotation, c2 for rightwise rotation */ + c = z->child[cid2]; + + z->parent = parent; + if (parent) + { + if (parent->left == pivot) + { + parent->left = z; + } + else + { + HAWK_ASSERT (rbt->hawk, parent->right == pivot); + parent->right = z; + } + } + else + { + HAWK_ASSERT (rbt->hawk, rbt->root == pivot); + rbt->root = z; + } + + z->child[cid2] = pivot; + if (!IS_NIL(rbt,pivot)) pivot->parent = z; + + pivot->child[cid1] = c; + if (!IS_NIL(rbt,c)) c->parent = pivot; +} + +static void adjust (hawk_rbt_t* rbt, hawk_rbt_pair_t* pair) +{ + while (pair != rbt->root) + { + hawk_rbt_pair_t* tmp, * tmp2, * x_par; + int leftwise; + + x_par = pair->parent; + if (x_par->color == HAWK_RBT_BLACK) break; + + HAWK_ASSERT (rbt->hawk, x_par->parent != HAWK_NULL); + + if (x_par == x_par->parent->child[LEFT]) + { + tmp = x_par->parent->child[RIGHT]; + tmp2 = x_par->child[RIGHT]; + leftwise = 1; + } + else + { + tmp = x_par->parent->child[LEFT]; + tmp2 = x_par->child[LEFT]; + leftwise = 0; + } + + if (tmp->color == HAWK_RBT_RED) + { + x_par->color = HAWK_RBT_BLACK; + tmp->color = HAWK_RBT_BLACK; + x_par->parent->color = HAWK_RBT_RED; + pair = x_par->parent; + } + else + { + if (pair == tmp2) + { + pair = x_par; + rotate (rbt, pair, leftwise); + x_par = pair->parent; + } + + x_par->color = HAWK_RBT_BLACK; + x_par->parent->color = HAWK_RBT_RED; + rotate (rbt, x_par->parent, !leftwise); + } + } +} + +static hawk_rbt_pair_t* change_pair_val ( + hawk_rbt_t* rbt, hawk_rbt_pair_t* pair, void* vptr, hawk_oow_t vlen) +{ + if (VPTR(pair) == vptr && VLEN(pair) == vlen) + { + /* if the old value and the new value are the same, + * it just calls the handler for this condition. + * No value replacement occurs. */ + if (rbt->style->keeper != HAWK_NULL) + { + rbt->style->keeper (rbt, vptr, vlen); + } + } + else + { + copier_t vcop = rbt->style->copier[HAWK_RBT_VAL]; + void* ovptr = VPTR(pair); + hawk_oow_t ovlen = VLEN(pair); + + /* place the new value according to the copier */ + if (vcop == HAWK_RBT_COPIER_SIMPLE) + { + VPTR(pair) = vptr; + VLEN(pair) = vlen; + } + else if (vcop == HAWK_RBT_COPIER_INLINE) + { + if (ovlen == vlen) + { + if (vptr) HAWK_MEMCPY (VPTR(pair), vptr, VTOB(rbt,vlen)); + } + else + { + /* need to reconstruct the pair */ + hawk_rbt_pair_t* p = hawk_rbt_allocpair (rbt, + KPTR(pair), KLEN(pair), + vptr, vlen); + if (p == HAWK_NULL) return HAWK_NULL; + + p->color = pair->color; + p->left = pair->left; + p->right = pair->right; + p->parent = pair->parent; + + if (pair->parent) + { + if (pair->parent->left == pair) + { + pair->parent->left = p; + } + else + { + HAWK_ASSERT (rbt->hawk, pair->parent->right == pair); + pair->parent->right = p; + } + } + if (!IS_NIL(rbt,pair->left)) pair->left->parent = p; + if (!IS_NIL(rbt,pair->right)) pair->right->parent = p; + + if (pair == rbt->root) rbt->root = p; + + hawk_rbt_freepair (rbt, pair); + return p; + } + } + else + { + void* nvptr = vcop (rbt, vptr, vlen); + if (nvptr == HAWK_NULL) return HAWK_NULL; + VPTR(pair) = nvptr; + VLEN(pair) = vlen; + } + + /* free up the old value */ + if (rbt->style->freeer[HAWK_RBT_VAL] != HAWK_NULL) + { + rbt->style->freeer[HAWK_RBT_VAL] (rbt, ovptr, ovlen); + } + } + + return pair; +} + +static hawk_rbt_pair_t* insert ( + hawk_rbt_t* rbt, void* kptr, hawk_oow_t klen, void* vptr, hawk_oow_t vlen, int opt) +{ + hawk_rbt_pair_t* x_cur = rbt->root; + hawk_rbt_pair_t* x_par = HAWK_NULL; + hawk_rbt_pair_t* x_new; + + while (!IS_NIL(rbt,x_cur)) + { + int n = rbt->style->comper (rbt, kptr, klen, KPTR(x_cur), KLEN(x_cur)); + if (n == 0) + { + switch (opt) + { + case UPSERT: + case UPDATE: + return change_pair_val (rbt, x_cur, vptr, vlen); + + case ENSERT: + /* return existing pair */ + return x_cur; + + case INSERT: + /* return failure */ + return HAWK_NULL; + } + } + + x_par = x_cur; + + if (n > 0) x_cur = x_cur->right; + else /* if (n < 0) */ x_cur = x_cur->left; + } + + if (opt == UPDATE) return HAWK_NULL; + + x_new = hawk_rbt_allocpair (rbt, kptr, klen, vptr, vlen); + if (x_new == HAWK_NULL) return HAWK_NULL; + + if (x_par == HAWK_NULL) + { + /* the tree contains no pair */ + HAWK_ASSERT (rbt->hawk, rbt->root == &rbt->xnil); + rbt->root = x_new; + } + else + { + /* perform normal binary insert */ + int n = rbt->style->comper (rbt, kptr, klen, KPTR(x_par), KLEN(x_par)); + if (n > 0) + { + HAWK_ASSERT (rbt->hawk, x_par->right == &rbt->xnil); + x_par->right = x_new; + } + else + { + HAWK_ASSERT (rbt->hawk, x_par->left == &rbt->xnil); + x_par->left = x_new; + } + + x_new->parent = x_par; + adjust (rbt, x_new); + } + + rbt->root->color = HAWK_RBT_BLACK; + rbt->size++; + return x_new; +} + +hawk_rbt_pair_t* hawk_rbt_upsert ( + hawk_rbt_t* rbt, void* kptr, hawk_oow_t klen, void* vptr, hawk_oow_t vlen) +{ + return insert (rbt, kptr, klen, vptr, vlen, UPSERT); +} + +hawk_rbt_pair_t* hawk_rbt_ensert ( + hawk_rbt_t* rbt, void* kptr, hawk_oow_t klen, void* vptr, hawk_oow_t vlen) +{ + return insert (rbt, kptr, klen, vptr, vlen, ENSERT); +} + +hawk_rbt_pair_t* hawk_rbt_insert ( + hawk_rbt_t* rbt, void* kptr, hawk_oow_t klen, void* vptr, hawk_oow_t vlen) +{ + return insert (rbt, kptr, klen, vptr, vlen, INSERT); +} + + +hawk_rbt_pair_t* hawk_rbt_update ( + hawk_rbt_t* rbt, void* kptr, hawk_oow_t klen, void* vptr, hawk_oow_t vlen) +{ + return insert (rbt, kptr, klen, vptr, vlen, UPDATE); +} + +hawk_rbt_pair_t* hawk_rbt_cbsert ( + hawk_rbt_t* rbt, void* kptr, hawk_oow_t klen, cbserter_t cbserter, void* ctx) +{ + hawk_rbt_pair_t* x_cur = rbt->root; + hawk_rbt_pair_t* x_par = HAWK_NULL; + hawk_rbt_pair_t* x_new; + + while (!IS_NIL(rbt,x_cur)) + { + int n = rbt->style->comper (rbt, kptr, klen, KPTR(x_cur), KLEN(x_cur)); + if (n == 0) + { + /* back up the contents of the current pair + * in case it is reallocated */ + hawk_rbt_pair_t tmp; + + tmp = *x_cur; + + /* call the callback function to manipulate the pair */ + x_new = cbserter (rbt, x_cur, kptr, klen, ctx); + if (x_new == HAWK_NULL) + { + /* error returned by the callback function */ + return HAWK_NULL; + } + + if (x_new != x_cur) + { + /* the current pair has been reallocated, which implicitly + * means the previous contents were wiped out. so the contents + * backed up will be used for restoration/migration */ + + x_new->color = tmp.color; + x_new->left = tmp.left; + x_new->right = tmp.right; + x_new->parent = tmp.parent; + + if (tmp.parent) + { + if (tmp.parent->left == x_cur) + { + tmp.parent->left = x_new; + } + else + { + HAWK_ASSERT (rbt->hawk, tmp.parent->right == x_cur); + tmp.parent->right = x_new; + } + } + if (!IS_NIL(rbt,tmp.left)) tmp.left->parent = x_new; + if (!IS_NIL(rbt,tmp.right)) tmp.right->parent = x_new; + + if (x_cur == rbt->root) rbt->root = x_new; + } + + return x_new; + } + + x_par = x_cur; + + if (n > 0) x_cur = x_cur->right; + else /* if (n < 0) */ x_cur = x_cur->left; + } + + x_new = cbserter (rbt, HAWK_NULL, kptr, klen, ctx); + if (x_new == HAWK_NULL) return HAWK_NULL; + + if (x_par == HAWK_NULL) + { + /* the tree contains no pair */ + HAWK_ASSERT (rbt->hawk, rbt->root == &rbt->xnil); + rbt->root = x_new; + } + else + { + /* perform normal binary insert */ + int n = rbt->style->comper (rbt, kptr, klen, KPTR(x_par), KLEN(x_par)); + if (n > 0) + { + HAWK_ASSERT (rbt->hawk, x_par->right == &rbt->xnil); + x_par->right = x_new; + } + else + { + HAWK_ASSERT (rbt->hawk, x_par->left == &rbt->xnil); + x_par->left = x_new; + } + + x_new->parent = x_par; + adjust (rbt, x_new); + } + + rbt->root->color = HAWK_RBT_BLACK; + rbt->size++; + return x_new; +} + + +static void adjust_for_delete (hawk_rbt_t* rbt, hawk_rbt_pair_t* pair, hawk_rbt_pair_t* par) +{ + while (pair != rbt->root && pair->color == HAWK_RBT_BLACK) + { + hawk_rbt_pair_t* tmp; + + if (pair == par->left) + { + tmp = par->right; + if (tmp->color == HAWK_RBT_RED) + { + tmp->color = HAWK_RBT_BLACK; + par->color = HAWK_RBT_RED; + rotate_left (rbt, par); + tmp = par->right; + } + + if (tmp->left->color == HAWK_RBT_BLACK && + tmp->right->color == HAWK_RBT_BLACK) + { + if (!IS_NIL(rbt,tmp)) tmp->color = HAWK_RBT_RED; + pair = par; + par = pair->parent; + } + else + { + if (tmp->right->color == HAWK_RBT_BLACK) + { + if (!IS_NIL(rbt,tmp->left)) + tmp->left->color = HAWK_RBT_BLACK; + tmp->color = HAWK_RBT_RED; + rotate_right (rbt, tmp); + tmp = par->right; + } + + tmp->color = par->color; + if (!IS_NIL(rbt,par)) par->color = HAWK_RBT_BLACK; + if (tmp->right->color == HAWK_RBT_RED) + tmp->right->color = HAWK_RBT_BLACK; + + rotate_left (rbt, par); + pair = rbt->root; + } + } + else + { + HAWK_ASSERT (rbt->hawk, pair == par->right); + tmp = par->left; + if (tmp->color == HAWK_RBT_RED) + { + tmp->color = HAWK_RBT_BLACK; + par->color = HAWK_RBT_RED; + rotate_right (rbt, par); + tmp = par->left; + } + + if (tmp->left->color == HAWK_RBT_BLACK && + tmp->right->color == HAWK_RBT_BLACK) + { + if (!IS_NIL(rbt,tmp)) tmp->color = HAWK_RBT_RED; + pair = par; + par = pair->parent; + } + else + { + if (tmp->left->color == HAWK_RBT_BLACK) + { + if (!IS_NIL(rbt,tmp->right)) + tmp->right->color = HAWK_RBT_BLACK; + tmp->color = HAWK_RBT_RED; + rotate_left (rbt, tmp); + tmp = par->left; + } + tmp->color = par->color; + if (!IS_NIL(rbt,par)) par->color = HAWK_RBT_BLACK; + if (tmp->left->color == HAWK_RBT_RED) + tmp->left->color = HAWK_RBT_BLACK; + + rotate_right (rbt, par); + pair = rbt->root; + } + } + } + + pair->color = HAWK_RBT_BLACK; +} + +static void delete_pair (hawk_rbt_t* rbt, hawk_rbt_pair_t* pair) +{ + hawk_rbt_pair_t* x, * y, * par; + + HAWK_ASSERT (rbt->hawk, pair && !IS_NIL(rbt,pair)); + + if (IS_NIL(rbt,pair->left) || IS_NIL(rbt,pair->right)) + { + y = pair; + } + else + { + /* find a successor with NIL as a child */ + y = pair->right; + while (!IS_NIL(rbt,y->left)) y = y->left; + } + + x = IS_NIL(rbt,y->left)? y->right: y->left; + + par = y->parent; + if (!IS_NIL(rbt,x)) x->parent = par; + + if (par) + { + if (y == par->left) + par->left = x; + else + par->right = x; + } + else + { + rbt->root = x; + } + + if (y == pair) + { + if (y->color == HAWK_RBT_BLACK && !IS_NIL(rbt,x)) + adjust_for_delete (rbt, x, par); + + hawk_rbt_freepair (rbt, y); + } + else + { + if (y->color == HAWK_RBT_BLACK && !IS_NIL(rbt,x)) + adjust_for_delete (rbt, x, par); + +#if 1 + if (pair->parent) + { + if (pair->parent->left == pair) pair->parent->left = y; + if (pair->parent->right == pair) pair->parent->right = y; + } + else + { + rbt->root = y; + } + + y->parent = pair->parent; + y->left = pair->left; + y->right = pair->right; + y->color = pair->color; + + if (pair->left->parent == pair) pair->left->parent = y; + if (pair->right->parent == pair) pair->right->parent = y; +#else + *y = *pair; + if (y->parent) + { + if (y->parent->left == pair) y->parent->left = y; + if (y->parent->right == pair) y->parent->right = y; + } + else + { + rbt->root = y; + } + + if (y->left->parent == pair) y->left->parent = y; + if (y->right->parent == pair) y->right->parent = y; +#endif + + hawk_rbt_freepair (rbt, pair); + } + + rbt->size--; +} + +int hawk_rbt_delete (hawk_rbt_t* rbt, const void* kptr, hawk_oow_t klen) +{ + hawk_rbt_pair_t* pair; + + pair = hawk_rbt_search (rbt, kptr, klen); + if (pair == HAWK_NULL) return -1; + + delete_pair (rbt, pair); + return 0; +} + +void hawk_rbt_clear (hawk_rbt_t* rbt) +{ + /* TODO: improve this */ + while (!IS_NIL(rbt,rbt->root)) delete_pair (rbt, rbt->root); +} + +#if 0 +static HAWK_INLINE hawk_rbt_walk_t walk_recursively ( + hawk_rbt_t* rbt, walker_t walker, void* ctx, hawk_rbt_pair_t* pair) +{ + if (!IS_NIL(rbt,pair->left)) + { + if (walk_recursively (rbt, walker, ctx, pair->left) == HAWK_RBT_WALK_STOP) + return HAWK_RBT_WALK_STOP; + } + + if (walker (rbt, pair, ctx) == HAWK_RBT_WALK_STOP) return HAWK_RBT_WALK_STOP; + + if (!IS_NIL(rbt,pair->right)) + { + if (walk_recursively (rbt, walker, ctx, pair->right) == HAWK_RBT_WALK_STOP) + return HAWK_RBT_WALK_STOP; + } + + return HAWK_RBT_WALK_FORWARD; +} +#endif + +static HAWK_INLINE void walk (hawk_rbt_t* rbt, walker_t walker, void* ctx, int l, int r) +{ + hawk_rbt_pair_t* x_cur = rbt->root; + hawk_rbt_pair_t* prev = rbt->root->parent; + + while (x_cur && !IS_NIL(rbt,x_cur)) + { + if (prev == x_cur->parent) + { + /* the previous node is the parent of the current node. + * it indicates that we're going down to the child[l] */ + if (!IS_NIL(rbt,x_cur->child[l])) + { + /* go to the child[l] child */ + prev = x_cur; + x_cur = x_cur->child[l]; + } + else + { + if (walker (rbt, x_cur, ctx) == HAWK_RBT_WALK_STOP) break; + + if (!IS_NIL(rbt,x_cur->child[r])) + { + /* go down to the right node if exists */ + prev = x_cur; + x_cur = x_cur->child[r]; + } + else + { + /* otherwise, move up to the parent */ + prev = x_cur; + x_cur = x_cur->parent; + } + } + } + else if (prev == x_cur->child[l]) + { + /* the left child has been already traversed */ + + if (walker (rbt, x_cur, ctx) == HAWK_RBT_WALK_STOP) break; + + if (!IS_NIL(rbt,x_cur->child[r])) + { + /* go down to the right node if it exists */ + prev = x_cur; + x_cur = x_cur->child[r]; + } + else + { + /* otherwise, move up to the parent */ + prev = x_cur; + x_cur = x_cur->parent; + } + } + else + { + /* both the left child and the right child have been traversed */ + HAWK_ASSERT (rbt->hawk, prev == x_cur->child[r]); + /* just move up to the parent */ + prev = x_cur; + x_cur = x_cur->parent; + } + } +} + +void hawk_rbt_walk (hawk_rbt_t* rbt, walker_t walker, void* ctx) +{ + walk (rbt, walker, ctx, LEFT, RIGHT); +} + +void hawk_rbt_rwalk (hawk_rbt_t* rbt, walker_t walker, void* ctx) +{ + walk (rbt, walker, ctx, RIGHT, LEFT); +} + +int hawk_rbt_dflcomp (const hawk_rbt_t* rbt, const void* kptr1, hawk_oow_t klen1, const void* kptr2, hawk_oow_t klen2) +{ + hawk_oow_t min; + int n, nn; + + if (klen1 < klen2) + { + min = klen1; + nn = -1; + } + else + { + min = klen2; + nn = (klen1 == klen2)? 0: 1; + } + + n = HAWK_MEMCMP(kptr1, kptr2, KTOB(rbt,min)); + if (n == 0) n = nn; + return n; +} + diff --git a/hawk/lib/rec.c b/hawk/lib/rec.c new file mode 100644 index 00000000..e563f707 --- /dev/null +++ b/hawk/lib/rec.c @@ -0,0 +1,509 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "hawk-prv.h" + +static int split_record (hawk_rtx_t* run); +static int recomp_record_fields (hawk_rtx_t* run, hawk_oow_t lv, const hawk_oocs_t* str); + +int hawk_rtx_setrec (hawk_rtx_t* rtx, hawk_oow_t idx, const hawk_oocs_t* str) +{ + hawk_val_t* v; + + if (idx == 0) + { + if (str->ptr == HAWK_OOECS_PTR(&rtx->inrec.line) && + str->len == HAWK_OOECS_LEN(&rtx->inrec.line)) + { + if (hawk_rtx_clrrec(rtx, 1) <= -1) return -1; + } + else + { + if (hawk_rtx_clrrec(rtx, 0) <= -1) return -1; + + if (hawk_ooecs_ncpy(&rtx->inrec.line, str->ptr, str->len) == (hawk_oow_t)-1) + { + hawk_rtx_clrrec (rtx, 0); + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + } + + v = hawk_rtx_makenstrvalwithoocs(rtx, str); + if (v == HAWK_NULL) + { + hawk_rtx_clrrec (rtx, 0); + return -1; + } + + HAWK_ASSERT (hawk_rtx_getawk(rtx), HAWK_RTX_GETVALTYPE (rtx, rtx->inrec.d0) == HAWK_VAL_NIL); + /* d0 should be cleared before the next line is reached + * as it doesn't call hawk_rtx_refdownval on rtx->inrec.d0 */ + rtx->inrec.d0 = v; + hawk_rtx_refupval (rtx, v); + + if (split_record(rtx) <= -1) + { + hawk_rtx_clrrec (rtx, 0); + return -1; + } + } + else + { + if (recomp_record_fields(rtx, idx, str) <= -1) + { + hawk_rtx_clrrec (rtx, 0); + return -1; + } + + /* recompose $0 */ + v = hawk_rtx_makestrvalwithoocs (rtx, HAWK_OOECS_OOCS(&rtx->inrec.line)); + if (v == HAWK_NULL) + { + hawk_rtx_clrrec (rtx, 0); + return -1; + } + + hawk_rtx_refdownval (rtx, rtx->inrec.d0); + rtx->inrec.d0 = v; + hawk_rtx_refupval (rtx, v); + } + + return 0; +} + +static int split_record (hawk_rtx_t* rtx) +{ + hawk_oocs_t tok; + hawk_ooch_t* p, * px; + hawk_oow_t len, nflds; + hawk_val_t* v, * fs; + hawk_val_type_t fsvtype; + hawk_ooch_t* fs_ptr, * fs_free; + hawk_oow_t fs_len; + hawk_errnum_t errnum; + int how; + + + /* inrec should be cleared before split_record is called */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), rtx->inrec.nflds == 0); + + /* get FS */ + fs = hawk_rtx_getgbl (rtx, HAWK_GBL_FS); + fsvtype = HAWK_RTX_GETVALTYPE (rtx, fs); + if (fsvtype == HAWK_VAL_NIL) + { + fs_ptr = HAWK_T(" "); + fs_len = 1; + fs_free = HAWK_NULL; + } + else if (fsvtype == HAWK_VAL_STR) + { + fs_ptr = ((hawk_val_str_t*)fs)->val.ptr; + fs_len = ((hawk_val_str_t*)fs)->val.len; + fs_free = HAWK_NULL; + } + else + { + fs_ptr = hawk_rtx_valtooocstrdup(rtx, fs, &fs_len); + if (fs_ptr == HAWK_NULL) return -1; + fs_free = fs_ptr; + } + + /* scan the input record to count the fields */ + if (fs_len == 5 && fs_ptr[0] == HAWK_T('?')) + { + if (hawk_ooecs_ncpy ( + &rtx->inrec.linew, + HAWK_OOECS_PTR(&rtx->inrec.line), + HAWK_OOECS_LEN(&rtx->inrec.line)) == (hawk_oow_t)-1) + { + if (fs_free != HAWK_NULL) + hawk_rtx_freemem (rtx, fs_free); + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + + px = HAWK_OOECS_PTR(&rtx->inrec.linew); + how = 1; + } + else + { + px = HAWK_OOECS_PTR(&rtx->inrec.line); + how = (fs_len <= 1)? 0: 2; + } + + p = px; + len = HAWK_OOECS_LEN(&rtx->inrec.line); + +#if 0 + nflds = 0; + while (p != HAWK_NULL) + { + switch (how) + { + case 0: + p = hawk_rtx_strxntok (rtx, + p, len, fs_ptr, fs_len, &tok); + break; + + case 1: + break; + + default: + p = hawk_rtx_strxntokbyrex ( + rtx, + HAWK_OOECS_PTR(&rtx->inrec.line), + HAWK_OOECS_LEN(&rtx->inrec.line), + p, len, + rtx->gbl.fs[rtx->gbl.ignorecase], &tok, &errnum + ); + if (p == HAWK_NULL && errnum != HAWK_ENOERR) + { + if (fs_free != HAWK_NULL) + hawk_rtx_freemem (rtx, fs_free); + hawk_rtx_seterrnum (rtx, errnum, HAWK_NULL); + return -1; + } + } + + if (nflds == 0 && p == HAWK_NULL && tok.len == 0) + { + /* there are no fields. it can just return here + * as hawk_rtx_clrrec has been called before this */ + if (fs_free) hawk_rtx_freemem (rtx, fs_free); + return 0; + } + + HAWK_ASSERT (hawk_rtx_getawk(rtx), (tok.ptr != HAWK_NULL && tok.len > 0) || tok.len == 0); + + nflds++; + len = HAWK_OOECS_LEN(&rtx->inrec.line) - (p - HAWK_OOECS_PTR(&rtx->inrec.line)); + } + + /* allocate space */ + if (nflds > rtx->inrec.maxflds) + { + void* tmp = hawk_rtx_allocmem(rtx, HAWK_SIZEOF(*rtx->inrec.flds) * nflds); + if (!tmp) + { + if (fs_free) hawk_rtx_freemem (rtx, fs_free); + return -1; + } + + if (rtx->inrec.flds) hawk_rtx_freemem (rtx, rtx->inrec.flds); + rtx->inrec.flds = tmp; + rtx->inrec.maxflds = nflds; + } + + /* scan again and split it */ + if (how == 1) + { + if (hawk_ooecs_ncpy ( + &rtx->inrec.linew, + HAWK_OOECS_PTR(&rtx->inrec.line), + HAWK_OOECS_LEN(&rtx->inrec.line)) == (hawk_oow_t)-1) + { + if (fs_free) hawk_rtx_freemem (rtx, fs_free); + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + px = HAWK_OOECS_PTR(&rtx->inrec.linew): + } + else + { + px = HAWK_OOECS_PTR(&rtx->inrec.line); + } + + p = px; + len = HAWK_OOECS_LEN(&rtx->inrec.line); +#endif + + while (p != HAWK_NULL) + { + switch (how) + { + case 0: + /* 1 character FS */ + p = hawk_rtx_strxntok ( + rtx, p, len, fs_ptr, fs_len, &tok); + break; + + case 1: + /* 5 character FS beginning with ? */ + p = hawk_rtx_strxnfld ( + rtx, p, len, + fs_ptr[1], fs_ptr[2], + fs_ptr[3], fs_ptr[4], &tok); + break; + + default: + /* all other cases */ + p = hawk_rtx_strxntokbyrex ( + rtx, + HAWK_OOECS_PTR(&rtx->inrec.line), + HAWK_OOECS_LEN(&rtx->inrec.line), + p, len, + rtx->gbl.fs[rtx->gbl.ignorecase], &tok, &errnum + ); + if (p == HAWK_NULL && errnum != HAWK_ENOERR) + { + if (fs_free != HAWK_NULL) + hawk_rtx_freemem (rtx, fs_free); + hawk_rtx_seterrnum (rtx, errnum, HAWK_NULL); + return -1; + } + } + +#if 1 + if (rtx->inrec.nflds == 0 && p == HAWK_NULL && tok.len == 0) + { + /* there are no fields. it can just return here + * as hawk_rtx_clrrec has been called before this */ + if (fs_free) hawk_rtx_freemem (rtx, fs_free); + return 0; + } +#endif + + HAWK_ASSERT (hawk_rtx_getawk(rtx), (tok.ptr != HAWK_NULL && tok.len > 0) || tok.len == 0); + +#if 1 + if (rtx->inrec.nflds >= rtx->inrec.maxflds) + { + void* tmp; + + if (rtx->inrec.nflds < 16) nflds = 32; + else nflds = rtx->inrec.nflds * 2; + + tmp = hawk_rtx_allocmem(rtx, HAWK_SIZEOF(*rtx->inrec.flds) * nflds); + if (tmp == HAWK_NULL) + { + if (fs_free) hawk_rtx_freemem (rtx, fs_free); + return -1; + } + + if (rtx->inrec.flds != HAWK_NULL) + { + HAWK_MEMCPY (tmp, rtx->inrec.flds, HAWK_SIZEOF(*rtx->inrec.flds) * rtx->inrec.nflds); + hawk_rtx_freemem (rtx, rtx->inrec.flds); + } + + rtx->inrec.flds = tmp; + rtx->inrec.maxflds = nflds; + } +#endif + + rtx->inrec.flds[rtx->inrec.nflds].ptr = tok.ptr; + rtx->inrec.flds[rtx->inrec.nflds].len = tok.len; + rtx->inrec.flds[rtx->inrec.nflds].val = hawk_rtx_makenstrvalwithoocs (rtx, &tok); + + if (rtx->inrec.flds[rtx->inrec.nflds].val == HAWK_NULL) + { + if (fs_free) hawk_rtx_freemem (rtx, fs_free); + return -1; + } + + hawk_rtx_refupval (rtx, rtx->inrec.flds[rtx->inrec.nflds].val); + rtx->inrec.nflds++; + + len = HAWK_OOECS_LEN(&rtx->inrec.line) - (p - px); + } + + if (fs_free) hawk_rtx_freemem (rtx, fs_free); + + /* set the number of fields */ + v = hawk_rtx_makeintval(rtx, (hawk_int_t)rtx->inrec.nflds); + if (v == HAWK_NULL) return -1; + + hawk_rtx_refupval (rtx, v); + if (hawk_rtx_setgbl(rtx, HAWK_GBL_NF, v) == -1) + { + hawk_rtx_refdownval (rtx, v); + return -1; + } + hawk_rtx_refdownval (rtx, v); + return 0; +} + +int hawk_rtx_clrrec (hawk_rtx_t* run, int skip_inrec_line) +{ + hawk_oow_t i; + int n = 0; + + if (run->inrec.d0 != hawk_val_nil) + { + hawk_rtx_refdownval (run, run->inrec.d0); + run->inrec.d0 = hawk_val_nil; + } + + if (run->inrec.nflds > 0) + { + HAWK_ASSERT (hawk_rtx_getawk(rtx), run->inrec.flds != HAWK_NULL); + + for (i = 0; i < run->inrec.nflds; i++) + { + HAWK_ASSERT (hawk_rtx_getawk(rtx), run->inrec.flds[i].val != HAWK_NULL); + hawk_rtx_refdownval (run, run->inrec.flds[i].val); + } + run->inrec.nflds = 0; + + if (hawk_rtx_setgbl ( + run, HAWK_GBL_NF, HAWK_VAL_ZERO) == -1) + { + /* first of all, this should never happen. + * if it happened, it would return an error + * after all the clearance tasks */ + n = -1; + } + } + + HAWK_ASSERT (hawk_rtx_getawk(rtx), run->inrec.nflds == 0); + if (!skip_inrec_line) hawk_ooecs_clear (&run->inrec.line); + + return n; +} + +static int recomp_record_fields (hawk_rtx_t* rtx, hawk_oow_t lv, const hawk_oocs_t* str) +{ + hawk_val_t* v; + hawk_oow_t max, i, nflds; + + /* recomposes the record and the fields when $N has been assigned + * a new value and recomputes NF accordingly */ + + HAWK_ASSERT (hawk_rtx_getawk(rtx), lv > 0); + max = (lv > rtx->inrec.nflds)? lv: rtx->inrec.nflds; + + nflds = rtx->inrec.nflds; + if (max > rtx->inrec.maxflds) + { + void* tmp; + + /* if the given field number is greater than the maximum + * number of fields that the current record can hold, + * the field spaces are resized */ + + tmp = hawk_rtx_reallocmem(rtx, rtx->inrec.flds, HAWK_SIZEOF(*rtx->inrec.flds) * max); + if (!tmp) return -1; + + rtx->inrec.flds = tmp; + rtx->inrec.maxflds = max; + } + + lv = lv - 1; /* adjust the value to 0-based index */ + + hawk_ooecs_clear (&rtx->inrec.line); + + for (i = 0; i < max; i++) + { + if (i > 0) + { + if (hawk_ooecs_ncat(&rtx->inrec.line, rtx->gbl.ofs.ptr, rtx->gbl.ofs.len) == (hawk_oow_t)-1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + } + + if (i == lv) + { + hawk_val_t* tmp; + + rtx->inrec.flds[i].ptr = HAWK_OOECS_PTR(&rtx->inrec.line) + HAWK_OOECS_LEN(&rtx->inrec.line); + rtx->inrec.flds[i].len = str->len; + + if (hawk_ooecs_ncat(&rtx->inrec.line, str->ptr, str->len) == (hawk_oow_t)-1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + + tmp = hawk_rtx_makestrvalwithoocs (rtx, str); + if (tmp == HAWK_NULL) return -1; + + if (i < nflds) + hawk_rtx_refdownval (rtx, rtx->inrec.flds[i].val); + else rtx->inrec.nflds++; + + rtx->inrec.flds[i].val = tmp; + hawk_rtx_refupval (rtx, tmp); + } + else if (i >= nflds) + { + rtx->inrec.flds[i].ptr = HAWK_OOECS_PTR(&rtx->inrec.line) + HAWK_OOECS_LEN(&rtx->inrec.line); + rtx->inrec.flds[i].len = 0; + + if (hawk_ooecs_cat(&rtx->inrec.line, HAWK_T("")) == (hawk_oow_t)-1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + + /* hawk_rtx_refdownval should not be called over + * rtx->inrec.flds[i].val as it is not initialized + * to any valid values */ + /*hawk_rtx_refdownval (rtx, rtx->inrec.flds[i].val);*/ + rtx->inrec.flds[i].val = hawk_val_zls; + hawk_rtx_refupval (rtx, hawk_val_zls); + rtx->inrec.nflds++; + } + else + { + hawk_val_str_t* tmp; + + tmp = (hawk_val_str_t*)rtx->inrec.flds[i].val; + + rtx->inrec.flds[i].ptr = HAWK_OOECS_PTR(&rtx->inrec.line) + HAWK_OOECS_LEN(&rtx->inrec.line); + rtx->inrec.flds[i].len = tmp->val.len; + + if (hawk_ooecs_ncat(&rtx->inrec.line, tmp->val.ptr, tmp->val.len) == (hawk_oow_t)-1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + } + } + + v = hawk_rtx_getgbl (rtx, HAWK_GBL_NF); + HAWK_ASSERT (hawk_rtx_getawk(rtx), HAWK_RTX_GETVALTYPE (rtx, v) == HAWK_VAL_INT); + + if (HAWK_RTX_GETINTFROMVAL (rtx, v)!= max) + { + v = hawk_rtx_makeintval (rtx, (hawk_int_t)max); + if (v == HAWK_NULL) return -1; + + hawk_rtx_refupval (rtx, v); + if (hawk_rtx_setgbl (rtx, HAWK_GBL_NF, v) == -1) + { + hawk_rtx_refdownval (rtx, v); + return -1; + } + hawk_rtx_refdownval (rtx, v); + } + + return 0; +} + diff --git a/hawk/lib/rio-prv.h b/hawk/lib/rio-prv.h new file mode 100644 index 00000000..43f99b24 --- /dev/null +++ b/hawk/lib/rio-prv.h @@ -0,0 +1,71 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_RIO_PRV_H_ +#define _HAWK_RIO_PRV_H_ + +#if defined(__cplusplus) +extern "C" { +#endif + +int hawk_rtx_readio ( + hawk_rtx_t* run, int in_type, + const hawk_ooch_t* name, hawk_ooecs_t* buf); + +int hawk_rtx_writeioval ( + hawk_rtx_t* run, int out_type, + const hawk_ooch_t* name, hawk_val_t* v); + +int hawk_rtx_writeiostr ( + hawk_rtx_t* run, int out_type, + const hawk_ooch_t* name, hawk_ooch_t* str, hawk_oow_t len); + +int hawk_rtx_writeiobytes ( + hawk_rtx_t* run, int out_type, + const hawk_ooch_t* name, hawk_bch_t* str, hawk_oow_t len); + +int hawk_rtx_flushio ( + hawk_rtx_t* run, int out_type, const hawk_ooch_t* name); + +int hawk_rtx_nextio_read ( + hawk_rtx_t* run, int in_type, const hawk_ooch_t* name); + +int hawk_rtx_nextio_write ( + hawk_rtx_t* run, int out_type, const hawk_ooch_t* name); + +int hawk_rtx_closeio ( + hawk_rtx_t* run, + const hawk_ooch_t* name, + const hawk_ooch_t* opt +); + +void hawk_rtx_cleario (hawk_rtx_t* run); + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/hawk/lib/rio.c b/hawk/lib/rio.c new file mode 100644 index 00000000..3aca6af7 --- /dev/null +++ b/hawk/lib/rio.c @@ -0,0 +1,1243 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "hawk-prv.h" + +enum io_mask_t +{ + IO_MASK_READ = 0x0100, + IO_MASK_WRITE = 0x0200, + IO_MASK_RDWR = 0x0400, + IO_MASK_CLEAR = 0x00FF +}; + +static int in_type_map[] = +{ + /* the order should match the order of the + * HAWK_IN_XXX values in tree.h */ + HAWK_RIO_PIPE, + HAWK_RIO_PIPE, + HAWK_RIO_FILE, + HAWK_RIO_CONSOLE +}; + +static int in_mode_map[] = +{ + /* the order should match the order of the + * HAWK_IN_XXX values in tree.h */ + HAWK_RIO_PIPE_READ, + HAWK_RIO_PIPE_RW, + HAWK_RIO_FILE_READ, + HAWK_RIO_CONSOLE_READ +}; + +static int in_mask_map[] = +{ + IO_MASK_READ, + IO_MASK_RDWR, + IO_MASK_READ, + IO_MASK_READ +}; + +static int out_type_map[] = +{ + /* the order should match the order of the + * HAWK_OUT_XXX values in tree.h */ + HAWK_RIO_PIPE, + HAWK_RIO_PIPE, + HAWK_RIO_FILE, + HAWK_RIO_FILE, + HAWK_RIO_CONSOLE +}; + +static int out_mode_map[] = +{ + /* the order should match the order of the + * HAWK_OUT_XXX values in tree.h */ + HAWK_RIO_PIPE_WRITE, + HAWK_RIO_PIPE_RW, + HAWK_RIO_FILE_WRITE, + HAWK_RIO_FILE_APPEND, + HAWK_RIO_CONSOLE_WRITE +}; + +static int out_mask_map[] = +{ + IO_MASK_WRITE, + IO_MASK_RDWR, + IO_MASK_WRITE, + IO_MASK_WRITE, + IO_MASK_WRITE +}; + +static int find_rio_in ( + hawk_rtx_t* rtx, int in_type, const hawk_ooch_t* name, + hawk_rio_arg_t** rio, hawk_rio_impl_t* fun) +{ + hawk_rio_arg_t* p = rtx->rio.chain; + hawk_rio_impl_t handler; + int io_type, io_mode, io_mask; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), in_type >= 0 && in_type <= HAWK_COUNTOF(in_type_map)); + HAWK_ASSERT (hawk_rtx_getawk(rtx), in_type >= 0 && in_type <= HAWK_COUNTOF(in_mode_map)); + HAWK_ASSERT (hawk_rtx_getawk(rtx), in_type >= 0 && in_type <= HAWK_COUNTOF(in_mask_map)); + + /* translate the in_type into the relevant io type and mode */ + io_type = in_type_map[in_type]; + io_mode = in_mode_map[in_type]; + io_mask = in_mask_map[in_type]; + + /* get the I/O handler provided by a user */ + handler = rtx->rio.handler[io_type]; + if (handler == HAWK_NULL) + { + /* no I/O handler provided */ + hawk_rtx_seterrnum (rtx, HAWK_EIOUSER, HAWK_NULL); + return -1; + } + + /* search the chain for exiting an existing io name */ + while (p) + { + if (p->type == (io_type | io_mask) && + hawk_comp_oocstr(p->name, name, 0) == 0) break; + p = p->next; + } + + if (p == HAWK_NULL) + { + hawk_ooi_t x; + + /* if the name doesn't exist in the chain, create an entry + * to the chain */ + p = (hawk_rio_arg_t*)hawk_rtx_allocmem(rtx, HAWK_SIZEOF(hawk_rio_arg_t)); + if (p == HAWK_NULL) return -1; + + HAWK_MEMSET (p, 0, HAWK_SIZEOF(*p)); + + p->name = hawk_rtx_dupoocstr(rtx, name, HAWK_NULL); + if (p->name == HAWK_NULL) + { + hawk_rtx_freemem (rtx, p); + return -1; + } + + p->type = (io_type | io_mask); + p->mode = io_mode; + p->rwcmode = HAWK_RIO_CMD_CLOSE_FULL; + /* + p->handle = HAWK_NULL; + p->next = HAWK_NULL; + p->rwcstate = 0; + + p->in.buf[0] = HAWK_T('\0'); + p->in.pos = 0; + p->in.len = 0; + p->in.eof = 0; + p->in.eos = 0; + */ + + hawk_rtx_seterrnum (rtx, HAWK_ENOERR, HAWK_NULL); + + /* request to open the stream */ + x = handler(rtx, HAWK_RIO_CMD_OPEN, p, HAWK_NULL, 0); + if (x <= -1) + { + hawk_rtx_freemem (rtx, p->name); + hawk_rtx_freemem (rtx, p); + + if (hawk_rtx_geterrnum(rtx) == HAWK_ENOERR) + { + /* if the error number has not been + * set by the user handler */ + hawk_rtx_seterrnum (rtx, HAWK_EIOIMPL, HAWK_NULL); + } + + return -1; + } + + /* chain it */ + p->next = rtx->rio.chain; + rtx->rio.chain = p; + } + + *rio = p; + *fun = handler; + + return 0; +} + +static HAWK_INLINE int resolve_rs (hawk_rtx_t* rtx, hawk_val_t* rs, hawk_oocs_t* rrs) +{ + int ret = 0; + hawk_val_type_t rs_vtype; + + + rs_vtype = HAWK_RTX_GETVALTYPE (rtx, rs); + + switch (rs_vtype) + { + case HAWK_VAL_NIL: + rrs->ptr = HAWK_NULL; + rrs->len = 0; + break; + + case HAWK_VAL_STR: + rrs->ptr = ((hawk_val_str_t*)rs)->val.ptr; + rrs->len = ((hawk_val_str_t*)rs)->val.len; + break; + + default: + rrs->ptr = hawk_rtx_valtooocstrdup (rtx, rs, &rrs->len); + if (rrs->ptr == HAWK_NULL) ret = -1; + break; + } + + return ret; +} + +static HAWK_INLINE int match_long_rs (hawk_rtx_t* run, hawk_ooecs_t* buf, hawk_rio_arg_t* p) +{ + hawk_oocs_t match; + hawk_errnum_t errnum; + int ret; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), run->gbl.rs[0] != HAWK_NULL); + HAWK_ASSERT (hawk_rtx_getawk(rtx), run->gbl.rs[1] != HAWK_NULL); + + ret = hawk_matchrex ( + run->awk, run->gbl.rs[run->gbl.ignorecase], + run->gbl.ignorecase, HAWK_OOECS_OOCS(buf), HAWK_OOECS_OOCS(buf), + &match, HAWK_NULL, &errnum); + if (ret <= -1) + { + hawk_rtx_seterrnum (run, errnum, HAWK_NULL); + } + else if (ret >= 1) + { + if (p->in.eof) + { + /* when EOF is reached, the record buffer + * is not added with a new character. It's + * just called again with the same record buffer + * as the previous call to this function. + * A match in this case must end at the end of + * the current record buffer */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), + HAWK_OOECS_PTR(buf) + HAWK_OOECS_LEN(buf) == + match.ptr + match.len + ); + + /* drop the RS part. no extra character after RS to drop + * because we're at EOF and the EOF condition didn't + * add a new character to the buffer before the call + * to this function. + */ + HAWK_OOECS_LEN(buf) -= match.len; + } + else + { + /* If the match is found before the end of the current buffer, + * I see it as the longest match. A match ending at the end + * of the buffer is not indeterministic as we don't have the + * full input yet. + */ + const hawk_ooch_t* be = HAWK_OOECS_PTR(buf) + HAWK_OOECS_LEN(buf); + const hawk_ooch_t* me = match.ptr + match.len; + + if (me < be) + { + /* the match ends before the ending boundary. + * it must be the longest match. drop the RS part + * and the characters after RS. */ + HAWK_OOECS_LEN(buf) -= match.len + (be - me); + p->in.pos -= (be - me); + } + else + { + /* the match is at the ending boundary. switch to no match */ + ret = 0; + } + } + } + + return ret; +} + +int hawk_rtx_readio (hawk_rtx_t* rtx, int in_type, const hawk_ooch_t* name, hawk_ooecs_t* buf) +{ + hawk_rio_arg_t* p; + hawk_rio_impl_t handler; + int ret; + + hawk_val_t* rs; + hawk_oocs_t rrs; + + hawk_oow_t line_len = 0; + hawk_ooch_t c = HAWK_T('\0'), pc; + + if (find_rio_in(rtx, in_type, name, &p, &handler) <= -1) return -1; + if (p->in.eos) return 0; /* no more streams left */ + + /* ready to read a record(typically a line). clear the buffer. */ + hawk_ooecs_clear (buf); + + /* get the record separator */ + rs = hawk_rtx_getgbl(rtx, HAWK_GBL_RS); + hawk_rtx_refupval (rtx, rs); + + if (resolve_rs(rtx, rs, &rrs) <= -1) + { + hawk_rtx_refdownval (rtx, rs); + return -1; + } + + ret = 1; + + /* call the I/O handler */ + while (1) + { + if (p->in.pos >= p->in.len) + { + hawk_ooi_t x; + + /* no more data in the read buffer. + * let the I/O handler read more */ + + if (p->in.eof) + { + /* it has reached EOF at the previous call. */ + if (HAWK_OOECS_LEN(buf) == 0) + { + /* we return EOF if the record buffer is empty */ + ret = 0; + } + break; + } + + hawk_rtx_seterrnum (rtx, HAWK_ENOERR, HAWK_NULL); + x = handler(rtx, HAWK_RIO_CMD_READ, p, p->in.buf, HAWK_COUNTOF(p->in.buf)); + if (x <= -1) + { + if (hawk_rtx_geterrnum(rtx) == HAWK_ENOERR) + { + /* if the error number has not been + * set by the user handler, we set + * it here to HAWK_EIOIMPL. */ + hawk_rtx_seterrnum (rtx, HAWK_EIOIMPL, HAWK_NULL); + } + + ret = -1; + break; + } + + if (x == 0) + { + /* EOF reached */ + p->in.eof = 1; + + if (HAWK_OOECS_LEN(buf) == 0) + { + /* We can return EOF now if the record buffer + * is empty */ + ret = 0; + } + else if (rrs.ptr && rrs.len == 0) + { + /* TODO: handle different line terminator */ + /* drop the line terminator from the record + * if RS is a blank line and EOF is reached. */ + if (HAWK_OOECS_LASTCHAR(buf) == HAWK_T('\n')) + { + HAWK_OOECS_LEN(buf) -= 1; + if (rtx->awk->opt.trait & HAWK_CRLF) + { + /* drop preceding CR */ + if (HAWK_OOECS_LEN(buf) > 0 && HAWK_OOECS_LASTCHAR(buf) == HAWK_T('\r')) HAWK_OOECS_LEN(buf) -= 1; + } + } + } + else if (rrs.len >= 2) + { + /* When RS is multiple characters, it should + * check for the match at the end of the + * input stream also because the previous + * match could fail as it didn't end at the + * desired position to be the longest match. + * At EOF, the match at the end is considered + * the longest as there are no more characters + * left */ + int n = match_long_rs(rtx, buf, p); + if (n != 0) + { + if (n <= -1) ret = -1; + break; + } + } + + break; + } + + p->in.len = x; + p->in.pos = 0; + } + + if (rrs.ptr == HAWK_NULL) + { + hawk_oow_t start_pos = p->in.pos; + hawk_oow_t end_pos, tmp; + + do + { + pc = c; + c = p->in.buf[p->in.pos++]; + end_pos = p->in.pos; + + /* TODO: handle different line terminator */ + /* separate by a new line */ + if (c == HAWK_T('\n')) + { + end_pos--; + if (pc == HAWK_T('\r')) + { + if (end_pos > start_pos) + { + /* CR is the part of the read buffer. + * decrementing the end_pos variable can + * simply drop it */ + end_pos--; + } + else + { + /* CR must have come from the previous + * read. drop CR that must be found at + * the end of the record buffer. */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), end_pos == start_pos); + HAWK_ASSERT (hawk_rtx_getawk(rtx), HAWK_OOECS_LEN(buf) > 0); + HAWK_ASSERT (hawk_rtx_getawk(rtx), HAWK_OOECS_LASTCHAR(buf) == HAWK_T('\r')); + HAWK_OOECS_LEN(buf)--; + } + } + break; + } + } + while (p->in.pos < p->in.len); + + tmp = hawk_ooecs_ncat(buf, &p->in.buf[start_pos], end_pos - start_pos); + if (tmp == (hawk_oow_t)-1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + ret = -1; + break; + } + + if (end_pos < p->in.len) break; /* RS found */ + } + else if (rrs.len == 0) + { + int done = 0; + + do + { + pc = c; + c = p->in.buf[p->in.pos++]; + + /* TODO: handle different line terminator */ + /* separate by a blank line */ + if (c == HAWK_T('\n')) + { + if (pc == HAWK_T('\r') && HAWK_OOECS_LEN(buf) > 0) + { + /* shrink the line length and the record + * by dropping of CR before NL */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), line_len > 0); + line_len--; + + /* we don't drop CR from the record buffer + * if we're in CRLF mode. POINT-X */ + if (!(rtx->awk->opt.trait & HAWK_CRLF)) + HAWK_OOECS_LEN(buf) -= 1; + } + + if (line_len == 0) + { + /* we got a blank line */ + + if (rtx->awk->opt.trait & HAWK_CRLF) + { + if (HAWK_OOECS_LEN(buf) > 0 && HAWK_OOECS_LASTCHAR(buf) == HAWK_T('\r')) + { + /* drop CR not dropped in POINT-X above */ + HAWK_OOECS_LEN(buf) -= 1; + } + + if (HAWK_OOECS_LEN(buf) <= 0) + { + /* if the record is empty when a blank + * line is encountered, the line + * terminator should not be added to + * the record */ + continue; + } + + /* drop NL */ + HAWK_OOECS_LEN(buf) -= 1; + + /* drop preceding CR */ + if (HAWK_OOECS_LEN(buf) > 0 && HAWK_OOECS_LASTCHAR(buf) == HAWK_T('\r')) HAWK_OOECS_LEN(buf) -= 1; + } + else + { + if (HAWK_OOECS_LEN(buf) <= 0) + { + /* if the record is empty when a blank + * line is encountered, the line + * terminator should not be added to + * the record */ + continue; + } + + /* drop NL of the previous line */ + HAWK_OOECS_LEN(buf) -= 1; /* simply drop NL */ + } + + done = 1; + break; + } + + line_len = 0; + } + else line_len++; + + if (hawk_ooecs_ccat(buf, c) == (hawk_oow_t)-1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + ret = -1; + done = 1; + break; + } + } + while (p->in.pos < p->in.len); + + if (done) break; + } + else if (rrs.len == 1) + { + hawk_oow_t start_pos = p->in.pos; + hawk_oow_t end_pos, tmp; + + do + { + c = p->in.buf[p->in.pos++]; + end_pos = p->in.pos; + if (c == rrs.ptr[0]) + { + end_pos--; + break; + } + } + while (p->in.pos < p->in.len); + + tmp = hawk_ooecs_ncat(buf, &p->in.buf[start_pos], end_pos - start_pos); + if (tmp == (hawk_oow_t)-1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + ret = -1; + break; + } + + if (end_pos < p->in.len) break; /* RS found */ + } + else + { + hawk_oow_t tmp; + int n; + + /* if RS is composed of multiple characters, + * I perform the matching after having added the + * current character 'c' to the record buffer 'buf' + * to find the longest match. If a match found ends + * one character before this character just added + * to the buffer, it is the longest match. + */ + + tmp = hawk_ooecs_ncat(buf, &p->in.buf[p->in.pos], p->in.len - p->in.pos); + if (tmp == (hawk_oow_t)-1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + ret = -1; + break; + } + + p->in.pos = p->in.len; + + n = match_long_rs(rtx, buf, p); + if (n != 0) + { + if (n <= -1) ret = -1; + break; + } + } + } + + if (rrs.ptr && HAWK_RTX_GETVALTYPE (rtx, rs) != HAWK_VAL_STR) hawk_rtx_freemem (rtx, rrs.ptr); + hawk_rtx_refdownval (rtx, rs); + + return ret; +} + +int hawk_rtx_writeioval (hawk_rtx_t* rtx, int out_type, const hawk_ooch_t* name, hawk_val_t* v) +{ + hawk_val_type_t vtype; + vtype = HAWK_RTX_GETVALTYPE (rtx, v); + + switch (vtype) + { + case HAWK_VAL_STR: + return hawk_rtx_writeiostr(rtx, out_type, name, ((hawk_val_str_t*)v)->val.ptr, ((hawk_val_str_t*)v)->val.len); + + case HAWK_VAL_MBS: + return hawk_rtx_writeiobytes(rtx, out_type, name, ((hawk_val_mbs_t*)v)->val.ptr, ((hawk_val_mbs_t*)v)->val.len); + + default: + { + hawk_rtx_valtostr_out_t out; + int n; + + out.type = HAWK_RTX_VALTOSTR_CPLDUP | HAWK_RTX_VALTOSTR_PRINT; + if (hawk_rtx_valtostr(rtx, v, &out) <= -1) return -1; + n = hawk_rtx_writeiostr(rtx, out_type, name, out.u.cpldup.ptr, out.u.cpldup.len); + hawk_rtx_freemem (rtx, out.u.cpldup.ptr); + return n; + } + } +} + +struct write_io_data_t +{ + hawk_rio_arg_t* p; + hawk_rio_impl_t handler; +}; +typedef struct write_io_data_t write_io_data_t; + +static int prepare_for_write_io_data (hawk_rtx_t* rtx, int out_type, const hawk_ooch_t* name, write_io_data_t* wid) +{ + hawk_rio_arg_t* p = rtx->rio.chain; + hawk_rio_impl_t handler; + int io_type, io_mode, io_mask, n; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), out_type >= 0 && out_type <= HAWK_COUNTOF(out_type_map)); + HAWK_ASSERT (hawk_rtx_getawk(rtx), out_type >= 0 && out_type <= HAWK_COUNTOF(out_mode_map)); + HAWK_ASSERT (hawk_rtx_getawk(rtx), out_type >= 0 && out_type <= HAWK_COUNTOF(out_mask_map)); + + /* translate the out_type into the relevant io type and mode */ + io_type = out_type_map[out_type]; + io_mode = out_mode_map[out_type]; + io_mask = out_mask_map[out_type]; + + handler = rtx->rio.handler[io_type]; + if (handler == HAWK_NULL) + { + /* no I/O handler provided */ + hawk_rtx_seterrnum (rtx, HAWK_EIOUSER, HAWK_NULL); + return -1; + } + + /* look for the corresponding rio for name */ + while (p) + { + /* the file "1.tmp", in the following code snippets, + * would be opened by the first print statement, but not by + * the second print statement. this is because + * both HAWK_OUT_FILE and HAWK_OUT_APFILE are + * translated to HAWK_RIO_FILE and it is used to + * keep track of file handles.. + * + * print "1111" >> "1.tmp" + * print "1111" > "1.tmp" + */ + if (p->type == (io_type | io_mask) && hawk_comp_oocstr(p->name, name, 0) == 0) break; + p = p->next; + } + + /* if there is not corresponding rio for name, create one */ + if (p == HAWK_NULL) + { + p = (hawk_rio_arg_t*)hawk_rtx_allocmem(rtx, HAWK_SIZEOF(hawk_rio_arg_t)); + if (p == HAWK_NULL) return -1; + + HAWK_MEMSET (p, 0, HAWK_SIZEOF(*p)); + + p->name = hawk_rtx_dupoocstr(rtx, name, HAWK_NULL); + if (p->name == HAWK_NULL) + { + hawk_rtx_freemem (rtx, p); + return -1; + } + + p->type = (io_type | io_mask); + p->mode = io_mode; + p->rwcmode = HAWK_RIO_CMD_CLOSE_FULL; + /* + p->handle = HAWK_NULL; + p->next = HAWK_NULL; + p->rwcstate = 0; + + p->out.eof = 0; + p->out.eos = 0; + */ + + hawk_rtx_seterrnum (rtx, HAWK_ENOERR, HAWK_NULL); + n = handler(rtx, HAWK_RIO_CMD_OPEN, p, HAWK_NULL, 0); + if (n <= -1) + { + hawk_rtx_freemem (rtx, p->name); + hawk_rtx_freemem (rtx, p); + + if (hawk_rtx_geterrnum(rtx) == HAWK_ENOERR) + hawk_rtx_seterrnum (rtx, HAWK_EIOIMPL, HAWK_NULL); + + return -1; + } + + /* chain it */ + p->next = rtx->rio.chain; + rtx->rio.chain = p; + } + + if (p->out.eos) return 0; /* no more streams */ + if (p->out.eof) return 0; /* it has reached the end of the stream but this function has been recalled */ + + wid->handler = handler; + wid->p = p; + return 1; +} + +int hawk_rtx_writeiostr (hawk_rtx_t* rtx, int out_type, const hawk_ooch_t* name, hawk_ooch_t* str, hawk_oow_t len) +{ + int x; + write_io_data_t wid; + + if ((x = prepare_for_write_io_data(rtx, out_type, name, &wid)) <= 0) return x; + + while (len > 0) + { + hawk_ooi_t n; + + hawk_rtx_seterrnum (rtx, HAWK_ENOERR, HAWK_NULL); + n = wid.handler(rtx, HAWK_RIO_CMD_WRITE, wid.p, str, len); + if (n <= -1) + { + if (hawk_rtx_geterrnum(rtx) == HAWK_ENOERR) + hawk_rtx_seterrnum (rtx, HAWK_EIOIMPL, HAWK_NULL); + return -1; + } + + if (n == 0) + { + wid.p->out.eof = 1; + return 0; + } + + len -= n; + str += n; + } + + return 1; +} + +int hawk_rtx_writeiobytes (hawk_rtx_t* rtx, int out_type, const hawk_ooch_t* name, hawk_bch_t* str, hawk_oow_t len) +{ + int x; + write_io_data_t wid; + + if ((x = prepare_for_write_io_data(rtx, out_type, name, &wid)) <= 0) return x; + + while (len > 0) + { + hawk_ooi_t n; + + hawk_rtx_seterrnum (rtx, HAWK_ENOERR, HAWK_NULL); + n = wid.handler(rtx, HAWK_RIO_CMD_WRITE_BYTES, wid.p, str, len); + if (n <= -1) + { + if (hawk_rtx_geterrnum(rtx) == HAWK_ENOERR) + hawk_rtx_seterrnum (rtx, HAWK_EIOIMPL, HAWK_NULL); + return -1; + } + + if (n == 0) + { + wid.p->out.eof = 1; + return 0; + } + + len -= n; + str += n; + } + + return 1; +} + +int hawk_rtx_flushio (hawk_rtx_t* rtx, int out_type, const hawk_ooch_t* name) +{ + hawk_rio_arg_t* p = rtx->rio.chain; + hawk_rio_impl_t handler; + int io_type, io_mode, io_mask; + hawk_ooi_t n; + int ok = 0; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), out_type >= 0 && out_type <= HAWK_COUNTOF(out_type_map)); + HAWK_ASSERT (hawk_rtx_getawk(rtx), out_type >= 0 && out_type <= HAWK_COUNTOF(out_mode_map)); + HAWK_ASSERT (hawk_rtx_getawk(rtx), out_type >= 0 && out_type <= HAWK_COUNTOF(out_mask_map)); + + /* translate the out_type into the relevant I/O type and mode */ + io_type = out_type_map[out_type]; + io_mode = out_mode_map[out_type]; + io_mask = out_mask_map[out_type]; + + handler = rtx->rio.handler[io_type]; + if (!handler) + { + /* no I/O handler provided */ + hawk_rtx_seterrnum (rtx, HAWK_EIOUSER, HAWK_NULL); + return -1; + } + + /* look for the corresponding rio for name */ + while (p) + { + /* without the check for io_mode and p->mode, + * HAWK_OUT_FILE and HAWK_OUT_APFILE matches the + * same entry since (io_type | io_mask) has the same value + * for both. */ + if (p->type == (io_type | io_mask) && p->mode == io_mode && + (name == HAWK_NULL || hawk_comp_oocstr(p->name, name, 0) == 0)) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOERR, HAWK_NULL); + n = handler(rtx, HAWK_RIO_CMD_FLUSH, p, HAWK_NULL, 0); + if (n <= -1) + { + if (hawk_rtx_geterrnum(rtx) == HAWK_ENOERR) + hawk_rtx_seterrnum (rtx, HAWK_EIOIMPL, HAWK_NULL); + return -1; + } + + ok = 1; + } + + p = p->next; + } + + if (ok) return 0; + + /* there is no corresponding rio for name */ + hawk_rtx_seterrnum (rtx, HAWK_EIONMNF, HAWK_NULL); + return -1; +} + +int hawk_rtx_nextio_read (hawk_rtx_t* rtx, int in_type, const hawk_ooch_t* name) +{ + hawk_rio_arg_t* p = rtx->rio.chain; + hawk_rio_impl_t handler; + int io_type, /*io_mode,*/ io_mask; + hawk_ooi_t n; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), in_type >= 0 && in_type <= HAWK_COUNTOF(in_type_map)); + HAWK_ASSERT (hawk_rtx_getawk(rtx), in_type >= 0 && in_type <= HAWK_COUNTOF(in_mode_map)); + HAWK_ASSERT (hawk_rtx_getawk(rtx), in_type >= 0 && in_type <= HAWK_COUNTOF(in_mask_map)); + + /* translate the in_type into the relevant I/O type and mode */ + io_type = in_type_map[in_type]; + /*io_mode = in_mode_map[in_type];*/ + io_mask = in_mask_map[in_type]; + + handler = rtx->rio.handler[io_type]; + if (!handler) + { + /* no I/O handler provided */ + hawk_rtx_seterrnum (rtx, HAWK_EIOUSER, HAWK_NULL); + return -1; + } + + while (p) + { + if (p->type == (io_type | io_mask) && hawk_comp_oocstr(p->name, name, 0) == 0) break; + p = p->next; + } + + if (!p) + { + /* something is totally wrong */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), !"should never happen - cannot find the relevant rio entry"); + hawk_rtx_seterrnum (rtx, HAWK_EINTERN, HAWK_NULL); + return -1; + } + + if (p->in.eos) + { + /* no more streams. */ + return 0; + } + + hawk_rtx_seterrnum (rtx, HAWK_ENOERR, HAWK_NULL); + n = handler(rtx, HAWK_RIO_CMD_NEXT, p, HAWK_NULL, 0); + if (n <= -1) + { + if (hawk_rtx_geterrnum(rtx) == HAWK_ENOERR) + hawk_rtx_seterrnum (rtx, HAWK_EIOIMPL, HAWK_NULL); + return -1; + } + + if (n == 0) + { + /* the next stream cannot be opened. + * set the EOS flags so that the next call to nextio_read + * will return 0 without executing the handler */ + p->in.eos = 1; + return 0; + } + else + { + /* as the next stream has been opened successfully, + * the EOF flag should be cleared if set */ + p->in.eof = 0; + + /* also the previous input buffer must be reset */ + p->in.pos = 0; + p->in.len = 0; + + return 1; + } +} + +int hawk_rtx_nextio_write (hawk_rtx_t* rtx, int out_type, const hawk_ooch_t* name) +{ + hawk_rio_arg_t* p = rtx->rio.chain; + hawk_rio_impl_t handler; + int io_type, /*io_mode,*/ io_mask; + hawk_ooi_t n; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), out_type >= 0 && out_type <= HAWK_COUNTOF(out_type_map)); + HAWK_ASSERT (hawk_rtx_getawk(rtx), out_type >= 0 && out_type <= HAWK_COUNTOF(out_mode_map)); + HAWK_ASSERT (hawk_rtx_getawk(rtx), out_type >= 0 && out_type <= HAWK_COUNTOF(out_mask_map)); + + /* translate the out_type into the relevant I/O type and mode */ + io_type = out_type_map[out_type]; + /*io_mode = out_mode_map[out_type];*/ + io_mask = out_mask_map[out_type]; + + handler = rtx->rio.handler[io_type]; + if (!handler) + { + /* no I/O handler provided */ + hawk_rtx_seterrnum (rtx, HAWK_EIOUSER, HAWK_NULL); + return -1; + } + + while (p) + { + if (p->type == (io_type | io_mask) && hawk_comp_oocstr(p->name, name, 0) == 0) break; + p = p->next; + } + + if (!p) + { + /* something is totally wrong */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), !"should never happen - cannot find the relevant rio entry"); + + hawk_rtx_seterrnum (rtx, HAWK_EINTERN, HAWK_NULL); + return -1; + } + + if (p->out.eos) + { + /* no more streams. */ + return 0; + } + + hawk_rtx_seterrnum (rtx, HAWK_ENOERR, HAWK_NULL); + n = handler(rtx, HAWK_RIO_CMD_NEXT, p, HAWK_NULL, 0); + if (n <= -1) + { + if (hawk_rtx_geterrnum(rtx) == HAWK_ENOERR) + hawk_rtx_seterrnum (rtx, HAWK_EIOIMPL, HAWK_NULL); + return -1; + } + + if (n == 0) + { + /* the next stream cannot be opened. + * set the EOS flags so that the next call to nextio_write + * will return 0 without executing the handler */ + p->out.eos = 1; + return 0; + } + else + { + /* as the next stream has been opened successfully, + * the EOF flag should be cleared if set */ + p->out.eof = 0; + return 1; + } +} + +int hawk_rtx_closio_read (hawk_rtx_t* rtx, int in_type, const hawk_ooch_t* name) +{ + hawk_rio_arg_t* p = rtx->rio.chain, * px = HAWK_NULL; + hawk_rio_impl_t handler; + int io_type, /*io_mode,*/ io_mask; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), in_type >= 0 && in_type <= HAWK_COUNTOF(in_type_map)); + HAWK_ASSERT (hawk_rtx_getawk(rtx), in_type >= 0 && in_type <= HAWK_COUNTOF(in_mode_map)); + HAWK_ASSERT (hawk_rtx_getawk(rtx), in_type >= 0 && in_type <= HAWK_COUNTOF(in_mask_map)); + + /* translate the in_type into the relevant I/O type and mode */ + io_type = in_type_map[in_type]; + /*io_mode = in_mode_map[in_type];*/ + io_mask = in_mask_map[in_type]; + + handler = rtx->rio.handler[io_type]; + if (!handler) + { + /* no I/O handler provided */ + hawk_rtx_seterrnum (rtx, HAWK_EIOUSER, HAWK_NULL); + return -1; + } + + while (p) + { + if (p->type == (io_type | io_mask) && hawk_comp_oocstr(p->name, name, 0) == 0) + { + hawk_rio_impl_t handler; + + handler = rtx->rio.handler[p->type & IO_MASK_CLEAR]; + if (handler) + { + if (handler (rtx, HAWK_RIO_CMD_CLOSE, p, HAWK_NULL, 0) <= -1) + { + /* this is not a rtx-time error.*/ + hawk_rtx_seterrnum (rtx, HAWK_EIOIMPL, HAWK_NULL); + return -1; + } + } + + if (px) px->next = p->next; + else rtx->rio.chain = p->next; + + hawk_rtx_freemem (rtx, p->name); + hawk_rtx_freemem (rtx, p); + return 0; + } + + px = p; + p = p->next; + } + + /* the name given is not found */ + hawk_rtx_seterrnum (rtx, HAWK_EIONMNF, HAWK_NULL); + return -1; +} + +int hawk_rtx_closio_write (hawk_rtx_t* rtx, int out_type, const hawk_ooch_t* name) +{ + hawk_rio_arg_t* p = rtx->rio.chain, * px = HAWK_NULL; + hawk_rio_impl_t handler; + int io_type, /*io_mode,*/ io_mask; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), out_type >= 0 && out_type <= HAWK_COUNTOF(out_type_map)); + HAWK_ASSERT (hawk_rtx_getawk(rtx), out_type >= 0 && out_type <= HAWK_COUNTOF(out_mode_map)); + HAWK_ASSERT (hawk_rtx_getawk(rtx), out_type >= 0 && out_type <= HAWK_COUNTOF(out_mask_map)); + + /* translate the out_type into the relevant io type and mode */ + io_type = out_type_map[out_type]; + /*io_mode = out_mode_map[out_type];*/ + io_mask = out_mask_map[out_type]; + + handler = rtx->rio.handler[io_type]; + if (!handler) + { + /* no io handler provided */ + hawk_rtx_seterrnum (rtx, HAWK_EIOUSER, HAWK_NULL); + return -1; + } + + while (p) + { + if (p->type == (io_type | io_mask) && hawk_comp_oocstr(p->name, name, 0) == 0) + { + hawk_rio_impl_t handler; + + handler = rtx->rio.handler[p->type & IO_MASK_CLEAR]; + if (handler) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOERR, HAWK_NULL); + if (handler (rtx, HAWK_RIO_CMD_CLOSE, p, HAWK_NULL, 0) <= -1) + { + if (hawk_rtx_geterrnum(rtx) == HAWK_ENOERR) + hawk_rtx_seterrnum (rtx, HAWK_EIOIMPL, HAWK_NULL); + return -1; + } + } + + if (px) px->next = p->next; + else rtx->rio.chain = p->next; + + hawk_rtx_freemem (rtx, p->name); + hawk_rtx_freemem (rtx, p); + return 0; + } + + px = p; + p = p->next; + } + + hawk_rtx_seterrnum (rtx, HAWK_EIONMNF, HAWK_NULL); + return -1; +} + +int hawk_rtx_closeio (hawk_rtx_t* rtx, const hawk_ooch_t* name, const hawk_ooch_t* opt) +{ + hawk_rio_arg_t* p = rtx->rio.chain, * px = HAWK_NULL; + + while (p) + { + /* it handles the first that matches the given name + * regardless of the io type */ + if (hawk_comp_oocstr(p->name, name, 0) == 0) + { + hawk_rio_impl_t handler; + hawk_rio_rwcmode_t rwcmode = HAWK_RIO_CMD_CLOSE_FULL; + + if (opt) + { + if (opt[0] == HAWK_T('r')) + { + if (p->type & IO_MASK_RDWR) + { + if (p->rwcstate != HAWK_RIO_CMD_CLOSE_WRITE) + { + /* if the write end is not + * closed, let io handler close + * the read end only. */ + rwcmode = HAWK_RIO_CMD_CLOSE_READ; + } + } + else if (!(p->type & IO_MASK_READ)) goto skip; + } + else + { + HAWK_ASSERT (hawk_rtx_getawk(rtx), opt[0] == HAWK_T('w')); + if (p->type & IO_MASK_RDWR) + { + if (p->rwcstate != HAWK_RIO_CMD_CLOSE_READ) + { + /* if the read end is not + * closed, let io handler close + * the write end only. */ + rwcmode = HAWK_RIO_CMD_CLOSE_WRITE; + } + } + else if (!(p->type & IO_MASK_WRITE)) goto skip; + } + } + + handler = rtx->rio.handler[p->type & IO_MASK_CLEAR]; + if (handler) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOERR, HAWK_NULL); + p->rwcmode = rwcmode; + if (handler(rtx, HAWK_RIO_CMD_CLOSE, p, HAWK_NULL, 0) <= -1) + { + /* this is not a run-time error.*/ + if (hawk_rtx_geterrnum(rtx) == HAWK_ENOERR) + hawk_rtx_seterrnum (rtx, HAWK_EIOIMPL, HAWK_NULL); + return -1; + } + } + + if (p->type & IO_MASK_RDWR) + { + p->rwcmode = rwcmode; + if (p->rwcstate == 0 && rwcmode != 0) + { + /* if either end has not been closed. + * return success without destroying + * the internal node. rwcstate keeps + * what has been successfully closed */ + p->rwcstate = rwcmode; + return 0; + } + } + + if (px != HAWK_NULL) px->next = p->next; + else rtx->rio.chain = p->next; + + hawk_rtx_freemem (rtx, p->name); + hawk_rtx_freemem (rtx, p); + + return 0; + } + + skip: + px = p; + p = p->next; + } + + hawk_rtx_seterrnum (rtx, HAWK_EIONMNF, HAWK_NULL); + return -1; +} + +void hawk_rtx_cleario (hawk_rtx_t* rtx) +{ + hawk_rio_arg_t* next; + hawk_rio_impl_t handler; + hawk_ooi_t n; + + while (rtx->rio.chain) + { + handler = rtx->rio.handler[rtx->rio.chain->type & IO_MASK_CLEAR]; + next = rtx->rio.chain->next; + + if (handler) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOERR, HAWK_NULL); + rtx->rio.chain->rwcmode = 0; + n = handler(rtx, HAWK_RIO_CMD_CLOSE, rtx->rio.chain, HAWK_NULL, 0); + if (n <= -1) + { + if (hawk_rtx_geterrnum(rtx) == HAWK_ENOERR) + hawk_rtx_seterrnum (rtx, HAWK_EIOIMPL, HAWK_NULL); + /* TODO: some warnings need to be shown??? */ + } + } + + hawk_rtx_freemem (rtx, rtx->rio.chain->name); + hawk_rtx_freemem (rtx, rtx->rio.chain); + + rtx->rio.chain = next; + } +} diff --git a/hawk/lib/run-prv.h b/hawk/lib/run-prv.h new file mode 100644 index 00000000..b4c8eedd --- /dev/null +++ b/hawk/lib/run-prv.h @@ -0,0 +1,147 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_RUN_PRV_H_ +#define _HAWK_RUN_PRV_H_ + +enum hawk_assop_type_t +{ + /* if you change this, you have to change assop_str in tree.c. + * synchronize it wit: + * - binop_func in eval_assignment of run.c + * - assop in assing_to_opcode of parse.c + * - TOK_XXX_ASSN in tok_t in parse.c + * - assop_str in tree.c + */ + HAWK_ASSOP_NONE, + HAWK_ASSOP_PLUS, /* += */ + HAWK_ASSOP_MINUS, /* -= */ + HAWK_ASSOP_MUL, /* *= */ + HAWK_ASSOP_DIV, /* /= */ + HAWK_ASSOP_IDIV, /* //= */ + HAWK_ASSOP_MOD, /* %= */ + HAWK_ASSOP_EXP, /* **= */ + HAWK_ASSOP_CONCAT, /* %%= */ + HAWK_ASSOP_RS, /* >>= */ + HAWK_ASSOP_LS, /* <<= */ + HAWK_ASSOP_BAND, /* &= */ + HAWK_ASSOP_BXOR, /* ^^= */ + HAWK_ASSOP_BOR /* |= */ +}; + +enum hawk_binop_type_t +{ + /* if you change this, you have to change + * binop_str in tree.c and binop_func in run.c accordingly. */ + HAWK_BINOP_LOR, + HAWK_BINOP_LAND, + HAWK_BINOP_IN, + + HAWK_BINOP_BOR, + HAWK_BINOP_BXOR, + HAWK_BINOP_BAND, + + HAWK_BINOP_TEQ, + HAWK_BINOP_TNE, + HAWK_BINOP_EQ, + HAWK_BINOP_NE, + HAWK_BINOP_GT, + HAWK_BINOP_GE, + HAWK_BINOP_LT, + HAWK_BINOP_LE, + + HAWK_BINOP_LS, + HAWK_BINOP_RS, + + HAWK_BINOP_PLUS, + HAWK_BINOP_MINUS, + HAWK_BINOP_MUL, + HAWK_BINOP_DIV, + HAWK_BINOP_IDIV, + HAWK_BINOP_MOD, + HAWK_BINOP_EXP, + + HAWK_BINOP_CONCAT, + HAWK_BINOP_MA, + HAWK_BINOP_NM +}; + +enum hawk_unrop_type_t +{ + /* if you change this, you have to change + * __unrop_str in tree.c accordingly. */ + HAWK_UNROP_PLUS, + HAWK_UNROP_MINUS, + HAWK_UNROP_LNOT, + HAWK_UNROP_BNOT +}; + +enum hawk_incop_type_t +{ + /* if you change this, you have to change + * __incop_str in tree.c accordingly. */ + HAWK_INCOP_PLUS, + HAWK_INCOP_MINUS +}; + +#if defined(__cplusplus) +extern "C" { +#endif + +hawk_ooch_t* hawk_rtx_format ( + hawk_rtx_t* rtx, + hawk_ooecs_t* out, + hawk_ooecs_t* fbu, + const hawk_ooch_t* fmt, + hawk_oow_t fmt_len, + hawk_oow_t nargs_on_stack, + hawk_nde_t* args, + hawk_oow_t* len +); + +hawk_bch_t* hawk_rtx_formatmbs ( + hawk_rtx_t* rtx, + hawk_becs_t* out, + hawk_becs_t* fbu, + const hawk_bch_t* fmt, + hawk_oow_t fmt_len, + hawk_oow_t nargs_on_stack, + hawk_nde_t* args, + hawk_oow_t* len +); + +int hawk_rtx_cmpval ( + hawk_rtx_t* rtx, + hawk_val_t* left, + hawk_val_t* right, + int* ret +); + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/hawk/lib/run.c b/hawk/lib/run.c new file mode 100644 index 00000000..debd5d6a --- /dev/null +++ b/hawk/lib/run.c @@ -0,0 +1,9093 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "hawk-prv.h" + +#define PRINT_IOERR -99 + +#define CMP_ERROR -99 +#define DEF_BUF_CAPA 256 +#define RTX_STACK_INCREMENT 512 + +/* Don't forget to grow IDXBUFSIZE if hawk_int_t is very large */ +#if (HAWK_SIZEOF_INT_T <= 16) /* 128 bits */ +# define IDXBUFSIZE 64 +#elif (HAWK_SIZEOF_INT_T <= 32) /* 256 bits */ +# define IDXBUFSIZE 128 +#elif (HAWK_SIZEOF_INT_T <= 64) /* 512 bits */ +# define IDXBUFSIZE 192 +#elif (HAWK_SIZEOF_INT_T <= 128) /* 1024 bits */ +# define IDXBUFSIZE 384 +#elif (HAWK_SIZEOF_INT_T <= 256) /* 2048 bits */ +# define IDXBUFSIZE 640 +#else +# error unsupported. hawk_int_t too big +#endif + +enum exit_level_t +{ + EXIT_NONE, + EXIT_BREAK, + EXIT_CONTINUE, + EXIT_FUNCTION, + EXIT_NEXT, + EXIT_GLOBAL, + EXIT_ABORT +}; + +struct pafv_t +{ + hawk_val_t** args; + hawk_oow_t nargs; + const hawk_ooch_t* argspec; +}; + +#define DEFAULT_CONVFMT HAWK_T("%.6g") +#define DEFAULT_OFMT HAWK_T("%.6g") +#define DEFAULT_OFS HAWK_T(" ") +#define DEFAULT_ORS HAWK_T("\n") +#define DEFAULT_ORS_CRLF HAWK_T("\r\n") +#define DEFAULT_SUBSEP HAWK_T("\034") + +/* the index of a positional variable should be a positive interger + * equal to or less than the maximum value of the type by which + * the index is represented. but it has an extra check against the + * maximum value of hawk_oow_t as the reference is represented + * in a pointer variable of hawk_val_ref_t and sizeof(void*) is + * equal to sizeof(hawk_oow_t). */ +#define IS_VALID_POSIDX(idx) \ + ((idx) >= 0 && \ + (idx) <= HAWK_TYPE_MAX(hawk_int_t) && \ + (idx) <= HAWK_TYPE_MAX(hawk_oow_t)) + +#define SETERR_ARGX_LOC(rtx,code,ea,loc) \ + hawk_rtx_seterror ((rtx), (code), (ea), (loc)) + +#define CLRERR(rtx) SETERR_ARGX_LOC(rtx,HAWK_ENOERR,HAWK_NULL,HAWK_NULL) + +#define SETERR_ARG_LOC(rtx,code,ep,el,loc) \ + do { \ + hawk_oocs_t __ea; \ + __ea.len = (el); __ea.ptr = (ep); \ + hawk_rtx_seterror ((rtx), (code), &__ea, (loc)); \ + } while (0) + +#define SETERR_ARGX(rtx,code,ea) SETERR_ARGX_LOC(rtx,code,ea,HAWK_NULL) +#define SETERR_ARG(rtx,code,ep,el) SETERR_ARG_LOC(rtx,code,ep,el,HAWK_NULL) +#define SETERR_LOC(rtx,code,loc) SETERR_ARGX_LOC(rtx,code,HAWK_NULL,loc) +#define SETERR_COD(rtx,code) SETERR_ARGX_LOC(rtx,code,HAWK_NULL,HAWK_NULL) + +#define ADJERR_LOC(rtx,l) do { (rtx)->errloc = *(l); } while (0) + +static hawk_oow_t push_arg_from_vals (hawk_rtx_t* rtx, hawk_nde_fncall_t* call, void* data); +static hawk_oow_t push_arg_from_nde (hawk_rtx_t* rtx, hawk_nde_fncall_t* call, void* data); + +static int init_rtx (hawk_rtx_t* rtx, hawk_t* awk, hawk_rio_cbs_t* rio); +static void fini_rtx (hawk_rtx_t* rtx, int fini_globals); + +static int init_globals (hawk_rtx_t* rtx); +static void refdown_globals (hawk_rtx_t* run, int pop); + +static int run_pblocks (hawk_rtx_t* rtx); +static int run_pblock_chain (hawk_rtx_t* rtx, hawk_chain_t* cha); +static int run_pblock (hawk_rtx_t* rtx, hawk_chain_t* cha, hawk_oow_t bno); +static int run_block (hawk_rtx_t* rtx, hawk_nde_blk_t* nde); +static int run_statement (hawk_rtx_t* rtx, hawk_nde_t* nde); +static int run_if (hawk_rtx_t* rtx, hawk_nde_if_t* nde); +static int run_while (hawk_rtx_t* rtx, hawk_nde_while_t* nde); +static int run_for (hawk_rtx_t* rtx, hawk_nde_for_t* nde); +static int run_foreach (hawk_rtx_t* rtx, hawk_nde_foreach_t* nde); +static int run_break (hawk_rtx_t* rtx, hawk_nde_break_t* nde); +static int run_continue (hawk_rtx_t* rtx, hawk_nde_continue_t* nde); +static int run_return (hawk_rtx_t* rtx, hawk_nde_return_t* nde); +static int run_exit (hawk_rtx_t* rtx, hawk_nde_exit_t* nde); +static int run_next (hawk_rtx_t* rtx, hawk_nde_next_t* nde); +static int run_nextfile (hawk_rtx_t* rtx, hawk_nde_nextfile_t* nde); +static int run_delete (hawk_rtx_t* rtx, hawk_nde_delete_t* nde); +static int run_reset (hawk_rtx_t* rtx, hawk_nde_reset_t* nde); +static int run_print (hawk_rtx_t* rtx, hawk_nde_print_t* nde); +static int run_printf (hawk_rtx_t* rtx, hawk_nde_print_t* nde); + +static int output_formatted ( + hawk_rtx_t* run, int out_type, const hawk_ooch_t* dst, + const hawk_ooch_t* fmt, hawk_oow_t fmt_len, hawk_nde_t* args); +static int output_formatted_bytes ( + hawk_rtx_t* run, int out_type, const hawk_ooch_t* dst, + const hawk_bch_t* fmt, hawk_oow_t fmt_len, hawk_nde_t* args); + +static hawk_val_t* eval_expression (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_expression0 (hawk_rtx_t* rtx, hawk_nde_t* nde); + +static hawk_val_t* eval_group (hawk_rtx_t* rtx, hawk_nde_t* nde); + +static hawk_val_t* eval_assignment (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* do_assignment (hawk_rtx_t* rtx, hawk_nde_t* var, hawk_val_t* val); +static hawk_val_t* do_assignment_nonidx (hawk_rtx_t* rtx, hawk_nde_var_t* var, hawk_val_t* val); +static hawk_val_t* do_assignment_idx (hawk_rtx_t* rtx, hawk_nde_var_t* var, hawk_val_t* val); +static hawk_val_t* do_assignment_pos (hawk_rtx_t* rtx, hawk_nde_pos_t* pos, hawk_val_t* val); + +static hawk_val_t* eval_binary (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_binop_lor (hawk_rtx_t* rtx, hawk_nde_t* left, hawk_nde_t* right); +static hawk_val_t* eval_binop_land (hawk_rtx_t* rtx, hawk_nde_t* left, hawk_nde_t* right); +static hawk_val_t* eval_binop_in (hawk_rtx_t* rtx, hawk_nde_t* left, hawk_nde_t* right); +static hawk_val_t* eval_binop_bor (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right); +static hawk_val_t* eval_binop_bxor (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right); +static hawk_val_t* eval_binop_band (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right); + +static hawk_val_t* eval_binop_teq (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right); +static hawk_val_t* eval_binop_tne (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right); +static hawk_val_t* eval_binop_eq (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right); +static hawk_val_t* eval_binop_ne (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right); +static hawk_val_t* eval_binop_gt (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right); +static hawk_val_t* eval_binop_ge (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right); +static hawk_val_t* eval_binop_lt (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right); +static hawk_val_t* eval_binop_le (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right); +static hawk_val_t* eval_binop_lshift (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right); +static hawk_val_t* eval_binop_rshift (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right); +static hawk_val_t* eval_binop_plus (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right); +static hawk_val_t* eval_binop_minus (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right); +static hawk_val_t* eval_binop_mul (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right); +static hawk_val_t* eval_binop_div (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right); +static hawk_val_t* eval_binop_idiv (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right); +static hawk_val_t* eval_binop_mod (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right); +static hawk_val_t* eval_binop_exp (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right); +static hawk_val_t* eval_binop_concat (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right); +static hawk_val_t* eval_binop_ma (hawk_rtx_t* rtx, hawk_nde_t* left, hawk_nde_t* right); +static hawk_val_t* eval_binop_nm (hawk_rtx_t* rtx, hawk_nde_t* left, hawk_nde_t* right); + +static hawk_val_t* eval_unary (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_incpre (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_incpst (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_cnd (hawk_rtx_t* rtx, hawk_nde_t* nde); + +static hawk_val_t* eval_fncall_fun_ex (hawk_rtx_t* rtx, hawk_nde_t* nde, void(*errhandler)(void*), void* eharg); + +static hawk_val_t* eval_fncall_fnc (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_fncall_fun (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_fncall_var (hawk_rtx_t* rtx, hawk_nde_t* nde); + +static hawk_val_t* __eval_call ( + hawk_rtx_t* rtx, + hawk_nde_t* nde, + hawk_fun_t* fun, + hawk_oow_t(*argpusher)(hawk_rtx_t*,hawk_nde_fncall_t*,void*), + void* apdata, /* data to argpusher */ + void(*errhandler)(void*), + void* eharg); + +static int get_reference (hawk_rtx_t* rtx, hawk_nde_t* nde, hawk_val_t*** ref); +static hawk_val_t** get_reference_indexed (hawk_rtx_t* rtx, hawk_nde_var_t* nde, hawk_val_t** val); + +static hawk_val_t* eval_int (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_flt (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_str (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_mbs (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_rex (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_fun (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_named (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_gbl (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_lcl (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_arg (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_namedidx (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_gblidx (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_lclidx (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_argidx (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_pos (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_getline (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_print (hawk_rtx_t* rtx, hawk_nde_t* nde); +static hawk_val_t* eval_printf (hawk_rtx_t* rtx, hawk_nde_t* nde); + +static int __raw_push (hawk_rtx_t* rtx, void* val); +#define __raw_pop(rtx) \ + do { \ + HAWK_ASSERT (hawk_rtx_getawk(rtx), (rtx)->stack_top > (rtx)->stack_base); \ + (rtx)->stack_top--; \ + } while (0) + +static int read_record (hawk_rtx_t* rtx); +static int shorten_record (hawk_rtx_t* rtx, hawk_oow_t nflds); + +static hawk_ooch_t* idxnde_to_str (hawk_rtx_t* rtx, hawk_nde_t* nde, hawk_ooch_t* buf, hawk_oow_t* len); + +typedef hawk_val_t* (*binop_func_t) (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right); +typedef hawk_val_t* (*eval_expr_t) (hawk_rtx_t* rtx, hawk_nde_t* nde); + + +HAWK_INLINE hawk_oow_t hawk_rtx_getnargs (hawk_rtx_t* rtx) +{ + return (hawk_oow_t) RTX_STACK_NARGS(rtx); +} + +HAWK_INLINE hawk_val_t* hawk_rtx_getarg (hawk_rtx_t* rtx, hawk_oow_t idx) +{ + return RTX_STACK_ARG(rtx, idx); +} + +HAWK_INLINE hawk_val_t* hawk_rtx_getgbl (hawk_rtx_t* rtx, int id) +{ + HAWK_ASSERT (hawk_rtx_getawk(rtx), id >= 0 && id < (int)HAWK_ARR_SIZE(rtx->awk->parse.gbls)); + return RTX_STACK_GBL(rtx, id); +} + +const hawk_oocs_t* hawk_rtx_getsubsep (hawk_rtx_t* rtx) +{ + return &rtx->gbl.subsep; +} + +/* internal function to set a value to a global variable. + * this function can handle a few special global variables that + * require special treatment. */ +static int set_global (hawk_rtx_t* rtx, int idx, hawk_nde_var_t* var, hawk_val_t* val, int assign) +{ + hawk_val_t* old; + hawk_rtx_ecb_t* ecb; + hawk_val_type_t vtype, old_vtype; + + old = RTX_STACK_GBL (rtx, idx); + + vtype = HAWK_RTX_GETVALTYPE (rtx, val); + old_vtype = HAWK_RTX_GETVALTYPE (rtx, old); + + if (!(rtx->awk->opt.trait & HAWK_FLEXMAP)) + { + hawk_errnum_t errnum = HAWK_ENOERR; + + if (vtype == HAWK_VAL_MAP) + { + if (old_vtype == HAWK_VAL_NIL) + { + /* a nil valul can be overridden with any values */ + /* ok. no error */ + } + else if (!assign && old_vtype == HAWK_VAL_MAP) + { + /* when both are maps, how should this operation be + * interpreted? + * + * is it an assignment? + * old = new + * + * or is it to delete all elements in the array + * and add new items? + * for (i in old) delete old[i]; + * for (i in new) old[i] = new[i]; + * + * i interpret this operation as the latter. + */ + + /* ok. no error */ + } + else + { + errnum = HAWK_ENSCALARTOMAP; + } + } + else + { + if (old_vtype == HAWK_VAL_MAP) errnum = HAWK_ENMAPTOSCALAR; + } + + if (errnum != HAWK_ENOERR) + { + /* once a variable becomes a map, it cannot be assigned + * others value than another map. you can only add a member + * using indexing. */ + if (var) + { + /* global variable */ + SETERR_ARGX_LOC (rtx, errnum, &var->id.name, &var->loc); + } + else + { + /* hawk_rtx_setgbl() has been called */ + hawk_oocs_t ea; + ea.ptr = (hawk_ooch_t*)hawk_getgblname (rtx->awk, idx, &ea.len); + SETERR_ARGX (rtx, errnum, &ea); + } + + return -1; + } + } + + if (vtype == HAWK_VAL_MAP) + { + if (idx >= HAWK_MIN_GBL_ID && idx <= HAWK_MAX_GBL_ID) + { + /* short-circuit check block to prevent the basic built-in + * variables from being assigned a map. if you happen to add + * one and if that's allowed to be a map, you may have to + * change the condition here. */ + +/* TODO: use global variable attribute. can it be a map? can it be a scalar? is it read-only???? */ + + hawk_oocs_t ea; + ea.ptr = (hawk_ooch_t*)hawk_getgblname (rtx->awk, idx, &ea.len); + SETERR_ARGX (rtx, HAWK_ENSCALARTOMAP, &ea); + return -1; + } + } + + if (old == val) + { + /* if the old value is the same as the new value, don't take any actions. + * note that several inspections have been performed before this check, + * mainly for consistency. anyway, this condition can be met if you execute + * a statement like 'ARGV=ARGV'. */ + return 0; + } + + /* perform actual assignment or assignment-like operation */ + switch (idx) + { + case HAWK_GBL_CONVFMT: + { + hawk_oow_t i; + hawk_rtx_valtostr_out_t out; + + out.type = HAWK_RTX_VALTOSTR_CPLDUP; + if (hawk_rtx_valtostr (rtx, val, &out) <= -1) + return -1; + + for (i = 0; i < out.u.cpldup.len; i++) + { + if (out.u.cpldup.ptr[i] == HAWK_T('\0')) + { + /* '\0' is included in the value */ + hawk_rtx_freemem (rtx, out.u.cpldup.ptr); + SETERR_COD (rtx, HAWK_ECONVFMTCHR); + return -1; + } + } + + if (rtx->gbl.convfmt.ptr) hawk_rtx_freemem (rtx, rtx->gbl.convfmt.ptr); + rtx->gbl.convfmt.ptr = out.u.cpldup.ptr; + rtx->gbl.convfmt.len = out.u.cpldup.len; + break; + } + + case HAWK_GBL_FNR: + { + int n; + hawk_int_t lv; + + n = hawk_rtx_valtoint (rtx, val, &lv); + if (n <= -1) return -1; + + rtx->gbl.fnr = lv; + break; + } + + case HAWK_GBL_FS: + { + hawk_ooch_t* fs_ptr; + hawk_oow_t fs_len; + + if (vtype == HAWK_VAL_STR) + { + fs_ptr = ((hawk_val_str_t*)val)->val.ptr; + fs_len = ((hawk_val_str_t*)val)->val.len; + } + else + { + hawk_rtx_valtostr_out_t out; + + /* due to the expression evaluation rule, the + * regular expression can not be an assigned value */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), vtype != HAWK_VAL_REX); + + out.type = HAWK_RTX_VALTOSTR_CPLDUP; + if (hawk_rtx_valtostr (rtx, val, &out) <= -1) return -1; + fs_ptr = out.u.cpldup.ptr; + fs_len = out.u.cpldup.len; + } + + if (fs_len > 1 && !(fs_len == 5 && fs_ptr[0] == HAWK_T('?'))) + { + /* it's a regular expression if FS contains multiple characters. + * however, it's not a regular expression if it's 5 character + * string beginning with a question mark. */ + void* rex, * irex; + hawk_errnum_t errnum; + + if (hawk_buildrex (rtx->awk, fs_ptr, fs_len, &errnum, &rex, &irex) <= -1) + { + SETERR_COD (rtx, errnum); + if (vtype != HAWK_VAL_STR) + hawk_rtx_freemem (rtx, fs_ptr); + return -1; + } + + if (rtx->gbl.fs[0]) hawk_freerex (rtx->awk, rtx->gbl.fs[0], rtx->gbl.fs[1]); + + rtx->gbl.fs[0] = rex; + rtx->gbl.fs[1] = irex; + } + + if (vtype != HAWK_VAL_STR) hawk_rtx_freemem (rtx, fs_ptr); + break; + } + + case HAWK_GBL_IGNORECASE: + { + hawk_int_t l; + hawk_flt_t r; + int vt; + + vt = hawk_rtx_valtonum(rtx, val, &l, &r); + if (vt <= -1) return -1; + + if (vt == 0) + rtx->gbl.ignorecase = ((l > 0)? 1: (l < 0)? -1: 0); + else + rtx->gbl.ignorecase = ((r > 0.0)? 1: (r < 0.0)? -1: 0); + break; + } + + case HAWK_GBL_NF: + { + int n; + hawk_int_t lv; + + n = hawk_rtx_valtoint(rtx, val, &lv); + if (n <= -1) return -1; + + if (lv < (hawk_int_t)rtx->inrec.nflds) + { + if (shorten_record(rtx, (hawk_oow_t)lv) == -1) + { + /* adjust the error line */ + /*if (var) ADJERR_LOC (rtx, &var->loc);*/ + return -1; + } + } + + break; + } + + + case HAWK_GBL_NR: + { + int n; + hawk_int_t lv; + + n = hawk_rtx_valtoint(rtx, val, &lv); + if (n <= -1) return -1; + + rtx->gbl.nr = lv; + break; + } + + case HAWK_GBL_OFMT: + { + hawk_oow_t i; + hawk_rtx_valtostr_out_t out; + + out.type = HAWK_RTX_VALTOSTR_CPLDUP; + if (hawk_rtx_valtostr(rtx, val, &out) <= -1) return -1; + + for (i = 0; i < out.u.cpldup.len; i++) + { + if (out.u.cpldup.ptr[i] == HAWK_T('\0')) + { + hawk_rtx_freemem (rtx, out.u.cpldup.ptr); + SETERR_COD (rtx, HAWK_EOFMTCHR); + return -1; + } + } + + if (rtx->gbl.ofmt.ptr) hawk_rtx_freemem (rtx, rtx->gbl.ofmt.ptr); + rtx->gbl.ofmt.ptr = out.u.cpldup.ptr; + rtx->gbl.ofmt.len = out.u.cpldup.len; + + break; + } + + case HAWK_GBL_OFS: + { + hawk_rtx_valtostr_out_t out; + + out.type = HAWK_RTX_VALTOSTR_CPLDUP; + if (hawk_rtx_valtostr(rtx, val, &out) <= -1) return -1; + if (rtx->gbl.ofs.ptr) hawk_rtx_freemem (rtx, rtx->gbl.ofs.ptr); + rtx->gbl.ofs.ptr = out.u.cpldup.ptr; + rtx->gbl.ofs.len = out.u.cpldup.len; + + break; + } + + case HAWK_GBL_ORS: + { + hawk_rtx_valtostr_out_t out; + + out.type = HAWK_RTX_VALTOSTR_CPLDUP; + if (hawk_rtx_valtostr(rtx, val, &out) <= -1) return -1; + if (rtx->gbl.ors.ptr) hawk_rtx_freemem (rtx, rtx->gbl.ors.ptr); + rtx->gbl.ors.ptr = out.u.cpldup.ptr; + rtx->gbl.ors.len = out.u.cpldup.len; + + break; + } + + case HAWK_GBL_RS: + { + hawk_oocs_t rss; + + if (vtype == HAWK_VAL_STR) + { + rss = ((hawk_val_str_t*)val)->val; + } + else + { + hawk_rtx_valtostr_out_t out; + + /* due to the expression evaluation rule, the + * regular expression can not be an assigned + * value */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), vtype != HAWK_VAL_REX); + + out.type = HAWK_RTX_VALTOSTR_CPLDUP; + if (hawk_rtx_valtostr(rtx, val, &out) <= -1) return -1; + + rss = out.u.cpldup; + } + + if (rtx->gbl.rs[0]) + { + hawk_freerex (rtx->awk, rtx->gbl.rs[0], rtx->gbl.rs[1]); + rtx->gbl.rs[0] = HAWK_NULL; + rtx->gbl.rs[1] = HAWK_NULL; + } + + if (rss.len > 1) + { + void* rex, * irex; + hawk_errnum_t errnum; + + /* compile the regular expression */ + if (hawk_buildrex(rtx->awk, rss.ptr, rss.len, &errnum, &rex, &irex) <= -1) + { + SETERR_COD (rtx, errnum); + if (vtype != HAWK_VAL_STR) hawk_rtx_freemem (rtx, rss.ptr); + return -1; + } + + rtx->gbl.rs[0] = rex; + rtx->gbl.rs[1] = irex; + } + + if (vtype != HAWK_VAL_STR) hawk_rtx_freemem (rtx, rss.ptr); + + break; + } + + case HAWK_GBL_STRIPRECSPC: + { + hawk_int_t l; + hawk_flt_t r; + int vt; + + vt = hawk_rtx_valtonum(rtx, val, &l, &r); + if (vt <= -1) return -1; + + if (vt == 0) + rtx->gbl.striprecspc = ((l > 0)? 1: (l < 0)? -1: 0); + else + rtx->gbl.striprecspc = ((r > 0.0)? 1: (r < 0.0)? -1: 0); + break; + } + + case HAWK_GBL_SUBSEP: + { + hawk_rtx_valtostr_out_t out; + + out.type = HAWK_RTX_VALTOSTR_CPLDUP; + if (hawk_rtx_valtostr(rtx, val, &out) <= -1) return -1; + + if (rtx->gbl.subsep.ptr) hawk_rtx_freemem (rtx, rtx->gbl.subsep.ptr); + rtx->gbl.subsep.ptr = out.u.cpldup.ptr; + rtx->gbl.subsep.len = out.u.cpldup.len; + + break; + } + } + + hawk_rtx_refdownval (rtx, old); + RTX_STACK_GBL(rtx,idx) = val; + hawk_rtx_refupval (rtx, val); + + for (ecb = (rtx)->ecb; ecb; ecb = ecb->next) + { + if (ecb->gblset) ecb->gblset (rtx, idx, val); + } + + return 0; +} + +HAWK_INLINE void hawk_rtx_setretval (hawk_rtx_t* rtx, hawk_val_t* val) +{ + hawk_rtx_refdownval (rtx, RTX_STACK_RETVAL(rtx)); + RTX_STACK_RETVAL(rtx) = val; + /* should use the same trick as run_return */ + hawk_rtx_refupval (rtx, val); +} + +HAWK_INLINE int hawk_rtx_setgbl (hawk_rtx_t* rtx, int id, hawk_val_t* val) +{ + HAWK_ASSERT (hawk_rtx_getawk(rtx), id >= 0 && id < (int)HAWK_ARR_SIZE(rtx->awk->parse.gbls)); + return set_global (rtx, id, HAWK_NULL, val, 0); +} + +int hawk_rtx_setfilename (hawk_rtx_t* rtx, const hawk_ooch_t* name, hawk_oow_t len) +{ + hawk_val_t* tmp; + int n; + + tmp = hawk_rtx_makestrvalwithoochars(rtx, name, len); + if (tmp == HAWK_NULL) return -1; + + hawk_rtx_refupval (rtx, tmp); + n = hawk_rtx_setgbl (rtx, HAWK_GBL_FILENAME, tmp); + hawk_rtx_refdownval (rtx, tmp); + + return n; +} + +int hawk_rtx_setofilename (hawk_rtx_t* rtx, const hawk_ooch_t* name, hawk_oow_t len) +{ + hawk_val_t* tmp; + int n; + + if (rtx->awk->opt.trait & HAWK_NEXTOFILE) + { + tmp = hawk_rtx_makestrvalwithoochars(rtx, name, len); + if (tmp == HAWK_NULL) return -1; + + hawk_rtx_refupval (rtx, tmp); + n = hawk_rtx_setgbl (rtx, HAWK_GBL_OFILENAME, tmp); + hawk_rtx_refdownval (rtx, tmp); + } + else n = 0; + + return n; +} + +hawk_htb_t* hawk_rtx_getnvmap (hawk_rtx_t* rtx) +{ + return rtx->named; +} + +struct module_init_ctx_t +{ + hawk_oow_t count; + hawk_rtx_t* rtx; +}; + +struct module_fini_ctx_t +{ + hawk_oow_t limit; + hawk_oow_t count; + hawk_rtx_t* rtx; +}; + +static hawk_rbt_walk_t init_module (hawk_rbt_t* rbt, hawk_rbt_pair_t* pair, void* ctx) +{ + hawk_mod_data_t* md; + struct module_init_ctx_t* mic; + + mic = (struct module_init_ctx_t*)ctx; + + md = (hawk_mod_data_t*)HAWK_RBT_VPTR(pair); + if (md->mod.init && md->mod.init (&md->mod, mic->rtx) <= -1) + return HAWK_RBT_WALK_STOP; + + mic->count++; + return HAWK_RBT_WALK_FORWARD; +} + +static hawk_rbt_walk_t fini_module (hawk_rbt_t* rbt, hawk_rbt_pair_t* pair, void* ctx) +{ + hawk_mod_data_t* md; + struct module_fini_ctx_t* mfc; + + mfc = (struct module_fini_ctx_t*)ctx; + + if (mfc->limit > 0 && mfc->count >= mfc->limit) + return HAWK_RBT_WALK_STOP; + + md = (hawk_mod_data_t*)HAWK_RBT_VPTR(pair); + if (md->mod.fini) md->mod.fini (&md->mod, mfc->rtx); + + mfc->count++; + return HAWK_RBT_WALK_FORWARD; +} + +hawk_rtx_t* hawk_rtx_open (hawk_t* awk, hawk_oow_t xtnsize, hawk_rio_cbs_t* rio) +{ + hawk_rtx_t* rtx; + struct module_init_ctx_t mic; + + /* clear the awk error code */ + hawk_seterrnum (awk, HAWK_ENOERR, HAWK_NULL); + + /* check if the code has ever been parsed */ + if (awk->tree.ngbls == 0 && + awk->tree.begin == HAWK_NULL && + awk->tree.end == HAWK_NULL && + awk->tree.chain_size == 0 && + hawk_htb_getsize(awk->tree.funs) == 0) + { + hawk_seterrnum (awk, HAWK_EPERM, HAWK_NULL); + return HAWK_NULL; + } + + /* allocate the storage for the rtx object */ + rtx = (hawk_rtx_t*)hawk_allocmem(awk, HAWK_SIZEOF(hawk_rtx_t) + xtnsize); + if (!rtx) + { + /* if it fails, the failure is reported thru the awk object */ + return HAWK_NULL; + } + + /* initialize the rtx object */ + HAWK_MEMSET (rtx, 0, HAWK_SIZEOF(hawk_rtx_t) + xtnsize); + rtx->_instsize = HAWK_SIZEOF(hawk_rtx_t); + if (init_rtx(rtx, awk, rio) <= -1) + { + hawk_freemem (awk, rtx); + return HAWK_NULL; + } + + if (init_globals(rtx) <= -1) + { + hawk_rtx_errortohawk (rtx, awk); + fini_rtx (rtx, 0); + hawk_freemem (awk, rtx); + return HAWK_NULL; + } + + mic.count = 0; + mic.rtx = rtx; + hawk_rbt_walk (rtx->awk->modtab, init_module, &mic); + if (mic.count != HAWK_RBT_SIZE(rtx->awk->modtab)) + { + hawk_rtx_errortohawk (rtx, awk); + + if (mic.count > 0) + { + struct module_fini_ctx_t mfc; + mfc.limit = mic.count; + mfc.count = 0; + hawk_rbt_walk (rtx->awk->modtab, fini_module, &mfc); + } + + fini_rtx (rtx, 1); + hawk_freemem (awk, rtx); + return HAWK_NULL; + } + + return rtx; +} + +void hawk_rtx_close (hawk_rtx_t* rtx) +{ + hawk_rtx_ecb_t* ecb; + struct module_fini_ctx_t mfc; + + mfc.limit = 0; + mfc.count = 0; + mfc.rtx = rtx; + hawk_rbt_walk (rtx->awk->modtab, fini_module, &mfc); + + for (ecb = rtx->ecb; ecb; ecb = ecb->next) + { + if (ecb->close) ecb->close (rtx); + } + + /* NOTE: + * the close callbacks are called before data in rtx + * is destroyed. if the destruction count on any data + * destroyed by the close callback, something bad + * will happen. + */ + fini_rtx (rtx, 1); + + hawk_freemem (rtx->awk, rtx); +} + +void hawk_rtx_halt (hawk_rtx_t* rtx) +{ + rtx->exit_level = EXIT_ABORT; +} + +int hawk_rtx_ishalt (hawk_rtx_t* rtx) +{ + return (rtx->exit_level == EXIT_ABORT || rtx->awk->haltall); +} + +void hawk_rtx_getrio (hawk_rtx_t* rtx, hawk_rio_cbs_t* rio) +{ + rio->pipe = rtx->rio.handler[HAWK_RIO_PIPE]; + rio->file = rtx->rio.handler[HAWK_RIO_FILE]; + rio->console = rtx->rio.handler[HAWK_RIO_CONSOLE]; +} + +void hawk_rtx_setrio (hawk_rtx_t* rtx, const hawk_rio_cbs_t* rio) +{ + rtx->rio.handler[HAWK_RIO_PIPE] = rio->pipe; + rtx->rio.handler[HAWK_RIO_FILE] = rio->file; + rtx->rio.handler[HAWK_RIO_CONSOLE] = rio->console; +} + +hawk_rtx_ecb_t* hawk_rtx_popecb (hawk_rtx_t* rtx) +{ + hawk_rtx_ecb_t* top = rtx->ecb; + if (top) rtx->ecb = top->next; + return top; +} + +void hawk_rtx_pushecb (hawk_rtx_t* rtx, hawk_rtx_ecb_t* ecb) +{ + ecb->next = rtx->ecb; + rtx->ecb = ecb; +} + +static void free_namedval (hawk_htb_t* map, void* dptr, hawk_oow_t dlen) +{ + hawk_rtx_refdownval (*(hawk_rtx_t**)hawk_htb_getxtn(map), dptr); +} + +static void same_namedval (hawk_htb_t* map, void* dptr, hawk_oow_t dlen) +{ + hawk_rtx_refdownval_nofree (*(hawk_rtx_t**)hawk_htb_getxtn(map), dptr); +} + +static int init_rtx (hawk_rtx_t* rtx, hawk_t* awk, hawk_rio_cbs_t* rio) +{ + static hawk_htb_style_t style_for_named = + { + { + HAWK_HTB_COPIER_INLINE, + HAWK_HTB_COPIER_DEFAULT + }, + { + HAWK_HTB_FREEER_DEFAULT, + free_namedval + }, + HAWK_HTB_COMPER_DEFAULT, + same_namedval, + HAWK_HTB_SIZER_DEFAULT, + HAWK_HTB_HASHER_DEFAULT + }; + hawk_oow_t stack_limit; + + rtx->_gem = awk->_gem; + rtx->awk = awk; + + CLRERR (rtx); + + stack_limit = awk->parse.pragma.rtx_stack_limit > 0? awk->parse.pragma.rtx_stack_limit: awk->opt.rtx_stack_limit; + if (stack_limit < HAWK_MIN_RTX_STACK_LIMIT) stack_limit = HAWK_MIN_RTX_STACK_LIMIT; + rtx->stack = hawk_rtx_allocmem(rtx, stack_limit * HAWK_SIZEOF(void*)); + if (!rtx->stack) goto oops_0; + rtx->stack_top = 0; + rtx->stack_base = 0; + rtx->stack_limit = stack_limit; + + rtx->exit_level = EXIT_NONE; + + rtx->vmgr.ichunk = HAWK_NULL; + rtx->vmgr.ifree = HAWK_NULL; + rtx->vmgr.rchunk = HAWK_NULL; + rtx->vmgr.rfree = HAWK_NULL; + + rtx->inrec.buf_pos = 0; + rtx->inrec.buf_len = 0; + rtx->inrec.flds = HAWK_NULL; + rtx->inrec.nflds = 0; + rtx->inrec.maxflds = 0; + rtx->inrec.d0 = hawk_val_nil; + + if (hawk_ooecs_init(&rtx->inrec.line, hawk_rtx_getawk(rtx), DEF_BUF_CAPA) <= -1) goto oops_1; + if (hawk_ooecs_init(&rtx->inrec.linew, hawk_rtx_getawk(rtx), DEF_BUF_CAPA) <= -1) goto oops_2; + if (hawk_ooecs_init(&rtx->inrec.lineg, hawk_rtx_getawk(rtx), DEF_BUF_CAPA) <= -1) goto oops_3; + if (hawk_ooecs_init(&rtx->format.out, hawk_rtx_getawk(rtx), 256) <= -1) goto oops_4; + if (hawk_ooecs_init(&rtx->format.fmt, hawk_rtx_getawk(rtx), 256) <= -1) goto oops_5; + + if (hawk_becs_init(&rtx->formatmbs.out, hawk_rtx_getawk(rtx), 256) <= -1) goto oops_6; + if (hawk_becs_init(&rtx->formatmbs.fmt, hawk_rtx_getawk(rtx), 256) <= -1) goto oops_7; + + rtx->named = hawk_htb_open(hawk_rtx_getawk(rtx), HAWK_SIZEOF(rtx), 1024, 70, HAWK_SIZEOF(hawk_ooch_t), 1); + if (!rtx->named) goto oops_8; + *(hawk_rtx_t**)hawk_htb_getxtn(rtx->named) = rtx; + hawk_htb_setstyle (rtx->named, &style_for_named); + + rtx->format.tmp.ptr = (hawk_ooch_t*)hawk_rtx_allocmem(rtx, 4096 * HAWK_SIZEOF(hawk_ooch_t)); + if (!rtx->format.tmp.ptr) goto oops_9; /* the error is set on the awk object after this jump is made */ + rtx->format.tmp.len = 4096; + rtx->format.tmp.inc = 4096 * 2; + + rtx->formatmbs.tmp.ptr = (hawk_bch_t*)hawk_rtx_allocmem(rtx, 4096 * HAWK_SIZEOF(hawk_bch_t)); + if (!rtx->formatmbs.tmp.ptr) goto oops_10; + rtx->formatmbs.tmp.len = 4096; + rtx->formatmbs.tmp.inc = 4096 * 2; + + if (rtx->awk->tree.chain_size > 0) + { + rtx->pattern_range_state = (hawk_oob_t*)hawk_rtx_allocmem(rtx, rtx->awk->tree.chain_size * HAWK_SIZEOF(hawk_oob_t)); + if (!rtx->pattern_range_state) goto oops_11; + HAWK_MEMSET (rtx->pattern_range_state, 0, rtx->awk->tree.chain_size * HAWK_SIZEOF(hawk_oob_t)); + } + else rtx->pattern_range_state = HAWK_NULL; + + if (rio) + { + rtx->rio.handler[HAWK_RIO_PIPE] = rio->pipe; + rtx->rio.handler[HAWK_RIO_FILE] = rio->file; + rtx->rio.handler[HAWK_RIO_CONSOLE] = rio->console; + rtx->rio.chain = HAWK_NULL; + } + + rtx->gbl.rs[0] = HAWK_NULL; + rtx->gbl.rs[1] = HAWK_NULL; + rtx->gbl.fs[0] = HAWK_NULL; + rtx->gbl.fs[1] = HAWK_NULL; + rtx->gbl.ignorecase = 0; + rtx->gbl.striprecspc = -1; + + return 0; + +oops_11: + hawk_rtx_freemem (rtx, rtx->formatmbs.tmp.ptr); +oops_10: + hawk_rtx_freemem (rtx, rtx->format.tmp.ptr); +oops_9: + hawk_htb_close (rtx->named); +oops_8: + hawk_becs_fini (&rtx->formatmbs.fmt); +oops_7: + hawk_becs_fini (&rtx->formatmbs.out); +oops_6: + hawk_ooecs_fini (&rtx->format.fmt); +oops_5: + hawk_ooecs_fini (&rtx->format.out); +oops_4: + hawk_ooecs_fini (&rtx->inrec.lineg); +oops_3: + hawk_ooecs_fini (&rtx->inrec.linew); +oops_2: + hawk_ooecs_fini (&rtx->inrec.line); +oops_1: + hawk_rtx_freemem (rtx, rtx->stack); +oops_0: + hawk_seterrnum (awk, HAWK_ENOMEM, HAWK_NULL); + return -1; +} + +static void fini_rtx (hawk_rtx_t* rtx, int fini_globals) +{ + if (rtx->pattern_range_state) + hawk_rtx_freemem (rtx, rtx->pattern_range_state); + + /* close all pending io's */ + /* TODO: what if this operation fails? */ + hawk_rtx_cleario (rtx); + HAWK_ASSERT (hawk_rtx_getawk(rtx), rtx->rio.chain == HAWK_NULL); + + if (rtx->gbl.rs[0]) + { + hawk_freerex (rtx->awk, rtx->gbl.rs[0], rtx->gbl.rs[1]); + rtx->gbl.rs[0] = HAWK_NULL; + rtx->gbl.rs[1] = HAWK_NULL; + } + if (rtx->gbl.fs[0]) + { + hawk_freerex (rtx->awk, rtx->gbl.fs[0], rtx->gbl.fs[1]); + rtx->gbl.fs[0] = HAWK_NULL; + rtx->gbl.fs[1] = HAWK_NULL; + } + + if (rtx->gbl.convfmt.ptr != HAWK_NULL && + rtx->gbl.convfmt.ptr != DEFAULT_CONVFMT) + { + hawk_rtx_freemem (rtx, rtx->gbl.convfmt.ptr); + rtx->gbl.convfmt.ptr = HAWK_NULL; + rtx->gbl.convfmt.len = 0; + } + + if (rtx->gbl.ofmt.ptr != HAWK_NULL && + rtx->gbl.ofmt.ptr != DEFAULT_OFMT) + { + hawk_rtx_freemem (rtx, rtx->gbl.ofmt.ptr); + rtx->gbl.ofmt.ptr = HAWK_NULL; + rtx->gbl.ofmt.len = 0; + } + + if (rtx->gbl.ofs.ptr != HAWK_NULL && + rtx->gbl.ofs.ptr != DEFAULT_OFS) + { + hawk_rtx_freemem (rtx, rtx->gbl.ofs.ptr); + rtx->gbl.ofs.ptr = HAWK_NULL; + rtx->gbl.ofs.len = 0; + } + + if (rtx->gbl.ors.ptr != HAWK_NULL && + rtx->gbl.ors.ptr != DEFAULT_ORS && + rtx->gbl.ors.ptr != DEFAULT_ORS_CRLF) + { + hawk_rtx_freemem (rtx, rtx->gbl.ors.ptr); + rtx->gbl.ors.ptr = HAWK_NULL; + rtx->gbl.ors.len = 0; + } + + if (rtx->gbl.subsep.ptr != HAWK_NULL && + rtx->gbl.subsep.ptr != DEFAULT_SUBSEP) + { + hawk_rtx_freemem (rtx, rtx->gbl.subsep.ptr); + rtx->gbl.subsep.ptr = HAWK_NULL; + rtx->gbl.subsep.len = 0; + } + + hawk_rtx_freemem (rtx, rtx->formatmbs.tmp.ptr); + rtx->formatmbs.tmp.ptr = HAWK_NULL; + rtx->formatmbs.tmp.len = 0; + hawk_becs_fini (&rtx->formatmbs.fmt); + hawk_becs_fini (&rtx->formatmbs.out); + + hawk_rtx_freemem (rtx, rtx->format.tmp.ptr); + rtx->format.tmp.ptr = HAWK_NULL; + rtx->format.tmp.len = 0; + hawk_ooecs_fini (&rtx->format.fmt); + hawk_ooecs_fini (&rtx->format.out); + + /* destroy input record. hawk_rtx_clrrec() should be called + * before the stack has been destroyed because it may try + * to change the value to HAWK_GBL_NF. */ + hawk_rtx_clrrec (rtx, 0); + if (rtx->inrec.flds) + { + hawk_rtx_freemem (rtx, rtx->inrec.flds); + rtx->inrec.flds = HAWK_NULL; + rtx->inrec.maxflds = 0; + } + hawk_ooecs_fini (&rtx->inrec.lineg); + hawk_ooecs_fini (&rtx->inrec.linew); + hawk_ooecs_fini (&rtx->inrec.line); + + if (fini_globals) refdown_globals (rtx, 1); + + /* destroy the stack if necessary */ + if (rtx->stack) + { + HAWK_ASSERT (hawk_rtx_getawk(rtx), rtx->stack_top == 0); + + hawk_rtx_freemem (rtx, rtx->stack); + rtx->stack = HAWK_NULL; + rtx->stack_top = 0; + rtx->stack_base = 0; + rtx->stack_limit = 0; + } + + /* destroy named variables */ + hawk_htb_close (rtx->named); + + /* destroy values in free list */ + while (rtx->rcache_count > 0) + { + hawk_val_ref_t* tmp = rtx->rcache[--rtx->rcache_count]; + hawk_rtx_freeval (rtx, (hawk_val_t*)tmp, 0); + } + +#if defined(ENABLE_FEATURE_SCACHE) + { + int i; + for (i = 0; i < HAWK_COUNTOF(rtx->scache_count); i++) + { + while (rtx->scache_count[i] > 0) + { + hawk_val_str_t* t = rtx->scache[i][--rtx->scache_count[i]]; + hawk_rtx_freeval (rtx, (hawk_val_t*)t, 0); + } + } + } +#endif + + hawk_rtx_freevalchunk (rtx, rtx->vmgr.ichunk); + hawk_rtx_freevalchunk (rtx, rtx->vmgr.rchunk); + rtx->vmgr.ichunk = HAWK_NULL; + rtx->vmgr.rchunk = HAWK_NULL; +} + +static int update_fnr (hawk_rtx_t* rtx, hawk_int_t fnr, hawk_int_t nr) +{ + hawk_val_t* tmp1, * tmp2; + + tmp1 = hawk_rtx_makeintval(rtx, fnr); + if (!tmp1) return -1; + + hawk_rtx_refupval (rtx, tmp1); + + if (nr == fnr) tmp2 = tmp1; + else + { + tmp2 = hawk_rtx_makeintval(rtx, nr); + if (!tmp2) + { + hawk_rtx_refdownval (rtx, tmp1); + return -1; + } + + hawk_rtx_refupval (rtx, tmp2); + } + + if (hawk_rtx_setgbl (rtx, HAWK_GBL_FNR, tmp1) == -1) + { + if (nr != fnr) hawk_rtx_refdownval (rtx, tmp2); + hawk_rtx_refdownval (rtx, tmp1); + return -1; + } + + if (hawk_rtx_setgbl (rtx, HAWK_GBL_NR, tmp2) == -1) + { + if (nr != fnr) hawk_rtx_refdownval (rtx, tmp2); + hawk_rtx_refdownval (rtx, tmp1); + return -1; + } + + if (nr != fnr) hawk_rtx_refdownval (rtx, tmp2); + hawk_rtx_refdownval (rtx, tmp1); + return 0; +} + +/* + * create global variables into the runtime stack + * each variable is initialized to nil or zero. + */ +static int prepare_globals (hawk_rtx_t* rtx) +{ + hawk_oow_t saved_stack_top; + hawk_oow_t ngbls; + + saved_stack_top = rtx->stack_top; + ngbls = rtx->awk->tree.ngbls; + + /* initialize all global variables to nil by push nils to the stack */ + while (ngbls > 0) + { + --ngbls; + if (__raw_push(rtx,hawk_val_nil) <= -1) + { + SETERR_COD (rtx, HAWK_ENOMEM); + goto oops; + } + } + + /* override NF to zero */ + if (hawk_rtx_setgbl(rtx, HAWK_GBL_NF, HAWK_VAL_ZERO) <= -1) goto oops; + + /* return success */ + return 0; + +oops: + /* restore the stack_top this way instead of calling __raw_pop() + * as many times as successful __raw_push(). it is ok because + * the values pushed so far are hawk_val_nils and HAWK_VAL_ZEROs. + */ + rtx->stack_top = saved_stack_top; + return -1; +} + +/* + * assign initial values to the global variables whose desired initial + * values are not nil or zero. some are handled in prepare_globals () and + * update_fnr(). + */ +static int defaultify_globals (hawk_rtx_t* rtx) +{ + struct gtab_t + { + int idx; + const hawk_ooch_t* str[2]; + }; + static struct gtab_t gtab[7] = + { + { HAWK_GBL_CONVFMT, { DEFAULT_CONVFMT, DEFAULT_CONVFMT } }, + { HAWK_GBL_FILENAME, { HAWK_NULL, HAWK_NULL } }, + { HAWK_GBL_OFILENAME, { HAWK_NULL, HAWK_NULL } }, + { HAWK_GBL_OFMT, { DEFAULT_OFMT, DEFAULT_OFMT } }, + { HAWK_GBL_OFS, { DEFAULT_OFS, DEFAULT_OFS } }, + { HAWK_GBL_ORS, { DEFAULT_ORS, DEFAULT_ORS_CRLF } }, + { HAWK_GBL_SUBSEP, { DEFAULT_SUBSEP, DEFAULT_SUBSEP } }, + }; + + hawk_val_t* tmp; + hawk_oow_t i, j; + int stridx; + + stridx = (rtx->awk->opt.trait & HAWK_CRLF)? 1: 0; + for (i = 0; i < HAWK_COUNTOF(gtab); i++) + { + if (gtab[i].str[stridx] == HAWK_NULL || gtab[i].str[stridx][0] == HAWK_T('\0')) + { + tmp = hawk_val_zls; + } + else + { + tmp = hawk_rtx_makestrvalwithoocstr (rtx, gtab[i].str[stridx]); + if (tmp == HAWK_NULL) return -1; + } + + hawk_rtx_refupval (rtx, tmp); + + HAWK_ASSERT (hawk_rtx_getawk(rtx), RTX_STACK_GBL(rtx,gtab[i].idx) == hawk_val_nil); + + if (hawk_rtx_setgbl(rtx, gtab[i].idx, tmp) == -1) + { + for (j = 0; j < i; j++) + { + hawk_rtx_setgbl (rtx, gtab[i].idx, hawk_val_nil); + } + + hawk_rtx_refdownval (rtx, tmp); + return -1; + } + + hawk_rtx_refdownval (rtx, tmp); + } + + return 0; +} + +static void refdown_globals (hawk_rtx_t* run, int pop) +{ + hawk_oow_t ngbls; + + ngbls = run->awk->tree.ngbls; + while (ngbls > 0) + { + --ngbls; + hawk_rtx_refdownval (run, RTX_STACK_GBL(run,ngbls)); + if (pop) __raw_pop (run); + else RTX_STACK_GBL(run,ngbls) = hawk_val_nil; + } +} + +static int init_globals (hawk_rtx_t* rtx) +{ + /* the stack must be clean when this function is invoked */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), rtx->stack_base == 0); + HAWK_ASSERT (hawk_rtx_getawk(rtx), rtx->stack_top == 0); + + if (prepare_globals (rtx) == -1) return -1; + if (update_fnr (rtx, 0, 0) == -1) goto oops; + if (defaultify_globals (rtx) == -1) goto oops; + return 0; + +oops: + refdown_globals (rtx, 1); + return -1; +} + +struct capture_retval_data_t +{ + hawk_rtx_t* rtx; + hawk_val_t* val; +}; + +static void capture_retval_on_exit (void* arg) +{ + struct capture_retval_data_t* data; + + data = (struct capture_retval_data_t*)arg; + data->val = RTX_STACK_RETVAL(data->rtx); + hawk_rtx_refupval (data->rtx, data->val); +} + +static int enter_stack_frame (hawk_rtx_t* rtx) +{ + hawk_oow_t saved_stack_top; + + /* remember the current stack top */ + saved_stack_top = rtx->stack_top; + + /* push the current stack base */ + if (__raw_push(rtx,(void*)rtx->stack_base) <= -1) goto oops; + + /* push the current stack top before push the current stack base */ + if (__raw_push(rtx,(void*)saved_stack_top) <= -1) goto oops; + + /* secure space for a return value */ + if (__raw_push(rtx,hawk_val_nil) <= -1) goto oops; + + /* secure space for RTX_STACK_NARGS */ + if (__raw_push(rtx,hawk_val_nil) <= -1) goto oops; + + /* let the stack top remembered be the base of a new stack frame */ + rtx->stack_base = saved_stack_top; + return 0; + +oops: + /* restore the stack top in a cheesy(?) way. + * it is ok to do so as the values pushed are + * nils and binary numbers. */ + rtx->stack_top = saved_stack_top; + SETERR_COD (rtx, HAWK_ENOMEM); + return -1; +} + +static void exit_stack_frame (hawk_rtx_t* run) +{ + /* At this point, the current stack frame should have + * the 4 entries pushed in enter_stack_frame(). */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), (run->stack_top-run->stack_base) == 4); + + run->stack_top = (hawk_oow_t)run->stack[run->stack_base + 1]; + run->stack_base = (hawk_oow_t)run->stack[run->stack_base + 0]; +} + +static hawk_val_t* run_bpae_loop (hawk_rtx_t* rtx) +{ + hawk_nde_t* nde; + hawk_oow_t nargs, i; + hawk_val_t* retv; + int ret = 0; + + /* set nargs to zero */ + nargs = 0; + RTX_STACK_NARGS(rtx) = (void*)nargs; + + /* execute the BEGIN block */ + for (nde = rtx->awk->tree.begin; + ret == 0 && nde != HAWK_NULL && rtx->exit_level < EXIT_GLOBAL; + nde = nde->next) + { + hawk_nde_blk_t* blk; + + blk = (hawk_nde_blk_t*)nde; + HAWK_ASSERT (hawk_rtx_getawk(rtx), blk->type == HAWK_NDE_BLK); + + rtx->active_block = blk; + rtx->exit_level = EXIT_NONE; + if (run_block (rtx, blk) == -1) ret = -1; + } + + if (ret <= -1 && hawk_rtx_geterrnum(rtx) == HAWK_ENOERR) + { + /* an error is returned with no error number set. + * this trait is used by eval_expression() to + * abort the evaluation when exit() is executed + * during function evaluation */ + ret = 0; + CLRERR (rtx); /* clear it just in case */ + } + + /* run pattern block loops */ + if (ret == 0 && + (rtx->awk->tree.chain != HAWK_NULL || + rtx->awk->tree.end != HAWK_NULL) && + rtx->exit_level < EXIT_GLOBAL) + { + if (run_pblocks(rtx) <= -1) ret = -1; + } + + if (ret <= -1 && hawk_rtx_geterrnum(rtx) == HAWK_ENOERR) + { + /* an error is returned with no error number set. + * this trait is used by eval_expression() to + * abort the evaluation when exit() is executed + * during function evaluation */ + ret = 0; + CLRERR (rtx); /* clear it just in case */ + } + + /* execute END blocks. the first END block is executed if the + * program is not explicitly aborted with hawk_rtx_halt().*/ + for (nde = rtx->awk->tree.end; + ret == 0 && nde != HAWK_NULL && rtx->exit_level < EXIT_ABORT; + nde = nde->next) + { + hawk_nde_blk_t* blk; + + blk = (hawk_nde_blk_t*)nde; + HAWK_ASSERT (hawk_rtx_getawk(rtx), blk->type == HAWK_NDE_BLK); + + rtx->active_block = blk; + rtx->exit_level = EXIT_NONE; + if (run_block (rtx, blk) <= -1) ret = -1; + else if (rtx->exit_level >= EXIT_GLOBAL) + { + /* once exit is called inside one of END blocks, + * subsequent END blocks must not be executed */ + break; + } + } + + if (ret <= -1 && hawk_rtx_geterrnum(rtx) == HAWK_ENOERR) + { + /* an error is returned with no error number set. + * this trait is used by eval_expression() to + * abort the evaluation when exit() is executed + * during function evaluation */ + ret = 0; + CLRERR (rtx); /* clear it just in case */ + } + + /* derefrence all arguments. however, there should be no arguments + * pushed to the stack as asserted below. we didn't push any arguments + * for BEGIN/pattern action/END block execution.*/ + nargs = (hawk_oow_t)RTX_STACK_NARGS(rtx); + HAWK_ASSERT (hawk_rtx_getawk(rtx), nargs == 0); + for (i = 0; i < nargs; i++) + hawk_rtx_refdownval (rtx, RTX_STACK_ARG(rtx,i)); + + /* get the return value in the current stack frame */ + retv = RTX_STACK_RETVAL(rtx); + + if (ret <= -1) + { + /* end the life of the global return value upon error */ + hawk_rtx_refdownval (rtx, retv); + retv = HAWK_NULL; + } + + return retv; +} + +/* start the BEGIN-pattern block-END loop */ +hawk_val_t* hawk_rtx_loop (hawk_rtx_t* rtx) +{ + hawk_val_t* retv = HAWK_NULL; + + rtx->exit_level = EXIT_NONE; + + if (enter_stack_frame (rtx) == 0) + { + retv = run_bpae_loop (rtx); + exit_stack_frame (rtx); + } + + /* reset the exit level */ + rtx->exit_level = EXIT_NONE; + return retv; +} + +/* find an AWK function by name */ +static hawk_fun_t* find_fun (hawk_rtx_t* rtx, const hawk_ooch_t* name) +{ + hawk_htb_pair_t* pair; + + pair = hawk_htb_search(rtx->awk->tree.funs, name, hawk_count_oocstr(name)); + + if (!pair) + { + hawk_oocs_t nm; + + nm.ptr = (hawk_ooch_t*)name; + nm.len = hawk_count_oocstr(name); + + SETERR_ARGX (rtx, HAWK_EFUNNF, &nm); + return HAWK_NULL; + } + + return (hawk_fun_t*)HAWK_HTB_VPTR(pair); +} + +hawk_fun_t* hawk_rtx_findfunwithbcstr (hawk_rtx_t* rtx, const hawk_bch_t* name) +{ +#if defined(HAWK_OOCH_IS_BCH) + return find_fun(rtx, name); +#else + hawk_ucs_t wcs; + hawk_fun_t* fun; + wcs.ptr = hawk_rtx_dupbtoucstr(rtx, name, &wcs.len, 0); + if (!wcs.ptr) return HAWK_NULL; + fun = find_fun(rtx, wcs.ptr); + hawk_rtx_freemem (rtx, wcs.ptr); + return fun; +#endif +} + +hawk_fun_t* hawk_rtx_findfunwithucstr (hawk_rtx_t* rtx, const hawk_uch_t* name) +{ +#if defined(HAWK_OOCH_IS_BCH) + hawk_bcs_t mbs; + hawk_fun_t* fun; + mbs.ptr = hawk_rtx_duputobcstr(rtx, name, &mbs.len); + if (!mbs.ptr) return HAWK_NULL; + fun = find_fun(rtx, mbs.ptr); + hawk_rtx_freemem (rtx, mbs.ptr); + return fun; +#else + return find_fun(rtx, name); +#endif +} + +/* call an AWK function by the function structure */ +hawk_val_t* hawk_rtx_callfun (hawk_rtx_t* rtx, hawk_fun_t* fun, hawk_val_t* args[], hawk_oow_t nargs) +{ + struct capture_retval_data_t crdata; + hawk_val_t* v; + struct pafv_t pafv/*= { args, nargs }*/; + hawk_nde_fncall_t call; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), fun != HAWK_NULL); + + pafv.args = args; + pafv.nargs = nargs; + pafv.argspec = fun->argspec; + + if (rtx->exit_level >= EXIT_GLOBAL) + { + /* cannot call the function again when exit() is called + * in an AWK program or hawk_rtx_halt() is invoked */ + SETERR_COD (rtx, HAWK_EPERM); + return HAWK_NULL; + } + /*rtx->exit_level = EXIT_NONE;*/ + +#if 0 + if (fun->argspec) + { + /* this function contains pass-by-reference parameters. + * i don't support the call here as it requires variables */ + hawk_rtx_seterrfmt (rtx, HAWK_EPERM, HAWK_NULL, HAWK_T("not allowed to call '%.*js' with pass-by-reference parameters"), (int)fun->name.len, fun->name.ptr); + return HAWK_NULL; + } +#endif + + /* forge a fake node containing a function call */ + HAWK_MEMSET (&call, 0, HAWK_SIZEOF(call)); + call.type = HAWK_NDE_FNCALL_FUN; + call.u.fun.name = fun->name; + call.nargs = nargs; + /* keep HAWK_NULL in call.args so that __eval_call() knows it's a fake call structure */ + + /* check if the number of arguments given is more than expected */ + if (nargs > fun->nargs) + { + /* TODO: is this correct? what if i want to + * allow arbitrary numbers of arguments? */ + SETERR_COD (rtx, HAWK_EARGTM); + return HAWK_NULL; + } + + /* now that the function is found and ok, let's execute it */ + + crdata.rtx = rtx; + crdata.val = HAWK_NULL; + + v = __eval_call(rtx, (hawk_nde_t*)&call, fun, push_arg_from_vals, (void*)&pafv, capture_retval_on_exit, &crdata); + + if (!v) + { + /* an error occurred. let's check if it is caused by exit(). + * if so, the return value should have been captured into + * crdata.val. */ + if (crdata.val) v = crdata.val; /* yet it is */ + } + else + { + /* the return value captured in termination by exit() + * is reference-counted up in capture_retval_on_exit(). + * let's do the same thing for the return value normally + * returned. */ + hawk_rtx_refupval (rtx, v); + } + + /* return the return value with its reference count at least 1. + * the caller of this function should count down its reference. */ + return v; +} + +/* call an AWK function by name */ +hawk_val_t* hawk_rtx_callwithucstr (hawk_rtx_t* rtx, const hawk_uch_t* name, hawk_val_t* args[], hawk_oow_t nargs) +{ + hawk_fun_t* fun; + + fun = hawk_rtx_findfunwithucstr(rtx, name); + if (!fun) return HAWK_NULL; + + return hawk_rtx_callfun(rtx, fun, args, nargs); +} + +hawk_val_t* hawk_rtx_callwithbcstr (hawk_rtx_t* rtx, const hawk_bch_t* name, hawk_val_t* args[], hawk_oow_t nargs) +{ + hawk_fun_t* fun; + + fun = hawk_rtx_findfunwithbcstr(rtx, name); + if (!fun) return HAWK_NULL; + + return hawk_rtx_callfun(rtx, fun, args, nargs); +} + +hawk_val_t* hawk_rtx_callwithucstrarr (hawk_rtx_t* rtx, const hawk_uch_t* name, const hawk_uch_t* args[], hawk_oow_t nargs) +{ + hawk_oow_t i; + hawk_val_t** v, * ret; + + v = hawk_rtx_allocmem(rtx, HAWK_SIZEOF(*v) * nargs); + if (!v) return HAWK_NULL; + + for (i = 0; i < nargs; i++) + { + v[i] = hawk_rtx_makestrvalwithucstr(rtx, args[i]); + if (!v[i]) + { + ret = HAWK_NULL; + goto oops; + } + + hawk_rtx_refupval (rtx, v[i]); + } + + ret = hawk_rtx_callwithucstr(rtx, name, v, nargs); + +oops: + while (i > 0) + { + hawk_rtx_refdownval (rtx, v[--i]); + } + hawk_rtx_freemem (rtx, v); + return ret; +} + +hawk_val_t* hawk_rtx_callwithbcstrarr (hawk_rtx_t* rtx, const hawk_bch_t* name, const hawk_bch_t* args[], hawk_oow_t nargs) +{ + hawk_oow_t i; + hawk_val_t** v, * ret; + + v = hawk_rtx_allocmem(rtx, HAWK_SIZEOF(*v) * nargs); + if (!v) return HAWK_NULL; + + for (i = 0; i < nargs; i++) + { + v[i] = hawk_rtx_makestrvalwithbcstr(rtx, args[i]); + if (!v[i]) + { + ret = HAWK_NULL; + goto oops; + } + + hawk_rtx_refupval (rtx, v[i]); + } + + ret = hawk_rtx_callwithbcstr(rtx, name, v, nargs); + +oops: + while (i > 0) + { + hawk_rtx_refdownval (rtx, v[--i]); + } + hawk_rtx_freemem (rtx, v); + return ret; +} + +static int run_pblocks (hawk_rtx_t* rtx) +{ + int n; + +#define ADJUST_ERROR(run) \ + if (rtx->awk->tree.chain != HAWK_NULL) \ + { \ + if (rtx->awk->tree.chain->pattern != HAWK_NULL) \ + ADJERR_LOC (rtx, &rtx->awk->tree.chain->pattern->loc); \ + else if (rtx->awk->tree.chain->action != HAWK_NULL) \ + ADJERR_LOC (rtx, &rtx->awk->tree.chain->action->loc); \ + } \ + else if (rtx->awk->tree.end != HAWK_NULL) \ + { \ + ADJERR_LOC (run, &rtx->awk->tree.end->loc); \ + } + + rtx->inrec.buf_pos = 0; + rtx->inrec.buf_len = 0; + rtx->inrec.eof = 0; + + /* run each pattern block */ + while (rtx->exit_level < EXIT_GLOBAL) + { + rtx->exit_level = EXIT_NONE; + + n = read_record(rtx); + if (n == -1) + { + ADJUST_ERROR (rtx); + return -1; /* error */ + } + if (n == 0) break; /* end of input */ + + if (rtx->awk->tree.chain) + { + if (run_pblock_chain(rtx, rtx->awk->tree.chain) == -1) return -1; + } + } + +#undef ADJUST_ERROR + return 0; +} + +static int run_pblock_chain (hawk_rtx_t* rtx, hawk_chain_t* chain) +{ + hawk_oow_t bno = 0; + + while (rtx->exit_level < EXIT_GLOBAL && chain) + { + if (rtx->exit_level == EXIT_NEXT) + { + rtx->exit_level = EXIT_NONE; + break; + } + + if (run_pblock(rtx, chain, bno) <= -1) return -1; + + chain = chain->next; + bno++; + } + + return 0; +} + +static int run_pblock (hawk_rtx_t* rtx, hawk_chain_t* cha, hawk_oow_t bno) +{ + hawk_nde_t* ptn; + hawk_nde_blk_t* blk; + + ptn = cha->pattern; + blk = (hawk_nde_blk_t*)cha->action; + + if (!ptn) + { + /* just execute the block */ + rtx->active_block = blk; + if (run_block(rtx, blk) <= -1) return -1; + } + else + { + if (!ptn->next) + { + /* pattern { ... } */ + hawk_val_t* v1; + + v1 = eval_expression(rtx, ptn); + if (!v1) return -1; + + hawk_rtx_refupval (rtx, v1); + + if (hawk_rtx_valtobool(rtx, v1)) + { + rtx->active_block = blk; + if (run_block(rtx, blk) <= -1) + { + hawk_rtx_refdownval (rtx, v1); + return -1; + } + } + + hawk_rtx_refdownval (rtx, v1); + } + else + { + /* pattern, pattern { ... } */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), ptn->next->next == HAWK_NULL); + HAWK_ASSERT (hawk_rtx_getawk(rtx), rtx->pattern_range_state != HAWK_NULL); + + if (rtx->pattern_range_state[bno] == 0) + { + hawk_val_t* v1; + + v1 = eval_expression(rtx, ptn); + if (!v1) return -1; + hawk_rtx_refupval (rtx, v1); + + if (hawk_rtx_valtobool(rtx, v1)) + { + rtx->active_block = blk; + if (run_block(rtx, blk) <= -1) + { + hawk_rtx_refdownval (rtx, v1); + return -1; + } + + rtx->pattern_range_state[bno] = 1; + } + + hawk_rtx_refdownval (rtx, v1); + } + else if (rtx->pattern_range_state[bno] == 1) + { + hawk_val_t* v2; + + v2 = eval_expression(rtx, ptn->next); + if (!v2) return -1; + hawk_rtx_refupval (rtx, v2); + + rtx->active_block = blk; + if (run_block(rtx, blk) <= -1) + { + hawk_rtx_refdownval(rtx, v2); + return -1; + } + + if (hawk_rtx_valtobool(rtx, v2)) rtx->pattern_range_state[bno] = 0; + + hawk_rtx_refdownval (rtx, v2); + } + } + } + + return 0; +} + +static HAWK_INLINE int run_block0 (hawk_rtx_t* rtx, hawk_nde_blk_t* nde) +{ + hawk_nde_t* p; + hawk_oow_t nlcls; + hawk_oow_t saved_stack_top; + int n = 0; + + if (nde == HAWK_NULL) + { + /* blockless pattern - execute print $0*/ + hawk_rtx_refupval (rtx, rtx->inrec.d0); + + n = hawk_rtx_writeiostr(rtx, HAWK_OUT_CONSOLE, HAWK_T(""), HAWK_OOECS_PTR(&rtx->inrec.line), HAWK_OOECS_LEN(&rtx->inrec.line)); + if (n <= -1) + { + hawk_rtx_refdownval (rtx, rtx->inrec.d0); + ADJERR_LOC (rtx, &nde->loc); + return -1; + } + + n = hawk_rtx_writeiostr(rtx, HAWK_OUT_CONSOLE, HAWK_T(""), rtx->gbl.ors.ptr, rtx->gbl.ors.len); + if (n <= -1) + { + hawk_rtx_refdownval (rtx, rtx->inrec.d0); + ADJERR_LOC (rtx, &nde->loc); + return -1; + } + + hawk_rtx_refdownval (rtx, rtx->inrec.d0); + return 0; + } + + HAWK_ASSERT (hawk_rtx_getawk(rtx), nde->type == HAWK_NDE_BLK); + + p = nde->body; + nlcls = nde->nlcls; + +#if defined(DEBUG_RUN) + hawk_logfmt (hawk_rtx_getawk(rtx), + HAWK_T("securing space for local variables nlcls = %d\n"), + (int)nlcls); +#endif + + saved_stack_top = rtx->stack_top; + + /* secure space for local variables */ + while (nlcls > 0) + { + --nlcls; + if (__raw_push(rtx,hawk_val_nil) <= -1) + { + /* restore stack top */ + rtx->stack_top = saved_stack_top; + return -1; + } + + /* refupval is not required for hawk_val_nil */ + } + +#if defined(DEBUG_RUN) + hawk_logfmt (hawk_rtx_getawk(rtx), HAWK_T("executing block statements\n")); +#endif + + while (p != HAWK_NULL && rtx->exit_level == EXIT_NONE) + { + if (run_statement(rtx, p) <= -1) + { + n = -1; + break; + } + p = p->next; + } + + /* pop off local variables */ +#if defined(DEBUG_RUN) + hawk_logfmt (hawk_rtx_getawk(rtx), HAWK_T("popping off local variables\n")); +#endif + nlcls = nde->nlcls; + while (nlcls > 0) + { + --nlcls; + hawk_rtx_refdownval (rtx, RTX_STACK_LCL(rtx,nlcls)); + __raw_pop (rtx); + } + + return n; +} + +static int run_block (hawk_rtx_t* rtx, hawk_nde_blk_t* nde) +{ + int n; + + if (rtx->awk->opt.depth.s.block_run > 0 && + rtx->depth.block >= rtx->awk->opt.depth.s.block_run) + { + SETERR_LOC (rtx, HAWK_EBLKNST, &nde->loc); + return -1;; + } + + rtx->depth.block++; + n = run_block0(rtx, nde); + rtx->depth.block--; + + return n; +} + +#define ON_STATEMENT(rtx,nde) do { \ + hawk_rtx_ecb_t* ecb; \ + if ((rtx)->awk->haltall) (rtx)->exit_level = EXIT_ABORT; \ + for (ecb = (rtx)->ecb; ecb; ecb = ecb->next) \ + if (ecb->stmt) ecb->stmt (rtx, nde); \ +} while(0) + +static int run_statement (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + int xret; + hawk_val_t* tmp; + + ON_STATEMENT (rtx, nde); + + switch (nde->type) + { + case HAWK_NDE_NULL: + /* do nothing */ + xret = 0; + break; + + case HAWK_NDE_BLK: + xret = run_block(rtx, (hawk_nde_blk_t*)nde); + break; + + case HAWK_NDE_IF: + xret = run_if(rtx, (hawk_nde_if_t*)nde); + break; + + case HAWK_NDE_WHILE: + case HAWK_NDE_DOWHILE: + xret = run_while(rtx, (hawk_nde_while_t*)nde); + break; + + case HAWK_NDE_FOR: + xret = run_for(rtx, (hawk_nde_for_t*)nde); + break; + + case HAWK_NDE_FOREACH: + xret = run_foreach(rtx, (hawk_nde_foreach_t*)nde); + break; + + case HAWK_NDE_BREAK: + xret = run_break(rtx, (hawk_nde_break_t*)nde); + break; + + case HAWK_NDE_CONTINUE: + xret = run_continue(rtx, (hawk_nde_continue_t*)nde); + break; + + case HAWK_NDE_RETURN: + xret = run_return(rtx, (hawk_nde_return_t*)nde); + break; + + case HAWK_NDE_EXIT: + xret = run_exit(rtx, (hawk_nde_exit_t*)nde); + break; + + case HAWK_NDE_NEXT: + xret = run_next(rtx, (hawk_nde_next_t*)nde); + break; + + case HAWK_NDE_NEXTFILE: + xret = run_nextfile(rtx, (hawk_nde_nextfile_t*)nde); + break; + + case HAWK_NDE_DELETE: + xret = run_delete(rtx, (hawk_nde_delete_t*)nde); + break; + + case HAWK_NDE_RESET: + xret = run_reset(rtx, (hawk_nde_reset_t*)nde); + break; + + case HAWK_NDE_PRINT: + if (rtx->awk->opt.trait & HAWK_TOLERANT) goto __fallback__; + xret = run_print(rtx, (hawk_nde_print_t*)nde); + break; + + case HAWK_NDE_PRINTF: + if (rtx->awk->opt.trait & HAWK_TOLERANT) goto __fallback__; + xret = run_printf(rtx, (hawk_nde_print_t*)nde); + break; + + default: + __fallback__: + tmp = eval_expression(rtx, nde); + if (tmp == HAWK_NULL) xret = -1; + else + { + /* destroy the value if not referenced */ + hawk_rtx_refupval (rtx, tmp); + hawk_rtx_refdownval (rtx, tmp); + xret = 0; + } + break; + } + + return xret; +} + +static int run_if (hawk_rtx_t* rtx, hawk_nde_if_t* nde) +{ + hawk_val_t* test; + int n = 0; + + /* the test expression for the if statement cannot have + * chained expressions. this should not be allowed by the + * parser first of all */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), nde->test->next == HAWK_NULL); + + test = eval_expression (rtx, nde->test); + if (test == HAWK_NULL) return -1; + + hawk_rtx_refupval (rtx, test); + if (hawk_rtx_valtobool(rtx, test)) + { + n = run_statement(rtx, nde->then_part); + } + else if (nde->else_part) + { + n = run_statement(rtx, nde->else_part); + } + + hawk_rtx_refdownval (rtx, test); /* TODO: is this correct?*/ + return n; +} + +static int run_while (hawk_rtx_t* rtx, hawk_nde_while_t* nde) +{ + hawk_val_t* test; + + if (nde->type == HAWK_NDE_WHILE) + { + /* no chained expressions are allowed for the test + * expression of the while statement */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), nde->test->next == HAWK_NULL); + + while (1) + { + ON_STATEMENT (rtx, nde->test); + + test = eval_expression(rtx, nde->test); + if (!test) return -1; + + hawk_rtx_refupval (rtx, test); + + if (hawk_rtx_valtobool(rtx, test)) + { + if (run_statement(rtx,nde->body) <= -1) + { + hawk_rtx_refdownval (rtx, test); + return -1; + } + } + else + { + hawk_rtx_refdownval (rtx, test); + break; + } + + hawk_rtx_refdownval (rtx, test); + + if (rtx->exit_level == EXIT_BREAK) + { + rtx->exit_level = EXIT_NONE; + break; + } + else if (rtx->exit_level == EXIT_CONTINUE) + { + rtx->exit_level = EXIT_NONE; + } + else if (rtx->exit_level != EXIT_NONE) break; + + } + } + else if (nde->type == HAWK_NDE_DOWHILE) + { + /* no chained expressions are allowed for the test + * expression of the while statement */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), nde->test->next == HAWK_NULL); + + do + { + if (run_statement(rtx,nde->body) <= -1) return -1; + + if (rtx->exit_level == EXIT_BREAK) + { + rtx->exit_level = EXIT_NONE; + break; + } + else if (rtx->exit_level == EXIT_CONTINUE) + { + rtx->exit_level = EXIT_NONE; + } + else if (rtx->exit_level != EXIT_NONE) break; + + ON_STATEMENT (rtx, nde->test); + + test = eval_expression(rtx, nde->test); + if (!test) return -1; + + hawk_rtx_refupval (rtx, test); + + if (!hawk_rtx_valtobool(rtx, test)) + { + hawk_rtx_refdownval (rtx, test); + break; + } + + hawk_rtx_refdownval (rtx, test); + } + while (1); + } + + return 0; +} + +static int run_for (hawk_rtx_t* rtx, hawk_nde_for_t* nde) +{ + hawk_val_t* val; + + if (nde->init != HAWK_NULL) + { + HAWK_ASSERT (hawk_rtx_getawk(rtx), nde->init->next == HAWK_NULL); + + ON_STATEMENT (rtx, nde->init); + val = eval_expression(rtx,nde->init); + if (val == HAWK_NULL) return -1; + + hawk_rtx_refupval (rtx, val); + hawk_rtx_refdownval (rtx, val); + } + + while (1) + { + if (nde->test != HAWK_NULL) + { + hawk_val_t* test; + + /* no chained expressions for the test expression of + * the for statement are allowed */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), nde->test->next == HAWK_NULL); + + ON_STATEMENT (rtx, nde->test); + test = eval_expression (rtx, nde->test); + if (test == HAWK_NULL) return -1; + + hawk_rtx_refupval (rtx, test); + if (hawk_rtx_valtobool(rtx, test)) + { + if (run_statement(rtx,nde->body) == -1) + { + hawk_rtx_refdownval (rtx, test); + return -1; + } + } + else + { + hawk_rtx_refdownval (rtx, test); + break; + } + + hawk_rtx_refdownval (rtx, test); + } + else + { + if (run_statement(rtx,nde->body) == -1) return -1; + } + + if (rtx->exit_level == EXIT_BREAK) + { + rtx->exit_level = EXIT_NONE; + break; + } + else if (rtx->exit_level == EXIT_CONTINUE) + { + rtx->exit_level = EXIT_NONE; + } + else if (rtx->exit_level != EXIT_NONE) break; + + if (nde->incr != HAWK_NULL) + { + HAWK_ASSERT (hawk_rtx_getawk(rtx), nde->incr->next == HAWK_NULL); + + ON_STATEMENT (rtx, nde->incr); + val = eval_expression (rtx, nde->incr); + if (val == HAWK_NULL) return -1; + + hawk_rtx_refupval (rtx, val); + hawk_rtx_refdownval (rtx, val); + } + } + + return 0; +} + +struct foreach_walker_t +{ + hawk_rtx_t* rtx; + hawk_nde_t* var; + hawk_nde_t* body; + int ret; +}; + +static hawk_htb_walk_t walk_foreach (hawk_htb_t* map, hawk_htb_pair_t* pair, void* arg) +{ + struct foreach_walker_t* w = (struct foreach_walker_t*)arg; + hawk_val_t* str; + + str = (hawk_val_t*)hawk_rtx_makestrvalwithoochars(w->rtx, HAWK_HTB_KPTR(pair), HAWK_HTB_KLEN(pair)); + if (str == HAWK_NULL) + { + ADJERR_LOC (w->rtx, &w->var->loc); + w->ret = -1; + return HAWK_HTB_WALK_STOP; + } + + hawk_rtx_refupval (w->rtx, str); + if (do_assignment(w->rtx, w->var, str) == HAWK_NULL) + { + hawk_rtx_refdownval (w->rtx, str); + w->ret = -1; + return HAWK_HTB_WALK_STOP; + } + + if (run_statement(w->rtx, w->body) == -1) + { + hawk_rtx_refdownval (w->rtx, str); + w->ret = -1; + return HAWK_HTB_WALK_STOP; + } + + hawk_rtx_refdownval (w->rtx, str); + + if (w->rtx->exit_level == EXIT_BREAK) + { + w->rtx->exit_level = EXIT_NONE; + return HAWK_HTB_WALK_STOP; + } + else if (w->rtx->exit_level == EXIT_CONTINUE) + { + w->rtx->exit_level = EXIT_NONE; + } + else if (w->rtx->exit_level != EXIT_NONE) + { + return HAWK_HTB_WALK_STOP; + } + + return HAWK_HTB_WALK_FORWARD; +} + +static int run_foreach (hawk_rtx_t* rtx, hawk_nde_foreach_t* nde) +{ + hawk_nde_exp_t* test; + hawk_val_t* rv; + hawk_htb_t* map; + struct foreach_walker_t walker; + hawk_val_type_t rvtype; + + test = (hawk_nde_exp_t*)nde->test; + HAWK_ASSERT (hawk_rtx_getawk(rtx), test->type == HAWK_NDE_EXP_BIN && test->opcode == HAWK_BINOP_IN); + + /* chained expressions should not be allowed + * by the parser first of all */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), test->right->next == HAWK_NULL); + + rv = eval_expression(rtx, test->right); + if (rv == HAWK_NULL) return -1; + + hawk_rtx_refupval (rtx, rv); + rvtype = HAWK_RTX_GETVALTYPE(rtx, rv); + if (rvtype == HAWK_VAL_NIL) + { + /* just return without excuting the loop body */ + hawk_rtx_refdownval (rtx, rv); + return 0; + } + else if (rvtype != HAWK_VAL_MAP) + { + hawk_rtx_refdownval (rtx, rv); + SETERR_LOC (rtx, HAWK_ENOTMAPIN, &test->right->loc); + return -1; + } + map = ((hawk_val_map_t*)rv)->map; + + walker.rtx = rtx; + walker.var = test->left; + walker.body = nde->body; + walker.ret = 0; + hawk_htb_walk (map, walk_foreach, &walker); + + hawk_rtx_refdownval (rtx, rv); + return walker.ret; +} + +static int run_break (hawk_rtx_t* run, hawk_nde_break_t* nde) +{ + run->exit_level = EXIT_BREAK; + return 0; +} + +static int run_continue (hawk_rtx_t* rtx, hawk_nde_continue_t* nde) +{ + rtx->exit_level = EXIT_CONTINUE; + return 0; +} + +static int run_return (hawk_rtx_t* rtx, hawk_nde_return_t* nde) +{ + if (nde->val != HAWK_NULL) + { + hawk_val_t* val; + + /* chained expressions should not be allowed + * by the parser first of all */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), nde->val->next == HAWK_NULL); + + val = eval_expression (rtx, nde->val); + if (val == HAWK_NULL) return -1; + + if (!(rtx->awk->opt.trait & HAWK_FLEXMAP)) + { + if (HAWK_RTX_GETVALTYPE (rtx, val) == HAWK_VAL_MAP) + { + /* cannot return a map */ + hawk_rtx_refupval (rtx, val); + hawk_rtx_refdownval (rtx, val); + SETERR_LOC (rtx, HAWK_EMAPRET, &nde->loc); + return -1; + } + } + + hawk_rtx_refdownval (rtx, RTX_STACK_RETVAL(rtx)); + RTX_STACK_RETVAL(rtx) = val; + + /* NOTE: see eval_call() for the trick */ + hawk_rtx_refupval (rtx, val); + } + + rtx->exit_level = EXIT_FUNCTION; + return 0; +} + +static int run_exit (hawk_rtx_t* rtx, hawk_nde_exit_t* nde) +{ + if (nde->val != HAWK_NULL) + { + hawk_val_t* val; + + /* chained expressions should not be allowed + * by the parser first of all */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), nde->val->next == HAWK_NULL); + + val = eval_expression (rtx, nde->val); + if (val == HAWK_NULL) return -1; + + hawk_rtx_refdownval (rtx, RTX_STACK_RETVAL_GBL(rtx)); + RTX_STACK_RETVAL_GBL(rtx) = val; /* global return value */ + + hawk_rtx_refupval (rtx, val); + } + + rtx->exit_level = (nde->abort)? EXIT_ABORT: EXIT_GLOBAL; + return 0; +} + +static int run_next (hawk_rtx_t* run, hawk_nde_next_t* nde) +{ + /* the parser checks if next has been called in the begin/end + * block or whereever inappropriate. so the runtime doesn't + * check that explicitly */ + if (run->active_block == (hawk_nde_blk_t*)run->awk->tree.begin) + { + SETERR_LOC (run, HAWK_ERNEXTBEG, &nde->loc); + return -1; + } + else if (run->active_block == (hawk_nde_blk_t*)run->awk->tree.end) + { + SETERR_LOC (run, HAWK_ERNEXTEND, &nde->loc); + return -1; + } + + run->exit_level = EXIT_NEXT; + return 0; +} + +static int run_nextinfile (hawk_rtx_t* rtx, hawk_nde_nextfile_t* nde) +{ + int n; + + /* normal nextfile statement */ + if (rtx->active_block == (hawk_nde_blk_t*)rtx->awk->tree.begin) + { + SETERR_LOC (rtx, HAWK_ERNEXTFBEG, &nde->loc); + return -1; + } + else if (rtx->active_block == (hawk_nde_blk_t*)rtx->awk->tree.end) + { + SETERR_LOC (rtx, HAWK_ERNEXTFEND, &nde->loc); + return -1; + } + + n = hawk_rtx_nextio_read (rtx, HAWK_IN_CONSOLE, HAWK_T("")); + if (n == -1) + { + ADJERR_LOC (rtx, &nde->loc); + return -1; + } + + if (n == 0) + { + /* no more input console */ + rtx->exit_level = EXIT_GLOBAL; + return 0; + } + + /* FNR resets to 0, NR remains the same */ + if (update_fnr (rtx, 0, rtx->gbl.nr) == -1) + { + ADJERR_LOC (rtx, &nde->loc); + return -1; + } + + rtx->exit_level = EXIT_NEXT; + return 0; + +} + +static int run_nextoutfile (hawk_rtx_t* rtx, hawk_nde_nextfile_t* nde) +{ + int n; + + /* nextofile can be called from BEGIN and END block unlike nextfile */ + + n = hawk_rtx_nextio_write (rtx, HAWK_OUT_CONSOLE, HAWK_T("")); + if (n == -1) + { + /* adjust the error line */ + ADJERR_LOC (rtx, &nde->loc); + return -1; + } + + if (n == 0) + { + /* should it terminate the program there is no more + * output console? no. there will just be no more console + * output */ + /*rtx->exit_level = EXIT_GLOBAL;*/ + return 0; + } + + return 0; +} + +static int run_nextfile (hawk_rtx_t* rtx, hawk_nde_nextfile_t* nde) +{ + return (nde->out)? + run_nextoutfile (rtx, nde): + run_nextinfile (rtx, nde); +} + +static int delete_indexed ( + hawk_rtx_t* rtx, hawk_htb_t* map, hawk_nde_var_t* var) +{ + hawk_val_t* idx; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), var->idx != HAWK_NULL); + + idx = eval_expression (rtx, var->idx); + if (idx == HAWK_NULL) return -1; + + hawk_rtx_refupval (rtx, idx); + + if (HAWK_RTX_GETVALTYPE (rtx, idx) == HAWK_VAL_STR) + { + /* delete x["abc"] */ + + hawk_htb_delete ( + map, + ((hawk_val_str_t*)idx)->val.ptr, + ((hawk_val_str_t*)idx)->val.len + ); + hawk_rtx_refdownval (rtx, idx); + } + else + { + /* delete x[20] */ + hawk_ooch_t buf[IDXBUFSIZE]; + hawk_rtx_valtostr_out_t out; + + /* try with a fixed-size buffer */ + out.type = HAWK_RTX_VALTOSTR_CPLCPY; + out.u.cplcpy.ptr = buf; + out.u.cplcpy.len = HAWK_COUNTOF(buf); + if (hawk_rtx_valtostr (rtx, idx, &out) <= -1) + { + int n; + + /* retry it in dynamic mode */ + out.type = HAWK_RTX_VALTOSTR_CPLDUP; + n = hawk_rtx_valtostr (rtx, idx, &out); + hawk_rtx_refdownval (rtx, idx); + if (n <= -1) + { + /* change the error line */ + ADJERR_LOC (rtx, &var->loc); + return -1; + } + else + { + hawk_htb_delete (map, out.u.cpldup.ptr, out.u.cpldup.len); + hawk_rtx_freemem (rtx, out.u.cpldup.ptr); + } + } + else + { + hawk_rtx_refdownval (rtx, idx); + hawk_htb_delete (map, out.u.cplcpy.ptr, out.u.cplcpy.len); + } + } + + return 0; +} + +static int run_delete_named (hawk_rtx_t* rtx, hawk_nde_var_t* var) +{ + hawk_htb_pair_t* pair; + + /* if a named variable has an index part and a named indexed variable + * doesn't have an index part, the program is definitely wrong */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), + (var->type == HAWK_NDE_NAMED && var->idx == HAWK_NULL) || + (var->type == HAWK_NDE_NAMEDIDX && var->idx != HAWK_NULL)); + + pair = hawk_htb_search(rtx->named, var->id.name.ptr, var->id.name.len); + if (pair == HAWK_NULL) + { + hawk_val_t* tmp; + + /* value not set for the named variable. + * create a map and assign it to the variable */ + + tmp = hawk_rtx_makemapval(rtx); + if (tmp == HAWK_NULL) + { + /* adjust error line */ + ADJERR_LOC (rtx, &var->loc); + return -1; + } + + pair = hawk_htb_upsert(rtx->named, var->id.name.ptr, var->id.name.len, tmp, 0); + if (pair == HAWK_NULL) + { + hawk_rtx_refupval (rtx, tmp); + hawk_rtx_refdownval (rtx, tmp); + SETERR_LOC (rtx, HAWK_ENOMEM, &var->loc); + return -1; + } + + /* as this is the assignment, it needs to update + * the reference count of the target value. */ + hawk_rtx_refupval (rtx, tmp); + } + else + { + hawk_val_t* val; + hawk_htb_t* map; + + val = (hawk_val_t*)HAWK_HTB_VPTR(pair); + HAWK_ASSERT (hawk_rtx_getawk(rtx), val != HAWK_NULL); + + if (HAWK_RTX_GETVALTYPE (rtx, val) != HAWK_VAL_MAP) + { + SETERR_ARGX_LOC (rtx, HAWK_ENOTDEL, &var->id.name, &var->loc); + return -1; + } + + map = ((hawk_val_map_t*)val)->map; + if (var->type == HAWK_NDE_NAMEDIDX) + { + if (delete_indexed(rtx, map, var) <= -1) return -1; + } + else + { + hawk_htb_clear (map); + } + } + + return 0; +} + +static int run_delete_unnamed (hawk_rtx_t* rtx, hawk_nde_var_t* var) +{ + hawk_val_t* val; + hawk_val_type_t vtype; + + switch (var->type) + { + case HAWK_NDE_GBL: + case HAWK_NDE_GBLIDX: + val = RTX_STACK_GBL(rtx,var->id.idxa); + break; + + case HAWK_NDE_LCL: + case HAWK_NDE_LCLIDX: + val = RTX_STACK_LCL(rtx,var->id.idxa); + break; + + default: + val = RTX_STACK_ARG(rtx,var->id.idxa); + break; + } + + HAWK_ASSERT (hawk_rtx_getawk(rtx), val != HAWK_NULL); + + vtype = HAWK_RTX_GETVALTYPE(rtx, val); + if (vtype == HAWK_VAL_NIL) + { + hawk_val_t* tmp; + + /* value not set. + * create a map and assign it to the variable */ + + tmp = hawk_rtx_makemapval(rtx); + if (tmp == HAWK_NULL) + { + ADJERR_LOC (rtx, &var->loc); + return -1; + } + + /* no need to reduce the reference count of + * the previous value because it was nil. */ + switch (var->type) + { + case HAWK_NDE_GBL: + case HAWK_NDE_GBLIDX: + { + int x; + + hawk_rtx_refupval (rtx, tmp); + x = hawk_rtx_setgbl(rtx, (int)var->id.idxa, tmp); + hawk_rtx_refdownval (rtx, tmp); + + if (x <= -1) + { + ADJERR_LOC (rtx, &var->loc); + return -1; + } + break; + } + + case HAWK_NDE_LCL: + case HAWK_NDE_LCLIDX: + RTX_STACK_LCL(rtx,var->id.idxa) = tmp; + hawk_rtx_refupval (rtx, tmp); + break; + + default: + RTX_STACK_ARG(rtx,var->id.idxa) = tmp; + hawk_rtx_refupval (rtx, tmp); + break; + } + } + else + { + hawk_htb_t* map; + + if (vtype != HAWK_VAL_MAP) + { + SETERR_ARGX_LOC (rtx, HAWK_ENOTDEL, &var->id.name, &var->loc); + return -1; + } + + map = ((hawk_val_map_t*)val)->map; + if (var->type == HAWK_NDE_GBLIDX || + var->type == HAWK_NDE_LCLIDX || + var->type == HAWK_NDE_ARGIDX) + { + if (delete_indexed(rtx, map, var) <= -1) return -1; + } + else + { + hawk_htb_clear (map); + } + } + + return 0; +} + +static int run_delete (hawk_rtx_t* rtx, hawk_nde_delete_t* nde) +{ + hawk_nde_var_t* var; + + var = (hawk_nde_var_t*)nde->var; + + switch (var->type) + { + case HAWK_NDE_NAMED: + case HAWK_NDE_NAMEDIDX: + return run_delete_named(rtx, var); + + case HAWK_NDE_GBL: + case HAWK_NDE_LCL: + case HAWK_NDE_ARG: + case HAWK_NDE_GBLIDX: + case HAWK_NDE_LCLIDX: + case HAWK_NDE_ARGIDX: + return run_delete_unnamed(rtx, var); + + default: + /* the delete statement cannot be called with other nodes than + * the variables such as a named variable, a named indexed variable, etc */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), !"should never happen - wrong target for delete"); + SETERR_LOC (rtx, HAWK_EBADARG, &var->loc); + return -1; + } + +} + +static int reset_variable (hawk_rtx_t* rtx, hawk_nde_var_t* var) +{ + switch (var->type) + { + case HAWK_NDE_NAMED: + /* if a named variable has an index part, something is definitely wrong */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), var->type == HAWK_NDE_NAMED && var->idx == HAWK_NULL); + + /* a named variable can be reset if removed from a internal map + to manage it */ + hawk_htb_delete (rtx->named, var->id.name.ptr, var->id.name.len); + return 0; + + case HAWK_NDE_GBL: + case HAWK_NDE_LCL: + case HAWK_NDE_ARG: + { + hawk_val_t* val; + + switch (var->type) + { + case HAWK_NDE_GBL: + val = RTX_STACK_GBL(rtx,var->id.idxa); + break; + + case HAWK_NDE_LCL: + val = RTX_STACK_LCL(rtx,var->id.idxa); + break; + + case HAWK_NDE_ARG: + val = RTX_STACK_ARG(rtx,var->id.idxa); + break; + } + + HAWK_ASSERT (hawk_rtx_getawk(rtx), val != HAWK_NULL); + + if (HAWK_RTX_GETVALTYPE (rtx, val) != HAWK_VAL_NIL) + { + hawk_rtx_refdownval (rtx, val); + switch (var->type) + { + case HAWK_NDE_GBL: + RTX_STACK_GBL(rtx,var->id.idxa) = hawk_val_nil; + break; + + case HAWK_NDE_LCL: + RTX_STACK_LCL(rtx,var->id.idxa) = hawk_val_nil; + break; + + case HAWK_NDE_ARG: + RTX_STACK_ARG(rtx,var->id.idxa) = hawk_val_nil; + break; + } + } + return 0; + } + + default: + /* the reset statement can only be called with plain variables */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), !"should never happen - wrong target for reset"); + SETERR_LOC (rtx, HAWK_EBADARG, &var->loc); + return -1; + } +} + +static int run_reset (hawk_rtx_t* rtx, hawk_nde_reset_t* nde) +{ + return reset_variable (rtx, (hawk_nde_var_t*)nde->var); +} + +static int run_print (hawk_rtx_t* rtx, hawk_nde_print_t* nde) +{ + hawk_ooch_t* out = HAWK_NULL; + hawk_val_t* out_v = HAWK_NULL; + const hawk_ooch_t* dst; + int n, xret = 0; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), + (nde->out_type == HAWK_OUT_PIPE && nde->out != HAWK_NULL) || + (nde->out_type == HAWK_OUT_RWPIPE && nde->out != HAWK_NULL) || + (nde->out_type == HAWK_OUT_FILE && nde->out != HAWK_NULL) || + (nde->out_type == HAWK_OUT_APFILE && nde->out != HAWK_NULL) || + (nde->out_type == HAWK_OUT_CONSOLE && nde->out == HAWK_NULL)); + + /* check if destination has been specified. */ + if (nde->out) + { + hawk_oow_t len; + + /* if so, resolve the destination name */ + out_v = eval_expression(rtx, nde->out); + if (!out_v) return -1; + + hawk_rtx_refupval (rtx, out_v); + + out = hawk_rtx_getvaloocstr(rtx, out_v, &len); + if (!out) goto oops; + + if (len <= 0) + { + /* the destination name is empty */ + SETERR_LOC (rtx, HAWK_EIONMEM, &nde->loc); + goto oops; + } + + /* it needs to check if the destination name contains + * any invalid characters to the underlying system */ + while (len > 0) + { + if (out[--len] == HAWK_T('\0')) + { + /* provide length up to one character before + * the first null not to contains a null + * in an error message */ + SETERR_ARG_LOC ( + rtx, HAWK_EIONMNL, + out, hawk_count_oocstr(out), &nde->loc); + + /* if so, it skips writing */ + goto oops_1; + } + } + } + + /* transforms the destination to suit the usage with io */ + dst = (out == HAWK_NULL)? HAWK_T(""): out; + + /* check if print is followed by any arguments */ + if (!nde->args) + { + /* if it doesn't have any arguments, print the entire + * input record */ + n = hawk_rtx_writeiostr(rtx, nde->out_type, dst, HAWK_OOECS_PTR(&rtx->inrec.line), HAWK_OOECS_LEN(&rtx->inrec.line)); + if (n <= -1 /*&& rtx->errinf.num != HAWK_EIOIMPL*/) + { + if (rtx->awk->opt.trait & HAWK_TOLERANT) + { + xret = PRINT_IOERR; + } + else + { + goto oops; + } + } + } + else + { + /* if it has any arguments, print the arguments separated by + * the value OFS */ + hawk_nde_t* head, * np; + hawk_val_t* v; + + if (nde->args->type == HAWK_NDE_GRP) + { + /* parenthesized print */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), nde->args->next == HAWK_NULL); + head = ((hawk_nde_grp_t*)nde->args)->body; + } + else head = nde->args; + + for (np = head; np != HAWK_NULL; np = np->next) + { + if (np != head) + { + n = hawk_rtx_writeiostr(rtx, nde->out_type, dst, rtx->gbl.ofs.ptr, rtx->gbl.ofs.len); + if (n <= -1 /*&& rtx->errinf.num != HAWK_EIOIMPL*/) + { + if (rtx->awk->opt.trait & HAWK_TOLERANT) + { + xret = PRINT_IOERR; + } + else + { + goto oops; + } + } + } + + v = eval_expression(rtx, np); + if (v == HAWK_NULL) goto oops_1; + + hawk_rtx_refupval (rtx, v); + n = hawk_rtx_writeioval(rtx, nde->out_type, dst, v); + hawk_rtx_refdownval (rtx, v); + + if (n <= -1 /*&& rtx->errinf.num != HAWK_EIOIMPL*/) + { + if (rtx->awk->opt.trait & HAWK_TOLERANT) + { + xret = PRINT_IOERR; + } + else + { + goto oops; + } + } + } + } + + /* print the value ORS to terminate the operation */ + n = hawk_rtx_writeiostr(rtx, nde->out_type, dst, rtx->gbl.ors.ptr, rtx->gbl.ors.len); + if (n <= -1 /*&& rtx->errinf.num != HAWK_EIOIMPL*/) + { + if (rtx->awk->opt.trait & HAWK_TOLERANT) + { + xret = PRINT_IOERR; + } + else + { + goto oops; + } + } + + /* unlike printf, flushio() is not needed here as print + * inserts that triggers auto-flush */ + if (out_v) + { + if (out) hawk_rtx_freevaloocstr (rtx, out_v, out); + hawk_rtx_refdownval (rtx, out_v); + } + + return xret; + +oops: + ADJERR_LOC (rtx, &nde->loc); + +oops_1: + if (out_v) + { + if (out) hawk_rtx_freevaloocstr (rtx, out_v, out); + hawk_rtx_refdownval (rtx, out_v); + } + + return -1; +} + +static int run_printf (hawk_rtx_t* rtx, hawk_nde_print_t* nde) +{ + hawk_ooch_t* out = HAWK_NULL; + hawk_val_t* out_v = HAWK_NULL; + hawk_val_t* v; + hawk_val_type_t vtype; + const hawk_ooch_t* dst; + hawk_nde_t* head; + int n, xret = 0; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), + (nde->out_type == HAWK_OUT_PIPE && nde->out != HAWK_NULL) || + (nde->out_type == HAWK_OUT_RWPIPE && nde->out != HAWK_NULL) || + (nde->out_type == HAWK_OUT_FILE && nde->out != HAWK_NULL) || + (nde->out_type == HAWK_OUT_APFILE && nde->out != HAWK_NULL) || + (nde->out_type == HAWK_OUT_CONSOLE && nde->out == HAWK_NULL)); + + if (nde->out) + { + hawk_oow_t len; + + out_v = eval_expression(rtx, nde->out); + if (!out_v) return -1; + + hawk_rtx_refupval (rtx, out_v); + + out = hawk_rtx_getvaloocstr(rtx, out_v, &len); + if (!out) goto oops; + + if (len <= 0) + { + /* the output destination name is empty. */ + SETERR_LOC (rtx, HAWK_EIONMEM, &nde->loc); + goto oops_1; + } + + while (len > 0) + { + if (out[--len] == HAWK_T('\0')) + { + /* provide length up to one character before + * the first null not to contains a null + * in an error message */ + SETERR_ARG_LOC (rtx, HAWK_EIONMNL, out, hawk_count_oocstr(out), &nde->loc); + + /* the output destination name contains a null + * character. */ + goto oops_1; + } + } + } + + dst = (out == HAWK_NULL)? HAWK_T(""): out; + + /*( valid printf statement should have at least one argument. the parser must ensure this. */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), nde->args != HAWK_NULL); + + if (nde->args->type == HAWK_NDE_GRP) + { + /* parenthesized print */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), nde->args->next == HAWK_NULL); + head = ((hawk_nde_grp_t*)nde->args)->body; + } + else head = nde->args; + + /* valid printf statement should have at least one argument. the parser must ensure this */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), head != HAWK_NULL); + + v = eval_expression(rtx, head); + if (v == HAWK_NULL) goto oops_1; + + hawk_rtx_refupval (rtx, v); + vtype = HAWK_RTX_GETVALTYPE(rtx, v); + switch (vtype) + { + case HAWK_VAL_STR: + /* perform the formatted output */ + n = output_formatted(rtx, nde->out_type, dst, ((hawk_val_str_t*)v)->val.ptr, ((hawk_val_str_t*)v)->val.len, head->next); + hawk_rtx_refdownval (rtx, v); + if (n <= -1) + { + if (n == PRINT_IOERR) xret = n; + else goto oops; + } + break; + + case HAWK_VAL_MBS: + /* perform the formatted output */ + n = output_formatted_bytes(rtx, nde->out_type, dst, ((hawk_val_mbs_t*)v)->val.ptr, ((hawk_val_mbs_t*)v)->val.len, head->next); + hawk_rtx_refdownval (rtx, v); + if (n <= -1) + { + if (n == PRINT_IOERR) xret = n; + else goto oops; + } + break; + + default: + /* the remaining arguments are ignored as the format cannot + * contain any % characters. e.g. printf (1, "xxxx") */ + n = hawk_rtx_writeioval(rtx, nde->out_type, dst, v); + hawk_rtx_refdownval (rtx, v); + + if (n <= -1 /*&& rtx->errinf.num != HAWK_EIOIMPL*/) + { + if (rtx->awk->opt.trait & HAWK_TOLERANT) xret = PRINT_IOERR; + else goto oops; + } + break; + } + + if (hawk_rtx_flushio(rtx, nde->out_type, dst) <= -1) + { + if (rtx->awk->opt.trait & HAWK_TOLERANT) xret = PRINT_IOERR; + else goto oops_1; + } + + if (out_v) + { + if (out) hawk_rtx_freevaloocstr (rtx, out_v, out); + hawk_rtx_refdownval (rtx, out_v); + } + + return xret; + +oops: + ADJERR_LOC (rtx, &nde->loc); + +oops_1: + if (out_v) + { + if (out) hawk_rtx_freevaloocstr (rtx, out_v, out); + hawk_rtx_refdownval (rtx, out_v); + } + + return -1; +} + +static int output_formatted ( + hawk_rtx_t* rtx, int out_type, const hawk_ooch_t* dst, + const hawk_ooch_t* fmt, hawk_oow_t fmt_len, hawk_nde_t* args) +{ + hawk_ooch_t* ptr; + hawk_oow_t len; + int n; + + ptr = hawk_rtx_format(rtx, HAWK_NULL, HAWK_NULL, fmt, fmt_len, 0, args, &len); + if (!ptr) return -1; + + n = hawk_rtx_writeiostr(rtx, out_type, dst, ptr, len); + if (n <= -1 /*&& rtx->errinf.num != HAWK_EIOIMPL*/) + { + return (rtx->awk->opt.trait & HAWK_TOLERANT)? PRINT_IOERR: -1; + } + + return 0; +} + +static int output_formatted_bytes ( + hawk_rtx_t* rtx, int out_type, const hawk_ooch_t* dst, + const hawk_bch_t* fmt, hawk_oow_t fmt_len, hawk_nde_t* args) +{ + hawk_bch_t* ptr; + hawk_oow_t len; + int n; + + ptr = hawk_rtx_formatmbs(rtx, HAWK_NULL, HAWK_NULL, fmt, fmt_len, 0, args, &len); + if (!ptr) return -1; + + n = hawk_rtx_writeiobytes(rtx, out_type, dst, ptr, len); + if (n <= -1 /*&& rtx->errinf.num != HAWK_EIOIMPL*/) + { + return (rtx->awk->opt.trait & HAWK_TOLERANT)? PRINT_IOERR: -1; + } + + return 0; +} + +static hawk_val_t* eval_expression (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + hawk_val_t* v; + int n; + +#if 0 + if (rtx->exit_level >= EXIT_GLOBAL) + { + /* returns HAWK_NULL as if an error occurred but + * clears the error number. run_main will + * detect this condition and treat it as a + * non-error condition.*/ + rtx->errinf.num = HAWK_ENOERR; + return HAWK_NULL; + } +#endif + + v = eval_expression0 (rtx, nde); + if (v == HAWK_NULL) return HAWK_NULL; + + if (HAWK_RTX_GETVALTYPE (rtx, v) == HAWK_VAL_REX) + { + hawk_oocs_t vs; + + /* special case where a regular expression is used in + * without any match operators: + * print /abc/; + * perform match against $0. + */ + hawk_rtx_refupval (rtx, v); + + if (HAWK_RTX_GETVALTYPE(rtx, rtx->inrec.d0) == HAWK_VAL_NIL) + { + /* the record has never been read. + * probably, this function has been triggered + * by the statements in the BEGIN block */ + vs.ptr = HAWK_T(""); + vs.len = 0; + } + else + { + /* the internal value representing $0 should always be of the string type once it has been set/updated. it is nil initially. */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), HAWK_RTX_GETVALTYPE(rtx, rtx->inrec.d0) == HAWK_VAL_STR); + vs.ptr = ((hawk_val_str_t*)rtx->inrec.d0)->val.ptr; + vs.len = ((hawk_val_str_t*)rtx->inrec.d0)->val.len; + } + + n = hawk_rtx_matchrex(rtx, v, &vs, &vs, HAWK_NULL, HAWK_NULL); + if (n <= -1) + { + ADJERR_LOC (rtx, &nde->loc); + hawk_rtx_refdownval (rtx, v); + return HAWK_NULL; + } + hawk_rtx_refdownval (rtx, v); + + v = hawk_rtx_makeintval(rtx, (n != 0)); + if (v == HAWK_NULL) + { + /* adjust error line */ + ADJERR_LOC (rtx, &nde->loc); + return HAWK_NULL; + } + } + + return v; +} + +static hawk_val_t* eval_expression0 (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + static eval_expr_t __evaluator[] = + { + /* the order of functions here should match the order + * of node types(hawk_nde_type_t) declared in hawk.h */ + eval_group, + eval_assignment, + eval_binary, + eval_unary, + eval_incpre, + eval_incpst, + eval_cnd, + eval_fncall_fnc, + eval_fncall_fun, + eval_fncall_var, + eval_int, + eval_flt, + eval_str, + eval_mbs, + eval_rex, + eval_fun, + eval_named, + eval_gbl, + eval_lcl, + eval_arg, + eval_namedidx, + eval_gblidx, + eval_lclidx, + eval_argidx, + eval_pos, + eval_getline, + eval_print, + eval_printf + }; + + hawk_val_t* v; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), nde->type >= HAWK_NDE_GRP && (nde->type - HAWK_NDE_GRP) < HAWK_COUNTOF(__evaluator)); + + v = __evaluator[nde->type-HAWK_NDE_GRP](rtx, nde); + + if (v != HAWK_NULL && rtx->exit_level >= EXIT_GLOBAL) + { + hawk_rtx_refupval (rtx, v); + hawk_rtx_refdownval (rtx, v); + + /* returns HAWK_NULL as if an error occurred but + * clears the error number. run_main will + * detect this condition and treat it as a + * non-error condition.*/ + hawk_rtx_seterrnum (rtx, HAWK_ENOERR, HAWK_NULL); + return HAWK_NULL; + } + + return v; +} + +static hawk_val_t* eval_group (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ +#if 0 + /* eval_binop_in evaluates the HAWK_NDE_GRP specially. + * so this function should never be reached. */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), !"should never happen - NDE_GRP only for in"); + SETERR_LOC (rtx, HAWK_EINTERN, &nde->loc); + return HAWK_NULL; +#endif + + /* a group can be evauluated in a normal context + * if a program is parsed with HAWK_TOLERANT on. + * before the introduction of this option, the grouped + * expression was valid only coerced with the 'in' + * operator. + * */ + + /* when a group is evaluated in a normal context, + * we return the last expression as a value. */ + + hawk_val_t* val; + hawk_nde_t* np; + + np = ((hawk_nde_grp_t*)nde)->body; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), np != HAWK_NULL); + +loop: + val = eval_expression (rtx, np); + if (val == HAWK_NULL) return HAWK_NULL; + + np = np->next; + if (np) + { + hawk_rtx_refupval (rtx, val); + hawk_rtx_refdownval (rtx, val); + goto loop; + } + + return val; +} + +static hawk_val_t* eval_assignment (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + hawk_val_t* val, * ret; + hawk_nde_ass_t* ass = (hawk_nde_ass_t*)nde; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), ass->left != HAWK_NULL); + HAWK_ASSERT (hawk_rtx_getawk(rtx), ass->right != HAWK_NULL); + + HAWK_ASSERT (hawk_rtx_getawk(rtx), ass->right->next == HAWK_NULL); + val = eval_expression (rtx, ass->right); + if (val == HAWK_NULL) return HAWK_NULL; + + hawk_rtx_refupval (rtx, val); + + if (ass->opcode != HAWK_ASSOP_NONE) + { + hawk_val_t* val2, * tmp; + static binop_func_t binop_func[] = + { + /* this table must match hawk_assop_type_t in rtx.h */ + HAWK_NULL, /* HAWK_ASSOP_NONE */ + eval_binop_plus, + eval_binop_minus, + eval_binop_mul, + eval_binop_div, + eval_binop_idiv, + eval_binop_mod, + eval_binop_exp, + eval_binop_concat, + eval_binop_rshift, + eval_binop_lshift, + eval_binop_band, + eval_binop_bxor, + eval_binop_bor + }; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), ass->left->next == HAWK_NULL); + val2 = eval_expression(rtx, ass->left); + if (val2 == HAWK_NULL) + { + hawk_rtx_refdownval (rtx, val); + return HAWK_NULL; + } + + hawk_rtx_refupval (rtx, val2); + + HAWK_ASSERT (hawk_rtx_getawk(rtx), ass->opcode >= 0); + HAWK_ASSERT (hawk_rtx_getawk(rtx), ass->opcode < HAWK_COUNTOF(binop_func)); + HAWK_ASSERT (hawk_rtx_getawk(rtx), binop_func[ass->opcode] != HAWK_NULL); + + tmp = binop_func[ass->opcode](rtx, val2, val); + if (tmp == HAWK_NULL) + { + hawk_rtx_refdownval (rtx, val2); + hawk_rtx_refdownval (rtx, val); + return HAWK_NULL; + } + + hawk_rtx_refdownval (rtx, val2); + hawk_rtx_refdownval (rtx, val); + + val = tmp; + hawk_rtx_refupval (rtx, val); + } + + ret = do_assignment(rtx, ass->left, val); + hawk_rtx_refdownval (rtx, val); + + return ret; +} + +static hawk_val_t* do_assignment (hawk_rtx_t* rtx, hawk_nde_t* var, hawk_val_t* val) +{ + hawk_val_t* ret; + hawk_errnum_t errnum; + + switch (var->type) + { + case HAWK_NDE_NAMED: + case HAWK_NDE_GBL: + case HAWK_NDE_LCL: + case HAWK_NDE_ARG: + ret = do_assignment_nonidx(rtx, (hawk_nde_var_t*)var, val); + break; + + case HAWK_NDE_NAMEDIDX: + case HAWK_NDE_GBLIDX: + case HAWK_NDE_LCLIDX: + case HAWK_NDE_ARGIDX: + if (HAWK_RTX_GETVALTYPE(rtx, val) == HAWK_VAL_MAP) + { + /* a map cannot become a member of a map */ + errnum = HAWK_EMAPTOIDX; + goto exit_on_error; + } + + ret = do_assignment_idx(rtx, (hawk_nde_var_t*)var, val); + break; + + case HAWK_NDE_POS: + if (HAWK_RTX_GETVALTYPE(rtx, val) == HAWK_VAL_MAP) + { + /* a map cannot be assigned to a positional */ + errnum = HAWK_EMAPTOPOS; + goto exit_on_error; + } + + ret = do_assignment_pos(rtx, (hawk_nde_pos_t*)var, val); + break; + + default: + HAWK_ASSERT (hawk_rtx_getawk(rtx), !"should never happen - invalid variable type"); + errnum = HAWK_EINTERN; + goto exit_on_error; + } + + return ret; + +exit_on_error: + SETERR_LOC (rtx, errnum, &var->loc); + return HAWK_NULL; +} + +static hawk_val_t* do_assignment_nonidx (hawk_rtx_t* run, hawk_nde_var_t* var, hawk_val_t* val) +{ + hawk_val_type_t vtype; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), + var->type == HAWK_NDE_NAMED || + var->type == HAWK_NDE_GBL || + var->type == HAWK_NDE_LCL || + var->type == HAWK_NDE_ARG + ); + + HAWK_ASSERT (hawk_rtx_getawk(rtx), var->idx == HAWK_NULL); + vtype = HAWK_RTX_GETVALTYPE (rtx, val); + + switch (var->type) + { + case HAWK_NDE_NAMED: + { + hawk_htb_pair_t* pair; + + pair = hawk_htb_search (run->named, var->id.name.ptr, var->id.name.len); + + if (!(run->awk->opt.trait & HAWK_FLEXMAP)) + { + if (pair && HAWK_RTX_GETVALTYPE (rtx, (hawk_val_t*)HAWK_HTB_VPTR(pair)) == HAWK_VAL_MAP) + { + /* old value is a map - it can only be accessed through indexing. */ + hawk_errnum_t errnum; + errnum = (vtype == HAWK_VAL_MAP)? HAWK_ENMAPTOMAP: HAWK_ENMAPTOSCALAR; + SETERR_ARGX_LOC (run, errnum, &var->id.name, &var->loc); + return HAWK_NULL; + } + else if (vtype == HAWK_VAL_MAP) + { + /* old value is not a map but a new value is a map. + * a map cannot be assigned to a variable if FLEXMAP is off. */ + SETERR_ARGX_LOC (run, HAWK_EMAPTONVAR, &var->id.name, &var->loc); + return HAWK_NULL; + } + } + + if (hawk_htb_upsert (run->named, var->id.name.ptr, var->id.name.len, val, 0) == HAWK_NULL) + { + SETERR_LOC (run, HAWK_ENOMEM, &var->loc); + return HAWK_NULL; + } + + hawk_rtx_refupval (run, val); + break; + } + + case HAWK_NDE_GBL: + { + if (set_global(run, var->id.idxa, var, val, 1) == -1) + { + ADJERR_LOC (run, &var->loc); + return HAWK_NULL; + } + break; + } + + case HAWK_NDE_LCL: + { + hawk_val_t* old = RTX_STACK_LCL(run,var->id.idxa); + + if (!(run->awk->opt.trait & HAWK_FLEXMAP)) + { + if (HAWK_RTX_GETVALTYPE (rtx, old) == HAWK_VAL_MAP) + { + /* old value is a map - it can only be accessed through indexing. */ + hawk_errnum_t errnum; + errnum = (vtype == HAWK_VAL_MAP)? HAWK_ENMAPTOMAP: HAWK_ENMAPTOSCALAR; + SETERR_ARGX_LOC (run, errnum, &var->id.name, &var->loc); + return HAWK_NULL; + } + else if (vtype == HAWK_VAL_MAP) + { + /* old value is not a map but a new value is a map. + * a map cannot be assigned to a variable if FLEXMAP is off. */ + SETERR_ARGX_LOC (run, HAWK_EMAPTONVAR, &var->id.name, &var->loc); + return HAWK_NULL; + } + } + + hawk_rtx_refdownval (run, old); + RTX_STACK_LCL(run,var->id.idxa) = val; + hawk_rtx_refupval (run, val); + break; + } + + case HAWK_NDE_ARG: + { + hawk_val_t* old = RTX_STACK_ARG(run,var->id.idxa); + + if (!(run->awk->opt.trait & HAWK_FLEXMAP)) + { + if (HAWK_RTX_GETVALTYPE(rtx, old) == HAWK_VAL_MAP) + { + /* old value is a map - it can only be accessed through indexing. */ + hawk_errnum_t errnum; + errnum = (vtype == HAWK_VAL_MAP)? HAWK_ENMAPTOMAP: HAWK_ENMAPTOSCALAR; + SETERR_ARGX_LOC (run, errnum, &var->id.name, &var->loc); + return HAWK_NULL; + } + else if (vtype == HAWK_VAL_MAP) + { + /* old value is not a map but a new value is a map. + * a map cannot be assigned to a variable if FLEXMAP is off. */ + SETERR_ARGX_LOC (run, HAWK_EMAPTONVAR, &var->id.name, &var->loc); + return HAWK_NULL; + } + } + + hawk_rtx_refdownval (run, old); + RTX_STACK_ARG(run,var->id.idxa) = val; + hawk_rtx_refupval (run, val); + break; + } + + } + + return val; +} + +static hawk_val_t* do_assignment_idx (hawk_rtx_t* rtx, hawk_nde_var_t* var, hawk_val_t* val) +{ + hawk_val_map_t* map; + hawk_val_type_t mvtype; + hawk_ooch_t* str; + hawk_oow_t len; + hawk_ooch_t idxbuf[IDXBUFSIZE]; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), + (var->type == HAWK_NDE_NAMEDIDX || + var->type == HAWK_NDE_GBLIDX || + var->type == HAWK_NDE_LCLIDX || + var->type == HAWK_NDE_ARGIDX) && var->idx != HAWK_NULL); + HAWK_ASSERT (hawk_rtx_getawk(rtx), HAWK_RTX_GETVALTYPE (rtx, val) != HAWK_VAL_MAP); + +retry: + switch (var->type) + { + case HAWK_NDE_NAMEDIDX: + { + hawk_htb_pair_t* pair; + pair = hawk_htb_search(rtx->named, var->id.name.ptr, var->id.name.len); + map = (pair == HAWK_NULL)? + (hawk_val_map_t*)hawk_val_nil: + (hawk_val_map_t*)HAWK_HTB_VPTR(pair); + break; + } + + case HAWK_NDE_GBLIDX: + map = (hawk_val_map_t*)RTX_STACK_GBL(rtx,var->id.idxa); + break; + + case HAWK_NDE_LCLIDX: + map = (hawk_val_map_t*)RTX_STACK_LCL(rtx,var->id.idxa); + break; + + default: /* HAWK_NDE_ARGIDX */ + map = (hawk_val_map_t*)RTX_STACK_ARG(rtx,var->id.idxa); + break; + } + + mvtype = HAWK_RTX_GETVALTYPE (rtx, map); + if (mvtype == HAWK_VAL_NIL) + { + hawk_val_t* tmp; + + /* the map is not initialized yet */ + tmp = hawk_rtx_makemapval (rtx); + if (tmp == HAWK_NULL) + { + ADJERR_LOC (rtx, &var->loc); + return HAWK_NULL; + } + + switch (var->type) + { + case HAWK_NDE_NAMEDIDX: + { + /* doesn't have to decrease the reference count + * of the previous value here as it is done by + * hawk_htb_upsert */ + hawk_rtx_refupval (rtx, tmp); + if (hawk_htb_upsert(rtx->named, var->id.name.ptr, var->id.name.len, tmp, 0) == HAWK_NULL) + { + hawk_rtx_refdownval (rtx, tmp); + SETERR_LOC (rtx, HAWK_ENOMEM, &var->loc); + return HAWK_NULL; + } + + break; + } + + case HAWK_NDE_GBLIDX: + { + int x; + + hawk_rtx_refupval (rtx, tmp); + x = hawk_rtx_setgbl (rtx, (int)var->id.idxa, tmp); + hawk_rtx_refdownval (rtx, tmp); + if (x <= -1) + { + ADJERR_LOC (rtx, &var->loc); + return HAWK_NULL; + } + break; + } + + case HAWK_NDE_LCLIDX: + hawk_rtx_refdownval (rtx, (hawk_val_t*)map); + RTX_STACK_LCL(rtx,var->id.idxa) = tmp; + hawk_rtx_refupval (rtx, tmp); + break; + + default: /* HAWK_NDE_ARGIDX */ + hawk_rtx_refdownval (rtx, (hawk_val_t*)map); + RTX_STACK_ARG(rtx,var->id.idxa) = tmp; + hawk_rtx_refupval (rtx, tmp); + break; + } + + map = (hawk_val_map_t*)tmp; + } + else if (mvtype != HAWK_VAL_MAP) + { + if (rtx->awk->opt.trait & HAWK_FLEXMAP) + { + /* if FLEXMAP is on, you can switch a scalar value to a map */ + hawk_nde_var_t fake; + + /* create a fake non-indexed variable node */ + fake = *var; + /* NOTE: type conversion by decrementing by 4 is + * dependent on the hawk_nde_type_t + * enumerators defined in */ + fake.type = var->type - 4; + fake.idx = HAWK_NULL; + + reset_variable (rtx, &fake); + goto retry; + } + else + { + /* you can't manipulate a variable pointing to + * a scalar value with an index if FLEXMAP is off. */ + SETERR_LOC (rtx, HAWK_ESCALARTOMAP, &var->loc); + return HAWK_NULL; + } + } + + len = HAWK_COUNTOF(idxbuf); + str = idxnde_to_str(rtx, var->idx, idxbuf, &len); + if (str == HAWK_NULL) return HAWK_NULL; + +#if defined(DEBUG_RUN) + hawk_logfmt (hawk_rtx_getawk(rtx), HAWK_T("**** index str=>%s, map->ref=%d, map->type=%d\n"), + str, (int)map->ref, (int)map->type); +#endif + + if (hawk_htb_upsert(map->map, str, len, val, 0) == HAWK_NULL) + { + if (str != idxbuf) hawk_rtx_freemem (rtx, str); + SETERR_LOC (rtx, HAWK_ENOMEM, &var->loc); + return HAWK_NULL; + } + + if (str != idxbuf) hawk_rtx_freemem (rtx, str); + hawk_rtx_refupval (rtx, val); + return val; +} + +static hawk_val_t* do_assignment_pos (hawk_rtx_t* rtx, hawk_nde_pos_t* pos, hawk_val_t* val) +{ + hawk_val_t* v; + hawk_val_type_t vtype; + hawk_int_t lv; + hawk_oocs_t str; + int n; + + v = eval_expression (rtx, pos->val); + if (v == HAWK_NULL) return HAWK_NULL; + + hawk_rtx_refupval (rtx, v); + n = hawk_rtx_valtoint (rtx, v, &lv); + hawk_rtx_refdownval (rtx, v); + + if (n <= -1) + { + SETERR_LOC (rtx, HAWK_EPOSIDX, &pos->loc); + return HAWK_NULL; + } + + if (!IS_VALID_POSIDX(lv)) + { + SETERR_LOC (rtx, HAWK_EPOSIDX, &pos->loc); + return HAWK_NULL; + } + + vtype = HAWK_RTX_GETVALTYPE (rtx, val); + if (vtype == HAWK_VAL_STR) + { + str = ((hawk_val_str_t*)val)->val; + } + else + { + hawk_rtx_valtostr_out_t out; + + out.type = HAWK_RTX_VALTOSTR_CPLDUP; + if (hawk_rtx_valtostr (rtx, val, &out) <= -1) + { + ADJERR_LOC (rtx, &pos->loc); + return HAWK_NULL; + } + + str = out.u.cpldup; + } + + n = hawk_rtx_setrec (rtx, (hawk_oow_t)lv, &str); + + if (vtype == HAWK_VAL_STR) + { + /* do nothing */ + } + else + { + hawk_rtx_freemem (rtx, str.ptr); + } + + if (n <= -1) return HAWK_NULL; + return (lv == 0)? rtx->inrec.d0: rtx->inrec.flds[lv-1].val; +} + +static hawk_val_t* eval_binary (hawk_rtx_t* run, hawk_nde_t* nde) +{ + static binop_func_t binop_func[] = + { + /* the order of the functions should be inline with + * the operator declaration in run.h */ + + HAWK_NULL, /* eval_binop_lor */ + HAWK_NULL, /* eval_binop_land */ + HAWK_NULL, /* eval_binop_in */ + + eval_binop_bor, + eval_binop_bxor, + eval_binop_band, + + eval_binop_teq, + eval_binop_tne, + eval_binop_eq, + eval_binop_ne, + eval_binop_gt, + eval_binop_ge, + eval_binop_lt, + eval_binop_le, + + eval_binop_lshift, + eval_binop_rshift, + + eval_binop_plus, + eval_binop_minus, + eval_binop_mul, + eval_binop_div, + eval_binop_idiv, + eval_binop_mod, + eval_binop_exp, + + eval_binop_concat, + HAWK_NULL, /* eval_binop_ma */ + HAWK_NULL /* eval_binop_nm */ + }; + + hawk_nde_exp_t* exp = (hawk_nde_exp_t*)nde; + hawk_val_t* left, * right, * res; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), exp->type == HAWK_NDE_EXP_BIN); + + if (exp->opcode == HAWK_BINOP_LAND) + { + res = eval_binop_land (run, exp->left, exp->right); + } + else if (exp->opcode == HAWK_BINOP_LOR) + { + res = eval_binop_lor (run, exp->left, exp->right); + } + else if (exp->opcode == HAWK_BINOP_IN) + { + /* treat the in operator specially */ + res = eval_binop_in (run, exp->left, exp->right); + } + else if (exp->opcode == HAWK_BINOP_NM) + { + res = eval_binop_nm (run, exp->left, exp->right); + } + else if (exp->opcode == HAWK_BINOP_MA) + { + res = eval_binop_ma (run, exp->left, exp->right); + } + else + { + HAWK_ASSERT (hawk_rtx_getawk(rtx), exp->left->next == HAWK_NULL); + left = eval_expression (run, exp->left); + if (left == HAWK_NULL) return HAWK_NULL; + + hawk_rtx_refupval (run, left); + + HAWK_ASSERT (hawk_rtx_getawk(rtx), exp->right->next == HAWK_NULL); + right = eval_expression (run, exp->right); + if (right == HAWK_NULL) + { + hawk_rtx_refdownval (run, left); + return HAWK_NULL; + } + + hawk_rtx_refupval (run, right); + + HAWK_ASSERT (hawk_rtx_getawk(rtx), exp->opcode >= 0 && + exp->opcode < HAWK_COUNTOF(binop_func)); + HAWK_ASSERT (hawk_rtx_getawk(rtx), binop_func[exp->opcode] != HAWK_NULL); + + res = binop_func[exp->opcode] (run, left, right); + if (res == HAWK_NULL) ADJERR_LOC (run, &nde->loc); + + hawk_rtx_refdownval (run, left); + hawk_rtx_refdownval (run, right); + } + + return res; +} + +static hawk_val_t* eval_binop_lor ( + hawk_rtx_t* run, hawk_nde_t* left, hawk_nde_t* right) +{ + /* + hawk_val_t* res = HAWK_NULL; + + res = hawk_rtx_makeintval ( + run, + hawk_rtx_valtobool(run,left) || + hawk_rtx_valtobool(run,right) + ); + if (res == HAWK_NULL) + { + ADJERR_LOC (run, &left->loc); + return HAWK_NULL; + } + + return res; + */ + + /* short-circuit evaluation required special treatment */ + hawk_val_t* lv, * rv, * res; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), left->next == HAWK_NULL); + lv = eval_expression (run, left); + if (lv == HAWK_NULL) return HAWK_NULL; + + hawk_rtx_refupval (run, lv); + if (hawk_rtx_valtobool(run, lv)) + { + res = HAWK_VAL_ONE; + } + else + { + HAWK_ASSERT (hawk_rtx_getawk(rtx), right->next == HAWK_NULL); + rv = eval_expression (run, right); + if (rv == HAWK_NULL) + { + hawk_rtx_refdownval (run, lv); + return HAWK_NULL; + } + hawk_rtx_refupval (run, rv); + + res = hawk_rtx_valtobool(run,rv)? + HAWK_VAL_ONE: HAWK_VAL_ZERO; + hawk_rtx_refdownval (run, rv); + } + + hawk_rtx_refdownval (run, lv); + + return res; +} + +static hawk_val_t* eval_binop_land (hawk_rtx_t* run, hawk_nde_t* left, hawk_nde_t* right) +{ + /* + hawk_val_t* res = HAWK_NULL; + + res = hawk_rtx_makeintval ( + run, + hawk_rtx_valtobool(run,left) && + hawk_rtx_valtobool(run,right) + ); + if (res == HAWK_NULL) + { + ADJERR_LOC (run, &left->loc); + return HAWK_NULL; + } + + return res; + */ + + /* short-circuit evaluation required special treatment */ + hawk_val_t* lv, * rv, * res; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), left->next == HAWK_NULL); + lv = eval_expression (run, left); + if (lv == HAWK_NULL) return HAWK_NULL; + + hawk_rtx_refupval (run, lv); + if (!hawk_rtx_valtobool(run, lv)) + { + res = HAWK_VAL_ZERO; + } + else + { + HAWK_ASSERT (hawk_rtx_getawk(rtx), right->next == HAWK_NULL); + rv = eval_expression (run, right); + if (rv == HAWK_NULL) + { + hawk_rtx_refdownval (run, lv); + return HAWK_NULL; + } + hawk_rtx_refupval (run, rv); + + res = hawk_rtx_valtobool(run,rv)? HAWK_VAL_ONE: HAWK_VAL_ZERO; + hawk_rtx_refdownval (run, rv); + } + + hawk_rtx_refdownval (run, lv); + + return res; +} + +static hawk_val_t* eval_binop_in (hawk_rtx_t* rtx, hawk_nde_t* left, hawk_nde_t* right) +{ + hawk_val_t* rv; + hawk_val_type_t rvtype; + hawk_ooch_t* str; + hawk_oow_t len; + hawk_ooch_t idxbuf[IDXBUFSIZE]; + + if (right->type != HAWK_NDE_GBL && + right->type != HAWK_NDE_LCL && + right->type != HAWK_NDE_ARG && + right->type != HAWK_NDE_NAMED) + { + /* the compiler should have handled this case */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), !"should never happen - it needs a plain variable"); + SETERR_LOC (rtx, HAWK_EINTERN, &right->loc); + return HAWK_NULL; + } + + /* evaluate the left-hand side of the operator */ + len = HAWK_COUNTOF(idxbuf); + str = (left->type == HAWK_NDE_GRP)? + idxnde_to_str (rtx, ((hawk_nde_grp_t*)left)->body, idxbuf, &len): + idxnde_to_str (rtx, left, idxbuf, &len); + if (str == HAWK_NULL) return HAWK_NULL; + + /* evaluate the right-hand side of the operator */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), right->next == HAWK_NULL); + rv = eval_expression (rtx, right); + if (rv == HAWK_NULL) + { + if (str != idxbuf) hawk_rtx_freemem (rtx, str); + return HAWK_NULL; + } + + hawk_rtx_refupval (rtx, rv); + + rvtype = HAWK_RTX_GETVALTYPE (rtx, rv); + if (rvtype == HAWK_VAL_NIL) + { + if (str != idxbuf) hawk_rtx_freemem (rtx, str); + hawk_rtx_refdownval (rtx, rv); + return HAWK_VAL_ZERO; + } + else if (rvtype == HAWK_VAL_MAP) + { + hawk_val_t* res; + hawk_htb_t* map; + + map = ((hawk_val_map_t*)rv)->map; + res = (hawk_htb_search (map, str, len) == HAWK_NULL)? + HAWK_VAL_ZERO: HAWK_VAL_ONE; + + if (str != idxbuf) hawk_rtx_freemem (rtx, str); + hawk_rtx_refdownval (rtx, rv); + return res; + } + + /* need a map */ + if (str != idxbuf) hawk_rtx_freemem (rtx, str); + hawk_rtx_refdownval (rtx, rv); + + SETERR_LOC (rtx, HAWK_ENOTMAPNILIN, &right->loc); + return HAWK_NULL; +} + +static hawk_val_t* eval_binop_bor ( + hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right) +{ + hawk_int_t l1, l2; + + if (hawk_rtx_valtoint (rtx, left, &l1) <= -1 || + hawk_rtx_valtoint (rtx, right, &l2) <= -1) + { + SETERR_COD (rtx, HAWK_EOPERAND); + return HAWK_NULL; + } + + return hawk_rtx_makeintval (rtx, l1 | l2); +} + +static hawk_val_t* eval_binop_bxor ( + hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right) +{ + hawk_int_t l1, l2; + + if (hawk_rtx_valtoint (rtx, left, &l1) <= -1 || + hawk_rtx_valtoint (rtx, right, &l2) <= -1) + { + SETERR_COD (rtx, HAWK_EOPERAND); + return HAWK_NULL; + } + + return hawk_rtx_makeintval (rtx, l1 ^ l2); +} + +static hawk_val_t* eval_binop_band ( + hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right) +{ + hawk_int_t l1, l2; + + if (hawk_rtx_valtoint (rtx, left, &l1) <= -1 || + hawk_rtx_valtoint (rtx, right, &l2) <= -1) + { + SETERR_COD (rtx, HAWK_EOPERAND); + return HAWK_NULL; + } + + return hawk_rtx_makeintval (rtx, l1 & l2); +} + +/* -------------------------------------------------------------------- */ + +enum cmp_op_t +{ + CMP_OP_NONE = 0, + CMP_OP_EQ = 1, + CMP_OP_NE = 2, + CMP_OP_GT = 3, + CMP_OP_GE = 4, + CMP_OP_LT = 5, + CMP_OP_LE = 6 +}; +typedef enum cmp_op_t cmp_op_t; + +static HAWK_INLINE cmp_op_t inverse_cmp_op (cmp_op_t op) +{ + static cmp_op_t inverse_cmp_op_tab[] = + { + CMP_OP_NONE, + CMP_OP_NE, + CMP_OP_EQ, + CMP_OP_LT, + CMP_OP_LE, + CMP_OP_GT, + CMP_OP_GE + }; + return inverse_cmp_op_tab[op]; +} + +static HAWK_INLINE int __cmp_ensure_not_equal (hawk_rtx_t* rtx, cmp_op_t op_hint) +{ + /* checking equality is mostly obvious. however, it is not possible + * to test if one is less/greater than the other for some operands. + * this function return a number that ensures to make NE to true and + * all other operations false */ + + switch (op_hint) + { + case CMP_OP_EQ: + case CMP_OP_NE: + return 1; /* not equal */ + + case CMP_OP_GT: + case CMP_OP_LT: + return 0; /* make GT or LT to be false by claiming equal */ + + case CMP_OP_GE: + return -1; /* make GE false by claiming less */ + case CMP_OP_LE: + return 1; /* make LE false by claiming greater */ + + default: + SETERR_COD (rtx, HAWK_EOPERAND); + return -1; + } +} + +/* -------------------------------------------------------------------- */ +static HAWK_INLINE int __cmp_nil_nil (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + return 0; +} + +static HAWK_INLINE int __cmp_nil_int (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + hawk_int_t v = HAWK_RTX_GETINTFROMVAL (rtx, right); + return (v < 0)? 1: ((v > 0)? -1: 0); +} + +static HAWK_INLINE int __cmp_nil_flt (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + if (((hawk_val_flt_t*)right)->val < 0) return 1; + if (((hawk_val_flt_t*)right)->val > 0) return -1; + return 0; +} + +static HAWK_INLINE int __cmp_nil_str (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + return (((hawk_val_str_t*)right)->val.len == 0)? 0: -1; +} + +static HAWK_INLINE int __cmp_nil_mbs (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + return (((hawk_val_mbs_t*)right)->val.len == 0)? 0: -1; +} + +static HAWK_INLINE int __cmp_nil_fun (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + /* != -> true, all others -> false */ + return __cmp_ensure_not_equal(rtx, op_hint); +} + +static HAWK_INLINE int __cmp_nil_map (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + return (HAWK_HTB_SIZE(((hawk_val_map_t*)right)->map) == 0)? 0: -1; +} + +/* -------------------------------------------------------------------- */ + +static HAWK_INLINE int __cmp_int_nil (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + hawk_int_t v = HAWK_RTX_GETINTFROMVAL(rtx, left); + return (v > 0)? 1: ((v < 0)? -1: 0); +} + +static HAWK_INLINE int __cmp_int_int (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + + hawk_int_t v1 = HAWK_RTX_GETINTFROMVAL(rtx, left); + hawk_int_t v2 = HAWK_RTX_GETINTFROMVAL(rtx, right); + return (v1 > v2)? 1: ((v1 < v2)? -1: 0); +} + +static HAWK_INLINE int __cmp_int_flt ( + hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + hawk_int_t v1 = HAWK_RTX_GETINTFROMVAL (rtx, left); + if (v1 > ((hawk_val_flt_t*)right)->val) return 1; + if (v1 < ((hawk_val_flt_t*)right)->val) return -1; + return 0; +} + +static HAWK_INLINE int __cmp_int_str (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + hawk_ooch_t* str0; + hawk_oow_t len0; + int n; + + /* SCO CC doesn't seem to handle right->nstr > 0 properly */ + if ((rtx->awk->opt.trait & HAWK_NCMPONSTR) || right->nstr /*> 0*/) + { + hawk_int_t ll, v1; + hawk_flt_t rr; + + n = hawk_rtx_oocharstonum( + rtx, + HAWK_RTX_OOCSTRTONUM_MAKE_OPTION(1, 0), + ((hawk_val_str_t*)right)->val.ptr, + ((hawk_val_str_t*)right)->val.len, + &ll, &rr + ); + + v1 = HAWK_RTX_GETINTFROMVAL(rtx, left); + if (n == 0) + { + /* a numeric integral string */ + return (v1 > ll)? 1: ((v1 < ll)? -1: 0); + } + else if (n > 0) + { + /* a numeric floating-point string */ + return (v1 > rr)? 1: ((v1 < rr)? -1: 0); + } + } + + str0 = hawk_rtx_valtooocstrdup(rtx, left, &len0); + if (!str0) return CMP_ERROR; + + n = hawk_comp_oochars(str0, len0, ((hawk_val_str_t*)right)->val.ptr, ((hawk_val_str_t*)right)->val.len, rtx->gbl.ignorecase); + hawk_rtx_freemem (rtx, str0); + return n; +} + +static HAWK_INLINE int __cmp_int_mbs (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + hawk_bch_t* str0; + hawk_oow_t len0; + int n; + + if ((rtx->awk->opt.trait & HAWK_NCMPONSTR) || right->nstr /*> 0*/) + { + hawk_int_t ll, v1; + hawk_flt_t rr; + + n = hawk_rtx_bcharstonum ( + rtx, + HAWK_RTX_OOCSTRTONUM_MAKE_OPTION(1, 0), + ((hawk_val_mbs_t*)right)->val.ptr, + ((hawk_val_mbs_t*)right)->val.len, + &ll, &rr + ); + + v1 = HAWK_RTX_GETINTFROMVAL(rtx, left); + if (n == 0) + { + /* a numeric integral string */ + return (v1 > ll)? 1: ((v1 < ll)? -1: 0); + } + else if (n > 0) + { + /* a numeric floating-point string */ + return (v1 > rr)? 1: ((v1 < rr)? -1: 0); + } + } + + str0 = hawk_rtx_valtobcstrdup(rtx, left, &len0); + if (!str0) return -1; + + n = hawk_comp_bchars(str0, len0, ((hawk_val_mbs_t*)right)->val.ptr, ((hawk_val_mbs_t*)right)->val.len, rtx->gbl.ignorecase); + hawk_rtx_freemem (rtx, str0); + return n; +} + +static HAWK_INLINE int __cmp_int_fun (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + return __cmp_ensure_not_equal(rtx, op_hint); +} + +static HAWK_INLINE int __cmp_int_map (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + /* compare an integer and the size of a map */ + hawk_int_t v1 = HAWK_RTX_GETINTFROMVAL(rtx, left); + hawk_int_t v2 = HAWK_HTB_SIZE(((hawk_val_map_t*)right)->map); + if (v1 > v2) return 1; + if (v1 < v2) return -1; + return 0; +} + +/* -------------------------------------------------------------------- */ + +static HAWK_INLINE int __cmp_flt_nil (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + if (((hawk_val_flt_t*)left)->val > 0) return 1; + if (((hawk_val_flt_t*)left)->val < 0) return -1; + return 0; +} + +static HAWK_INLINE int __cmp_flt_int (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + hawk_int_t v2 = HAWK_RTX_GETINTFROMVAL (rtx, right); + if (((hawk_val_flt_t*)left)->val > v2) return 1; + if (((hawk_val_flt_t*)left)->val < v2) return -1; + return 0; +} + +static HAWK_INLINE int __cmp_flt_flt (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + if (((hawk_val_flt_t*)left)->val > + ((hawk_val_flt_t*)right)->val) return 1; + if (((hawk_val_flt_t*)left)->val < + ((hawk_val_flt_t*)right)->val) return -1; + return 0; +} + +static HAWK_INLINE int __cmp_flt_str (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + hawk_ooch_t* str0; + hawk_oow_t len0; + int n; + + /* SCO CC doesn't seem to handle right->nstr > 0 properly */ + if (rtx->awk->opt.trait & HAWK_NCMPONSTR || right->nstr /*> 0*/) + { + const hawk_ooch_t* end; + hawk_flt_t rr; + + rr = hawk_strxtoflt(rtx->awk, ((hawk_val_str_t*)right)->val.ptr, ((hawk_val_str_t*)right)->val.len, &end); + if (end == ((hawk_val_str_t*)right)->val.ptr + ((hawk_val_str_t*)right)->val.len) + { + return (((hawk_val_flt_t*)left)->val > rr)? 1: + (((hawk_val_flt_t*)left)->val < rr)? -1: 0; + } + } + + str0 = hawk_rtx_valtooocstrdup(rtx, left, &len0); + if (!str0) return CMP_ERROR; + + n = hawk_comp_oochars(str0, len0, ((hawk_val_str_t*)right)->val.ptr, ((hawk_val_str_t*)right)->val.len, rtx->gbl.ignorecase); + hawk_rtx_freemem (rtx, str0); + return n; +} + +static HAWK_INLINE int __cmp_flt_mbs (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + hawk_bch_t* str0; + hawk_oow_t len0; + int n; + + if (rtx->awk->opt.trait & HAWK_NCMPONSTR || right->nstr /*> 0*/) + { + const hawk_bch_t* end; + hawk_flt_t rr; + + rr = hawk_bcharstoflt(rtx->awk, ((hawk_val_mbs_t*)right)->val.ptr, ((hawk_val_mbs_t*)right)->val.len, &end); + if (end == ((hawk_val_mbs_t*)right)->val.ptr + ((hawk_val_mbs_t*)right)->val.len) + { + return (((hawk_val_flt_t*)left)->val > rr)? 1: + (((hawk_val_flt_t*)left)->val < rr)? -1: 0; + } + } + + str0 = hawk_rtx_valtobcstrdup(rtx, left, &len0); + if (!str0) return CMP_ERROR; + + n = hawk_comp_bchars(str0, len0, ((hawk_val_mbs_t*)right)->val.ptr, ((hawk_val_mbs_t*)right)->val.len, rtx->gbl.ignorecase); + hawk_rtx_freemem (rtx, str0); + return n; +} + +static HAWK_INLINE int __cmp_flt_fun (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + return __cmp_ensure_not_equal(rtx, op_hint); +} + +static HAWK_INLINE int __cmp_flt_map (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + /* compare a float with the size of a map */ + hawk_int_t v2 = HAWK_HTB_SIZE(((hawk_val_map_t*)right)->map); + if (((hawk_val_flt_t*)left)->val > v2) return 1; + if (((hawk_val_flt_t*)left)->val < v2) return -1; + return 0; +} + +/* -------------------------------------------------------------------- */ + +static HAWK_INLINE int __cmp_str_nil (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + return (((hawk_val_str_t*)left)->val.len == 0)? 0: 1; +} + +static HAWK_INLINE int __cmp_str_int (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + int n; + n = __cmp_int_str(rtx, right, left, inverse_cmp_op(op_hint)); + if (n == CMP_ERROR) return CMP_ERROR; + return -n; +} + +static HAWK_INLINE int __cmp_str_flt (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + int n; + n = __cmp_flt_str(rtx, right, left, inverse_cmp_op(op_hint)); + if (n == CMP_ERROR) return CMP_ERROR; + return -n; +} + +static HAWK_INLINE int __cmp_str_str (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + hawk_val_str_t* ls, * rs; + + ls = (hawk_val_str_t*)left; + rs = (hawk_val_str_t*)right; + + if (ls->nstr == 0 || rs->nstr == 0) + { + /* both are definitely strings */ + return hawk_comp_oochars(ls->val.ptr, ls->val.len, rs->val.ptr, rs->val.len, rtx->gbl.ignorecase); + } + + if (ls->nstr == 1) + { + hawk_int_t ll; + + ll = hawk_strxtoint(rtx->awk, ls->val.ptr, ls->val.len, 0, HAWK_NULL); + + if (rs->nstr == 1) + { + hawk_int_t rr; + + rr = hawk_strxtoint(rtx->awk, rs->val.ptr, rs->val.len, 0, HAWK_NULL); + + return (ll > rr)? 1: + (ll < rr)? -1: 0; + } + else + { + hawk_flt_t rr; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), rs->nstr == 2); + + rr = hawk_strxtoflt(rtx->awk, rs->val.ptr, rs->val.len, HAWK_NULL); + + return (ll > rr)? 1: + (ll < rr)? -1: 0; + } + } + else + { + hawk_flt_t ll; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), ls->nstr == 2); + + ll = hawk_strxtoflt(rtx->awk, ls->val.ptr, ls->val.len, HAWK_NULL); + + if (rs->nstr == 1) + { + hawk_int_t rr; + + rr = hawk_strxtoint(rtx->awk, rs->val.ptr, rs->val.len, 0, HAWK_NULL); + + return (ll > rr)? 1: + (ll < rr)? -1: 0; + } + else + { + hawk_flt_t rr; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), rs->nstr == 2); + + rr = hawk_strxtoflt(rtx->awk, rs->val.ptr, rs->val.len, HAWK_NULL); + + return (ll > rr)? 1: + (ll < rr)? -1: 0; + } + } +} + +static HAWK_INLINE int __cmp_str_mbs (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + hawk_val_str_t* ls = (hawk_val_str_t*)left; + hawk_val_mbs_t* rs = (hawk_val_mbs_t*)right; + +#if (HAWK_SIZEOF_BCH_T != HAWK_SIZEOF_UINT8_T) +# error Unsupported size of hawk_bch_t +#endif + +#if defined(HAWK_OOCH_IS_BCH) + return hawk_comp_bchars(ls->val.ptr, ls->val.len, rs->val.ptr, rs->val.len, rtx->gbl.ignorecase); +#else + hawk_bch_t* mbsptr; + hawk_oow_t mbslen; + int n; + + mbsptr = hawk_rtx_duputobchars(rtx, ls->val.ptr, ls->val.len, &mbslen); + if (!mbsptr) return CMP_ERROR; + n = hawk_comp_bchars(mbsptr, mbslen, (const hawk_bch_t*)rs->val.ptr, rs->val.len, rtx->gbl.ignorecase); + hawk_rtx_freemem (rtx, mbsptr); + return n; +#endif +} + +static HAWK_INLINE int __cmp_str_fun (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + return __cmp_ensure_not_equal(rtx, op_hint); +} + +static HAWK_INLINE int __cmp_str_map (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + return __cmp_ensure_not_equal(rtx, op_hint); +} + +/* -------------------------------------------------------------------- */ + +static HAWK_INLINE int __cmp_mbs_nil (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + return (((hawk_val_mbs_t*)left)->val.len == 0)? 0: 1; +} + +static HAWK_INLINE int __cmp_mbs_int (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + int n; + n = __cmp_int_mbs(rtx, right, left, inverse_cmp_op(op_hint)); + if (n == CMP_ERROR) return CMP_ERROR; + return -n; +} + +static HAWK_INLINE int __cmp_mbs_flt (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + int n; + n = __cmp_flt_mbs(rtx, right, left, inverse_cmp_op(op_hint)); + if (n == CMP_ERROR) return CMP_ERROR; + return -n; +} + +static HAWK_INLINE int __cmp_mbs_str (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + int n; + n = __cmp_str_mbs(rtx, right, left, inverse_cmp_op(op_hint)); + if (n == CMP_ERROR) return CMP_ERROR; + return -n; +} + +static HAWK_INLINE int __cmp_mbs_mbs (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + hawk_val_mbs_t* ls = (hawk_val_mbs_t*)left; + hawk_val_mbs_t* rs = (hawk_val_mbs_t*)right; +#if (HAWK_SIZEOF_BCH_T != HAWK_SIZEOF_UINT8_T) +# error Unsupported size of hawk_bch_t +#endif + return hawk_comp_bchars(ls->val.ptr, ls->val.len, rs->val.ptr, rs->val.len, rtx->gbl.ignorecase); +} + +static HAWK_INLINE int __cmp_mbs_fun (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + return __cmp_ensure_not_equal(rtx, op_hint); +} + +static HAWK_INLINE int __cmp_mbs_map (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + return __cmp_ensure_not_equal(rtx, op_hint); +} + +/* -------------------------------------------------------------------- */ + +static HAWK_INLINE int __cmp_fun_nil (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + return __cmp_ensure_not_equal(rtx, op_hint); +} + +static HAWK_INLINE int __cmp_fun_int (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + return __cmp_ensure_not_equal(rtx, op_hint); +} + +static HAWK_INLINE int __cmp_fun_flt (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + return __cmp_ensure_not_equal(rtx, op_hint); +} + +static HAWK_INLINE int __cmp_fun_str (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + return __cmp_ensure_not_equal(rtx, op_hint); +} + +static HAWK_INLINE int __cmp_fun_mbs (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + return __cmp_ensure_not_equal(rtx, op_hint); +} + +static HAWK_INLINE int __cmp_fun_fun (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + return (((hawk_val_fun_t*)left)->fun == ((hawk_val_fun_t*)right)->fun)? 0: __cmp_ensure_not_equal(rtx, op_hint); +} + +static HAWK_INLINE int __cmp_fun_map (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + return __cmp_ensure_not_equal(rtx, op_hint); +} + +/* -------------------------------------------------------------------- */ + +static HAWK_INLINE int __cmp_map_nil (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + int n; + n = __cmp_nil_map(rtx, right, left, inverse_cmp_op(op_hint)); + if (n == CMP_ERROR) return CMP_ERROR; + return -n; +} + +static HAWK_INLINE int __cmp_map_int (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + int n; + n = __cmp_int_map(rtx, right, left, inverse_cmp_op(op_hint)); + if (n == CMP_ERROR) return CMP_ERROR; + return -n; +} + +static HAWK_INLINE int __cmp_map_flt (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + int n; + n = __cmp_flt_map(rtx, right, left, inverse_cmp_op(op_hint)); + if (n == CMP_ERROR) return CMP_ERROR; + return -n; +} + +static HAWK_INLINE int __cmp_map_str (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + return __cmp_ensure_not_equal(rtx, op_hint); +} + +static HAWK_INLINE int __cmp_map_mbs (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + return __cmp_ensure_not_equal(rtx, op_hint); +} + +static HAWK_INLINE int __cmp_map_fun (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + return __cmp_ensure_not_equal(rtx, op_hint); +} + +static HAWK_INLINE int __cmp_map_map (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint) +{ + /* can't compare a map with a map */ + SETERR_COD (rtx, HAWK_EOPERAND); + return CMP_ERROR; +} +/* -------------------------------------------------------------------- */ + + +static HAWK_INLINE int __cmp_val (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, cmp_op_t op_hint, int* ret) +{ + int n; + hawk_val_type_t lvtype, rvtype; + typedef int (*cmp_val_t) (hawk_rtx_t*, hawk_val_t*, hawk_val_t*, cmp_op_t op_hint); + + static cmp_val_t func[] = + { + /* this table must be synchronized with + * the HAWK_VAL_XXX values in awk.h */ + __cmp_nil_nil, __cmp_nil_int, __cmp_nil_flt, __cmp_nil_str, __cmp_nil_mbs, __cmp_nil_fun, __cmp_nil_map, + __cmp_int_nil, __cmp_int_int, __cmp_int_flt, __cmp_int_str, __cmp_int_mbs, __cmp_int_fun, __cmp_int_map, + __cmp_flt_nil, __cmp_flt_int, __cmp_flt_flt, __cmp_flt_str, __cmp_flt_mbs, __cmp_flt_fun, __cmp_flt_map, + __cmp_str_nil, __cmp_str_int, __cmp_str_flt, __cmp_str_str, __cmp_str_mbs, __cmp_str_fun, __cmp_str_map, + __cmp_mbs_nil, __cmp_mbs_int, __cmp_mbs_flt, __cmp_mbs_str, __cmp_mbs_mbs, __cmp_mbs_fun, __cmp_mbs_map, + __cmp_fun_nil, __cmp_fun_int, __cmp_fun_flt, __cmp_fun_str, __cmp_fun_mbs, __cmp_fun_fun, __cmp_fun_map, + __cmp_map_nil, __cmp_map_int, __cmp_map_flt, __cmp_map_str, __cmp_map_mbs, __cmp_map_fun, __cmp_map_map + }; + + lvtype = HAWK_RTX_GETVALTYPE(rtx, left); + rvtype = HAWK_RTX_GETVALTYPE(rtx, right); + if (!(rtx->awk->opt.trait & HAWK_FLEXMAP) && + (lvtype == HAWK_VAL_MAP || rvtype == HAWK_VAL_MAP)) + { + /* a map can't be compared againt other values */ + SETERR_COD (rtx, HAWK_EOPERAND); + return -1; + } + + HAWK_ASSERT (hawk_rtx_getawk(rtx), lvtype >= HAWK_VAL_NIL && lvtype <= HAWK_VAL_MAP); + HAWK_ASSERT (hawk_rtx_getawk(rtx), rvtype >= HAWK_VAL_NIL && rvtype <= HAWK_VAL_MAP); + + /* mapping fomula and table layout assume: + * HAWK_VAL_NIL = 0 + * HAWK_VAL_INT = 1 + * HAWK_VAL_FLT = 2 + * HAWK_VAL_STR = 3 + * HAWK_VAL_MBS = 4 + * HAWK_VAL_FUN = 5 + * HAWK_VAL_MAP = 6 + * + * op_hint indicate the operation in progress when this function is called. + * this hint doesn't require the comparison function to compare using this + * operation. the comparision function should return 0 if equal, -1 if less, + * 1 if greater, CMP_ERROR upon error regardless of this hint. + */ + n = func[lvtype * 7 + rvtype](rtx, left, right, op_hint); + if (n == CMP_ERROR) return -1; + + *ret = n; + return 0; +} + +int hawk_rtx_cmpval (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, int* ret) +{ + return __cmp_val(rtx, left, right, CMP_OP_NONE, ret); +} + +static int teq_val (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right) +{ + int n; + hawk_val_type_t lt, rt; + + if (left == right) n = 1; + else + { + lt = HAWK_RTX_GETVALTYPE(rtx, left); + rt = HAWK_RTX_GETVALTYPE(rtx, right); + + if (lt != rt) n = 0; + else + { + switch (lt) + { + case HAWK_VAL_NIL: + n = 1; + break; + + case HAWK_VAL_INT: + n = (HAWK_RTX_GETINTFROMVAL (rtx, left) == HAWK_RTX_GETINTFROMVAL (rtx, right)); + break; + + case HAWK_VAL_FLT: + n = ((hawk_val_flt_t*)left)->val == ((hawk_val_flt_t*)right)->val; + break; + + case HAWK_VAL_STR: + n = hawk_comp_oochars ( + ((hawk_val_str_t*)left)->val.ptr, + ((hawk_val_str_t*)left)->val.len, + ((hawk_val_str_t*)right)->val.ptr, + ((hawk_val_str_t*)right)->val.len, + rtx->gbl.ignorecase) == 0; + break; + + case HAWK_VAL_MBS: + n = hawk_comp_bchars ( + ((hawk_val_mbs_t*)left)->val.ptr, + ((hawk_val_mbs_t*)left)->val.len, + ((hawk_val_mbs_t*)right)->val.ptr, + ((hawk_val_mbs_t*)right)->val.len, + rtx->gbl.ignorecase) == 0; + break; + + case HAWK_VAL_FUN: + n = ((hawk_val_fun_t*)left)->fun == ((hawk_val_fun_t*)right)->fun; + break; + + default: + /* map-x and map-y are always different regardless of + * their contents. however, if they are pointing to the + * same map value, it won't reach here but will be + * handled by the first check in this function */ + n = 0; + break; + } + } + } + + return n; +} + +static hawk_val_t* eval_binop_teq (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right) +{ + return teq_val(rtx, left, right)? HAWK_VAL_ONE: HAWK_VAL_ZERO; +} + +static hawk_val_t* eval_binop_tne (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right) +{ + return teq_val(rtx, left, right)? HAWK_VAL_ZERO: HAWK_VAL_ONE; +} + +static hawk_val_t* eval_binop_eq (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right) +{ + int n; + if (__cmp_val(rtx, left, right, CMP_OP_EQ, &n) <= -1) return HAWK_NULL; + return (n == 0)? HAWK_VAL_ONE: HAWK_VAL_ZERO; +} + +static hawk_val_t* eval_binop_ne (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right) +{ + int n; + if (__cmp_val(rtx, left, right, CMP_OP_NE, &n) <= -1) return HAWK_NULL; + return (n != 0)? HAWK_VAL_ONE: HAWK_VAL_ZERO; +} + +static hawk_val_t* eval_binop_gt (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right) +{ + int n; + if (__cmp_val(rtx, left, right, CMP_OP_GT, &n) <= -1) return HAWK_NULL; + return (n > 0)? HAWK_VAL_ONE: HAWK_VAL_ZERO; +} + +static hawk_val_t* eval_binop_ge (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right) +{ + int n; + if (__cmp_val(rtx, left, right, CMP_OP_GE, &n) <= -1) return HAWK_NULL; + return (n >= 0)? HAWK_VAL_ONE: HAWK_VAL_ZERO; +} + +static hawk_val_t* eval_binop_lt (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right) +{ + int n; + if (__cmp_val(rtx, left, right, CMP_OP_LT, &n) <= -1) return HAWK_NULL; + return (n < 0)? HAWK_VAL_ONE: HAWK_VAL_ZERO; +} + +static hawk_val_t* eval_binop_le (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right) +{ + int n; + if (__cmp_val(rtx, left, right, CMP_OP_LE, &n) <= -1) return HAWK_NULL; + return (n <= 0)? HAWK_VAL_ONE: HAWK_VAL_ZERO; +} + +static hawk_val_t* eval_binop_lshift (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right) +{ + hawk_int_t l1, l2; + + if (hawk_rtx_valtoint(rtx, left, &l1) <= -1 || + hawk_rtx_valtoint(rtx, right, &l2) <= -1) + { + SETERR_COD (rtx, HAWK_EOPERAND); + return HAWK_NULL; + } + + return hawk_rtx_makeintval(rtx, l1 << l2); +} + +static hawk_val_t* eval_binop_rshift (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right) +{ + hawk_int_t l1, l2; + + if (hawk_rtx_valtoint(rtx, left, &l1) <= -1 || + hawk_rtx_valtoint(rtx, right, &l2) <= -1) + { + SETERR_COD (rtx, HAWK_EOPERAND); + return HAWK_NULL; + } + + return hawk_rtx_makeintval (rtx, l1 >> l2); +} + +static hawk_val_t* eval_binop_plus (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right) +{ + int n1, n2, n3; + hawk_int_t l1, l2; + hawk_flt_t r1, r2; + + n1 = hawk_rtx_valtonum(rtx, left, &l1, &r1); + n2 = hawk_rtx_valtonum(rtx, right, &l2, &r2); + + if (n1 <= -1 || n2 <= -1) + { + SETERR_COD (rtx, HAWK_EOPERAND); + return HAWK_NULL; + } + /* + n1 n2 n3 + 0 0 = 0 + 1 0 = 1 + 0 1 = 2 + 1 1 = 3 + */ + n3 = n1 + (n2 << 1); + HAWK_ASSERT (hawk_rtx_getawk(rtx), n3 >= 0 && n3 <= 3); + + return (n3 == 0)? hawk_rtx_makeintval(rtx,(hawk_int_t)l1+(hawk_int_t)l2): + (n3 == 1)? hawk_rtx_makefltval(rtx,(hawk_flt_t)r1+(hawk_flt_t)l2): + (n3 == 2)? hawk_rtx_makefltval(rtx,(hawk_flt_t)l1+(hawk_flt_t)r2): + hawk_rtx_makefltval(rtx,(hawk_flt_t)r1+(hawk_flt_t)r2); +} + +static hawk_val_t* eval_binop_minus (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right) +{ + int n1, n2, n3; + hawk_int_t l1, l2; + hawk_flt_t r1, r2; + + n1 = hawk_rtx_valtonum(rtx, left, &l1, &r1); + n2 = hawk_rtx_valtonum(rtx, right, &l2, &r2); + + if (n1 <= -1 || n2 <= -1) + { + SETERR_COD (rtx, HAWK_EOPERAND); + return HAWK_NULL; + } + + n3 = n1 + (n2 << 1); + HAWK_ASSERT (hawk_rtx_getawk(rtx), n3 >= 0 && n3 <= 3); + return (n3 == 0)? hawk_rtx_makeintval(rtx,(hawk_int_t)l1-(hawk_int_t)l2): + (n3 == 1)? hawk_rtx_makefltval(rtx,(hawk_flt_t)r1-(hawk_flt_t)l2): + (n3 == 2)? hawk_rtx_makefltval(rtx,(hawk_flt_t)l1-(hawk_flt_t)r2): + hawk_rtx_makefltval(rtx,(hawk_flt_t)r1-(hawk_flt_t)r2); +} + +static hawk_val_t* eval_binop_mul (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right) +{ + int n1, n2, n3; + hawk_int_t l1, l2; + hawk_flt_t r1, r2; + + n1 = hawk_rtx_valtonum (rtx, left, &l1, &r1); + n2 = hawk_rtx_valtonum (rtx, right, &l2, &r2); + + if (n1 <= -1 || n2 <= -1) + { + SETERR_COD (rtx, HAWK_EOPERAND); + return HAWK_NULL; + } + + n3 = n1 + (n2 << 1); + HAWK_ASSERT (hawk_rtx_getawk(rtx), n3 >= 0 && n3 <= 3); + return (n3 == 0)? hawk_rtx_makeintval(rtx,(hawk_int_t)l1*(hawk_int_t)l2): + (n3 == 1)? hawk_rtx_makefltval(rtx,(hawk_flt_t)r1*(hawk_flt_t)l2): + (n3 == 2)? hawk_rtx_makefltval(rtx,(hawk_flt_t)l1*(hawk_flt_t)r2): + hawk_rtx_makefltval(rtx,(hawk_flt_t)r1*(hawk_flt_t)r2); +} + +static hawk_val_t* eval_binop_div (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right) +{ + int n1, n2, n3; + hawk_int_t l1, l2; + hawk_flt_t r1, r2; + hawk_val_t* res; + + n1 = hawk_rtx_valtonum (rtx, left, &l1, &r1); + n2 = hawk_rtx_valtonum (rtx, right, &l2, &r2); + + if (n1 <= -1 || n2 <= -1) + { + SETERR_COD (rtx, HAWK_EOPERAND); + return HAWK_NULL; + } + + n3 = n1 + (n2 << 1); + switch (n3) + { + case 0: + if (l2 == 0) + { + SETERR_COD (rtx, HAWK_EDIVBY0); + return HAWK_NULL; + } + + if (((hawk_int_t)l1 % (hawk_int_t)l2) == 0) + { + res = hawk_rtx_makeintval ( + rtx, (hawk_int_t)l1 / (hawk_int_t)l2); + } + else + { + res = hawk_rtx_makefltval ( + rtx, (hawk_flt_t)l1 / (hawk_flt_t)l2); + } + break; + + case 1: + res = hawk_rtx_makefltval ( + rtx, (hawk_flt_t)r1 / (hawk_flt_t)l2); + break; + + case 2: + res = hawk_rtx_makefltval ( + rtx, (hawk_flt_t)l1 / (hawk_flt_t)r2); + break; + + case 3: + res = hawk_rtx_makefltval ( + rtx, (hawk_flt_t)r1 / (hawk_flt_t)r2); + break; + } + + return res; +} + +static hawk_val_t* eval_binop_idiv (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right) +{ + int n1, n2, n3; + hawk_int_t l1, l2; + hawk_flt_t r1, r2, quo; + hawk_val_t* res; + + n1 = hawk_rtx_valtonum (rtx, left, &l1, &r1); + n2 = hawk_rtx_valtonum (rtx, right, &l2, &r2); + + if (n1 <= -1 || n2 <= -1) + { + SETERR_COD (rtx, HAWK_EOPERAND); + return HAWK_NULL; + } + + n3 = n1 + (n2 << 1); + switch (n3) + { + case 0: + if (l2 == 0) + { + SETERR_COD (rtx, HAWK_EDIVBY0); + return HAWK_NULL; + } + res = hawk_rtx_makeintval ( + rtx, (hawk_int_t)l1 / (hawk_int_t)l2); + break; + + case 1: + quo = (hawk_flt_t)r1 / (hawk_flt_t)l2; + res = hawk_rtx_makeintval (rtx, (hawk_int_t)quo); + break; + + case 2: + quo = (hawk_flt_t)l1 / (hawk_flt_t)r2; + res = hawk_rtx_makeintval (rtx, (hawk_int_t)quo); + break; + + case 3: + quo = (hawk_flt_t)r1 / (hawk_flt_t)r2; + res = hawk_rtx_makeintval (rtx, (hawk_int_t)quo); + break; + } + + return res; +} + +static hawk_val_t* eval_binop_mod (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right) +{ + int n1, n2, n3; + hawk_int_t l1, l2; + hawk_flt_t r1, r2; + hawk_val_t* res; + + /* the mod function must be provided when the awk object is created to be able to calculate floating-pointer remainder */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), rtx->awk->prm.math.mod != HAWK_NULL); + + n1 = hawk_rtx_valtonum(rtx, left, &l1, &r1); + n2 = hawk_rtx_valtonum(rtx, right, &l2, &r2); + + if (n1 <= -1 || n2 <= -1) + { + SETERR_COD (rtx, HAWK_EOPERAND); + return HAWK_NULL; + } + + n3 = n1 + (n2 << 1); + switch (n3) + { + case 0: + if (l2 == 0) + { + SETERR_COD (rtx, HAWK_EDIVBY0); + return HAWK_NULL; + } + res = hawk_rtx_makeintval(rtx, (hawk_int_t)l1 % (hawk_int_t)l2); + break; + + case 1: + res = hawk_rtx_makefltval(rtx, rtx->awk->prm.math.mod(rtx->awk, (hawk_flt_t)r1, (hawk_flt_t)l2)); + break; + + case 2: + res = hawk_rtx_makefltval(rtx, rtx->awk->prm.math.mod(rtx->awk, (hawk_flt_t)l1, (hawk_flt_t)r2)); + break; + + case 3: + res = hawk_rtx_makefltval(rtx, rtx->awk->prm.math.mod(rtx->awk, (hawk_flt_t)r1, (hawk_flt_t)r2)); + break; + } + + return res; +} + +static hawk_val_t* eval_binop_exp (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right) +{ + int n1, n2, n3; + hawk_int_t l1, l2; + hawk_flt_t r1, r2; + hawk_val_t* res; + + n1 = hawk_rtx_valtonum (rtx, left, &l1, &r1); + n2 = hawk_rtx_valtonum (rtx, right, &l2, &r2); + + if (n1 <= -1 || n2 <= -1) + { + SETERR_COD (rtx, HAWK_EOPERAND); + return HAWK_NULL; + } + + n3 = n1 + (n2 << 1); + switch (n3) + { + case 0: + /* left - int, right - int */ + if (l2 >= 0) + { + hawk_int_t v = 1; + while (l2-- > 0) v *= l1; + res = hawk_rtx_makeintval (rtx, v); + } + else if (l1 == 0) + { + SETERR_COD (rtx, HAWK_EDIVBY0); + return HAWK_NULL; + } + else + { + hawk_flt_t v = 1.0; + l2 *= -1; + while (l2-- > 0) v /= l1; + res = hawk_rtx_makefltval (rtx, v); + } + break; + + case 1: + /* left - real, right - int */ + if (l2 >= 0) + { + hawk_flt_t v = 1.0; + while (l2-- > 0) v *= r1; + res = hawk_rtx_makefltval (rtx, v); + } + else if (r1 == 0.0) + { + SETERR_COD (rtx, HAWK_EDIVBY0); + return HAWK_NULL; + } + else + { + hawk_flt_t v = 1.0; + l2 *= -1; + while (l2-- > 0) v /= r1; + res = hawk_rtx_makefltval (rtx, v); + } + break; + + case 2: + /* left - int, right - real */ + res = hawk_rtx_makefltval ( + rtx, + rtx->awk->prm.math.pow ( + rtx->awk, (hawk_flt_t)l1, (hawk_flt_t)r2 + ) + ); + break; + + case 3: + /* left - real, right - real */ + res = hawk_rtx_makefltval ( + rtx, + rtx->awk->prm.math.pow ( + rtx->awk, (hawk_flt_t)r1,(hawk_flt_t)r2 + ) + ); + break; + } + + return res; +} + +static hawk_val_t* eval_binop_concat (hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right) +{ + hawk_val_t* res; + hawk_rtx_valtostr_out_t lout, rout; + + lout.type = HAWK_RTX_VALTOSTR_CPLDUP; + if (hawk_rtx_valtostr(rtx, left, &lout) <= -1) return HAWK_NULL; + + rout.type = HAWK_RTX_VALTOSTR_CPLDUP; + if (hawk_rtx_valtostr(rtx, right, &rout) <= -1) + { + hawk_rtx_freemem (rtx, lout.u.cpldup.ptr); + return HAWK_NULL; + } + + res = hawk_rtx_makestrvalwithoochars2( + rtx, + lout.u.cpldup.ptr, lout.u.cpldup.len, + rout.u.cpldup.ptr, rout.u.cpldup.len + ); + + hawk_rtx_freemem (rtx, rout.u.cpldup.ptr); + hawk_rtx_freemem (rtx, lout.u.cpldup.ptr); + + return res; +} + +static hawk_val_t* eval_binop_match0 ( + hawk_rtx_t* rtx, hawk_val_t* left, hawk_val_t* right, + const hawk_loc_t* lloc, const hawk_loc_t* rloc, int ret) +{ + hawk_val_t* res; + hawk_oocs_t out; + int n; + + out.ptr = hawk_rtx_getvaloocstr (rtx, left, &out.len); + if (out.ptr == HAWK_NULL) return HAWK_NULL; + + n = hawk_rtx_matchrex (rtx, right, &out, &out, HAWK_NULL, HAWK_NULL); + hawk_rtx_freevaloocstr (rtx, left, out.ptr); + + if (n <= -1) + { + ADJERR_LOC (rtx, lloc); + return HAWK_NULL; + } + + res = hawk_rtx_makeintval (rtx, (n == ret)); + if (res == HAWK_NULL) + { + ADJERR_LOC (rtx, lloc); + return HAWK_NULL; + } + + return res; +} + +static hawk_val_t* eval_binop_ma (hawk_rtx_t* run, hawk_nde_t* left, hawk_nde_t* right) +{ + hawk_val_t* lv, * rv, * res; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), left->next == HAWK_NULL); + HAWK_ASSERT (hawk_rtx_getawk(rtx), right->next == HAWK_NULL); + + lv = eval_expression (run, left); + if (lv == HAWK_NULL) return HAWK_NULL; + + hawk_rtx_refupval (run, lv); + + rv = eval_expression0 (run, right); + if (rv == HAWK_NULL) + { + hawk_rtx_refdownval (run, lv); + return HAWK_NULL; + } + + hawk_rtx_refupval (run, rv); + + res = eval_binop_match0 (run, lv, rv, &left->loc, &right->loc, 1); + + hawk_rtx_refdownval (run, rv); + hawk_rtx_refdownval (run, lv); + + return res; +} + +static hawk_val_t* eval_binop_nm (hawk_rtx_t* run, hawk_nde_t* left, hawk_nde_t* right) +{ + hawk_val_t* lv, * rv, * res; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), left->next == HAWK_NULL); + HAWK_ASSERT (hawk_rtx_getawk(rtx), right->next == HAWK_NULL); + + lv = eval_expression (run, left); + if (lv == HAWK_NULL) return HAWK_NULL; + + hawk_rtx_refupval (run, lv); + + rv = eval_expression0 (run, right); + if (rv == HAWK_NULL) + { + hawk_rtx_refdownval (run, lv); + return HAWK_NULL; + } + + hawk_rtx_refupval (run, rv); + + res = eval_binop_match0 (run, lv, rv, &left->loc, &right->loc, 0); + + hawk_rtx_refdownval (run, rv); + hawk_rtx_refdownval (run, lv); + + return res; +} + +static hawk_val_t* eval_unary (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + hawk_val_t* left, * res = HAWK_NULL; + hawk_nde_exp_t* exp = (hawk_nde_exp_t*)nde; + int n; + hawk_int_t l; + hawk_flt_t r; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), + exp->type == HAWK_NDE_EXP_UNR); + HAWK_ASSERT (hawk_rtx_getawk(rtx), + exp->left != HAWK_NULL && exp->right == HAWK_NULL); + HAWK_ASSERT (hawk_rtx_getawk(rtx), + exp->opcode == HAWK_UNROP_PLUS || + exp->opcode == HAWK_UNROP_MINUS || + exp->opcode == HAWK_UNROP_LNOT || + exp->opcode == HAWK_UNROP_BNOT); + + HAWK_ASSERT (hawk_rtx_getawk(rtx), exp->left->next == HAWK_NULL); + left = eval_expression (rtx, exp->left); + if (left == HAWK_NULL) return HAWK_NULL; + + hawk_rtx_refupval (rtx, left); + + switch (exp->opcode) + { + case HAWK_UNROP_MINUS: + n = hawk_rtx_valtonum (rtx, left, &l, &r); + if (n <= -1) goto exit_func; + + res = (n == 0)? hawk_rtx_makeintval (rtx, -l): + hawk_rtx_makefltval (rtx, -r); + break; + + case HAWK_UNROP_LNOT: + if (HAWK_RTX_GETVALTYPE (rtx, left) == HAWK_VAL_STR) + { + /* 0 if the string length is greater than 0. + * 1 if it's empty */ + res = hawk_rtx_makeintval ( + rtx, !(((hawk_val_str_t*)left)->val.len > 0)); + } + else + { + n = hawk_rtx_valtonum (rtx, left, &l, &r); + if (n <= -1) goto exit_func; + + res = (n == 0)? hawk_rtx_makeintval (rtx, !l): + hawk_rtx_makefltval (rtx, !r); + } + break; + + case HAWK_UNROP_BNOT: + n = hawk_rtx_valtoint (rtx, left, &l); + if (n <= -1) goto exit_func; + + res = hawk_rtx_makeintval (rtx, ~l); + break; + + case HAWK_UNROP_PLUS: + n = hawk_rtx_valtonum (rtx, left, &l, &r); + if (n <= -1) goto exit_func; + + res = (n == 0)? hawk_rtx_makeintval (rtx, l): + hawk_rtx_makefltval (rtx, r); + break; + } + +exit_func: + hawk_rtx_refdownval (rtx, left); + if (res == HAWK_NULL) ADJERR_LOC (rtx, &nde->loc); + return res; +} + +static hawk_val_t* eval_incpre (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + hawk_val_t* left, * res; + hawk_val_type_t left_vtype; + hawk_int_t inc_val_int; + hawk_flt_t inc_val_flt; + hawk_nde_exp_t* exp = (hawk_nde_exp_t*)nde; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), exp->type == HAWK_NDE_EXP_INCPRE); + HAWK_ASSERT (hawk_rtx_getawk(rtx), exp->left != HAWK_NULL && exp->right == HAWK_NULL); + + /* this way of checking if the l-value is assignable is + * ugly as it is dependent on the node types defined in hawk.h + * but let's keep going this way for the time being. */ + if (exp->left->type < HAWK_NDE_NAMED || + /*exp->left->type > HAWK_NDE_ARGIDX) XXX */ + exp->left->type > HAWK_NDE_POS) + { + SETERR_LOC (rtx, HAWK_EOPERAND, &nde->loc); + return HAWK_NULL; + } + + if (exp->opcode == HAWK_INCOP_PLUS) + { + inc_val_int = 1; + inc_val_flt = 1.0; + } + else if (exp->opcode == HAWK_INCOP_MINUS) + { + inc_val_int = -1; + inc_val_flt = -1.0; + } + else + { + HAWK_ASSERT (hawk_rtx_getawk(rtx), !"should never happen - invalid opcode"); + SETERR_LOC (rtx, HAWK_EINTERN, &nde->loc); + return HAWK_NULL; + } + + HAWK_ASSERT (hawk_rtx_getawk(rtx), exp->left->next == HAWK_NULL); + left = eval_expression (rtx, exp->left); + if (left == HAWK_NULL) return HAWK_NULL; + + hawk_rtx_refupval (rtx, left); + left_vtype = HAWK_RTX_GETVALTYPE (rtx, left); + + switch (left_vtype) + { + case HAWK_VAL_INT: + { + hawk_int_t r = HAWK_RTX_GETINTFROMVAL (rtx, left); + res = hawk_rtx_makeintval (rtx, r + inc_val_int); + if (res == HAWK_NULL) + { + hawk_rtx_refdownval (rtx, left); + ADJERR_LOC (rtx, &nde->loc); + return HAWK_NULL; + } + break; + } + + case HAWK_VAL_FLT: + { + hawk_flt_t r = ((hawk_val_flt_t*)left)->val; + res = hawk_rtx_makefltval (rtx, r + inc_val_flt); + if (res == HAWK_NULL) + { + hawk_rtx_refdownval (rtx, left); + ADJERR_LOC (rtx, &nde->loc); + return HAWK_NULL; + } + break; + } + + default: + { + hawk_int_t v1; + hawk_flt_t v2; + int n; + + n = hawk_rtx_valtonum (rtx, left, &v1, &v2); + if (n <= -1) + { + hawk_rtx_refdownval (rtx, left); + ADJERR_LOC (rtx, &nde->loc); + return HAWK_NULL; + } + + if (n == 0) + { + res = hawk_rtx_makeintval (rtx, v1 + inc_val_int); + } + else /* if (n == 1) */ + { + HAWK_ASSERT (hawk_rtx_getawk(rtx), n == 1); + res = hawk_rtx_makefltval (rtx, v2 + inc_val_flt); + } + + if (res == HAWK_NULL) + { + hawk_rtx_refdownval (rtx, left); + ADJERR_LOC (rtx, &nde->loc); + return HAWK_NULL; + } + + break; + } + } + + if (do_assignment (rtx, exp->left, res) == HAWK_NULL) + { + hawk_rtx_refdownval (rtx, left); + return HAWK_NULL; + } + + hawk_rtx_refdownval (rtx, left); + return res; +} + +static hawk_val_t* eval_incpst (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + hawk_val_t* left, * res, * res2; + hawk_val_type_t left_vtype; + hawk_int_t inc_val_int; + hawk_flt_t inc_val_flt; + hawk_nde_exp_t* exp = (hawk_nde_exp_t*)nde; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), exp->type == HAWK_NDE_EXP_INCPST); + HAWK_ASSERT (hawk_rtx_getawk(rtx), exp->left != HAWK_NULL && exp->right == HAWK_NULL); + + /* this way of checking if the l-value is assignable is + * ugly as it is dependent on the node types defined in hawk.h. + * but let's keep going this way for the time being. */ + if (exp->left->type < HAWK_NDE_NAMED || + /*exp->left->type > HAWK_NDE_ARGIDX) XXX */ + exp->left->type > HAWK_NDE_POS) + { + SETERR_LOC (rtx, HAWK_EOPERAND, &nde->loc); + return HAWK_NULL; + } + + if (exp->opcode == HAWK_INCOP_PLUS) + { + inc_val_int = 1; + inc_val_flt = 1.0; + } + else if (exp->opcode == HAWK_INCOP_MINUS) + { + inc_val_int = -1; + inc_val_flt = -1.0; + } + else + { + HAWK_ASSERT (hawk_rtx_getawk(rtx), !"should never happen - invalid opcode"); + SETERR_LOC (rtx, HAWK_EINTERN, &nde->loc); + return HAWK_NULL; + } + + HAWK_ASSERT (hawk_rtx_getawk(rtx), exp->left->next == HAWK_NULL); + left = eval_expression (rtx, exp->left); + if (left == HAWK_NULL) return HAWK_NULL; + + hawk_rtx_refupval (rtx, left); + + left_vtype = HAWK_RTX_GETVALTYPE (rtx, left); + + switch (left_vtype) + { + case HAWK_VAL_INT: + { + hawk_int_t r = HAWK_RTX_GETINTFROMVAL (rtx, left); + res = hawk_rtx_makeintval (rtx, r); + if (res == HAWK_NULL) + { + hawk_rtx_refdownval (rtx, left); + ADJERR_LOC (rtx, &nde->loc); + return HAWK_NULL; + } + + res2 = hawk_rtx_makeintval (rtx, r + inc_val_int); + if (res2 == HAWK_NULL) + { + hawk_rtx_refdownval (rtx, left); + hawk_rtx_freeval (rtx, res, 1); + ADJERR_LOC (rtx, &nde->loc); + return HAWK_NULL; + } + + break; + } + + case HAWK_VAL_FLT: + { + hawk_flt_t r = ((hawk_val_flt_t*)left)->val; + res = hawk_rtx_makefltval (rtx, r); + if (res == HAWK_NULL) + { + hawk_rtx_refdownval (rtx, left); + ADJERR_LOC (rtx, &nde->loc); + return HAWK_NULL; + } + + res2 = hawk_rtx_makefltval (rtx, r + inc_val_flt); + if (res2 == HAWK_NULL) + { + hawk_rtx_refdownval (rtx, left); + hawk_rtx_freeval (rtx, res, 1); + ADJERR_LOC (rtx, &nde->loc); + return HAWK_NULL; + } + + break; + } + + default: + { + hawk_int_t v1; + hawk_flt_t v2; + int n; + + n = hawk_rtx_valtonum (rtx, left, &v1, &v2); + if (n <= -1) + { + hawk_rtx_refdownval (rtx, left); + ADJERR_LOC (rtx, &nde->loc); + return HAWK_NULL; + } + + if (n == 0) + { + res = hawk_rtx_makeintval (rtx, v1); + if (res == HAWK_NULL) + { + hawk_rtx_refdownval (rtx, left); + ADJERR_LOC (rtx, &nde->loc); + return HAWK_NULL; + } + + res2 = hawk_rtx_makeintval (rtx, v1 + inc_val_int); + if (res2 == HAWK_NULL) + { + hawk_rtx_refdownval (rtx, left); + hawk_rtx_freeval (rtx, res, 1); + ADJERR_LOC (rtx, &nde->loc); + return HAWK_NULL; + } + } + else /* if (n == 1) */ + { + HAWK_ASSERT (hawk_rtx_getawk(rtx), n == 1); + res = hawk_rtx_makefltval (rtx, v2); + if (res == HAWK_NULL) + { + hawk_rtx_refdownval (rtx, left); + ADJERR_LOC (rtx, &nde->loc); + return HAWK_NULL; + } + + res2 = hawk_rtx_makefltval (rtx, v2 + inc_val_flt); + if (res2 == HAWK_NULL) + { + hawk_rtx_refdownval (rtx, left); + hawk_rtx_freeval (rtx, res, 1); + ADJERR_LOC (rtx, &nde->loc); + return HAWK_NULL; + } + } + + break; + } + } + + if (do_assignment (rtx, exp->left, res2) == HAWK_NULL) + { + hawk_rtx_refdownval (rtx, left); + return HAWK_NULL; + } + + hawk_rtx_refdownval (rtx, left); + return res; +} + +static hawk_val_t* eval_cnd (hawk_rtx_t* run, hawk_nde_t* nde) +{ + hawk_val_t* tv, * v; + hawk_nde_cnd_t* cnd = (hawk_nde_cnd_t*)nde; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), cnd->test->next == HAWK_NULL); + + tv = eval_expression (run, cnd->test); + if (tv == HAWK_NULL) return HAWK_NULL; + + hawk_rtx_refupval (run, tv); + + HAWK_ASSERT (hawk_rtx_getawk(rtx), cnd->left->next == HAWK_NULL && cnd->right->next == HAWK_NULL); + v = (hawk_rtx_valtobool(run, tv))? eval_expression(run, cnd->left): eval_expression(run, cnd->right); + + hawk_rtx_refdownval (run, tv); + return v; +} + +static hawk_val_t* eval_fncall_fnc (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + /* intrinsic function */ + hawk_nde_fncall_t* call = (hawk_nde_fncall_t*)nde; + /* the parser must make sure that the number of arguments is proper */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), call->nargs >= call->u.fnc.spec.arg.min && call->nargs <= call->u.fnc.spec.arg.max); + return __eval_call(rtx, nde, HAWK_NULL, push_arg_from_nde, (void*)call->u.fnc.spec.arg.spec, HAWK_NULL, HAWK_NULL); +} + +static HAWK_INLINE hawk_val_t* eval_fncall_fun_ex (hawk_rtx_t* rtx, hawk_nde_t* nde, void(*errhandler)(void*), void* eharg) +{ + hawk_nde_fncall_t* call = (hawk_nde_fncall_t*)nde; + hawk_fun_t* fun; + hawk_htb_pair_t* pair; + + if (!call->u.fun.fun) + { + /* there can be multiple runtime instances for a single awk object. + * changing the parse tree from one runtime instance can affect + * other instances. however i do change the parse tree without protection + * hoping that the pointer assignment is atomic. (call->u.fun.fun = fun). + * i don't mind each instance performs a search duplicately for a short while */ + + pair = hawk_htb_search(rtx->awk->tree.funs, call->u.fun.name.ptr, call->u.fun.name.len); + if (!pair) + { + SETERR_ARGX_LOC (rtx, HAWK_EFUNNF, &call->u.fun.name, &nde->loc); + return HAWK_NULL; + } + + fun = (hawk_fun_t*)HAWK_HTB_VPTR(pair); + HAWK_ASSERT (hawk_rtx_getawk(rtx), fun != HAWK_NULL); + + /* cache the search result */ + call->u.fun.fun = fun; + } + else + { + /* use the cached function */ + fun = call->u.fun.fun; + } + + if (call->nargs > fun->nargs) + { + /* TODO: is this correct? what if i want to + * allow arbitarary numbers of arguments? */ + SETERR_LOC (rtx, HAWK_EARGTM, &nde->loc); + return HAWK_NULL; + } + + return __eval_call(rtx, nde, fun, push_arg_from_nde, HAWK_NULL, errhandler, eharg); +} + +static hawk_val_t* eval_fncall_fun (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + return eval_fncall_fun_ex(rtx, nde, HAWK_NULL, HAWK_NULL); +} + +static hawk_val_t* eval_fncall_var (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + hawk_nde_fncall_t* call = (hawk_nde_fncall_t*)nde; + hawk_val_t* fv, * rv; + + fv = eval_expression(rtx, (hawk_nde_t*)call->u.var.var); + if (!fv) return HAWK_NULL; + + hawk_rtx_refupval (rtx, fv); + if (HAWK_RTX_GETVALTYPE(rtx, fv) != HAWK_VAL_FUN) + { + SETERR_ARGX_LOC (rtx, HAWK_ENOTFUN, &call->u.var.var->id.name, &nde->loc); + rv = HAWK_NULL; + } + else + { + hawk_fun_t* fun = ((hawk_val_fun_t*)fv)->fun; + rv = __eval_call(rtx, nde, fun, push_arg_from_nde, HAWK_NULL, HAWK_NULL, HAWK_NULL); + } + hawk_rtx_refdownval (rtx, fv); + + return rv; +} + +/* run->stack_base has not been set for this + * stack frame. so the RTX_STACK_ARG macro cannot be used as in + * hawk_rtx_refdownval (run, RTX_STACK_ARG(run,nargs));*/ +#define UNWIND_RTX_STACK_ARG(rtx,nargs) \ + do { \ + while ((nargs) > 0) \ + { \ + --(nargs); \ + hawk_rtx_refdownval ((rtx), (rtx)->stack[(rtx)->stack_top-1]); \ + __raw_pop (rtx); \ + } \ + } while (0) + +#define UNWIND_RTX_STACK_BASE(rtx) \ + do { \ + __raw_pop (rtx); /* nargs */ \ + __raw_pop (rtx); /* return */ \ + __raw_pop (rtx); /* prev stack top */ \ + __raw_pop (rtx); /* prev stack back */ \ + } while (0) + +#define UNWIND_RTX_STACK(rtx,nargs) \ + do { \ + UNWIND_RTX_STACK_ARG (rtx,nargs); \ + UNWIND_RTX_STACK_BASE (rtx); \ + } while (0) + +static hawk_val_t* __eval_call ( + hawk_rtx_t* rtx, hawk_nde_t* nde, hawk_fun_t* fun, + hawk_oow_t(*argpusher)(hawk_rtx_t*,hawk_nde_fncall_t*,void*), void* apdata, + void(*errhandler)(void*), void* eharg) +{ + hawk_nde_fncall_t* call = (hawk_nde_fncall_t*)nde; + hawk_oow_t saved_stack_top; + hawk_oow_t nargs, i; + hawk_val_t* v; + int n; + + /* + * --------------------- + * lcln <- stack top + * --------------------- + * .... + * --------------------- + * lcl0 local variables are pushed by run_block + * ===================== + * argn + * --------------------- + * .... + * --------------------- + * arg1 + * --------------------- + * arg0 + * --------------------- + * nargs + * --------------------- + * return value + * --------------------- + * previous stack top + * --------------------- + * previous stack base <- stack base + * ===================== + * 0 (nargs) <- stack top + * --------------------- + * return value + * --------------------- + * previous stack top + * --------------------- + * previous stack base <- stack base + * ===================== + * gbln + * --------------------- + * .... + * --------------------- + * gbl0 + * --------------------- + */ + + HAWK_ASSERT (hawk_rtx_getawk(rtx), HAWK_SIZEOF(void*) >= HAWK_SIZEOF(rtx->stack_top)); + HAWK_ASSERT (hawk_rtx_getawk(rtx), HAWK_SIZEOF(void*) >= HAWK_SIZEOF(rtx->stack_base)); + + saved_stack_top = rtx->stack_top; + +#if defined(DEBUG_RUN) + hawk_logfmt (hawk_rtx_getawk(rtx), HAWK_T("setting up function stack frame top=%zd base=%zd\n"), (hawk_oow_t)rtx->stack_top, (hawk_oow_t)rtx->stack_base); +#endif + + if (__raw_push(rtx,(void*)rtx->stack_base) <= -1) + { + SETERR_LOC (rtx, HAWK_ENOMEM, &nde->loc); + return HAWK_NULL; + } + + if (__raw_push(rtx,(void*)saved_stack_top) <= -1) + { + __raw_pop (rtx); + SETERR_LOC (rtx, HAWK_ENOMEM, &nde->loc); + return HAWK_NULL; + } + + /* secure space for a return value. */ + if (__raw_push(rtx,hawk_val_nil) <= -1) + { + __raw_pop (rtx); + __raw_pop (rtx); + SETERR_LOC (rtx, HAWK_ENOMEM, &nde->loc); + return HAWK_NULL; + } + + /* secure space for nargs */ + if (__raw_push(rtx,hawk_val_nil) <= -1) + { + __raw_pop (rtx); + __raw_pop (rtx); + __raw_pop (rtx); + SETERR_LOC (rtx, HAWK_ENOMEM, &nde->loc); + return HAWK_NULL; + } + + /* push all arguments onto the stack */ + nargs = argpusher(rtx, call, apdata); + if (nargs == (hawk_oow_t)-1) + { + UNWIND_RTX_STACK_BASE (rtx); + return HAWK_NULL; + } + + HAWK_ASSERT (hawk_rtx_getawk(rtx), nargs == call->nargs); + + if (fun) + { + /* extra step for normal awk functions */ + + if (fun->argspec && call->args) /* hawk_rtx_callfun() sets up a fake call structure with nargs > 0 but args == HAWK_NULL */ + { + /* sanity check for pass-by-reference parameters of a normal awk function. + * it tests if each pass-by-reference argument is referenceable. */ + + hawk_nde_t* p = call->args; + for (i = 0; i < nargs; i++) + { + if (fun->argspec[i] == HAWK_T('r')) + { + hawk_val_t** ref; + + if (get_reference(rtx, p, &ref) <= -1) + { + UNWIND_RTX_STACK (rtx, nargs); + return HAWK_NULL; + } + } + p = p->next; + } + } + + while (nargs < fun->nargs) + { + /* push as many nils as the number of missing actual arguments */ + if (__raw_push(rtx, hawk_val_nil) <= -1) + { + UNWIND_RTX_STACK (rtx, nargs); + SETERR_LOC (rtx, HAWK_ENOMEM, &nde->loc); + return HAWK_NULL; + } + + nargs++; + } + } + + rtx->stack_base = saved_stack_top; + RTX_STACK_NARGS(rtx) = (void*)nargs; + +#if defined(DEBUG_RUN) + hawk_logfmt (hawk_rtx_getawk(rtx), HAWK_T("running function body\n")); +#endif + + if (fun) + { + /* normal awk function */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), fun->body->type == HAWK_NDE_BLK); + n = run_block(rtx,(hawk_nde_blk_t*)fun->body); + } + else + { + n = 0; + + /* intrinsic function */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), call->nargs >= call->u.fnc.spec.arg.min && call->nargs <= call->u.fnc.spec.arg.max); + + if (call->u.fnc.spec.impl) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOERR, HAWK_NULL); + + n = call->u.fnc.spec.impl(rtx, &call->u.fnc.info); + + if (n <= -1) + { + if (hawk_rtx_geterrnum(rtx) == HAWK_ENOERR) + { + /* the handler has not set the error. + * fix it */ + SETERR_ARGX_LOC ( + rtx, HAWK_EFNCIMPL, + &call->u.fnc.info.name, &nde->loc + ); + } + else + { + ADJERR_LOC (rtx, &nde->loc); + } + + /* correct the return code just in case */ + if (n < -1) n = -1; + } + } + } + + /* refdown args in the rtx.stack */ + nargs = (hawk_oow_t)RTX_STACK_NARGS(rtx); +#if defined(DEBUG_RUN) + hawk_logfmt (hawk_rtx_getawk(rtx), HAWK_T("block rtx complete nargs = %d\n"), (int)nargs); +#endif + + if (fun && fun->argspec && call->args && call->nargs > 0) /* hawk_rtx_callfun() sets up a fake call structure with nargs > 0 but args == HAWK_NULL */ + { + /* set back the values for pass-by-reference parameters of normal functions. + * the intrinsic functions are not handled here but their implementation would + * call hawk_rtx_setrefval() */ + + /* even if fun->argspec exists, call->nargs may still be 0. so i test if call->nargs > 0. + * function x(a1, &a2) {} + * BEGIN { x(); } + * all parameters are nils in this case. nargs and fun->nargs are 2 but call->nargs is 0. + */ + + hawk_oow_t cur_stack_base = rtx->stack_base; + hawk_oow_t prev_stack_base = (hawk_oow_t)rtx->stack[rtx->stack_base + 0]; + + hawk_nde_t* p = call->args; + for (i = 0; i < call->nargs; i++) + { + if (fun->argspec[i] == HAWK_T('r')) + { + hawk_val_t** ref; + hawk_val_ref_t refv; + + /* if an argument passed is a local variable or a parameter to the previous caller, + * the argument node information stored is relative to the previous stack frame. + * i revert rtx->stack_base to the previous stack frame base before calling + * get_reference() and restors it back to the current base. this tactic + * is very ugly because the assumptions for this is dependent on get_reference() + * implementation */ + rtx->stack_base = prev_stack_base; /* UGLY */ + get_reference (rtx, p, &ref); /* no failure check as it must succeed here for the check done above */ + rtx->stack_base = cur_stack_base; /* UGLY */ + + HAWK_RTX_INIT_REF_VAL (&refv, p->type - HAWK_NDE_NAMED, ref, 9); /* initialize a fake reference variable. 9 chosen randomly */ + hawk_rtx_setrefval (rtx, &refv, RTX_STACK_ARG(rtx, i)); + } + + hawk_rtx_refdownval (rtx, RTX_STACK_ARG(rtx,i)); + p = p->next; + } + + for (; i < nargs; i++) + { + hawk_rtx_refdownval (rtx, RTX_STACK_ARG(rtx,i)); + } + } + else + { + for (i = 0; i < nargs; i++) + { + hawk_rtx_refdownval (rtx, RTX_STACK_ARG(rtx,i)); + } + } + +#if defined(DEBUG_RUN) + hawk_logfmt (hawk_rtx_getawk(rtx), HAWK_T("got return value\n")); +#endif + + v = RTX_STACK_RETVAL(rtx); + if (n == -1) + { + if (hawk_rtx_geterrnum(rtx) == HAWK_ENOERR && errhandler != HAWK_NULL) + { + /* errhandler is passed only when __eval_call() is + * invoked from hawk_rtx_call(). Under this + * circumstance, this stack frame is the first + * activated and the stack base is the first element + * after the global variables. so RTX_STACK_RETVAL(rtx) + * effectively becomes RTX_STACK_RETVAL_GBL(rtx). + * As __eval_call() returns HAWK_NULL on error and + * the reference count of RTX_STACK_RETVAL(rtx) should be + * decremented, it can't get the return value + * if it turns out to be terminated by exit(). + * The return value could be destroyed by then. + * Unlikely, rtx_bpae_loop() just checks if rtx->errinf.num + * is HAWK_ENOERR and gets RTX_STACK_RETVAL_GBL(rtx) + * to determine if it is terminated by exit(). + * + * The handler capture_retval_on_exit() + * increments the reference of RTX_STACK_RETVAL(rtx) + * and stores the pointer into accompanying space. + * This way, the return value is preserved upon + * termination by exit() out to the caller. + */ + errhandler (eharg); + } + + /* if the earlier operations failed and this function + * has to return a error, the return value is just + * destroyed and replaced by nil */ + hawk_rtx_refdownval (rtx, v); + RTX_STACK_RETVAL(rtx) = hawk_val_nil; + } + else + { + /* this trick has been mentioned in rtx_return. + * adjust the reference count of the return value. + * the value must not be freed even if the reference count + * reached zero because its reference has been incremented + * in rtx_return or directly by hawk_rtx_setretval() + * regardless of its reference count. */ + hawk_rtx_refdownval_nofree (rtx, v); + } + + rtx->stack_top = (hawk_oow_t)rtx->stack[rtx->stack_base + 1]; + rtx->stack_base = (hawk_oow_t)rtx->stack[rtx->stack_base + 0]; + + if (rtx->exit_level == EXIT_FUNCTION) rtx->exit_level = EXIT_NONE; + +#if defined(DEBUG_RUN) + hawk_logfmt (hawk_rtx_getawk(rtx), HAWK_T("returning from function top=%zd, base=%zd\n"), (hawk_oow_t)rtx->stack_top, (hawk_oow_t)rtx->stack_base); +#endif + return (n == -1)? HAWK_NULL: v; +} + +static hawk_oow_t push_arg_from_vals (hawk_rtx_t* rtx, hawk_nde_fncall_t* call, void* data) +{ + struct pafv_t* pafv = (struct pafv_t*)data; + hawk_oow_t nargs = 0; + + for (nargs = 0; nargs < pafv->nargs; nargs++) + { + if (pafv->argspec && pafv->argspec[nargs] == HAWK_T('r')) + { + hawk_val_t** ref; + hawk_val_t* v; + + ref = (hawk_val_t**)&pafv->args[nargs]; + v = hawk_rtx_makerefval(rtx, HAWK_VAL_REF_LCL, ref); /* this type(HAWK_VAL_REF_LCL) is fake */ + if (!v) + { + UNWIND_RTX_STACK_ARG (rtx, nargs); + SETERR_LOC (rtx, HAWK_ENOMEM, &call->loc); + return (hawk_oow_t)-1; + } + + if (__raw_push(rtx, v) <= -1) + { + hawk_rtx_refupval (rtx, v); + hawk_rtx_refdownval (rtx, v); + + UNWIND_RTX_STACK_ARG (rtx, nargs); + SETERR_LOC (rtx, HAWK_ENOMEM, &call->loc); + return (hawk_oow_t)-1; + } + + hawk_rtx_refupval (rtx, v); + } + else + { + if (__raw_push(rtx, pafv->args[nargs]) <= -1) + { + /* ugly - arg needs to be freed if it doesn't have + * any reference. but its reference has not been + * updated yet as it is carried out after successful + * stack push. so it adds up a reference and + * dereferences it */ + hawk_rtx_refupval (rtx, pafv->args[nargs]); + hawk_rtx_refdownval (rtx, pafv->args[nargs]); + + UNWIND_RTX_STACK_ARG (rtx, nargs); + SETERR_LOC (rtx, HAWK_ENOMEM, &call->loc); + return (hawk_oow_t)-1; + } + + hawk_rtx_refupval (rtx, pafv->args[nargs]); + } + } + + return nargs; +} + +static hawk_oow_t push_arg_from_nde (hawk_rtx_t* rtx, hawk_nde_fncall_t* call, void* data) +{ + hawk_nde_t* p; + hawk_val_t* v; + hawk_oow_t nargs; + const hawk_ooch_t* fnc_arg_spec = (const hawk_ooch_t*)data; + + for (p = call->args, nargs = 0; p != HAWK_NULL; p = p->next, nargs++) + { + /* if fnc_arg_spec is to be provided, it must contain as many characters as nargs */ + + if (fnc_arg_spec && fnc_arg_spec[nargs] == HAWK_T('r')) + { + hawk_val_t** ref; + + if (get_reference(rtx, p, &ref) <= -1) + { + UNWIND_RTX_STACK_ARG (rtx, nargs); + return (hawk_oow_t)-1; + } + + /* 'p->type - HAWK_NDE_NAMED' must produce a relevant HAWK_VAL_REF_XXX value. */ + v = hawk_rtx_makerefval(rtx, p->type - HAWK_NDE_NAMED, ref); + } + else if (fnc_arg_spec && fnc_arg_spec[nargs] == HAWK_T('x')) + { + /* a regular expression is passed to + * the function as it is */ + v = eval_expression0(rtx, p); + } + else + { + v = eval_expression(rtx, p); + } + + if (!v) + { + UNWIND_RTX_STACK_ARG (rtx, nargs); + return (hawk_oow_t)-1; + } + + if (__raw_push(rtx,v) <= -1) + { + /* ugly - v needs to be freed if it doesn't have + * any reference. but its reference has not been + * updated yet as it is carried out after the + * successful stack push. so it adds up a reference + * and dereferences it */ + hawk_rtx_refupval (rtx, v); + hawk_rtx_refdownval (rtx, v); + + UNWIND_RTX_STACK_ARG (rtx, nargs); + SETERR_LOC (rtx, HAWK_ENOMEM, &call->loc); + return (hawk_oow_t)-1; + } + + hawk_rtx_refupval (rtx, v); + } + + HAWK_ASSERT (hawk_rtx_getawk(rtx), call->nargs == nargs); + return nargs; +} + +static int get_reference (hawk_rtx_t* rtx, hawk_nde_t* nde, hawk_val_t*** ref) +{ + hawk_nde_var_t* tgt = (hawk_nde_var_t*)nde; + hawk_val_t** tmp; + + /* refer to eval_indexed for application of a similar concept */ + + switch (nde->type) + { + case HAWK_NDE_NAMED: + { + hawk_htb_pair_t* pair; + + pair = hawk_htb_search(rtx->named, tgt->id.name.ptr, tgt->id.name.len); + if (pair == HAWK_NULL) + { + /* it is bad that the named variable has to be created here. + * would there be any better ways to avoid this? */ + pair = hawk_htb_upsert(rtx->named, tgt->id.name.ptr, tgt->id.name.len, hawk_val_nil, 0); + if (!pair) + { + SETERR_LOC (rtx, HAWK_ENOMEM, &nde->loc); + return -1; + } + } + + *ref = (hawk_val_t**)&HAWK_HTB_VPTR(pair); + return 0; + } + + case HAWK_NDE_GBL: + /* *ref = (hawk_val_t**)&RTX_STACK_GBL(rtx,tgt->id.idxa); */ + *ref = (hawk_val_t**)((hawk_oow_t)tgt->id.idxa); + return 0; + + case HAWK_NDE_LCL: + *ref = (hawk_val_t**)&RTX_STACK_LCL(rtx,tgt->id.idxa); + return 0; + + case HAWK_NDE_ARG: + *ref = (hawk_val_t**)&RTX_STACK_ARG(rtx,tgt->id.idxa); + return 0; + + case HAWK_NDE_NAMEDIDX: + { + hawk_htb_pair_t* pair; + + pair = hawk_htb_search(rtx->named, tgt->id.name.ptr, tgt->id.name.len); + if (pair == HAWK_NULL) + { + pair = hawk_htb_upsert(rtx->named, tgt->id.name.ptr, tgt->id.name.len, hawk_val_nil, 0); + if (pair == HAWK_NULL) + { + SETERR_LOC (rtx, HAWK_ENOMEM, &nde->loc); + return -1; + } + } + + tmp = get_reference_indexed(rtx, tgt, (hawk_val_t**)&HAWK_HTB_VPTR(pair)); + if (tmp == HAWK_NULL) return -1; + *ref = tmp; + return 0; + } + + case HAWK_NDE_GBLIDX: + tmp = get_reference_indexed(rtx, tgt, (hawk_val_t**)&RTX_STACK_GBL(rtx,tgt->id.idxa)); + if (tmp == HAWK_NULL) return -1; + *ref = tmp; + return 0; + + case HAWK_NDE_LCLIDX: + tmp = get_reference_indexed(rtx, tgt, (hawk_val_t**)&RTX_STACK_LCL(rtx,tgt->id.idxa)); + if (tmp == HAWK_NULL) return -1; + *ref = tmp; + return 0; + + case HAWK_NDE_ARGIDX: + tmp = get_reference_indexed(rtx, tgt, (hawk_val_t**)&RTX_STACK_ARG(rtx,tgt->id.idxa)); + if (tmp == HAWK_NULL) return -1; + *ref = tmp; + return 0; + + case HAWK_NDE_POS: + { + int n; + hawk_int_t lv; + hawk_val_t* v; + + /* the position number is returned for the positional + * variable unlike other reference types. */ + v = eval_expression(rtx, ((hawk_nde_pos_t*)nde)->val); + if (v == HAWK_NULL) return -1; + + hawk_rtx_refupval (rtx, v); + n = hawk_rtx_valtoint(rtx, v, &lv); + hawk_rtx_refdownval (rtx, v); + + if (n <= -1) + { + SETERR_LOC (rtx, HAWK_EPOSIDX, &nde->loc); + return -1; + } + + if (!IS_VALID_POSIDX(lv)) + { + SETERR_LOC (rtx, HAWK_EPOSIDX, &nde->loc); + return -1; + } + + *ref = (hawk_val_t**)((hawk_oow_t)lv); + return 0; + } + + default: + SETERR_LOC (rtx, HAWK_ENOTREF, &nde->loc); + return -1; + } +} + +static hawk_val_t** get_reference_indexed (hawk_rtx_t* rtx, hawk_nde_var_t* nde, hawk_val_t** val) +{ + hawk_htb_pair_t* pair; + hawk_ooch_t* str; + hawk_oow_t len; + hawk_ooch_t idxbuf[IDXBUFSIZE]; + hawk_val_type_t vtype; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), val != HAWK_NULL); + + vtype = HAWK_RTX_GETVALTYPE(rtx, *val); + if (vtype == HAWK_VAL_NIL) + { + hawk_val_t* tmp; + + tmp = hawk_rtx_makemapval (rtx); + if (tmp == HAWK_NULL) + { + ADJERR_LOC (rtx, &nde->loc); + return HAWK_NULL; + } + + hawk_rtx_refdownval (rtx, *val); + *val = tmp; + hawk_rtx_refupval (rtx, (hawk_val_t*)*val); + } + else if (vtype != HAWK_VAL_MAP) + { + SETERR_LOC (rtx, HAWK_ENOTMAP, &nde->loc); + return HAWK_NULL; + } + + HAWK_ASSERT (hawk_rtx_getawk(rtx), nde->idx != HAWK_NULL); + + len = HAWK_COUNTOF(idxbuf); + str = idxnde_to_str (rtx, nde->idx, idxbuf, &len); + if (str == HAWK_NULL) return HAWK_NULL; + + pair = hawk_htb_search((*(hawk_val_map_t**)val)->map, str, len); + if (pair == HAWK_NULL) + { + pair = hawk_htb_upsert((*(hawk_val_map_t**)val)->map, str, len, hawk_val_nil, 0); + if (pair == HAWK_NULL) + { + if (str != idxbuf) hawk_rtx_freemem (rtx, str); + SETERR_LOC (rtx, HAWK_ENOMEM, &nde->loc); + return HAWK_NULL; + } + + hawk_rtx_refupval (rtx, HAWK_HTB_VPTR(pair)); + } + + if (str != idxbuf) hawk_rtx_freemem (rtx, str); + return (hawk_val_t**)&HAWK_HTB_VPTR(pair); +} + +static hawk_val_t* eval_int (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + hawk_val_t* val; + val = hawk_rtx_makeintval(rtx, ((hawk_nde_int_t*)nde)->val); + if (val == HAWK_NULL) ADJERR_LOC (rtx, &nde->loc); + else if (HAWK_VTR_IS_POINTER(val)) ((hawk_val_int_t*)val)->nde = nde; + return val; +} + +static hawk_val_t* eval_flt (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + hawk_val_t* val; + val = hawk_rtx_makefltval(rtx, ((hawk_nde_flt_t*)nde)->val); + if (val == HAWK_NULL) ADJERR_LOC (rtx, &nde->loc); + else ((hawk_val_flt_t*)val)->nde = nde; + return val; +} + +static hawk_val_t* eval_str (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + hawk_val_t* val; + val = hawk_rtx_makestrvalwithoochars(rtx, ((hawk_nde_str_t*)nde)->ptr, ((hawk_nde_str_t*)nde)->len); + if (val == HAWK_NULL) ADJERR_LOC (rtx, &nde->loc); + return val; +} + +static hawk_val_t* eval_mbs (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + hawk_val_t* val; + val = hawk_rtx_makembsval(rtx, ((hawk_nde_mbs_t*)nde)->ptr, ((hawk_nde_mbs_t*)nde)->len); + if (val == HAWK_NULL) ADJERR_LOC (rtx, &nde->loc); + return val; +} + +static hawk_val_t* eval_rex (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + hawk_val_t* val; + val = hawk_rtx_makerexval(rtx, &((hawk_nde_rex_t*)nde)->str, ((hawk_nde_rex_t*)nde)->code); + if (val == HAWK_NULL) ADJERR_LOC (rtx, &nde->loc); + return val; +} + +static hawk_val_t* eval_fun (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + hawk_val_t* val; + hawk_fun_t* fun; + + + fun = ((hawk_nde_fun_t*)nde)->funptr; + if (!fun) + { + hawk_htb_pair_t* pair; + + /* TODO: support bultin functions?, support module functions? */ + pair = hawk_htb_search(rtx->awk->tree.funs, ((hawk_nde_fun_t*)nde)->name.ptr, ((hawk_nde_fun_t*)nde)->name.len); + if (!pair) + { + SETERR_ARGX_LOC (rtx, HAWK_EFUNNF, &((hawk_nde_fun_t*)nde)->name, &nde->loc); + return HAWK_NULL; + } + + fun = (hawk_fun_t*)HAWK_HTB_VPTR(pair); + HAWK_ASSERT (hawk_rtx_getawk(rtx), fun != HAWK_NULL); + } + + val = hawk_rtx_makefunval(rtx, fun); + if (!val) ADJERR_LOC (rtx, &nde->loc); + return val; +} + +static hawk_val_t* eval_named (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + hawk_htb_pair_t* pair; + pair = hawk_htb_search (rtx->named, ((hawk_nde_var_t*)nde)->id.name.ptr, ((hawk_nde_var_t*)nde)->id.name.len); + return (pair == HAWK_NULL)? hawk_val_nil: HAWK_HTB_VPTR(pair); +} + +static hawk_val_t* eval_gbl (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + return RTX_STACK_GBL(rtx,((hawk_nde_var_t*)nde)->id.idxa); +} + +static hawk_val_t* eval_lcl (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + return RTX_STACK_LCL(rtx,((hawk_nde_var_t*)nde)->id.idxa); +} + +static hawk_val_t* eval_arg (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + return RTX_STACK_ARG(rtx,((hawk_nde_var_t*)nde)->id.idxa); +} + +static hawk_val_t* eval_indexed (hawk_rtx_t* rtx, hawk_nde_var_t* nde, hawk_val_t** val) +{ + hawk_htb_pair_t* pair; + hawk_ooch_t* str; + hawk_oow_t len; + hawk_ooch_t idxbuf[IDXBUFSIZE]; + hawk_val_type_t vtype; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), val != HAWK_NULL); + + vtype = HAWK_RTX_GETVALTYPE(rtx, *val); + if (vtype == HAWK_VAL_NIL) + { + hawk_val_t* tmp; + + tmp = hawk_rtx_makemapval(rtx); + if (tmp == HAWK_NULL) + { + ADJERR_LOC (rtx, &nde->loc); + return HAWK_NULL; + } + + hawk_rtx_refdownval (rtx, *val); + *val = tmp; + hawk_rtx_refupval (rtx, (hawk_val_t*)*val); + } + else if (vtype != HAWK_VAL_MAP) + { + SETERR_LOC (rtx, HAWK_ENOTMAP, &nde->loc); + return HAWK_NULL; + } + + HAWK_ASSERT (hawk_rtx_getawk(rtx), nde->idx != HAWK_NULL); + + len = HAWK_COUNTOF(idxbuf); + str = idxnde_to_str(rtx, nde->idx, idxbuf, &len); + if (str == HAWK_NULL) return HAWK_NULL; + + pair = hawk_htb_search((*(hawk_val_map_t**)val)->map, str, len); + if (str != idxbuf) hawk_rtx_freemem (rtx, str); + + return (pair == HAWK_NULL)? hawk_val_nil: (hawk_val_t*)HAWK_HTB_VPTR(pair); +} + +static hawk_val_t* eval_namedidx (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + hawk_nde_var_t* tgt = (hawk_nde_var_t*)nde; + hawk_htb_pair_t* pair; + + pair = hawk_htb_search(rtx->named, tgt->id.name.ptr, tgt->id.name.len); + if (pair == HAWK_NULL) + { + pair = hawk_htb_upsert(rtx->named, tgt->id.name.ptr, tgt->id.name.len, hawk_val_nil, 0); + if (pair == HAWK_NULL) + { + SETERR_LOC (rtx, HAWK_ENOMEM, &nde->loc); + return HAWK_NULL; + } + + hawk_rtx_refupval (rtx, HAWK_HTB_VPTR(pair)); + } + + return eval_indexed (rtx, tgt, (hawk_val_t**)&HAWK_HTB_VPTR(pair)); +} + +static hawk_val_t* eval_gblidx (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + return eval_indexed(rtx, (hawk_nde_var_t*)nde, (hawk_val_t**)&RTX_STACK_GBL(rtx,((hawk_nde_var_t*)nde)->id.idxa)); +} + +static hawk_val_t* eval_lclidx (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + return eval_indexed(rtx, (hawk_nde_var_t*)nde, (hawk_val_t**)&RTX_STACK_LCL(rtx,((hawk_nde_var_t*)nde)->id.idxa)); +} + +static hawk_val_t* eval_argidx (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + return eval_indexed(rtx, (hawk_nde_var_t*)nde, (hawk_val_t**)&RTX_STACK_ARG(rtx,((hawk_nde_var_t*)nde)->id.idxa)); +} + +static hawk_val_t* eval_pos (hawk_rtx_t* run, hawk_nde_t* nde) +{ + hawk_nde_pos_t* pos = (hawk_nde_pos_t*)nde; + hawk_val_t* v; + hawk_int_t lv; + int n; + + v = eval_expression (run, pos->val); + if (v == HAWK_NULL) return HAWK_NULL; + + hawk_rtx_refupval (run, v); + n = hawk_rtx_valtoint (run, v, &lv); + hawk_rtx_refdownval (run, v); + if (n <= -1) + { + SETERR_LOC (run, HAWK_EPOSIDX, &nde->loc); + return HAWK_NULL; + } + + if (lv < 0) + { + SETERR_LOC (run, HAWK_EPOSIDX, &nde->loc); + return HAWK_NULL; + } + if (lv == 0) v = run->inrec.d0; + else if (lv > 0 && lv <= (hawk_int_t)run->inrec.nflds) + v = run->inrec.flds[lv-1].val; + else v = hawk_val_zls; /*hawk_val_nil;*/ + + return v; +} + +static hawk_val_t* eval_getline (hawk_rtx_t* rtx, hawk_nde_t* nde) +{ + hawk_nde_getline_t* p; + hawk_val_t* v, * tmp; + hawk_ooch_t* dst; + hawk_ooecs_t* buf; + int n, x; + hawk_val_type_t vtype; + + p = (hawk_nde_getline_t*)nde; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), + (p->in_type == HAWK_IN_PIPE && p->in != HAWK_NULL) || + (p->in_type == HAWK_IN_RWPIPE && p->in != HAWK_NULL) || + (p->in_type == HAWK_IN_FILE && p->in != HAWK_NULL) || + (p->in_type == HAWK_IN_CONSOLE && p->in == HAWK_NULL)); + + if (p->in) + { + hawk_oow_t len; + hawk_rtx_valtostr_out_t out; + + v = eval_expression(rtx, p->in); + if (!v) return HAWK_NULL; + + hawk_rtx_refupval (rtx, v); + dst = hawk_rtx_getvaloocstr(rtx, v, &len); + if (!dst) + { + hawk_rtx_refdownval (rtx, v); + return HAWK_NULL; + } + + if (len <= 0) + { + + hawk_rtx_freevaloocstr (rtx, v, dst); + hawk_rtx_refdownval (rtx, v); + + n = -1; + goto skip_read; + } + + while (len > 0) + { + if (dst[--len] == HAWK_T('\0')) + { + /* the input source name contains a null + * character. make getline return -1. + * unlike print & printf, it is not a hard + * error */ + hawk_rtx_freevaloocstr (rtx, v, dst); + hawk_rtx_refdownval (rtx, v); + n = -1; + goto skip_read; + } + } + } + else dst = (hawk_ooch_t*)HAWK_T(""); + + buf = &rtx->inrec.lineg; +read_console_again: + hawk_ooecs_clear (&rtx->inrec.lineg); + + n = hawk_rtx_readio(rtx, p->in_type, dst, buf); + + if (p->in) + { + hawk_rtx_freevaloocstr (rtx, v, dst); + hawk_rtx_refdownval (rtx, v); + } + + if (n <= -1) + { + /* make getline return -1 */ + n = -1; + } + else if (n > 0) + { + if (p->in_type == HAWK_IN_CONSOLE) + { + HAWK_ASSERT (hawk_rtx_getawk(rtx), p->in == HAWK_NULL); + if (rtx->nrflt.limit > 0) + { + /* record filter based on record number(NR) */ + if (((rtx->gbl.nr / rtx->nrflt.limit) % rtx->nrflt.size) != rtx->nrflt.rank) + { + if (update_fnr(rtx, rtx->gbl.fnr + 1, rtx->gbl.nr + 1) <= -1) return HAWK_NULL; + /* this jump is a bit dirty. the 'if' block below hawk_rtx_readio() + * will never be true. but this makes code confusing */ + goto read_console_again; + } + } + } + + if (p->var == HAWK_NULL) + { + /* set $0 with the input value */ + x = hawk_rtx_setrec(rtx, 0, HAWK_OOECS_OOCS(buf)); + if (x <= -1) return HAWK_NULL; + } + else + { + hawk_val_t* v; + + v = hawk_rtx_makestrvalwithoocs(rtx, HAWK_OOECS_OOCS(buf)); + if (v == HAWK_NULL) + { + ADJERR_LOC (rtx, &nde->loc); + return HAWK_NULL; + } + + hawk_rtx_refupval (rtx, v); + tmp = do_assignment(rtx, p->var, v); + hawk_rtx_refdownval (rtx, v); + if (tmp == HAWK_NULL) return HAWK_NULL; + } + + /* update FNR & NR if reading from console */ + if (p->in_type == HAWK_IN_CONSOLE && + update_fnr(rtx, rtx->gbl.fnr + 1, rtx->gbl.nr + 1) <= -1) + { + return HAWK_NULL; + } + } + +skip_read: + tmp = hawk_rtx_makeintval (rtx, n); + if (!tmp) ADJERR_LOC (rtx, &nde->loc); + return tmp; +} + +static hawk_val_t* eval_print (hawk_rtx_t* run, hawk_nde_t* nde) +{ + int n = run_print(run, (hawk_nde_print_t*)nde); + if (n == PRINT_IOERR) n = -1; /* let print return -1 */ + else if (n <= -1) return HAWK_NULL; + return hawk_rtx_makeintval(run, n); +} + +static hawk_val_t* eval_printf (hawk_rtx_t* run, hawk_nde_t* nde) +{ + int n = run_printf(run, (hawk_nde_print_t*)nde); + if (n == PRINT_IOERR) n = -1; /* let print return -1 */ + else if (n <= -1) return HAWK_NULL; + return hawk_rtx_makeintval(run, n); +} + +static int __raw_push (hawk_rtx_t* rtx, void* val) +{ + if (rtx->stack_top >= rtx->stack_limit) + { + /* + void** tmp; + hawk_oow_t n; + + n = rtx->stack_limit + RTX_STACK_INCREMENT; + + tmp = (void**)hawk_rtx_reallocmem(rtx, rtx->stack, n * HAWK_SIZEOF(void*)); + if (!tmp) return -1; + + rtx->stack = tmp; + rtx->stack_limit = n; + */ + hawk_rtx_seterrfmt (rtx, HAWK_ESTACK, HAWK_NULL, HAWK_T("runtime stack full")); + return -1; + } + + rtx->stack[rtx->stack_top++] = val; + return 0; +} + +static int read_record (hawk_rtx_t* rtx) +{ + hawk_ooi_t n; + hawk_ooecs_t* buf; + +read_again: + if (hawk_rtx_clrrec (rtx, 0) == -1) return -1; + + buf = &rtx->inrec.line; + n = hawk_rtx_readio (rtx, HAWK_IN_CONSOLE, HAWK_T(""), buf); + if (n <= -1) + { + hawk_rtx_clrrec (rtx, 0); + return -1; + } + +#if defined(DEBUG_RUN) + hawk_logfmt (hawk_rtx_getawk(rtx), HAWK_T("record len = %d str=[%.*s]\n"), (int)HAWK_OOECS_LEN(buf), (int)HAWK_OOECS_LEN(buf), HAWK_OOECS_PTR(buf)); +#endif + if (n == 0) + { + HAWK_ASSERT (hawk_rtx_getawk(rtx), HAWK_OOECS_LEN(buf) == 0); + return 0; + } + + if (rtx->nrflt.limit > 0) + { + if (((rtx->gbl.nr / rtx->nrflt.limit) % rtx->nrflt.size) != rtx->nrflt.rank) + { + if (update_fnr (rtx, rtx->gbl.fnr + 1, rtx->gbl.nr + 1) <= -1) return -1; + goto read_again; + } + } + + if (hawk_rtx_setrec(rtx, 0, HAWK_OOECS_OOCS(buf)) <= -1 || + update_fnr(rtx, rtx->gbl.fnr + 1, rtx->gbl.nr + 1) <= -1) return -1; + + return 1; +} + +static int shorten_record (hawk_rtx_t* rtx, hawk_oow_t nflds) +{ + hawk_val_t* v; + hawk_ooch_t* ofs_free = HAWK_NULL, * ofs_ptr; + hawk_oow_t ofs_len, i; + hawk_ooecs_t tmp; + hawk_val_type_t vtype; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), nflds <= rtx->inrec.nflds); + + if (nflds > 1) + { + v = RTX_STACK_GBL(rtx, HAWK_GBL_OFS); + hawk_rtx_refupval (rtx, v); + vtype = HAWK_RTX_GETVALTYPE(rtx, v); + + if (vtype == HAWK_VAL_NIL) + { + /* OFS not set */ + ofs_ptr = HAWK_T(" "); + ofs_len = 1; + } + else if (vtype == HAWK_VAL_STR) + { + ofs_ptr = ((hawk_val_str_t*)v)->val.ptr; + ofs_len = ((hawk_val_str_t*)v)->val.len; + } + else + { + hawk_rtx_valtostr_out_t out; + + out.type = HAWK_RTX_VALTOSTR_CPLDUP; + if (hawk_rtx_valtostr (rtx, v, &out) <= -1) return -1; + + ofs_ptr = out.u.cpldup.ptr; + ofs_len = out.u.cpldup.len; + ofs_free = ofs_ptr; + } + } + + if (hawk_ooecs_init(&tmp, hawk_rtx_getawk(rtx), HAWK_OOECS_LEN(&rtx->inrec.line)) <= -1) + { + if (ofs_free) hawk_rtx_freemem (rtx, ofs_free); + if (nflds > 1) hawk_rtx_refdownval (rtx, v); + SETERR_COD (rtx, HAWK_ENOMEM); + return -1; + } + + for (i = 0; i < nflds; i++) + { + if (i > 0 && hawk_ooecs_ncat(&tmp,ofs_ptr,ofs_len) == (hawk_oow_t)-1) + { + hawk_ooecs_fini (&tmp); + if (ofs_free) hawk_rtx_freemem (rtx, ofs_free); + if (nflds > 1) hawk_rtx_refdownval (rtx, v); + SETERR_COD (rtx, HAWK_ENOMEM); + return -1; + } + + if (hawk_ooecs_ncat (&tmp, rtx->inrec.flds[i].ptr, rtx->inrec.flds[i].len) == (hawk_oow_t)-1) + { + hawk_ooecs_fini (&tmp); + if (ofs_free) hawk_rtx_freemem (rtx, ofs_free); + if (nflds > 1) hawk_rtx_refdownval (rtx, v); + SETERR_COD (rtx, HAWK_ENOMEM); + return -1; + } + } + + if (ofs_free) hawk_rtx_freemem (rtx, ofs_free); + if (nflds > 1) hawk_rtx_refdownval (rtx, v); + + v = (hawk_val_t*)hawk_rtx_makestrvalwithoocs(rtx, HAWK_OOECS_OOCS(&tmp)); + if (!v) + { + hawk_ooecs_fini (&tmp); + return -1; + } + + hawk_rtx_refdownval (rtx, rtx->inrec.d0); + rtx->inrec.d0 = v; + hawk_rtx_refupval (rtx, rtx->inrec.d0); + + hawk_ooecs_swap (&tmp, &rtx->inrec.line); + hawk_ooecs_fini (&tmp); + + for (i = nflds; i < rtx->inrec.nflds; i++) + { + hawk_rtx_refdownval (rtx, rtx->inrec.flds[i].val); + } + + rtx->inrec.nflds = nflds; + return 0; +} + +static hawk_ooch_t* idxnde_to_str (hawk_rtx_t* rtx, hawk_nde_t* nde, hawk_ooch_t* buf, hawk_oow_t* len) +{ + hawk_ooch_t* str; + hawk_val_t* idx; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), nde != HAWK_NULL); + + if (!nde->next) + { + hawk_rtx_valtostr_out_t out; + + /* single node index */ + idx = eval_expression (rtx, nde); + if (!idx) return HAWK_NULL; + + hawk_rtx_refupval (rtx, idx); + + str = HAWK_NULL; + + if (buf) + { + /* try with a fixed-size buffer if given */ + out.type = HAWK_RTX_VALTOSTR_CPLCPY; + out.u.cplcpy.ptr = buf; + out.u.cplcpy.len = *len; + + if (hawk_rtx_valtostr (rtx, idx, &out) >= 0) + { + str = out.u.cplcpy.ptr; + *len = out.u.cplcpy.len; + HAWK_ASSERT (hawk_rtx_getawk(rtx), str == buf); + } + } + + if (!str) + { + /* if no fixed-size buffer was given or the fixed-size + * conversion failed, switch to the dynamic mode */ + out.type = HAWK_RTX_VALTOSTR_CPLDUP; + if (hawk_rtx_valtostr(rtx, idx, &out) <= -1) + { + hawk_rtx_refdownval (rtx, idx); + ADJERR_LOC (rtx, &nde->loc); + return HAWK_NULL; + } + + str = out.u.cpldup.ptr; + *len = out.u.cpldup.len; + } + + hawk_rtx_refdownval (rtx, idx); + } + else + { + /* multidimensional index */ + hawk_ooecs_t idxstr; + hawk_oocs_t tmp; + hawk_rtx_valtostr_out_t out; + + out.type = HAWK_RTX_VALTOSTR_STRPCAT; + out.u.strpcat = &idxstr; + + if (hawk_ooecs_init(&idxstr, hawk_rtx_getawk(rtx), DEF_BUF_CAPA) <= -1) + { + SETERR_LOC (rtx, HAWK_ENOMEM, &nde->loc); + return HAWK_NULL; + } + + while (nde) + { + idx = eval_expression(rtx, nde); + if (!idx) + { + hawk_ooecs_fini (&idxstr); + return HAWK_NULL; + } + + hawk_rtx_refupval (rtx, idx); + + if (HAWK_OOECS_LEN(&idxstr) > 0 && hawk_ooecs_ncat(&idxstr, rtx->gbl.subsep.ptr, rtx->gbl.subsep.len) == (hawk_oow_t)-1) + { + hawk_rtx_refdownval (rtx, idx); + hawk_ooecs_fini (&idxstr); + SETERR_LOC (rtx, HAWK_ENOMEM, &nde->loc); + return HAWK_NULL; + } + + if (hawk_rtx_valtostr(rtx, idx, &out) <= -1) + { + hawk_rtx_refdownval (rtx, idx); + hawk_ooecs_fini (&idxstr); + return HAWK_NULL; + } + + hawk_rtx_refdownval (rtx, idx); + nde = nde->next; + } + + hawk_ooecs_yield (&idxstr, &tmp, 0); + str = tmp.ptr; + *len = tmp.len; + + hawk_ooecs_fini (&idxstr); + } + + return str; +} + +/* ========================================================================= */ + +hawk_ooch_t* hawk_rtx_format ( + hawk_rtx_t* rtx, hawk_ooecs_t* out, hawk_ooecs_t* fbu, + const hawk_ooch_t* fmt, hawk_oow_t fmt_len, + hawk_oow_t nargs_on_stack, hawk_nde_t* args, hawk_oow_t* len) +{ + hawk_oow_t i; + hawk_oow_t stack_arg_idx = 1; + hawk_val_t* val; + +#define OUT_CHAR(c) do { \ + if (hawk_ooecs_ccat(out, (c)) == (hawk_oow_t)-1) \ + { \ + SETERR_COD (rtx, HAWK_ENOMEM); \ + return HAWK_NULL; \ + } \ +} while(0) + +#define OUT_STR(ptr,len) do { \ + if (hawk_ooecs_ncat(out, (ptr), (len)) == (hawk_oow_t)-1) \ + { \ + SETERR_COD (rtx, HAWK_ENOMEM); \ + return HAWK_NULL; \ + } \ +} while(0) + +#define FMT_CHAR(c) do { \ + if (hawk_ooecs_ccat(fbu, (c)) == (hawk_oow_t)-1) \ + { \ + SETERR_COD (rtx, HAWK_ENOMEM); \ + return HAWK_NULL; \ + } \ +} while(0) + +#define FMT_STR(ptr,len) do { \ + if (hawk_ooecs_ncat(fbu, (ptr), (len)) == (hawk_oow_t)-1) \ + { \ + SETERR_COD (rtx, HAWK_ENOMEM); \ + return HAWK_NULL; \ + } \ +} while(0) + +#define GROW(buf) do { \ + if ((buf)->ptr) \ + { \ + hawk_rtx_freemem (rtx, (buf)->ptr); \ + (buf)->ptr = HAWK_NULL; \ + } \ + (buf)->len += (buf)->inc; \ + (buf)->ptr = (hawk_ooch_t*)hawk_rtx_allocmem(rtx, (buf)->len * HAWK_SIZEOF(hawk_ooch_t)); \ + if ((buf)->ptr == HAWK_NULL) \ + { \ + (buf)->len = 0; \ + return HAWK_NULL; \ + } \ +} while(0) + +#define GROW_WITH_INC(buf,incv) do { \ + if ((buf)->ptr) \ + { \ + hawk_rtx_freemem (rtx, (buf)->ptr); \ + (buf)->ptr = HAWK_NULL; \ + } \ + (buf)->len += ((incv) > (buf)->inc)? (incv): (buf)->inc; \ + (buf)->ptr = (hawk_ooch_t*)hawk_rtx_allocmem(rtx, (buf)->len * HAWK_SIZEOF(hawk_ooch_t)); \ + if ((buf)->ptr == HAWK_NULL) \ + { \ + (buf)->len = 0; \ + return HAWK_NULL; \ + } \ +} while(0) + + /* run->format.tmp.ptr should have been assigned a pointer to a block of memory before this function has been called */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), rtx->format.tmp.ptr != HAWK_NULL); + + if (nargs_on_stack == (hawk_oow_t)-1) + { + val = (hawk_val_t*)args; + nargs_on_stack = 2; + } + else + { + val = HAWK_NULL; + } + + if (out == HAWK_NULL) out = &rtx->format.out; + if (fbu == HAWK_NULL) fbu = &rtx->format.fmt; + + hawk_ooecs_clear (out); + hawk_ooecs_clear (fbu); + + for (i = 0; i < fmt_len; i++) + { + hawk_int_t wp[2]; + int wp_idx; +#define WP_WIDTH 0 +#define WP_PRECISION 1 + + int flags; +#define FLAG_SPACE (1 << 0) +#define FLAG_HASH (1 << 1) +#define FLAG_ZERO (1 << 2) +#define FLAG_PLUS (1 << 3) +#define FLAG_MINUS (1 << 4) + + if (HAWK_OOECS_LEN(fbu) == 0) + { + /* format specifier is empty */ + if (fmt[i] == HAWK_T('%')) + { + /* add % to format specifier (fbu) */ + FMT_CHAR (fmt[i]); + } + else + { + /* normal output */ + OUT_CHAR (fmt[i]); + } + continue; + } + + /* handle flags */ + flags = 0; + while (i < fmt_len) + { + switch (fmt[i]) + { + case HAWK_T(' '): + flags |= FLAG_SPACE; + break; + case HAWK_T('#'): + flags |= FLAG_HASH; + break; + case HAWK_T('0'): + flags |= FLAG_ZERO; + break; + case HAWK_T('+'): + flags |= FLAG_PLUS; + break; + case HAWK_T('-'): + flags |= FLAG_MINUS; + break; + default: + goto wp_mod_init; + } + + FMT_CHAR (fmt[i]); i++; + } + +wp_mod_init: + wp[WP_WIDTH] = -1; /* width */ + wp[WP_PRECISION] = -1; /* precision */ + wp_idx = WP_WIDTH; /* width first */ + +wp_mod_main: + if (i < fmt_len && fmt[i] == HAWK_T('*')) + { + /* variable width/precision modifier. + * take the width/precision from a parameter and + * transform it to a fixed length format */ + hawk_val_t* v; + int n; + + if (args == HAWK_NULL) + { + if (stack_arg_idx >= nargs_on_stack) + { + SETERR_COD (rtx, HAWK_EFMTARG); + return HAWK_NULL; + } + v = hawk_rtx_getarg (rtx, stack_arg_idx); + } + else + { + if (val) + { + if (stack_arg_idx >= nargs_on_stack) + { + SETERR_COD (rtx, HAWK_EFMTARG); + return HAWK_NULL; + } + v = val; + } + else + { + v = eval_expression (rtx, args); + if (v == HAWK_NULL) return HAWK_NULL; + } + } + + hawk_rtx_refupval (rtx, v); + n = hawk_rtx_valtoint(rtx, v, &wp[wp_idx]); + hawk_rtx_refdownval (rtx, v); + if (n <= -1) return HAWK_NULL; + + do + { + n = hawk_fmt_intmax_to_oocstr( + rtx->format.tmp.ptr, + rtx->format.tmp.len, + wp[wp_idx], + 10 | HAWK_FMT_INTMAX_NOTRUNC | HAWK_FMT_INTMAX_NONULL, + -1, + HAWK_T('\0'), + HAWK_NULL + ); + if (n <= -1) + { + /* -n is the number of characters required + * including terminating null */ + GROW_WITH_INC (&rtx->format.tmp, -n); + continue; + } + + break; + } + while (1); + + FMT_STR(rtx->format.tmp.ptr, n); + + if (args == HAWK_NULL || val != HAWK_NULL) stack_arg_idx++; + else args = args->next; + i++; + } + else + { + /* fixed width/precision modifier */ + if (i < fmt_len && hawk_is_ooch_digit(fmt[i])) + { + wp[wp_idx] = 0; + do + { + wp[wp_idx] = wp[wp_idx] * 10 + fmt[i] - HAWK_T('0'); + FMT_CHAR (fmt[i]); i++; + } + while (i < fmt_len && hawk_is_ooch_digit(fmt[i])); + } + } + + if (wp_idx == WP_WIDTH && i < fmt_len && fmt[i] == HAWK_T('.')) + { + wp[WP_PRECISION] = 0; + FMT_CHAR (fmt[i]); i++; + + wp_idx = WP_PRECISION; /* change index to precision */ + goto wp_mod_main; + } + + if (i >= fmt_len) break; + + if (fmt[i] == HAWK_T('d') || fmt[i] == HAWK_T('i') || + fmt[i] == HAWK_T('x') || fmt[i] == HAWK_T('X') || + fmt[i] == HAWK_T('b') || fmt[i] == HAWK_T('B') || + fmt[i] == HAWK_T('o')) + { + hawk_val_t* v; + hawk_int_t l; + int n; + + int fmt_flags; + int fmt_uint = 0; + int fmt_width; + hawk_ooch_t fmt_fill = HAWK_T('\0'); + const hawk_ooch_t* fmt_prefix = HAWK_NULL; + + if (args == HAWK_NULL) + { + if (stack_arg_idx >= nargs_on_stack) + { + SETERR_COD (rtx, HAWK_EFMTARG); + return HAWK_NULL; + } + v = hawk_rtx_getarg (rtx, stack_arg_idx); + } + else + { + if (val != HAWK_NULL) + { + if (stack_arg_idx >= nargs_on_stack) + { + SETERR_COD (rtx, HAWK_EFMTARG); + return HAWK_NULL; + } + v = val; + } + else + { + v = eval_expression (rtx, args); + if (v == HAWK_NULL) return HAWK_NULL; + } + } + + hawk_rtx_refupval (rtx, v); + n = hawk_rtx_valtoint (rtx, v, &l); + hawk_rtx_refdownval (rtx, v); + if (n <= -1) return HAWK_NULL; + + fmt_flags = HAWK_FMT_INTMAX_NOTRUNC | HAWK_FMT_INTMAX_NONULL; + + if (l == 0 && wp[WP_PRECISION] == 0) + { + /* A zero value with a precision of zero produces + * no character. */ + fmt_flags |= HAWK_FMT_INTMAX_NOZERO; + } + + if (wp[WP_WIDTH] != -1) + { + /* Width must be greater than 0 if specified */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), wp[WP_WIDTH] > 0); + + /* justification when width is specified. */ + if (flags & FLAG_ZERO) + { + if (flags & FLAG_MINUS) + { + /* FLAG_MINUS wins if both FLAG_ZERO + * and FLAG_MINUS are specified. */ + fmt_fill = HAWK_T(' '); + if (flags & FLAG_MINUS) + { + /* left justification. need to fill the right side */ + fmt_flags |= HAWK_FMT_INTMAX_FILLRIGHT; + } + } + else + { + if (wp[WP_PRECISION] == -1) + { + /* precision not specified. + * FLAG_ZERO can take effect */ + fmt_fill = HAWK_T('0'); + fmt_flags |= HAWK_FMT_INTMAX_FILLCENTER; + } + else + { + fmt_fill = HAWK_T(' '); + } + } + } + else + { + fmt_fill = HAWK_T(' '); + if (flags & FLAG_MINUS) + { + /* left justification. need to fill the right side */ + fmt_flags |= HAWK_FMT_INTMAX_FILLRIGHT; + } + } + } + + switch (fmt[i]) + { + case HAWK_T('B'): + case HAWK_T('b'): + fmt_flags |= 2; + fmt_uint = 1; + if (l && (flags & FLAG_HASH)) + { + /* A nonzero value is prefixed with 0b */ + fmt_prefix = HAWK_T("0b"); + } + break; + + case HAWK_T('X'): + fmt_flags |= HAWK_FMT_INTMAX_UPPERCASE; + case HAWK_T('x'): + fmt_flags |= 16; + fmt_uint = 1; + if (l && (flags & FLAG_HASH)) + { + /* A nonzero value is prefixed with 0x */ + fmt_prefix = HAWK_T("0x"); + } + break; + + case HAWK_T('o'): + fmt_flags |= 8; + fmt_uint = 1; + if (flags & FLAG_HASH) + { + /* Force a leading zero digit including zero. + * 0 with FLAG_HASH and precision 0 still emits '0'. + * On the contrary, 'X' and 'x' emit no digits + * for 0 with FLAG_HASH and precision 0. */ + fmt_flags |= HAWK_FMT_INTMAX_ZEROLEAD; + } + break; + + default: + fmt_flags |= 10; + if (flags & FLAG_PLUS) + fmt_flags |= HAWK_FMT_INTMAX_PLUSSIGN; + if (flags & FLAG_SPACE) + fmt_flags |= HAWK_FMT_INTMAX_EMPTYSIGN; + break; + } + + + if (wp[WP_WIDTH] > 0) + { + if (wp[WP_WIDTH] > rtx->format.tmp.len) + GROW_WITH_INC (&rtx->format.tmp, wp[WP_WIDTH] - rtx->format.tmp.len); + fmt_width = wp[WP_WIDTH]; + } + else fmt_width = rtx->format.tmp.len; + + do + { + if (fmt_uint) + { + /* Explicit type-casting for 'l' from hawk_int_t + * to hawk_uint_t is needed before passing it to + * hawk_fmt_uintmax_to_oocstr(). + * + * Consider a value of -1 for example. + * -1 is a value with all bits set. + * If hawk_int_t is 4 bytes and hawk_uintmax_t + * is 8 bytes, the value is shown below for + * each type respectively . + * -1 - 0xFFFFFFFF (hawk_int_t) + * -1 - 0xFFFFFFFFFFFFFFFF (hawk_uintmax_t) + * Implicit typecasting of -1 from hawk_int_t to + * to hawk_uintmax_t results in 0xFFFFFFFFFFFFFFFF, + * though 0xFFFFFFF is expected in hexadecimal. + */ + n = hawk_fmt_uintmax_to_oocstr ( + rtx->format.tmp.ptr, + fmt_width, + (hawk_uint_t)l, + fmt_flags, + wp[WP_PRECISION], + fmt_fill, + fmt_prefix + ); + } + else + { + n = hawk_fmt_intmax_to_oocstr ( + rtx->format.tmp.ptr, + fmt_width, + l, + fmt_flags, + wp[WP_PRECISION], + fmt_fill, + fmt_prefix + ); + } + if (n <= -1) + { + /* -n is the number of characters required */ + GROW_WITH_INC (&rtx->format.tmp, -n); + fmt_width = -n; + continue; + } + + break; + } + while (1); + + OUT_STR (rtx->format.tmp.ptr, n); + } + else if (fmt[i] == HAWK_T('e') || fmt[i] == HAWK_T('E') || + fmt[i] == HAWK_T('g') || fmt[i] == HAWK_T('G') || + fmt[i] == HAWK_T('f')) + { + hawk_val_t* v; + hawk_flt_t r; + int n; + + #if defined(HAWK_USE_AWK_FLTMAX) + FMT_CHAR (HAWK_T('j')); + #else + FMT_CHAR (HAWK_T('z')); + #endif + FMT_CHAR (fmt[i]); + + if (args == HAWK_NULL) + { + if (stack_arg_idx >= nargs_on_stack) + { + SETERR_COD (rtx, HAWK_EFMTARG); + return HAWK_NULL; + } + v = hawk_rtx_getarg(rtx, stack_arg_idx); + } + else + { + if (val != HAWK_NULL) + { + if (stack_arg_idx >= nargs_on_stack) + { + SETERR_COD (rtx, HAWK_EFMTARG); + return HAWK_NULL; + } + v = val; + } + else + { + v = eval_expression(rtx, args); + if (v == HAWK_NULL) return HAWK_NULL; + } + } + + hawk_rtx_refupval (rtx, v); + n = hawk_rtx_valtoflt (rtx, v, &r); + hawk_rtx_refdownval (rtx, v); + if (n <= -1) return HAWK_NULL; + + if (hawk_ooecs_fcat(out, HAWK_OOECS_PTR(fbu), r) == (hawk_oow_t)-1) + { + SETERR_COD (rtx, HAWK_ENOMEM); + return HAWK_NULL; + } + } + else if (fmt[i] == HAWK_T('c')) + { + hawk_ooch_t ch; + hawk_oow_t ch_len; + hawk_val_t* v; + hawk_val_type_t vtype; + + if (args == HAWK_NULL) + { + if (stack_arg_idx >= nargs_on_stack) + { + SETERR_COD (rtx, HAWK_EFMTARG); + return HAWK_NULL; + } + v = hawk_rtx_getarg (rtx, stack_arg_idx); + } + else + { + if (val != HAWK_NULL) + { + if (stack_arg_idx >= nargs_on_stack) + { + SETERR_COD (rtx, HAWK_EFMTARG); + return HAWK_NULL; + } + v = val; + } + else + { + v = eval_expression (rtx, args); + if (v == HAWK_NULL) return HAWK_NULL; + } + } + + hawk_rtx_refupval (rtx, v); + vtype = HAWK_RTX_GETVALTYPE (rtx, v); + switch (vtype) + { + case HAWK_VAL_NIL: + ch = HAWK_T('\0'); + ch_len = 0; + break; + + case HAWK_VAL_INT: + ch = (hawk_ooch_t)HAWK_RTX_GETINTFROMVAL (rtx, v); + ch_len = 1; + break; + + case HAWK_VAL_FLT: + ch = (hawk_ooch_t)((hawk_val_flt_t*)v)->val; + ch_len = 1; + break; + + case HAWK_VAL_STR: + ch_len = ((hawk_val_str_t*)v)->val.len; + if (ch_len > 0) + { + ch = ((hawk_val_str_t*)v)->val.ptr[0]; + ch_len = 1; + } + else ch = HAWK_T('\0'); + break; + + case HAWK_VAL_MBS: + ch_len = ((hawk_val_mbs_t*)v)->val.len; + if (ch_len > 0) + { + ch = ((hawk_val_mbs_t*)v)->val.ptr[0]; + ch_len = 1; + } + else ch = HAWK_T('\0'); + break; + + default: + hawk_rtx_refdownval (rtx, v); + SETERR_COD (rtx, HAWK_EVALTOCHR); + return HAWK_NULL; + } + + if (wp[WP_PRECISION] == -1 || wp[WP_PRECISION] == 0 || wp[WP_PRECISION] > (hawk_int_t)ch_len) + { + wp[WP_PRECISION] = (hawk_int_t)ch_len; + } + + if (wp[WP_PRECISION] > wp[WP_WIDTH]) wp[WP_WIDTH] = wp[WP_PRECISION]; + + if (!(flags & FLAG_MINUS)) + { + /* right align */ + while (wp[WP_WIDTH] > wp[WP_PRECISION]) + { + if (hawk_ooecs_ccat(out, HAWK_T(' ')) == (hawk_oow_t)-1) + { + hawk_rtx_refdownval (rtx, v); + SETERR_COD (rtx, HAWK_ENOMEM); + return HAWK_NULL; + } + wp[WP_WIDTH]--; + } + } + + if (wp[WP_PRECISION] > 0) + { + if (hawk_ooecs_ccat(out, ch) == (hawk_oow_t)-1) + { + hawk_rtx_refdownval (rtx, v); + SETERR_COD (rtx, HAWK_ENOMEM); + return HAWK_NULL; + } + } + + if (flags & FLAG_MINUS) + { + /* left align */ + while (wp[WP_WIDTH] > wp[WP_PRECISION]) + { + if (hawk_ooecs_ccat (out, HAWK_T(' ')) == (hawk_oow_t)-1) + { + hawk_rtx_refdownval (rtx, v); + SETERR_COD (rtx, HAWK_ENOMEM); + return HAWK_NULL; + } + wp[WP_WIDTH]--; + } + } + + hawk_rtx_refdownval (rtx, v); + } + else if (fmt[i] == HAWK_T('s') || fmt[i] == HAWK_T('k') || fmt[i] == HAWK_T('K')) + { + hawk_ooch_t* str_ptr, * str_free = HAWK_NULL; + hawk_oow_t str_len; + hawk_int_t k; + hawk_val_t* v; + hawk_val_type_t vtype; + int bytetostr_flagged_radix = 16; + + if (args == HAWK_NULL) + { + if (stack_arg_idx >= nargs_on_stack) + { + SETERR_COD (rtx, HAWK_EFMTARG); + return HAWK_NULL; + } + v = hawk_rtx_getarg (rtx, stack_arg_idx); + } + else + { + if (val) + { + if (stack_arg_idx >= nargs_on_stack) + { + SETERR_COD (rtx, HAWK_EFMTARG); + return HAWK_NULL; + } + v = val; + } + else + { + v = eval_expression (rtx, args); + if (v == HAWK_NULL) return HAWK_NULL; + } + } + + hawk_rtx_refupval (rtx, v); + + vtype = HAWK_RTX_GETVALTYPE(rtx, v); + switch (vtype) + { + case HAWK_VAL_NIL: + str_ptr = HAWK_T(""); + str_len = 0; + break; + + case HAWK_VAL_STR: + str_ptr = ((hawk_val_str_t*)v)->val.ptr; + str_len = ((hawk_val_str_t*)v)->val.len; + break; + + case HAWK_VAL_MBS: + #if defined(HAWK_OOCH_IS_BCH) + str_ptr = ((hawk_val_mbs_t*)v)->val.ptr; + str_len = ((hawk_val_mbs_t*)v)->val.len; + break; + #else + if (fmt[i] != HAWK_T('s')) + { + str_ptr = (hawk_ooch_t*)((hawk_val_mbs_t*)v)->val.ptr; + str_len = ((hawk_val_mbs_t*)v)->val.len; + break; + } + #endif + + default: + { + if (v == val) + { + hawk_rtx_refdownval (rtx, v); + SETERR_COD (rtx, HAWK_EFMTCNV); + return HAWK_NULL; + } + + str_ptr = hawk_rtx_valtooocstrdup(rtx, v, &str_len); + if (!str_ptr) + { + hawk_rtx_refdownval (rtx, v); + return HAWK_NULL; + } + + str_free = str_ptr; + break; + } + } + + if (wp[WP_PRECISION] == -1 || wp[WP_PRECISION] > (hawk_int_t)str_len) wp[WP_PRECISION] = (hawk_int_t)str_len; + if (wp[WP_PRECISION] > wp[WP_WIDTH]) wp[WP_WIDTH] = wp[WP_PRECISION]; + + if (!(flags & FLAG_MINUS)) + { + /* right align */ + while (wp[WP_WIDTH] > wp[WP_PRECISION]) + { + if (hawk_ooecs_ccat(out, HAWK_T(' ')) == (hawk_oow_t)-1) + { + if (str_free) hawk_rtx_freemem (rtx, str_free); + hawk_rtx_refdownval (rtx, v); + SETERR_COD (rtx, HAWK_ENOMEM); + return HAWK_NULL; + } + wp[WP_WIDTH]--; + } + } + + if (fmt[i] == HAWK_T('k')) bytetostr_flagged_radix |= HAWK_BYTE_TO_BCSTR_LOWERCASE; + + for (k = 0; k < wp[WP_PRECISION]; k++) + { + hawk_ooch_t curc; + + #if defined(HAWK_OOCH_IS_BCH) + curc = str_ptr[k]; + #else + if (vtype == HAWK_VAL_MBS && fmt[i] != HAWK_T('s')) + curc = (hawk_uint8_t)((hawk_bch_t*)str_ptr)[k]; + else curc = str_ptr[k]; + #endif + + if (fmt[i] != HAWK_T('s') && !HAWK_BYTE_PRINTABLE(curc)) + { + hawk_ooch_t xbuf[3]; + if (curc <= 0xFF) + { + if (hawk_ooecs_ncat(out, HAWK_T("\\x"), 2) == (hawk_oow_t)-1) goto s_fail; + hawk_byte_to_oocstr(curc, xbuf, HAWK_COUNTOF(xbuf), bytetostr_flagged_radix, HAWK_T('0')); + if (hawk_ooecs_ncat(out, xbuf, 2) == (hawk_oow_t)-1) goto s_fail; + } + else if (curc <= 0xFFFF) + { + hawk_uint16_t u16 = curc; + if (hawk_ooecs_ncat(out, HAWK_T("\\u"), 2) == (hawk_oow_t)-1) goto s_fail; + hawk_byte_to_oocstr((u16 >> 8) & 0xFF, xbuf, HAWK_COUNTOF(xbuf), bytetostr_flagged_radix, HAWK_T('0')); + if (hawk_ooecs_ncat(out, xbuf, 2) == (hawk_oow_t)-1) goto s_fail; + hawk_byte_to_oocstr(u16 & 0xFF, xbuf, HAWK_COUNTOF(xbuf), bytetostr_flagged_radix, HAWK_T('0')); + if (hawk_ooecs_ncat(out, xbuf, 2) == (hawk_oow_t)-1) goto s_fail; + } + else + { + hawk_uint32_t u32 = curc; + if (hawk_ooecs_ncat(out, HAWK_T("\\U"), 2) == (hawk_oow_t)-1) goto s_fail; + hawk_byte_to_oocstr((u32 >> 24) & 0xFF, xbuf, HAWK_COUNTOF(xbuf), bytetostr_flagged_radix, HAWK_T('0')); + if (hawk_ooecs_ncat(out, xbuf, 2) == (hawk_oow_t)-1) goto s_fail; + hawk_byte_to_oocstr((u32 >> 16) & 0xFF, xbuf, HAWK_COUNTOF(xbuf), bytetostr_flagged_radix, HAWK_T('0')); + if (hawk_ooecs_ncat(out, xbuf, 2) == (hawk_oow_t)-1) goto s_fail; + hawk_byte_to_oocstr((u32 >> 8) & 0xFF, xbuf, HAWK_COUNTOF(xbuf), bytetostr_flagged_radix, HAWK_T('0')); + if (hawk_ooecs_ncat(out, xbuf, 2) == (hawk_oow_t)-1) goto s_fail; + hawk_byte_to_oocstr(u32 & 0xFF, xbuf, HAWK_COUNTOF(xbuf), bytetostr_flagged_radix, HAWK_T('0')); + if (hawk_ooecs_ncat(out, xbuf, 2) == (hawk_oow_t)-1) goto s_fail; + } + } + else + { + if (hawk_ooecs_ccat(out, curc) == (hawk_oow_t)-1) + { + s_fail: + if (str_free) hawk_rtx_freemem (rtx, str_free); + hawk_rtx_refdownval (rtx, v); + SETERR_COD (rtx, HAWK_ENOMEM); + return HAWK_NULL; + } + } + } + + if (str_free) hawk_rtx_freemem (rtx, str_free); + + if (flags & FLAG_MINUS) + { + /* left align */ + while (wp[WP_WIDTH] > wp[WP_PRECISION]) + { + if (hawk_ooecs_ccat(out, HAWK_T(' ')) == (hawk_oow_t)-1) + { + hawk_rtx_refdownval (rtx, v); + SETERR_COD (rtx, HAWK_ENOMEM); + return HAWK_NULL; + } + wp[WP_WIDTH]--; + } + } + + hawk_rtx_refdownval (rtx, v); + } + else + { + if (fmt[i] != HAWK_T('%')) OUT_STR (HAWK_OOECS_PTR(fbu), HAWK_OOECS_LEN(fbu)); + OUT_CHAR (fmt[i]); + goto skip_taking_arg; + } + + if (args == HAWK_NULL || val != HAWK_NULL) stack_arg_idx++; + else args = args->next; + skip_taking_arg: + hawk_ooecs_clear (fbu); + } + + /* flush uncompleted formatting sequence */ + OUT_STR (HAWK_OOECS_PTR(fbu), HAWK_OOECS_LEN(fbu)); + + *len = HAWK_OOECS_LEN(out); + return HAWK_OOECS_PTR(out); +} + +/* ========================================================================= */ + +hawk_bch_t* hawk_rtx_formatmbs ( + hawk_rtx_t* rtx, hawk_becs_t* out, hawk_becs_t* fbu, + const hawk_bch_t* fmt, hawk_oow_t fmt_len, + hawk_oow_t nargs_on_stack, hawk_nde_t* args, hawk_oow_t* len) +{ + hawk_oow_t i; + hawk_oow_t stack_arg_idx = 1; + hawk_val_t* val; + +#define OUT_MCHAR(c) do { \ + if (hawk_becs_ccat(out, (c)) == (hawk_oow_t)-1) \ + { \ + SETERR_COD (rtx, HAWK_ENOMEM); \ + return HAWK_NULL; \ + } \ +} while(0) + +#define OUT_MBS(ptr,len) do { \ + if (hawk_becs_ncat(out, (ptr), (len)) == (hawk_oow_t)-1) \ + { \ + SETERR_COD (rtx, HAWK_ENOMEM); \ + return HAWK_NULL; \ + } \ +} while(0) + +#define FMT_MCHAR(c) do { \ + if (hawk_becs_ccat(fbu, (c)) == (hawk_oow_t)-1) \ + { \ + SETERR_COD (rtx, HAWK_ENOMEM); \ + return HAWK_NULL; \ + } \ +} while(0) + +#define FMT_MBS(ptr,len) do { \ + if (hawk_becs_ncat(fbu, (ptr), (len)) == (hawk_oow_t)-1) \ + { \ + SETERR_COD (rtx, HAWK_ENOMEM); \ + return HAWK_NULL; \ + } \ +} while(0) + +#define GROW_MBSBUF(buf) do { \ + if ((buf)->ptr) \ + { \ + hawk_rtx_freemem (rtx, (buf)->ptr); \ + (buf)->ptr = HAWK_NULL; \ + } \ + (buf)->len += (buf)->inc; \ + (buf)->ptr = (hawk_bch_t*)hawk_rtx_allocmem(rtx, (buf)->len * HAWK_SIZEOF(hawk_bch_t)); \ + if ((buf)->ptr == HAWK_NULL) \ + { \ + SETERR_COD (rtx, HAWK_ENOMEM); \ + (buf)->len = 0; \ + return HAWK_NULL; \ + } \ +} while(0) + +#define GROW_MBSBUF_WITH_INC(buf,incv) do { \ + if ((buf)->ptr) \ + { \ + hawk_rtx_freemem (rtx, (buf)->ptr); \ + (buf)->ptr = HAWK_NULL; \ + } \ + (buf)->len += ((incv) > (buf)->inc)? (incv): (buf)->inc; \ + (buf)->ptr = (hawk_bch_t*)hawk_rtx_allocmem(rtx, (buf)->len * HAWK_SIZEOF(hawk_bch_t)); \ + if ((buf)->ptr == HAWK_NULL) \ + { \ + SETERR_COD (rtx, HAWK_ENOMEM); \ + (buf)->len = 0; \ + return HAWK_NULL; \ + } \ +} while(0) + + /* run->format.tmp.ptr should have been assigned a pointer to a block of memory before this function has been called */ + HAWK_ASSERT (hawk_rtx_getawk(awk), rtx->formatmbs.tmp.ptr != HAWK_NULL) + + if (nargs_on_stack == (hawk_oow_t)-1) + { + val = (hawk_val_t*)args; + nargs_on_stack = 2; + } + else + { + val = HAWK_NULL; + } + + if (out == HAWK_NULL) out = &rtx->formatmbs.out; + if (fbu == HAWK_NULL) fbu = &rtx->formatmbs.fmt; + + hawk_becs_clear (out); + hawk_becs_clear (fbu); + + for (i = 0; i < fmt_len; i++) + { + hawk_int_t wp[2]; + int wp_idx; +#define WP_WIDTH 0 +#define WP_PRECISION 1 + + int flags; +#define FLAG_SPACE (1 << 0) +#define FLAG_HASH (1 << 1) +#define FLAG_ZERO (1 << 2) +#define FLAG_PLUS (1 << 3) +#define FLAG_MINUS (1 << 4) + + if (HAWK_BECS_LEN(fbu) == 0) + { + /* format specifier is empty */ + if (fmt[i] == HAWK_BT('%')) + { + /* add % to format specifier (fbu) */ + FMT_MCHAR (fmt[i]); + } + else + { + /* normal output */ + OUT_MCHAR (fmt[i]); + } + continue; + } + + /* handle flags */ + flags = 0; + while (i < fmt_len) + { + switch (fmt[i]) + { + case HAWK_BT(' '): + flags |= FLAG_SPACE; + break; + case HAWK_BT('#'): + flags |= FLAG_HASH; + break; + case HAWK_BT('0'): + flags |= FLAG_ZERO; + break; + case HAWK_BT('+'): + flags |= FLAG_PLUS; + break; + case HAWK_BT('-'): + flags |= FLAG_MINUS; + break; + default: + goto wp_mod_init; + } + + FMT_MCHAR (fmt[i]); i++; + } + +wp_mod_init: + wp[WP_WIDTH] = -1; /* width */ + wp[WP_PRECISION] = -1; /* precision */ + wp_idx = WP_WIDTH; /* width first */ + +wp_mod_main: + if (i < fmt_len && fmt[i] == HAWK_BT('*')) + { + /* variable width/precision modifier. + * take the width/precision from a parameter and + * transform it to a fixed length format */ + hawk_val_t* v; + int n; + + if (args == HAWK_NULL) + { + if (stack_arg_idx >= nargs_on_stack) + { + SETERR_COD (rtx, HAWK_EFMTARG); + return HAWK_NULL; + } + v = hawk_rtx_getarg(rtx, stack_arg_idx); + } + else + { + if (val) + { + if (stack_arg_idx >= nargs_on_stack) + { + SETERR_COD (rtx, HAWK_EFMTARG); + return HAWK_NULL; + } + v = val; + } + else + { + v = eval_expression(rtx, args); + if (v == HAWK_NULL) return HAWK_NULL; + } + } + + hawk_rtx_refupval (rtx, v); + n = hawk_rtx_valtoint(rtx, v, &wp[wp_idx]); + hawk_rtx_refdownval (rtx, v); + if (n <= -1) return HAWK_NULL; + + do + { + n = hawk_fmt_intmax_to_bcstr ( + rtx->formatmbs.tmp.ptr, + rtx->formatmbs.tmp.len, + wp[wp_idx], + 10 | HAWK_FMT_INTMAX_NOTRUNC | HAWK_FMT_INTMAX_NONULL, + -1, + HAWK_BT('\0'), + HAWK_NULL + ); + if (n <= -1) + { + /* -n is the number of characters required + * including terminating null */ + GROW_MBSBUF_WITH_INC (&rtx->formatmbs.tmp, -n); + continue; + } + + break; + } + while (1); + + FMT_MBS(rtx->formatmbs.tmp.ptr, n); + + if (args == HAWK_NULL || val != HAWK_NULL) stack_arg_idx++; + else args = args->next; + i++; + } + else + { + /* fixed width/precision modifier */ + if (i < fmt_len && hawk_is_bch_digit(fmt[i])) + { + wp[wp_idx] = 0; + do + { + wp[wp_idx] = wp[wp_idx] * 10 + fmt[i] - HAWK_BT('0'); + FMT_MCHAR (fmt[i]); i++; + } + while (i < fmt_len && hawk_is_bch_digit(fmt[i])); + } + } + + if (wp_idx == WP_WIDTH && i < fmt_len && fmt[i] == HAWK_BT('.')) + { + wp[WP_PRECISION] = 0; + FMT_MCHAR (fmt[i]); i++; + + wp_idx = WP_PRECISION; /* change index to precision */ + goto wp_mod_main; + } + + if (i >= fmt_len) break; + + if (fmt[i] == HAWK_BT('d') || fmt[i] == HAWK_BT('i') || + fmt[i] == HAWK_BT('x') || fmt[i] == HAWK_BT('X') || + fmt[i] == HAWK_BT('b') || fmt[i] == HAWK_BT('B') || + fmt[i] == HAWK_BT('o')) + { + hawk_val_t* v; + hawk_int_t l; + int n; + + int fmt_flags; + int fmt_uint = 0; + int fmt_width; + hawk_bch_t fmt_fill = HAWK_BT('\0'); + const hawk_bch_t* fmt_prefix = HAWK_NULL; + + if (args == HAWK_NULL) + { + if (stack_arg_idx >= nargs_on_stack) + { + SETERR_COD (rtx, HAWK_EFMTARG); + return HAWK_NULL; + } + v = hawk_rtx_getarg (rtx, stack_arg_idx); + } + else + { + if (val != HAWK_NULL) + { + if (stack_arg_idx >= nargs_on_stack) + { + SETERR_COD (rtx, HAWK_EFMTARG); + return HAWK_NULL; + } + v = val; + } + else + { + v = eval_expression (rtx, args); + if (v == HAWK_NULL) return HAWK_NULL; + } + } + + hawk_rtx_refupval (rtx, v); + n = hawk_rtx_valtoint (rtx, v, &l); + hawk_rtx_refdownval (rtx, v); + if (n <= -1) return HAWK_NULL; + + fmt_flags = HAWK_FMT_INTMAX_NOTRUNC | HAWK_FMT_INTMAX_NONULL; + + if (l == 0 && wp[WP_PRECISION] == 0) + { + /* A zero value with a precision of zero produces + * no character. */ + fmt_flags |= HAWK_FMT_INTMAX_NOZERO; + } + + if (wp[WP_WIDTH] != -1) + { + /* Width must be greater than 0 if specified */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), wp[WP_WIDTH] > 0); + + /* justification when width is specified. */ + if (flags & FLAG_ZERO) + { + if (flags & FLAG_MINUS) + { + /* FLAG_MINUS wins if both FLAG_ZERO + * and FLAG_MINUS are specified. */ + fmt_fill = HAWK_BT(' '); + if (flags & FLAG_MINUS) + { + /* left justification. need to fill the right side */ + fmt_flags |= HAWK_FMT_INTMAX_FILLRIGHT; + } + } + else + { + if (wp[WP_PRECISION] == -1) + { + /* precision not specified. + * FLAG_ZERO can take effect */ + fmt_fill = HAWK_BT('0'); + fmt_flags |= HAWK_FMT_INTMAX_FILLCENTER; + } + else + { + fmt_fill = HAWK_BT(' '); + } + } + } + else + { + fmt_fill = HAWK_BT(' '); + if (flags & FLAG_MINUS) + { + /* left justification. need to fill the right side */ + fmt_flags |= HAWK_FMT_INTMAX_FILLRIGHT; + } + } + } + + switch (fmt[i]) + { + case HAWK_BT('B'): + case HAWK_BT('b'): + fmt_flags |= 2; + fmt_uint = 1; + if (l && (flags & FLAG_HASH)) + { + /* A nonzero value is prefixed with 0b */ + fmt_prefix = HAWK_BT("0b"); + } + break; + + case HAWK_BT('X'): + fmt_flags |= HAWK_FMT_INTMAX_UPPERCASE; + case HAWK_BT('x'): + fmt_flags |= 16; + fmt_uint = 1; + if (l && (flags & FLAG_HASH)) + { + /* A nonzero value is prefixed with 0x */ + fmt_prefix = HAWK_BT("0x"); + } + break; + + case HAWK_BT('o'): + fmt_flags |= 8; + fmt_uint = 1; + if (flags & FLAG_HASH) + { + /* Force a leading zero digit including zero. + * 0 with FLAG_HASH and precision 0 still emits '0'. + * On the contrary, 'X' and 'x' emit no digits + * for 0 with FLAG_HASH and precision 0. */ + fmt_flags |= HAWK_FMT_INTMAX_ZEROLEAD; + } + break; + + default: + fmt_flags |= 10; + if (flags & FLAG_PLUS) + fmt_flags |= HAWK_FMT_INTMAX_PLUSSIGN; + if (flags & FLAG_SPACE) + fmt_flags |= HAWK_FMT_INTMAX_EMPTYSIGN; + break; + } + + + if (wp[WP_WIDTH] > 0) + { + if (wp[WP_WIDTH] > rtx->formatmbs.tmp.len) + GROW_MBSBUF_WITH_INC (&rtx->formatmbs.tmp, wp[WP_WIDTH] - rtx->formatmbs.tmp.len); + fmt_width = wp[WP_WIDTH]; + } + else fmt_width = rtx->formatmbs.tmp.len; + + do + { + if (fmt_uint) + { + /* Explicit type-casting for 'l' from hawk_int_t + * to hawk_uint_t is needed before passing it to + * hawk_fmt_uintmax_to_bcstr(). + * + * Consider a value of -1 for example. + * -1 is a value with all bits set. + * If hawk_int_t is 4 bytes and hawk_uintmax_t + * is 8 bytes, the value is shown below for + * each type respectively . + * -1 - 0xFFFFFFFF (hawk_int_t) + * -1 - 0xFFFFFFFFFFFFFFFF (hawk_uintmax_t) + * Implicit typecasting of -1 from hawk_int_t to + * to hawk_uintmax_t results in 0xFFFFFFFFFFFFFFFF, + * though 0xFFFFFFF is expected in hexadecimal. + */ + n = hawk_fmt_uintmax_to_bcstr ( + rtx->formatmbs.tmp.ptr, + fmt_width, + (hawk_uint_t)l, + fmt_flags, + wp[WP_PRECISION], + fmt_fill, + fmt_prefix + ); + } + else + { + n = hawk_fmt_intmax_to_bcstr ( + rtx->formatmbs.tmp.ptr, + fmt_width, + l, + fmt_flags, + wp[WP_PRECISION], + fmt_fill, + fmt_prefix + ); + } + if (n <= -1) + { + /* -n is the number of characters required */ + GROW_MBSBUF_WITH_INC (&rtx->formatmbs.tmp, -n); + fmt_width = -n; + continue; + } + + break; + } + while (1); + + OUT_MBS (rtx->formatmbs.tmp.ptr, n); + } + else if (fmt[i] == HAWK_BT('e') || fmt[i] == HAWK_BT('E') || + fmt[i] == HAWK_BT('g') || fmt[i] == HAWK_BT('G') || + fmt[i] == HAWK_BT('f')) + { + hawk_val_t* v; + hawk_flt_t r; + int n; + + #if defined(HAWK_USE_AWK_FLTMAX) + FMT_MCHAR (HAWK_BT('j')); + #else + FMT_MCHAR (HAWK_BT('z')); + #endif + FMT_MCHAR (fmt[i]); + + if (args == HAWK_NULL) + { + if (stack_arg_idx >= nargs_on_stack) + { + SETERR_COD (rtx, HAWK_EFMTARG); + return HAWK_NULL; + } + v = hawk_rtx_getarg(rtx, stack_arg_idx); + } + else + { + if (val != HAWK_NULL) + { + if (stack_arg_idx >= nargs_on_stack) + { + SETERR_COD (rtx, HAWK_EFMTARG); + return HAWK_NULL; + } + v = val; + } + else + { + v = eval_expression(rtx, args); + if (v == HAWK_NULL) return HAWK_NULL; + } + } + + hawk_rtx_refupval (rtx, v); + n = hawk_rtx_valtoflt(rtx, v, &r); + hawk_rtx_refdownval (rtx, v); + if (n <= -1) return HAWK_NULL; + + if (hawk_becs_fcat(out, HAWK_BECS_PTR(fbu), r) == (hawk_oow_t)-1) + { + SETERR_COD (rtx, HAWK_ENOMEM); + return HAWK_NULL; + } + } + else if (fmt[i] == HAWK_BT('c')) + { + hawk_bch_t ch; + hawk_oow_t ch_len; + hawk_val_t* v; + hawk_val_type_t vtype; + + if (args == HAWK_NULL) + { + if (stack_arg_idx >= nargs_on_stack) + { + SETERR_COD (rtx, HAWK_EFMTARG); + return HAWK_NULL; + } + v = hawk_rtx_getarg(rtx, stack_arg_idx); + } + else + { + if (val != HAWK_NULL) + { + if (stack_arg_idx >= nargs_on_stack) + { + SETERR_COD (rtx, HAWK_EFMTARG); + return HAWK_NULL; + } + v = val; + } + else + { + v = eval_expression(rtx, args); + if (v == HAWK_NULL) return HAWK_NULL; + } + } + + hawk_rtx_refupval (rtx, v); + vtype = HAWK_RTX_GETVALTYPE (rtx, v); + switch (vtype) + { + case HAWK_VAL_NIL: + ch = HAWK_BT('\0'); + ch_len = 0; + break; + + case HAWK_VAL_INT: + ch = (hawk_bch_t)HAWK_RTX_GETINTFROMVAL(rtx, v); + ch_len = 1; + break; + + case HAWK_VAL_FLT: + ch = (hawk_bch_t)((hawk_val_flt_t*)v)->val; + ch_len = 1; + break; + + case HAWK_VAL_STR: + ch_len = ((hawk_val_str_t*)v)->val.len; + if (ch_len > 0) + { + /* value truncation is expected */ + ch = ((hawk_val_str_t*)v)->val.ptr[0]; + ch_len = 1; + } + else ch = HAWK_BT('\0'); + break; + + case HAWK_VAL_MBS: + ch_len = ((hawk_val_mbs_t*)v)->val.len; + if (ch_len > 0) + { + ch = ((hawk_val_mbs_t*)v)->val.ptr[0]; + ch_len = 1; + } + else ch = HAWK_BT('\0'); + break; + + default: + hawk_rtx_refdownval (rtx, v); + SETERR_COD (rtx, HAWK_EVALTOCHR); + return HAWK_NULL; + } + + if (wp[WP_PRECISION] == -1 || wp[WP_PRECISION] == 0 || wp[WP_PRECISION] > (hawk_int_t)ch_len) + { + wp[WP_PRECISION] = (hawk_int_t)ch_len; + } + + if (wp[WP_PRECISION] > wp[WP_WIDTH]) wp[WP_WIDTH] = wp[WP_PRECISION]; + + if (!(flags & FLAG_MINUS)) + { + /* right align */ + while (wp[WP_WIDTH] > wp[WP_PRECISION]) + { + if (hawk_becs_ccat(out, HAWK_BT(' ')) == (hawk_oow_t)-1) + { + hawk_rtx_refdownval (rtx, v); + SETERR_COD (rtx, HAWK_ENOMEM); + return HAWK_NULL; + } + wp[WP_WIDTH]--; + } + } + + if (wp[WP_PRECISION] > 0) + { + if (hawk_becs_ccat(out, ch) == (hawk_oow_t)-1) + { + hawk_rtx_refdownval (rtx, v); + SETERR_COD (rtx, HAWK_ENOMEM); + return HAWK_NULL; + } + } + + if (flags & FLAG_MINUS) + { + /* left align */ + while (wp[WP_WIDTH] > wp[WP_PRECISION]) + { + if (hawk_becs_ccat (out, HAWK_BT(' ')) == (hawk_oow_t)-1) + { + hawk_rtx_refdownval (rtx, v); + SETERR_COD (rtx, HAWK_ENOMEM); + return HAWK_NULL; + } + wp[WP_WIDTH]--; + } + } + + hawk_rtx_refdownval (rtx, v); + } + else if (fmt[i] == HAWK_BT('s') || fmt[i] == HAWK_BT('k') || fmt[i] == HAWK_BT('K')) + { + hawk_bch_t* str_ptr, * str_free = HAWK_NULL; + hawk_oow_t str_len; + hawk_int_t k; + hawk_val_t* v; + hawk_val_type_t vtype; + int bytetombs_flagged_radix = 16; + + if (args == HAWK_NULL) + { + if (stack_arg_idx >= nargs_on_stack) + { + SETERR_COD (rtx, HAWK_EFMTARG); + return HAWK_NULL; + } + v = hawk_rtx_getarg (rtx, stack_arg_idx); + } + else + { + if (val) + { + if (stack_arg_idx >= nargs_on_stack) + { + SETERR_COD (rtx, HAWK_EFMTARG); + return HAWK_NULL; + } + v = val; + } + else + { + v = eval_expression (rtx, args); + if (v == HAWK_NULL) return HAWK_NULL; + } + } + + hawk_rtx_refupval (rtx, v); + + vtype = HAWK_RTX_GETVALTYPE(rtx, v); + switch (vtype) + { + case HAWK_VAL_NIL: + str_ptr = HAWK_BT(""); + str_len = 0; + break; + + case HAWK_VAL_MBS: + str_ptr = ((hawk_val_mbs_t*)v)->val.ptr; + str_len = ((hawk_val_mbs_t*)v)->val.len; + break; + + case HAWK_VAL_STR: + #if defined(HAWK_OOCH_IS_BCH) + str_ptr = ((hawk_val_str_t*)v)->val.ptr; + str_len = ((hawk_val_str_t*)v)->val.len; + break; + #else + if (fmt[i] != HAWK_BT('s')) + { + /* arrange to print the wide character string byte by byte regardless of byte order */ + str_ptr = (hawk_bch_t*)((hawk_val_str_t*)v)->val.ptr; + str_len = ((hawk_val_str_t*)v)->val.len * (HAWK_SIZEOF_OOCH_T / HAWK_SIZEOF_BCH_T); + break; + } + /* fall thru */ + #endif + + default: + { + if (v == val) + { + hawk_rtx_refdownval (rtx, v); + SETERR_COD (rtx, HAWK_EFMTCNV); + return HAWK_NULL; + } + + str_ptr = hawk_rtx_valtobcstrdup(rtx, v, &str_len); + if (!str_ptr) + { + hawk_rtx_refdownval (rtx, v); + return HAWK_NULL; + } + + str_free = str_ptr; + break; + } + } + + if (wp[WP_PRECISION] == -1 || wp[WP_PRECISION] > (hawk_int_t)str_len) wp[WP_PRECISION] = (hawk_int_t)str_len; + if (wp[WP_PRECISION] > wp[WP_WIDTH]) wp[WP_WIDTH] = wp[WP_PRECISION]; + + if (!(flags & FLAG_MINUS)) + { + /* right align */ + while (wp[WP_WIDTH] > wp[WP_PRECISION]) + { + if (hawk_becs_ccat(out, HAWK_BT(' ')) == (hawk_oow_t)-1) + { + if (str_free) hawk_rtx_freemem (rtx, str_free); + hawk_rtx_refdownval (rtx, v); + SETERR_COD (rtx, HAWK_ENOMEM); + return HAWK_NULL; + } + wp[WP_WIDTH]--; + } + } + + if (fmt[i] == HAWK_BT('k')) bytetombs_flagged_radix |= HAWK_BYTE_TO_BCSTR_LOWERCASE; + + for (k = 0; k < wp[WP_PRECISION]; k++) + { + hawk_bch_t curc; + + curc = str_ptr[k]; + + if (fmt[i] != HAWK_BT('s') && !HAWK_BYTE_PRINTABLE(curc)) + { + hawk_bch_t xbuf[3]; + if (curc <= 0xFF) + { + if (hawk_becs_ncat(out, HAWK_BT("\\x"), 2) == (hawk_oow_t)-1) goto s_fail; + hawk_byte_to_bcstr(curc, xbuf, HAWK_COUNTOF(xbuf), bytetombs_flagged_radix, HAWK_BT('0')); + if (hawk_becs_ncat(out, xbuf, 2) == (hawk_oow_t)-1) goto s_fail; + } + else if (curc <= 0xFFFF) + { + hawk_uint16_t u16 = curc; + if (hawk_becs_ncat(out, HAWK_BT("\\u"), 2) == (hawk_oow_t)-1) goto s_fail; + hawk_byte_to_bcstr((u16 >> 8) & 0xFF, xbuf, HAWK_COUNTOF(xbuf), bytetombs_flagged_radix, HAWK_BT('0')); + if (hawk_becs_ncat(out, xbuf, 2) == (hawk_oow_t)-1) goto s_fail; + hawk_byte_to_bcstr(u16 & 0xFF, xbuf, HAWK_COUNTOF(xbuf), bytetombs_flagged_radix, HAWK_BT('0')); + if (hawk_becs_ncat(out, xbuf, 2) == (hawk_oow_t)-1) goto s_fail; + } + else + { + hawk_uint32_t u32 = curc; + if (hawk_becs_ncat(out, HAWK_BT("\\U"), 2) == (hawk_oow_t)-1) goto s_fail; + hawk_byte_to_bcstr((u32 >> 24) & 0xFF, xbuf, HAWK_COUNTOF(xbuf), bytetombs_flagged_radix, HAWK_BT('0')); + if (hawk_becs_ncat(out, xbuf, 2) == (hawk_oow_t)-1) goto s_fail; + hawk_byte_to_bcstr((u32 >> 16) & 0xFF, xbuf, HAWK_COUNTOF(xbuf), bytetombs_flagged_radix, HAWK_BT('0')); + if (hawk_becs_ncat(out, xbuf, 2) == (hawk_oow_t)-1) goto s_fail; + hawk_byte_to_bcstr((u32 >> 8) & 0xFF, xbuf, HAWK_COUNTOF(xbuf), bytetombs_flagged_radix, HAWK_BT('0')); + if (hawk_becs_ncat(out, xbuf, 2) == (hawk_oow_t)-1) goto s_fail; + hawk_byte_to_bcstr(u32 & 0xFF, xbuf, HAWK_COUNTOF(xbuf), bytetombs_flagged_radix, HAWK_BT('0')); + if (hawk_becs_ncat(out, xbuf, 2) == (hawk_oow_t)-1) goto s_fail; + } + } + else + { + if (hawk_becs_ccat(out, curc) == (hawk_oow_t)-1) + { + s_fail: + if (str_free) hawk_rtx_freemem (rtx, str_free); + hawk_rtx_refdownval (rtx, v); + SETERR_COD (rtx, HAWK_ENOMEM); + return HAWK_NULL; + } + } + } + + if (str_free) hawk_rtx_freemem (rtx, str_free); + + if (flags & FLAG_MINUS) + { + /* left align */ + while (wp[WP_WIDTH] > wp[WP_PRECISION]) + { + if (hawk_becs_ccat(out, HAWK_BT(' ')) == (hawk_oow_t)-1) + { + hawk_rtx_refdownval (rtx, v); + SETERR_COD (rtx, HAWK_ENOMEM); + return HAWK_NULL; + } + wp[WP_WIDTH]--; + } + } + + hawk_rtx_refdownval (rtx, v); + } + else + { + if (fmt[i] != HAWK_BT('%')) OUT_MBS (HAWK_BECS_PTR(fbu), HAWK_BECS_LEN(fbu)); + OUT_MCHAR (fmt[i]); + goto skip_taking_arg; + } + + if (args == HAWK_NULL || val != HAWK_NULL) stack_arg_idx++; + else args = args->next; + skip_taking_arg: + hawk_becs_clear (fbu); + } + + /* flush uncompleted formatting sequence */ + OUT_MBS (HAWK_BECS_PTR(fbu), HAWK_BECS_LEN(fbu)); + + *len = HAWK_BECS_LEN(out); + return HAWK_BECS_PTR(out); +} + +/* ------------------------------------------------------------------------- */ + +void hawk_rtx_setnrflt (hawk_rtx_t* rtx, const hawk_nrflt_t* nrflt) +{ + rtx->nrflt = *nrflt; +} + +void hawk_rtx_getnrflt (hawk_rtx_t* rtx, hawk_nrflt_t* nrflt) +{ + *nrflt = rtx->nrflt; +} + +/* ------------------------------------------------------------------------- */ + +void* hawk_rtx_allocmem (hawk_rtx_t* rtx, hawk_oow_t size) +{ + void* ptr = HAWK_MMGR_ALLOC(hawk_getmmgr(rtx->awk), size); + if (!ptr) hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return ptr; +} + +void* hawk_rtx_reallocmem (hawk_rtx_t* rtx, void* ptr, hawk_oow_t size) +{ + void* nptr = HAWK_MMGR_REALLOC(hawk_getmmgr(rtx->awk), ptr, size); + if (!nptr) hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return nptr; +} + +void* hawk_rtx_callocmem (hawk_rtx_t* rtx, hawk_oow_t size) +{ + void* ptr = HAWK_MMGR_ALLOC(hawk_getmmgr(rtx->awk), size); + if (ptr) HAWK_MEMSET (ptr, 0, size); + else hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return ptr; +} + +/* ------------------------------------------------------------------------- */ + +hawk_uch_t* hawk_rtx_dupucstr (hawk_rtx_t* rtx, const hawk_uch_t* ucs, hawk_oow_t* _ucslen) +{ + hawk_uch_t* ptr; + hawk_oow_t ucslen; + + ucslen = hawk_count_ucstr(ucs); + ptr = (hawk_uch_t*)hawk_rtx_allocmem(rtx, (ucslen + 1) * HAWK_SIZEOF(hawk_uch_t)); + if (!ptr) return HAWK_NULL; + + hawk_copy_uchars (ptr, ucs, ucslen); + ptr[ucslen] = '\0'; + + if (_ucslen) *_ucslen = ucslen; + return ptr; +} + +hawk_bch_t* hawk_rtx_dupbcstr (hawk_rtx_t* rtx, const hawk_bch_t* bcs, hawk_oow_t* _bcslen) +{ + hawk_bch_t* ptr; + hawk_oow_t bcslen; + + bcslen = hawk_count_bcstr(bcs); + ptr = (hawk_bch_t*)hawk_rtx_allocmem(rtx, (bcslen + 1) * HAWK_SIZEOF(hawk_bch_t)); + if (!ptr) return HAWK_NULL; + + hawk_copy_bchars (ptr, bcs, bcslen); + ptr[bcslen] = '\0'; + + if (_bcslen) *_bcslen = bcslen; + return ptr; +} + + +hawk_uch_t* hawk_rtx_dupuchars (hawk_rtx_t* rtx, const hawk_uch_t* ucs, hawk_oow_t ucslen) +{ + hawk_uch_t* ptr; + + ptr = (hawk_uch_t*)hawk_rtx_allocmem(rtx, (ucslen + 1) * HAWK_SIZEOF(hawk_uch_t)); + if (!ptr) return HAWK_NULL; + + hawk_copy_uchars (ptr, ucs, ucslen); + ptr[ucslen] = '\0'; + return ptr; +} + +hawk_bch_t* hawk_rtx_dupbchars (hawk_rtx_t* rtx, const hawk_bch_t* bcs, hawk_oow_t bcslen) +{ + hawk_bch_t* ptr; + + ptr = (hawk_bch_t*)hawk_rtx_allocmem(rtx, (bcslen + 1) * HAWK_SIZEOF(hawk_bch_t)); + if (!ptr) return HAWK_NULL; + + hawk_copy_bchars (ptr, bcs, bcslen); + ptr[bcslen] = '\0'; + return ptr; +} + +hawk_uch_t* hawk_rtx_dupucs (hawk_rtx_t* rtx, const hawk_ucs_t* ucs) +{ + hawk_uch_t* ptr; + + ptr = (hawk_uch_t*)hawk_rtx_allocmem(rtx, (ucs->len + 1) * HAWK_SIZEOF(hawk_uch_t)); + if (!ptr) return HAWK_NULL; + + hawk_copy_uchars (ptr, ucs->ptr, ucs->len); + ptr[ucs->len] = '\0'; + return ptr; +} + +hawk_bch_t* hawk_rtx_dupbcs (hawk_rtx_t* rtx, const hawk_bcs_t* bcs) +{ + hawk_bch_t* ptr; + + ptr = (hawk_bch_t*)hawk_rtx_allocmem(rtx, (bcs->len + 1) * HAWK_SIZEOF(hawk_bch_t)); + if (!ptr) return HAWK_NULL; + + hawk_copy_bchars (ptr, bcs->ptr, bcs->len); + ptr[bcs->len] = '\0'; + return ptr; +} + +/* ------------------------------------------------------------------------- */ + +int hawk_rtx_convbtouchars (hawk_rtx_t* rtx, const hawk_bch_t* bcs, hawk_oow_t* bcslen, hawk_uch_t* ucs, hawk_oow_t* ucslen, int all) +{ + /* length bound */ + int n; + n = hawk_conv_bchars_to_uchars_with_cmgr(bcs, bcslen, ucs, ucslen, hawk_rtx_getcmgr(rtx), all); + /* -1: illegal character, -2: buffer too small, -3: incomplete sequence */ + if (n <= -1) hawk_rtx_seterrnum (rtx, (n == -2)? HAWK_EBUFFULL: HAWK_EECERR, HAWK_NULL); + return n; +} + +int hawk_rtx_convutobchars (hawk_rtx_t* rtx, const hawk_uch_t* ucs, hawk_oow_t* ucslen, hawk_bch_t* bcs, hawk_oow_t* bcslen) +{ + /* length bound */ + int n; + n = hawk_conv_uchars_to_bchars_with_cmgr(ucs, ucslen, bcs, bcslen, hawk_rtx_getcmgr(rtx)); + if (n <= -1) hawk_rtx_seterrnum (rtx, (n == -2)? HAWK_EBUFFULL: HAWK_EECERR, HAWK_NULL); + return n; +} + +int hawk_rtx_convbtoucstr (hawk_rtx_t* rtx, const hawk_bch_t* bcs, hawk_oow_t* bcslen, hawk_uch_t* ucs, hawk_oow_t* ucslen, int all) +{ + /* null-terminated. */ + int n; + n = hawk_conv_bcstr_to_ucstr_with_cmgr(bcs, bcslen, ucs, ucslen, hawk_rtx_getcmgr(rtx), all); + if (n <= -1) hawk_rtx_seterrnum (rtx, (n == -2)? HAWK_EBUFFULL: HAWK_EECERR, HAWK_NULL); + return n; +} + +int hawk_rtx_convutobcstr (hawk_rtx_t* rtx, const hawk_uch_t* ucs, hawk_oow_t* ucslen, hawk_bch_t* bcs, hawk_oow_t* bcslen) +{ + /* null-terminated */ + int n; + n = hawk_conv_ucstr_to_bcstr_with_cmgr(ucs, ucslen, bcs, bcslen, hawk_rtx_getcmgr(rtx)); + if (n <= -1) hawk_rtx_seterrnum (rtx, (n == -2)? HAWK_EBUFFULL: HAWK_EECERR, HAWK_NULL); + return n; +} + +/* ------------------------------------------------------------------------- */ + +hawk_uch_t* hawk_rtx_dupbtouchars (hawk_rtx_t* rtx, const hawk_bch_t* bcs, hawk_oow_t _bcslen, hawk_oow_t* _ucslen, int all) +{ + hawk_oow_t bcslen, ucslen; + hawk_uch_t* ucs; + + bcslen = _bcslen; + if (hawk_rtx_convbtouchars(rtx, bcs, &bcslen, HAWK_NULL, &ucslen, all) <= -1) return HAWK_NULL; + + ucs = hawk_rtx_allocmem(rtx, HAWK_SIZEOF(*ucs) * (ucslen + 1)); + if (!ucs) return HAWK_NULL; + + bcslen= _bcslen; + hawk_rtx_convbtouchars (rtx, bcs, &bcslen, ucs, &ucslen, all); + ucs[ucslen] = '\0'; + + if (_ucslen) *_ucslen = ucslen; + return ucs; +} + +hawk_bch_t* hawk_rtx_duputobchars (hawk_rtx_t* rtx, const hawk_uch_t* ucs, hawk_oow_t _ucslen, hawk_oow_t* _bcslen) +{ + hawk_oow_t bcslen, ucslen; + hawk_bch_t* bcs; + + ucslen = _ucslen; + if (hawk_rtx_convutobchars(rtx, ucs, &ucslen, HAWK_NULL, &bcslen) <= -1) return HAWK_NULL; + + bcs = hawk_rtx_allocmem(rtx, HAWK_SIZEOF(*bcs) * (bcslen + 1)); + if (!bcs) return HAWK_NULL; + + ucslen = _ucslen; + hawk_rtx_convutobchars (rtx, ucs, &ucslen, bcs, &bcslen); + bcs[bcslen] = '\0'; + + if (_bcslen) *_bcslen = bcslen; + return bcs; +} + +hawk_uch_t* hawk_rtx_dupb2touchars (hawk_rtx_t* rtx, const hawk_bch_t* bcs1, hawk_oow_t bcslen1, const hawk_bch_t* bcs2, hawk_oow_t bcslen2, hawk_oow_t* ucslen, int all) +{ + hawk_oow_t inlen, outlen1, outlen2; + hawk_uch_t* ptr; + + inlen = bcslen1; + if (hawk_rtx_convbtouchars(rtx, bcs1, &inlen, HAWK_NULL, &outlen1, all) <= -1) return HAWK_NULL; + + inlen = bcslen2; + if (hawk_rtx_convbtouchars(rtx, bcs2, &inlen, HAWK_NULL, &outlen2, all) <= -1) return HAWK_NULL; + + ptr = (hawk_uch_t*)hawk_rtx_allocmem(rtx, (outlen1 + outlen2 + 1) * HAWK_SIZEOF(*ptr)); + if (!ptr) return HAWK_NULL; + + inlen = bcslen1; + hawk_rtx_convbtouchars (rtx, bcs1, &inlen, &ptr[0], &outlen1, all); + + inlen = bcslen2; + hawk_rtx_convbtouchars (rtx, bcs2, &inlen, &ptr[outlen1], &outlen2, all); + + /* hawk_convbtouchars() doesn't null-terminate the target. + * but in hawk_dupbtouchars(), i allocate space. so i don't mind + * null-terminating it with 1 extra character overhead */ + ptr[outlen1 + outlen2] = '\0'; + if (ucslen) *ucslen = outlen1 + outlen2; + return ptr; +} + +hawk_bch_t* hawk_rtx_dupu2tobchars (hawk_rtx_t* rtx, const hawk_uch_t* ucs1, hawk_oow_t ucslen1, const hawk_uch_t* ucs2, hawk_oow_t ucslen2, hawk_oow_t* bcslen) +{ + hawk_oow_t inlen, outlen1, outlen2; + hawk_bch_t* ptr; + + inlen = ucslen1; + if (hawk_rtx_convutobchars(rtx, ucs1, &inlen, HAWK_NULL, &outlen1) <= -1) return HAWK_NULL; + + inlen = ucslen2; + if (hawk_rtx_convutobchars(rtx, ucs2, &inlen, HAWK_NULL, &outlen2) <= -1) return HAWK_NULL; + + ptr = (hawk_bch_t*)hawk_rtx_allocmem(rtx, (outlen1 + outlen2 + 1) * HAWK_SIZEOF(*ptr)); + if (!ptr) return HAWK_NULL; + + inlen = ucslen1; + hawk_rtx_convutobchars (rtx, ucs1, &inlen, &ptr[0], &outlen1); + + inlen = ucslen2; + hawk_rtx_convutobchars (rtx, ucs2, &inlen, &ptr[outlen1], &outlen2); + + ptr[outlen1 + outlen2] = '\0'; + if (bcslen) *bcslen = outlen1 + outlen2; + + return ptr; +} + + + +hawk_uch_t* hawk_rtx_dupbtoucstr (hawk_rtx_t* rtx, const hawk_bch_t* bcs, hawk_oow_t* _ucslen, int all) +{ + hawk_oow_t bcslen, ucslen; + hawk_uch_t* ucs; + + if (hawk_rtx_convbtoucstr(rtx, bcs, &bcslen, HAWK_NULL, &ucslen, all) <= -1) return HAWK_NULL; + ucslen = ucslen + 1; /* for terminating null */ + + ucs = hawk_rtx_allocmem(rtx, HAWK_SIZEOF(*ucs) * ucslen); + if (!ucs) return HAWK_NULL; + + hawk_rtx_convbtoucstr (rtx, bcs, &bcslen, ucs, &ucslen, all); + if (_ucslen) *_ucslen = ucslen; + return ucs; +} + +hawk_bch_t* hawk_rtx_duputobcstr (hawk_rtx_t* rtx, const hawk_uch_t* ucs, hawk_oow_t* _bcslen) +{ + hawk_oow_t bcslen, ucslen; + hawk_bch_t* bcs; + + if (hawk_rtx_convutobcstr(rtx, ucs, &ucslen, HAWK_NULL, &bcslen) <= -1) return HAWK_NULL; + bcslen = bcslen + 1; /* for terminating null */ + + bcs = hawk_rtx_allocmem(rtx, HAWK_SIZEOF(*bcs) * bcslen); + if (!bcs) return HAWK_NULL; + + hawk_rtx_convutobcstr (rtx, ucs, &ucslen, bcs, &bcslen); + if (_bcslen) *_bcslen = bcslen; + return bcs; +} + +/* ------------------------------------------------------------------------- */ + +hawk_uch_t* hawk_rtx_dupbtoucharswithcmgr (hawk_rtx_t* rtx, const hawk_bch_t* bcs, hawk_oow_t _bcslen, hawk_oow_t* _ucslen, hawk_cmgr_t* cmgr, int all) +{ + hawk_oow_t bcslen, ucslen; + hawk_uch_t* ucs; + int n; + + bcslen = _bcslen; + n = hawk_conv_bchars_to_uchars_with_cmgr(bcs, &bcslen, HAWK_NULL, &ucslen, cmgr, all); + if (n <= -1) + { + /* -1: illegal character, -2: buffer too small, -3: incomplete sequence */ + hawk_rtx_seterrnum (rtx, (n == -2)? HAWK_EBUFFULL: HAWK_EECERR, HAWK_NULL); + return HAWK_NULL; + } + + ucs = hawk_rtx_allocmem(rtx, HAWK_SIZEOF(*ucs) * (ucslen + 1)); + if (!ucs) return HAWK_NULL; + + bcslen= _bcslen; + hawk_conv_bchars_to_uchars_with_cmgr(bcs, &bcslen, ucs, &ucslen, cmgr, all); + ucs[ucslen] = '\0'; + + if (_ucslen) *_ucslen = ucslen; + return ucs; +} + +hawk_bch_t* hawk_rtx_duputobcharswithcmgr (hawk_rtx_t* rtx, const hawk_uch_t* ucs, hawk_oow_t _ucslen, hawk_oow_t* _bcslen, hawk_cmgr_t* cmgr) +{ + hawk_oow_t bcslen, ucslen; + hawk_bch_t* bcs; + int n; + + ucslen = _ucslen; + n = hawk_conv_uchars_to_bchars_with_cmgr(ucs, &ucslen, HAWK_NULL, &bcslen, cmgr); + if (n <= -1) + { + /* -1: illegal character, -2: buffer too small, -3: incomplete sequence */ + hawk_rtx_seterrnum (rtx, (n == -2)? HAWK_EBUFFULL: HAWK_EECERR, HAWK_NULL); + return HAWK_NULL; + } + + bcs = hawk_rtx_allocmem(rtx, HAWK_SIZEOF(*bcs) * (bcslen + 1)); + if (!bcs) return HAWK_NULL; + + ucslen = _ucslen; + hawk_conv_uchars_to_bchars_with_cmgr (ucs, &ucslen, bcs, &bcslen, cmgr); + bcs[bcslen] = '\0'; + + if (_bcslen) *_bcslen = bcslen; + return bcs; +} diff --git a/hawk/lib/sio.c b/hawk/lib/sio.c new file mode 100644 index 00000000..58f9393a --- /dev/null +++ b/hawk/lib/sio.c @@ -0,0 +1,774 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include "hawk-prv.h" + +#if defined(_WIN32) +# include /* for the UGLY hack */ +#elif defined(__OS2__) + /* nothing */ +#elif defined(__DOS__) + /* nothing */ +#else +# include "syscall.h" +#endif + + +#define LOCK_OUTPUT(sio) do { if ((sio)->mtx) hawk_mtx_lock ((sio)->mtx, HAWK_NULL); } while(0) +#define UNLOCK_OUTPUT(sio) do { if ((sio)->mtx) hawk_mtx_unlock ((sio)->mtx); } while(0) + +/* TODO: currently, LOCK_INPUT and LOCK_OUTPUT don't have difference. + * can i just use two difference mutex objects to differentiate? */ +#define LOCK_INPUT(sio) do { if ((sio)->mtx) hawk_mtx_lock ((sio)->mtx, HAWK_NULL); } while(0) +#define UNLOCK_INPUT(sio) do { if ((sio)->mtx) hawk_mtx_unlock ((sio)->mtx); } while(0) + +/* internal status codes */ +enum +{ + STATUS_UTF8_CONSOLE = (1 << 0), + STATUS_LINE_BREAK = (1 << 1) +}; + +static hawk_ooi_t file_input (hawk_tio_t* tio, hawk_tio_cmd_t cmd, void* buf, hawk_oow_t size); +static hawk_ooi_t file_output (hawk_tio_t* tio, hawk_tio_cmd_t cmd, void* buf, hawk_oow_t size); + +static hawk_sio_errnum_t fio_errnum_to_sio_errnum (hawk_fio_t* fio) +{ + switch (fio->errnum) + { + case HAWK_FIO_ENOMEM: + return HAWK_SIO_ENOMEM; + case HAWK_FIO_EINVAL: + return HAWK_SIO_EINVAL; + case HAWK_FIO_EACCES: + return HAWK_SIO_EACCES; + case HAWK_FIO_ENOENT: + return HAWK_SIO_ENOENT; + case HAWK_FIO_EEXIST: + return HAWK_SIO_EEXIST; + case HAWK_FIO_EINTR: + return HAWK_SIO_EINTR; + case HAWK_FIO_EPIPE: + return HAWK_SIO_EPIPE; + case HAWK_FIO_EAGAIN: + return HAWK_SIO_EAGAIN; + case HAWK_FIO_ESYSERR: + return HAWK_SIO_ESYSERR; + case HAWK_FIO_ENOIMPL: + return HAWK_SIO_ENOIMPL; + default: + return HAWK_SIO_EOTHER; + } +} + +static hawk_sio_errnum_t tio_errnum_to_sio_errnum (hawk_tio_t* tio) +{ + switch (tio->errnum) + { + case HAWK_TIO_ENOMEM: + return HAWK_SIO_ENOMEM; + case HAWK_TIO_EINVAL: + return HAWK_SIO_EINVAL; + case HAWK_TIO_EACCES: + return HAWK_SIO_EACCES; + case HAWK_TIO_ENOENT: + return HAWK_SIO_ENOENT; + case HAWK_TIO_EILSEQ: + return HAWK_SIO_EILSEQ; + case HAWK_TIO_EICSEQ: + return HAWK_SIO_EICSEQ; + case HAWK_TIO_EILCHR: + return HAWK_SIO_EILCHR; + default: + return HAWK_SIO_EOTHER; + } +} + +hawk_sio_t* hawk_sio_open (hawk_t* hawk, hawk_oow_t xtnsize, const hawk_ooch_t* file, int flags) +{ + hawk_sio_t* sio; + + sio = (hawk_sio_t*)hawk_allocmem(hawk, HAWK_SIZEOF(hawk_sio_t) + xtnsize); + if (sio) + { + if (hawk_sio_init(sio, hawk, file, flags) <= -1) + { + hawk_freemem (hawk, sio); + return HAWK_NULL; + } + else HAWK_MEMSET (sio + 1, 0, xtnsize); + } + return sio; +} + +hawk_sio_t* hawk_sio_openstd (hawk_t* hawk, hawk_oow_t xtnsize, hawk_sio_std_t std, int flags) +{ + hawk_sio_t* sio; + hawk_fio_hnd_t hnd; + + /* Is this necessary? + if (flags & HAWK_SIO_KEEPATH) + { + sio->errnum = HAWK_SIO_EINVAL; + return HAWK_NULL; + } + */ + + if (hawk_get_std_fio_handle(std, &hnd) <= -1) return HAWK_NULL; + + sio = hawk_sio_open(hawk, xtnsize, (const hawk_ooch_t*)&hnd, flags | HAWK_SIO_HANDLE | HAWK_SIO_NOCLOSE); + +#if defined(_WIN32) + if (sio) + { + DWORD mode; + if (GetConsoleMode (sio->file.handle, &mode) == TRUE && + GetConsoleOutputCP() == CP_UTF8) + { + sio->status |= STATUS_UTF8_CONSOLE; + } + } +#endif + + return sio; +} + +void hawk_sio_close (hawk_sio_t* sio) +{ + hawk_sio_fini (sio); + hawk_freemem (sio->hawk, sio); +} + +int hawk_sio_init (hawk_sio_t* sio, hawk_t* hawk, const hawk_ooch_t* path, int flags) +{ + int mode; + int topt = 0; + + HAWK_MEMSET (sio, 0, HAWK_SIZEOF(*sio)); + sio->hawk = hawk; + + mode = HAWK_FIO_RUSR | HAWK_FIO_WUSR | HAWK_FIO_RGRP | HAWK_FIO_ROTH; + + if (flags & HAWK_SIO_REENTRANT) + { + sio->mtx = hawk_mtx_open(hawk, 0); + if (!sio->mtx) goto oops00; + } + /* sio flag enumerators redefines most fio flag enumerators and + * compose a superset of fio flag enumerators. when a user calls + * this function, a user can specify a sio flag enumerator not + * present in the fio flag enumerator. mask off such an enumerator. */ + if (hawk_fio_init(&sio->file, hawk, path, (flags & ~HAWK_FIO_RESERVED), mode) <= -1) + { + sio->errnum = fio_errnum_to_sio_errnum (&sio->file); + goto oops01; + } + + if (flags & HAWK_SIO_IGNOREECERR) topt |= HAWK_TIO_IGNOREECERR; + if (flags & HAWK_SIO_NOAUTOFLUSH) topt |= HAWK_TIO_NOAUTOFLUSH; + + if ((flags & HAWK_SIO_KEEPPATH) && !(flags & HAWK_SIO_HANDLE)) + { + sio->path = hawk_dupoocstr(hawk, path, HAWK_NULL); + if (sio->path == HAWK_NULL) + { + sio->errnum = HAWK_SIO_ENOMEM; + goto oops02; + } + } + + if (hawk_tio_init(&sio->tio.io, hawk, topt) <= -1) + { + sio->errnum = tio_errnum_to_sio_errnum (&sio->tio.io); + goto oops03; + } + + /* store the back-reference to sio in the extension area.*/ + HAWK_ASSERT (hawk, (&sio->tio.io + 1) == &sio->tio.xtn); + *(hawk_sio_t**)(&sio->tio.io + 1) = sio; + + if (hawk_tio_attachin(&sio->tio.io, file_input, sio->inbuf, HAWK_COUNTOF(sio->inbuf)) <= -1 || + hawk_tio_attachout(&sio->tio.io, file_output, sio->outbuf, HAWK_COUNTOF(sio->outbuf)) <= -1) + { + if (sio->errnum == HAWK_SIO_ENOERR) + sio->errnum = tio_errnum_to_sio_errnum (&sio->tio.io); + goto oops04; + } + +#if defined(__OS2__) + if (flags & HAWK_SIO_LINEBREAK) sio->status |= STATUS_LINE_BREAK; +#endif + return 0; + +oops04: + hawk_tio_fini (&sio->tio.io); +oops03: + if (sio->path) hawk_freemem (sio->hawk, sio->path); +oops02: + hawk_fio_fini (&sio->file); +oops01: + if (sio->mtx) hawk_mtx_close (sio->mtx); +oops00: + return -1; +} + +int hawk_sio_initstd (hawk_sio_t* sio, hawk_t* hawk, hawk_sio_std_t std, int flags) +{ + int n; + hawk_fio_hnd_t hnd; + + if (hawk_get_std_fio_handle (std, &hnd) <= -1) return -1; + + n = hawk_sio_init(sio, hawk, (const hawk_ooch_t*)&hnd, flags | HAWK_SIO_HANDLE | HAWK_SIO_NOCLOSE); + +#if defined(_WIN32) + if (n >= 0) + { + DWORD mode; + if (GetConsoleMode (sio->file.handle, &mode) == TRUE && + GetConsoleOutputCP() == CP_UTF8) + { + sio->status |= STATUS_UTF8_CONSOLE; + } + } +#endif + + return n; +} + +void hawk_sio_fini (hawk_sio_t* sio) +{ + /*if (hawk_sio_flush (sio) <= -1) return -1;*/ + hawk_sio_flush (sio); + hawk_tio_fini (&sio->tio.io); + hawk_fio_fini (&sio->file); + if (sio->path) hawk_freemem (sio->hawk, sio->path); + if (sio->mtx) hawk_mtx_close (sio->mtx); +} +hawk_sio_errnum_t hawk_sio_geterrnum (const hawk_sio_t* sio) +{ + return sio->errnum; +} + +hawk_cmgr_t* hawk_sio_getcmgr (hawk_sio_t* sio) +{ + return hawk_tio_getcmgr (&sio->tio.io); +} + +void hawk_sio_setcmgr (hawk_sio_t* sio, hawk_cmgr_t* cmgr) +{ + hawk_tio_setcmgr (&sio->tio.io, cmgr); +} + +hawk_sio_hnd_t hawk_sio_gethnd (const hawk_sio_t* sio) +{ + /*return hawk_fio_gethnd (&sio->file);*/ + return HAWK_FIO_HANDLE(&sio->file); +} + +const hawk_ooch_t* hawk_sio_getpath (hawk_sio_t* sio) +{ + /* this path is valid if HAWK_SIO_HANDLE is off and HAWK_SIO_KEEPPATH is on */ + return sio->path; +} + +hawk_ooi_t hawk_sio_flush (hawk_sio_t* sio) +{ + hawk_ooi_t n; + + LOCK_OUTPUT (sio); + sio->errnum = HAWK_SIO_ENOERR; + n = hawk_tio_flush(&sio->tio.io); + if (n <= -1 && sio->errnum == HAWK_SIO_ENOERR) + sio->errnum = tio_errnum_to_sio_errnum (&sio->tio.io); + UNLOCK_OUTPUT (sio); + return n; +} + +void hawk_sio_drain (hawk_sio_t* sio) +{ + LOCK_OUTPUT (sio); + hawk_tio_drain (&sio->tio.io); + UNLOCK_OUTPUT (sio); +} + +hawk_ooi_t hawk_sio_getbchar (hawk_sio_t* sio, hawk_bch_t* c) +{ + hawk_ooi_t n; + + LOCK_INPUT (sio); + sio->errnum = HAWK_SIO_ENOERR; + n = hawk_tio_readbchars(&sio->tio.io, c, 1); + if (n <= -1 && sio->errnum == HAWK_SIO_ENOERR) + sio->errnum = tio_errnum_to_sio_errnum (&sio->tio.io); + UNLOCK_INPUT (sio); + + return n; +} + +hawk_ooi_t hawk_sio_getuchar (hawk_sio_t* sio, hawk_uch_t* c) +{ + hawk_ooi_t n; + + LOCK_INPUT (sio); + sio->errnum = HAWK_SIO_ENOERR; + n = hawk_tio_readuchars(&sio->tio.io, c, 1); + if (n <= -1 && sio->errnum == HAWK_SIO_ENOERR) + sio->errnum = tio_errnum_to_sio_errnum (&sio->tio.io); + UNLOCK_INPUT (sio); + + return n; +} + +hawk_ooi_t hawk_sio_getbcstr (hawk_sio_t* sio, hawk_bch_t* buf, hawk_oow_t size) +{ + hawk_ooi_t n; + + if (size <= 0) return 0; + +#if defined(_WIN32) + /* Using ReadConsoleA() didn't help at all. + * so I don't implement any hack here */ +#endif + + LOCK_INPUT (sio); + sio->errnum = HAWK_SIO_ENOERR; + n = hawk_tio_readbchars(&sio->tio.io, buf, size - 1); + if (n <= -1) + { + if (sio->errnum == HAWK_SIO_ENOERR) + sio->errnum = tio_errnum_to_sio_errnum (&sio->tio.io); + return -1; + } + UNLOCK_INPUT (sio); + + buf[n] = HAWK_BT('\0'); + return n; +} + +hawk_ooi_t hawk_sio_getbchars (hawk_sio_t* sio, hawk_bch_t* buf, hawk_oow_t size) +{ + hawk_ooi_t n; +#if defined(_WIN32) + /* Using ReadConsoleA() didn't help at all. + * so I don't implement any hack here */ +#endif + + LOCK_INPUT (sio); + sio->errnum = HAWK_SIO_ENOERR; + n = hawk_tio_readbchars(&sio->tio.io, buf, size); + if (n <= -1 && sio->errnum == HAWK_SIO_ENOERR) + sio->errnum = tio_errnum_to_sio_errnum (&sio->tio.io); + UNLOCK_INPUT (sio); + + return n; +} + +hawk_ooi_t hawk_sio_getucstr (hawk_sio_t* sio, hawk_uch_t* buf, hawk_oow_t size) +{ + hawk_ooi_t n; + + if (size <= 0) return 0; + +#if defined(_WIN32) + /* Using ReadConsoleA() didn't help at all. + * so I don't implement any hack here */ +#endif + + LOCK_INPUT (sio); + sio->errnum = HAWK_SIO_ENOERR; + n = hawk_tio_readuchars(&sio->tio.io, buf, size - 1); + if (n <= -1) + { + if (sio->errnum == HAWK_SIO_ENOERR) + sio->errnum = tio_errnum_to_sio_errnum (&sio->tio.io); + return -1; + } + UNLOCK_INPUT (sio); + + buf[n] = HAWK_UT('\0'); + return n; +} + +hawk_ooi_t hawk_sio_getuchars(hawk_sio_t* sio, hawk_uch_t* buf, hawk_oow_t size) +{ + hawk_ooi_t n; + +#if defined(_WIN32) + /* Using ReadConsoleW() didn't help at all. + * so I don't implement any hack here */ +#endif + + LOCK_INPUT (sio); + sio->errnum = HAWK_SIO_ENOERR; + n = hawk_tio_readuchars (&sio->tio.io, buf, size); + if (n <= -1 && sio->errnum == HAWK_SIO_ENOERR) + sio->errnum = tio_errnum_to_sio_errnum (&sio->tio.io); + UNLOCK_INPUT (sio); + + return n; +} + +static hawk_ooi_t putbc_no_mutex (hawk_sio_t* sio, hawk_bch_t c) +{ + hawk_ooi_t n; + + sio->errnum = HAWK_SIO_ENOERR; + +#if defined(__OS2__) + if (c == HAWK_BT('\n') && (sio->status & STATUS_LINE_BREAK)) + n = hawk_tio_writebchars (&sio->tio.io, HAWK_BT("\r\n"), 2); + else + n = hawk_tio_writebchars (&sio->tio.io, &c, 1); +#else + n = hawk_tio_writebchars (&sio->tio.io, &c, 1); +#endif + + if (n <= -1 && sio->errnum == HAWK_SIO_ENOERR) + sio->errnum = tio_errnum_to_sio_errnum (&sio->tio.io); + + return n; +} + +hawk_ooi_t hawk_sio_putbchar (hawk_sio_t* sio, hawk_bch_t c) +{ + hawk_ooi_t n; + LOCK_OUTPUT (sio); + n = putbc_no_mutex(sio, c); + UNLOCK_OUTPUT (sio); + return n; +} + +static hawk_ooi_t put_uchar_no_mutex (hawk_sio_t* sio, hawk_uch_t c) +{ + hawk_ooi_t n; + + sio->errnum = HAWK_SIO_ENOERR; +#if defined(__OS2__) + if (c == HAWK_UT('\n') && (sio->status & STATUS_LINE_BREAK)) + n = hawk_tio_writeuchars(&sio->tio.io, HAWK_UT("\r\n"), 2); + else + n = hawk_tio_writeuchars(&sio->tio.io, &c, 1); +#else + n = hawk_tio_writeuchars(&sio->tio.io, &c, 1); +#endif + if (n <= -1 && sio->errnum == HAWK_SIO_ENOERR) + sio->errnum = tio_errnum_to_sio_errnum (&sio->tio.io); + + return n; +} + +hawk_ooi_t hawk_sio_putuchar (hawk_sio_t* sio, hawk_uch_t c) +{ + hawk_ooi_t n; + LOCK_OUTPUT (sio); + n = put_uchar_no_mutex(sio, c); + UNLOCK_OUTPUT (sio); + return n; +} + +hawk_ooi_t hawk_sio_putbcstr (hawk_sio_t* sio, const hawk_bch_t* str) +{ + hawk_ooi_t n; + +#if defined(_WIN32) + /* Using WriteConsoleA() didn't help at all. + * so I don't implement any hacks here */ +#elif defined(__OS2__) + if (sio->status & STATUS_LINE_BREAK) + { + LOCK_OUTPUT (sio); + for (n = 0; n < HAWK_TYPE_MAX(hawk_ooi_t) && str[n] != HAWK_BT('\0'); n++) + { + if ((n = putbc_no_mutex(sio, str[n])) <= -1) return n; + } + UNLOCK_OUTPUT (sio); + return n; + } +#endif + + LOCK_OUTPUT (sio); + + sio->errnum = HAWK_SIO_ENOERR; + n = hawk_tio_writebchars(&sio->tio.io, str, (hawk_oow_t)-1); + if (n <= -1 && sio->errnum == HAWK_SIO_ENOERR) + sio->errnum = tio_errnum_to_sio_errnum(&sio->tio.io); + + UNLOCK_OUTPUT (sio); + return n; +} + +hawk_ooi_t hawk_sio_putbchars (hawk_sio_t* sio, const hawk_bch_t* str, hawk_oow_t size) +{ + hawk_ooi_t n; + +#if defined(_WIN32) + /* Using WriteConsoleA() didn't help at all. + * so I don't implement any hacks here */ +#elif defined(__OS2__) + if (sio->status & STATUS_LINE_BREAK) + { + if (size > HAWK_TYPE_MAX(hawk_ooi_t)) size = HAWK_TYPE_MAX(hawk_ooi_t); + LOCK_OUTPUT (sio); + for (n = 0; n < size; n++) + { + if (putbc_no_mutex(sio, str[n]) <= -1) return -1; + } + UNLOCK_OUTPUT (sio); + return n; + } +#endif + + LOCK_OUTPUT (sio); + + sio->errnum = HAWK_SIO_ENOERR; + n = hawk_tio_writebchars (&sio->tio.io, str, size); + if (n <= -1 && sio->errnum == HAWK_SIO_ENOERR) + sio->errnum = tio_errnum_to_sio_errnum (&sio->tio.io); + + UNLOCK_OUTPUT (sio); + + return n; +} + +hawk_ooi_t hawk_sio_putucstr (hawk_sio_t* sio, const hawk_uch_t* str) +{ + hawk_ooi_t n; + +#if defined(_WIN32) + /* DAMN UGLY: See comment in hawk_sio_putuchars() */ + if (sio->status & STATUS_UTF8_CONSOLE) + { + DWORD count, left; + const hawk_uch_t* cur; + + if (hawk_sio_flush (sio) <= -1) return -1; /* can't do buffering */ + + for (cur = str, left = hawk_wcslen(str); left > 0; cur += count, left -= count) + { + if (WriteConsoleW(sio->file.handle, cur, left, &count, HAWK_NULL) == FALSE) + { + sio->errnum = HAWK_SIO_ESYSERR; + return -1; + } + if (count == 0) break; + + if (count > left) + { + sio->errnum = HAWK_SIO_ESYSERR; + return -1; + } + } + return cur - str; + } +#elif defined(__OS2__) + if (sio->status & STATUS_LINE_BREAK) + { + LOCK_OUTPUT (sio); + for (n = 0; n < HAWK_TYPE_MAX(hawk_ooi_t) && str[n] != HAWK_UT('\0'); n++) + { + if (put_uchar_no_mutex(sio, str[n]) <= -1) return -1; + } + UNLOCK_OUTPUT (sio); + return n; + } +#endif + + LOCK_OUTPUT (sio); + + sio->errnum = HAWK_SIO_ENOERR; + n = hawk_tio_writeuchars(&sio->tio.io, str, (hawk_oow_t)-1); + if (n <= -1 && sio->errnum == HAWK_SIO_ENOERR) + sio->errnum = tio_errnum_to_sio_errnum (&sio->tio.io); + + UNLOCK_OUTPUT (sio); + return n; +} + +hawk_ooi_t hawk_sio_putuchars (hawk_sio_t* sio, const hawk_uch_t* str, hawk_oow_t size) +{ + hawk_ooi_t n; + +#if defined(_WIN32) + /* DAMN UGLY: + * WriteFile returns wrong number of bytes written if it is + * requested to write a utf8 string on utf8 console (codepage 65001). + * it seems to return a number of characters written instead. so + * i have to use an alternate API for console output for + * wide-character strings. Conversion to either an OEM codepage or + * the utf codepage is handled by the API. This hack at least + * lets you do proper utf8 output on utf8 console using wide-character. + * + * Note that the multibyte functions hawk_sio_putbcstr() and + * hawk_sio_putbchars() doesn't handle this. So you may still suffer. + */ + if (sio->status & STATUS_UTF8_CONSOLE) + { + DWORD count, left; + const hawk_uch_t* cur; + + if (hawk_sio_flush (sio) <= -1) return -1; /* can't do buffering */ + + for (cur = str, left = size; left > 0; cur += count, left -= count) + { + if (WriteConsoleW(sio->file.handle, cur, left, &count, HAWK_NULL) == FALSE) + { + sio->errnum = HAWK_SIO_ESYSERR; + return -1; + } + if (count == 0) break; + + /* Note: + * WriteConsoleW() in unicosw.dll on win 9x/me returns + * the number of bytes via 'count'. If a double byte + * string is given, 'count' can be greater than 'left'. + * this case is a miserable failure. however, i don't + * think there is CP_UTF8 codepage for console on win9x/me. + * so let me make this function fail if that ever happens. + */ + if (count > left) + { + sio->errnum = HAWK_SIO_ESYSERR; + return -1; + } + } + return cur - str; + } + +#elif defined(__OS2__) + if (sio->status & STATUS_LINE_BREAK) + { + if (size > HAWK_TYPE_MAX(hawk_ooi_t)) size = HAWK_TYPE_MAX(hawk_ooi_t); + LOCK_OUTPUT (sio); + for (n = 0; n < size; n++) + { + if (put_uchar_no_mutex(sio, str[n]) <= -1) return -1; + } + UNLOCK_OUTPUT (sio); + return n; + } +#endif + + LOCK_OUTPUT (sio); + + sio->errnum = HAWK_SIO_ENOERR; + n = hawk_tio_writeuchars(&sio->tio.io, str, size); + if (n <= -1 && sio->errnum == HAWK_SIO_ENOERR) + sio->errnum = tio_errnum_to_sio_errnum (&sio->tio.io); + + UNLOCK_OUTPUT (sio); + return n; +} + +int hawk_sio_getpos (hawk_sio_t* sio, hawk_sio_pos_t* pos) +{ + hawk_fio_off_t off; + + if (hawk_sio_flush(sio) <= -1) return -1; + + off = hawk_fio_seek(&sio->file, 0, HAWK_FIO_CURRENT); + if (off == (hawk_fio_off_t)-1) + { + sio->errnum = fio_errnum_to_sio_errnum(&sio->file); + return -1; + } + + *pos = off; + return 0; +} + +int hawk_sio_setpos (hawk_sio_t* sio, hawk_sio_pos_t pos) +{ + hawk_fio_off_t off; + + if (hawk_sio_flush(sio) <= -1) return -1; + + off = hawk_fio_seek(&sio->file, pos, HAWK_FIO_BEGIN); + if (off == (hawk_fio_off_t)-1) + { + sio->errnum = fio_errnum_to_sio_errnum(&sio->file); + return -1; + } + + return 0; +} + +int hawk_sio_truncate (hawk_sio_t* sio, hawk_sio_pos_t pos) +{ + if (hawk_sio_flush(sio) <= -1) return -1; + return hawk_fio_truncate(&sio->file, pos); +} + +int hawk_sio_seek (hawk_sio_t* sio, hawk_sio_pos_t* pos, hawk_sio_ori_t origin) +{ + hawk_fio_off_t x; + + if (hawk_sio_flush(sio) <= -1) return -1; + x = hawk_fio_seek(&sio->file, *pos, origin); + if (x == (hawk_fio_off_t)-1) return -1; + + *pos = x; + return 0; +} + +static hawk_ooi_t file_input (hawk_tio_t* tio, hawk_tio_cmd_t cmd, void* buf, hawk_oow_t size) +{ + if (cmd == HAWK_TIO_DATA) + { + hawk_ooi_t n; + hawk_sio_t* sio; + + sio = *(hawk_sio_t**)(tio + 1); + HAWK_ASSERT (tio->hawk, sio != HAWK_NULL); + HAWK_ASSERT (tio->hawk, tio->hawk == sio->hawk); + + n = hawk_fio_read(&sio->file, buf, size); + if (n <= -1) sio->errnum = fio_errnum_to_sio_errnum (&sio->file); + return n; + } + + return 0; +} + +static hawk_ooi_t file_output (hawk_tio_t* tio, hawk_tio_cmd_t cmd, void* buf, hawk_oow_t size) +{ + if (cmd == HAWK_TIO_DATA) + { + hawk_ooi_t n; + hawk_sio_t* sio; + + sio = *(hawk_sio_t**)(tio + 1); + HAWK_ASSERT (tio->hawk, sio != HAWK_NULL); + HAWK_ASSERT (tio->hawk, tio->hawk == sio->hawk); + + n = hawk_fio_write(&sio->file, buf, size); + if (n <= -1) sio->errnum = fio_errnum_to_sio_errnum(&sio->file); + return n; + } + + return 0; +} diff --git a/hawk/lib/std-prv.h b/hawk/lib/std-prv.h new file mode 100644 index 00000000..e2de5a31 --- /dev/null +++ b/hawk/lib/std-prv.h @@ -0,0 +1,51 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_STD_PRV_H +#define _HAWK_STD_PRV_H_ + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +HAWK_EXPORT hawk_flt_t hawk_stdmathpow (hawk_t* awk, hawk_flt_t x, hawk_flt_t y); +HAWK_EXPORT hawk_flt_t hawk_stdmathmod (hawk_t* awk, hawk_flt_t x, hawk_flt_t y); + +HAWK_EXPORT int hawk_stdmodstartup (hawk_t* awk); +HAWK_EXPORT void hawk_stdmodshutdown (hawk_t* awk); + +HAWK_EXPORT void* hawk_stdmodopen (hawk_t* awk, const hawk_mod_spec_t* spec); +HAWK_EXPORT void hawk_stdmodclose (hawk_t* awk, void* handle); +HAWK_EXPORT void* hawk_stdmodgetsym (hawk_t* awk, void* handle, const hawk_ooch_t* name); + +#if defined(__cplusplus) +} +#endif + + +#endif diff --git a/hawk/lib/std.c b/hawk/lib/std.c new file mode 100644 index 00000000..c40f77af --- /dev/null +++ b/hawk/lib/std.c @@ -0,0 +1,2770 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "hawk-prv.h" +#include "std-prv.h" + +#include +#include + +#include +#include +#include +#if defined(HAVE_QUADMATH_H) +# include +#endif + +#if defined(_WIN32) +# include +# include +# if defined(HAWK_HAVE_CONFIG_H) && defined(HAWK_ENABLE_LIBLTDL) +# include +# define USE_LTDL +# endif +#elif defined(__OS2__) +# define INCL_DOSMODULEMGR +# define INCL_DOSPROCESS +# define INCL_DOSERRORS +# include +#elif defined(__DOS__) + /* nothing to include */ +#else +# include "syscall.h" +# if defined(HAWK_ENABLE_LIBLTDL) +# include +# define USE_LTDL +# elif defined(HAVE_DLFCN_H) +# include +# define USE_DLFCN +# else +# error UNSUPPORTED DYNAMIC LINKER +# endif +#endif + +#if !defined(HAWK_HAVE_CONFIG_H) +# if defined(_WIN32) || defined(__OS2__) || defined(__DOS__) +# define HAVE_POW +# define HAVE_FMOD +# endif +#endif + +typedef struct xtn_t +{ + struct + { + struct + { + hawk_parsestd_t* x; + hawk_oow_t xindex; + + union + { + /* nothing to maintain here for file */ + + struct + { + const hawk_ooch_t* ptr; + const hawk_ooch_t* end; + } oocs; + struct + { + const hawk_bch_t* ptr; + const hawk_bch_t* end; + } bcs; + struct + { + const hawk_uch_t* ptr; + const hawk_uch_t* end; + } ucs; + } u; + } in; + + struct + { + hawk_parsestd_t* x; + union + { + struct + { + hawk_sio_t* sio; + } file; + struct + { + hawk_ooecs_t* buf; + } oocs; + struct + { + hawk_becs_t* buf; + } bcs; + struct + { + hawk_uecs_t* buf; + } ucs; + } u; + } out; + } s; /* script/source handling */ + + int gbl_argc; + int gbl_argv; + int gbl_environ; + + hawk_ecb_t ecb; + int stdmod_up; +} xtn_t; + +typedef struct rxtn_t +{ + struct + { + struct { + const hawk_ooch_t*const* files; + hawk_oow_t index; + hawk_oow_t count; + } in; + + struct + { + const hawk_ooch_t*const* files; + hawk_oow_t index; + hawk_oow_t count; + } out; + + hawk_cmgr_t* cmgr; + } c; /* console */ + + int cmgrtab_inited; + hawk_htb_t cmgrtab; + + hawk_rtx_ecb_t ecb; +} rxtn_t; + +typedef struct ioattr_t +{ + hawk_cmgr_t* cmgr; + hawk_ooch_t cmgr_name[64]; /* i assume that the cmgr name never exceeds this length */ + hawk_ntime_t tmout[4]; +} ioattr_t; + +#if defined(HAWK_HAVE_INLINE) +static HAWK_INLINE xtn_t* GET_XTN(hawk_t* awk) { return (xtn_t*)((hawk_uint8_t*)hawk_getxtn(awk) - HAWK_SIZEOF(xtn_t)); } +static HAWK_INLINE rxtn_t* GET_RXTN(hawk_rtx_t* rtx) { return (rxtn_t*)((hawk_uint8_t*)hawk_rtx_getxtn(rtx) - HAWK_SIZEOF(rxtn_t)); } +#else +#define GET_XTN(awk) ((xtn_t*)((hawk_uint8_t*)hawk_getxtn(awk) - HAWK_SIZEOF(xtn_t))) +#define GET_RXTN(rtx) ((rxtn_t*)((hawk_uint8_t*)hawk_rtx_getxtn(rtx) - HAWK_SIZEOF(rxtn_t))) +#endif + + +/* ========================================================================= */ + +static void* sys_alloc (hawk_mmgr_t* mmgr, hawk_oow_t size) +{ + return malloc(size); +} + +static void* sys_realloc (hawk_mmgr_t* mmgr, void* ptr, hawk_oow_t size) +{ + return realloc(ptr, size); +} + +static void sys_free (hawk_mmgr_t* mmgr, void* ptr) +{ + free (ptr); +} + +static hawk_mmgr_t sys_mmgr = +{ + sys_alloc, + sys_realloc, + sys_free, + HAWK_NULL +}; + +/* ========================================================================= */ + +static ioattr_t* get_ioattr (hawk_htb_t* tab, const hawk_ooch_t* ptr, hawk_oow_t len); + +hawk_flt_t hawk_stdmathpow (hawk_t* awk, hawk_flt_t x, hawk_flt_t y) +{ +#if defined(HAWK_USE_AWK_FLTMAX) && defined(HAVE_POWQ) + return powq(x, y); +#elif defined(HAVE_POWL) && (HAWK_SIZEOF_LONG_DOUBLE > HAWK_SIZEOF_DOUBLE) + return powl(x, y); +#elif defined(HAVE_POW) + return pow(x, y); +#elif defined(HAVE_POWF) + return powf(x, y); +#else + #error ### no pow function available ### +#endif +} + +hawk_flt_t hawk_stdmathmod (hawk_t* awk, hawk_flt_t x, hawk_flt_t y) +{ +#if defined(HAWK_USE_AWK_FLTMAX) && defined(HAVE_FMODQ) + return fmodq(x, y); +#elif defined(HAVE_FMODL) && (HAWK_SIZEOF_LONG_DOUBLE > HAWK_SIZEOF_DOUBLE) + return fmodl(x, y); +#elif defined(HAVE_FMOD) + return fmod(x, y); +#elif defined(HAVE_FMODF) + return fmodf(x, y); +#else + #error ### no fmod function available ### +#endif +} + +/* [IMPORTANT] + * hawk_stdmodXXXX() functions must not access the extension + * area of 'awk'. they are used in StdAwk.cpp which instantiates + * an awk object with hawk_open() instead of hawk_openstd(). */ + +int hawk_stdmodstartup (hawk_t* awk) +{ +#if defined(USE_LTDL) + + /* lt_dlinit() can be called more than once and + * lt_dlexit() shuts down libltdl if it's called as many times as + * corresponding lt_dlinit(). so it's safe to call lt_dlinit() + * and lt_dlexit() at the library level. */ + return lt_dlinit() != 0? -1: 0; + +#else + return 0; +#endif + +} + +void hawk_stdmodshutdown (hawk_t* awk) +{ +#if defined(USE_LTDL) + lt_dlexit (); +#else + /* do nothing */ +#endif +} + +static void* std_mod_open_checked (hawk_t* awk, const hawk_mod_spec_t* spec) +{ + xtn_t* xtn = GET_XTN(awk); + + if (!xtn->stdmod_up) + { + /* hawk_stdmodstartup() must have failed upon start-up. + * return failure immediately */ + hawk_seterrnum (awk, HAWK_ENOIMPL, HAWK_NULL); + return HAWK_NULL; + } + + return hawk_stdmodopen(awk, spec); +} + +void* hawk_stdmodopen (hawk_t* awk, const hawk_mod_spec_t* spec) +{ +#if defined(USE_LTDL) + void* h; + lt_dladvise adv; + hawk_bch_t* modpath; + const hawk_ooch_t* tmp[4]; + int count; + + count = 0; + if (spec->prefix) tmp[count++] = spec->prefix; + tmp[count++] = spec->name; + if (spec->postfix) tmp[count++] = spec->postfix; + tmp[count] = HAWK_NULL; + + #if defined(HAWK_OOCH_IS_BCH) + modpath = hawk_dupbcstrarr(awk, tmp, HAWK_NULL); + #else + modpath = hawk_dupucstrarrtobcstr(awk, tmp, HAWK_NULL) + #endif + if (!modpath) return HAWK_NULL; + + if (lt_dladvise_init(&adv) != 0) + { + /* the only failure of lt_dladvise_init() seems to be caused + * by memory allocation failured */ + hawk_seterrnum (awk, HAWK_ENOMEM, HAWK_NULL); + return HAWK_NULL; + } + + lt_dladvise_ext (&adv); + /*lt_dladvise_resident (&adv); useful for debugging with valgrind */ + + h = lt_dlopenadvise (modpath, adv); + + lt_dladvise_destroy (&adv); + + HAWK_MMGR_FREE (hawk_getmmgr(awk), modpath); + + return h; + +#elif defined(_WIN32) + + HMODULE h; + hawk_ooch_t* modpath; + const hawk_ooch_t* tmp[4]; + int count; + + count = 0; + if (spec->prefix) tmp[count++] = spec->prefix; + tmp[count++] = spec->name; + if (spec->postfix) tmp[count++] = spec->postfix; + tmp[count] = HAWK_NULL; + + modpath = hawk_stradup (tmp, HAWK_NULL, hawk_getmmgr(awk)); + if (!modpath) + { + hawk_seterrnum (awk, HAWK_ENOMEM, HAWK_NULL); + return HAWK_NULL; + } + + h = LoadLibrary (modpath); + + hawk_freemem (awk, modpath); + + HAWK_ASSERT (awk, HAWK_SIZEOF(h) <= HAWK_SIZEOF(void*)); + return h; + +#elif defined(__OS2__) + + HMODULE h; + hawk_bch_t* modpath; + const hawk_ooch_t* tmp[4]; + int count; + char errbuf[CCHMAXPATH]; + APIRET rc; + + count = 0; + if (spec->prefix) tmp[count++] = spec->prefix; + tmp[count++] = spec->name; + if (spec->postfix) tmp[count++] = spec->postfix; + tmp[count] = HAWK_NULL; + + #if defined(HAWK_OOCH_IS_BCH) + modpath = hawk_dupbcstrarr(awk, tmp, HAWK_NULL); + #else + modpath = hawk_dupucstrarrtobcstr(awk, tmp, HAWK_NULL); + #endif + if (!modpath) return HAWK_NULL; + + /* DosLoadModule() seems to have severe limitation on + * the file name it can load (max-8-letters.xxx) */ + rc = DosLoadModule (errbuf, HAWK_COUNTOF(errbuf) - 1, modpath, &h); + if (rc != NO_ERROR) h = HAWK_NULL; + + hawk_freemem (awk, modpath); + + HAWK_ASSERT (awk, HAWK_SIZEOF(h) <= HAWK_SIZEOF(void*)); + return h; + +#elif defined(__DOS__) && defined(HAWK_ENABLE_DOS_DYNAMIC_MODULE) + + /* the DOS code here is not generic enough. it's for a specific + * dos-extender only. the best is not to use dynamic loading + * when building for DOS. */ + void* h; + hawk_bch_t* modpath; + const hawk_ooch_t* tmp[4]; + int count; + + count = 0; + if (spec->prefix) tmp[count++] = spec->prefix; + tmp[count++] = spec->name; + if (spec->postfix) tmp[count++] = spec->postfix; + tmp[count] = HAWK_NULL; + + #if defined(HAWK_OOCH_IS_BCH) + modpath = hawk_dupbcstrarr(awk, tmp, HAWK_NULL); + #else + modpath = hawk_dupucstrarrtobcstr(awk, tmp, HAWK_NULL); + #endif + if (!modpath) return HAWK_NULL; + + h = LoadModule (modpath); + + hawk_freemem (awk, modpath); + + HAWK_ASSERT (awk, HAWK_SIZEOF(h) <= HAWK_SIZEOF(void*)); + return h; + +#elif defined(USE_DLFCN) + void* h; + hawk_bch_t* modpath; + const hawk_ooch_t* tmp[4]; + int count; + + count = 0; + if (spec->prefix) tmp[count++] = spec->prefix; + tmp[count++] = spec->name; + if (spec->postfix) tmp[count++] = spec->postfix; + tmp[count] = HAWK_NULL; + + #if defined(HAWK_OOCH_IS_BCH) + modpath = hawk_dupbcstrarr(awk, tmp, HAWK_NULL); + #else + modpath = hawk_dupucstrarrtobcstr(awk, tmp, HAWK_NULL); + #endif + if (!modpath) + { + hawk_seterrnum (awk, HAWK_ENOMEM, HAWK_NULL); + return HAWK_NULL; + } + + h = dlopen(modpath, RTLD_NOW); + if (!h) + { + hawk_seterrfmt (awk, HAWK_ESYSERR, HAWK_NULL, HAWK_T("%hs"), dlerror()); + } + + hawk_freemem (awk, modpath); + + return h; + +#else + hawk_seterrnum (awk, HAWK_ENOIMPL, HAWK_NULL); + return HAWK_NULL; +#endif +} + +void hawk_stdmodclose (hawk_t* awk, void* handle) +{ +#if defined(USE_LTDL) + lt_dlclose (handle); +#elif defined(_WIN32) + FreeLibrary ((HMODULE)handle); +#elif defined(__OS2__) + DosFreeModule ((HMODULE)handle); +#elif defined(__DOS__) && defined(HAWK_ENABLE_DOS_DYNAMIC_MODULE) + FreeModule (handle); +#elif defined(USE_DLFCN) + dlclose (handle); +#else + /* nothing to do */ +#endif +} + +void* hawk_stdmodgetsym (hawk_t* awk, void* handle, const hawk_ooch_t* name) +{ + void* s; + hawk_bch_t* mname; + +#if defined(HAWK_OOCH_IS_BCH) + mname = (hawk_bch_t*)name; +#else + mname = hawk_duputobcstr(awk, name, HAWK_NULL); + if (!mname) return HAWK_NULL; +#endif + +#if defined(USE_LTDL) + s = lt_dlsym (handle, mname); + +#elif defined(_WIN32) + s = GetProcAddress ((HMODULE)handle, mname); + +#elif defined(__OS2__) + if (DosQueryProcAddr ((HMODULE)handle, 0, mname, (PFN*)&s) != NO_ERROR) s = HAWK_NULL; + +#elif defined(__DOS__) && defined(HAWK_ENABLE_DOS_DYNAMIC_MODULE) + s = GetProcAddress (handle, mname); + +#elif defined(USE_DLFCN) + s = dlsym (handle, mname); + +#else + s = HAWK_NULL; +#endif + +#if defined(HAWK_OOCH_IS_BCH) + /* nothing to do */ +#else + HAWK_MMGR_FREE (hawk_getmmgr(awk), mname); +#endif + + return s; +} + +static int add_globals (hawk_t* awk); +static int add_functions (hawk_t* awk); + +hawk_t* hawk_openstd (hawk_oow_t xtnsize, hawk_errnum_t* errnum) +{ + return hawk_openstdwithmmgr(&sys_mmgr, xtnsize, hawk_get_cmgr_by_id(HAWK_CMGR_UTF8), errnum); +} + +static void fini_xtn (hawk_t* awk) +{ + xtn_t* xtn = GET_XTN(awk); + if (xtn->stdmod_up) + { + hawk_stdmodshutdown (awk); + xtn->stdmod_up = 0; + } +} + +static void clear_xtn (hawk_t* awk) +{ + /* nothing to do */ +} + +hawk_t* hawk_openstdwithmmgr (hawk_mmgr_t* mmgr, hawk_oow_t xtnsize, hawk_cmgr_t* cmgr, hawk_errnum_t* errnum) +{ + hawk_t* awk; + hawk_prm_t prm; + xtn_t* xtn; + + prm.math.pow = hawk_stdmathpow; + prm.math.mod = hawk_stdmathmod; + + prm.modopen = std_mod_open_checked; + prm.modclose = hawk_stdmodclose; + prm.modgetsym = hawk_stdmodgetsym; + + /* create an object */ + awk = hawk_open(mmgr, HAWK_SIZEOF(xtn_t) + xtnsize, cmgr, &prm, errnum); + if (!awk) return HAWK_NULL; + + /* adjust the object size by the sizeof xtn_t so that hawk_getxtn() returns the right pointer. */ + awk->_instsize += HAWK_SIZEOF(xtn_t); + +#if defined(USE_DLFCN) + if (hawk_setopt(awk, HAWK_MODPOSTFIX, HAWK_T(".so")) <= -1) + { + if (errnum) *errnum = hawk_geterrnum(awk); + goto oops; + } +#endif + + /* initialize extension */ + xtn = GET_XTN(awk); + /* the extension area has been cleared in hawk_open(). + * HAWK_MEMSET (xtn, 0, HAWK_SIZEOF(*xtn));*/ + + /* add intrinsic global variables and functions */ + if (add_globals(awk) <= -1 || add_functions(awk) <= -1) + { + if (errnum) *errnum = hawk_geterrnum(awk); + goto oops; + } + + if (hawk_stdmodstartup(awk) <= -1) + { + xtn->stdmod_up = 0; + /* carry on regardless of failure */ + } + else + { + xtn->stdmod_up = 1; + } + + xtn->ecb.close = fini_xtn; + xtn->ecb.clear = clear_xtn; + hawk_pushecb (awk, &xtn->ecb); + + return awk; + +oops: + if (awk) hawk_close (awk); + return HAWK_NULL; +} + +static hawk_sio_t* open_sio (hawk_t* awk, const hawk_ooch_t* file, int flags) +{ + hawk_sio_t* sio; + sio = hawk_sio_open(awk, 0, file, flags); + if (sio == HAWK_NULL) + { + hawk_oocs_t errarg; + errarg.ptr = (hawk_ooch_t*)file; + errarg.len = hawk_count_oocstr(file); + hawk_seterrnum (awk, HAWK_EOPEN, &errarg); + } + return sio; +} + +static hawk_sio_t* open_sio_rtx (hawk_rtx_t* rtx, const hawk_ooch_t* file, int flags) +{ + hawk_sio_t* sio; + sio = hawk_sio_open(hawk_rtx_getawk(rtx), 0, file, flags); + if (sio == HAWK_NULL) + { + hawk_oocs_t errarg; + errarg.ptr = (hawk_ooch_t*)file; + errarg.len = hawk_count_oocstr(file); + hawk_rtx_seterrnum (rtx, HAWK_EOPEN, &errarg); + } + return sio; +} + +static hawk_oocs_t sio_std_names[] = +{ + { HAWK_T("stdin"), 5 }, + { HAWK_T("stdout"), 6 }, + { HAWK_T("stderr"), 6 } +}; + +static hawk_sio_t* open_sio_std (hawk_t* awk, hawk_sio_std_t std, int flags) +{ + hawk_sio_t* sio; + sio = hawk_sio_openstd(awk, 0, std, flags); + if (sio == HAWK_NULL) hawk_seterrnum (awk, HAWK_EOPEN, &sio_std_names[std]); + return sio; +} + +static hawk_sio_t* open_sio_std_rtx (hawk_rtx_t* rtx, hawk_sio_std_t std, int flags) +{ + hawk_sio_t* sio; + + sio = hawk_sio_openstd(hawk_rtx_getawk(rtx), 0, std, flags); + if (sio == HAWK_NULL) hawk_rtx_seterrnum (rtx, HAWK_EOPEN, &sio_std_names[std]); + return sio; +} + +/*** PARSESTD ***/ + +static int is_psin_file (hawk_parsestd_t* psin) +{ + return psin->type == HAWK_PARSESTD_FILE || + psin->type == HAWK_PARSESTD_FILEB || + psin->type == HAWK_PARSESTD_FILEU; +} + +static int open_parsestd (hawk_t* awk, hawk_sio_arg_t* arg, xtn_t* xtn, hawk_oow_t index) +{ + hawk_parsestd_t* psin = &xtn->s.in.x[index]; + + switch (psin->type) + { + /* normal source files */ + #if defined(HAWK_OOCH_IS_BCH) + case HAWK_PARSESTD_FILE: + HAWK_ASSERT (moo, &psin->u.fileb.path == &psin->u.file.path); + HAWK_ASSERT (moo, &psin->u.fileb.cmgr == &psin->u.file.cmgr); + #endif + case HAWK_PARSESTD_FILEB: + { + hawk_sio_t* tmp; + if (psin->u.fileb.path == HAWK_NULL || (psin->u.fileb.path[0] == '-' && psin->u.fileb.path[1] == '\0')) + { + /* no path name or - -> stdin */ + tmp = open_sio_std(awk, HAWK_SIO_STDIN, HAWK_SIO_READ | HAWK_SIO_IGNOREECERR); + } + else + { + #if defined(HAWK_OOCH_IS_UCH) + hawk_uch_t* upath; + upath = hawk_dupbtoucstr(awk, psin->u.fileb.path, HAWK_NULL, 1); + if (!upath) return -1; + tmp = open_sio(awk, upath, HAWK_SIO_READ | HAWK_SIO_IGNOREECERR | HAWK_SIO_KEEPPATH); + hawk_freemem (awk, upath); + #else + tmp = open_sio(awk, psin->u.fileb.path, HAWK_SIO_READ | HAWK_SIO_IGNOREECERR | HAWK_SIO_KEEPPATH); + #endif + } + if (tmp == HAWK_NULL) return -1; + + if (index >= 1 && is_psin_file(&xtn->s.in.x[index - 1])) hawk_sio_close (arg->handle); + + arg->handle = tmp; + if (psin->u.fileb.cmgr) hawk_sio_setcmgr (arg->handle, psin->u.fileb.cmgr); + return 0; + } + + #if defined(HAWK_OOCH_IS_UCH) + case HAWK_PARSESTD_FILE: + HAWK_ASSERT (moo, &psin->u.fileu.path == &psin->u.file.path); + HAWK_ASSERT (moo, &psin->u.fileu.cmgr == &psin->u.file.cmgr); + #endif + case HAWK_PARSESTD_FILEU: + { + hawk_sio_t* tmp; + if (psin->u.fileu.path == HAWK_NULL || (psin->u.fileu.path[0] == '-' && psin->u.fileu.path[1] == '\0')) + { + /* no path name or - -> stdin */ + tmp = open_sio_std(awk, HAWK_SIO_STDIN, HAWK_SIO_READ | HAWK_SIO_IGNOREECERR); + } + else + { + #if defined(HAWK_OOCH_IS_UCH) + tmp = open_sio(awk, psin->u.fileu.path, HAWK_SIO_READ | HAWK_SIO_IGNOREECERR | HAWK_SIO_KEEPPATH); + #else + hawk_bch_t* bpath; + bpath = hawk_duputobcstr(awk, psin->u.fileu.path, HAWK_NULL); + if (!upath) return -1; + tmp = open_sio(awk, bpath, HAWK_SIO_READ | HAWK_SIO_IGNOREECERR | HAWK_SIO_KEEPPATH); + hawk_freemem (hawk, bpath); + #endif + } + if (tmp == HAWK_NULL) return -1; + + if (index >= 1 && is_psin_file(&xtn->s.in.x[index - 1])) + hawk_sio_close (arg->handle); + + arg->handle = tmp; + if (psin->u.fileu.cmgr) hawk_sio_setcmgr (arg->handle, psin->u.fileu.cmgr); + return 0; + } + + case HAWK_PARSESTD_OOCS: + if (index >= 1 && is_psin_file(&xtn->s.in.x[index - 1])) hawk_sio_close (arg->handle); + xtn->s.in.u.oocs.ptr = psin->u.oocs.ptr; + xtn->s.in.u.oocs.end = psin->u.oocs.ptr + psin->u.oocs.len; + return 0; + + case HAWK_PARSESTD_BCS: + if (index >= 1 && is_psin_file(&xtn->s.in.x[index - 1])) hawk_sio_close (arg->handle); + xtn->s.in.u.bcs.ptr = psin->u.bcs.ptr; + xtn->s.in.u.bcs.end = psin->u.bcs.ptr + psin->u.bcs.len; + return 0; + + case HAWK_PARSESTD_UCS: + if (index >= 1 && is_psin_file(&xtn->s.in.x[index - 1])) hawk_sio_close (arg->handle); + xtn->s.in.u.ucs.ptr = psin->u.ucs.ptr; + xtn->s.in.u.ucs.end = psin->u.ucs.ptr + psin->u.ucs.len; + return 0; + + default: + hawk_seterrnum (awk, HAWK_EINTERN, HAWK_NULL); + return -1; + } +} + +static int fill_sio_arg_unique_id (hawk_t* hawk, hawk_sio_arg_t* arg, const hawk_ooch_t* path) +{ +#if defined(_WIN32) + return -1; + +#elif defined(__OS2__) + return -1; + +#elif defined(__DOS__) + return -1; + +#else + hawk_stat_t st; + int x; + struct + { + hawk_uintptr_t ino; + hawk_uintptr_t dev; + } tmp; + +#if defined(HAWK_OOCH_IS_BCH) + x = HAWK_STAT(path, &st); + if (x <= -1) return -1; +#else + hawk_bch_t* bpath; + + bpath= hawk_duputobcstr(hawk, path, HAWK_NULL); + if (!bpath) return -1; + + x = HAWK_STAT(bpath, &st); + hawk_freemem (hawk, bpath); + if (x <= -1) return -1; +#endif + + tmp.ino = st.st_ino; + tmp.dev = st.st_dev; + + HAWK_MEMCPY (arg->unique_id, &tmp, (HAWK_SIZEOF(tmp) > HAWK_SIZEOF(arg->unique_id)? HAWK_SIZEOF(arg->unique_id): HAWK_SIZEOF(tmp))); + return 0; +#endif +} + +static hawk_ooi_t sf_in_open (hawk_t* awk, hawk_sio_arg_t* arg, xtn_t* xtn) +{ + if (arg->prev == HAWK_NULL) + { + /* handle normal source input streams specified + * to hawk_parsestd() */ + + hawk_ooi_t x; + + HAWK_ASSERT (awk, arg == &awk->sio.arg); + + x = open_parsestd(awk, arg, xtn, 0); + if (x >= 0) + { + xtn->s.in.xindex = 0; /* update the current stream index */ + /* perform some manipulation about the top-level input information */ + if (is_psin_file(&xtn->s.in.x[0])) + { + arg->name = hawk_sio_getpath(arg->handle); + if (arg->name == HAWK_NULL) arg->name = sio_std_names[HAWK_SIO_STDIN].ptr; + } + else arg->name = HAWK_NULL; + } + + return x; + } + else + { + /* handle the included source file - @include */ + const hawk_ooch_t* path; + hawk_ooch_t fbuf[64]; + hawk_ooch_t* dbuf = HAWK_NULL; + + HAWK_ASSERT (awk, arg->name != HAWK_NULL); + + path = arg->name; + if (arg->prev->handle) + { + const hawk_ooch_t* outer; + + outer = hawk_sio_getpath(arg->prev->handle); + if (outer) + { + const hawk_ooch_t* base; + + base = hawk_get_base_name_oocstr(outer); + if (base != outer && arg->name[0] != HAWK_T('/')) + { + hawk_oow_t tmplen, totlen, dirlen; + + dirlen = base - outer; + totlen = hawk_count_oocstr(arg->name) + dirlen; + if (totlen >= HAWK_COUNTOF(fbuf)) + { + dbuf = hawk_allocmem(awk, HAWK_SIZEOF(hawk_ooch_t) * (totlen + 1)); + if (!dbuf) return -1; + path = dbuf; + } + else path = fbuf; + + tmplen = hawk_copy_oochars_to_oocstr_unlimited((hawk_ooch_t*)path, outer, dirlen); + hawk_copy_oocstr_unlimited ((hawk_ooch_t*)path + tmplen, arg->name); + } + } + } + + arg->handle = hawk_sio_open(awk, 0, path, HAWK_SIO_READ | HAWK_SIO_IGNOREECERR | HAWK_SIO_KEEPPATH); + + if (dbuf) hawk_freemem (awk, dbuf); + if (!arg->handle) + { + hawk_oocs_t ea; + ea.ptr = (hawk_ooch_t*)arg->name; + ea.len = hawk_count_oocstr(ea.ptr); + hawk_seterrnum (awk, HAWK_EOPEN, &ea); + return -1; + } + + /* TODO: use the system handle(file descriptor) instead of the path? */ + /*syshnd = hawk_sio_gethnd(arg->handle);*/ + fill_sio_arg_unique_id(awk, arg, path); /* ignore failure */ + + return 0; + } +} + +static hawk_ooi_t sf_in_close (hawk_t* awk, hawk_sio_arg_t* arg, xtn_t* xtn) +{ + if (arg->prev == HAWK_NULL) + { + switch (xtn->s.in.x[xtn->s.in.xindex].type) + { + case HAWK_PARSESTD_FILE: + case HAWK_PARSESTD_FILEB: + case HAWK_PARSESTD_FILEU: + HAWK_ASSERT (awk, arg->handle != HAWK_NULL); + hawk_sio_close (arg->handle); + break; + + case HAWK_PARSESTD_OOCS: + case HAWK_PARSESTD_BCS: + case HAWK_PARSESTD_UCS: + /* nothing to close */ + break; + + default: + /* nothing to close */ + break; + } + } + else + { + /* handle the included source file - @include */ + HAWK_ASSERT (awk, arg->handle != HAWK_NULL); + hawk_sio_close (arg->handle); + } + + return 0; +} + +static hawk_ooi_t sf_in_read (hawk_t* awk, hawk_sio_arg_t* arg, hawk_ooch_t* data, hawk_oow_t size, xtn_t* xtn) +{ + if (arg->prev == HAWK_NULL) + { + hawk_ooi_t n; + + HAWK_ASSERT (awk, arg == &awk->sio.arg); + + again: + switch (xtn->s.in.x[xtn->s.in.xindex].type) + { + case HAWK_PARSESTD_FILE: + case HAWK_PARSESTD_FILEB: + case HAWK_PARSESTD_FILEU: + HAWK_ASSERT (awk, arg->handle != HAWK_NULL); + n = hawk_sio_getoochars (arg->handle, data, size); + if (n <= -1) + { + hawk_oocs_t ea; + ea.ptr = (hawk_ooch_t*)xtn->s.in.x[xtn->s.in.xindex].u.file.path; + if (ea.ptr == HAWK_NULL) ea.ptr = sio_std_names[HAWK_SIO_STDIN].ptr; + ea.len = hawk_count_oocstr(ea.ptr); + hawk_seterrnum (awk, HAWK_EREAD, &ea); + } + break; + + case HAWK_PARSESTD_OOCS: + parsestd_str: + n = 0; + while (n < size && xtn->s.in.u.oocs.ptr < xtn->s.in.u.oocs.end) + { + data[n++] = *xtn->s.in.u.oocs.ptr++; + } + break; + + case HAWK_PARSESTD_BCS: + #if defined(HAWK_OOCH_IS_BCH) + goto parsestd_str; + #else + { + int m; + hawk_oow_t mbslen, wcslen; + + mbslen = xtn->s.in.u.bcs.end - xtn->s.in.u.bcs.ptr; + wcslen = size; + if ((m = hawk_conv_bchars_to_uchars_with_cmgr(xtn->s.in.u.bcs.ptr, &mbslen, data, &wcslen, hawk_getcmgr(awk), 0)) <= -1 && m != -2) + { + hawk_seterrnum (awk, HAWK_EINVAL, HAWK_NULL); + n = -1; + } + else + { + xtn->s.in.u.bcs.ptr += mbslen; + n = wcslen; + } + break; + } + #endif + + case HAWK_PARSESTD_UCS: + #if defined(HAWK_OOCH_IS_BCH) + { + int m; + hawk_oow_t mbslen, wcslen; + + wcslen = xtn->s.in.u.ucs.end - xtn->s.in.u.ucs.ptr; + mbslen = size; + if ((m = hawk_conv_uchars_to_bchars_with_cmgr(xtn->s.in.u.ucs.ptr, &wcslen, data, &mbslen, hawk_getcmgr(awk))) <= -1 && m != -2) + { + hawk_seterrnum (awk, HAWK_EINVAL, HAWK_NULL); + n = -1; + } + else + { + xtn->s.in.u.ucs.ptr += wcslen; + n = mbslen; + } + break; + } + #else + goto parsestd_str; + #endif + + default: + /* this should never happen */ + hawk_seterrnum (awk, HAWK_EINTERN, HAWK_NULL); + n = -1; + break; + } + + if (n == 0) + { + /* reached end of the current stream. */ + hawk_oow_t next = xtn->s.in.xindex + 1; + if (xtn->s.in.x[next].type != HAWK_PARSESTD_NULL) + { + /* open the next stream if available. */ + if (open_parsestd (awk, arg, xtn, next) <= -1) n = -1; + else + { + xtn->s.in.xindex = next; /* update the next to the current */ + + /* update the I/O object name */ + if (is_psin_file(&xtn->s.in.x[next])) + { + arg->name = hawk_sio_getpath(arg->handle); + if (arg->name == HAWK_NULL) arg->name = sio_std_names[HAWK_SIO_STDIN].ptr; + } + else + { + arg->name = HAWK_NULL; + } + + arg->line = 0; /* reset the line number */ + arg->colm = 0; + goto again; + } + } + } + + return n; + } + else + { + /* handle the included source file - @include */ + hawk_ooi_t n; + + HAWK_ASSERT (awk, arg->name != HAWK_NULL); + HAWK_ASSERT (awk, arg->handle != HAWK_NULL); + + n = hawk_sio_getoochars(arg->handle, data, size); + if (n <= -1) + { + hawk_oocs_t ea; + ea.ptr = (hawk_ooch_t*)arg->name; + ea.len = hawk_count_oocstr(ea.ptr); + hawk_seterrnum (awk, HAWK_EREAD, &ea); + } + return n; + } +} + +static hawk_ooi_t sf_in (hawk_t* awk, hawk_sio_cmd_t cmd, hawk_sio_arg_t* arg, hawk_ooch_t* data, hawk_oow_t size) +{ + xtn_t* xtn = GET_XTN(awk); + + switch (cmd) + { + case HAWK_SIO_CMD_OPEN: + return sf_in_open(awk, arg, xtn); + + case HAWK_SIO_CMD_CLOSE: + return sf_in_close(awk, arg, xtn); + + case HAWK_SIO_CMD_READ: + return sf_in_read(awk, arg, data, size, xtn); + + default: + hawk_seterrnum (awk, HAWK_EINTERN, HAWK_NULL); + return -1; + } +} + +static hawk_ooi_t sf_out (hawk_t* awk, hawk_sio_cmd_t cmd, hawk_sio_arg_t* arg, hawk_ooch_t* data, hawk_oow_t size) +{ + xtn_t* xtn = GET_XTN(awk); + + switch (cmd) + { + case HAWK_SIO_CMD_OPEN: + { + switch (xtn->s.out.x->type) + { + #if defined(HAWK_OOCH_IS_BCH) + case HAWK_PARSESTD_FILE: + HAWK_ASSERT (moo, &xtn->s.out.x->u.fileb.path == &xtn->s.out.x->u.file.path); + HAWK_ASSERT (moo, &xtn->s.out.x->u.fileb.cmgr == &xtn->s.out.x->u.file.cmgr); + #endif + case HAWK_PARSESTD_FILEB: + if (xtn->s.out.x->u.fileb.path == HAWK_NULL || (xtn->s.out.x->u.fileb.path[0] == '-' && xtn->s.out.x->u.fileb.path[1] == '\0')) + { + /* no path name or - -> stdout */ + xtn->s.out.u.file.sio = open_sio_std(awk, HAWK_SIO_STDOUT, HAWK_SIO_WRITE | HAWK_SIO_IGNOREECERR | HAWK_SIO_LINEBREAK); + if (xtn->s.out.u.file.sio == HAWK_NULL) return -1; + } + else + { + #if defined(HAWK_OOCH_IS_UCH) + hawk_uch_t* upath; + upath = hawk_dupbtoucstr(awk, xtn->s.out.x->u.fileb.path, HAWK_NULL, 1); + if (!upath) return -1; + xtn->s.out.u.file.sio = open_sio(awk, upath, HAWK_SIO_WRITE | HAWK_SIO_CREATE | HAWK_SIO_TRUNCATE | HAWK_SIO_IGNOREECERR); + hawk_freemem (awk, upath); + #else + xtn->s.out.u.file.sio = open_sio(awk, xtn->s.out.x->u.fileb.path, HAWK_SIO_WRITE | HAWK_SIO_CREATE | HAWK_SIO_TRUNCATE | HAWK_SIO_IGNOREECERR); + #endif + if (xtn->s.out.u.file.sio == HAWK_NULL) return -1; + } + + if (xtn->s.out.x->u.fileb.cmgr) hawk_sio_setcmgr (xtn->s.out.u.file.sio, xtn->s.out.x->u.fileb.cmgr); + return 1; + + #if defined(HAWK_OOCH_IS_UCH) + case HAWK_PARSESTD_FILE: + HAWK_ASSERT (moo, &xtn->s.out.x->u.fileu.path == &xtn->s.out.x->u.file.path); + HAWK_ASSERT (moo, &xtn->s.out.x->u.fileu.cmgr == &xtn->s.out.x->u.file.cmgr); + #endif + case HAWK_PARSESTD_FILEU: + if (xtn->s.out.x->u.fileu.path == HAWK_NULL || (xtn->s.out.x->u.fileu.path[0] == '-' && xtn->s.out.x->u.fileu.path[1] == '\0')) + { + /* no path name or - -> stdout */ + xtn->s.out.u.file.sio = open_sio_std(awk, HAWK_SIO_STDOUT, HAWK_SIO_WRITE | HAWK_SIO_IGNOREECERR | HAWK_SIO_LINEBREAK); + if (xtn->s.out.u.file.sio == HAWK_NULL) return -1; + } + else + { + #if defined(HAWK_OOCH_IS_UCH) + xtn->s.out.u.file.sio = open_sio(awk, xtn->s.out.x->u.fileu.path, HAWK_SIO_WRITE | HAWK_SIO_CREATE | HAWK_SIO_TRUNCATE | HAWK_SIO_IGNOREECERR); + #else + hawk_bch_t* bpath; + bpath = hawk_duputobcstr(awk, xtn->s.out.x->u.fileu.path, HAWK_NULL); + if (!bpath) return -1; + xtn->s.out.u.file.sio = open_sio(awk, bpath, HAWK_SIO_WRITE | HAWK_SIO_CREATE | HAWK_SIO_TRUNCATE | HAWK_SIO_IGNOREECERR); + hawk_freemem (awk, bpath); + #endif + if (xtn->s.out.u.file.sio == HAWK_NULL) return -1; + } + + if (xtn->s.out.x->u.fileu.cmgr) hawk_sio_setcmgr (xtn->s.out.u.file.sio, xtn->s.out.x->u.fileu.cmgr); + return 1; + + case HAWK_PARSESTD_OOCS: + xtn->s.out.u.oocs.buf = hawk_ooecs_open(awk, 0, 512); + if (xtn->s.out.u.oocs.buf == HAWK_NULL) return -1; + return 1; + + case HAWK_PARSESTD_BCS: + xtn->s.out.u.bcs.buf = hawk_becs_open(awk, 0, 512); + if (xtn->s.out.u.bcs.buf == HAWK_NULL) return -1; + return 1; + + case HAWK_PARSESTD_UCS: + xtn->s.out.u.ucs.buf = hawk_uecs_open(awk, 0, 512); + if (xtn->s.out.u.ucs.buf == HAWK_NULL) return -1; + return 1; + } + + break; + } + + + case HAWK_SIO_CMD_CLOSE: + { + switch (xtn->s.out.x->type) + { + case HAWK_PARSESTD_FILE: + case HAWK_PARSESTD_FILEB: + case HAWK_PARSESTD_FILEU: + hawk_sio_close (xtn->s.out.u.file.sio); + return 0; + + case HAWK_PARSESTD_OOCS: + case HAWK_PARSESTD_BCS: + case HAWK_PARSESTD_UCS: + /* i don't close xtn->s.out.u.oocs.buf intentionally here. + * it will be closed at the end of hawk_parsestd() */ + return 0; + } + + break; + } + + case HAWK_SIO_CMD_WRITE: + { + switch (xtn->s.out.x->type) + { + case HAWK_PARSESTD_FILE: + case HAWK_PARSESTD_FILEB: + case HAWK_PARSESTD_FILEU: + { + hawk_ooi_t n; + HAWK_ASSERT (awk, xtn->s.out.u.file.sio != HAWK_NULL); + n = hawk_sio_putoochars(xtn->s.out.u.file.sio, data, size); + if (n <= -1) + { + hawk_oocs_t ea; + ea.ptr = (hawk_ooch_t*)xtn->s.out.x->u.file.path; + if (ea.ptr == HAWK_NULL) ea.ptr = sio_std_names[HAWK_SIO_STDOUT].ptr; + ea.len = hawk_count_oocstr(ea.ptr); + hawk_seterrnum (awk, HAWK_EWRITE, &ea); + } + return n; + } + + case HAWK_PARSESTD_OOCS: + parsestd_str: + if (size > HAWK_TYPE_MAX(hawk_ooi_t)) size = HAWK_TYPE_MAX(hawk_ooi_t); + if (hawk_ooecs_ncat(xtn->s.out.u.oocs.buf, data, size) == (hawk_oow_t)-1) + { + hawk_seterrnum (awk, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + return size; + + case HAWK_PARSESTD_BCS: + #if defined(HAWK_OOCH_IS_BCH) + goto parsestd_str; + #else + { + hawk_oow_t mbslen, wcslen; + hawk_oow_t orglen; + + wcslen = size; + if (hawk_convutobchars(awk, data, &wcslen, HAWK_NULL, &mbslen) <= -1) return -1; + if (mbslen > HAWK_TYPE_MAX(hawk_ooi_t)) mbslen = HAWK_TYPE_MAX(hawk_ooi_t); + + orglen = hawk_becs_getlen(xtn->s.out.u.bcs.buf); + if (hawk_becs_setlen(xtn->s.out.u.bcs.buf, orglen + mbslen) == (hawk_oow_t)-1) + { + hawk_seterrnum (awk, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + + wcslen = size; + hawk_convutobchars (awk, data, &wcslen, HAWK_BECS_CPTR(xtn->s.out.u.bcs.buf, orglen), &mbslen); + size = wcslen; + + return size; + } + #endif + + case HAWK_PARSESTD_UCS: + #if defined(HAWK_OOCH_IS_BCH) + { + hawk_oow_t mbslen, wcslen; + hawk_oow_t orglen; + + mbslen = size; + if (hawk_convbtouchars(awk, data, &mbslen, HAWK_NULL, &wcslen) <= -1) return -1; + if (wcslen > HAWK_TYPE_MAX(hawk_ooi_t)) wcslen = HAWK_TYPE_MAX(hawk_ooi_t); + + orglen = hawk_becs_getlen(xtn->s.out.u.ucs.buf); + if (hawk_uecs_setlen(xtn->s.out.u.ucs.buf, orglen + wcslen) == (hawk_oow_t)-1) + { + hawk_seterrnum (awk, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + + mbslen = size; + hawk_convbtouchars (awk, data, &mbslen, HAWK_UECS_CPTR(xtn->s.out.u.ucs.buf, orglen), &wcslen); + size = mbslen; + + return size; + } + #else + goto parsestd_str; + #endif + } + + break; + } + + default: + /* other code must not trigger this function */ + break; + } + + hawk_seterrnum (awk, HAWK_EINTERN, HAWK_NULL); + return -1; +} + +int hawk_parsestd (hawk_t* awk, hawk_parsestd_t in[], hawk_parsestd_t* out) +{ + hawk_sio_cbs_t sio; + xtn_t* xtn = GET_XTN(awk); + int n; + + if (in == HAWK_NULL || (in[0].type != HAWK_PARSESTD_FILE && + in[0].type != HAWK_PARSESTD_FILEB && + in[0].type != HAWK_PARSESTD_FILEU && + in[0].type != HAWK_PARSESTD_OOCS && + in[0].type != HAWK_PARSESTD_BCS && + in[0].type != HAWK_PARSESTD_UCS)) + { + /* the input is a must. at least 1 file or 1 string + * must be specified */ + hawk_seterrnum (awk, HAWK_EINVAL, HAWK_NULL); + return -1; + } + + sio.in = sf_in; + xtn->s.in.x = in; + + if (out == HAWK_NULL) sio.out = HAWK_NULL; + else + { + if (out->type != HAWK_PARSESTD_FILE && + out->type != HAWK_PARSESTD_FILEB && + out->type != HAWK_PARSESTD_FILEU && + out->type != HAWK_PARSESTD_OOCS && + out->type != HAWK_PARSESTD_BCS && + out->type != HAWK_PARSESTD_UCS) + { + hawk_seterrnum (awk, HAWK_EINVAL, HAWK_NULL); + return -1; + } + sio.out = sf_out; + xtn->s.out.x = out; + } + + n = hawk_parse(awk, &sio); + + if (out) + { + switch (out->type) + { + case HAWK_PARSESTD_OOCS: + if (n >= 0) + { + HAWK_ASSERT (awk, xtn->s.out.u.oocs.buf != HAWK_NULL); + hawk_ooecs_yield (xtn->s.out.u.oocs.buf, &out->u.oocs, 0); + } + if (xtn->s.out.u.oocs.buf) hawk_ooecs_close (xtn->s.out.u.oocs.buf); + break; + + case HAWK_PARSESTD_BCS: + if (n >= 0) + { + HAWK_ASSERT (awk, xtn->s.out.u.bcs.buf != HAWK_NULL); + hawk_becs_yield (xtn->s.out.u.bcs.buf, &out->u.bcs, 0); + } + if (xtn->s.out.u.bcs.buf) hawk_becs_close (xtn->s.out.u.bcs.buf); + break; + + case HAWK_PARSESTD_UCS: + if (n >= 0) + { + HAWK_ASSERT (awk, xtn->s.out.u.ucs.buf != HAWK_NULL); + hawk_uecs_yield (xtn->s.out.u.ucs.buf, &out->u.ucs, 0); + } + if (xtn->s.out.u.ucs.buf) hawk_uecs_close (xtn->s.out.u.ucs.buf); + break; + } + } + + return n; +} + +/*** RTX_OPENSTD ***/ + +#if defined(ENABLE_NWIO) +static hawk_ooi_t nwio_handler_open (hawk_rtx_t* rtx, hawk_rio_arg_t* riod, int flags, hawk_nwad_t* nwad, hawk_nwio_tmout_t* tmout) +{ + hawk_nwio_t* handle; + + handle = hawk_nwio_open ( + hawk_rtx_getmmgr(rtx), 0, nwad, + flags | HAWK_NWIO_TEXT | HAWK_NWIO_IGNOREECERR | + HAWK_NWIO_REUSEADDR | HAWK_NWIO_READNORETRY | HAWK_NWIO_WRITENORETRY, + tmout + ); + if (handle == HAWK_NULL) return -1; + +#if defined(HAWK_OOCH_IS_UCH) + { + hawk_cmgr_t* cmgr = hawk_rtx_getiocmgrstd(rtx, riod->name); + if (cmgr) hawk_nwio_setcmgr (handle, cmgr); + } +#endif + + riod->handle = (void*)handle; + riod->uflags = 1; /* nwio indicator */ + return 1; +} + +static hawk_ooi_t nwio_handler_rest (hawk_rtx_t* rtx, hawk_rio_cmd_t cmd, hawk_rio_arg_t* riod, void* data, hawk_oow_t size) +{ + switch (cmd) + { + case HAWK_RIO_CMD_OPEN: + hawk_rtx_seterrnum (rtx, HAWK_EINTERN, HAWK_NULL); + return -1; + + case HAWK_RIO_CMD_CLOSE: + hawk_nwio_close ((hawk_nwio_t*)riod->handle); + return 0; + + case HAWK_RIO_CMD_READ: + return hawk_nwio_read((hawk_nwio_t*)riod->handle, data, size); + + case HAWK_RIO_CMD_WRITE: + return hawk_nwio_write((hawk_nwio_t*)riod->handle, data, size); + + case HAWK_RIO_CMD_WRITE_BYTES: + return hawk_nwio_writebytes((hawk_nwio_t*)riod->handle, data, size); + + case HAWK_RIO_CMD_FLUSH: + /*if (riod->mode == HAWK_RIO_PIPE_READ) return -1;*/ + return hawk_nwio_flush((hawk_nwio_t*)riod->handle); + + case HAWK_RIO_CMD_NEXT: + break; + } + + hawk_rtx_seterrnum (rtx, HAWK_EINTERN, HAWK_NULL); + return -1; +} + +static int parse_rwpipe_uri (const hawk_ooch_t* uri, int* flags, hawk_nwad_t* nwad) +{ + static struct + { + const hawk_ooch_t* prefix; + hawk_oow_t len; + int flags; + } x[] = + { + { HAWK_T("tcp://"), 6, HAWK_NWIO_TCP }, + { HAWK_T("udp://"), 6, HAWK_NWIO_UDP }, + { HAWK_T("tcpd://"), 7, HAWK_NWIO_TCP | HAWK_NWIO_PASSIVE }, + { HAWK_T("udpd://"), 7, HAWK_NWIO_UDP | HAWK_NWIO_PASSIVE } + }; + int i; + + + for (i = 0; i < HAWK_COUNTOF(x); i++) + { + if (hawk_strzcmp (uri, x[i].prefix, x[i].len) == 0) + { + if (hawk_strtonwad (uri + x[i].len, nwad) <= -1) return -1; + *flags = x[i].flags; + return 0; + } + } + + return -1; +} +#endif + +static hawk_ooi_t pio_handler_open (hawk_rtx_t* rtx, hawk_rio_arg_t* riod) +{ + hawk_pio_t* handle; + int flags; + + if (riod->mode == HAWK_RIO_PIPE_READ) + { + /* TODO: should ERRTOOUT be unset? */ + flags = HAWK_PIO_READOUT | HAWK_PIO_ERRTOOUT; + } + else if (riod->mode == HAWK_RIO_PIPE_WRITE) + { + flags = HAWK_PIO_WRITEIN; + } + else if (riod->mode == HAWK_RIO_PIPE_RW) + { + flags = HAWK_PIO_READOUT | HAWK_PIO_ERRTOOUT | HAWK_PIO_WRITEIN; + } + else + { + /* this must not happen */ + hawk_rtx_seterrnum (rtx, HAWK_EINTERN, HAWK_NULL); + return -1; + } + + handle = hawk_pio_open ( + hawk_rtx_getawk(rtx), + 0, + riod->name, + flags | HAWK_PIO_SHELL | HAWK_PIO_TEXT | HAWK_PIO_IGNOREECERR + ); + if (handle == HAWK_NULL) return -1; + +#if defined(HAWK_OOCH_IS_UCH) + { + hawk_cmgr_t* cmgr = hawk_rtx_getiocmgrstd(rtx, riod->name); + if (cmgr) + { + hawk_pio_setcmgr (handle, HAWK_PIO_IN, cmgr); + hawk_pio_setcmgr (handle, HAWK_PIO_OUT, cmgr); + hawk_pio_setcmgr (handle, HAWK_PIO_ERR, cmgr); + } + } +#endif + + riod->handle = (void*)handle; + riod->uflags = 0; /* pio indicator */ + return 1; +} + +static hawk_ooi_t pio_handler_rest (hawk_rtx_t* rtx, hawk_rio_cmd_t cmd, hawk_rio_arg_t* riod, void* data, hawk_oow_t size) +{ + switch (cmd) + { + case HAWK_RIO_CMD_OPEN: + hawk_rtx_seterrnum (rtx, HAWK_EINTERN, HAWK_NULL); + return -1; + + case HAWK_RIO_CMD_CLOSE: + { + hawk_pio_t* pio = (hawk_pio_t*)riod->handle; + if (riod->mode == HAWK_RIO_PIPE_RW) + { + /* specialy treatment is needed for rwpipe. + * inspect rwcmode to see if partial closing is + * requested. */ + if (riod->rwcmode == HAWK_RIO_CMD_CLOSE_READ) + { + hawk_pio_end (pio, HAWK_PIO_IN); + return 0; + } + if (riod->rwcmode == HAWK_RIO_CMD_CLOSE_WRITE) + { + hawk_pio_end (pio, HAWK_PIO_OUT); + return 0; + } + } + + hawk_pio_close (pio); + return 0; + } + + case HAWK_RIO_CMD_READ: + return hawk_pio_read ((hawk_pio_t*)riod->handle, HAWK_PIO_OUT, data, size); + + case HAWK_RIO_CMD_WRITE: + return hawk_pio_write((hawk_pio_t*)riod->handle, HAWK_PIO_IN, data, size); + + case HAWK_RIO_CMD_WRITE_BYTES: + return hawk_pio_writebytes((hawk_pio_t*)riod->handle, HAWK_PIO_IN, data, size); + + case HAWK_RIO_CMD_FLUSH: + /*if (riod->mode == HAWK_RIO_PIPE_READ) return -1;*/ + return hawk_pio_flush ((hawk_pio_t*)riod->handle, HAWK_PIO_IN); + + case HAWK_RIO_CMD_NEXT: + break; + } + + hawk_rtx_seterrnum (rtx, HAWK_EINTERN, HAWK_NULL); + return -1; +} + +static hawk_ooi_t awk_rio_pipe (hawk_rtx_t* rtx, hawk_rio_cmd_t cmd, hawk_rio_arg_t* riod, void* data, hawk_oow_t size) +{ + if (cmd == HAWK_RIO_CMD_OPEN) + { + #if defined(ENABLE_NWIO) + int flags; + hawk_nwad_t nwad; + + if (riod->mode != HAWK_RIO_PIPE_RW || + parse_rwpipe_uri(riod->name, &flags, &nwad) <= -1) + { + return pio_handler_open (rtx, riod); + } + else + { + hawk_nwio_tmout_t tmout_buf; + hawk_nwio_tmout_t* tmout = HAWK_NULL; + ioattr_t* ioattr; + rxtn_t* rxtn; + + rxtn = GET_RXTN(rtx); + + ioattr = get_ioattr(&rxtn->cmgrtab, riod->name, hawk_count_oocstr(riod->name)); + if (ioattr) + { + tmout = &tmout_buf; + tmout->r = ioattr->tmout[0]; + tmout->w = ioattr->tmout[1]; + tmout->c = ioattr->tmout[2]; + tmout->a = ioattr->tmout[3]; + } + + return nwio_handler_open(rtx, riod, flags, &nwad, tmout); + } + #else + return pio_handler_open (rtx, riod); + #endif + } + #if defined(ENABLE_NWIO) + else if (riod->uflags > 0) + return nwio_handler_rest(rtx, cmd, riod, data, size); + #endif + else + return pio_handler_rest(rtx, cmd, riod, data, size); +} + +static hawk_ooi_t awk_rio_file (hawk_rtx_t* rtx, hawk_rio_cmd_t cmd, hawk_rio_arg_t* riod, void* data, hawk_oow_t size) +{ + switch (cmd) + { + case HAWK_RIO_CMD_OPEN: + { + hawk_sio_t* handle; + int flags = HAWK_SIO_IGNOREECERR; + + switch (riod->mode) + { + case HAWK_RIO_FILE_READ: + flags |= HAWK_SIO_READ; + break; + case HAWK_RIO_FILE_WRITE: + flags |= HAWK_SIO_WRITE | HAWK_SIO_CREATE | HAWK_SIO_TRUNCATE; + break; + case HAWK_RIO_FILE_APPEND: + flags |= HAWK_SIO_APPEND | HAWK_SIO_CREATE; + break; + default: + /* this must not happen */ + hawk_rtx_seterrnum (rtx, HAWK_EINTERN, HAWK_NULL); + return -1; + } + + handle = hawk_sio_open(hawk_rtx_getawk(rtx), 0, riod->name, flags); + if (handle == HAWK_NULL) + { + hawk_oocs_t errarg; + errarg.ptr = riod->name; + errarg.len = hawk_count_oocstr(riod->name); + hawk_rtx_seterrnum (rtx, HAWK_EOPEN, &errarg); + return -1; + } + + #if defined(HAWK_OOCH_IS_UCH) + { + hawk_cmgr_t* cmgr = hawk_rtx_getiocmgrstd(rtx, riod->name); + if (cmgr) hawk_sio_setcmgr(handle, cmgr); + } + #endif + + riod->handle = (void*)handle; + return 1; + } + + case HAWK_RIO_CMD_CLOSE: + hawk_sio_close ((hawk_sio_t*)riod->handle); + riod->handle = HAWK_NULL; + return 0; + + case HAWK_RIO_CMD_READ: + return hawk_sio_getoochars((hawk_sio_t*)riod->handle, data, size); + + case HAWK_RIO_CMD_WRITE: + return hawk_sio_putoochars((hawk_sio_t*)riod->handle, data, size); + + case HAWK_RIO_CMD_WRITE_BYTES: + return hawk_sio_putbchars((hawk_sio_t*)riod->handle, data, size); + + case HAWK_RIO_CMD_FLUSH: + return hawk_sio_flush((hawk_sio_t*)riod->handle); + + case HAWK_RIO_CMD_NEXT: + return -1; + } + + return -1; +} + +static int open_rio_console (hawk_rtx_t* rtx, hawk_rio_arg_t* riod) +{ + rxtn_t* rxtn = GET_RXTN(rtx); + hawk_sio_t* sio; + + if (riod->mode == HAWK_RIO_CONSOLE_READ) + { + xtn_t* xtn = (xtn_t*)GET_XTN(rtx->awk); + + if (rxtn->c.in.files == HAWK_NULL) + { + /* if no input files is specified, + * open the standard input */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), rxtn->c.in.index == 0); + + if (rxtn->c.in.count == 0) + { + sio = open_sio_std_rtx ( + rtx, HAWK_SIO_STDIN, + HAWK_SIO_READ | HAWK_SIO_IGNOREECERR + ); + if (sio == HAWK_NULL) return -1; + + if (rxtn->c.cmgr) hawk_sio_setcmgr (sio, rxtn->c.cmgr); + + riod->handle = sio; + rxtn->c.in.count++; + return 1; + } + + return 0; + } + else + { + /* a temporary variable sio is used here not to change + * any fields of riod when the open operation fails */ + const hawk_ooch_t* file; + hawk_val_t* argv; + hawk_htb_t* map; + hawk_htb_pair_t* pair; + hawk_ooch_t ibuf[128]; + hawk_oow_t ibuflen; + hawk_val_t* v; + hawk_oocs_t as; + + nextfile: + file = rxtn->c.in.files[rxtn->c.in.index]; + + if (file == HAWK_NULL) + { + /* no more input file */ + + if (rxtn->c.in.count == 0) + { + /* all ARGVs are empty strings. + * so no console files were opened. + * open the standard input here. + * + * 'BEGIN { ARGV[1]=""; ARGV[2]=""; } + * { print $0; }' file1 file2 + */ + sio = open_sio_std_rtx ( + rtx, HAWK_SIO_STDIN, + HAWK_SIO_READ | HAWK_SIO_IGNOREECERR + ); + if (sio == HAWK_NULL) return -1; + + if (rxtn->c.cmgr) hawk_sio_setcmgr (sio, rxtn->c.cmgr); + + riod->handle = sio; + rxtn->c.in.count++; + return 1; + } + + return 0; + } + + /* handle special case when ARGV[x] has been altered. + * so from here down, the file name gotten from + * rxtn->c.in.files is not important and is overridden + * from ARGV. + * 'BEGIN { ARGV[1]="file3"; } + * { print $0; }' file1 file2 + */ + argv = hawk_rtx_getgbl(rtx, xtn->gbl_argv); + HAWK_ASSERT (hawk_rtx_getawk(rtx), argv != HAWK_NULL); + HAWK_ASSERT (hawk_rtx_getawk(rtx), HAWK_RTX_GETVALTYPE (rtx, argv) == HAWK_VAL_MAP); + + map = ((hawk_val_map_t*)argv)->map; + HAWK_ASSERT (hawk_rtx_getawk(rtx), map != HAWK_NULL); + + ibuflen = hawk_int_to_oocstr (rxtn->c.in.index + 1, 10, HAWK_NULL, ibuf, HAWK_COUNTOF(ibuf)); + + pair = hawk_htb_search(map, ibuf, ibuflen); + HAWK_ASSERT (hawk_rtx_getawk(rtx), pair != HAWK_NULL); + + v = HAWK_HTB_VPTR(pair); + HAWK_ASSERT (hawk_rtx_getawk(rtx), v != HAWK_NULL); + + as.ptr = hawk_rtx_getvaloocstr(rtx, v, &as.len); + if (as.ptr == HAWK_NULL) return -1; + + if (as.len == 0) + { + /* the name is empty */ + hawk_rtx_freevaloocstr (rtx, v, as.ptr); + rxtn->c.in.index++; + goto nextfile; + } + + if (hawk_count_oocstr(as.ptr) < as.len) + { + /* the name contains one or more '\0' */ + hawk_oocs_t errarg; + + errarg.ptr = as.ptr; + /* use this length not to contains '\0' + * in an error message */ + errarg.len = hawk_count_oocstr(as.ptr); + + hawk_rtx_seterrnum (rtx, HAWK_EIONMNL, &errarg); + + hawk_rtx_freevaloocstr (rtx, v, as.ptr); + return -1; + } + + file = as.ptr; + + sio = (file[0] == HAWK_T('-') && file[1] == HAWK_T('\0'))? + open_sio_std_rtx (rtx, HAWK_SIO_STDIN, + HAWK_SIO_READ | HAWK_SIO_IGNOREECERR): + open_sio_rtx (rtx, file, + HAWK_SIO_READ | HAWK_SIO_IGNOREECERR); + if (sio == HAWK_NULL) + { + hawk_rtx_freevaloocstr (rtx, v, as.ptr); + return -1; + } + + if (rxtn->c.cmgr) hawk_sio_setcmgr (sio, rxtn->c.cmgr); + + if (hawk_rtx_setfilename ( + rtx, file, hawk_count_oocstr(file)) <= -1) + { + hawk_sio_close (sio); + hawk_rtx_freevaloocstr (rtx, v, as.ptr); + return -1; + } + + hawk_rtx_freevaloocstr (rtx, v, as.ptr); + riod->handle = sio; + + /* increment the counter of files successfully opened */ + rxtn->c.in.count++; + rxtn->c.in.index++; + return 1; + } + + } + else if (riod->mode == HAWK_RIO_CONSOLE_WRITE) + { + if (rxtn->c.out.files == HAWK_NULL) + { + HAWK_ASSERT (hawk_rtx_getawk(rtx), rxtn->c.out.index == 0); + + if (rxtn->c.out.count == 0) + { + sio = open_sio_std_rtx ( + rtx, HAWK_SIO_STDOUT, + HAWK_SIO_WRITE | HAWK_SIO_IGNOREECERR | HAWK_SIO_LINEBREAK + ); + if (sio == HAWK_NULL) return -1; + + if (rxtn->c.cmgr) hawk_sio_setcmgr (sio, rxtn->c.cmgr); + + riod->handle = sio; + rxtn->c.out.count++; + return 1; + } + + return 0; + } + else + { + /* a temporary variable sio is used here not to change + * any fields of riod when the open operation fails */ + hawk_sio_t* sio; + const hawk_ooch_t* file; + + file = rxtn->c.out.files[rxtn->c.out.index]; + + if (file == HAWK_NULL) + { + /* no more input file */ + return 0; + } + + sio = (file[0] == HAWK_T('-') && file[1] == HAWK_T('\0'))? + open_sio_std_rtx ( + rtx, HAWK_SIO_STDOUT, + HAWK_SIO_WRITE | HAWK_SIO_IGNOREECERR | HAWK_SIO_LINEBREAK): + open_sio_rtx ( + rtx, file, + HAWK_SIO_WRITE | HAWK_SIO_CREATE | + HAWK_SIO_TRUNCATE | HAWK_SIO_IGNOREECERR); + if (sio == HAWK_NULL) return -1; + + if (rxtn->c.cmgr) hawk_sio_setcmgr (sio, rxtn->c.cmgr); + + if (hawk_rtx_setofilename ( + rtx, file, hawk_count_oocstr(file)) <= -1) + { + hawk_sio_close (sio); + return -1; + } + + riod->handle = sio; + rxtn->c.out.index++; + rxtn->c.out.count++; + return 1; + } + + } + + return -1; +} + +static hawk_ooi_t awk_rio_console (hawk_rtx_t* rtx, hawk_rio_cmd_t cmd, hawk_rio_arg_t* riod, void* data, hawk_oow_t size) +{ + switch (cmd) + { + case HAWK_RIO_CMD_OPEN: + return open_rio_console (rtx, riod); + + case HAWK_RIO_CMD_CLOSE: + if (riod->handle) hawk_sio_close ((hawk_sio_t*)riod->handle); + return 0; + + case HAWK_RIO_CMD_READ: + { + hawk_ooi_t nn; + + while ((nn = hawk_sio_getoochars((hawk_sio_t*)riod->handle, data, size)) == 0) + { + int n; + hawk_sio_t* sio = (hawk_sio_t*)riod->handle; + + n = open_rio_console(rtx, riod); + if (n <= -1) return -1; + + if (n == 0) + { + /* no more input console */ + return 0; + } + + if (sio) hawk_sio_close (sio); + } + + return nn; + } + + case HAWK_RIO_CMD_WRITE: + return hawk_sio_putoochars((hawk_sio_t*)riod->handle, data, size); + + case HAWK_RIO_CMD_WRITE_BYTES: + return hawk_sio_putbchars((hawk_sio_t*)riod->handle, data, size); + + case HAWK_RIO_CMD_FLUSH: + return hawk_sio_flush((hawk_sio_t*)riod->handle); + + case HAWK_RIO_CMD_NEXT: + { + int n; + hawk_sio_t* sio = (hawk_sio_t*)riod->handle; + + n = open_rio_console (rtx, riod); + if (n <= -1) return -1; + + if (n == 0) + { + /* if there is no more file, keep the previous handle */ + return 0; + } + + if (sio) hawk_sio_close (sio); + return n; + } + + } + + hawk_rtx_seterrnum (rtx, HAWK_EINTERN, HAWK_NULL); + return -1; +} + +static void fini_rxtn (hawk_rtx_t* rtx) +{ + rxtn_t* rxtn = GET_RXTN(rtx); + /*xtn_t* xtn = (xtn_t*)GET_XTN(rtx->awk);*/ + + if (rxtn->cmgrtab_inited) + { + hawk_htb_fini (&rxtn->cmgrtab); + rxtn->cmgrtab_inited = 0; + } +} + +static int build_argcv ( + hawk_rtx_t* rtx, int argc_id, int argv_id, + const hawk_ooch_t* id, const hawk_ooch_t*const icf[]) +{ + const hawk_ooch_t*const* p; + hawk_oow_t argc; + hawk_val_t* v_argc; + hawk_val_t* v_argv; + hawk_val_t* v_tmp; + hawk_ooch_t key[HAWK_SIZEOF(hawk_int_t)*8+2]; + hawk_oow_t key_len; + + v_argv = hawk_rtx_makemapval (rtx); + if (v_argv == HAWK_NULL) return -1; + + hawk_rtx_refupval (rtx, v_argv); + + /* make ARGV[0] */ + v_tmp = hawk_rtx_makestrvalwithoocstr (rtx, id); + if (v_tmp == HAWK_NULL) + { + hawk_rtx_refdownval (rtx, v_argv); + return -1; + } + + /* increment reference count of v_tmp in advance as if + * it has successfully been assigned into ARGV. */ + hawk_rtx_refupval (rtx, v_tmp); + + key_len = hawk_copy_oocstr(key, HAWK_COUNTOF(key), HAWK_T("0")); + if (hawk_htb_upsert ( + ((hawk_val_map_t*)v_argv)->map, + key, key_len, v_tmp, 0) == HAWK_NULL) + { + /* if the assignment operation fails, decrements + * the reference of v_tmp to free it */ + hawk_rtx_refdownval (rtx, v_tmp); + + /* the values previously assigned into the + * map will be freeed when v_argv is freed */ + hawk_rtx_refdownval (rtx, v_argv); + + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + + if (icf) + { + for (argc = 1, p = icf; *p; p++, argc++) + { + /* the argument must compose a numeric string if it can be. + * so call hawk_rtx_makenstrvalwithoocstr() instead of + * hawk_rtx_makestrvalwithoocstr(). */ + v_tmp = hawk_rtx_makenstrvalwithoocstr (rtx, *p); + if (v_tmp == HAWK_NULL) + { + hawk_rtx_refdownval (rtx, v_argv); + return -1; + } + + key_len = hawk_int_to_oocstr (argc, 10, HAWK_NULL, key, HAWK_COUNTOF(key)); + HAWK_ASSERT (hawk_rtx_getawk(rtx), key_len != (hawk_oow_t)-1); + + hawk_rtx_refupval (rtx, v_tmp); + + if (hawk_htb_upsert ( + ((hawk_val_map_t*)v_argv)->map, + key, key_len, v_tmp, 0) == HAWK_NULL) + { + hawk_rtx_refdownval (rtx, v_tmp); + hawk_rtx_refdownval (rtx, v_argv); + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + } + } + else argc = 1; + + v_argc = hawk_rtx_makeintval(rtx, (hawk_int_t)argc); + if (v_argc == HAWK_NULL) + { + hawk_rtx_refdownval (rtx, v_argv); + return -1; + } + + hawk_rtx_refupval (rtx, v_argc); + + if (hawk_rtx_setgbl(rtx, argc_id, v_argc) <= -1) + { + hawk_rtx_refdownval (rtx, v_argc); + hawk_rtx_refdownval (rtx, v_argv); + return -1; + } + + if (hawk_rtx_setgbl(rtx, argv_id, v_argv) <= -1) + { + hawk_rtx_refdownval (rtx, v_argc); + hawk_rtx_refdownval (rtx, v_argv); + return -1; + } + + hawk_rtx_refdownval (rtx, v_argc); + hawk_rtx_refdownval (rtx, v_argv); + + return 0; +} + +/* TODO: use wenviron where it's available */ +typedef hawk_bch_t env_char_t; +#define ENV_CHAR_IS_BCH +extern char **environ; + +static int build_environ (hawk_rtx_t* rtx, int gbl_id, env_char_t* envarr[]) +{ + hawk_val_t* v_env; + hawk_val_t* v_tmp; + + v_env = hawk_rtx_makemapval (rtx); + if (v_env == HAWK_NULL) return -1; + + hawk_rtx_refupval (rtx, v_env); + + if (envarr) + { + env_char_t* eq; + hawk_ooch_t* kptr, * vptr; + hawk_oow_t klen, count; + + for (count = 0; envarr[count]; count++) + { + #if ((defined(ENV_CHAR_IS_BCH) && defined(HAWK_OOCH_IS_BCH)) || \ + (defined(ENV_CHAR_IS_UCH) && defined(HAWK_OOCH_IS_UCH))) + eq = hawk_find_oochar_in_oocstr(envarr[count], HAWK_T('=')); + if (eq == HAWK_NULL || eq == envarr[count]) continue; + + kptr = envarr[count]; + klen = eq - envarr[count]; + vptr = eq + 1; + #elif defined(ENV_CHAR_IS_BCH) + eq = hawk_find_bchar_in_bcstr(envarr[count], HAWK_BT('=')); + if (eq == HAWK_NULL || eq == envarr[count]) continue; + + *eq = HAWK_BT('\0'); + + /* dupbtoucstr() may fail for invalid encoding. as the environment + * variaables are not under control, call mbstowcsalldup() instead + * to go on despite encoding failure */ + + kptr = hawk_dupbtoucstr(hawk_rtx_getawk(rtx), envarr[count], &klen, 1); + vptr = hawk_dupbtoucstr(hawk_rtx_getawk(rtx), eq + 1, HAWK_NULL, 1); + if (kptr == HAWK_NULL || vptr == HAWK_NULL) + { + if (kptr) hawk_rtx_freemem (rtx, kptr); + if (vptr) hawk_rtx_freemem (rtx, vptr); + hawk_rtx_refdownval (rtx, v_env); + + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + + *eq = HAWK_BT('='); + #else + eq = hawk_find_uchar_in_ucstr(envarr[count], HAWK_UT('=')); + if (eq == HAWK_NULL || eq == envarr[count]) continue; + + *eq = HAWK_UT('\0'); + + kptr = hawk_duputobcstr(hawk_rtx_getawk(rtx), envarr[count], &klen); + vptr = hawk_duputobcstr(hawk_rtx_getawk(rtx), eq + 1, HAWK_NULL); + if (kptr == HAWK_NULL || vptr == HAWK_NULL) + { + if (kptr) hawk_rtx_freemem (rtx, kptr); + if (vptr) hawk_rtx_freeme (rtx, vptr): + hawk_rtx_refdownval (rtx, v_env); + + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + + *eq = HAWK_UT('='); + #endif + + /* the string in ENVIRON should be a numeric string if + * it can be converted to a number. call makenstrval() + * instead of makestrval() */ + v_tmp = hawk_rtx_makenstrvalwithoocstr(rtx, vptr); + if (v_tmp == HAWK_NULL) + { + #if ((defined(ENV_CHAR_IS_BCH) && defined(HAWK_OOCH_IS_BCH)) || \ + (defined(ENV_CHAR_IS_UCH) && defined(HAWK_OOCH_IS_UCH))) + /* nothing to do */ + #else + if (vptr) hawk_rtx_freemem (rtx, vptr); + if (kptr) hawk_rtx_freemem (rtx, kptr); + #endif + hawk_rtx_refdownval (rtx, v_env); + return -1; + } + + /* increment reference count of v_tmp in advance as if + * it has successfully been assigned into ARGV. */ + hawk_rtx_refupval (rtx, v_tmp); + + if (hawk_htb_upsert(((hawk_val_map_t*)v_env)->map, kptr, klen, v_tmp, 0) == HAWK_NULL) + { + /* if the assignment operation fails, decrements + * the reference of v_tmp to free it */ + hawk_rtx_refdownval (rtx, v_tmp); + + #if ((defined(ENV_CHAR_IS_BCH) && defined(HAWK_OOCH_IS_BCH)) || \ + (defined(ENV_CHAR_IS_UCH) && defined(HAWK_OOCH_IS_UCH))) + /* nothing to do */ + #else + if (vptr) hawk_rtx_freemem (rtx, vptr); + if (kptr) hawk_rtx_freemem (rtx, kptr); + #endif + + /* the values previously assigned into the + * map will be freeed when v_env is freed */ + hawk_rtx_refdownval (rtx, v_env); + + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + + #if ((defined(ENV_CHAR_IS_BCH) && defined(HAWK_OOCH_IS_BCH)) || \ + (defined(ENV_CHAR_IS_UCH) && defined(HAWK_OOCH_IS_UCH))) + /* nothing to do */ + #else + if (vptr) hawk_rtx_freemem (rtx, vptr); + if (kptr) hawk_rtx_freemem (rtx, kptr); + #endif + } + } + + if (hawk_rtx_setgbl (rtx, gbl_id, v_env) == -1) + { + hawk_rtx_refdownval (rtx, v_env); + return -1; + } + + hawk_rtx_refdownval (rtx, v_env); + return 0; +} + +static int make_additional_globals (hawk_rtx_t* rtx, xtn_t* xtn, const hawk_ooch_t* id, const hawk_ooch_t*const icf[]) +{ + if (build_argcv (rtx, xtn->gbl_argc, xtn->gbl_argv, id, icf) <= -1 || + build_environ (rtx, xtn->gbl_environ, environ) <= -1) return -1; + return 0; +} + +static hawk_rtx_t* open_rtx_std ( + hawk_t* awk, + hawk_oow_t xtnsize, + const hawk_ooch_t* id, + const hawk_ooch_t* icf[], + const hawk_ooch_t* ocf[], + hawk_cmgr_t* cmgr) +{ + hawk_rtx_t* rtx; + hawk_rio_cbs_t rio; + rxtn_t* rxtn; + xtn_t* xtn; + + xtn = GET_XTN(awk); + + rio.pipe = awk_rio_pipe; + rio.file = awk_rio_file; + rio.console = awk_rio_console; + + rtx = hawk_rtx_open(awk, HAWK_SIZEOF(rxtn_t) + xtnsize, &rio); + if (!rtx) return HAWK_NULL; + + rtx->_instsize += HAWK_SIZEOF(rxtn_t); + + rxtn = GET_RXTN(rtx); + + if (rtx->awk->opt.trait & HAWK_RIO) + { + if (hawk_htb_init(&rxtn->cmgrtab, awk, 256, 70, HAWK_SIZEOF(hawk_ooch_t), 1) <= -1) + { + hawk_rtx_close (rtx); + hawk_seterrnum (awk, HAWK_ENOMEM, HAWK_NULL); + return HAWK_NULL; + } + hawk_htb_setstyle (&rxtn->cmgrtab, hawk_get_htb_style(HAWK_HTB_STYLE_INLINE_COPIERS)); + rxtn->cmgrtab_inited = 1; + } + + rxtn->ecb.close = fini_rxtn; + hawk_rtx_pushecb (rtx, &rxtn->ecb); + + rxtn->c.in.files = icf; + rxtn->c.in.index = 0; + rxtn->c.in.count = 0; + rxtn->c.out.files = ocf; + rxtn->c.out.index = 0; + rxtn->c.out.count = 0; + rxtn->c.cmgr = cmgr; + + /* FILENAME can be set when the input console is opened. + * so we skip setting it here even if an explicit console file + * is specified. So the value of FILENAME is empty in the + * BEGIN block unless getline is ever met. + * + * However, OFILENAME is different. The output + * console is treated as if it's already open upon start-up. + * otherwise, 'BEGIN { print OFILENAME; }' prints an empty + * string regardless of output console files specified. + * That's because OFILENAME is evaluated before the output + * console file is opened. + */ + if (ocf && ocf[0]) + { + if (hawk_rtx_setofilename(rtx, ocf[0], hawk_count_oocstr(ocf[0])) <= -1) + { + hawk_rtx_errortohawk (rtx, awk); + hawk_rtx_close (rtx); + return HAWK_NULL; + } + } + + if (make_additional_globals(rtx, xtn, id, icf) <= -1) + { + hawk_rtx_errortohawk (rtx, awk); + hawk_rtx_close (rtx); + return HAWK_NULL; + } + + return rtx; +} + +hawk_rtx_t* hawk_rtx_openstdwithbcstr ( + hawk_t* awk, + hawk_oow_t xtnsize, + const hawk_bch_t* id, + const hawk_bch_t* icf[], + const hawk_bch_t* ocf[], + hawk_cmgr_t* cmgr) +{ +#if defined(HAWK_OOCH_IS_BCH) + return open_rtx_std(awk, xtnsize, id, icf, ocf, cmgr); +#else + hawk_rtx_t* rtx = HAWK_NULL; + hawk_oow_t wcslen, i; + hawk_uch_t* wid = HAWK_NULL, ** wicf = HAWK_NULL, ** wocf = HAWK_NULL; + + wid = hawk_dupbtoucstr(awk, id, &wcslen, 0); + if (!wid) return HAWK_NULL; + + if (icf) + { + for (i = 0; icf[i]; i++) ; + + wicf = (hawk_uch_t**)hawk_callocmem(awk, HAWK_SIZEOF(*wicf) * (i + 1)); + if (!wicf) goto done; + + for (i = 0; icf[i]; i++) + { + wicf[i] = hawk_dupbtoucstr(awk, icf[i], &wcslen, 0); + if (!wicf[i]) goto done; + } + wicf[i] = HAWK_NULL; + } + + if (ocf) + { + for (i = 0; ocf[i]; i++) ; + + wocf = (hawk_uch_t**)hawk_callocmem(awk, HAWK_SIZEOF(*wocf) * (i + 1)); + if (!wocf) goto done; + + for (i = 0; ocf[i]; i++) + { + wocf[i] = hawk_dupbtoucstr(awk, ocf[i], &wcslen, 0); + if (!wocf[i]) goto done; + } + wocf[i] = HAWK_NULL; + } + + rtx = open_rtx_std(awk, xtnsize, wid, (const hawk_uch_t**)wicf, (const hawk_uch_t**)wocf, cmgr); + +done: + if (wocf) + { + for (i = 0; wocf[i]; i++) hawk_freemem (awk, wocf[i]); + hawk_freemem (awk, wocf); + } + if (wicf) + { + for (i = 0; wicf[i]; i++) hawk_freemem (awk, wicf[i]); + hawk_freemem (awk, wicf); + } + if (wid) hawk_freemem (awk, wid); + + return rtx; +#endif +} + +hawk_rtx_t* hawk_rtx_openstdwithucstr ( + hawk_t* awk, + hawk_oow_t xtnsize, + const hawk_uch_t* id, + const hawk_uch_t* icf[], + const hawk_uch_t* ocf[], + hawk_cmgr_t* cmgr) +{ +#if defined(HAWK_OOCH_IS_BCH) + hawk_rtx_t* rtx = HAWK_NULL; + hawk_oow_t mbslen, i; + hawk_bch_t* mid = HAWK_NULL, ** micf = HAWK_NULL, ** mocf = HAWK_NULL; + + mid = hawk_duputobcstr(awk, id, &mbslen); + if (!mid) return HAWK_NULL; + + if (icf) + { + for (i = 0; icf[i]; i++) ; + + micf = (hawk_bch_t**)hawk_callocmem(awk, HAWK_SIZEOF(*micf) * (i + 1)); + if (!micf) goto done; + + for (i = 0; icf[i]; i++) + { + micf[i] = hawk_duputobcstr(awk, icf[i], &mbslen); + if (!micf[i]) goto done; + } + micf[i] = HAWK_NULL; + } + + if (ocf) + { + for (i = 0; ocf[i]; i++) ; + + mocf = (hawk_uch_t**)hawk_callocmem(awk, HAWK_SIZEOF(*mocf) * (i + 1)); + if (!mocf) goto done; + + for (i = 0; ocf[i]; i++) + { + mocf[i] = hawk_dupbtoucstr(awk, ocf[i], &mbslen); + if (!mocf[i]) goto done; + } + mocf[i] = HAWK_NULL; + } + + rtx = open_rtx_std(awk, xtnsize, mid, (const hawk_bch_t**)micf, (const hawk_bch_t**)mocf, cmgr); + +done: + if (mocf) + { + for (i = 0; mocf[i]; i++) hawk_freemem (awk, mocf[i]); + hawk_freemem (awk, mocf); + } + if (micf) + { + for (i = 0; micf[i]; i++) hawk_freemem (awk, micf[i]); + hawk_freemem (awk, micf); + } + if (mid) hawk_freemem (awk, mid); + + return rtx; +#else + return open_rtx_std(awk, xtnsize, id, icf, ocf, cmgr); +#endif +} + +static int timeout_code (const hawk_ooch_t* name) +{ + if (hawk_comp_oocstr(name, HAWK_T("rtimeout"), 1) == 0) return 0; + if (hawk_comp_oocstr(name, HAWK_T("wtimeout"), 1) == 0) return 1; + if (hawk_comp_oocstr(name, HAWK_T("ctimeout"), 1) == 0) return 2; + if (hawk_comp_oocstr(name, HAWK_T("atimeout"), 1) == 0) return 3; + return -1; +} + +static HAWK_INLINE void init_ioattr (ioattr_t* ioattr) +{ + int i; + HAWK_MEMSET (ioattr, 0, HAWK_SIZEOF(*ioattr)); + for (i = 0; i < HAWK_COUNTOF(ioattr->tmout); i++) + { + /* a negative number for no timeout */ + ioattr->tmout[i].sec = -999; + ioattr->tmout[i].nsec = 0; + } +} + +static ioattr_t* get_ioattr ( + hawk_htb_t* tab, const hawk_ooch_t* ptr, hawk_oow_t len) +{ + hawk_htb_pair_t* pair; + + pair = hawk_htb_search (tab, ptr, len); + if (pair) return HAWK_HTB_VPTR(pair); + + return HAWK_NULL; +} + +static ioattr_t* find_or_make_ioattr ( + hawk_rtx_t* rtx, hawk_htb_t* tab, const hawk_ooch_t* ptr, hawk_oow_t len) +{ + hawk_htb_pair_t* pair; + + pair = hawk_htb_search (tab, ptr, len); + if (pair == HAWK_NULL) + { + ioattr_t ioattr; + + init_ioattr (&ioattr); + + pair = hawk_htb_insert (tab, (void*)ptr, len, (void*)&ioattr, HAWK_SIZEOF(ioattr)); + if (pair == HAWK_NULL) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + } + } + + return (ioattr_t*)HAWK_HTB_VPTR(pair); +} + +static int fnc_setioattr (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + rxtn_t* rxtn; + hawk_val_t* v[3]; + hawk_ooch_t* ptr[3]; + hawk_oow_t len[3]; + int i, ret = 0, fret = 0; + int tmout; + + rxtn = GET_RXTN(rtx); + HAWK_ASSERT (hawk_rtx_getawk(rtx), rxtn->cmgrtab_inited == 1); + + for (i = 0; i < 3; i++) + { + v[i] = hawk_rtx_getarg (rtx, i); + ptr[i] = hawk_rtx_getvaloocstr (rtx, v[i], &len[i]); + if (ptr[i] == HAWK_NULL) + { + ret = -1; + goto done; + } + + if (hawk_find_oochar(ptr[i], len[i], HAWK_T('\0'))) + { + fret = -1; + goto done; + } + } + + if ((tmout = timeout_code (ptr[1])) >= 0) + { + ioattr_t* ioattr; + + hawk_int_t l; + hawk_flt_t r; + int x; + + /* no error is returned by hawk_rtx_strnum() if the strict option + * of the second parameter is 0. so i don't check for an error */ + x = hawk_rtx_oocharstonum(rtx, HAWK_RTX_OOCSTRTONUM_MAKE_OPTION(0, 0), ptr[2], len[2], &l, &r); + if (x == 0) r = (hawk_flt_t)l; + + ioattr = find_or_make_ioattr(rtx, &rxtn->cmgrtab, ptr[0], len[0]); + if (ioattr == HAWK_NULL) + { + ret = -1; + goto done; + } + + if (x == 0) + { + ioattr->tmout[tmout].sec = l; + ioattr->tmout[tmout].nsec = 0; + } + else if (x >= 1) + { + hawk_flt_t nsec; + ioattr->tmout[tmout].sec = (hawk_int_t)r; + nsec = r - ioattr->tmout[tmout].sec; + ioattr->tmout[tmout].nsec = HAWK_SEC_TO_NSEC(nsec); + } + } +#if defined(HAWK_OOCH_IS_UCH) + else if (hawk_comp_oocstr(ptr[1], HAWK_T("codepage"), 1) == 0 || + hawk_comp_oocstr(ptr[1], HAWK_T("encoding"), 1) == 0) + { + ioattr_t* ioattr; + hawk_cmgr_t* cmgr; + + if (ptr[2][0] == HAWK_T('\0')) + { + cmgr = HAWK_NULL; + } + else + { + cmgr = hawk_get_cmgr_by_name(ptr[2]); + if (cmgr == HAWK_NULL) + { + fret = -1; + goto done; + } + } + + ioattr = find_or_make_ioattr(rtx, &rxtn->cmgrtab, ptr[0], len[0]); + if (ioattr == HAWK_NULL) + { + ret = -1; + goto done; + } + + ioattr->cmgr = cmgr; + hawk_copy_oocstr (ioattr->cmgr_name, HAWK_COUNTOF(ioattr->cmgr_name), ptr[2]); + } +#endif + else + { + /* unknown attribute name */ + fret = -1; + goto done; + } + +done: + while (i > 0) + { + i--; + hawk_rtx_freevaloocstr (rtx, v[i], ptr[i]); + } + + if (ret >= 0) + { + v[0] = hawk_rtx_makeintval (rtx, (hawk_int_t)fret); + if (v[0] == HAWK_NULL) return -1; + hawk_rtx_setretval (rtx, v[0]); + } + + return ret; +} + +static int fnc_getioattr (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi) +{ + rxtn_t* rxtn; + hawk_val_t* v[2]; + hawk_ooch_t* ptr[2]; + hawk_oow_t len[2]; + int i, ret = 0; + int tmout; + hawk_val_t* rv = HAWK_NULL; + + ioattr_t* ioattr; + ioattr_t ioattr_buf; + + rxtn = GET_RXTN(rtx); + HAWK_ASSERT (hawk_rtx_getawk(rtx), rxtn->cmgrtab_inited == 1); + + for (i = 0; i < 2; i++) + { + v[i] = hawk_rtx_getarg (rtx, i); + ptr[i] = hawk_rtx_getvaloocstr (rtx, v[i], &len[i]); + if (ptr[i] == HAWK_NULL) + { + ret = -1; + goto done; + } + + if (hawk_find_oochar(ptr[i], len[i], HAWK_T('\0'))) goto done; + } + + ioattr = get_ioattr (&rxtn->cmgrtab, ptr[0], len[0]); + if (ioattr == HAWK_NULL) + { + init_ioattr (&ioattr_buf); + ioattr = &ioattr_buf; + } + + if ((tmout = timeout_code (ptr[1])) >= 0) + { + if (ioattr->tmout[tmout].nsec == 0) + rv = hawk_rtx_makeintval(rtx, ioattr->tmout[tmout].sec); + else + rv = hawk_rtx_makefltval(rtx, (hawk_flt_t)ioattr->tmout[tmout].sec + HAWK_NSEC_TO_SEC((hawk_flt_t)ioattr->tmout[tmout].nsec)); + if (rv == HAWK_NULL) + { + ret = -1; + goto done; + } + } +#if defined(HAWK_OOCH_IS_UCH) + else if (hawk_comp_oocstr(ptr[1], HAWK_T("codepage"), 1) == 0 || + hawk_comp_oocstr(ptr[1], HAWK_T("encoding"), 1) == 0) + { + rv = hawk_rtx_makestrvalwithoocstr(rtx, ioattr->cmgr_name); + if (rv == HAWK_NULL) + { + ret = -1; + goto done; + } + } +#endif + else + { + /* unknown attribute name */ + goto done; + } + +done: + while (i > 0) + { + i--; + hawk_rtx_freevaloocstr (rtx, v[i], ptr[i]); + } + + if (ret >= 0) + { + if (rv) + { + hawk_rtx_refupval (rtx, rv); + ret = hawk_rtx_setrefval (rtx, (hawk_val_ref_t*)hawk_rtx_getarg (rtx, 2), rv); + hawk_rtx_refdownval (rtx, rv); + if (ret >= 0) hawk_rtx_setretval (rtx, HAWK_VAL_ZERO); + } + else + { + hawk_rtx_setretval (rtx, HAWK_VAL_NEGONE); + } + + } + + return ret; +} + +hawk_cmgr_t* hawk_rtx_getiocmgrstd (hawk_rtx_t* rtx, const hawk_ooch_t* ioname) +{ +#if defined(HAWK_OOCH_IS_UCH) + rxtn_t* rxtn = GET_RXTN(rtx); + ioattr_t* ioattr; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), rxtn->cmgrtab_inited == 1); + + ioattr = get_ioattr(&rxtn->cmgrtab, ioname, hawk_count_oocstr(ioname)); + if (ioattr) return ioattr->cmgr; +#endif + return HAWK_NULL; +} + +static int add_globals (hawk_t* awk) +{ + xtn_t* xtn = GET_XTN(awk); + + xtn->gbl_argc = hawk_addgbl(awk, HAWK_T("ARGC")); + xtn->gbl_argv = hawk_addgbl(awk, HAWK_T("ARGV")); + xtn->gbl_environ = hawk_addgbl(awk, HAWK_T("ENVIRON")); + + return (xtn->gbl_argc <= -1 || + xtn->gbl_argv <= -1 || + xtn->gbl_environ <= -1)? -1: 0; +} + +struct fnctab_t +{ + const hawk_ooch_t* name; + hawk_fnc_spec_t spec; +}; + +static struct fnctab_t fnctab[] = +{ + /* additional aliases to module functions */ + { HAWK_T("rand"), { {1, 0, HAWK_T("math")}, HAWK_NULL, 0 } }, + { HAWK_T("srand"), { {1, 0, HAWK_T("math")}, HAWK_NULL, 0 } }, + { HAWK_T("system"), { {1, 0, HAWK_T("sys")}, HAWK_NULL , 0 } }, + + /* additional functions */ + { HAWK_T("setioattr"), { {3, 3, HAWK_NULL}, fnc_setioattr, HAWK_RIO } }, + { HAWK_T("getioattr"), { {3, 3, HAWK_T("vvr")}, fnc_getioattr, HAWK_RIO } } +}; + +static int add_functions (hawk_t* awk) +{ + int i; + + for (i = 0; i < HAWK_COUNTOF(fnctab); i++) + { + if (hawk_addfnc (awk, fnctab[i].name, &fnctab[i].spec) == HAWK_NULL) return -1; + } + + return 0; +} + diff --git a/hawk/lib/syscall.h b/hawk/lib/syscall.h new file mode 100644 index 00000000..83d66c0a --- /dev/null +++ b/hawk/lib/syscall.h @@ -0,0 +1,762 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_SYSCALL_H_ +#define _HAWK_SYSCALL_H_ + +#if defined(_WIN32) || defined(__OS2__) || defined(__DOS__) +# error Do not include this file +#endif + +/* This file defines unix/linux system calls */ + +#if defined(HAVE_SYS_TYPES_H) +# include +#endif +#if defined(HAVE_UNISTD_H) +# include +#endif +#if defined(HAVE_SYS_WAIT_H) +# include +#endif +#if defined(HAVE_SIGNAL_H) +# include +#endif +#if defined(HAVE_ERRNO_H) +# include +#endif +#if defined(HAVE_FCNTL_H) +# include +#endif +#if defined(HAVE_TIME_H) +# include +#endif +#if defined(HAVE_SYS_TIME_H) +# include +#endif +#if defined(HAVE_UTIME_H) +# include +#endif +#if defined(HAVE_SYS_RESOURCE_H) +# include +#endif +#if defined(HAVE_SYS_STAT_H) +# include +#endif +#if defined(HAVE_DIRENT_H) +# include +#endif +#if defined(HAVE_SYS_IOCTL_H) +# include +#endif + +#if defined(HAWK_USE_SYSCALL) && defined(HAVE_SYS_SYSCALL_H) +# include +#endif + +#if defined(__cplusplus) +# define HAWK_LIBCALL0(x) ::x() +# define HAWK_LIBCALL1(x,a1) ::x(a1) +# define HAWK_LIBCALL2(x,a1,a2) ::x(a1,a2) +# define HAWK_LIBCALL3(x,a1,a2,a3) ::x(a1,a2,a3) +# define HAWK_LIBCALL4(x,a1,a2,a3,a4) ::x(a1,a2,a3,a4) +# define HAWK_LIBCALL5(x,a1,a2,a3,a4,a5) ::x(a1,a2,a3,a4,a5) +#else +# define HAWK_LIBCALL0(x) x +# define HAWK_LIBCALL1(x,a1) x(a1) +# define HAWK_LIBCALL2(x,a1,a2) x(a1,a2) +# define HAWK_LIBCALL3(x,a1,a2,a3) x(a1,a2,a3) +# define HAWK_LIBCALL4(x,a1,a2,a3,a4) x(a1,a2,a3,a4) +# define HAWK_LIBCALL5(x,a1,a2,a3,a4,a5) x(a1,a2,a3,a4,a5) +#endif + +#if defined(SYS_open) && defined(HAWK_USE_SYSCALL) +# define HAWK_OPEN(path,flags,mode) syscall(SYS_open,path,flags,mode) +#else +# define HAWK_OPEN(path,flags,mode) HAWK_LIBCALL3(open,path,flags,mode) +#endif + +#if defined(SYS_close) && defined(HAWK_USE_SYSCALL) +# define HAWK_CLOSE(handle) syscall(SYS_close,handle) +#else +# define HAWK_CLOSE(handle) HAWK_LIBCALL1(close,handle) +#endif + +#if defined(SYS_read) && defined(HAWK_USE_SYSCALL) +# define HAWK_READ(handle,buf,size) syscall(SYS_read,handle,buf,size) +#else +# define HAWK_READ(handle,buf,size) HAWK_LIBCALL3(read,handle,buf,size) +#endif + +#if defined(SYS_write) && defined(HAWK_USE_SYSCALL) +# define HAWK_WRITE(handle,buf,size) syscall(SYS_write,handle,buf,size) +#else +# define HAWK_WRITE(handle,buf,size) HAWK_LIBCALL3(write,handle,buf,size) +#endif + +#if !defined(_LP64) && (HAWK_SIZEOF_VOID_P<8) && defined(SYS__llseek) && defined(HAWK_USE_SYSCALL) +# define HAWK_LLSEEK(handle,hoffset,loffset,out,whence) syscall(SYS__llseek,handle,hoffset,loffset,out,whence) +#elif !defined(_LP64) && (HAWK_SIZEOF_VOID_P<8) && defined(HAVE__LLSEEK) && defined(HAWK_USE_SYSCALL) +# define HAWK_LLSEEK(handle,hoffset,loffset,out,whence) _llseek(handle,hoffset,loffset,out,whence) +#endif + +#if !defined(_LP64) && (HAWK_SIZEOF_VOID_P<8) && defined(SYS_lseek64) && defined(HAWK_USE_SYSCALL) +# define HAWK_LSEEK(handle,offset,whence) syscall(SYS_lseek64,handle,offset,whence) +#elif defined(SYS_lseek) && defined(HAWK_USE_SYSCALL) +# define HAWK_LSEEK(handle,offset,whence) syscall(SYS_lseek,handle,offset,whence) +#elif !defined(_LP64) && (HAWK_SIZEOF_VOID_P<8) && defined(HAVE_LSEEK64) +# define HAWK_LSEEK(handle,offset,whence) lseek64(handle,offset,whence) +#else +# define HAWK_LSEEK(handle,offset,whence) lseek(handle,offset,whence) +#endif + +#if !defined(_LP64) && (HAWK_SIZEOF_VOID_P<8) && defined(SYS_ftruncate64) && defined(HAWK_USE_SYSCALL) +# define HAWK_FTRUNCATE(handle,size) syscall(SYS_ftruncate64,handle,size) +#elif defined(SYS_ftruncate) && defined(HAWK_USE_SYSCALL) +# define HAWK_FTRUNCATE(handle,size) syscall(SYS_ftruncate,handle,size) +#elif !defined(_LP64) && (HAWK_SIZEOF_VOID_P<8) && defined(HAVE_FTRUNCATE64) +# define HAWK_FTRUNCATE(handle,size) ftruncate64(handle,size) +#else +# define HAWK_FTRUNCATE(handle,size) ftruncate(handle,size) +#endif + +#if defined(SYS_fsync) && defined(HAWK_USE_SYSCALL) +# define HAWK_FSYNC(handle) syscall(SYS_fsync,handle) +#else +# define HAWK_FSYNC(handle) fsync(handle) +#endif + +#if defined(SYS_fcntl) && defined(HAWK_USE_SYSCALL) +# define HAWK_FCNTL(handle,cmd,arg) syscall(SYS_fcntl,handle,cmd,arg) +#else +# define HAWK_FCNTL(handle,cmd,arg) fcntl(handle,cmd,arg) +#endif + +#if defined(SYS_dup2) && defined(HAWK_USE_SYSCALL) +# define HAWK_DUP2(ofd,nfd) syscall(SYS_dup2,ofd,nfd) +#else +# define HAWK_DUP2(ofd,nfd) dup2(ofd,nfd) +#endif + +#if defined(SYS_pipe) && defined(HAWK_USE_SYSCALL) +# define HAWK_PIPE(pfds) syscall(SYS_pipe,pfds) +#else +# define HAWK_PIPE(pfds) pipe(pfds) +#endif + +#if defined(SYS_exit) && defined(HAWK_USE_SYSCALL) +# define HAWK_EXIT(code) syscall(SYS_exit,code) +#else +# define HAWK_EXIT(code) _exit(code) +#endif + +#if defined(SYS_fork) && defined(HAWK_USE_SYSCALL) +# define HAWK_FORK() syscall(SYS_fork) +#else +# define HAWK_FORK() fork() +#endif + +#if defined(SYS_vfork) && defined(HAWK_USE_SYSCALL) +# define HAWK_VFORK() syscall(SYS_vfork) +#else +# define HAWK_VFORK() vfork() +#endif + +#if defined(SYS_execve) && defined(HAWK_USE_SYSCALL) +# define HAWK_EXECVE(path,argv,envp) syscall(SYS_execve,path,argv,envp) +#else +# define HAWK_EXECVE(path,argv,envp) execve(path,argv,envp) +#endif + +#if defined(SYS_waitpid) && defined(HAWK_USE_SYSCALL) +# define HAWK_WAITPID(pid,status,options) syscall(SYS_waitpid,pid,status,options) +#else +# define HAWK_WAITPID(pid,status,options) waitpid(pid,status,options) +#endif + +#if defined(SYS_kill) && defined(HAWK_USE_SYSCALL) +# define HAWK_KILL(pid,sig) syscall(SYS_kill,pid,sig) +#else +# define HAWK_KILL(pid,sig) kill(pid,sig) +#endif + +#if defined(SYS_getpid) && defined(HAWK_USE_SYSCALL) +# define HAWK_GETPID() syscall(SYS_getpid) +#else +# define HAWK_GETPID() getpid() +#endif + +#if defined(SYS_getuid) && defined(HAWK_USE_SYSCALL) +# define HAWK_GETUID() syscall(SYS_getuid) +#else +# define HAWK_GETUID() getuid() +#endif + +#if defined(SYS_geteuid) && defined(HAWK_USE_SYSCALL) +# define HAWK_GETEUID() syscall(SYS_geteuid) +#else +# define HAWK_GETEUID() geteuid() +#endif + +#if defined(SYS_getgid) && defined(HAWK_USE_SYSCALL) +# define HAWK_GETGID() syscall(SYS_getgid) +#else +# define HAWK_GETGID() getgid() +#endif + +#if defined(SYS_getegid) && defined(HAWK_USE_SYSCALL) +# define HAWK_GETEGID() syscall(SYS_getegid) +#else +# define HAWK_GETEGID() getegid() +#endif + +#if defined(SYS_getsid) && defined(HAWK_USE_SYSCALL) +# define HAWK_GETSID(pid) syscall(SYS_getsid,pid) +#else +# define HAWK_GETSID(pid) getsid(pid) +#endif + +#if defined(SYS_setsid) && defined(HAWK_USE_SYSCALL) +# define HAWK_SETSID() syscall(SYS_setsid) +#else +# define HAWK_SETSID() setsid() +#endif + +#if defined(SYS_signal) && defined(HAWK_USE_SYSCALL) +# define HAWK_SIGNAL(signum,handler) syscall(SYS_signal,signum,handler) +#else +# define HAWK_SIGNAL(signum,handler) signal(signum,handler) +#endif + +#if defined(SYS_gettimeofday) && defined(HAWK_USE_SYSCALL) +# define HAWK_GETTIMEOFDAY(tv,tz) syscall(SYS_gettimeofday,tv,tz) +#else +# define HAWK_GETTIMEOFDAY(tv,tz) gettimeofday(tv,tz) +#endif + +#if defined(SYS_settimeofday) && defined(HAWK_USE_SYSCALL) +# define HAWK_SETTIMEOFDAY(tv,tz) syscall(SYS_settimeofday,tv,tz) +#else +# define HAWK_SETTIMEOFDAY(tv,tz) settimeofday(tv,tz) +#endif + +#if defined(SYS_time) && defined(HAWK_USE_SYSCALL) +# define HAWK_TIME(tv) syscall(SYS_time,tv) +#else +# define HAWK_TIME(tv) time(tv) +#endif + +#if defined(SYS_stime) && defined(HAWK_USE_SYSCALL) +# define HAWK_STIME(tv) syscall(SYS_stime,tv) +#else +# define HAWK_STIME(tv) stime(tv) +#endif + +#if defined(SYS_getrlimit) && defined(HAWK_USE_SYSCALL) +# define HAWK_GETRLIMIT(res,lim) syscall(SYS_getrlimit,res,lim) +#else +# define HAWK_GETRLIMIT(res,lim) getrlimit(res,lim) +#endif + +#if defined(SYS_setrlimit) && defined(HAWK_USE_SYSCALL) +# define HAWK_SETRLIMIT(res,lim) syscall(SYS_setrlimit,res,lim) +#else +# define HAWK_SETRLIMIT(res,lim) setrlimit(res,lim) +#endif + +#if defined(SYS_ioctl) && defined(HAWK_USE_SYSCALL) +# define HAWK_IOCTL(fd,req,arg) syscall(SYS_ioctl,fd,req,arg) +#else +# define HAWK_IOCTL(fd,req,arg) ioctl(fd,req,arg) +#endif + + +/* ===== FILE SYSTEM CALLS ===== */ + +#if defined(SYS_chmod) && defined(HAWK_USE_SYSCALL) +# define HAWK_CHMOD(path,mode) syscall(SYS_chmod,path,mode) +#else +# define HAWK_CHMOD(path,mode) chmod(path,mode) +#endif + +#if defined(SYS_fchmod) && defined(HAWK_USE_SYSCALL) +# define HAWK_FCHMOD(handle,mode) syscall(SYS_fchmod,handle,mode) +#else +# define HAWK_FCHMOD(handle,mode) fchmod(handle,mode) +#endif + +#if defined(SYS_fchmodat) && defined(HAWK_USE_SYSCALL) +# define HAWK_FCHMODAT(dirfd,path,mode,flags) syscall(SYS_fchmodat,dirfd,path,mode,flags) +#else +# define HAWK_FCHMODAT(dirfd,path,mode,flags) fchmodat(dirfd,path,mode,flags) +#endif + +#if defined(SYS_chown) && defined(HAWK_USE_SYSCALL) +# define HAWK_CHOWN(path,owner,group) syscall(SYS_chown,path,owner,group) +#else +# define HAWK_CHOWN(path,owner,group) chown(path,owner,group) +#endif + +#if defined(SYS_fchown) && defined(HAWK_USE_SYSCALL) +# define HAWK_FCHOWN(handle,owner,group) syscall(SYS_fchown,handle,owner,group) +#else +# define HAWK_FCHOWN(handle,owner,group) HAWK_LIBCALL3(fchown,handle,owner,group) +#endif + +#if defined(SYS_fchownat) && defined(HAWK_USE_SYSCALL) +# define HAWK_FCHOWNAT(dirfd,path,uid,gid,flags) syscall(SYS_fchownat,dirfd,path,uid,gid,flags) +#else +# define HAWK_FCHOWNAT(dirfd,path,uid,gid,flags) HAWK_LIBCALL5(fchownat,dirfd,path,uid,gid,flags) +#endif + +#if defined(SYS_chroot) && defined(HAWK_USE_SYSCALL) +# define HAWK_CHROOT(path) syscall(SYS_chroot,path) +#else +# define HAWK_CHROOT(path) HAWK_LIBCALL1(chroot,path) +#endif + +#if !defined(SYS_lchown) && !defined(HAVE_LCHOWN) && defined(__APPLE__) && defined(__MACH__) && defined(__POWERPC__) + /* special handling for old darwin/macosx sdks */ +# define HAWK_LCHOWN(path,owner,group) syscall(364,path,owner,group) +#elif defined(SYS_lchown) && defined(HAWK_USE_SYSCALL) +# define HAWK_LCHOWN(path,owner,group) syscall(SYS_lchown,path,owner,group) +#else +# define HAWK_LCHOWN(path,owner,group) HAWK_LIBCALL3(lchown,path,owner,group) +#endif + +#if defined(SYS_link) && defined(HAWK_USE_SYSCALL) +# define HAWK_LINK(oldpath,newpath) syscall(SYS_link,oldpath,newpath) +#else +# define HAWK_LINK(oldpath,newpath) HAWK_LIBCALL2(link,oldpath,newpath) +#endif + + +#if !defined(_LP64) && (HAWK_SIZEOF_VOID_P<8) && defined(SYS_fstat64) && defined(HAWK_USE_SYSCALL) +# define HAWK_FSTAT(handle,stbuf) syscall(SYS_fstat64,handle,stbuf) + typedef struct stat64 hawk_fstat_t; +#elif defined(SYS_fstat) && defined(HAWK_USE_SYSCALL) +# define HAWK_FSTAT(handle,stbuf) syscall(SYS_fstat,handle,stbuf) + typedef struct stat hawk_fstat_t; +#elif !defined(_LP64) && (HAWK_SIZEOF_VOID_P<8) && defined(HAVE_FSTAT64) +# define HAWK_FSTAT(handle,stbuf) fstat64(handle,stbuf) + typedef struct stat64 hawk_fstat_t; +#else +# define HAWK_FSTAT(handle,stbuf) fstat(handle,stbuf) + typedef struct stat hawk_fstat_t; +#endif + +#if !defined(_LP64) && (HAWK_SIZEOF_VOID_P<8) && defined(SYS_stat64) && defined(HAWK_USE_SYSCALL) +# define HAWK_STAT(path,stbuf) syscall(SYS_stat64,path,stbuf) + typedef struct stat64 hawk_stat_t; +#elif defined(SYS_stat) && defined(HAWK_USE_SYSCALL) +# define HAWK_STAT(path,stbuf) syscall(SYS_stat,path,stbuf) + typedef struct stat hawk_stat_t; +#elif !defined(_LP64) && (HAWK_SIZEOF_VOID_P<8) && defined(HAVE_STAT64) +# define HAWK_STAT(path,stbuf) stat64(path,stbuf) + typedef struct stat64 hawk_stat_t; +#else +# define HAWK_STAT(path,stbuf) stat(path,stbuf) + typedef struct stat hawk_stat_t; +#endif + +#if !defined(_LP64) && (HAWK_SIZEOF_VOID_P<8) && defined(SYS_lstat64) && defined(HAWK_USE_SYSCALL) +# define HAWK_LSTAT(path,stbuf) syscall(SYS_lstat,path,stbuf) + typedef struct stat64 hawk_lstat_t; +#elif defined(SYS_lstat) && defined(HAWK_USE_SYSCALL) +# define HAWK_LSTAT(path,stbuf) syscall(SYS_lstat,path,stbuf) + typedef struct stat hawk_lstat_t; +#elif !defined(_LP64) && (HAWK_SIZEOF_VOID_P<8) && defined(HAVE_LSTAT64) +# define HAWK_LSTAT(path,stbuf) lstat64(path,stbuf) + typedef struct stat64 hawk_lstat_t; +#else +# define HAWK_LSTAT(path,stbuf) lstat(path,stbuf) + typedef struct stat hawk_lstat_t; +#endif + + +#if !defined(_LP64) && (HAWK_SIZEOF_VOID_P<8) && defined(SYS_fstatat64) && defined(HAWK_USE_SYSCALL) +# define HAWK_FSTATAT(dirfd,path,stbuf,flags) syscall(SYS_fstatat,dirfd,path,stbuf,flags) + typedef struct stat64 hawk_fstatat_t; +#elif defined(SYS_fstatat) && defined(HAWK_USE_SYSCALL) +# define HAWK_FSTATAT(dirfd,path,stbuf,flags) syscall(SYS_fstatat,dirfd,path,stbuf,flags) + typedef struct stat hawk_fstatat_t; +#elif !defined(_LP64) && (HAWK_SIZEOF_VOID_P<8) && defined(HAVE_FSTATAT64) +# define HAWK_FSTATAT(dirfd,path,stbuf,flags) fstatat64(dirfd,path,stbuf,flags) + typedef struct stat64 hawk_fstatat_t; +#else +# define HAWK_FSTATAT(dirfd,path,stbuf,flags) fstatat(dirfd,path,stbuf,flags) + typedef struct stat hawk_fstatat_t; +#endif + +#if defined(SYS_access) && defined(HAWK_USE_SYSCALL) +# define HAWK_ACCESS(path,mode) syscall(SYS_access,path,mode) +#else +# define HAWK_ACCESS(path,mode) access(path,mode) +#endif + +#if defined(SYS_faccessat) && defined(HAWK_USE_SYSCALL) +# define HAWK_FACCESSAT(dirfd,path,mode,flags) syscall(SYS_faccessat,dirfd,path,mode,flags) +#elif defined(HAVE_FACCESSAT) +# define HAWK_FACCESSAT(dirfd,path,mode,flags) faccessat(dirfd,path,mode,flags) +#endif + +#if defined(SYS_rename) && defined(HAWK_USE_SYSCALL) +# define HAWK_RENAME(oldpath,newpath) syscall(SYS_rename,oldpath,newpath) +#else + extern int rename(const char *oldpath, const char *newpath); /* not to include stdio.h */ +# define HAWK_RENAME(oldpath,newpath) rename(oldpath,newpath) +#endif + +#if defined(SYS_umask) && defined(HAWK_USE_SYSCALL) +# define HAWK_UMASK(mode) syscall(SYS_umask,mode) +#else +# define HAWK_UMASK(mode) umask(mode) +#endif + +#if defined(SYS_mkdir) && defined(HAWK_USE_SYSCALL) +# define HAWK_MKDIR(path,mode) syscall(SYS_mkdir,path,mode) +#else +# define HAWK_MKDIR(path,mode) mkdir(path,mode) +#endif + +#if defined(SYS_rmdir) && defined(HAWK_USE_SYSCALL) +# define HAWK_RMDIR(path) syscall(SYS_rmdir,path) +#else +# define HAWK_RMDIR(path) rmdir(path) +#endif + +#if defined(SYS_chdir) && defined(HAWK_USE_SYSCALL) +# define HAWK_CHDIR(path) syscall(SYS_chdir,path) +#else +# define HAWK_CHDIR(path) chdir(path) +#endif + +#if defined(SYS_fchdir) && defined(HAWK_USE_SYSCALL) +# define HAWK_FCHDIR(handle) syscall(SYS_fchdir,handle) +#else +# define HAWK_FCHDIR(handle) fchdir(handle) +#endif + +#if defined(SYS_symlink) && defined(HAWK_USE_SYSCALL) +# define HAWK_SYMLINK(oldpath,newpath) syscall(SYS_symlink,oldpath,newpath) +#else +# define HAWK_SYMLINK(oldpath,newpath) symlink(oldpath,newpath) +#endif + +#if defined(SYS_readlink) && defined(HAWK_USE_SYSCALL) +# define HAWK_READLINK(path,buf,size) syscall(SYS_readlink,path,buf,size) +#else +# define HAWK_READLINK(path,buf,size) readlink(path,buf,size) +#endif + +#if defined(SYS_unlink) && defined(HAWK_USE_SYSCALL) +# define HAWK_UNLINK(path) syscall(SYS_unlink,path) +#else +# define HAWK_UNLINK(path) unlink(path) +#endif + +#if defined(SYS_utime) && defined(HAWK_USE_SYSCALL) +# define HAWK_UTIME(path,t) syscall(SYS_utime,path,t) +#else +# define HAWK_UTIME(path,t) utime(path,t) +#endif + +#if defined(SYS_utimes) && defined(HAWK_USE_SYSCALL) +# define HAWK_UTIMES(path,t) syscall(SYS_utimes,path,t) +#else +# define HAWK_UTIMES(path,t) utimes(path,t) +#endif + +#if defined(SYS_futimes) && defined(HAWK_USE_SYSCALL) +# define HAWK_FUTIMES(fd,t) syscall(SYS_futimes,fd,t) +#else +# define HAWK_FUTIMES(fd,t) futimes(fd,t) +#endif + +#if defined(SYS_lutimes) && defined(HAWK_USE_SYSCALL) +# define HAWK_LUTIMES(fd,t) syscall(SYS_lutimes,fd,t) +#else +# define HAWK_LUTIMES(fd,t) lutimes(fd,t) +#endif + +#if defined(SYS_futimens) && defined(HAWK_USE_SYSCALL) +# define HAWK_FUTIMENS(fd,t) syscall(SYS_futimens,fd,t) +#else +# define HAWK_FUTIMENS(fd,t) futimens(fd,t) +#endif + +#if defined(SYS_utimensat) && defined(HAWK_USE_SYSCALL) +# define HAWK_FUTIMENS(dirfd,path,times,flags) syscall(SYS_futimens,dirfd,path,times,flags) +#else +# define HAWK_UTIMENSAT(dirfd,path,times,flags) utimensat(dirfd,path,times,flags) +#endif + +/* +the library's getcwd() returns char* while the system call returns int. +so it's not practical to define HAWK_GETCWD(). +#if defined(SYS_getcwd) && defined(HAWK_USE_SYSCALL) +# define HAWK_GETCWD(buf,size) syscall(SYS_getcwd,buf,size) +#else +# define HAWK_GETCWD(buf,size) getcwd(buf,size) +#endif +*/ + +/* ===== DIRECTORY - not really system calls ===== */ +#define HAWK_OPENDIR(name) opendir(name) +#define HAWK_CLOSEDIR(dir) closedir(dir) +#define HAWK_REWINDDIR(dir) rewinddir(dir) +#if defined(HAVE_DIRFD) +# define HAWK_DIRFD(dir) dirfd(dir) +#elif defined(HAVE_DIR_DD_FD) +# define HAWK_DIRFD(dir) ((dir)->dd_fd) +#elif defined(HAVE_DIR_D_FD) +# define HAWK_DIRFD(dir) ((dir)->d_fd) +#else +# if defined(dirfd) + /* mac os x 10.1 defines dirfd as a macro */ +# define HAWK_DIRFD(dir) dirfd(dir) +# else +# error OUCH!!! NO DIRFD AVAILABLE +# endif +#endif +#define HAWK_DIR DIR + +#if !defined(_LP64) && (HAWK_SIZEOF_VOID_P<8) && defined(HAVE_READDIR64) + typedef struct dirent64 hawk_dirent_t; +# define HAWK_READDIR(x) readdir64(x) +#else + typedef struct dirent hawk_dirent_t; +# define HAWK_READDIR(x) readdir(x) +#endif + +/* ------------------------------------------------------------------------ */ + +#if defined(__linux) && defined(__GNUC__) && defined(__x86_64) + +#include + +/* + +http://www.x86-64.org/documentation/abi.pdf + +A.2 AMD64 Linux Kernel Conventions +The section is informative only. + +A.2.1 Calling Conventions +The Linux AMD64 kernel uses internally the same calling conventions as user- +level applications (see section 3.2.3 for details). User-level applications +that like to call system calls should use the functions from the C library. +The interface between the C library and the Linux kernel is the same as for +the user-level applications with the following differences: + +1. User-level applications use as integer registers for passing the sequence + %rdi, %rsi, %rdx, %rcx, %r8 and %r9. The kernel interface uses %rdi, + %rsi, %rdx, %r10, %r8 and %r9. +2. A system-call is done via the syscall instruction. The kernel destroys + registers %rcx and %r11. +3. The number of the syscall has to be passed in register %rax. +4. System-calls are limited to six arguments, no argument is passed directly + on the stack. +5. Returning from the syscall, register %rax contains the result of the + system-call. A value in the range between -4095 and -1 indicates an error, + it is -errno. +6. Only values of class INTEGER or class MEMORY are passed to the kernel. + +*/ + +/* +#define HAWK_SYSCALL0(ret,num) \ + __asm__ volatile ( \ + "movq %1, %%rax\n\t" \ + "syscall\n" \ + : "=&a"(ret) \ + : "g"((hawk_uint64_t)num) \ + : "%rcx", "%r11") + +#define HAWK_SYSCALL1(ret,num,arg1) \ + __asm__ volatile ( \ + "movq %1, %%rax\n\t" \ + "movq %2, %%rdi\n\t" \ + "syscall\n" \ + : "=&a"(ret) \ + : "g"((hawk_uint64_t)num), "g"((hawk_uint64_t)arg1) \ + : "%rdi", "%rcx", "%r11") + +#define HAWK_SYSCALL2(ret,num,arg1,arg2) \ + __asm__ volatile ( \ + "movq %1, %%rax\n\t" \ + "movq %2, %%rdi\n\t" \ + "movq %3, %%rsi\n\t" \ + "syscall\n" \ + : "=&a"(ret) \ + : "g"((hawk_uint64_t)num), "g"((hawk_uint64_t)arg1), "g"((hawk_uint64_t)arg2) \ + : "%rdi", "%rsi", "%rcx", "%r11") + +#define HAWK_SYSCALL3(ret,num,arg1,arg2,arg3) \ + __asm__ volatile ( \ + "movq %1, %%rax\n\t" \ + "movq %2, %%rdi\n\t" \ + "movq %3, %%rsi\n\t" \ + "movq %4, %%rdx\n\t" \ + "syscall\n" \ + : "=&a"(ret) \ + : "g"((hawk_uint64_t)num), "g"((hawk_uint64_t)arg1), "g"((hawk_uint64_t)arg2), "g"((hawk_uint64_t)arg3) \ + : "%rdi", "%rsi", "%rdx", "%rcx", "%r11") +*/ + +#define HAWK_SYSCALL0(ret,num) \ + __asm__ volatile ( \ + "syscall\n" \ + : "=a"(ret) \ + : "a"((hawk_uint64_t)num) \ + : "memory", "cc", "%rcx", "%r11" \ + ) + + +#define HAWK_SYSCALL1(ret,num,arg1) \ + __asm__ volatile ( \ + "syscall\n" \ + : "=a"(ret) \ + : "a"((hawk_uint64_t)num), "D"((hawk_uint64_t)arg1) \ + : "memory", "cc", "%rcx", "%r11" \ + ) + +#define HAWK_SYSCALL2(ret,num,arg1,arg2) \ + __asm__ volatile ( \ + "syscall\n" \ + : "=a"(ret) \ + : "a"((hawk_uint64_t)num), "D"((hawk_uint64_t)arg1), "S"((hawk_uint64_t)arg2) \ + : "memory", "cc", "%rcx", "%r11" \ + ) + +#define HAWK_SYSCALL3(ret,num,arg1,arg2,arg3) \ + __asm__ volatile ( \ + "syscall\n" \ + : "=a"(ret) \ + : "a"((hawk_uint64_t)num), "D"((hawk_uint64_t)arg1), "S"((hawk_uint64_t)arg2), "d"((hawk_uint64_t)arg3) \ + : "memory", "cc", "%rcx", "%r11" \ + ) + +#define HAWK_SYSCALL4(ret,num,arg1,arg2,arg3,arg4) \ + __asm__ volatile ( \ + "syscall\n" \ + : "=a"(ret) \ + : "a"((hawk_uint64_t)num), "D"((hawk_uint64_t)arg1), "S"((hawk_uint64_t)arg2), "d"((hawk_uint64_t)arg3), "c"((hawk_uint64_t)arg4) \ + : "memory", "cc", "%rcx", "%r11" \ + ) + +#elif defined(__linux) && defined(__GNUC__) && defined(__i386) + +#include + +#define HAWK_SYSCALL0(ret,num) \ + __asm__ volatile ( \ + "int $0x80\n" \ + : "=a"(ret) \ + : "a"((hawk_uint32_t)num) \ + : "memory" \ + ) + +/* +#define HAWK_SYSCALL1(ret,num,arg1) \ + __asm__ volatile ( \ + "int $0x80\n" \ + : "=a"(ret) \ + : "a"((hawk_uint32_t)num), "b"((hawk_uint32_t)arg1) \ + : "memory" \ + ) + +GCC in x86 PIC mode uses ebx to store the GOT table. so the macro shouldn't +clobber the ebx register. this modified version stores ebx before interrupt +and restores it after interrupt. +*/ +#define HAWK_SYSCALL1(ret,num,arg1) \ + __asm__ volatile ( \ + "push %%ebx\n\t" \ + "movl %2, %%ebx\n\t" \ + "int $0x80\n\t" \ + "pop %%ebx\n" \ + : "=a"(ret) \ + : "a"((hawk_uint32_t)num), "r"((hawk_uint32_t)arg1) \ + : "memory" \ + ) + +/* +#define HAWK_SYSCALL2(ret,num,arg1,arg2) \ + __asm__ volatile ( \ + "int $0x80\n" \ + : "=a"(ret) \ + : "a"((hawk_uint32_t)num), "b"((hawk_uint32_t)arg1), "c"((hawk_uint32_t)arg2) \ + : "memory" \ + ) +*/ +#define HAWK_SYSCALL2(ret,num,arg1,arg2) \ + __asm__ volatile ( \ + "push %%ebx\n\t" \ + "movl %2, %%ebx\n\t" \ + "int $0x80\n\t" \ + "pop %%ebx\n" \ + : "=a"(ret) \ + : "a"((hawk_uint32_t)num), "r"((hawk_uint32_t)arg1), "c"((hawk_uint32_t)arg2) \ + : "memory" \ + ) + +/* +#define HAWK_SYSCALL3(ret,num,arg1,arg2,arg3) \ + __asm__ volatile ( \ + "int $0x80\n" \ + : "=a"(ret) \ + : "a"((hawk_uint32_t)num), "b"((hawk_uint32_t)arg1), "c"((hawk_uint32_t)arg2), "d"((hawk_uint32_t)arg3) \ + : "memory" \ + ) +*/ +#define HAWK_SYSCALL3(ret,num,arg1,arg2,arg3) \ + __asm__ volatile ( \ + "push %%ebx\n\t" \ + "movl %2, %%ebx\n\t" \ + "int $0x80\n\t" \ + "pop %%ebx\n" \ + : "=a"(ret) \ + : "a"((hawk_uint32_t)num), "r"((hawk_uint32_t)arg1), "c"((hawk_uint32_t)arg2), "d"((hawk_uint32_t)arg3) \ + : "memory" \ + ) + +#define HAWK_SYSCALL4(ret,num,arg1,arg2,arg3,arg4) \ + __asm__ volatile ( \ + "push %%ebx\n\t" \ + "movl %2, %%ebx\n\t" \ + "int $0x80\n\t" \ + "pop %%ebx\n" \ + : "=a"(ret) \ + : "a"((hawk_uint32_t)num), "r"((hawk_uint32_t)arg1), "c"((hawk_uint32_t)arg2), "d"((hawk_uint32_t)arg3), "S"((hawk_uint32_t)arg4) \ + : "memory" \ + ) + +#endif + +/* ------------------------------------------------------------------------ */ + +#endif diff --git a/hawk/lib/syserr.h b/hawk/lib/syserr.h new file mode 100644 index 00000000..c64e507e --- /dev/null +++ b/hawk/lib/syserr.h @@ -0,0 +1,231 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * this file is intended for internal use only. + * you can include this file and use IMPLEMENT_SYSERR_TO_ERRNUM. + * + * #include "syserr.h" + * IMPLEMENT_SYSERR_TO_ERRNUM (pio, PIO) + * + * header files defining system error codes must be included + * before this file. + */ + +#if defined(__cplusplus) +# define __SYSERRTYPE__(obj) obj +# define __SYSERRNUM__(obj,num) (obj E_ ## num) +#else +# define __SYSERRTYPE__(obj) hawk_ ## obj ## _errnum_t +# define __SYSERRNUM__(obj,num) (HAWK_ ## obj ## _ ## num) +#endif + +#if defined(_WIN32) + + #define IMPLEMENT_SYSERR_TO_ERRNUM(obj1,obj2) \ + static __SYSERRTYPE__(obj1) syserr_to_errnum (DWORD e) \ + { \ + switch (e) \ + { \ + case ERROR_NOT_ENOUGH_MEMORY: \ + case ERROR_OUTOFMEMORY: \ + return __SYSERRNUM__ (obj2, ENOMEM); \ + case ERROR_INVALID_PARAMETER: \ + case ERROR_INVALID_HANDLE: \ + case ERROR_INVALID_NAME: \ + return __SYSERRNUM__ (obj2, EINVAL); \ + case ERROR_ACCESS_DENIED: \ + case ERROR_SHARING_VIOLATION: \ + return __SYSERRNUM__ (obj2, EACCES); \ + case ERROR_FILE_NOT_FOUND: \ + case ERROR_PATH_NOT_FOUND: \ + return __SYSERRNUM__ (obj2, ENOENT); \ + case ERROR_ALREADY_EXISTS: \ + case ERROR_FILE_EXISTS: \ + return __SYSERRNUM__ (obj2, EEXIST); \ + case ERROR_BROKEN_PIPE: \ + return __SYSERRNUM__ (obj2, EPIPE); \ + default: \ + return __SYSERRNUM__ (obj2, ESYSERR); \ + } \ + } + +#elif defined(__OS2__) + + #define IMPLEMENT_SYSERR_TO_ERRNUM(obj1,obj2) \ + static __SYSERRTYPE__(obj1) syserr_to_errnum (APIRET e) \ + { \ + switch (e) \ + { \ + case ERROR_NOT_ENOUGH_MEMORY: \ + return __SYSERRNUM__ (obj2, ENOMEM); \ + case ERROR_INVALID_PARAMETER: \ + case ERROR_INVALID_HANDLE: \ + case ERROR_INVALID_NAME: \ + return __SYSERRNUM__ (obj2, EINVAL); \ + case ERROR_ACCESS_DENIED: \ + case ERROR_SHARING_VIOLATION: \ + return __SYSERRNUM__ (obj2, EACCES); \ + case ERROR_FILE_NOT_FOUND: \ + case ERROR_PATH_NOT_FOUND: \ + return __SYSERRNUM__ (obj2, ENOENT); \ + case ERROR_ALREADY_EXISTS: \ + return __SYSERRNUM__ (obj2, EEXIST); \ + case ERROR_BROKEN_PIPE: \ + return __SYSERRNUM__ (obj2, EPIPE); \ + default: \ + return __SYSERRNUM__ (obj2, ESYSERR); \ + } \ + } + +/* +#elif defined(__DOS__) + + #define IMPLEMENT_SYSERR_TO_ERRNUM(obj1,obj2) \ + static __SYSERRTYPE__(obj1) syserr_to_errnum (int e) \ + { \ + switch (e) \ + { \ + case ENOMEM: return __SYSERRNUM__ (obj2, ENOMEM); \ + case EINVAL: return __SYSERRNUM__ (obj2, EINVAL); \ + case EACCES: return __SYSERRNUM__ (obj2, EACCES); \ + case ENOENT: return __SYSERRNUM__ (obj2, ENOENT); \ + case EEXIST: return __SYSERRNUM__ (obj2, EEXIST); \ + default: return __SYSERRNUM__ (obj2, ESYSERR); \ + } \ + } +*/ + +#elif defined(vms) || defined(__vms) + + /* TODO: */ + #define IMPLEMENT_SYSERR_TO_ERRNUM(obj1,obj2) \ + static __SYSERRTYPE__(obj1) syserr_to_errnum (unsigned long e) \ + { \ + switch (e) \ + { \ + case RMS$_NORMAL: return __SYSERRNUM__ (obj2, ENOERR); \ + default: return __SYSERRNUM__ (obj2, ESYSERR); \ + } \ + } + +#else + + #if defined(EWOULDBLOCK) && defined(EAGAIN) && (EWOULDBLOCK != EAGAIN) + + #define IMPLEMENT_SYSERR_TO_ERRNUM(obj1,obj2) \ + static __SYSERRTYPE__(obj1) syserr_to_errnum (int e) \ + { \ + switch (e) \ + { \ + case ENOMEM: return __SYSERRNUM__ (obj2, ENOMEM); \ + case EINVAL: return __SYSERRNUM__ (obj2, EINVAL); \ + case EBUSY: \ + case EACCES: return __SYSERRNUM__ (obj2, EACCES); \ + case EPERM: return __SYSERRNUM__ (obj2, EPERM); \ + case ENOTDIR: return __SYSERRNUM__ (obj2, ENOTDIR); \ + case ENOENT: return __SYSERRNUM__ (obj2, ENOENT); \ + case EEXIST: return __SYSERRNUM__ (obj2, EEXIST); \ + case EINTR: return __SYSERRNUM__ (obj2, EINTR); \ + case EPIPE: return __SYSERRNUM__ (obj2, EPIPE); \ + case EINPROGRESS: return __SYSERRNUM__ (obj2, EINPROG); \ + case EWOULDBLOCK: \ + case EAGAIN: return __SYSERRNUM__ (obj2, EAGAIN); \ + default: return __SYSERRNUM__ (obj2, ESYSERR); \ + } \ + } + + #elif defined(EAGAIN) + + #define IMPLEMENT_SYSERR_TO_ERRNUM(obj1,obj2) \ + static __SYSERRTYPE__(obj1) syserr_to_errnum (int e) \ + { \ + switch (e) \ + { \ + case ENOMEM: return __SYSERRNUM__ (obj2, ENOMEM); \ + case EINVAL: return __SYSERRNUM__ (obj2, EINVAL); \ + case EBUSY: \ + case EACCES: return __SYSERRNUM__ (obj2, EACCES); \ + case EPERM: return __SYSERRNUM__ (obj2, EPERM); \ + case ENOTDIR: return __SYSERRNUM__ (obj2, ENOTDIR); \ + case ENOENT: return __SYSERRNUM__ (obj2, ENOENT); \ + case EEXIST: return __SYSERRNUM__ (obj2, EEXIST); \ + case EINTR: return __SYSERRNUM__ (obj2, EINTR); \ + case EPIPE: return __SYSERRNUM__ (obj2, EPIPE); \ + case EINPROGRESS: return __SYSERRNUM__ (obj2, EINPROG); \ + case EAGAIN: return __SYSERRNUM__ (obj2, EAGAIN); \ + default: return __SYSERRNUM__ (obj2, ESYSERR); \ + } \ + } + + #elif defined(EWOULDBLOCK) + + #define IMPLEMENT_SYSERR_TO_ERRNUM(obj1,obj2) \ + static __SYSERRTYPE__(obj1) syserr_to_errnum (int e) \ + { \ + switch (e) \ + { \ + case ENOMEM: return __SYSERRNUM__ (obj2, ENOMEM); \ + case EINVAL: return __SYSERRNUM__ (obj2, EINVAL); \ + case EBUSY: \ + case EACCES: return __SYSERRNUM__ (obj2, EACCES); \ + case EPERM: return __SYSERRNUM__ (obj2, EPERM); \ + case ENOTDIR: return __SYSERRNUM__ (obj2, ENOTDIR); \ + case ENOENT: return __SYSERRNUM__ (obj2, ENOENT); \ + case EEXIST: return __SYSERRNUM__ (obj2, EEXIST); \ + case EINTR: return __SYSERRNUM__ (obj2, EINTR); \ + case EPIPE: return __SYSERRNUM__ (obj2, EPIPE); \ + case EINPROGRESS: return __SYSERRNUM__ (obj2, EINPROG); \ + case EWOULDBLOCK: return __SYSERRNUM__ (obj2, EAGAIN); \ + default: return __SYSERRNUM__ (obj2, ESYSERR); \ + } \ + } + + #else + + #define IMPLEMENT_SYSERR_TO_ERRNUM(obj1,obj2) \ + static __SYSERRTYPE__(obj1) syserr_to_errnum (int e) \ + { \ + switch (e) \ + { \ + case ENOMEM: return __SYSERRNUM__ (obj2, ENOMEM); \ + case EINVAL: return __SYSERRNUM__ (obj2, EINVAL); \ + case EBUSY: \ + case EACCES: return __SYSERRNUM__ (obj2, EACCES); \ + case EPERM: return __SYSERRNUM__ (obj2, EPERM); \ + case ENOTDIR: return __SYSERRNUM__ (obj2, ENOTDIR); \ + case ENOENT: return __SYSERRNUM__ (obj2, ENOENT); \ + case EEXIST: return __SYSERRNUM__ (obj2, EEXIST); \ + case EINTR: return __SYSERRNUM__ (obj2, EINTR); \ + case EPIPE: return __SYSERRNUM__ (obj2, EPIPE); \ + case EINPROGRESS: return __SYSERRNUM__ (obj2, EINPROG); \ + default: return __SYSERRNUM__ (obj2, ESYSERR); \ + } \ + } + + #endif + +#endif diff --git a/hawk/lib/tio.c b/hawk/lib/tio.c new file mode 100644 index 00000000..ebf85e90 --- /dev/null +++ b/hawk/lib/tio.c @@ -0,0 +1,743 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include "hawk-prv.h" + +#define STATUS_OUTPUT_DYNBUF (1 << 0) +#define STATUS_INPUT_DYNBUF (1 << 1) +#define STATUS_INPUT_ILLSEQ (1 << 2) +#define STATUS_INPUT_EOF (1 << 3) + +static int detach_in (hawk_tio_t* tio, int fini); +static int detach_out (hawk_tio_t* tio, int fini); + +hawk_tio_t* hawk_tio_open (hawk_t* hawk, hawk_oow_t xtnsize, int flags) +{ + hawk_tio_t* tio; + + tio = (hawk_tio_t*)hawk_allocmem(hawk, HAWK_SIZEOF(hawk_tio_t) + xtnsize); + if (tio) + { + if (hawk_tio_init(tio, hawk, flags) <= -1) + { + hawk_freemem (hawk, tio); + return HAWK_NULL; + } + else HAWK_MEMSET (tio + 1, 0, xtnsize); + } + return tio; +} + +int hawk_tio_close (hawk_tio_t* tio) +{ + int n = hawk_tio_fini(tio); + hawk_freemem (tio->hawk, tio); + return n; +} + +int hawk_tio_init (hawk_tio_t* tio, hawk_t* hawk, int flags) +{ + HAWK_MEMSET (tio, 0, HAWK_SIZEOF(*tio)); + + tio->hawk = hawk; + tio->cmgr = hawk_getcmgr(hawk); + + tio->flags = flags; + + /* + tio->input_func = HAWK_NULL; + tio->input_arg = HAWK_NULL; + tio->output_func = HAWK_NULL; + tio->output_arg = HAWK_NULL; + + tio->status = 0; + tio->inbuf_cur = 0; + tio->inbuf_len = 0; + tio->outbuf_len = 0; + */ + + tio->errnum = HAWK_TIO_ENOERR; + return 0; +} + +int hawk_tio_fini (hawk_tio_t* tio) +{ + int ret = 0; + + hawk_tio_flush (tio); /* don't care about the result */ + if (detach_in (tio, 1) <= -1) ret = -1; + if (detach_out (tio, 1) <= -1) ret = -1; + + return ret; +} + + +hawk_tio_errnum_t hawk_tio_geterrnum (const hawk_tio_t* tio) +{ + return tio->errnum; +} + +void hawk_tio_seterrnum (hawk_tio_t* tio, hawk_tio_errnum_t errnum) +{ + tio->errnum = errnum; +} + +hawk_cmgr_t* hawk_tio_getcmgr (hawk_tio_t* tio) +{ + return tio->cmgr; +} + +void hawk_tio_setcmgr (hawk_tio_t* tio, hawk_cmgr_t* cmgr) +{ + tio->cmgr = cmgr; +} + +int hawk_tio_attachin ( + hawk_tio_t* tio, hawk_tio_io_impl_t input, + hawk_bch_t* bufptr, hawk_oow_t bufcapa) +{ + hawk_bch_t* xbufptr; + + if (input == HAWK_NULL || bufcapa < HAWK_TIO_MININBUFCAPA) + { + tio->errnum = HAWK_TIO_EINVAL; + return -1; + } + + if (hawk_tio_detachin(tio) <= -1) return -1; + + HAWK_ASSERT (tio->hawk, tio->in.fun == HAWK_NULL); + + xbufptr = bufptr; + if (xbufptr == HAWK_NULL) + { + xbufptr = hawk_allocmem(tio->hawk, HAWK_SIZEOF(hawk_bch_t) * bufcapa); + if (xbufptr == HAWK_NULL) + { + tio->errnum = HAWK_TIO_ENOMEM; + return -1; + } + } + + tio->errnum = HAWK_TIO_ENOERR; + if (input(tio, HAWK_TIO_OPEN, HAWK_NULL, 0) <= -1) + { + if (tio->errnum == HAWK_TIO_ENOERR) tio->errnum = HAWK_TIO_EOTHER; + if (xbufptr != bufptr) hawk_freemem (tio->hawk, xbufptr); + return -1; + } + + /* if i defined tio->io[2] instead of tio->in and tio-out, + * i would be able to shorten code amount. but fields to initialize + * are not symmetric between input and output. + * so it's just a bit clumsy that i repeat almost the same code + * in hawk_tio_attachout(). + */ + + tio->in.fun = input; + tio->in.buf.ptr = xbufptr; + tio->in.buf.capa = bufcapa; + + tio->status &= ~(STATUS_INPUT_ILLSEQ | STATUS_INPUT_EOF); + tio->inbuf_cur = 0; + tio->inbuf_len = 0; + + if (xbufptr != bufptr) tio->status |= STATUS_INPUT_DYNBUF; + return 0; +} + +static int detach_in (hawk_tio_t* tio, int fini) +{ + int ret = 0; + + if (tio->in.fun) + { + tio->errnum = HAWK_TIO_ENOERR; + if (tio->in.fun(tio, HAWK_TIO_CLOSE, HAWK_NULL, 0) <= -1) + { + if (tio->errnum == HAWK_TIO_ENOERR) tio->errnum = HAWK_TIO_EOTHER; + + /* returning with an error here allows you to retry detaching */ + if (!fini) return -1; + + /* otherwise, you can't retry since the input handler information + * is reset below */ + ret = -1; + } + + if (tio->status & STATUS_INPUT_DYNBUF) + { + hawk_freemem(tio->hawk, tio->in.buf.ptr); + tio->status &= ~STATUS_INPUT_DYNBUF; + } + + tio->in.fun = HAWK_NULL; + tio->in.buf.ptr = HAWK_NULL; + tio->in.buf.capa = 0; + } + + return ret; +} + +int hawk_tio_detachin (hawk_tio_t* tio) +{ + return detach_in (tio, 0); +} + +int hawk_tio_attachout ( + hawk_tio_t* tio, hawk_tio_io_impl_t output, + hawk_bch_t* bufptr, hawk_oow_t bufcapa) +{ + hawk_bch_t* xbufptr; + + if (output == HAWK_NULL || bufcapa < HAWK_TIO_MINOUTBUFCAPA) + { + tio->errnum = HAWK_TIO_EINVAL; + return -1; + } + + if (hawk_tio_detachout(tio) == -1) return -1; + + HAWK_ASSERT (tio->hawk, tio->out.fun == HAWK_NULL); + + xbufptr = bufptr; + if (xbufptr == HAWK_NULL) + { + xbufptr = hawk_allocmem(tio->hawk, HAWK_SIZEOF(hawk_bch_t) * bufcapa); + if (xbufptr == HAWK_NULL) + { + tio->errnum = HAWK_TIO_ENOMEM; + return -1; + } + } + + tio->errnum = HAWK_TIO_ENOERR; + if (output(tio, HAWK_TIO_OPEN, HAWK_NULL, 0) <= -1) + { + if (tio->errnum == HAWK_TIO_ENOERR) tio->errnum = HAWK_TIO_EOTHER; + if (xbufptr != bufptr) hawk_freemem (tio->hawk, xbufptr); + return -1; + } + + tio->out.fun = output; + tio->out.buf.ptr = xbufptr; + tio->out.buf.capa = bufcapa; + + tio->outbuf_len = 0; + + if (xbufptr != bufptr) tio->status |= STATUS_OUTPUT_DYNBUF; + return 0; +} + +static int detach_out (hawk_tio_t* tio, int fini) +{ + int ret = 0; + + if (tio->out.fun) + { + hawk_tio_flush (tio); /* don't care about the result */ + + tio->errnum = HAWK_TIO_ENOERR; + if (tio->out.fun (tio, HAWK_TIO_CLOSE, HAWK_NULL, 0) <= -1) + { + if (tio->errnum == HAWK_TIO_ENOERR) tio->errnum = HAWK_TIO_EOTHER; + /* returning with an error here allows you to retry detaching */ + if (!fini) return -1; + + /* otherwise, you can't retry since the input handler information + * is reset below */ + ret = -1; + } + + if (tio->status & STATUS_OUTPUT_DYNBUF) + { + hawk_freemem (tio->hawk, tio->out.buf.ptr); + tio->status &= ~STATUS_OUTPUT_DYNBUF; + } + + tio->out.fun = HAWK_NULL; + tio->out.buf.ptr = HAWK_NULL; + tio->out.buf.capa = 0; + } + + return ret; +} + +int hawk_tio_detachout (hawk_tio_t* tio) +{ + return detach_out (tio, 0); +} + +hawk_ooi_t hawk_tio_flush (hawk_tio_t* tio) +{ + hawk_oow_t left, count; + hawk_ooi_t n; + hawk_bch_t* cur; + + if (tio->out.fun == HAWK_NULL) + { + tio->errnum = HAWK_TIO_ENOUTF; + return (hawk_ooi_t)-1; + } + + left = tio->outbuf_len; + cur = tio->out.buf.ptr; + while (left > 0) + { + tio->errnum = HAWK_TIO_ENOERR; + n = tio->out.fun (tio, HAWK_TIO_DATA, cur, left); + if (n <= -1) + { + if (tio->errnum == HAWK_TIO_ENOERR) tio->errnum = HAWK_TIO_EOTHER; + if (cur != tio->out.buf.ptr) + { + HAWK_MEMCPY (tio->out.buf.ptr, cur, left); + tio->outbuf_len = left; + } + return -1; + } + if (n == 0) + { + if (cur != tio->out.buf.ptr) + HAWK_MEMCPY (tio->out.buf.ptr, cur, left); + break; + } + + left -= n; + cur += n; + } + + count = tio->outbuf_len - left; + tio->outbuf_len = left; + + return (hawk_ooi_t)count; +} + +void hawk_tio_drain (hawk_tio_t* tio) +{ + tio->status &= ~(STATUS_INPUT_ILLSEQ | STATUS_INPUT_EOF); + tio->inbuf_cur = 0; + tio->inbuf_len = 0; + tio->outbuf_len = 0; + tio->errnum = HAWK_TIO_ENOERR; +} + +/* ------------------------------------------------------------- */ + + +hawk_ooi_t hawk_tio_readbchars (hawk_tio_t* tio, hawk_bch_t* buf, hawk_oow_t size) +{ + hawk_oow_t nread; + hawk_ooi_t n; + + /*HAWK_ASSERT (tio->hawk, tio->in.fun != HAWK_NULL);*/ + if (tio->in.fun == HAWK_NULL) + { + tio->errnum = HAWK_TIO_ENINPF; + return -1; + } + + /* note that this function doesn't check if + * tio->status is set with STATUS_INPUT_ILLSEQ + * since this function can simply return the next + * available byte. */ + + if (size > HAWK_TYPE_MAX(hawk_ooi_t)) size = HAWK_TYPE_MAX(hawk_ooi_t); + + nread = 0; + while (nread < size) + { + if (tio->inbuf_cur >= tio->inbuf_len) + { + tio->errnum = HAWK_TIO_ENOERR; + n = tio->in.fun ( + tio, HAWK_TIO_DATA, + tio->in.buf.ptr, tio->in.buf.capa); + if (n == 0) break; + if (n <= -1) + { + if (tio->errnum == HAWK_TIO_ENOERR) tio->errnum = HAWK_TIO_EOTHER; + return -1; + } + + tio->inbuf_cur = 0; + tio->inbuf_len = (hawk_oow_t)n; + } + + do + { + buf[nread] = tio->in.buf.ptr[tio->inbuf_cur++]; + /* TODO: support a different line terminator */ + if (buf[nread++] == '\n') goto done; + } + while (tio->inbuf_cur < tio->inbuf_len && nread < size); + } + +done: + return nread; +} + +static HAWK_INLINE hawk_ooi_t tio_read_widechars ( + hawk_tio_t* tio, hawk_uch_t* buf, hawk_oow_t bufsize) +{ + hawk_oow_t mlen, wlen; + hawk_ooi_t n; + int x; + + if (tio->inbuf_cur >= tio->inbuf_len) + { + tio->inbuf_cur = 0; + tio->inbuf_len = 0; + + getc_conv: + if (tio->status & STATUS_INPUT_EOF) n = 0; + else + { + tio->errnum = HAWK_TIO_ENOERR; + n = tio->in.fun ( + tio, HAWK_TIO_DATA, + &tio->in.buf.ptr[tio->inbuf_len], + tio->in.buf.capa - tio->inbuf_len); + } + if (n == 0) + { + tio->status |= STATUS_INPUT_EOF; + + if (tio->inbuf_cur < tio->inbuf_len) + { + /* no more input from the underlying input handler. + * but some incomplete bytes in the buffer. */ + if (tio->flags & HAWK_TIO_IGNOREECERR) + { + /* tread them as illegal sequence */ + goto ignore_illseq; + } + else + { + tio->errnum = HAWK_TIO_EICSEQ; + return -1; + } + } + + return 0; + } + if (n <= -1) + { + if (tio->errnum == HAWK_TIO_ENOERR) tio->errnum = HAWK_TIO_EOTHER; + return -1; + } + + tio->inbuf_len += n; + } + + mlen = tio->inbuf_len - tio->inbuf_cur; + wlen = bufsize; + + x = hawk_conv_bchars_to_uchars_upto_stopper_with_cmgr( + &tio->in.buf.ptr[tio->inbuf_cur], + &mlen, buf, &wlen, '\n', tio->cmgr); + tio->inbuf_cur += mlen; + + if (x == -3) + { + /* incomplete sequence */ + if (wlen <= 0) + { + /* not even a single character was handled. + * shift bytes in the buffer to the head. */ + HAWK_ASSERT (tio->hawk, mlen <= 0); + tio->inbuf_len = tio->inbuf_len - tio->inbuf_cur; + HAWK_MEMCPY (&tio->in.buf.ptr[0], + &tio->in.buf.ptr[tio->inbuf_cur], + tio->inbuf_len * HAWK_SIZEOF(tio->in.buf.ptr[0])); + tio->inbuf_cur = 0; + goto getc_conv; /* and read more */ + } + + /* get going if some characters are handled */ + } + else if (x == -2) + { + /* buffer not large enough */ + HAWK_ASSERT (tio->hawk, wlen > 0); + + /* the wide-character buffer is not just large enough to + * hold the entire conversion result. lets's go on so long as + * 1 wide-character is produced though it may be inefficient. + */ + } + else if (x <= -1) + { + /* illegal sequence */ + if (tio->flags & HAWK_TIO_IGNOREECERR) + { + ignore_illseq: + tio->inbuf_cur++; /* skip one byte */ + buf[wlen++] = '?'; + } + else if (wlen <= 0) + { + tio->errnum = HAWK_TIO_EILSEQ; + return -1; + } + else + { + /* some characters are already handled. + * mark that an illegal sequence encountered + * and carry on. */ + tio->status |= STATUS_INPUT_ILLSEQ; + } + } + + return wlen; +} + +hawk_ooi_t hawk_tio_readuchars (hawk_tio_t* tio, hawk_uch_t* buf, hawk_oow_t size) +{ + hawk_oow_t nread = 0; + hawk_ooi_t n; + + /*HAWK_ASSERT (tio->hawk, tio->in.fun != HAWK_NULL);*/ + if (tio->in.fun == HAWK_NULL) + { + tio->errnum = HAWK_TIO_ENINPF; + return -1; + } + + if (size > HAWK_TYPE_MAX(hawk_ooi_t)) size = HAWK_TYPE_MAX(hawk_ooi_t); + + while (nread < size) + { + if (tio->status & STATUS_INPUT_ILLSEQ) + { + tio->status &= ~STATUS_INPUT_ILLSEQ; + tio->errnum = HAWK_TIO_EILSEQ; + return -1; + } + + n = tio_read_widechars (tio, &buf[nread], size - nread); + if (n == 0) break; + if (n <= -1) return -1; + + nread += n; + if (buf[nread-1] == '\n') break; + } + + return nread; +} + + +/* ------------------------------------------------------------- */ +hawk_ooi_t hawk_tio_writebchars (hawk_tio_t* tio, const hawk_bch_t* mptr, hawk_oow_t mlen) +{ + if (tio->outbuf_len >= tio->out.buf.capa) + { + /* maybe, previous flush operation has failed a few + * times previously. so the buffer is full. + */ + tio->errnum = HAWK_TIO_ENOSPC; + return -1; + } + + if (mlen == (hawk_oow_t)-1) + { + hawk_oow_t pos = 0; + + if (tio->flags & HAWK_TIO_NOAUTOFLUSH) + { + while (mptr[pos] != '\0') + { + tio->out.buf.ptr[tio->outbuf_len++] = mptr[pos++]; + if (tio->outbuf_len >= tio->out.buf.capa && + hawk_tio_flush(tio) <= -1) return -1; + if (pos >= HAWK_TYPE_MAX(hawk_ooi_t)) break; + } + } + else + { + int nl = 0; + while (mptr[pos] != '\0') + { + tio->out.buf.ptr[tio->outbuf_len++] = mptr[pos]; + if (tio->outbuf_len >= tio->out.buf.capa) + { + if (hawk_tio_flush(tio) <= -1) return -1; + nl = 0; + } + else if (mptr[pos] == '\n') nl = 1; + /* TODO: different line terminator */ + if (++pos >= HAWK_TYPE_MAX(hawk_ooi_t)) break; + } + if (nl && hawk_tio_flush(tio) <= -1) return -1; + } + + return pos; + } + else + { + const hawk_bch_t* xptr, * xend; + hawk_oow_t capa; + int nl = 0; + + /* adjust mlen for the type difference between the parameter + * and the return value */ + if (mlen > HAWK_TYPE_MAX(hawk_ooi_t)) mlen = HAWK_TYPE_MAX(hawk_ooi_t); + xptr = mptr; + + /* handle the parts that can't fit into the internal buffer */ + while (mlen >= (capa = tio->out.buf.capa - tio->outbuf_len)) + { + for (xend = xptr + capa; xptr < xend; xptr++) + tio->out.buf.ptr[tio->outbuf_len++] = *xptr; + if (hawk_tio_flush(tio) <= -1) return -1; + mlen -= capa; + } + + if (tio->flags & HAWK_TIO_NOAUTOFLUSH) + { + /* handle the last part that can fit into the internal buffer */ + for (xend = xptr + mlen; xptr < xend; xptr++) + tio->out.buf.ptr[tio->outbuf_len++] = *xptr; + } + else + { + /* handle the last part that can fit into the internal buffer */ + for (xend = xptr + mlen; xptr < xend; xptr++) + { + /* TODO: support different line terminating characeter */ + if (*xptr == '\n') + { + nl = 1; + break; + } + + tio->out.buf.ptr[tio->outbuf_len++] = *xptr; + } + + /* continue copying without checking for nl */ + while (xptr < xend) tio->out.buf.ptr[tio->outbuf_len++] = *xptr++; + } + + /* if the last part contains a new line, flush the internal + * buffer. note that this flushes characters after nl also.*/ + if (nl && hawk_tio_flush(tio) <= -1) return -1; + + /* returns the number multi-byte characters handled */ + return xptr - mptr; + } +} + +hawk_ooi_t hawk_tio_writeuchars (hawk_tio_t* tio, const hawk_uch_t* wptr, hawk_oow_t wlen) +{ + hawk_oow_t capa, wcnt, mcnt, xwlen; + int n, nl = 0; + + if (tio->outbuf_len >= tio->out.buf.capa) + { + /* maybe, previous flush operation has failed a few + * times previously. so the buffer is full. */ + tio->errnum = HAWK_TIO_ENOSPC; + return -1; + } + + if (wlen == (hawk_oow_t)-1) wlen = hawk_count_ucstr(wptr); + if (wlen > HAWK_TYPE_MAX(hawk_ooi_t)) wlen = HAWK_TYPE_MAX(hawk_ooi_t); + + xwlen = wlen; + while (xwlen > 0) + { + capa = tio->out.buf.capa - tio->outbuf_len; + wcnt = xwlen; mcnt = capa; + + n = hawk_conv_uchars_to_bchars_with_cmgr(wptr, &wcnt, &tio->out.buf.ptr[tio->outbuf_len], &mcnt, tio->cmgr); + tio->outbuf_len += mcnt; + + if (n == -2) + { + /* the buffer is not large enough to + * convert more. so flush now and continue. + * note that the buffer may not be full though + * it is not large enough in this case */ + if (hawk_tio_flush(tio) <= -1) return -1; + nl = 0; + } + else + { + if (tio->outbuf_len >= tio->out.buf.capa) + { + /* flush the full buffer regardless of conversion + * result. */ + if (hawk_tio_flush (tio) <= -1) return -1; + nl = 0; + } + + if (n <= -1) + { + /* an invalid wide-character is encountered. */ + if (tio->flags & HAWK_TIO_IGNOREECERR) + { + /* insert a question mark for an illegal + * character. */ + HAWK_ASSERT (tio->hawk, tio->outbuf_len < tio->out.buf.capa); + tio->out.buf.ptr[tio->outbuf_len++] = '?'; + wcnt++; /* skip this illegal character */ + /* don't need to increment mcnt since + * it's not used below */ + } + else + { + tio->errnum = HAWK_TIO_EILCHR; + return -1; + } + } + else + { + if (!(tio->flags & HAWK_TIO_NOAUTOFLUSH) && !nl) + { + /* checking for a newline this way looks damn ugly. + * TODO: how can i do this more elegantly? */ + hawk_oow_t i = wcnt; + while (i > 0) + { + /* scan backward assuming a line terminator + * is typically at the back */ + if (wptr[--i] == '\n') + { + /* TOOD: handle different line terminator */ + nl = 1; + break; + } + } + } + } + } + wptr += wcnt; xwlen -= wcnt; + } + + if (nl && hawk_tio_flush(tio) <= -1) return -1; + return wlen; +} diff --git a/hawk/lib/tre-ast.c b/hawk/lib/tre-ast.c new file mode 100644 index 00000000..918d6d34 --- /dev/null +++ b/hawk/lib/tre-ast.c @@ -0,0 +1,266 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + tre-ast.c - Abstract syntax tree (AST) routines + +This is the license, copyright notice, and disclaimer for TRE, a regex +matching package (library and tools) with support for approximate +matching. + +Copyright (c) 2001-2009 Ville Laurikari +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "tre-ast.h" + +tre_ast_node_t * +tre_ast_new_node(tre_mem_t mem, tre_ast_type_t type, size_t size) +{ + tre_ast_node_t *node; + + node = tre_mem_calloc(mem, sizeof(*node)); + if (!node) return NULL; + node->obj = tre_mem_calloc(mem, size); + if (!node->obj) return NULL; + node->type = type; + node->nullable = -1; + node->submatch_id = -1; + + return node; +} + +tre_ast_node_t * tre_ast_new_literal(tre_mem_t mem, int code_min, int code_max, int position) +{ + tre_ast_node_t *node; + tre_literal_t *lit; + + node = tre_ast_new_node(mem, LITERAL, sizeof(tre_literal_t)); + if (!node) return NULL; + lit = node->obj; + lit->code_min = code_min; + lit->code_max = code_max; + lit->position = position; + + return node; +} + +tre_ast_node_t * +tre_ast_new_iter(tre_mem_t mem, tre_ast_node_t *arg, int min, int max, + int minimal) +{ + tre_ast_node_t *node; + tre_iteration_t *iter; + + node = tre_ast_new_node(mem, ITERATION, sizeof(tre_iteration_t)); + if (!node) return NULL; + iter = node->obj; + iter->arg = arg; + iter->min = min; + iter->max = max; + iter->minimal = minimal; + node->num_submatches = arg->num_submatches; + + return node; +} + +tre_ast_node_t * +tre_ast_new_union(tre_mem_t mem, tre_ast_node_t *left, tre_ast_node_t *right) +{ + tre_ast_node_t *node; + + node = tre_ast_new_node(mem, UNION, sizeof(tre_union_t)); + if (node == NULL) return NULL; + ((tre_union_t *)node->obj)->left = left; + ((tre_union_t *)node->obj)->right = right; + node->num_submatches = left->num_submatches + right->num_submatches; + + return node; +} + +tre_ast_node_t * +tre_ast_new_catenation(tre_mem_t mem, tre_ast_node_t *left, + tre_ast_node_t *right) +{ + tre_ast_node_t *node; + + node = tre_ast_new_node(mem, CATENATION, sizeof(tre_catenation_t)); + if (node == NULL) return NULL; + ((tre_catenation_t *)node->obj)->left = left; + ((tre_catenation_t *)node->obj)->right = right; + node->num_submatches = left->num_submatches + right->num_submatches; + + return node; +} + +#ifdef TRE_DEBUG + +static void +tre_findent(FILE *stream, int i) +{ + while (i-- > 0) + fputc(' ', stream); +} + +void +tre_print_params(int *params) +{ + int i; + if (params) + { + DPRINT(("params [")); + for (i = 0; i < TRE_PARAM_LAST; i++) + { + if (params[i] == TRE_PARAM_UNSET) + DPRINT(("unset")); + else if (params[i] == TRE_PARAM_DEFAULT) + DPRINT(("default")); + else + DPRINT(("%d", params[i])); + if (i < TRE_PARAM_LAST - 1) + DPRINT((", ")); + } + DPRINT(("]")); + } +} + +static void +tre_do_print(FILE *stream, tre_ast_node_t *ast, int indent) +{ + int code_min, code_max, pos; + int num_tags = ast->num_tags; + tre_literal_t *lit; + tre_iteration_t *iter; + + tre_findent(stream, indent); + switch (ast->type) + { + case LITERAL: + lit = ast->obj; + code_min = lit->code_min; + code_max = lit->code_max; + pos = lit->position; + if (IS_EMPTY(lit)) + { + fprintf(stream, "literal empty\n"); + } + else if (IS_ASSERTION(lit)) + { + int i; + char *assertions[] = { "bol", "eol", "ctype", "!ctype", + "bow", "eow", "wb", "!wb" + }; + if (code_max >= ASSERT_LAST << 1) + assert(0); + fprintf(stream, "assertions: "); + for (i = 0; (1 << i) <= ASSERT_LAST; i++) + if (code_max & (1 << i)) + fprintf(stream, "%s ", assertions[i]); + fprintf(stream, "\n"); + } + else if (IS_TAG(lit)) + { + fprintf(stream, "tag %d\n", code_max); + } + else if (IS_BACKREF(lit)) + { + fprintf(stream, "backref %d, pos %d\n", code_max, pos); + } + else if (IS_PARAMETER(lit)) + { + tre_print_params(lit->u.params); + fprintf(stream, "\n"); + } + else + { + fprintf(stream, "literal (%c, %c) (%d, %d), pos %d, sub %d, " + "%d tags\n", code_min, code_max, code_min, code_max, pos, + ast->submatch_id, num_tags); + } + break; + case ITERATION: + iter = ast->obj; + fprintf(stream, "iteration {%d, %d}, sub %d, %d tags, %s\n", + iter->min, iter->max, ast->submatch_id, num_tags, + iter->minimal ? "minimal" : "greedy"); + tre_do_print(stream, iter->arg, indent + 2); + break; + case UNION: + fprintf(stream, "union, sub %d, %d tags\n", ast->submatch_id, num_tags); + tre_do_print(stream, ((tre_union_t *)ast->obj)->left, indent + 2); + tre_do_print(stream, ((tre_union_t *)ast->obj)->right, indent + 2); + break; + case CATENATION: + fprintf(stream, "catenation, sub %d, %d tags\n", ast->submatch_id, + num_tags); + tre_do_print(stream, ((tre_catenation_t *)ast->obj)->left, indent + 2); + tre_do_print(stream, ((tre_catenation_t *)ast->obj)->right, indent + 2); + break; + default: + assert(0); + break; + } +} + +static void +tre_ast_fprint(FILE *stream, tre_ast_node_t *ast) +{ + tre_do_print(stream, ast, 0); +} + +void +tre_ast_print(tre_ast_node_t *tree) +{ + printf("AST:\n"); + tre_ast_fprint(stdout, tree); +} + +#endif /* TRE_DEBUG */ + +/* EOF */ diff --git a/hawk/lib/tre-ast.h b/hawk/lib/tre-ast.h new file mode 100644 index 00000000..62d80736 --- /dev/null +++ b/hawk/lib/tre-ast.h @@ -0,0 +1,176 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + tre-ast.h - Abstract syntax tree (AST) definitions + +This is the license, copyright notice, and disclaimer for TRE, a regex +matching package (library and tools) with support for approximate +matching. + +Copyright (c) 2001-2009 Ville Laurikari +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +#ifndef _HAWK_LIB_CMN_TRE_AST_H_ +#define _HAWK_LIB_CMN_TRE_AST_H_ + +#include "tre-prv.h" +#include "tre-compile.h" + +/* The different AST node types. */ +typedef enum +{ + LITERAL, + CATENATION, + ITERATION, + UNION +} tre_ast_type_t; + +/* Special subtypes of TRE_LITERAL. */ +#define EMPTY -1 /* Empty leaf (denotes empty string). */ +#define ASSERTION -2 /* Assertion leaf. */ +#define TAG -3 /* Tag leaf. */ +#define BACKREF -4 /* Back reference leaf. */ +#define PARAMETER -5 /* Parameter. */ + +#define IS_SPECIAL(x) ((x)->code_min < 0) +#define IS_EMPTY(x) ((x)->code_min == EMPTY) +#define IS_ASSERTION(x) ((x)->code_min == ASSERTION) +#define IS_TAG(x) ((x)->code_min == TAG) +#define IS_BACKREF(x) ((x)->code_min == BACKREF) +#define IS_PARAMETER(x) ((x)->code_min == PARAMETER) + + +/* A generic AST node. All AST nodes consist of this node on the top + level with `obj' pointing to the actual content. */ +typedef struct +{ + tre_ast_type_t type; /* Type of the node. */ + void *obj; /* Pointer to actual node. */ + int nullable; + int submatch_id; + int num_submatches; + int num_tags; + tre_pos_and_tags_t *firstpos; + tre_pos_and_tags_t *lastpos; +} tre_ast_node_t; + + +/* A "literal" node. These are created for assertions, back references, + tags, matching parameter settings, and all expressions that match one + character. */ +typedef struct +{ + long code_min; + long code_max; + int position; + union + { + tre_ctype_t class; + int *params; + } u; + tre_ctype_t *neg_classes; +} tre_literal_t; + +/* A "catenation" node. These are created when two regexps are concatenated. + If there are more than one subexpressions in sequence, the `left' part + holds all but the last, and `right' part holds the last subexpression + (catenation is left associative). */ +typedef struct +{ + tre_ast_node_t *left; + tre_ast_node_t *right; +} tre_catenation_t; + +/* An "iteration" node. These are created for the "*", "+", "?", and "{m,n}" + operators. */ +typedef struct +{ + /* Subexpression to match. */ + tre_ast_node_t *arg; + /* Minimum number of consecutive matches. */ + int min; + /* Maximum number of consecutive matches. */ + int max; + /* If 0, match as many characters as possible, if 1 match as few as + possible. Note that this does not always mean the same thing as + matching as many/few repetitions as possible. */ + unsigned int minimal:1; + /* Approximate matching parameters (or NULL). */ + int *params; +} tre_iteration_t; + +/* An "union" node. These are created for the "|" operator. */ +typedef struct +{ + tre_ast_node_t *left; + tre_ast_node_t *right; +} tre_union_t; + +tre_ast_node_t* tre_ast_new_node(tre_mem_t mem, tre_ast_type_t type, size_t size); + +tre_ast_node_t* tre_ast_new_literal(tre_mem_t mem, int code_min, int code_max, int position); + +tre_ast_node_t* tre_ast_new_iter(tre_mem_t mem, tre_ast_node_t *arg, int min, int max, int minimal); + +tre_ast_node_t* tre_ast_new_union(tre_mem_t mem, tre_ast_node_t *left, tre_ast_node_t *right); + +tre_ast_node_t* tre_ast_new_catenation(tre_mem_t mem, tre_ast_node_t *left, tre_ast_node_t *right); + +#ifdef TRE_DEBUG +void tre_ast_print(tre_ast_node_t *tree); +/* XXX - rethink AST printing API */ +void tre_print_params(int *params); +#endif /* TRE_DEBUG */ + +#endif /* TRE_AST_H */ + +/* EOF */ diff --git a/hawk/lib/tre-compile.c b/hawk/lib/tre-compile.c new file mode 100644 index 00000000..7e7d7386 --- /dev/null +++ b/hawk/lib/tre-compile.c @@ -0,0 +1,2278 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + tre-compile.c - TRE regex compiler + +This is the license, copyright notice, and disclaimer for TRE, a regex +matching package (library and tools) with support for approximate +matching. + +Copyright (c) 2001-2009 Ville Laurikari +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + TODO: + - Fix tre_ast_to_tnfa() to recurse using a stack instead of recursive + function calls. +*/ + + +#include +#include "tre-stack.h" +#include "tre-ast.h" +#include "tre-parse.h" +#include "tre-compile.h" + +/* + Algorithms to setup tags so that submatch addressing can be done. +*/ + +static HAWK_INLINE void* xcalloc (hawk_t* hawk, hawk_oow_t nmemb, hawk_oow_t size) +{ + void* ptr = hawk_allocmem(hawk, nmemb * size); + if (ptr) HAWK_MEMSET (ptr, 0, nmemb * size); + return ptr; +} + +/* Inserts a catenation node to the root of the tree given in `node'. + As the left child a new tag with number `tag_id' to `node' is added, + and the right child is the old root. */ +static reg_errcode_t +tre_add_tag_left(tre_mem_t mem, tre_ast_node_t *node, int tag_id) +{ + tre_catenation_t *c; + + DPRINT(("add_tag_left: tag %d\n", tag_id)); + + c = tre_mem_alloc(mem, sizeof(*c)); + if (c == NULL) return REG_ESPACE; + c->left = tre_ast_new_literal(mem, TAG, tag_id, -1); + if (c->left == NULL) return REG_ESPACE; + c->right = tre_mem_alloc(mem, sizeof(tre_ast_node_t)); + if (c->right == NULL) return REG_ESPACE; + + c->right->obj = node->obj; + c->right->type = node->type; + c->right->nullable = -1; + c->right->submatch_id = -1; + c->right->firstpos = NULL; + c->right->lastpos = NULL; + c->right->num_tags = 0; + node->obj = c; + node->type = CATENATION; + return REG_OK; +} + +/* Inserts a catenation node to the root of the tree given in `node'. + As the right child a new tag with number `tag_id' to `node' is added, + and the left child is the old root. */ +static reg_errcode_t +tre_add_tag_right(tre_mem_t mem, tre_ast_node_t *node, int tag_id) +{ + tre_catenation_t *c; + + DPRINT(("tre_add_tag_right: tag %d\n", tag_id)); + + c = tre_mem_alloc(mem, sizeof(*c)); + if (c == NULL) + return REG_ESPACE; + c->right = tre_ast_new_literal(mem, TAG, tag_id, -1); + if (c->right == NULL) + return REG_ESPACE; + c->left = tre_mem_alloc(mem, sizeof(tre_ast_node_t)); + if (c->left == NULL) + return REG_ESPACE; + + c->left->obj = node->obj; + c->left->type = node->type; + c->left->nullable = -1; + c->left->submatch_id = -1; + c->left->firstpos = NULL; + c->left->lastpos = NULL; + c->left->num_tags = 0; + node->obj = c; + node->type = CATENATION; + return REG_OK; +} + +typedef enum +{ + ADDTAGS_RECURSE, + ADDTAGS_AFTER_ITERATION, + ADDTAGS_AFTER_UNION_LEFT, + ADDTAGS_AFTER_UNION_RIGHT, + ADDTAGS_AFTER_CAT_LEFT, + ADDTAGS_AFTER_CAT_RIGHT, + ADDTAGS_SET_SUBMATCH_END +} tre_addtags_symbol_t; + +typedef struct +{ + int tag; + int next_tag; +} tre_tag_states_t; + + +/* Go through `regset' and set submatch data for submatches that are + using this tag. */ +static void +tre_purge_regset(int *regset, tre_tnfa_t *tnfa, int tag) +{ + int i; + + for (i = 0; regset[i] >= 0; i++) + { + int id = regset[i] / 2; + int start = !(regset[i] % 2); + DPRINT((" Using tag %d for %s offset of " + "submatch %d\n", tag, + start ? "start" : "end", id)); + if (start) + tnfa->submatch_data[id].so_tag = tag; + else + tnfa->submatch_data[id].eo_tag = tag; + } + regset[0] = -1; +} + + +/* Adds tags to appropriate locations in the parse tree in `tree', so that + subexpressions marked for submatch addressing can be traced. */ +static reg_errcode_t +tre_add_tags(tre_mem_t mem, tre_stack_t *stack, tre_ast_node_t *tree, + tre_tnfa_t *tnfa, int first_pass) +{ + reg_errcode_t status = REG_OK; + tre_addtags_symbol_t symbol; + tre_ast_node_t *node = tree; /* Tree node we are currently looking at. */ + int bottom = tre_stack_num_objects(stack); + /* True for first pass (counting number of needed tags) */ + /*int first_pass = (mem == NULL || tnfa == NULL);*/ + int *regset, *orig_regset; + int num_tags = 0; /* Total number of tags. */ + int num_minimals = 0; /* Number of special minimal tags. */ + int tag = 0; /* The tag that is to be added next. */ + int next_tag = 1; /* Next tag to use after this one. */ + int *parents; /* Stack of submatches the current submatch is + contained in. */ + int minimal_tag = -1; /* Tag that marks the beginning of a minimal match. */ + tre_tag_states_t *saved_states; + + tre_tag_direction_t direction = TRE_TAG_MINIMIZE; + if (!first_pass) + { + tnfa->end_tag = 0; + tnfa->minimal_tags[0] = -1; + } + + regset = xmalloc(mem->hawk, sizeof(*regset) * ((tnfa->num_submatches + 1) * 2)); + if (regset == NULL) + return REG_ESPACE; + regset[0] = -1; + orig_regset = regset; + + parents = xmalloc(mem->hawk, sizeof(*parents) * (tnfa->num_submatches + 1)); + if (parents == NULL) + { + xfree(mem->hawk, regset); + return REG_ESPACE; + } + parents[0] = -1; + + saved_states = xmalloc(mem->hawk, sizeof(*saved_states) * (tnfa->num_submatches + 1)); + if (saved_states == NULL) + { + xfree(mem->hawk,regset); + xfree(mem->hawk,parents); + return REG_ESPACE; + } + else + { + unsigned int i; + for (i = 0; i <= tnfa->num_submatches; i++) + saved_states[i].tag = -1; + } + + STACK_PUSH(stack, voidptr, node); + STACK_PUSH(stack, int, ADDTAGS_RECURSE); + + while (tre_stack_num_objects(stack) > bottom) + { + if (status != REG_OK) + break; + + symbol = (tre_addtags_symbol_t)tre_stack_pop_int(stack); + switch (symbol) + { + + case ADDTAGS_SET_SUBMATCH_END: + { + int id = tre_stack_pop_int(stack); + int i; + + /* Add end of this submatch to regset. */ + for (i = 0; regset[i] >= 0; i++); + regset[i] = id * 2 + 1; + regset[i + 1] = -1; + + /* Pop this submatch from the parents stack. */ + for (i = 0; parents[i] >= 0; i++); + parents[i - 1] = -1; + break; + } + + case ADDTAGS_RECURSE: + node = tre_stack_pop_voidptr(stack); + + if (node->submatch_id >= 0) + { + int id = node->submatch_id; + int i; + + + /* Add start of this submatch to regset. */ + for (i = 0; regset[i] >= 0; i++); + regset[i] = id * 2; + regset[i + 1] = -1; + + if (!first_pass) + { + for (i = 0; parents[i] >= 0; i++); + tnfa->submatch_data[id].parents = NULL; + if (i > 0) + { + int *p = xmalloc(mem->hawk, sizeof(*p) * (i + 1)); + if (p == NULL) + { + status = REG_ESPACE; + break; + } + assert(tnfa->submatch_data[id].parents == NULL); + tnfa->submatch_data[id].parents = p; + for (i = 0; parents[i] >= 0; i++) + p[i] = parents[i]; + p[i] = -1; + } + } + + /* Add end of this submatch to regset after processing this + node. */ + STACK_PUSHX(stack, int, node->submatch_id); + STACK_PUSHX(stack, int, ADDTAGS_SET_SUBMATCH_END); + } + + switch (node->type) + { + case LITERAL: + { + tre_literal_t *lit = node->obj; + + if (!IS_SPECIAL(lit) || IS_BACKREF(lit)) + { + int i; + DPRINT(("Literal %d-%d\n", + (int)lit->code_min, (int)lit->code_max)); + if (regset[0] >= 0) + { + /* Regset is not empty, so add a tag before the + literal or backref. */ + if (!first_pass) + { + status = tre_add_tag_left(mem, node, tag); + tnfa->tag_directions[tag] = direction; + if (minimal_tag >= 0) + { + DPRINT(("Minimal %d, %d\n", minimal_tag, tag)); + for (i = 0; tnfa->minimal_tags[i] >= 0; i++); + tnfa->minimal_tags[i] = tag; + tnfa->minimal_tags[i + 1] = minimal_tag; + tnfa->minimal_tags[i + 2] = -1; + minimal_tag = -1; + num_minimals++; + } + tre_purge_regset(regset, tnfa, tag); + } + else + { + DPRINT((" num_tags = 1\n")); + node->num_tags = 1; + } + + DPRINT((" num_tags++\n")); + regset[0] = -1; + tag = next_tag; + num_tags++; + next_tag++; + } + } + else + { + assert(!IS_TAG(lit)); + } + break; + } + + + case CATENATION: + { + tre_catenation_t *cat = node->obj; + tre_ast_node_t *left = cat->left; + tre_ast_node_t *right = cat->right; + int reserved_tag = -1; + DPRINT(("Catenation, next_tag = %d\n", next_tag)); + + + /* After processing right child. */ + STACK_PUSHX(stack, voidptr, node); + STACK_PUSHX(stack, int, ADDTAGS_AFTER_CAT_RIGHT); + + /* Process right child. */ + STACK_PUSHX(stack, voidptr, right); + STACK_PUSHX(stack, int, ADDTAGS_RECURSE); + + /* After processing left child. */ + STACK_PUSHX(stack, int, next_tag + left->num_tags); + DPRINT((" Pushing %d for after left\n", + next_tag + left->num_tags)); + if (left->num_tags > 0 && right->num_tags > 0) + { + /* Reserve the next tag to the right child. */ + DPRINT((" Reserving next_tag %d to right child\n", + next_tag)); + reserved_tag = next_tag; + next_tag++; + } + STACK_PUSHX(stack, int, reserved_tag); + STACK_PUSHX(stack, int, ADDTAGS_AFTER_CAT_LEFT); + + /* Process left child. */ + STACK_PUSHX(stack, voidptr, left); + STACK_PUSHX(stack, int, ADDTAGS_RECURSE); + break; + } + + + case ITERATION: + { + tre_iteration_t *iter = node->obj; + DPRINT(("Iteration\n")); + + if (first_pass) + { + STACK_PUSHX(stack, int, regset[0] >= 0 || iter->minimal); + } + else + { + STACK_PUSHX(stack, int, tag); + STACK_PUSHX(stack, int, iter->minimal); + } + STACK_PUSHX(stack, voidptr, node); + STACK_PUSHX(stack, int, ADDTAGS_AFTER_ITERATION); + + STACK_PUSHX(stack, voidptr, iter->arg); + STACK_PUSHX(stack, int, ADDTAGS_RECURSE); + + /* Regset is not empty, so add a tag here. */ + if (regset[0] >= 0 || iter->minimal) + { + if (!first_pass) + { + int i; + status = tre_add_tag_left(mem, node, tag); + if (iter->minimal) + tnfa->tag_directions[tag] = TRE_TAG_MAXIMIZE; + else + tnfa->tag_directions[tag] = direction; + if (minimal_tag >= 0) + { + DPRINT(("Minimal %d, %d\n", minimal_tag, tag)); + for (i = 0; tnfa->minimal_tags[i] >= 0; i++); + tnfa->minimal_tags[i] = tag; + tnfa->minimal_tags[i + 1] = minimal_tag; + tnfa->minimal_tags[i + 2] = -1; + minimal_tag = -1; + num_minimals++; + } + tre_purge_regset(regset, tnfa, tag); + } + + DPRINT((" num_tags++\n")); + regset[0] = -1; + tag = next_tag; + num_tags++; + next_tag++; + } + direction = TRE_TAG_MINIMIZE; + break; + } + + case UNION: + { + tre_union_t *uni = node->obj; + tre_ast_node_t *left = uni->left; + tre_ast_node_t *right = uni->right; + int left_tag; + int right_tag; + + if (regset[0] >= 0) + { + left_tag = next_tag; + right_tag = next_tag + 1; + } + else + { + left_tag = tag; + right_tag = next_tag; + } + + DPRINT(("Union\n")); + + /* After processing right child. */ + STACK_PUSHX(stack, int, right_tag); + STACK_PUSHX(stack, int, left_tag); + STACK_PUSHX(stack, voidptr, regset); + STACK_PUSHX(stack, int, regset[0] >= 0); + STACK_PUSHX(stack, voidptr, node); + STACK_PUSHX(stack, voidptr, right); + STACK_PUSHX(stack, voidptr, left); + STACK_PUSHX(stack, int, ADDTAGS_AFTER_UNION_RIGHT); + + /* Process right child. */ + STACK_PUSHX(stack, voidptr, right); + STACK_PUSHX(stack, int, ADDTAGS_RECURSE); + + /* After processing left child. */ + STACK_PUSHX(stack, int, ADDTAGS_AFTER_UNION_LEFT); + + /* Process left child. */ + STACK_PUSHX(stack, voidptr, left); + STACK_PUSHX(stack, int, ADDTAGS_RECURSE); + + /* Regset is not empty, so add a tag here. */ + if (regset[0] >= 0) + { + if (!first_pass) + { + int i; + status = tre_add_tag_left(mem, node, tag); + tnfa->tag_directions[tag] = direction; + if (minimal_tag >= 0) + { + DPRINT(("Minimal %d, %d\n", minimal_tag, tag)); + for (i = 0; tnfa->minimal_tags[i] >= 0; i++); + tnfa->minimal_tags[i] = tag; + tnfa->minimal_tags[i + 1] = minimal_tag; + tnfa->minimal_tags[i + 2] = -1; + minimal_tag = -1; + num_minimals++; + } + tre_purge_regset(regset, tnfa, tag); + } + + DPRINT((" num_tags++\n")); + regset[0] = -1; + tag = next_tag; + num_tags++; + next_tag++; + } + + if (node->num_submatches > 0) + { + /* The next two tags are reserved for markers. */ + next_tag++; + tag = next_tag; + next_tag++; + } + + break; + } + } + + if (node->submatch_id >= 0) + { + int i; + /* Push this submatch on the parents stack. */ + for (i = 0; parents[i] >= 0; i++); + parents[i] = node->submatch_id; + parents[i + 1] = -1; + } + + break; /* end case: ADDTAGS_RECURSE */ + + case ADDTAGS_AFTER_ITERATION: + { + int minimal = 0; + int enter_tag; + node = tre_stack_pop_voidptr(stack); + if (first_pass) + { + node->num_tags = ((tre_iteration_t *)node->obj)->arg->num_tags + + tre_stack_pop_int(stack); + minimal_tag = -1; + } + else + { + minimal = tre_stack_pop_int(stack); + enter_tag = tre_stack_pop_int(stack); + if (minimal) + minimal_tag = enter_tag; + } + + DPRINT(("After iteration\n")); + if (!first_pass) + { + DPRINT((" Setting direction to %s\n", + minimal ? "minimize" : "maximize")); + if (minimal) + direction = TRE_TAG_MINIMIZE; + else + direction = TRE_TAG_MAXIMIZE; + } + break; + } + + case ADDTAGS_AFTER_CAT_LEFT: + { + int new_tag = tre_stack_pop_int(stack); + next_tag = tre_stack_pop_int(stack); + DPRINT(("After cat left, tag = %d, next_tag = %d\n", + tag, next_tag)); + if (new_tag >= 0) + { + DPRINT((" Setting tag to %d\n", new_tag)); + tag = new_tag; + } + break; + } + + case ADDTAGS_AFTER_CAT_RIGHT: + DPRINT(("After cat right\n")); + node = tre_stack_pop_voidptr(stack); + if (first_pass) + node->num_tags = ((tre_catenation_t *)node->obj)->left->num_tags + + ((tre_catenation_t *)node->obj)->right->num_tags; + break; + + case ADDTAGS_AFTER_UNION_LEFT: + DPRINT(("After union left\n")); + /* Lift the bottom of the `regset' array so that when processing + the right operand the items currently in the array are + invisible. The original bottom was saved at ADDTAGS_UNION and + will be restored at ADDTAGS_AFTER_UNION_RIGHT below. */ + while (*regset >= 0) + regset++; + break; + + case ADDTAGS_AFTER_UNION_RIGHT: + { + int added_tags, tag_left, tag_right; + tre_ast_node_t *left = tre_stack_pop_voidptr(stack); + tre_ast_node_t *right = tre_stack_pop_voidptr(stack); + DPRINT(("After union right\n")); + node = tre_stack_pop_voidptr(stack); + added_tags = tre_stack_pop_int(stack); + if (first_pass) + { + node->num_tags = ((tre_union_t *)node->obj)->left->num_tags + + ((tre_union_t *)node->obj)->right->num_tags + added_tags + + ((node->num_submatches > 0) ? 2 : 0); + } + regset = tre_stack_pop_voidptr(stack); + tag_left = tre_stack_pop_int(stack); + tag_right = tre_stack_pop_int(stack); + + /* Add tags after both children, the left child gets a smaller + tag than the right child. This guarantees that we prefer + the left child over the right child. */ + /* XXX - This is not always necessary (if the children have + tags which must be seen for every match of that child). */ + /* XXX - Check if this is the only place where tre_add_tag_right + is used. If so, use tre_add_tag_left (putting the tag before + the child as opposed after the child) and throw away + tre_add_tag_right. */ + if (node->num_submatches > 0) + { + if (!first_pass) + { + status = tre_add_tag_right(mem, left, tag_left); + tnfa->tag_directions[tag_left] = TRE_TAG_MAXIMIZE; + status = tre_add_tag_right(mem, right, tag_right); + tnfa->tag_directions[tag_right] = TRE_TAG_MAXIMIZE; + } + DPRINT((" num_tags += 2\n")); + num_tags += 2; + } + direction = TRE_TAG_MAXIMIZE; + break; + } + + default: + assert(0); + break; + + } /* end switch(symbol) */ + } /* end while(tre_stack_num_objects(stack) > bottom) */ + + if (!first_pass) + tre_purge_regset(regset, tnfa, tag); + + if (!first_pass && minimal_tag >= 0) + { + int i; + DPRINT(("Minimal %d, %d\n", minimal_tag, tag)); + for (i = 0; tnfa->minimal_tags[i] >= 0; i++); + tnfa->minimal_tags[i] = tag; + tnfa->minimal_tags[i + 1] = minimal_tag; + tnfa->minimal_tags[i + 2] = -1; + minimal_tag = -1; + num_minimals++; + } + + DPRINT(("tre_add_tags: %s complete. Number of tags %d.\n", + first_pass? "First pass" : "Second pass", num_tags)); + + assert(tree->num_tags == num_tags); + tnfa->end_tag = num_tags; + tnfa->num_tags = num_tags; + tnfa->num_minimals = num_minimals; + xfree(mem->hawk,orig_regset); + xfree(mem->hawk,parents); + xfree(mem->hawk,saved_states); + return status; +} + + + +/* + AST to TNFA compilation routines. +*/ + +typedef enum +{ + COPY_RECURSE, + COPY_SET_RESULT_PTR +} tre_copyast_symbol_t; + +/* Flags for tre_copy_ast(). */ +#define COPY_REMOVE_TAGS 1 +#define COPY_MAXIMIZE_FIRST_TAG 2 + +static reg_errcode_t +tre_copy_ast(tre_mem_t mem, tre_stack_t *stack, tre_ast_node_t *ast, + int flags, int *pos_add, tre_tag_direction_t *tag_directions, + tre_ast_node_t **copy, int *max_pos) +{ + reg_errcode_t status = REG_OK; + int bottom = tre_stack_num_objects(stack); + int num_copied = 0; + int first_tag = 1; + tre_ast_node_t **result = copy; + tre_copyast_symbol_t symbol; + + STACK_PUSH(stack, voidptr, ast); + STACK_PUSH(stack, int, COPY_RECURSE); + + while (status == REG_OK && tre_stack_num_objects(stack) > bottom) + { + tre_ast_node_t *node; + if (status != REG_OK) + break; + + symbol = (tre_copyast_symbol_t)tre_stack_pop_int(stack); + switch (symbol) + { + case COPY_SET_RESULT_PTR: + result = tre_stack_pop_voidptr(stack); + break; + case COPY_RECURSE: + node = tre_stack_pop_voidptr(stack); + switch (node->type) + { + case LITERAL: + { + tre_literal_t *lit = node->obj; + int pos = lit->position; + int min = lit->code_min; + int max = lit->code_max; + if (!IS_SPECIAL(lit) || IS_BACKREF(lit)) + { + /* XXX - e.g. [ab] has only one position but two + nodes, so we are creating holes in the state space + here. Not fatal, just wastes memory. */ + pos += *pos_add; + num_copied++; + } + else if (IS_TAG(lit) && (flags & COPY_REMOVE_TAGS)) + { + /* Change this tag to empty. */ + min = EMPTY; + max = pos = -1; + } + else if (IS_TAG(lit) && (flags & COPY_MAXIMIZE_FIRST_TAG) + && first_tag) + { + /* Maximize the first tag. */ + tag_directions[max] = TRE_TAG_MAXIMIZE; + first_tag = 0; + } + *result = tre_ast_new_literal(mem, min, max, pos); + if (*result == NULL) status = REG_ESPACE; + + if (pos > *max_pos) + *max_pos = pos; + break; + } + case UNION: + { + tre_union_t *uni = node->obj; + tre_union_t *tmp; + *result = tre_ast_new_union(mem, uni->left, uni->right); + if (*result == NULL) + { + status = REG_ESPACE; + break; + } + tmp = (*result)->obj; + result = &tmp->left; + STACK_PUSHX(stack, voidptr, uni->right); + STACK_PUSHX(stack, int, COPY_RECURSE); + STACK_PUSHX(stack, voidptr, &tmp->right); + STACK_PUSHX(stack, int, COPY_SET_RESULT_PTR); + STACK_PUSHX(stack, voidptr, uni->left); + STACK_PUSHX(stack, int, COPY_RECURSE); + break; + } + case CATENATION: + { + tre_catenation_t *cat = node->obj; + tre_catenation_t *tmp; + *result = tre_ast_new_catenation(mem, cat->left, cat->right); + if (*result == NULL) + { + status = REG_ESPACE; + break; + } + tmp = (*result)->obj; + tmp->left = NULL; + tmp->right = NULL; + result = &tmp->left; + + STACK_PUSHX(stack, voidptr, cat->right); + STACK_PUSHX(stack, int, COPY_RECURSE); + STACK_PUSHX(stack, voidptr, &tmp->right); + STACK_PUSHX(stack, int, COPY_SET_RESULT_PTR); + STACK_PUSHX(stack, voidptr, cat->left); + STACK_PUSHX(stack, int, COPY_RECURSE); + break; + } + case ITERATION: + { + tre_iteration_t *iter = node->obj; + STACK_PUSHX(stack, voidptr, iter->arg); + STACK_PUSHX(stack, int, COPY_RECURSE); + *result = tre_ast_new_iter(mem, iter->arg, iter->min, + iter->max, iter->minimal); + if (*result == NULL) + { + status = REG_ESPACE; + break; + } + iter = (*result)->obj; + result = &iter->arg; + break; + } + default: + assert(0); + break; + } + break; + } + } + *pos_add += num_copied; + return status; +} + +typedef enum +{ + EXPAND_RECURSE, + EXPAND_AFTER_ITER +} tre_expand_ast_symbol_t; + +/* Expands each iteration node that has a finite nonzero minimum or maximum + iteration count to a catenated sequence of copies of the node. */ +static reg_errcode_t +tre_expand_ast(tre_mem_t mem, tre_stack_t *stack, tre_ast_node_t *ast, + int *position, tre_tag_direction_t *tag_directions, + int *max_depth) +{ + reg_errcode_t status = REG_OK; + int bottom = tre_stack_num_objects(stack); + int pos_add = 0; + int pos_add_total = 0; + int max_pos = 0; + /* Current approximate matching parameters. */ + int params[TRE_PARAM_LAST]; + /* Approximate parameter nesting level. */ + int params_depth = 0; + int iter_depth = 0; + int i; + + for (i = 0; i < TRE_PARAM_LAST; i++) + params[i] = TRE_PARAM_DEFAULT; + + STACK_PUSHR(stack, voidptr, ast); + STACK_PUSHR(stack, int, EXPAND_RECURSE); + while (status == REG_OK && tre_stack_num_objects(stack) > bottom) + { + tre_ast_node_t *node; + tre_expand_ast_symbol_t symbol; + + if (status != REG_OK) + break; + + DPRINT(("pos_add %d\n", pos_add)); + + symbol = (tre_expand_ast_symbol_t)tre_stack_pop_int(stack); + node = tre_stack_pop_voidptr(stack); + switch (symbol) + { + case EXPAND_RECURSE: + switch (node->type) + { + case LITERAL: + { + tre_literal_t *lit= node->obj; + if (!IS_SPECIAL(lit) || IS_BACKREF(lit)) + { + lit->position += pos_add; + if (lit->position > max_pos) + max_pos = lit->position; + } + break; + } + case UNION: + { + tre_union_t *uni = node->obj; + STACK_PUSHX(stack, voidptr, uni->right); + STACK_PUSHX(stack, int, EXPAND_RECURSE); + STACK_PUSHX(stack, voidptr, uni->left); + STACK_PUSHX(stack, int, EXPAND_RECURSE); + break; + } + case CATENATION: + { + tre_catenation_t *cat = node->obj; + STACK_PUSHX(stack, voidptr, cat->right); + STACK_PUSHX(stack, int, EXPAND_RECURSE); + STACK_PUSHX(stack, voidptr, cat->left); + STACK_PUSHX(stack, int, EXPAND_RECURSE); + break; + } + case ITERATION: + { + tre_iteration_t *iter = node->obj; + STACK_PUSHX(stack, int, pos_add); + STACK_PUSHX(stack, voidptr, node); + STACK_PUSHX(stack, int, EXPAND_AFTER_ITER); + STACK_PUSHX(stack, voidptr, iter->arg); + STACK_PUSHX(stack, int, EXPAND_RECURSE); + /* If we are going to expand this node at EXPAND_AFTER_ITER + then don't increase the `pos' fields of the nodes now, it + will get done when expanding. */ + if (iter->min > 1 || iter->max > 1) + pos_add = 0; + iter_depth++; + DPRINT(("iter\n")); + break; + } + default: + assert(0); + break; + } + break; + case EXPAND_AFTER_ITER: + { + tre_iteration_t *iter = node->obj; + int pos_add_last; + pos_add = tre_stack_pop_int(stack); + pos_add_last = pos_add; + if (iter->min > 1 || iter->max > 1) + { + tre_ast_node_t *seq1 = NULL, *seq2 = NULL; + int j; + int pos_add_save = pos_add; + + /* Create a catenated sequence of copies of the node. */ + for (j = 0; j < iter->min; j++) + { + tre_ast_node_t *copy; + /* Remove tags from all but the last copy. */ + int flags = ((j + 1 < iter->min) + ? COPY_REMOVE_TAGS + : COPY_MAXIMIZE_FIRST_TAG); + DPRINT((" pos_add %d\n", pos_add)); + pos_add_save = pos_add; + status = tre_copy_ast(mem, stack, iter->arg, flags, + &pos_add, tag_directions, ©, + &max_pos); + if (status != REG_OK) + return status; + if (seq1 != NULL) + seq1 = tre_ast_new_catenation(mem, seq1, copy); + else + seq1 = copy; + if (seq1 == NULL) + return REG_ESPACE; + } + + if (iter->max == -1) + { + /* No upper limit. */ + pos_add_save = pos_add; + status = tre_copy_ast(mem, stack, iter->arg, 0, + &pos_add, NULL, &seq2, &max_pos); + if (status != REG_OK) + return status; + seq2 = tre_ast_new_iter(mem, seq2, 0, -1, 0); + if (seq2 == NULL) + return REG_ESPACE; + } + else + { + for (j = iter->min; j < iter->max; j++) + { + tre_ast_node_t *tmp, *copy; + pos_add_save = pos_add; + status = tre_copy_ast(mem, stack, iter->arg, 0, + &pos_add, NULL, ©, &max_pos); + if (status != REG_OK) + return status; + if (seq2 != NULL) + seq2 = tre_ast_new_catenation(mem, copy, seq2); + else + seq2 = copy; + if (seq2 == NULL) + return REG_ESPACE; + tmp = tre_ast_new_literal(mem, EMPTY, -1, -1); + if (tmp == NULL) + return REG_ESPACE; + seq2 = tre_ast_new_union(mem, tmp, seq2); + if (seq2 == NULL) + return REG_ESPACE; + } + } + + pos_add = pos_add_save; + if (seq1 == NULL) + seq1 = seq2; + else if (seq2 != NULL) + seq1 = tre_ast_new_catenation(mem, seq1, seq2); + if (seq1 == NULL) + return REG_ESPACE; + node->obj = seq1->obj; + node->type = seq1->type; + } + + iter_depth--; + pos_add_total += pos_add - pos_add_last; + if (iter_depth == 0) + pos_add = pos_add_total; + + /* If approximate parameters are specified, surround the result + with two parameter setting nodes. The one on the left sets + the specified parameters, and the one on the right restores + the old parameters. */ + if (iter->params) + { + tre_ast_node_t *tmp_l, *tmp_r, *tmp_node, *node_copy; + int *old_params; + + tmp_l = tre_ast_new_literal(mem, PARAMETER, 0, -1); + if (!tmp_l) + return REG_ESPACE; + ((tre_literal_t *)tmp_l->obj)->u.params = iter->params; + iter->params[TRE_PARAM_DEPTH] = params_depth + 1; + tmp_r = tre_ast_new_literal(mem, PARAMETER, 0, -1); + if (!tmp_r) + return REG_ESPACE; + old_params = tre_mem_alloc(mem, sizeof(*old_params) + * TRE_PARAM_LAST); + if (!old_params) + return REG_ESPACE; + for (i = 0; i < TRE_PARAM_LAST; i++) + old_params[i] = params[i]; + ((tre_literal_t *)tmp_r->obj)->u.params = old_params; + old_params[TRE_PARAM_DEPTH] = params_depth; + /* XXX - this is the only place where ast_new_node is + needed -- should be moved inside AST module. */ + node_copy = tre_ast_new_node(mem, ITERATION, + sizeof(tre_iteration_t)); + if (!node_copy) + return REG_ESPACE; + node_copy->obj = node->obj; + tmp_node = tre_ast_new_catenation(mem, tmp_l, node_copy); + if (!tmp_node) + return REG_ESPACE; + tmp_node = tre_ast_new_catenation(mem, tmp_node, tmp_r); + if (!tmp_node) + return REG_ESPACE; + /* Replace the contents of `node' with `tmp_node'. */ + HAWK_MEMCPY (node, tmp_node, sizeof(*node)); + node->obj = tmp_node->obj; + node->type = tmp_node->type; + params_depth++; + if (params_depth > *max_depth) + *max_depth = params_depth; + } + break; + } + default: + assert(0); + break; + } + } + + *position += pos_add_total; + + /* `max_pos' should never be larger than `*position' if the above + code works, but just an extra safeguard let's make sure + `*position' is set large enough so enough memory will be + allocated for the transition table. */ + if (max_pos > *position) + *position = max_pos; + +#ifdef TRE_DEBUG + DPRINT(("Expanded AST:\n")); + tre_ast_print(ast); + DPRINT(("*position %d, max_pos %d\n", *position, max_pos)); +#endif + + return status; +} + +static tre_pos_and_tags_t * +tre_set_empty(tre_mem_t mem) +{ + tre_pos_and_tags_t *new_set; + + new_set = tre_mem_calloc(mem, sizeof(*new_set)); + if (new_set == NULL) + return NULL; + + new_set[0].position = -1; + new_set[0].code_min = -1; + new_set[0].code_max = -1; + + return new_set; +} + +static tre_pos_and_tags_t * +tre_set_one(tre_mem_t mem, int position, int code_min, int code_max, + tre_ctype_t class, tre_ctype_t *neg_classes, int backref) +{ + tre_pos_and_tags_t *new_set; + + new_set = tre_mem_calloc(mem, sizeof(*new_set) * 2); + if (new_set == NULL) return NULL; + + new_set[0].position = position; + new_set[0].code_min = code_min; + new_set[0].code_max = code_max; + new_set[0].class = class; + new_set[0].neg_classes = neg_classes; + new_set[0].backref = backref; + new_set[1].position = -1; + new_set[1].code_min = -1; + new_set[1].code_max = -1; + + return new_set; +} + +static tre_pos_and_tags_t * +tre_set_union(tre_mem_t mem, tre_pos_and_tags_t *set1, tre_pos_and_tags_t *set2, + int *tags, int assertions, int *params) +{ + int s1, s2, i, j; + tre_pos_and_tags_t *new_set; + int *new_tags; + int num_tags; + + for (num_tags = 0; tags != NULL && tags[num_tags] >= 0; num_tags++); + for (s1 = 0; set1[s1].position >= 0; s1++); + for (s2 = 0; set2[s2].position >= 0; s2++); + new_set = tre_mem_calloc(mem, sizeof(*new_set) * (s1 + s2 + 1)); + if (!new_set) return NULL; + + for (s1 = 0; set1[s1].position >= 0; s1++) + { + new_set[s1].position = set1[s1].position; + new_set[s1].code_min = set1[s1].code_min; + new_set[s1].code_max = set1[s1].code_max; + new_set[s1].assertions = set1[s1].assertions | assertions; + new_set[s1].class = set1[s1].class; + new_set[s1].neg_classes = set1[s1].neg_classes; + new_set[s1].backref = set1[s1].backref; + if (set1[s1].tags == NULL && tags == NULL) + new_set[s1].tags = NULL; + else + { + for (i = 0; set1[s1].tags != NULL && set1[s1].tags[i] >= 0; i++); + new_tags = tre_mem_alloc(mem, (sizeof(*new_tags) + * (i + num_tags + 1))); + if (new_tags == NULL) + return NULL; + for (j = 0; j < i; j++) + new_tags[j] = set1[s1].tags[j]; + for (i = 0; i < num_tags; i++) + new_tags[j + i] = tags[i]; + new_tags[j + i] = -1; + new_set[s1].tags = new_tags; + } + if (set1[s1].params) + new_set[s1].params = set1[s1].params; + if (params) + { + if (!new_set[s1].params) + new_set[s1].params = params; + else + { + new_set[s1].params = tre_mem_alloc(mem, sizeof(*params) * + TRE_PARAM_LAST); + if (!new_set[s1].params) + return NULL; + for (i = 0; i < TRE_PARAM_LAST; i++) + if (params[i] != TRE_PARAM_UNSET) + new_set[s1].params[i] = params[i]; + } + } + } + + for (s2 = 0; set2[s2].position >= 0; s2++) + { + new_set[s1 + s2].position = set2[s2].position; + new_set[s1 + s2].code_min = set2[s2].code_min; + new_set[s1 + s2].code_max = set2[s2].code_max; + /* XXX - why not | assertions here as well? */ + new_set[s1 + s2].assertions = set2[s2].assertions; + new_set[s1 + s2].class = set2[s2].class; + new_set[s1 + s2].neg_classes = set2[s2].neg_classes; + new_set[s1 + s2].backref = set2[s2].backref; + if (set2[s2].tags == NULL) + new_set[s1 + s2].tags = NULL; + else + { + for (i = 0; set2[s2].tags[i] >= 0; i++); + new_tags = tre_mem_alloc(mem, sizeof(*new_tags) * (i + 1)); + if (new_tags == NULL) + return NULL; + for (j = 0; j < i; j++) + new_tags[j] = set2[s2].tags[j]; + new_tags[j] = -1; + new_set[s1 + s2].tags = new_tags; + } + if (set2[s2].params) + new_set[s1 + s2].params = set2[s2].params; + if (params) + { + if (!new_set[s1 + s2].params) + new_set[s1 + s2].params = params; + else + { + new_set[s1 + s2].params = tre_mem_alloc(mem, sizeof(*params) * + TRE_PARAM_LAST); + if (!new_set[s1 + s2].params) + return NULL; + for (i = 0; i < TRE_PARAM_LAST; i++) + if (params[i] != TRE_PARAM_UNSET) + new_set[s1 + s2].params[i] = params[i]; + } + } + } + new_set[s1 + s2].position = -1; + return new_set; +} + +/* Finds the empty path through `node' which is the one that should be + taken according to POSIX.2 rules, and adds the tags on that path to + `tags'. `tags' may be NULL. If `num_tags_seen' is not NULL, it is + set to the number of tags seen on the path. */ +static reg_errcode_t +tre_match_empty(tre_stack_t *stack, tre_ast_node_t *node, int *tags, + int *assertions, int *params, int *num_tags_seen, + int *params_seen) +{ + tre_literal_t *lit; + tre_union_t *uni; + tre_catenation_t *cat; + tre_iteration_t *iter; + int i; + int bottom = tre_stack_num_objects(stack); + reg_errcode_t status = REG_OK; + if (num_tags_seen) + *num_tags_seen = 0; + if (params_seen) + *params_seen = 0; + + status = tre_stack_push_voidptr(stack, node); + + /* Walk through the tree recursively. */ + while (status == REG_OK && tre_stack_num_objects(stack) > bottom) + { + node = tre_stack_pop_voidptr(stack); + + switch (node->type) + { + case LITERAL: + lit = (tre_literal_t *)node->obj; + switch (lit->code_min) + { + case TAG: + if (lit->code_max >= 0) + { + if (tags != NULL) + { + /* Add the tag to `tags'. */ + for (i = 0; tags[i] >= 0; i++) + if (tags[i] == lit->code_max) + break; + if (tags[i] < 0) + { + tags[i] = lit->code_max; + tags[i + 1] = -1; + } + } + if (num_tags_seen) + (*num_tags_seen)++; + } + break; + case ASSERTION: + assert(lit->code_max >= 1 + || lit->code_max <= ASSERT_LAST); + if (assertions != NULL) + *assertions |= lit->code_max; + break; + case PARAMETER: + if (params != NULL) + for (i = 0; i < TRE_PARAM_LAST; i++) + params[i] = lit->u.params[i]; + if (params_seen != NULL) + *params_seen = 1; + break; + case EMPTY: + break; + default: + assert(0); + break; + } + break; + + case UNION: + /* Subexpressions starting earlier take priority over ones + starting later, so we prefer the left subexpression over the + right subexpression. */ + uni = (tre_union_t *)node->obj; + if (uni->left->nullable) + STACK_PUSHX(stack, voidptr, uni->left) + else if (uni->right->nullable) + STACK_PUSHX(stack, voidptr, uni->right) + else + assert(0); + break; + + case CATENATION: + /* The path must go through both children. */ + cat = (tre_catenation_t *)node->obj; + assert(cat->left->nullable); + assert(cat->right->nullable); + STACK_PUSHX(stack, voidptr, cat->left); + STACK_PUSHX(stack, voidptr, cat->right); + break; + + case ITERATION: + /* A match with an empty string is preferred over no match at + all, so we go through the argument if possible. */ + iter = (tre_iteration_t *)node->obj; + if (iter->arg->nullable) + STACK_PUSHX(stack, voidptr, iter->arg); + break; + + default: + assert(0); + break; + } + } + + return status; +} + + +typedef enum +{ + NFL_RECURSE, + NFL_POST_UNION, + NFL_POST_CATENATION, + NFL_POST_ITERATION +} tre_nfl_stack_symbol_t; + + +/* Computes and fills in the fields `nullable', `firstpos', and `lastpos' for + the nodes of the AST `tree'. */ +static reg_errcode_t +tre_compute_nfl(tre_mem_t mem, tre_stack_t *stack, tre_ast_node_t *tree) +{ + int bottom = tre_stack_num_objects(stack); + + STACK_PUSHR(stack, voidptr, tree); + STACK_PUSHR(stack, int, NFL_RECURSE); + + while (tre_stack_num_objects(stack) > bottom) + { + tre_nfl_stack_symbol_t symbol; + tre_ast_node_t *node; + + symbol = (tre_nfl_stack_symbol_t)tre_stack_pop_int(stack); + node = tre_stack_pop_voidptr(stack); + switch (symbol) + { + case NFL_RECURSE: + switch (node->type) + { + case LITERAL: + { + tre_literal_t *lit = (tre_literal_t *)node->obj; + if (IS_BACKREF(lit)) + { + /* Back references: nullable = false, firstpos = {i}, + lastpos = {i}. */ + node->nullable = 0; + node->firstpos = tre_set_one(mem, lit->position, 0, TRE_CHAR_MAX, 0, NULL, -1); + if (!node->firstpos) return REG_ESPACE; + node->lastpos = tre_set_one(mem, lit->position, 0, TRE_CHAR_MAX, 0, NULL, (int)lit->code_max); + if (!node->lastpos) return REG_ESPACE; + } + else if (lit->code_min < 0) + { + /* Tags, empty strings, params, and zero width assertions: + nullable = true, firstpos = {}, and lastpos = {}. */ + node->nullable = 1; + node->firstpos = tre_set_empty(mem); + if (!node->firstpos) + return REG_ESPACE; + node->lastpos = tre_set_empty(mem); + if (!node->lastpos) + return REG_ESPACE; + } + else + { + /* Literal at position i: nullable = false, firstpos = {i}, + lastpos = {i}. */ + node->nullable = 0; + node->firstpos = tre_set_one(mem, lit->position, (int)lit->code_min, (int)lit->code_max, 0, NULL, -1); + if (!node->firstpos) return REG_ESPACE; + node->lastpos = tre_set_one(mem, lit->position, (int)lit->code_min, (int)lit->code_max, lit->u.class, lit->neg_classes, -1); + if (!node->lastpos) return REG_ESPACE; + } + break; + } + + case UNION: + /* Compute the attributes for the two subtrees, and after that + for this node. */ + STACK_PUSHR(stack, voidptr, node); + STACK_PUSHR(stack, int, NFL_POST_UNION); + STACK_PUSHR(stack, voidptr, ((tre_union_t *)node->obj)->right); + STACK_PUSHR(stack, int, NFL_RECURSE); + STACK_PUSHR(stack, voidptr, ((tre_union_t *)node->obj)->left); + STACK_PUSHR(stack, int, NFL_RECURSE); + break; + + case CATENATION: + /* Compute the attributes for the two subtrees, and after that + for this node. */ + STACK_PUSHR(stack, voidptr, node); + STACK_PUSHR(stack, int, NFL_POST_CATENATION); + STACK_PUSHR(stack, voidptr, ((tre_catenation_t *)node->obj)->right); + STACK_PUSHR(stack, int, NFL_RECURSE); + STACK_PUSHR(stack, voidptr, ((tre_catenation_t *)node->obj)->left); + STACK_PUSHR(stack, int, NFL_RECURSE); + break; + + case ITERATION: + /* Compute the attributes for the subtree, and after that for + this node. */ + STACK_PUSHR(stack, voidptr, node); + STACK_PUSHR(stack, int, NFL_POST_ITERATION); + STACK_PUSHR(stack, voidptr, ((tre_iteration_t *)node->obj)->arg); + STACK_PUSHR(stack, int, NFL_RECURSE); + break; + } + break; /* end case: NFL_RECURSE */ + + case NFL_POST_UNION: + { + tre_union_t *uni = (tre_union_t *)node->obj; + node->nullable = uni->left->nullable || uni->right->nullable; + node->firstpos = tre_set_union(mem, uni->left->firstpos, + uni->right->firstpos, NULL, 0, NULL); + if (!node->firstpos) + return REG_ESPACE; + node->lastpos = tre_set_union(mem, uni->left->lastpos, + uni->right->lastpos, NULL, 0, NULL); + if (!node->lastpos) + return REG_ESPACE; + break; + } + + case NFL_POST_ITERATION: + { + tre_iteration_t *iter = (tre_iteration_t *)node->obj; + + if (iter->min == 0 || iter->arg->nullable) + node->nullable = 1; + else + node->nullable = 0; + node->firstpos = iter->arg->firstpos; + node->lastpos = iter->arg->lastpos; + break; + } + + case NFL_POST_CATENATION: + { + int num_tags, *tags, assertions, params_seen; + int *params; + reg_errcode_t status; + tre_catenation_t *cat = node->obj; + node->nullable = cat->left->nullable && cat->right->nullable; + + /* Compute firstpos. */ + if (cat->left->nullable) + { + /* The left side matches the empty string. Make a first pass + with tre_match_empty() to get the number of tags and + parameters. */ + status = tre_match_empty(stack, cat->left, + NULL, NULL, NULL, &num_tags, + ¶ms_seen); + if (status != REG_OK) + return status; + /* Allocate arrays for the tags and parameters. */ + tags = xmalloc(mem->hawk, sizeof(*tags) * (num_tags + 1)); + if (!tags) + return REG_ESPACE; + tags[0] = -1; + assertions = 0; + params = NULL; + if (params_seen) + { + params = tre_mem_alloc(mem, sizeof(*params) + * TRE_PARAM_LAST); + if (!params) + { + xfree(mem->hawk,tags); + return REG_ESPACE; + } + } + /* Second pass with tre_mach_empty() to get the list of + tags and parameters. */ + status = tre_match_empty(stack, cat->left, tags, + &assertions, params, NULL, NULL); + if (status != REG_OK) + { + xfree(mem->hawk,tags); + return status; + } + node->firstpos = + tre_set_union(mem, cat->right->firstpos, cat->left->firstpos, + tags, assertions, params); + xfree(mem->hawk,tags); + if (!node->firstpos) + return REG_ESPACE; + } + else + { + node->firstpos = cat->left->firstpos; + } + + /* Compute lastpos. */ + if (cat->right->nullable) + { + /* The right side matches the empty string. Make a first pass + with tre_match_empty() to get the number of tags and + parameters. */ + status = tre_match_empty(stack, cat->right, + NULL, NULL, NULL, &num_tags, + ¶ms_seen); + if (status != REG_OK) + return status; + /* Allocate arrays for the tags and parameters. */ + tags = xmalloc(mem->hawk,sizeof(int) * (num_tags + 1)); + if (!tags) + return REG_ESPACE; + tags[0] = -1; + assertions = 0; + params = NULL; + if (params_seen) + { + params = tre_mem_alloc(mem, sizeof(*params) + * TRE_PARAM_LAST); + if (!params) + { + xfree(mem->hawk,tags); + return REG_ESPACE; + } + } + /* Second pass with tre_mach_empty() to get the list of + tags and parameters. */ + status = tre_match_empty(stack, cat->right, tags, + &assertions, params, NULL, NULL); + if (status != REG_OK) + { + xfree(mem->hawk,tags); + return status; + } + node->lastpos = + tre_set_union(mem, cat->left->lastpos, cat->right->lastpos, + tags, assertions, params); + xfree(mem->hawk,tags); + if (!node->lastpos) + return REG_ESPACE; + } + else + { + node->lastpos = cat->right->lastpos; + } + break; + } + + default: + assert(0); + break; + } + } + + return REG_OK; +} + + +/* Adds a transition from each position in `p1' to each position in `p2'. */ +static reg_errcode_t +tre_make_trans(hawk_t* hawk, tre_pos_and_tags_t *p1, tre_pos_and_tags_t *p2, + tre_tnfa_transition_t *transitions, + int *counts, int *offs) +{ + tre_pos_and_tags_t *orig_p2 = p2; + tre_tnfa_transition_t *trans; + int i, j, k, l, dup, prev_p2_pos; + + if (transitions != NULL) + { + while (p1->position >= 0) + { + p2 = orig_p2; + prev_p2_pos = -1; + while (p2->position >= 0) + { + /* Optimization: if this position was already handled, skip it. */ + if (p2->position == prev_p2_pos) + { + p2++; + continue; + } + prev_p2_pos = p2->position; + /* Set `trans' to point to the next unused transition from + position `p1->position'. */ + trans = transitions + offs[p1->position]; + while (trans->state != NULL) + { +#if 0 + /* If we find a previous transition from `p1->position' to + `p2->position', it is overwritten. This can happen only + if there are nested loops in the regexp, like in "((a)*)*". + In POSIX.2 repetition using the outer loop is always + preferred over using the inner loop. Therefore the + transition for the inner loop is useless and can be thrown + away. */ + /* XXX - The same position is used for all nodes in a bracket + expression, so this optimization cannot be used (it will + break bracket expressions) unless I figure out a way to + detect it here. */ + if (trans->state_id == p2->position) + { + DPRINT(("*")); + break; + } +#endif + trans++; + } + + if (trans->state == NULL) + (trans + 1)->state = NULL; + /* Use the character ranges, assertions, etc. from `p1' for + the transition from `p1' to `p2'. */ + trans->code_min = p1->code_min; + trans->code_max = p1->code_max; + trans->state = transitions + offs[p2->position]; + trans->state_id = p2->position; + trans->assertions = p1->assertions | p2->assertions + | (p1->class ? ASSERT_CHAR_CLASS : 0) + | (p1->neg_classes != NULL ? ASSERT_CHAR_CLASS_NEG : 0); + if (p1->backref >= 0) + { + assert((trans->assertions & ASSERT_CHAR_CLASS) == 0); + assert(p2->backref < 0); + trans->u.backref = p1->backref; + trans->assertions |= ASSERT_BACKREF; + } + else + trans->u.class = p1->class; + if (p1->neg_classes != NULL) + { + for (i = 0; p1->neg_classes[i] != (tre_ctype_t)0; i++); + trans->neg_classes = xmalloc(hawk,sizeof(*trans->neg_classes) * (i + 1)); + if (trans->neg_classes == NULL) return REG_ESPACE; + for (i = 0; p1->neg_classes[i] != (tre_ctype_t)0; i++) + trans->neg_classes[i] = p1->neg_classes[i]; + trans->neg_classes[i] = (tre_ctype_t)0; + } + else + trans->neg_classes = NULL; + + /* Find out how many tags this transition has. */ + i = 0; + if (p1->tags != NULL) + while(p1->tags[i] >= 0) + i++; + j = 0; + if (p2->tags != NULL) + while(p2->tags[j] >= 0) + j++; + + /* If we are overwriting a transition, free the old tag array. */ + if (trans->tags != NULL) xfree(hawk,trans->tags); + trans->tags = NULL; + + /* If there were any tags, allocate an array and fill it. */ + if (i + j > 0) + { + trans->tags = xmalloc(hawk,sizeof(*trans->tags) * (i + j + 1)); + if (!trans->tags) + return REG_ESPACE; + i = 0; + if (p1->tags != NULL) + while(p1->tags[i] >= 0) + { + trans->tags[i] = p1->tags[i]; + i++; + } + l = i; + j = 0; + if (p2->tags != NULL) + while (p2->tags[j] >= 0) + { + /* Don't add duplicates. */ + dup = 0; + for (k = 0; k < i; k++) + if (trans->tags[k] == p2->tags[j]) + { + dup = 1; + break; + } + if (!dup) + trans->tags[l++] = p2->tags[j]; + j++; + } + trans->tags[l] = -1; + } + + /* Set the parameter array. If both `p2' and `p1' have same + parameters, the values in `p2' override those in `p1'. */ + if (p1->params || p2->params) + { + if (!trans->params) + trans->params = xmalloc(hawk,sizeof(*trans->params) + * TRE_PARAM_LAST); + if (!trans->params) + return REG_ESPACE; + for (i = 0; i < TRE_PARAM_LAST; i++) + { + trans->params[i] = TRE_PARAM_UNSET; + if (p1->params && p1->params[i] != TRE_PARAM_UNSET) + trans->params[i] = p1->params[i]; + if (p2->params && p2->params[i] != TRE_PARAM_UNSET) + trans->params[i] = p2->params[i]; + } + } + else + { + if (trans->params) + xfree(hawk,trans->params); + trans->params = NULL; + } + + +#ifdef TRE_DEBUG + { + int *tags; + + DPRINT((" %2d -> %2d on %3d", p1->position, p2->position, + p1->code_min)); + if (p1->code_max != p1->code_min) + DPRINT(("-%3d", p1->code_max)); + tags = trans->tags; + if (tags) + { + DPRINT((", tags [")); + while (*tags >= 0) + { + DPRINT(("%d", *tags)); + tags++; + if (*tags >= 0) + DPRINT((",")); + } + DPRINT(("]")); + } + if (trans->assertions) + DPRINT((", assert %d", trans->assertions)); + if (trans->assertions & ASSERT_BACKREF) + DPRINT((", backref %d", trans->u.backref)); + else if (trans->u.class) + DPRINT((", class %ld", (long)trans->u.class)); + if (trans->neg_classes) + DPRINT((", neg_classes %p", trans->neg_classes)); + if (trans->params) + { + DPRINT((", ")); + tre_print_params(trans->params); + } + DPRINT(("\n")); + } +#endif /* TRE_DEBUG */ + p2++; + } + p1++; + } + } + else + { + /* Compute a maximum limit for the number of transitions leaving + from each state. */ + while (p1->position >= 0) + { + p2 = orig_p2; + while (p2->position >= 0) + { + counts[p1->position]++; + p2++; + } + p1++; + } + } + return REG_OK; +} + +/* Converts the syntax tree to a TNFA. All the transitions in the TNFA are + labelled with one character range (there are no transitions on empty + strings). The TNFA takes O(n^2) space in the worst case, `n' is size of + the regexp. */ +static reg_errcode_t +tre_ast_to_tnfa(hawk_t* hawk, tre_ast_node_t *node, tre_tnfa_transition_t *transitions, + int *counts, int *offs) +{ + tre_union_t *uni; + tre_catenation_t *cat; + tre_iteration_t *iter; + reg_errcode_t errcode = REG_OK; + + /* XXX - recurse using a stack!. */ + switch (node->type) + { + case LITERAL: + break; + case UNION: + uni = (tre_union_t *)node->obj; + errcode = tre_ast_to_tnfa(hawk, uni->left, transitions, counts, offs); + if (errcode != REG_OK) + return errcode; + errcode = tre_ast_to_tnfa(hawk, uni->right, transitions, counts, offs); + break; + + case CATENATION: + cat = (tre_catenation_t *)node->obj; + /* Add a transition from each position in cat->left->lastpos + to each position in cat->right->firstpos. */ + errcode = tre_make_trans(hawk, cat->left->lastpos, cat->right->firstpos, + transitions, counts, offs); + if (errcode != REG_OK) + return errcode; + errcode = tre_ast_to_tnfa(hawk, cat->left, transitions, counts, offs); + if (errcode != REG_OK) + return errcode; + errcode = tre_ast_to_tnfa(hawk, cat->right, transitions, counts, offs); + break; + + case ITERATION: + iter = (tre_iteration_t *)node->obj; + assert(iter->max == -1 || iter->max == 1); + + if (iter->max == -1) + { + assert(iter->min == 0 || iter->min == 1); + /* Add a transition from each last position in the iterated + expression to each first position. */ + errcode = tre_make_trans(hawk, iter->arg->lastpos, iter->arg->firstpos, + transitions, counts, offs); + if (errcode != REG_OK) + return errcode; + } + errcode = tre_ast_to_tnfa(hawk, iter->arg, transitions, counts, offs); + break; + } + return errcode; +} + + +#define ERROR_EXIT(err) \ + do \ + { \ + errcode = err; \ + if (/*CONSTCOND*/1) \ + goto error_exit; \ + } \ + while (/*CONSTCOND*/0) + + +int tre_compile (regex_t *preg, const tre_char_t *regex, size_t n, int cflags) +{ + tre_stack_t *stack; + tre_ast_node_t *tree, *tmp_ast_l, *tmp_ast_r; + tre_pos_and_tags_t *p; + int *counts = NULL, *offs = NULL; + int i, add = 0; + tre_tnfa_transition_t *transitions, *initial; + tre_tnfa_t *tnfa = NULL; + tre_submatch_data_t *submatch_data; + tre_tag_direction_t *tag_directions = NULL; + reg_errcode_t errcode; + tre_mem_t mem; + + /* Parse context. */ + tre_parse_ctx_t parse_ctx; + + /* Allocate a stack used throughout the compilation process for various + purposes. */ +/* HAWK: deleted limit on the stack size + stack = tre_stack_new(preg->hawk, 512, 10240, 128); */ + stack = tre_stack_new(preg->hawk, 512, -1, 128); + if (!stack) + return REG_ESPACE; + /* Allocate a fast memory allocator. */ + mem = tre_mem_new(preg->hawk); + if (!mem) + { + tre_stack_destroy(stack); + return REG_ESPACE; + } + + /* Parse the regexp. */ + HAWK_MEMSET(&parse_ctx, 0, sizeof(parse_ctx)); + parse_ctx.mem = mem; + parse_ctx.stack = stack; + parse_ctx.re = regex; + parse_ctx.len = n; + parse_ctx.cflags = cflags; + parse_ctx.max_backref = -1; + DPRINT(("tre_compile: parsing '%.*" STRF "'\n", (int)n, regex)); + errcode = tre_parse(&parse_ctx); + if (errcode != REG_OK) + ERROR_EXIT(errcode); + preg->re_nsub = parse_ctx.submatch_id - 1; + tree = parse_ctx.result; + + /* Back references and approximate matching cannot currently be used + in the same regexp. */ + if (parse_ctx.max_backref >= 0 && parse_ctx.have_approx) + ERROR_EXIT(REG_BADPAT); + +#ifdef TRE_DEBUG + tre_ast_print(tree); +#endif /* TRE_DEBUG */ + + /* Referring to nonexistent subexpressions is illegal. */ + if (parse_ctx.max_backref > (int)preg->re_nsub) + ERROR_EXIT(REG_ESUBREG); + + /* Allocate the TNFA struct. */ + tnfa = xcalloc(preg->hawk, 1, sizeof(tre_tnfa_t)); + if (tnfa == NULL) + ERROR_EXIT(REG_ESPACE); + tnfa->have_backrefs = parse_ctx.max_backref >= 0; + tnfa->have_approx = parse_ctx.have_approx; + tnfa->num_submatches = parse_ctx.submatch_id; + + /* Set up tags for submatch addressing. If REG_NOSUB is set and the + regexp does not have back references, this can be skipped. */ + if (tnfa->have_backrefs || !(cflags & REG_NOSUB)) + { + DPRINT(("tre_compile: setting up tags\n")); + + /* Figure out how many tags we will need. */ + /*errcode = tre_add_tags(NULL, stack, tree, tnfa); */ + errcode = tre_add_tags(mem, stack, tree, tnfa, 1); + if (errcode != REG_OK) + ERROR_EXIT(errcode); +#ifdef TRE_DEBUG + tre_ast_print(tree); +#endif /* TRE_DEBUG */ + + if (tnfa->num_tags > 0) + { + tag_directions = xmalloc(preg->hawk,sizeof(*tag_directions) + * (tnfa->num_tags + 1)); + if (tag_directions == NULL) + ERROR_EXIT(REG_ESPACE); + tnfa->tag_directions = tag_directions; + HAWK_MEMSET(tag_directions, -1, + sizeof(*tag_directions) * (tnfa->num_tags + 1)); + } + tnfa->minimal_tags = xcalloc(preg->hawk, (unsigned)tnfa->num_tags * 2 + 1, + sizeof(tnfa->minimal_tags)); + if (tnfa->minimal_tags == NULL) + ERROR_EXIT(REG_ESPACE); + + submatch_data = xcalloc(preg->hawk,(unsigned)parse_ctx.submatch_id, + sizeof(*submatch_data)); + if (submatch_data == NULL) + ERROR_EXIT(REG_ESPACE); + tnfa->submatch_data = submatch_data; + + errcode = tre_add_tags(mem, stack, tree, tnfa, 0); + if (errcode != REG_OK) + ERROR_EXIT(errcode); + +#ifdef TRE_DEBUG + for (i = 0; i < parse_ctx.submatch_id; i++) + DPRINT(("pmatch[%d] = {t%d, t%d}\n", + i, submatch_data[i].so_tag, submatch_data[i].eo_tag)); + for (i = 0; i < tnfa->num_tags; i++) + DPRINT(("t%d is %s\n", i, + tag_directions[i] == TRE_TAG_MINIMIZE ? + "minimized" : "maximized")); +#endif /* TRE_DEBUG */ + } + + /* Expand iteration nodes. */ + errcode = tre_expand_ast(mem, stack, tree, &parse_ctx.position, + tag_directions, &tnfa->params_depth); + if (errcode != REG_OK) + ERROR_EXIT(errcode); + + /* Add a dummy node for the final state. + XXX - For certain patterns this dummy node can be optimized away, + for example "a*" or "ab*". Figure out a simple way to detect + this possibility. */ + tmp_ast_l = tree; + tmp_ast_r = tre_ast_new_literal(mem, 0, 0, parse_ctx.position++); + if (tmp_ast_r == NULL) + ERROR_EXIT(REG_ESPACE); + + tree = tre_ast_new_catenation(mem, tmp_ast_l, tmp_ast_r); + if (tree == NULL) + ERROR_EXIT(REG_ESPACE); + +#ifdef TRE_DEBUG + tre_ast_print(tree); + DPRINT(("Number of states: %d\n", parse_ctx.position)); +#endif /* TRE_DEBUG */ + + errcode = tre_compute_nfl(mem, stack, tree); + if (errcode != REG_OK) + ERROR_EXIT(errcode); + + counts = xmalloc(preg->hawk,sizeof(int) * parse_ctx.position); + if (counts == NULL) + ERROR_EXIT(REG_ESPACE); + + offs = xmalloc(preg->hawk,sizeof(int) * parse_ctx.position); + if (offs == NULL) + ERROR_EXIT(REG_ESPACE); + + for (i = 0; i < parse_ctx.position; i++) + counts[i] = 0; + tre_ast_to_tnfa(preg->hawk, tree, NULL, counts, NULL); + + add = 0; + for (i = 0; i < parse_ctx.position; i++) + { + offs[i] = add; + add += counts[i] + 1; + counts[i] = 0; + } + transitions = xcalloc(preg->hawk, (unsigned)add + 1, sizeof(*transitions)); + if (transitions == NULL) + ERROR_EXIT(REG_ESPACE); + tnfa->transitions = transitions; + tnfa->num_transitions = add; + + DPRINT(("Converting to TNFA:\n")); + errcode = tre_ast_to_tnfa(preg->hawk, tree, transitions, counts, offs); + if (errcode != REG_OK) + ERROR_EXIT(errcode); + + /* If in eight bit mode, compute a table of characters that can be the + first character of a match. */ + tnfa->first_char = -1; + +/* HAWK: deleted */ +/* + if (TRE_MB_CUR_MAX == 1 && !tmp_ast_l->nullable) + { + int count = 0; + tre_cint_t k; + DPRINT(("Characters that can start a match:")); + tnfa->firstpos_chars = xcalloc(preg->hawk, 256, sizeof(char)); + if (tnfa->firstpos_chars == NULL) + ERROR_EXIT(REG_ESPACE); + for (p = tree->firstpos; p->position >= 0; p++) + { + tre_tnfa_transition_t *j = transitions + offs[p->position]; + while (j->state != NULL) + { + for (k = j->code_min; k <= j->code_max && k < 256; k++) + { + DPRINT((" %d", k)); + tnfa->firstpos_chars[k] = 1; + count++; + } + j++; + } + } + DPRINT(("\n")); +#define TRE_OPTIMIZE_FIRST_CHAR 1 +#if TRE_OPTIMIZE_FIRST_CHAR + if (count == 1) + { + for (k = 0; k < 256; k++) + if (tnfa->firstpos_chars[k]) + { + DPRINT(("first char must be %d\n", k)); + tnfa->first_char = k; + xfree(preg->hawk,tnfa->firstpos_chars); + tnfa->firstpos_chars = NULL; + break; + } + } +#endif + + } + else + tnfa->firstpos_chars = NULL; +*/ +/* END HAWK */ + + + p = tree->firstpos; + i = 0; + while (p->position >= 0) + { + i++; + +#ifdef TRE_DEBUG + { + int *tags; + DPRINT(("initial: %d", p->position)); + tags = p->tags; + if (tags != NULL) + { + if (*tags >= 0) + DPRINT(("/")); + while (*tags >= 0) + { + DPRINT(("%d", *tags)); + tags++; + if (*tags >= 0) + DPRINT((",")); + } + } + DPRINT((", assert %d", p->assertions)); + if (p->params) + { + DPRINT((", ")); + tre_print_params(p->params); + } + DPRINT(("\n")); + } +#endif /* TRE_DEBUG */ + + p++; + } + + initial = xcalloc(preg->hawk, (unsigned)i + 1, sizeof(tre_tnfa_transition_t)); + if (initial == NULL) + ERROR_EXIT(REG_ESPACE); + tnfa->initial = initial; + + i = 0; + for (p = tree->firstpos; p->position >= 0; p++) + { + initial[i].state = transitions + offs[p->position]; + initial[i].state_id = p->position; + initial[i].tags = NULL; + /* Copy the arrays p->tags, and p->params, they are allocated + from a tre_mem object. */ + if (p->tags) + { + int j; + for (j = 0; p->tags[j] >= 0; j++); + initial[i].tags = xmalloc(preg->hawk,sizeof(*p->tags) * (j + 1)); + if (!initial[i].tags) + ERROR_EXIT(REG_ESPACE); + HAWK_MEMCPY (initial[i].tags, p->tags, sizeof(*p->tags) * (j + 1)); + } + initial[i].params = NULL; + if (p->params) + { + initial[i].params = xmalloc(preg->hawk,sizeof(*p->params) * TRE_PARAM_LAST); + if (!initial[i].params) + ERROR_EXIT(REG_ESPACE); + HAWK_MEMCPY (initial[i].params, p->params, + sizeof(*p->params) * TRE_PARAM_LAST); + } + initial[i].assertions = p->assertions; + i++; + } + initial[i].state = NULL; + + tnfa->num_transitions = add; + tnfa->final = transitions + offs[tree->lastpos[0].position]; + tnfa->num_states = parse_ctx.position; + tnfa->cflags = cflags; + + DPRINT(("final state %p\n", (void *)tnfa->final)); + + tre_mem_destroy(mem); + tre_stack_destroy(stack); + xfree(preg->hawk,counts); + xfree(preg->hawk,offs); + + preg->TRE_REGEX_T_FIELD = (void *)tnfa; + return REG_OK; + +error_exit: + /* Free everything that was allocated and return the error code. */ + tre_mem_destroy(mem); + if (stack != NULL) + tre_stack_destroy(stack); + if (counts != NULL) + xfree(preg->hawk,counts); + if (offs != NULL) + xfree(preg->hawk,offs); + preg->TRE_REGEX_T_FIELD = (void *)tnfa; + tre_free(preg); + return errcode; +} + +void tre_free (regex_t *preg) +{ + tre_tnfa_t *tnfa; + unsigned int i; + tre_tnfa_transition_t *trans; + + tnfa = (void *)preg->TRE_REGEX_T_FIELD; + if (!tnfa) + return; + + for (i = 0; i < tnfa->num_transitions; i++) + if (tnfa->transitions[i].state) + { + if (tnfa->transitions[i].tags) + xfree(preg->hawk,tnfa->transitions[i].tags); + if (tnfa->transitions[i].neg_classes) + xfree(preg->hawk,tnfa->transitions[i].neg_classes); + if (tnfa->transitions[i].params) + xfree(preg->hawk,tnfa->transitions[i].params); + } + if (tnfa->transitions) + xfree(preg->hawk,tnfa->transitions); + + if (tnfa->initial) + { + for (trans = tnfa->initial; trans->state; trans++) + { + if (trans->tags) + xfree(preg->hawk,trans->tags); + if (trans->params) + xfree(preg->hawk,trans->params); + } + xfree(preg->hawk,tnfa->initial); + } + + if (tnfa->submatch_data) + { + for (i = 0; i < tnfa->num_submatches; i++) + if (tnfa->submatch_data[i].parents) + xfree(preg->hawk,tnfa->submatch_data[i].parents); + xfree(preg->hawk,tnfa->submatch_data); + } + + if (tnfa->tag_directions) + xfree(preg->hawk,tnfa->tag_directions); +/* HAWK: deleted */ +/* + if (tnfa->firstpos_chars) + xfree(preg->hawk,tnfa->firstpos_chars); +*/ +/* END HAWK */ + if (tnfa->minimal_tags) + xfree(preg->hawk,tnfa->minimal_tags); + xfree(preg->hawk,tnfa); +} + +/* EOF */ diff --git a/hawk/lib/tre-compile.h b/hawk/lib/tre-compile.h new file mode 100644 index 00000000..10d784e3 --- /dev/null +++ b/hawk/lib/tre-compile.h @@ -0,0 +1,81 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + tre-compile.h: Regex compilation definitions + +This is the license, copyright notice, and disclaimer for TRE, a regex +matching package (library and tools) with support for approximate +matching. + +Copyright (c) 2001-2009 Ville Laurikari +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +#ifndef _HAWK_LIB_CMN_TRE_COMPILE_H_ +#define _HAWK_LIB_CMN_TRE_COMPILE_H_ + +typedef struct +{ + int position; + int code_min; + int code_max; + int *tags; + int assertions; + tre_ctype_t class; + tre_ctype_t *neg_classes; + int backref; + int *params; +} tre_pos_and_tags_t; + + +#endif /* TRE_COMPILE_H */ + +/* EOF */ diff --git a/hawk/lib/tre-match-bt.c b/hawk/lib/tre-match-bt.c new file mode 100644 index 00000000..27bf2cbc --- /dev/null +++ b/hawk/lib/tre-match-bt.c @@ -0,0 +1,640 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + tre-match-backtrack.c - TRE backtracking regex matching engine + +This is the license, copyright notice, and disclaimer for TRE, a regex +matching package (library and tools) with support for approximate +matching. + +Copyright (c) 2001-2009 Ville Laurikari +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + This matcher is for regexps that use back referencing. Regexp matching + with back referencing is an NP-complete problem on the number of back + references. The easiest way to match them is to use a backtracking + routine which basically goes through all possible paths in the TNFA + and chooses the one which results in the best (leftmost and longest) + match. This can be spectacularly expensive and may run out of stack + space, but there really is no better known generic algorithm. Quoting + Henry Spencer from comp.compilers: + + + POSIX.2 REs require longest match, which is really exciting to + implement since the obsolete ("basic") variant also includes + \. I haven't found a better way of tackling this than doing + a preliminary match using a DFA (or simulation) on a modified RE + that just replicates subREs for \, and then doing a + backtracking match to determine whether the subRE matches were + right. This can be rather slow, but I console myself with the + thought that people who use \ deserve very slow execution. + (Pun unintentional but very appropriate.) + +*/ + +#include "tre-prv.h" +#include "tre-match-ut.h" + +typedef struct +{ + int pos; + const char *str_byte; +#ifdef TRE_WCHAR + const hawk_uch_t *str_wide; +#endif /* TRE_WCHAR */ + tre_tnfa_transition_t *state; + int state_id; + int next_c; + int *tags; +#ifdef TRE_MBSTATE + hawk_mbstate_t mbstate; +#endif /* TRE_MBSTATE */ +} tre_backtrack_item_t; + +typedef struct tre_backtrack_struct +{ + tre_backtrack_item_t item; + struct tre_backtrack_struct *prev; + struct tre_backtrack_struct *next; +} *tre_backtrack_t; + +#ifdef TRE_WCHAR +#define BT_STACK_WIDE_IN(_str_wide) stack->item.str_wide = (_str_wide) +#define BT_STACK_WIDE_OUT (str_wide) = stack->item.str_wide +#else /* !TRE_WCHAR */ +#define BT_STACK_WIDE_IN(_str_wide) +#define BT_STACK_WIDE_OUT +#endif /* !TRE_WCHAR */ + +#ifdef TRE_MBSTATE +#define BT_STACK_MBSTATE_IN stack->item.mbstate = (mbstate) +#define BT_STACK_MBSTATE_OUT (mbstate) = stack->item.mbstate +#else /* !TRE_MBSTATE */ +#define BT_STACK_MBSTATE_IN +#define BT_STACK_MBSTATE_OUT +#endif /* !TRE_MBSTATE */ + +#define tre_bt_mem_new tre_mem_new +#define tre_bt_mem_alloc tre_mem_alloc +#define tre_bt_mem_destroy tre_mem_destroy + + +#define BT_STACK_PUSH(_hawk, _pos, _str_byte, _str_wide, _state, _state_id, _next_c, _tags, _mbstate) \ + do \ + { \ + int i; \ + if (!stack->next) \ + { \ + tre_backtrack_t s; \ + s = tre_bt_mem_alloc(mem, sizeof(*s)); \ + if (!s) \ + { \ + tre_bt_mem_destroy(mem); \ + if (tags) xfree(_hawk,tags); \ + if (pmatch) xfree(_hawk,pmatch); \ + if (states_seen) xfree(_hawk,states_seen); \ + return REG_ESPACE; \ + } \ + s->prev = stack; \ + s->next = NULL; \ + s->item.tags = tre_bt_mem_alloc(mem, \ + sizeof(*tags) * tnfa->num_tags); \ + if (!s->item.tags) \ + { \ + tre_bt_mem_destroy(mem); \ + if (tags) xfree(_hawk,tags); \ + if (pmatch) xfree(_hawk,pmatch); \ + if (states_seen) xfree(_hawk,states_seen); \ + return REG_ESPACE; \ + } \ + stack->next = s; \ + stack = s; \ + } \ + else \ + stack = stack->next; \ + stack->item.pos = (_pos); \ + stack->item.str_byte = (_str_byte); \ + BT_STACK_WIDE_IN(_str_wide); \ + stack->item.state = (_state); \ + stack->item.state_id = (_state_id); \ + stack->item.next_c = (_next_c); \ + for (i = 0; i < tnfa->num_tags; i++) \ + stack->item.tags[i] = (_tags)[i]; \ + BT_STACK_MBSTATE_IN; \ + } \ + while (/*CONSTCOND*/0) + +#define BT_STACK_POP() \ + do { \ + int i; \ + assert(stack->prev); \ + pos = stack->item.pos; \ + str_byte = stack->item.str_byte; \ + BT_STACK_WIDE_OUT; \ + state = stack->item.state; \ + next_c = stack->item.next_c; \ + for (i = 0; i < tnfa->num_tags; i++) tags[i] = stack->item.tags[i]; \ + BT_STACK_MBSTATE_OUT; \ + stack = stack->prev; \ + } while (/*CONSTCOND*/0) + +#undef MIN +#define MIN(a, b) ((a) <= (b) ? (a) : (b)) + +reg_errcode_t +tre_tnfa_run_backtrack(hawk_t* hawk, const tre_tnfa_t *tnfa, const void *string, + int len, tre_str_type_t type, int *match_tags, + int eflags, int *match_end_ofs) +{ + /* State variables required by GET_NEXT_WCHAR. */ + tre_char_t prev_c = 0, next_c = 0; + const char *str_byte = string; + int pos = 0; + unsigned int pos_add_next = 1; +#ifdef TRE_WCHAR + const hawk_uch_t *str_wide = string; +#ifdef TRE_MBSTATE + hawk_mbstate_t mbstate; +#endif /* TRE_MBSTATE */ +#endif /* TRE_WCHAR */ + int reg_notbol = eflags & REG_NOTBOL; + int reg_noteol = eflags & REG_NOTEOL; + int reg_newline = tnfa->cflags & REG_NEWLINE; + + /* These are used to remember the necessary values of the above + variables to return to the position where the current search + started from. */ + int next_c_start; + const char *str_byte_start; + int pos_start = -1; +#ifdef TRE_WCHAR + const hawk_uch_t *str_wide_start; +#endif /* TRE_WCHAR */ +#ifdef TRE_MBSTATE + hawk_mbstate_t mbstate_start; +#endif /* TRE_MBSTATE */ + + /* End offset of best match so far, or -1 if no match found yet. */ + int match_eo = -1; + /* Tag arrays. */ + int *next_tags, *tags = NULL; + /* Current TNFA state. */ + tre_tnfa_transition_t *state; + int *states_seen = NULL; + + /* Memory allocator to for allocating the backtracking stack. */ + tre_mem_t mem = tre_bt_mem_new(hawk); + + /* The backtracking stack. */ + tre_backtrack_t stack; + + tre_tnfa_transition_t *trans_i; + regmatch_t *pmatch = NULL; + int ret; + +#ifdef TRE_MBSTATE + HAWK_MEMSET(&mbstate, '\0', sizeof(mbstate)); +#endif /* TRE_MBSTATE */ + + if (!mem) + return REG_ESPACE; + stack = tre_bt_mem_alloc(mem, sizeof(*stack)); + if (!stack) + { + ret = REG_ESPACE; + goto error_exit; + } + stack->prev = NULL; + stack->next = NULL; + + DPRINT(("tnfa_execute_backtrack, input type %d\n", type)); + DPRINT(("len = %d\n", len)); + + if (tnfa->num_tags) + { + tags = xmalloc(hawk, sizeof(*tags) * tnfa->num_tags); + if (!tags) + { + ret = REG_ESPACE; + goto error_exit; + } + } + if (tnfa->num_submatches) + { + pmatch = xmalloc(hawk, sizeof(*pmatch) * tnfa->num_submatches); + if (!pmatch) + { + ret = REG_ESPACE; + goto error_exit; + } + } + if (tnfa->num_states) + { + states_seen = xmalloc(hawk, sizeof(*states_seen) * tnfa->num_states); + if (!states_seen) + { + ret = REG_ESPACE; + goto error_exit; + } + } + +retry: + { + int i; + for (i = 0; i < tnfa->num_tags; i++) + { + tags[i] = -1; + if (match_tags) + match_tags[i] = -1; + } + for (i = 0; i < tnfa->num_states; i++) + states_seen[i] = 0; + } + + state = NULL; + pos = pos_start; + GET_NEXT_WCHAR(); + pos_start = pos; + next_c_start = next_c; + str_byte_start = str_byte; +#ifdef TRE_WCHAR + str_wide_start = str_wide; +#endif /* TRE_WCHAR */ +#ifdef TRE_MBSTATE + mbstate_start = mbstate; +#endif /* TRE_MBSTATE */ + + /* Handle initial states. */ + next_tags = NULL; + for (trans_i = tnfa->initial; trans_i->state; trans_i++) + { + DPRINT(("> init %p, prev_c %lc\n", trans_i->state, (tre_cint_t)prev_c)); + if (trans_i->assertions && CHECK_ASSERTIONS(trans_i->assertions)) + { + DPRINT(("assert failed\n")); + continue; + } + if (state == NULL) + { + /* Start from this state. */ + state = trans_i->state; + next_tags = trans_i->tags; + } + else + { + /* Backtrack to this state. */ + DPRINT(("saving state %d for backtracking\n", trans_i->state_id)); + BT_STACK_PUSH(hawk, pos, str_byte, str_wide, trans_i->state, + trans_i->state_id, next_c, tags, mbstate); + { + int *tmp = trans_i->tags; + if (tmp) + while (*tmp >= 0) + stack->item.tags[*tmp++] = pos; + } + } + } + + if (next_tags) + for (; *next_tags >= 0; next_tags++) + tags[*next_tags] = pos; + + + DPRINT(("entering match loop, pos %d, str_byte %p\n", pos, str_byte)); + DPRINT(("pos:chr/code | state and tags\n")); + DPRINT(("-------------+------------------------------------------------\n")); + + if (state == NULL) + goto backtrack; + + while (/*CONSTCOND*/1) + { + tre_tnfa_transition_t *next_state; + int empty_br_match; + + DPRINT(("start loop\n")); + if (state == tnfa->final) + { + DPRINT((" match found, %d %d\n", match_eo, pos)); + if (match_eo < pos + || (match_eo == pos + && match_tags + && tre_tag_order(tnfa->num_tags, tnfa->tag_directions, + tags, match_tags))) + { + int i; + /* This match wins the previous match. */ + DPRINT((" win previous\n")); + match_eo = pos; + if (match_tags) + for (i = 0; i < tnfa->num_tags; i++) + match_tags[i] = tags[i]; + } + /* Our TNFAs never have transitions leaving from the final state, + so we jump right to backtracking. */ + goto backtrack; + } + +#ifdef TRE_DEBUG + DPRINT(("%3d:%2lc/%05d | %p ", pos, (tre_cint_t)next_c, (int)next_c, + state)); + { + int i; + for (i = 0; i < tnfa->num_tags; i++) + DPRINT(("%d%s", tags[i], i < tnfa->num_tags - 1 ? ", " : "")); + DPRINT(("\n")); + } +#endif /* TRE_DEBUG */ + + /* Go to the next character in the input string. */ + empty_br_match = 0; + trans_i = state; + if (trans_i->state && (trans_i->assertions & ASSERT_BACKREF)) + { + /* This is a back reference state. All transitions leaving from + this state have the same back reference "assertion". Instead + of reading the next character, we match the back reference. */ + int so, eo, bt = trans_i->u.backref; + int bt_len; + int result; + + DPRINT((" should match back reference %d\n", bt)); + /* Get the substring we need to match against. Remember to + turn off REG_NOSUB temporarily. */ + tre_fill_pmatch(bt + 1, pmatch, tnfa->cflags & /*LINTED*/!REG_NOSUB, + tnfa, tags, pos); + so = pmatch[bt].rm_so; + eo = pmatch[bt].rm_eo; + bt_len = eo - so; + +#ifdef TRE_DEBUG + { + int slen; + if (len < 0) + slen = bt_len; + else + slen = MIN(bt_len, len - pos); + + if (type == STR_BYTE) + { + DPRINT((" substring (len %d) is [%d, %d[: '%.*s'\n", + bt_len, so, eo, bt_len, (char*)string + so)); + DPRINT((" current string is '%.*s'\n", slen, str_byte - 1)); + } +#ifdef TRE_WCHAR + else if (type == STR_WIDE) + { + DPRINT((" substring (len %d) is [%d, %d[: '%.*" STRF "'\n", + bt_len, so, eo, bt_len, (hawk_uch_t*)string + so)); + DPRINT((" current string is '%.*" STRF "'\n", + slen, str_wide - 1)); + } +#endif /* TRE_WCHAR */ + } +#endif + + if (len < 0) + { +#ifdef TRE_WCHAR + if (type == STR_WIDE) + result = hawk_comp_ucstr_limited((const hawk_uch_t*)string + so, str_wide - 1, (size_t)bt_len); + else +#endif /* TRE_WCHAR */ + result = hawk_comp_bcstr_limited((const char*)string + so, str_byte - 1, (size_t)bt_len); + } + else if (len - pos < bt_len) + result = 1; +#ifdef TRE_WCHAR + else if (type == STR_WIDE) + { + /*result = wmemcmp((const hawk_uch_t*)string + so, str_wide - 1, (size_t)bt_len);*/ + result = hawk_comp_uchars((const hawk_uch_t*)string + so, (size_t)bt_len, str_wide - 1, (size_t)bt_len, 0); + } +#endif /* TRE_WCHAR */ + else + { + /*result = memcmp((const char*)string + so, str_byte - 1, (size_t)bt_len); */ + result = hawk_comp_bchars((const char*)string + so, (size_t)bt_len, str_byte - 1, (size_t)bt_len, 0); + } + + + if (result == 0) + { + /* Back reference matched. Check for infinite loop. */ + if (bt_len == 0) + empty_br_match = 1; + if (empty_br_match && states_seen[trans_i->state_id]) + { + DPRINT((" avoid loop\n")); + goto backtrack; + } + + states_seen[trans_i->state_id] = empty_br_match; + + /* Advance in input string and resync `prev_c', `next_c' + and pos. */ + DPRINT((" back reference matched\n")); + str_byte += bt_len - 1; +#ifdef TRE_WCHAR + str_wide += bt_len - 1; +#endif /* TRE_WCHAR */ + pos += bt_len - 1; + GET_NEXT_WCHAR(); + DPRINT((" pos now %d\n", pos)); + } + else + { + DPRINT((" back reference did not match\n")); + goto backtrack; + } + } + else + { + /* Check for end of string. */ + if (len < 0) + { + if (next_c == HAWK_T('\0')) + goto backtrack; + } + else + { + if (pos >= len) + goto backtrack; + } + + /* Read the next character. */ + GET_NEXT_WCHAR(); + } + + next_state = NULL; + for (trans_i = state; trans_i->state; trans_i++) + { + DPRINT((" transition %d-%d (%c-%c) %d to %d\n", + trans_i->code_min, trans_i->code_max, + trans_i->code_min, trans_i->code_max, + trans_i->assertions, trans_i->state_id)); + + if (trans_i->code_min <= (tre_cint_t)prev_c && trans_i->code_max >= (tre_cint_t)prev_c) + { + if (trans_i->assertions + && (CHECK_ASSERTIONS(trans_i->assertions) + || CHECK_CHAR_CLASSES(trans_i, tnfa, eflags))) + { + DPRINT((" assertion failed\n")); + continue; + } + + if (next_state == NULL) + { + /* First matching transition. */ + DPRINT((" Next state is %d\n", trans_i->state_id)); + next_state = trans_i->state; + next_tags = trans_i->tags; + } + else + { + /* Second matching transition. We may need to backtrack here + to take this transition instead of the first one, so we + push this transition in the backtracking stack so we can + jump back here if needed. */ + DPRINT((" saving state %d for backtracking\n", + trans_i->state_id)); + BT_STACK_PUSH(hawk, pos, str_byte, str_wide, trans_i->state, + trans_i->state_id, next_c, tags, mbstate); + { + int *tmp; + for (tmp = trans_i->tags; tmp && *tmp >= 0; tmp++) + stack->item.tags[*tmp] = pos; + } +#if 0 /* XXX - it's important not to look at all transitions here to keep + the stack small! */ + break; +#endif + } + } + } + + if (next_state != NULL) + { + /* Matching transitions were found. Take the first one. */ + state = next_state; + + /* Update the tag values. */ + if (next_tags) + while (*next_tags >= 0) + tags[*next_tags++] = pos; + } + else + { +backtrack: + /* A matching transition was not found. Try to backtrack. */ + if (stack->prev) + { + DPRINT((" backtracking\n")); + if (stack->item.state->assertions && ASSERT_BACKREF) + { + DPRINT((" states_seen[%d] = 0\n", stack->item.state_id)); + states_seen[stack->item.state_id] = 0; + } + + BT_STACK_POP(); + } + else if (match_eo < 0) + { + /* Try starting from a later position in the input string. */ + /* Check for end of string. */ + if (len < 0) + { + if (next_c == HAWK_T('\0')) + { + DPRINT(("end of string.\n")); + break; + } + } + else + { + if (pos >= len) + { + DPRINT(("end of string.\n")); + break; + } + } + DPRINT(("restarting from next start position\n")); + next_c = next_c_start; +#ifdef TRE_MBSTATE + mbstate = mbstate_start; +#endif /* TRE_MBSTATE */ + str_byte = str_byte_start; +#ifdef TRE_WCHAR + str_wide = str_wide_start; +#endif /* TRE_WCHAR */ + goto retry; + } + else + { + DPRINT(("finished\n")); + break; + } + } + } + + ret = match_eo >= 0 ? REG_OK : REG_NOMATCH; + *match_end_ofs = match_eo; + +error_exit: + tre_bt_mem_destroy(mem); + if (tags) xfree(hawk, tags); + if (pmatch) xfree(hawk, pmatch); + if (states_seen) xfree(hawk, states_seen); + + return ret; +} diff --git a/hawk/lib/tre-match-pa.c b/hawk/lib/tre-match-pa.c new file mode 100644 index 00000000..7346ea3e --- /dev/null +++ b/hawk/lib/tre-match-pa.c @@ -0,0 +1,494 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + tre-match-parallel.c - TRE parallel regex matching engine + +This is the license, copyright notice, and disclaimer for TRE, a regex +matching package (library and tools) with support for approximate +matching. + +Copyright (c) 2001-2009 Ville Laurikari +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + This algorithm searches for matches basically by reading characters + in the searched string one by one, starting at the beginning. All + matching paths in the TNFA are traversed in parallel. When two or + more paths reach the same state, exactly one is chosen according to + tag ordering rules; if returning submatches is not required it does + not matter which path is chosen. + + The worst case time required for finding the leftmost and longest + match, or determining that there is no match, is always linearly + dependent on the length of the text being searched. + + This algorithm cannot handle TNFAs with back referencing nodes. + See `tre-match-backtrack.c'. +*/ + +#include "tre-prv.h" +#include "tre-match-ut.h" + +typedef struct +{ + tre_tnfa_transition_t *state; + int *tags; +} tre_tnfa_reach_t; + +typedef struct +{ + int pos; + int **tags; +} tre_reach_pos_t; + + +#ifdef TRE_DEBUG +static void +tre_print_reach(const tre_tnfa_t *tnfa, tre_tnfa_reach_t *reach, int num_tags) +{ + int i; + + while (reach->state != NULL) + { + DPRINT((" %p", (void *)reach->state)); + if (num_tags > 0) + { + DPRINT(("/")); + for (i = 0; i < num_tags; i++) + { + DPRINT(("%d:%d", i, reach->tags[i])); + if (i < (num_tags-1)) + DPRINT((",")); + } + } + reach++; + } + DPRINT(("\n")); + +} +#endif /* TRE_DEBUG */ + +reg_errcode_t +tre_tnfa_run_parallel(hawk_t* hawk, const tre_tnfa_t *tnfa, const void *string, int len, + tre_str_type_t type, int *match_tags, int eflags, + int *match_end_ofs) +{ + /* State variables required by GET_NEXT_WCHAR. */ + tre_char_t prev_c = 0, next_c = 0; + const char *str_byte = string; + int pos = -1; + unsigned int pos_add_next = 1; +#ifdef TRE_WCHAR + const hawk_uch_t *str_wide = string; +#ifdef TRE_MBSTATE + hawk_mbstate_t mbstate; +#endif +#endif /* TRE_WCHAR */ + int reg_notbol = eflags & REG_NOTBOL; + int reg_noteol = eflags & REG_NOTEOL; + int reg_newline = tnfa->cflags & REG_NEWLINE; + int str_user_end = 0; + + char *buf; + tre_tnfa_transition_t *trans_i; + tre_tnfa_reach_t *reach, *reach_next, *reach_i, *reach_next_i; + tre_reach_pos_t *reach_pos; + int *tag_i; + int num_tags, i; + + int match_eo = -1; /* end offset of match (-1 if no match found yet) */ + int new_match = 0; + int *tmp_tags = NULL; + int *tmp_iptr; + +#ifdef TRE_MBSTATE + HAWK_MEMSET(&mbstate, '\0', sizeof(mbstate)); +#endif /* TRE_MBSTATE */ + + DPRINT(("tre_tnfa_run_parallel, input type %d\n", type)); + + if (!match_tags) + num_tags = 0; + else + num_tags = tnfa->num_tags; + + /* Allocate memory for temporary data required for matching. This needs to + be done for every matching operation to be thread safe. This allocates + everything in a single large block from the stack frame using alloca() + or with malloc() if alloca is unavailable. */ + { + int tbytes, rbytes, pbytes, xbytes, total_bytes; + char *tmp_buf; + /* Compute the length of the block we need. */ + tbytes = sizeof(*tmp_tags) * num_tags; + rbytes = sizeof(*reach_next) * (tnfa->num_states + 1); + pbytes = sizeof(*reach_pos) * tnfa->num_states; + xbytes = sizeof(int) * num_tags; + total_bytes = + (sizeof(long) - 1) * 4 /* for alignment paddings */ + + (rbytes + xbytes * tnfa->num_states) * 2 + tbytes + pbytes; + + /* Allocate the memory. */ + buf = xmalloc(hawk, (unsigned)total_bytes); + if (buf == NULL) return REG_ESPACE; + HAWK_MEMSET(buf, 0, (size_t)total_bytes); + + /* Get the various pointers within tmp_buf (properly aligned). */ + tmp_tags = (void *)buf; + tmp_buf = buf + tbytes; + tmp_buf += ALIGN(tmp_buf, hawk_uintptr_t); + reach_next = (void *)tmp_buf; + tmp_buf += rbytes; + tmp_buf += ALIGN(tmp_buf, hawk_uintptr_t); + reach = (void *)tmp_buf; + tmp_buf += rbytes; + tmp_buf += ALIGN(tmp_buf, hawk_uintptr_t); + reach_pos = (void *)tmp_buf; + tmp_buf += pbytes; + tmp_buf += ALIGN(tmp_buf, hawk_uintptr_t); + for (i = 0; i < tnfa->num_states; i++) + { + reach[i].tags = (void *)tmp_buf; + tmp_buf += xbytes; + reach_next[i].tags = (void *)tmp_buf; + tmp_buf += xbytes; + } + } + + for (i = 0; i < tnfa->num_states; i++) + reach_pos[i].pos = -1; + + /* If only one character can start a match, find it first. */ + if (tnfa->first_char >= 0 && type == STR_BYTE && str_byte) + { + const char *orig_str = str_byte; + int first = tnfa->first_char; + + if (len >= 0) + str_byte = hawk_find_bchar(orig_str, (size_t)len, first); + else + str_byte = hawk_find_bchar_in_bcstr(orig_str, first); + if (str_byte == NULL) + { + if (buf) xfree(hawk, buf); + return REG_NOMATCH; + } + DPRINT(("skipped %lu chars\n", (unsigned long)(str_byte - orig_str))); + if (str_byte >= orig_str + 1) + prev_c = (unsigned char)*(str_byte - 1); + next_c = (unsigned char)*str_byte; + pos = str_byte - orig_str; + if (len < 0 || pos < len) + str_byte++; + } + else + { + GET_NEXT_WCHAR(); + pos = 0; + } + +#if 0 + /* Skip over characters that cannot possibly be the first character + of a match. */ + if (tnfa->firstpos_chars != NULL) + { + char *chars = tnfa->firstpos_chars; + + if (len < 0) + { + const char *orig_str = str_byte; + /* XXX - use strpbrk() and wcspbrk() because they might be + optimized for the target architecture. Try also strcspn() + and wcscspn() and compare the speeds. */ + while (next_c != HAWK_T('\0') && !chars[next_c]) + { + next_c = *str_byte++; + } + prev_c = *(str_byte - 2); + pos += str_byte - orig_str; + DPRINT(("skipped %d chars\n", str_byte - orig_str)); + } + else + { + while (pos <= len && !chars[next_c]) + { + prev_c = next_c; + next_c = (unsigned char)(*str_byte++); + pos++; + } + } + } +#endif + + DPRINT(("length: %d\n", len)); + DPRINT(("pos:chr/code | states and tags\n")); + DPRINT(("-------------+------------------------------------------------\n")); + + reach_next_i = reach_next; + while (/*CONSTCOND*/1) + { + /* If no match found yet, add the initial states to `reach_next'. */ + if (match_eo < 0) + { + DPRINT((" init >")); + trans_i = tnfa->initial; + while (trans_i->state != NULL) + { + if (reach_pos[trans_i->state_id].pos < pos) + { + if (trans_i->assertions + && CHECK_ASSERTIONS(trans_i->assertions)) + { + DPRINT(("assertion failed\n")); + trans_i++; + continue; + } + + DPRINT((" %p", (void *)trans_i->state)); + reach_next_i->state = trans_i->state; + for (i = 0; i < num_tags; i++) + reach_next_i->tags[i] = -1; + tag_i = trans_i->tags; + if (tag_i) + while (*tag_i >= 0) + { + if (*tag_i < num_tags) + reach_next_i->tags[*tag_i] = pos; + tag_i++; + } + if (reach_next_i->state == tnfa->final) + { + DPRINT((" found empty match\n")); + match_eo = pos; + new_match = 1; + for (i = 0; i < num_tags; i++) + match_tags[i] = reach_next_i->tags[i]; + } + reach_pos[trans_i->state_id].pos = pos; + reach_pos[trans_i->state_id].tags = &reach_next_i->tags; + reach_next_i++; + } + trans_i++; + } + DPRINT(("\n")); + reach_next_i->state = NULL; + } + else + { + if (num_tags == 0 || reach_next_i == reach_next) + /*?We have found a match. */ + break; + } + + /* Check for end of string. */ + if (len < 0) + { + if (next_c == HAWK_T('\0')) + break; + } + else + { + if (pos >= len) + break; + } + + GET_NEXT_WCHAR(); + +#ifdef TRE_DEBUG + DPRINT(("%3d:%2lc/%05d |", pos - 1, (tre_cint_t)prev_c, (int)prev_c)); + tre_print_reach(tnfa, reach_next, num_tags); + DPRINT(("%3d:%2lc/%05d |", pos, (tre_cint_t)next_c, (int)next_c)); + tre_print_reach(tnfa, reach_next, num_tags); +#endif /* TRE_DEBUG */ + + /* Swap `reach' and `reach_next'. */ + reach_i = reach; + reach = reach_next; + reach_next = reach_i; + + /* For each state in `reach', weed out states that don't fulfill the + minimal matching conditions. */ + if (tnfa->num_minimals && new_match) + { + new_match = 0; + reach_next_i = reach_next; + for (reach_i = reach; reach_i->state; reach_i++) + { + int skip = 0; + for (i = 0; tnfa->minimal_tags[i] >= 0; i += 2) + { + int end = tnfa->minimal_tags[i]; + int start = tnfa->minimal_tags[i + 1]; + DPRINT((" Minimal start %d, end %d\n", start, end)); + if (end >= num_tags) + { + DPRINT((" Throwing %p out.\n", reach_i->state)); + skip = 1; + break; + } + else if (reach_i->tags[start] == match_tags[start] + && reach_i->tags[end] < match_tags[end]) + { + DPRINT((" Throwing %p out because t%d < %d\n", + reach_i->state, end, match_tags[end])); + skip = 1; + break; + } + } + if (!skip) + { + reach_next_i->state = reach_i->state; + tmp_iptr = reach_next_i->tags; + reach_next_i->tags = reach_i->tags; + reach_i->tags = tmp_iptr; + reach_next_i++; + } + } + reach_next_i->state = NULL; + + /* Swap `reach' and `reach_next'. */ + reach_i = reach; + reach = reach_next; + reach_next = reach_i; + } + + /* For each state in `reach' see if there is a transition leaving with + the current input symbol to a state not yet in `reach_next', and + add the destination states to `reach_next'. */ + reach_next_i = reach_next; + for (reach_i = reach; reach_i->state; reach_i++) + { + for (trans_i = reach_i->state; trans_i->state; trans_i++) + { + /* Does this transition match the input symbol? */ + if (trans_i->code_min <= (tre_cint_t)prev_c && trans_i->code_max >= (tre_cint_t)prev_c) + { + if (trans_i->assertions && + (CHECK_ASSERTIONS(trans_i->assertions) || + CHECK_CHAR_CLASSES(trans_i, tnfa, eflags))) + { + DPRINT(("assertion failed\n")); + continue; + } + + /* Compute the tags after this transition. */ + for (i = 0; i < num_tags; i++) tmp_tags[i] = reach_i->tags[i]; + tag_i = trans_i->tags; + if (tag_i != NULL) + { + while (*tag_i >= 0) + { + if (*tag_i < num_tags) + tmp_tags[*tag_i] = pos; + tag_i++; + } + } + + if (reach_pos[trans_i->state_id].pos < pos) + { + /* Found an unvisited node. */ + reach_next_i->state = trans_i->state; + tmp_iptr = reach_next_i->tags; + reach_next_i->tags = tmp_tags; + tmp_tags = tmp_iptr; + reach_pos[trans_i->state_id].pos = pos; + reach_pos[trans_i->state_id].tags = &reach_next_i->tags; + + if (reach_next_i->state == tnfa->final + && (match_eo == -1 || (num_tags > 0 && reach_next_i->tags[0] <= match_tags[0]))) + { + DPRINT((" found match %p\n", trans_i->state)); + match_eo = pos; + new_match = 1; + for (i = 0; i < num_tags; i++) match_tags[i] = reach_next_i->tags[i]; + } + reach_next_i++; + + } + else + { + assert(reach_pos[trans_i->state_id].pos == pos); + /* Another path has also reached this state. We choose + the winner by examining the tag values for both + paths. */ + if (tre_tag_order(num_tags, tnfa->tag_directions, + tmp_tags, + *reach_pos[trans_i->state_id].tags)) + { + /* The new path wins. */ + tmp_iptr = *reach_pos[trans_i->state_id].tags; + *reach_pos[trans_i->state_id].tags = tmp_tags; + if (trans_i->state == tnfa->final) + { + DPRINT((" found better match\n")); + match_eo = pos; + new_match = 1; + for (i = 0; i < num_tags; i++) + match_tags[i] = tmp_tags[i]; + } + tmp_tags = tmp_iptr; + } + } + } + } + } + reach_next_i->state = NULL; + } + + DPRINT(("match end offset = %d\n", match_eo)); + + if (buf) xfree(hawk, buf); + + *match_end_ofs = match_eo; + return match_eo >= 0 ? REG_OK : REG_NOMATCH; +} + +/* EOF */ diff --git a/hawk/lib/tre-match-ut.h b/hawk/lib/tre-match-ut.h new file mode 100644 index 00000000..44e194fa --- /dev/null +++ b/hawk/lib/tre-match-ut.h @@ -0,0 +1,241 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + tre-match-ut.h - TRE matcher helper definitions + +This is the license, copyright notice, and disclaimer for TRE, a regex +matching package (library and tools) with support for approximate +matching. + +Copyright (c) 2001-2009 Ville Laurikari +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifdef TRE_WCHAR + +#ifdef TRE_MULTIBYTE + +/* Wide character and multibyte support. */ + +#define GET_NEXT_WCHAR() \ + do { \ + prev_c = next_c; \ + if (type == STR_BYTE) \ + { \ + pos++; \ + if (len >= 0 && pos >= len) \ + next_c = '\0'; \ + else \ + next_c = (unsigned char)(*str_byte++); \ + } \ + else if (type == STR_WIDE) \ + { \ + pos++; \ + if (len >= 0 && pos >= len) \ + next_c = HAWK_T('\0'); \ + else \ + next_c = *str_wide++; \ + } \ + else if (type == STR_MBS) \ + { \ + pos += pos_add_next; \ + if (str_byte == NULL) \ + next_c = HAWK_T('\0'); \ + else \ + { \ + size_t w; \ + int max; \ + if (len >= 0) \ + max = len - pos; \ + else \ + max = 32; \ + if (max <= 0) \ + { \ + next_c = HAWK_T('\0'); \ + pos_add_next = 1; \ + } \ + else \ + { \ + w = hawk_mbrtowc(str_byte, (size_t)max, &next_c, &mbstate); \ + if (w <= 0 || w > max) \ + return REG_NOMATCH; \ + if (next_c == HAWK_T('\0') && len >= 0) \ + { \ + pos_add_next = 1; \ + next_c = 0; \ + str_byte++; \ + } \ + else \ + { \ + pos_add_next = w; \ + str_byte += w; \ + } \ + } \ + } \ + } \ + } while(/*CONSTCOND*/0) + +#else /* !TRE_MULTIBYTE */ + +/* Wide character support, no multibyte support. */ + +#define GET_NEXT_WCHAR() \ +do { \ + prev_c = next_c; \ + if (type == STR_BYTE) \ + { \ + pos++; \ + if (len >= 0 && pos >= len) next_c = HAWK_BT('\0'); \ + else next_c = (unsigned char)(*str_byte++); \ + } \ + else if (type == STR_WIDE) \ + { \ + pos++; \ + if (len >= 0 && pos >= len) next_c = HAWK_T('\0'); \ + else next_c = *str_wide++; \ + } \ +} while(/*CONSTCOND*/0) + +#endif /* !TRE_MULTIBYTE */ + +#else /* !TRE_WCHAR */ + +/* No wide character or multibyte support. */ + +#define GET_NEXT_WCHAR() \ + do { \ + prev_c = next_c; \ + if (type == STR_BYTE) \ + { \ + pos++; \ + if (len >= 0 && pos >= len) next_c = '\0'; \ + else next_c = (unsigned char)(*str_byte++); \ + } \ + } while(/*CONSTCOND*/0) + +#endif /* !TRE_WCHAR */ + + + +#define IS_WORD_CHAR(c) ((c) == HAWK_T('_') || tre_isalnum(c)) + +#define CHECK_ASSERTIONS(assertions) \ + (((assertions & ASSERT_AT_BOL) \ + && (pos > 0 || reg_notbol) \ + && (prev_c != HAWK_T('\n') || !reg_newline)) \ + || ((assertions & ASSERT_AT_EOL) \ + && (next_c != HAWK_T('\0') || reg_noteol) \ + && (next_c != HAWK_T('\n') || !reg_newline)) \ + || ((assertions & ASSERT_AT_BOW) \ + && (IS_WORD_CHAR(prev_c) || !IS_WORD_CHAR(next_c))) \ + || ((assertions & ASSERT_AT_EOW) \ + && (!IS_WORD_CHAR(prev_c) || IS_WORD_CHAR(next_c))) \ + || ((assertions & ASSERT_AT_WB) \ + && (pos != 0 && next_c != HAWK_T('\0') \ + && IS_WORD_CHAR(prev_c) == IS_WORD_CHAR(next_c))) \ + || ((assertions & ASSERT_AT_WB_NEG) \ + && (pos == 0 || next_c == HAWK_T('\0') \ + || IS_WORD_CHAR(prev_c) != IS_WORD_CHAR(next_c)))) + +#define CHECK_CHAR_CLASSES(trans_i, tnfa, eflags) \ + (((trans_i->assertions & ASSERT_CHAR_CLASS) \ + && !(tnfa->cflags & REG_ICASE) \ + && !tre_isctype((tre_cint_t)prev_c, trans_i->u.class)) \ + || ((trans_i->assertions & ASSERT_CHAR_CLASS) \ + && (tnfa->cflags & REG_ICASE) \ + && !tre_isctype(tre_tolower((tre_cint_t)prev_c),trans_i->u.class) \ + && !tre_isctype(tre_toupper((tre_cint_t)prev_c),trans_i->u.class)) \ + || ((trans_i->assertions & ASSERT_CHAR_CLASS_NEG) \ + && tre_neg_char_classes_match(trans_i->neg_classes,(tre_cint_t)prev_c,\ + tnfa->cflags & REG_ICASE))) + + + + +/* Returns 1 if `t1' wins `t2', 0 otherwise. */ +HAWK_INLINE static int +tre_tag_order(int num_tags, tre_tag_direction_t *tag_directions, + int *t1, int *t2) +{ + int i; + for (i = 0; i < num_tags; i++) + { + if (tag_directions[i] == TRE_TAG_MINIMIZE) + { + if (t1[i] < t2[i]) + return 1; + if (t1[i] > t2[i]) + return 0; + } + else + { + if (t1[i] > t2[i]) + return 1; + if (t1[i] < t2[i]) + return 0; + } + } + /* assert(0);*/ + return 0; +} + +HAWK_INLINE static int +tre_neg_char_classes_match(tre_ctype_t *classes, tre_cint_t wc, int icase) +{ + DPRINT(("neg_char_classes_test: %p, %d, %d\n", classes, wc, icase)); + while (*classes != (tre_ctype_t)0) + if ((!icase && tre_isctype(wc, *classes)) + || (icase && (tre_isctype(tre_toupper(wc), *classes) + || tre_isctype(tre_tolower(wc), *classes)))) + return 1; /* Match. */ + else + classes++; + return 0; /* No match. */ +} diff --git a/hawk/lib/tre-parse.c b/hawk/lib/tre-parse.c new file mode 100644 index 00000000..f7c9891c --- /dev/null +++ b/hawk/lib/tre-parse.c @@ -0,0 +1,1747 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + tre-parse.c - Regexp parser + +This is the license, copyright notice, and disclaimer for TRE, a regex +matching package (library and tools) with support for approximate +matching. + +Copyright (c) 2001-2009 Ville Laurikari +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + This parser is just a simple recursive descent parser for POSIX.2 + regexps. The parser supports both the obsolete default syntax and + the "extended" syntax, and some nonstandard extensions. +*/ + + +#include "tre-prv.h" +#include "tre-ast.h" +#include "tre-stack.h" +#include "tre-parse.h" + +/* Characters with special meanings in regexp syntax. */ +#define CHAR_PIPE HAWK_T('|') +#define CHAR_LPAREN HAWK_T('(') +#define CHAR_RPAREN HAWK_T(')') +#define CHAR_LBRACE HAWK_T('{') +#define CHAR_RBRACE HAWK_T('}') +#define CHAR_LBRACKET HAWK_T('[') +#define CHAR_RBRACKET HAWK_T(']') +#define CHAR_MINUS HAWK_T('-') +#define CHAR_STAR HAWK_T('*') +#define CHAR_QUESTIONMARK HAWK_T('?') +#define CHAR_PLUS HAWK_T('+') +#define CHAR_PERIOD HAWK_T('.') +#define CHAR_COLON HAWK_T(':') +#define CHAR_EQUAL HAWK_T('=') +#define CHAR_COMMA HAWK_T(',') +#define CHAR_CARET HAWK_T('^') +#define CHAR_DOLLAR HAWK_T('$') +#define CHAR_BACKSLASH HAWK_T('\\') +#define CHAR_HASH HAWK_T('#') +#define CHAR_TILDE HAWK_T('~') + + +/* Some macros for expanding \w, \s, etc. */ +static const struct tre_macro_struct +{ + const char c; + const char *expansion; +} tre_macros[] = +{ + {'t', "\t"}, {'n', "\n"}, {'r', "\r"}, + {'f', "\f"}, {'a', "\a"}, {'e', "\033"}, + {'w', "[[:alnum:]_]"}, {'W', "[^[:alnum:]_]"}, {'s', "[[:space:]]"}, + {'S', "[^[:space:]]"}, {'d', "[[:digit:]]"}, {'D', "[^[:digit:]]"}, + { 0, NULL } +}; + +static HAWK_INLINE int xdigit_to_num (hawk_ooch_t c) +{ + return (c >= '0' && c <= '9')? (c - '0'): + (c >= 'A' && c <= 'F')? (c - 'A' + 10): + (c >= 'a' && c <= 'f')? (c - 'a' + 10): -1; +} + +/* Expands a macro delimited by `regex' and `regex_end' to `buf', which + must have at least `len' items. Sets buf[0] to zero if the there + is no match in `tre_macros'. */ +static void +tre_expand_macro(const tre_char_t *regex, const tre_char_t *regex_end, + tre_char_t *buf, size_t buf_len) +{ + int i; + + buf[0] = 0; + if (regex >= regex_end) + return; + + for (i = 0; tre_macros[i].expansion; i++) + { + if (tre_macros[i].c == *regex) + { + unsigned int j; + DPRINT(("Expanding macro '%c' => '%s'\n", + tre_macros[i].c, tre_macros[i].expansion)); + for (j = 0; tre_macros[i].expansion[j] && j < buf_len; j++) + buf[j] = tre_macros[i].expansion[j]; + buf[j] = 0; + break; + } + } +} + +static reg_errcode_t +tre_new_item(tre_mem_t mem, int min, int max, int *i, int *max_i, tre_ast_node_t ***items) +{ + reg_errcode_t status; + tre_ast_node_t **array = *items; + /* Allocate more space if necessary. */ + if (*i >= *max_i) + { + tre_ast_node_t **new_items; + DPRINT(("out of array space, i = %d\n", *i)); + /* If the array is already 1024 items large, give up -- there's + probably an error in the regexp (e.g. not a '\0' terminated + string and missing ']') */ + if (*max_i > 1024) + return REG_ESPACE; + *max_i *= 2; + new_items = xrealloc(mem->hawk, array, sizeof(*items) * *max_i); + if (new_items == NULL) + return REG_ESPACE; + *items = array = new_items; + } + array[*i] = tre_ast_new_literal(mem, min, max, -1); + status = array[*i] == NULL ? REG_ESPACE : REG_OK; + (*i)++; + return status; +} + + +#if defined(HAWK_OOCH_IS_BCH) +/* Expands a character class to character ranges. */ +static reg_errcode_t +tre_expand_ctype(tre_mem_t mem, tre_ctype_t class, tre_ast_node_t ***items, + int *i, int *max_i, int cflags) +{ + reg_errcode_t status = REG_OK; + tre_cint_t c; + int j, min = -1, max = 0; + /* HAWK: deleted */ + /*assert(TRE_MB_CUR_MAX == 1);*/ + /* END HAWK */ + + DPRINT((" expanding class to character ranges\n")); + for (j = 0; (j < 256) && (status == REG_OK); j++) + { + c = j; + if (tre_isctype(c, class) || + ((cflags & REG_ICASE) && (tre_isctype(tre_tolower(c), class) || + tre_isctype(tre_toupper(c), class)))) + { + if (min < 0) min = c; + max = c; + } + else if (min >= 0) + { + DPRINT((" range %c (%d) to %c (%d)\n", min, min, max, max)); + status = tre_new_item(mem, min, max, i, max_i, items); + min = -1; + } + } + if (min >= 0 && status == REG_OK) + status = tre_new_item(mem, min, max, i, max_i, items); + return status; +} +#endif + + +static int +tre_compare_items(const void *a, const void *b, void* ctx) +{ + const tre_ast_node_t *node_a = *(tre_ast_node_t * const *)a; + const tre_ast_node_t *node_b = *(tre_ast_node_t * const *)b; + tre_literal_t *l_a = node_a->obj, *l_b = node_b->obj; + int a_min = l_a->code_min, b_min = l_b->code_min; + + if (a_min < b_min) + return -1; + else if (a_min > b_min) + return 1; + else + return 0; +} + +/* Maximum number of character classes that can occur in a negated bracket + expression. */ +#define MAX_NEG_CLASSES 64 + +/* Maximum length of character class names. */ +#define MAX_CLASS_NAME + +#define REST(re) (int)(ctx->re_end - (re)), (re) + +static reg_errcode_t +tre_parse_bracket_items(tre_parse_ctx_t *ctx, int negate, + tre_ctype_t neg_classes[], int *num_neg_classes, + tre_ast_node_t ***items, int *num_items, + int *items_size) +{ + const tre_char_t *re = ctx->re; + reg_errcode_t status = REG_OK; + tre_ctype_t class = (tre_ctype_t)0; + int i = *num_items; + int max_i = *items_size; + int skip; + + /* Build an array of the items in the bracket expression. */ + while (status == REG_OK) + { + skip = 0; + if (re == ctx->re_end) + { + status = REG_EBRACK; + } + else if (*re == CHAR_RBRACKET && re > ctx->re) + { + DPRINT(("tre_parse_bracket: done: '%.*" STRF "'\n", REST(re))); + re++; + break; + } + else + { + tre_cint_t min = 0, max = 0; + + class = (tre_ctype_t)0; + if (re + 2 < ctx->re_end + && *(re + 1) == CHAR_MINUS && *(re + 2) != CHAR_RBRACKET) + { + DPRINT(("tre_parse_bracket: range: '%.*" STRF "'\n", REST(re))); + min = *re; + max = *(re + 2); + re += 3; + /* XXX - Should use collation order instead of encoding values + in character ranges. */ + if (min > max) + status = REG_ERANGE; + } + else if (re + 1 < ctx->re_end + && *re == CHAR_LBRACKET && *(re + 1) == CHAR_PERIOD) + status = REG_ECOLLATE; + else if (re + 1 < ctx->re_end + && *re == CHAR_LBRACKET && *(re + 1) == CHAR_EQUAL) + status = REG_ECOLLATE; + else if (re + 1 < ctx->re_end + && *re == CHAR_LBRACKET && *(re + 1) == CHAR_COLON) + { + const tre_char_t *endptr = re + 2; + int len; + DPRINT(("tre_parse_bracket: class: '%.*" STRF "'\n", REST(re))); + while (endptr < ctx->re_end && *endptr != CHAR_COLON) endptr++; + if (endptr != ctx->re_end) + { + /* HAWK: bug fix of not checking ending ] */ + if (*(endptr + 1) != CHAR_RBRACKET) status = REG_ECTYPE; + else + { + /* END HAWK */ + len = MIN(endptr - re - 2, 63); + + if (hawk_oochars_to_ooch_prop(re + 2, len, &class) <= -1) status = REG_ECTYPE; + + /* Optimize character classes for 8 bit character sets. */ +#if defined(HAWK_OOCH_IS_BCH) + /* HAWK: not possible to count on MB_CUR_MAX since + * this library is designed to support per-object + * or per-context character encoding using hawk_cmgr_t */ + /* if (status == REG_OK && TRE_MB_CUR_MAX == 1) */ + /* END HAWK */ + if (status == REG_OK) + { + status = tre_expand_ctype(ctx->mem, class, items, &i, &max_i, ctx->cflags); + class = (tre_ctype_t)0; + skip = 1; + } +#endif + re = endptr + 2; + } + } + else status = REG_ECTYPE; + min = 0; + max = TRE_CHAR_MAX; + } + else + { + DPRINT(("tre_parse_bracket: char: '%.*" STRF "'\n", REST(re))); + if (*re == CHAR_MINUS && *(re + 1) != CHAR_RBRACKET && ctx->re != re) + /* Two ranges are not allowed to share and endpoint. */ + status = REG_ERANGE; + min = max = *re++; + } + + if (status != REG_OK) break; + + if (class && negate) + { + if (*num_neg_classes >= MAX_NEG_CLASSES) + status = REG_ESPACE; + else + neg_classes[(*num_neg_classes)++] = class; + } + else if (!skip) + { + status = tre_new_item(ctx->mem, min, max, &i, &max_i, items); + if (status != REG_OK) break; + ((tre_literal_t*)((*items)[i-1])->obj)->u.class = class; + } + + /* Add opposite-case counterpoints if REG_ICASE is present. + This is broken if there are more than two "same" characters. */ + if ((ctx->cflags & REG_ICASE) && !class && status == REG_OK && !skip) + { + tre_cint_t cmin, ccurr; + + DPRINT(("adding opposite-case counterpoints\n")); + while (min <= max) + { + if (tre_islower(min)) + { + cmin = ccurr = tre_toupper(min++); + while (tre_islower(min) && tre_toupper(min) == ccurr + 1 && min <= max) + ccurr = tre_toupper(min++); + status = tre_new_item(ctx->mem, cmin, ccurr, &i, &max_i, items); + } + else if (tre_isupper(min)) + { + cmin = ccurr = tre_tolower(min++); + while (tre_isupper(min) && tre_tolower(min) == ccurr + 1 && min <= max) + ccurr = tre_tolower(min++); + status = tre_new_item(ctx->mem, cmin, ccurr, &i, &max_i, items); + } + else min++; + if (status != REG_OK) break; + } + if (status != REG_OK) break; + } + } + } + *num_items = i; + *items_size = max_i; + ctx->re = re; + return status; +} + +static reg_errcode_t +tre_parse_bracket(tre_parse_ctx_t *ctx, tre_ast_node_t **result) +{ + tre_ast_node_t *node = NULL; + int negate = 0; + reg_errcode_t status = REG_OK; + tre_ast_node_t **items, *u, *n; + int i = 0, j, max_i = 32, curr_max, curr_min; + tre_ctype_t neg_classes[MAX_NEG_CLASSES]; + int num_neg_classes = 0; + + /* Start off with an array of `max_i' elements. */ + items = xmalloc(ctx->mem->hawk, sizeof(*items) * max_i); + if (items == NULL) return REG_ESPACE; + + if (*ctx->re == CHAR_CARET) + { + DPRINT(("tre_parse_bracket: negate: '%.*" STRF "'\n", REST(ctx->re))); + negate = 1; + ctx->re++; + } + + status = tre_parse_bracket_items(ctx, negate, neg_classes, &num_neg_classes, &items, &i, &max_i); + if (status != REG_OK) goto parse_bracket_done; + + /* Sort the array if we need to negate it. */ + if (negate) hawk_qsort(items, (unsigned)i, sizeof(*items), tre_compare_items, HAWK_NULL); + + curr_max = curr_min = 0; + /* Build a union of the items in the array, negated if necessary. */ + for (j = 0; j < i && status == REG_OK; j++) + { + int min, max; + tre_literal_t *l = items[j]->obj; + min = l->code_min; + max = l->code_max; + + DPRINT(("item: %d - %d, class %ld, curr_max = %d\n", + (int)l->code_min, (int)l->code_max, (long)l->u.class, curr_max)); + + if (negate) + { + if (min < curr_max) + { + /* Overlap. */ + curr_max = MAX(max + 1, curr_max); + DPRINT(("overlap, curr_max = %d\n", curr_max)); + l = NULL; + } + else + { + /* No overlap. */ + curr_max = min - 1; + if (curr_max >= curr_min) + { + DPRINT(("no overlap\n")); + l->code_min = curr_min; + l->code_max = curr_max; + } + else + { + DPRINT(("no overlap, zero room\n")); + l = NULL; + } + curr_min = curr_max = max + 1; + } + } + + if (l != NULL) + { + int k; + DPRINT(("creating %d - %d\n", (int)l->code_min, (int)l->code_max)); + l->position = ctx->position; + if (num_neg_classes > 0) + { + l->neg_classes = tre_mem_alloc(ctx->mem, (sizeof(l->neg_classes) * (num_neg_classes + 1))); + if (l->neg_classes == NULL) + { + status = REG_ESPACE; + break; + } + for (k = 0; k < num_neg_classes; k++) l->neg_classes[k] = neg_classes[k]; + l->neg_classes[k] = (tre_ctype_t)0; + } + else + { + l->neg_classes = NULL; + } + if (node == NULL) + { + node = items[j]; + } + else + { + u = tre_ast_new_union(ctx->mem, node, items[j]); + if (u == NULL) + status = REG_ESPACE; + node = u; + } + } + } + + if (status != REG_OK) goto parse_bracket_done; + + if (negate) + { + int k; + DPRINT(("final: creating %d - %d\n", curr_min, (int)TRE_CHAR_MAX)); + n = tre_ast_new_literal(ctx->mem, curr_min, TRE_CHAR_MAX, ctx->position); + if (n == NULL) + { + status = REG_ESPACE; + } + else + { + tre_literal_t *l = n->obj; + if (num_neg_classes > 0) + { + l->neg_classes = tre_mem_alloc(ctx->mem, + (sizeof(l->neg_classes) + * (num_neg_classes + 1))); + if (l->neg_classes == NULL) + { + status = REG_ESPACE; + goto parse_bracket_done; + } + for (k = 0; k < num_neg_classes; k++) + l->neg_classes[k] = neg_classes[k]; + l->neg_classes[k] = (tre_ctype_t)0; + } + else + { + l->neg_classes = NULL; + } + if (node == NULL) + { + node = n; + } + else + { + u = tre_ast_new_union(ctx->mem, node, n); + if (u == NULL) status = REG_ESPACE; + node = u; + } + } + } + + if (status != REG_OK) goto parse_bracket_done; + +#ifdef TRE_DEBUG + tre_ast_print(node); +#endif /* TRE_DEBUG */ + +parse_bracket_done: + xfree(ctx->mem->hawk, items); + ctx->position++; + *result = node; + return status; +} + + +/* Parses a positive decimal integer. Returns -1 if the string does not + contain a valid number. */ +static int +tre_parse_int(const tre_char_t **regex, const tre_char_t *regex_end) +{ + int num = -1; + const tre_char_t *r = *regex; + while (r < regex_end && *r >= HAWK_T('0') && *r <= HAWK_T('9')) + { + if (num < 0) + num = 0; + num = num * 10 + *r - HAWK_T('0'); + r++; + } + *regex = r; + return num; +} + + +static reg_errcode_t +tre_parse_bound(tre_parse_ctx_t *ctx, tre_ast_node_t **result) +{ + int min, max, i; + int cost_ins, cost_del, cost_subst, cost_max; + int limit_ins, limit_del, limit_subst, limit_err; + const tre_char_t *r = ctx->re; + const tre_char_t *start; + int minimal = (ctx->cflags & REG_UNGREEDY) ? 1 : 0; + int approx = 0; + int costs_set = 0; + int counts_set = 0; + + cost_ins = cost_del = cost_subst = cost_max = TRE_PARAM_UNSET; + limit_ins = limit_del = limit_subst = limit_err = TRE_PARAM_UNSET; + + /* Parse number (minimum repetition count). */ + min = -1; + if (r < ctx->re_end && *r >= HAWK_T('0') && *r <= HAWK_T('9')) + { + DPRINT(("tre_parse: min count: '%.*" STRF "'\n", REST(r))); + min = tre_parse_int(&r, ctx->re_end); + } + + /* Parse comma and second number (maximum repetition count). */ + max = min; + if (r < ctx->re_end && *r == CHAR_COMMA) + { + r++; + DPRINT(("tre_parse: max count: '%.*" STRF "'\n", REST(r))); + max = tre_parse_int(&r, ctx->re_end); + } + + /* Check that the repeat counts are sane. */ + /*if ((max >= 0 && min > max) || max > RE_DUP_MAX) return REG_BADBR; + + hyunghwan.chung: + this original check still allows something like {100000,} + while it does not allow {1,256}. Why is RE_DUP_MAX necessary? + */ + if ((max >= 0 && min > max)) return REG_BADBR; + + + /* + '{' + optionally followed immediately by a number == minimum repcount + optionally followed by , then a number == maximum repcount + + then a number == maximum insertion count + - then a number == maximum deletion count + # then a number == maximum substitution count + ~ then a number == maximum number of errors + Any of +, -, # or ~ without followed by a number means that + the maximum count/number of errors is infinite. + + An equation of the form + Xi + Yd + Zs < C + can be specified to set costs and the cost limit to a value + different from the default value: + - X is the cost of an insertion + - Y is the cost of a deletion + - Z is the cost of a substitution + - C is the maximum cost + + If no count limit or cost is set for an operation, the operation + is not allowed at all. + */ + + + do + { + int done; + start = r; + + /* Parse count limit settings */ + done = 0; + if (!counts_set) + while (r + 1 < ctx->re_end && !done) + { + switch (*r) + { + case CHAR_PLUS: /* Insert limit */ + DPRINT(("tre_parse: ins limit: '%.*" STRF "'\n", REST(r))); + r++; + limit_ins = tre_parse_int(&r, ctx->re_end); + if (limit_ins < 0) + limit_ins = HAWK_TYPE_MAX(int); + counts_set = 1; + break; + case CHAR_MINUS: /* Delete limit */ + DPRINT(("tre_parse: del limit: '%.*" STRF "'\n", REST(r))); + r++; + limit_del = tre_parse_int(&r, ctx->re_end); + if (limit_del < 0) + limit_del = HAWK_TYPE_MAX(int); + counts_set = 1; + break; + case CHAR_HASH: /* Substitute limit */ + DPRINT(("tre_parse: subst limit: '%.*" STRF "'\n", REST(r))); + r++; + limit_subst = tre_parse_int(&r, ctx->re_end); + if (limit_subst < 0) + limit_subst = HAWK_TYPE_MAX(int); + counts_set = 1; + break; + case CHAR_TILDE: /* Maximum number of changes */ + DPRINT(("tre_parse: count limit: '%.*" STRF "'\n", REST(r))); + r++; + limit_err = tre_parse_int(&r, ctx->re_end); + if (limit_err < 0) + limit_err = HAWK_TYPE_MAX(int); + approx = 1; + break; + case CHAR_COMMA: + r++; + break; + case HAWK_T(' '): + r++; + break; + case HAWK_T('}'): + done = 1; + break; + default: + done = 1; + break; + } + } + + /* Parse cost restriction equation. */ + done = 0; + if (!costs_set) + while (r + 1 < ctx->re_end && !done) + { + switch (*r) + { + case CHAR_PLUS: + case HAWK_T(' '): + r++; + break; + case HAWK_T('<'): + DPRINT(("tre_parse: max cost: '%.*" STRF "'\n", REST(r))); + r++; + while (*r == HAWK_T(' ')) + r++; + cost_max = tre_parse_int(&r, ctx->re_end); + if (cost_max < 0) + cost_max = HAWK_TYPE_MAX(int); + else + cost_max--; + approx = 1; + break; + case CHAR_COMMA: + r++; + done = 1; + break; + default: + if (*r >= HAWK_T('0') && *r <= HAWK_T('9')) + { +#ifdef TRE_DEBUG + const tre_char_t *sr = r; +#endif /* TRE_DEBUG */ + int cost = tre_parse_int(&r, ctx->re_end); + /* XXX - make sure r is not past end. */ + switch (*r) + { + case HAWK_T('i'): /* Insert cost */ + DPRINT(("tre_parse: ins cost: '%.*" STRF "'\n", + REST(sr))); + r++; + cost_ins = cost; + costs_set = 1; + break; + case HAWK_T('d'): /* Delete cost */ + DPRINT(("tre_parse: del cost: '%.*" STRF "'\n", + REST(sr))); + r++; + cost_del = cost; + costs_set = 1; + break; + case HAWK_T('s'): /* Substitute cost */ + DPRINT(("tre_parse: subst cost: '%.*" STRF "'\n", + REST(sr))); + r++; + cost_subst = cost; + costs_set = 1; + break; + default: + return REG_BADBR; + } + } + else + { + done = 1; + break; + } + } + } + } + while (start != r); + + /* Missing }. */ + if (r >= ctx->re_end) + return REG_EBRACE; + + /* Empty contents of {}. */ + if (r == ctx->re) + return REG_BADBR; + + /* Parse the ending '}' or '\}'.*/ + if (ctx->cflags & REG_EXTENDED) + { + if (r >= ctx->re_end || *r != CHAR_RBRACE) + return REG_BADBR; + r++; + } + else + { + if (r + 1 >= ctx->re_end + || *r != CHAR_BACKSLASH + || *(r + 1) != CHAR_RBRACE) + return REG_BADBR; + r += 2; + } + + + /* Parse trailing '?' marking minimal repetition. */ + if (r < ctx->re_end) + { + if (*r == CHAR_QUESTIONMARK) + { + minimal = !(ctx->cflags & REG_UNGREEDY); + r++; + } +/* HAWK - commented out for minimal impact on backward compatibility. + * X{x,y}* X{x,y}+ */ +#if 0 + else if (*r == CHAR_STAR || *r == CHAR_PLUS) + { + /* These are reserved for future extensions. */ + return REG_BADRPT; + } +#endif + } + + /* Create the AST node(s). */ + if (min == 0 && max == 0) + { + *result = tre_ast_new_literal(ctx->mem, EMPTY, -1, -1); + if (*result == NULL) return REG_ESPACE; + } + else + { + if (min < 0 && max < 0) + /* Only approximate parameters set, no repetitions. */ + min = max = 1; + + *result = tre_ast_new_iter(ctx->mem, *result, min, max, minimal); + if (!*result) + return REG_ESPACE; + + /* If approximate matching parameters are set, add them to the + iteration node. */ + if (approx || costs_set || counts_set) + { + int *params; + tre_iteration_t *iter = (*result)->obj; + + if (costs_set || counts_set) + { + if (limit_ins == TRE_PARAM_UNSET) + { + if (cost_ins == TRE_PARAM_UNSET) + limit_ins = 0; + else + limit_ins = HAWK_TYPE_MAX(int); + } + + if (limit_del == TRE_PARAM_UNSET) + { + if (cost_del == TRE_PARAM_UNSET) + limit_del = 0; + else + limit_del = HAWK_TYPE_MAX(int); + } + + if (limit_subst == TRE_PARAM_UNSET) + { + if (cost_subst == TRE_PARAM_UNSET) + limit_subst = 0; + else + limit_subst = HAWK_TYPE_MAX(int); + } + } + + if (cost_max == TRE_PARAM_UNSET) + cost_max = HAWK_TYPE_MAX(int); + if (limit_err == TRE_PARAM_UNSET) + limit_err = HAWK_TYPE_MAX(int); + + ctx->have_approx = 1; + params = tre_mem_alloc(ctx->mem, sizeof(*params) * TRE_PARAM_LAST); + if (!params) + return REG_ESPACE; + for (i = 0; i < TRE_PARAM_LAST; i++) + params[i] = TRE_PARAM_UNSET; + params[TRE_PARAM_COST_INS] = cost_ins; + params[TRE_PARAM_COST_DEL] = cost_del; + params[TRE_PARAM_COST_SUBST] = cost_subst; + params[TRE_PARAM_COST_MAX] = cost_max; + params[TRE_PARAM_MAX_INS] = limit_ins; + params[TRE_PARAM_MAX_DEL] = limit_del; + params[TRE_PARAM_MAX_SUBST] = limit_subst; + params[TRE_PARAM_MAX_ERR] = limit_err; + iter->params = params; + } + } + + DPRINT(("tre_parse_bound: min %d, max %d, costs [%d,%d,%d, total %d], " + "limits [%d,%d,%d, total %d]\n", + min, max, cost_ins, cost_del, cost_subst, cost_max, + limit_ins, limit_del, limit_subst, limit_err)); + + + ctx->re = r; + return REG_OK; +} + +typedef enum +{ + PARSE_RE = 0, + PARSE_ATOM, + PARSE_MARK_FOR_SUBMATCH, + PARSE_BRANCH, + PARSE_PIECE, + PARSE_CATENATION, + PARSE_POST_CATENATION, + PARSE_UNION, + PARSE_POST_UNION, + PARSE_POSTFIX, + PARSE_RESTORE_CFLAGS +} tre_parse_re_stack_symbol_t; + +reg_errcode_t tre_parse(tre_parse_ctx_t *ctx) +{ + tre_ast_node_t *result = NULL; + tre_parse_re_stack_symbol_t symbol; + reg_errcode_t status = REG_OK; + tre_stack_t *stack = ctx->stack; + int bottom = tre_stack_num_objects(stack); + int depth = 0; + int temporary_cflags = 0; + + DPRINT(("tre_parse: parsing '%.*" STRF "', len = %d\n", + ctx->len, ctx->re, ctx->len)); + + if (!ctx->nofirstsub) + { + STACK_PUSH(stack, int, ctx->submatch_id); + STACK_PUSH(stack, int, PARSE_MARK_FOR_SUBMATCH); + ctx->submatch_id++; + } + STACK_PUSH(stack, int, PARSE_RE); + ctx->re_start = ctx->re; + ctx->re_end = ctx->re + ctx->len; + + + /* The following is basically just a recursive descent parser. I use + an explicit stack instead of recursive functions mostly because of + two reasons: compatibility with systems which have an overflowable + call stack, and efficiency (both in lines of code and speed). */ + while (tre_stack_num_objects(stack) > bottom && status == REG_OK) + { + if (status != REG_OK) break; + + symbol = tre_stack_pop_int(stack); + switch (symbol) + { + case PARSE_RE: + /* Parse a full regexp. A regexp is one or more branches, + separated by the union operator `|'. */ +#ifdef REG_LITERAL + if (!(ctx->cflags & REG_LITERAL) + && ctx->cflags & REG_EXTENDED) +#endif /* REG_LITERAL */ + STACK_PUSHX(stack, int, PARSE_UNION); + STACK_PUSHX(stack, int, PARSE_BRANCH); + break; + + case PARSE_BRANCH: + /* Parse a branch. A branch is one or more pieces, concatenated. + A piece is an atom possibly followed by a postfix operator. */ + STACK_PUSHX(stack, int, PARSE_CATENATION); + STACK_PUSHX(stack, int, PARSE_PIECE); + break; + + case PARSE_PIECE: + /* Parse a piece. A piece is an atom possibly followed by one + or more postfix operators. */ +#ifdef REG_LITERAL + if (!(ctx->cflags & REG_LITERAL)) +#endif /* REG_LITERAL */ + STACK_PUSHX(stack, int, PARSE_POSTFIX); + STACK_PUSHX(stack, int, PARSE_ATOM); + break; + + case PARSE_CATENATION: + /* If the expression has not ended, parse another piece. */ + { + tre_char_t c; + + if (ctx->re >= ctx->re_end) break; + c = *ctx->re; +#ifdef REG_LITERAL + if (!(ctx->cflags & REG_LITERAL)) + { +#endif /* REG_LITERAL */ + if (ctx->cflags & REG_EXTENDED && c == CHAR_PIPE) + break; + if ((ctx->cflags & REG_EXTENDED + && c == CHAR_RPAREN && depth > 0) + || (!(ctx->cflags & REG_EXTENDED) + && (c == CHAR_BACKSLASH + && *(ctx->re + 1) == CHAR_RPAREN))) + { + if (!(ctx->cflags & REG_EXTENDED) && depth == 0) + status = REG_EPAREN; + DPRINT(("tre_parse: group end: '%.*" STRF "'\n", + REST(ctx->re))); + depth--; + if (!(ctx->cflags & REG_EXTENDED)) + ctx->re += 2; + break; + } +#ifdef REG_LITERAL + } +#endif /* REG_LITERAL */ + +#ifdef REG_RIGHT_ASSOC + if (ctx->cflags & REG_RIGHT_ASSOC) + { + /* Right associative concatenation. */ + STACK_PUSHX(stack, voidptr, result); + STACK_PUSHX(stack, int, PARSE_POST_CATENATION); + STACK_PUSHX(stack, int, PARSE_CATENATION); + STACK_PUSHX(stack, int, PARSE_PIECE); + } + else +#endif + { /* REG_RIGHT_ASSOC */ + /* Default case, left associative concatenation. */ + STACK_PUSHX(stack, int, PARSE_CATENATION); + STACK_PUSHX(stack, voidptr, result); + STACK_PUSHX(stack, int, PARSE_POST_CATENATION); + STACK_PUSHX(stack, int, PARSE_PIECE); + } + break; + } + + case PARSE_POST_CATENATION: + { + tre_ast_node_t *tree = tre_stack_pop_voidptr(stack); + tre_ast_node_t *tmp_node; + tmp_node = tre_ast_new_catenation(ctx->mem, tree, result); + if (!tmp_node) + return REG_ESPACE; + result = tmp_node; + break; + } + + case PARSE_UNION: + if (ctx->re >= ctx->re_end) break; + #ifdef REG_LITERAL + if (ctx->cflags & REG_LITERAL) break; + #endif /* REG_LITERAL */ + switch (*ctx->re) + { + case CHAR_PIPE: + DPRINT(("tre_parse: union: '%.*" STRF "'\n", + REST(ctx->re))); + STACK_PUSHX(stack, int, PARSE_UNION); + STACK_PUSHX(stack, voidptr, result); + STACK_PUSHX(stack, int, PARSE_POST_UNION); + STACK_PUSHX(stack, int, PARSE_BRANCH); + ctx->re++; + break; + + case CHAR_RPAREN: + ctx->re++; + break; + + default: + break; + } + break; + + case PARSE_POST_UNION: + { + tre_ast_node_t *tmp_node; + tre_ast_node_t *tree = tre_stack_pop_voidptr(stack); + tmp_node = tre_ast_new_union(ctx->mem, tree, result); + if (!tmp_node) + return REG_ESPACE; + result = tmp_node; + break; + } + + case PARSE_POSTFIX: + /* Parse postfix operators. */ + if (ctx->re >= ctx->re_end) + break; + #ifdef REG_LITERAL + if (ctx->cflags & REG_LITERAL) + break; + #endif /* REG_LITERAL */ + switch (*ctx->re) + { + case CHAR_PLUS: + case CHAR_QUESTIONMARK: + if (!(ctx->cflags & REG_EXTENDED)) break; + /*FALLTHROUGH*/ + case CHAR_STAR: + /* HAWK - added this label */ + parse_star: + /* END HAWK */ + { + tre_ast_node_t *tmp_node; + int minimal = (ctx->cflags & REG_UNGREEDY) ? 1 : 0; + int rep_min = 0; + int rep_max = -1; + #ifdef TRE_DEBUG + const tre_char_t *tmp_re; + #endif + + if (*ctx->re == CHAR_PLUS) /* HAWK: case CHAR_PLUS fell through down here */ + rep_min = 1; + if (*ctx->re == CHAR_QUESTIONMARK) /* HAWK: case CHAR_QUESTIONMARK fell though down here */ + rep_max = 1; + #ifdef TRE_DEBUG + tmp_re = ctx->re; + #endif + + if (ctx->re + 1 < ctx->re_end) + { + if (*(ctx->re + 1) == CHAR_QUESTIONMARK) /* HAWK: +?, ??, *? */ + { + minimal = !(ctx->cflags & REG_UNGREEDY); + ctx->re++; + } + /* HAWK - TRE has provisions for ** or *+ as a special repetition operator. + * however, that seems to break backward compatibility. + * '+' in 'a*+' is not treated as a normal character with the + * following block enabled. So let me comment it out */ + #if 0 + else if (*(ctx->re + 1) == CHAR_STAR + || *(ctx->re + 1) == CHAR_PLUS) + { + /* These are reserved for future extensions. */ + return REG_BADRPT; + } + #endif + } + + DPRINT(("tre_parse: %s star: '%.*" STRF "'\n", + minimal ? " minimal" : "greedy", REST(tmp_re))); + ctx->re++; + tmp_node = tre_ast_new_iter(ctx->mem, result, rep_min, rep_max, + minimal); + if (tmp_node == NULL) + return REG_ESPACE; + result = tmp_node; + STACK_PUSHX(stack, int, PARSE_POSTFIX); + + break; + } + + case CHAR_BACKSLASH: + /* "\{" is special without REG_EXTENDED */ + /* HAWK - also handle \+ and \? */ + /* + if (!(ctx->cflags & REG_EXTENDED) + && ctx->re + 1 < ctx->re_end + && *(ctx->re + 1) == CHAR_LBRACE) + { + ctx->re++; + goto parse_brace; + } + else + break; + */ + if (!(ctx->cflags & REG_EXTENDED) && ctx->re + 1 < ctx->re_end) + { + if (*(ctx->re + 1) == CHAR_LBRACE) + { + ctx->re++; + goto parse_brace; + } + else if (*(ctx->re + 1) == CHAR_PLUS || + *(ctx->re + 1) == CHAR_QUESTIONMARK) + { + ctx->re++; + goto parse_star; + } + } + break; + /* END HAWK */ + + + case CHAR_LBRACE: + /* "{" is literal without REG_EXTENDED */ + if (!(ctx->cflags & REG_EXTENDED)) break; + /* HAWK */ + if (ctx->cflags & REG_NOBOUND) break; + /* END HAWK */ + + parse_brace: + DPRINT(("tre_parse: bound: '%.*" STRF "'\n", + REST(ctx->re))); + ctx->re++; + + status = tre_parse_bound(ctx, &result); + if (status != REG_OK) + return status; + STACK_PUSHX(stack, int, PARSE_POSTFIX); + break; + } + + break; + + case PARSE_ATOM: + + /* Parse an atom. An atom is a regular expression enclosed in `()', + an empty set of `()', a bracket expression, `.', `^', `$', + a `\' followed by a character, or a single character. */ + + /* End of regexp? (empty string). */ + if (ctx->re >= ctx->re_end) goto parse_literal; + + #ifdef REG_LITERAL + if (ctx->cflags & REG_LITERAL) goto parse_literal; + #endif /* REG_LITERAL */ + + switch (*ctx->re) + { + case CHAR_LPAREN: /* parenthesized subexpression */ + + /* Handle "(?...)" extensions. They work in a way similar + to Perls corresponding extensions. */ + /* HAWK: added ctx->cflags & REG_NONSTDEXT */ + if ((ctx->cflags & REG_NONSTDEXT) && + (ctx->cflags & REG_EXTENDED) && + *(ctx->re + 1) == CHAR_QUESTIONMARK) + { + int new_cflags = ctx->cflags; + int bit = 1; + DPRINT(("tre_parse: extension: '%.*" STRF "\n", REST(ctx->re))); + ctx->re += 2; + while (/*CONSTCOND*/1) + { + if (*ctx->re == HAWK_T('i')) + { + DPRINT(("tre_parse: icase: '%.*" STRF "\n", REST(ctx->re))); + if (bit) + new_cflags |= REG_ICASE; + else + new_cflags &= ~REG_ICASE; + ctx->re++; + } + else if (*ctx->re == HAWK_T('n')) + { + DPRINT(("tre_parse: newline: '%.*" STRF "\n", REST(ctx->re))); + if (bit) + new_cflags |= REG_NEWLINE; + else + new_cflags &= ~REG_NEWLINE; + ctx->re++; + } + #ifdef REG_RIGHT_ASSOC + else if (*ctx->re == HAWK_T('r')) + { + DPRINT(("tre_parse: right assoc: '%.*" STRF "\n", REST(ctx->re))); + if (bit) + new_cflags |= REG_RIGHT_ASSOC; + else + new_cflags &= ~REG_RIGHT_ASSOC; + ctx->re++; + } + #endif /* REG_RIGHT_ASSOC */ + #ifdef REG_UNGREEDY + else if (*ctx->re == HAWK_T('U')) + { + DPRINT(("tre_parse: ungreedy: '%.*" STRF "\n", REST(ctx->re))); + if (bit) + new_cflags |= REG_UNGREEDY; + else + new_cflags &= ~REG_UNGREEDY; + ctx->re++; + } + #endif /* REG_UNGREEDY */ + else if (*ctx->re == CHAR_MINUS) + { + DPRINT(("tre_parse: turn off: '%.*" STRF "\n", + REST(ctx->re))); + ctx->re++; + bit = 0; + } + else if (*ctx->re == CHAR_COLON) + { + DPRINT(("tre_parse: no group: '%.*" STRF "\n", + REST(ctx->re))); + ctx->re++; + depth++; + break; + } + else if (*ctx->re == CHAR_HASH) + { + DPRINT(("tre_parse: comment: '%.*" STRF "\n", + REST(ctx->re))); + /* A comment can contain any character except a + right parenthesis */ + while (*ctx->re != CHAR_RPAREN + && ctx->re < ctx->re_end) + ctx->re++; + if (*ctx->re == CHAR_RPAREN && ctx->re < ctx->re_end) + { + ctx->re++; + break; + } + else + return REG_BADPAT; + } + else if (*ctx->re == CHAR_RPAREN) + { + ctx->re++; + break; + } + else + return REG_BADPAT; + } + + /* Turn on the cflags changes for the rest of the + enclosing group. */ + STACK_PUSHX(stack, int, ctx->cflags); + STACK_PUSHX(stack, int, PARSE_RESTORE_CFLAGS); + STACK_PUSHX(stack, int, PARSE_RE); + ctx->cflags = new_cflags; + break; + } + + if (ctx->cflags & REG_EXTENDED + || (ctx->re > ctx->re_start + && *(ctx->re - 1) == CHAR_BACKSLASH)) + { + depth++; + /* HAWK: added ctx->cflags & REG_NONSTDEXT */ + if ((ctx->cflags & REG_NONSTDEXT) && + ctx->re + 2 < ctx->re_end && + *(ctx->re + 1) == CHAR_QUESTIONMARK && + *(ctx->re + 2) == CHAR_COLON) + { + /* HAWK: \(?: or (?: depending on REG_EXTENDED */ + DPRINT(("tre_parse: group begin: '%.*" STRF + "', no submatch\n", REST(ctx->re))); + /* Don't mark for submatching. */ + ctx->re += 3; + STACK_PUSHX(stack, int, PARSE_RE); + } + else + { + DPRINT(("tre_parse: group begin: '%.*" STRF + "', submatch %d\n", REST(ctx->re), + ctx->submatch_id)); + ctx->re++; + /* First parse a whole RE, then mark the resulting tree + for submatching. */ + STACK_PUSHX(stack, int, ctx->submatch_id); + STACK_PUSHX(stack, int, PARSE_MARK_FOR_SUBMATCH); + STACK_PUSHX(stack, int, PARSE_RE); + ctx->submatch_id++; + } + } + else + goto parse_literal; + break; + + case CHAR_RPAREN: /* end of current subexpression */ + if ((ctx->cflags & REG_EXTENDED && depth > 0) + || (ctx->re > ctx->re_start + && *(ctx->re - 1) == CHAR_BACKSLASH)) + { + DPRINT(("tre_parse: empty: '%.*" STRF "'\n", REST(ctx->re))); + /* We were expecting an atom, but instead the current + subexpression was closed. POSIX leaves the meaning of + this to be implementation-defined. We interpret this as + an empty expression (which matches an empty string). */ + result = tre_ast_new_literal(ctx->mem, EMPTY, -1, -1); + if (result == NULL) return REG_ESPACE; + if (!(ctx->cflags & REG_EXTENDED)) ctx->re--; + } + else + goto parse_literal; + break; + + case CHAR_LBRACKET: /* bracket expression */ + DPRINT(("tre_parse: bracket: '%.*" STRF "'\n", REST(ctx->re))); + ctx->re++; + status = tre_parse_bracket(ctx, &result); + if (status != REG_OK) return status; + break; + + case CHAR_BACKSLASH: + /* If this is "\(" or "\)" chew off the backslash and + try again. */ + if (!(ctx->cflags & REG_EXTENDED) + && ctx->re + 1 < ctx->re_end + && (*(ctx->re + 1) == CHAR_LPAREN + || *(ctx->re + 1) == CHAR_RPAREN)) + { + ctx->re++; + STACK_PUSHX(stack, int, PARSE_ATOM); + break; + } + + /* If a macro is used, parse the expanded macro recursively. */ + { + tre_char_t buf[64]; + tre_expand_macro(ctx->re + 1, ctx->re_end, buf, HAWK_COUNTOF(buf)); + if (buf[0] != 0) + { + tre_parse_ctx_t subctx; + HAWK_MEMCPY (&subctx, ctx, sizeof(subctx)); + subctx.re = buf; + subctx.len = tre_strlen(buf); + subctx.nofirstsub = 1; + status = tre_parse(&subctx); + if (status != REG_OK) return status; + ctx->re += 2; + ctx->position = subctx.position; + result = subctx.result; + break; + } + } + + if (ctx->re + 1 >= ctx->re_end) + { + /* Trailing backslash. */ + return REG_EESCAPE; + } + + #ifdef REG_LITERAL + if (*(ctx->re + 1) == HAWK_T('Q')) + { + DPRINT(("tre_parse: tmp literal: '%.*" STRF "'\n", + REST(ctx->re))); + ctx->cflags |= REG_LITERAL; + temporary_cflags |= REG_LITERAL; + ctx->re += 2; + STACK_PUSHX(stack, int, PARSE_ATOM); + break; + } + #endif /* REG_LITERAL */ + + DPRINT(("tre_parse: bleep: '%.*" STRF "'\n", REST(ctx->re))); + ctx->re++; + switch (*ctx->re) + { + case HAWK_T('b'): + result = tre_ast_new_literal(ctx->mem, ASSERTION, ASSERT_AT_WB, -1); + ctx->re++; + break; + case HAWK_T('B'): + result = tre_ast_new_literal(ctx->mem, ASSERTION, ASSERT_AT_WB_NEG, -1); + ctx->re++; + break; + case HAWK_T('<'): + result = tre_ast_new_literal(ctx->mem, ASSERTION, ASSERT_AT_BOW, -1); + ctx->re++; + break; + case HAWK_T('>'): + result = tre_ast_new_literal(ctx->mem, ASSERTION, ASSERT_AT_EOW, -1); + ctx->re++; + break; + case HAWK_T('x'): + ctx->re++; + if (ctx->re[0] != CHAR_LBRACE && ctx->re < ctx->re_end) + { + /* HAWK */ + #if 0 + /* 8 bit hex char. */ + char tmp[3] = {0, 0, 0}; + long val; + DPRINT(("tre_parse: 8 bit hex: '%.*" STRF "'\n", + REST(ctx->re - 2))); + + if (tre_isxdigit(ctx->re[0]) && ctx->re < ctx->re_end) + { + tmp[0] = (char)ctx->re[0]; + ctx->re++; + } + if (tre_isxdigit(ctx->re[0]) && ctx->re < ctx->re_end) + { + tmp[1] = (char)ctx->re[0]; + ctx->re++; + } + val = strtol(tmp, NULL, 16); + #endif + long val = 0; + int tmp; + if ((tmp = xdigit_to_num(ctx->re[0])) >= 0 && ctx->re < ctx->re_end) + { + val = val * 16 + tmp; + ctx->re++; + } + if ((tmp = xdigit_to_num(ctx->re[1])) >= 0 && ctx->re < ctx->re_end) + { + val = val * 16 + tmp; + ctx->re++; + } + + result = tre_ast_new_literal(ctx->mem, (int)val, (int)val, ctx->position); + ctx->position++; + break; + } + else if (ctx->re < ctx->re_end) + { + /* Wide char. */ + /* HAWK */ + #if 0 + char tmp[32]; + long val; + int i = 0; + ctx->re++; + while (ctx->re_end - ctx->re >= 0) + { + if (ctx->re[0] == CHAR_RBRACE) + break; + if (tre_isxdigit(ctx->re[0])) + { + tmp[i] = (char)ctx->re[0]; + i++; + ctx->re++; + continue; + } + return REG_EBRACE; + } + ctx->re++; + tmp[i] = 0; + val = strtol(tmp, NULL, 16); + #endif + long val = 0; + int tmp; + + ctx->re++; + while (ctx->re_end - ctx->re >= 0) + { + if (ctx->re[0] == CHAR_RBRACE) + break; + tmp = xdigit_to_num(ctx->re[0]); + if (tmp >= 0) + { + val = val * 16 + tmp; + ctx->re++; + continue; + } + return REG_EBRACE; + } + + result = tre_ast_new_literal(ctx->mem, (int)val, (int)val, ctx->position); + ctx->position++; + break; + } + /*FALLTHROUGH*/ + + default: + if (tre_isdigit(*ctx->re)) + { + /* Back reference. */ + int val = *ctx->re - HAWK_T('0'); + DPRINT(("tre_parse: backref: '%.*" STRF "'\n", REST(ctx->re - 1))); + result = tre_ast_new_literal(ctx->mem, BACKREF, val, ctx->position); + if (result == NULL) return REG_ESPACE; + ctx->position++; + ctx->max_backref = MAX(val, ctx->max_backref); + ctx->re++; + } + else + { + /* Escaped character. */ + DPRINT(("tre_parse: escaped: '%.*" STRF "'\n", REST(ctx->re - 1))); + result = tre_ast_new_literal(ctx->mem, *ctx->re, *ctx->re, ctx->position); + ctx->position++; + ctx->re++; + } + break; + } + if (result == NULL) + return REG_ESPACE; + break; + + case CHAR_PERIOD: /* the any-symbol */ + DPRINT(("tre_parse: any: '%.*" STRF "'\n", + REST(ctx->re))); + if (ctx->cflags & REG_NEWLINE) + { + tre_ast_node_t *tmp1; + tre_ast_node_t *tmp2; + /* exclude new line */ + tmp1 = tre_ast_new_literal(ctx->mem, 0, HAWK_T('\n') - 1, ctx->position); + if (!tmp1) return REG_ESPACE; + tmp2 = tre_ast_new_literal(ctx->mem, HAWK_T('\n') + 1, TRE_CHAR_MAX, ctx->position + 1); + if (!tmp2) return REG_ESPACE; + result = tre_ast_new_union(ctx->mem, tmp1, tmp2); + if (!result) return REG_ESPACE; + ctx->position += 2; + } + else + { + /* all characters */ + result = tre_ast_new_literal(ctx->mem, 0, TRE_CHAR_MAX, ctx->position); + if (!result) return REG_ESPACE; + ctx->position++; + } + ctx->re++; + break; + + case CHAR_CARET: /* beginning of line assertion */ + /* '^' has a special meaning everywhere in EREs, and in the + beginning of the RE and after \( is BREs. */ + if (ctx->cflags & REG_EXTENDED + || (ctx->re - 2 >= ctx->re_start + && *(ctx->re - 2) == CHAR_BACKSLASH + && *(ctx->re - 1) == CHAR_LPAREN) + || ctx->re == ctx->re_start) + { + DPRINT(("tre_parse: BOL: '%.*" STRF "'\n", + REST(ctx->re))); + result = tre_ast_new_literal(ctx->mem, ASSERTION, ASSERT_AT_BOL, -1); + if (result == NULL) return REG_ESPACE; + ctx->re++; + } + else + goto parse_literal; + break; + + case CHAR_DOLLAR: /* end of line assertion. */ + /* '$' is special everywhere in EREs, and in the end of the + string and before \) is BREs. */ + if (ctx->cflags & REG_EXTENDED + || (ctx->re + 2 < ctx->re_end + && *(ctx->re + 1) == CHAR_BACKSLASH + && *(ctx->re + 2) == CHAR_RPAREN) + || ctx->re + 1 == ctx->re_end) + { + DPRINT(("tre_parse: EOL: '%.*" STRF "'\n", + REST(ctx->re))); + result = tre_ast_new_literal(ctx->mem, ASSERTION, ASSERT_AT_EOL, -1); + if (result == NULL) + return REG_ESPACE; + ctx->re++; + } + else + goto parse_literal; + break; + + default: + parse_literal: + + if (temporary_cflags && ctx->re + 1 < ctx->re_end + && *ctx->re == CHAR_BACKSLASH && *(ctx->re + 1) == HAWK_T('E')) + { + DPRINT(("tre_parse: end tmps: '%.*" STRF "'\n", REST(ctx->re))); + ctx->cflags &= ~temporary_cflags; + temporary_cflags = 0; + ctx->re += 2; + STACK_PUSHX(stack, int, PARSE_PIECE); + break; + } + + + /* We are expecting an atom. If the subexpression (or the whole + regexp ends here, we interpret it as an empty expression + (which matches an empty string). */ + if ( + #ifdef REG_LITERAL + !(ctx->cflags & REG_LITERAL) && + #endif /* REG_LITERAL */ + (ctx->re >= ctx->re_end + || *ctx->re == CHAR_STAR + || (ctx->cflags & REG_EXTENDED + && (*ctx->re == CHAR_PIPE + /* HAWK */ + /*|| *ctx->re == CHAR_LBRACE*/ + || (*ctx->re == CHAR_LBRACE && !(ctx->cflags & REG_NOBOUND)) + /* END HAWK */ + || *ctx->re == CHAR_PLUS + || *ctx->re == CHAR_QUESTIONMARK)) + /* Test for "\)" in BRE mode. */ + || (!(ctx->cflags & REG_EXTENDED) + && ctx->re + 1 < ctx->re_end + && *ctx->re == CHAR_BACKSLASH + && *(ctx->re + 1) == CHAR_LBRACE))) + { + DPRINT(("tre_parse: empty: '%.*" STRF "'\n", REST(ctx->re))); + result = tre_ast_new_literal(ctx->mem, EMPTY, -1, -1); + if (!result) return REG_ESPACE; + break; + } + + DPRINT(("tre_parse: literal: '%.*" STRF "'\n", + REST(ctx->re))); + /* Note that we can't use an tre_isalpha() test here, since there + may be characters which are alphabetic but neither upper or + lower case. */ + if (ctx->cflags & REG_ICASE && (tre_isupper(*ctx->re) || tre_islower(*ctx->re))) + { + tre_ast_node_t *tmp1; + tre_ast_node_t *tmp2; + + /* XXX - Can there be more than one opposite-case + counterpoints for some character in some locale? Or + more than two characters which all should be regarded + the same character if case is ignored? If yes, there + does not seem to be a portable way to detect it. I guess + that at least for multi-character collating elements there + could be several opposite-case counterpoints, but they + cannot be supported portably anyway. */ + tmp1 = tre_ast_new_literal(ctx->mem, tre_toupper(*ctx->re), tre_toupper(*ctx->re), ctx->position); + if (!tmp1) return REG_ESPACE; + tmp2 = tre_ast_new_literal(ctx->mem, tre_tolower(*ctx->re), tre_tolower(*ctx->re), ctx->position); + if (!tmp2) return REG_ESPACE; + result = tre_ast_new_union(ctx->mem, tmp1, tmp2); + if (!result) return REG_ESPACE; + } + else + { + result = tre_ast_new_literal(ctx->mem, *ctx->re, *ctx->re, ctx->position); + if (!result) return REG_ESPACE; + } + ctx->position++; + ctx->re++; + break; + } + break; + + case PARSE_MARK_FOR_SUBMATCH: + { + int submatch_id = tre_stack_pop_int(stack); + + if (result->submatch_id >= 0) + { + tre_ast_node_t *n, *tmp_node; + n = tre_ast_new_literal(ctx->mem, EMPTY, -1, -1); + if (n == NULL) return REG_ESPACE; + tmp_node = tre_ast_new_catenation(ctx->mem, n, result); + if (tmp_node == NULL) return REG_ESPACE; + tmp_node->num_submatches = result->num_submatches; + result = tmp_node; + } + result->submatch_id = submatch_id; + result->num_submatches++; + break; + } + + case PARSE_RESTORE_CFLAGS: + ctx->cflags = tre_stack_pop_int(stack); + break; + + default: + assert(0); + break; + } + } + + /* Check for missing closing parentheses. */ + if (depth > 0) + return REG_EPAREN; + + if (status == REG_OK) + ctx->result = result; + + return status; +} + +/* EOF */ diff --git a/hawk/lib/tre-parse.h b/hawk/lib/tre-parse.h new file mode 100644 index 00000000..9583c400 --- /dev/null +++ b/hawk/lib/tre-parse.h @@ -0,0 +1,102 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + tre-parse.c - Regexp parser definitions + +This is the license, copyright notice, and disclaimer for TRE, a regex +matching package (library and tools) with support for approximate +matching. + +Copyright (c) 2001-2009 Ville Laurikari +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _HAWK_LIB_CMN_TRE_PARSE_H_ +#define _HAWK_LIB_CMN_TRE_PARSE_H_ + +/* Parse context. */ +typedef struct +{ + /* Memory allocator. The AST is allocated using this. */ + tre_mem_t mem; + /* Stack used for keeping track of regexp syntax. */ + tre_stack_t *stack; + /* The parse result. */ + tre_ast_node_t *result; + /* The regexp to parse and its length. */ + const tre_char_t *re; + /* The first character of the entire regexp. */ + const tre_char_t *re_start; + /* The first character after the end of the regexp. */ + const tre_char_t *re_end; + int len; + /* Current submatch ID. */ + int submatch_id; + /* Current position (number of literal). */ + int position; + /* The highest back reference or -1 if none seen so far. */ + int max_backref; + /* This flag is set if the regexp uses approximate matching. */ + int have_approx; + /* Compilation flags. */ + int cflags; + /* If this flag is set the top-level submatch is not captured. */ + int nofirstsub; + /* The currently set approximate matching parameters. */ + int params[TRE_PARAM_LAST]; +} tre_parse_ctx_t; + +/* Parses a wide character regexp pattern into a syntax tree. This parser + handles both syntaxes (BRE and ERE), including the TRE extensions. */ +reg_errcode_t tre_parse(tre_parse_ctx_t *ctx); + +#endif /* TRE_PARSE_H */ + +/* EOF */ diff --git a/hawk/lib/tre-prv.h b/hawk/lib/tre-prv.h new file mode 100644 index 00000000..49d4670d --- /dev/null +++ b/hawk/lib/tre-prv.h @@ -0,0 +1,445 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + tre-internal.h - TRE internal definitions + +This is the license, copyright notice, and disclaimer for TRE, a regex +matching package (library and tools) with support for approximate +matching. + +Copyright (c) 2001-2009 Ville Laurikari +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _HAWK_TRE_PRV_H_ +#define _HAWK_TRE_PRV_H_ + +/* TODO: MAKE TRE WORK LIKE GNU + +PATTERN: \(.\{0,1\}\)\(~[^,]*\)\([0-9]\)\(\.*\),\([^;]*\)\(;\([^;]*\(\3[^;]*\)\).*X*\1\(.*\)\) +INPUT: ~02.,3~3;0123456789;9876543210 + +------------------------------------------------------ +samples/cmn/tre01 gives the following output. this does not seem wrong, though. + +SUBMATCH[7],[8],[9]. + +SUBMATCH[0] = [~02.,3~3;0123456789;9876543210] +SUBMATCH[1] = [] +SUBMATCH[2] = [~0] +SUBMATCH[3] = [2] +SUBMATCH[4] = [.] +SUBMATCH[5] = [3~3] +SUBMATCH[6] = [;0123456789;9876543210] +SUBMATCH[7] = [012] +SUBMATCH[8] = [2] +SUBMATCH[9] = [3456789;9876543210 + +------------------------------------------------------ + +Using the GNU regcomp(),regexec(), the following +is printed. + +#include +#include +#include +int main (int argc, char* argv[]) +{ + regex_t tre; + regmatch_t mat[10]; + int i; + regcomp (&tre, argv[1], 0); + regexec (&tre, argv[2], 10, mat, 0); + for (i = 0; i < 10; i++) + { + if (mat[i].rm_so == -1) break; + printf ("SUBMATCH[%u] = [%.*s]\n", i, + (int)(mat[i].rm_eo - mat[i].rm_so), &argv[2][mat[i].rm_so]); + } + regfree (&tre); + return 0; +} + +SUBMATCH[0] = [~02.,3~3;0123456789;9876543210] +SUBMATCH[1] = [] +SUBMATCH[2] = [~0] +SUBMATCH[3] = [2] +SUBMATCH[4] = [.] +SUBMATCH[5] = [3~3] +SUBMATCH[6] = [;0123456789;9876543210] +SUBMATCH[7] = [0123456789] +SUBMATCH[8] = [23456789] +SUBMATCH[9] = [] + + +------------------------------------------------------ +One more example here: +$ ./tre01 "\(x*\)ab\(\(c*\1\)\(.*\)\)" "abcdefg" +Match: YES +SUBMATCH[0] = [abcdefg] +SUBMATCH[1] = [] +SUBMATCH[2] = [cdefg] +SUBMATCH[3] = [] +SUBMATCH[4] = [cdefg] + +$ ./reg "\(x*\)ab\(\(c*\1\)\(.*\)\)" "abcdefg" +SUBMATCH[0] = [abcdefg] +SUBMATCH[1] = [] +SUBMATCH[2] = [cdefg] +SUBMATCH[3] = [c] +SUBMATCH[4] = [defg] +*/ + +#include +#include +#include +#include "hawk-prv.h" + +#if defined(HAWK_OOCH_IS_UCH) +# define TRE_WCHAR + +/*# define TRE_MULTIBYTE*/ +/*# define TRE_MBSTATE*/ +#endif + +#define TRE_REGEX_T_FIELD value +/*#define assert(x) HAWK_ASSERT(x)*/ +#define assert(x) +#define NULL HAWK_NULL + +#define tre_islower(c) hawk_is_ooch_lower(c) +#define tre_isupper(c) hawk_is_ooch_upper(c) +#define tre_isalpha(c) hawk_is_ooch_alpha(c) +#define tre_isdigit(c) hawk_is_ooch_digit(c) +#define tre_isxdigit(c) hawk_is_ooch_xdigit(c) +#define tre_isalnum(c) hawk_is_ooch_alnum(c) + +#define tre_isspace(c) hawk_is_ooch_space(c) +#define tre_isprint(c) hawk_is_ooch_print(c) +#define tre_isgraph(c) hawk_is_ooch_graph(c) +#define tre_iscntrl(c) hawk_is_ooch_cntrl(c) +#define tre_ispunct(c) hawk_is_ooch_punct(c) +#define tre_isblank(c) hawk_is_ooch_blank(c) + +#define tre_tolower(c) hawk_to_ooch_lower(c) +#define tre_toupper(c) hawk_to_ooch_upper(c) + +#if defined(HAWK_OOCH_IS_BCH) && (HAWK_SIZEOF_MCHAR_T == HAWK_SIZEOF_CHAR) + typedef unsigned char tre_char_t; +#else + typedef hawk_ooch_t tre_char_t; +#endif +typedef hawk_ooci_t tre_cint_t; + +#define size_t hawk_oow_t +#define regex_t hawk_tre_t +#define regmatch_t hawk_tre_match_t +#define reg_errcode_t hawk_tre_errnum_t + + +#define REG_OK HAWK_TRE_ENOERR +#define REG_ESPACE HAWK_TRE_ENOMEM +#define REG_NOMATCH HAWK_TRE_ENOMATCH +#define REG_BADPAT HAWK_TRE_EBADPAT +#define REG_ECOLLATE HAWK_TRE_ECOLLATE +#define REG_ECTYPE HAWK_TRE_ECTYPE +#define REG_EESCAPE HAWK_TRE_EESCAPE +#define REG_ESUBREG HAWK_TRE_ESUBREG +#define REG_EBRACK HAWK_TRE_EBRACK +#define REG_EPAREN HAWK_TRE_EPAREN +#define REG_EBRACE HAWK_TRE_EBRACE +#define REG_BADBR HAWK_TRE_EBADBR +#define REG_ERANGE HAWK_TRE_ERANGE +#define REG_BADRPT HAWK_TRE_EBADRPT + +/* The maximum number of iterations in a bound expression. */ +#undef RE_DUP_MAX +#define RE_DUP_MAX 255 + +/* POSIX tre_regcomp() flags. */ +#define REG_EXTENDED HAWK_TRE_EXTENDED +#define REG_ICASE HAWK_TRE_IGNORECASE +#define REG_NEWLINE HAWK_TRE_NEWLINE +#define REG_NOSUB HAWK_TRE_NOSUBREG +/* Extra tre_regcomp() flags. */ +#define REG_LITERAL HAWK_TRE_LITERAL +#define REG_RIGHT_ASSOC HAWK_TRE_RIGHTASSOC +#define REG_UNGREEDY HAWK_TRE_UNGREEDY +#define REG_NOBOUND HAWK_TRE_NOBOUND +#define REG_NONSTDEXT HAWK_TRE_NONSTDEXT + +/* POSIX tre_regexec() flags. */ +#define REG_NOTBOL HAWK_TRE_NOTBOL +#define REG_NOTEOL HAWK_TRE_NOTEOL +#define REG_BACKTRACKING_MATCHER HAWK_TRE_BACKTRACKING + + +#define tre_strlen(c) hawk_count_oocstr(c) + +typedef hawk_pma_t* tre_mem_t; + +#define tre_mem_new(hawk) hawk_pma_open(hawk,0) +#define tre_mem_destroy(mem) hawk_pma_close(mem) +#define tre_mem_alloc(mem,size) hawk_pma_alloc(mem,size) +#define tre_mem_calloc(mem,size) hawk_pma_calloc(mem,size) + +#define xmalloc(hawk,size) hawk_allocmem(hawk,size) +#define xfree(hawk,ptr) hawk_freemem(hawk,ptr) +#define xrealloc(hawk,ptr,new_size) hawk_reallocmem(hawk, ptr, new_size) + + +/* tre-ast.h */ +#define tre_ast_new_node hawk_tre_astnewnode +#define tre_ast_new_literal hawk_tre_astnewliteral +#define tre_ast_new_iter hawk_tre_astnewiter +#define tre_ast_new_union hawk_tre_astnewunion +#define tre_ast_new_catenation hawk_tre_astnewcatenation + +/* tre-parse.h */ +#define tre_parse hawk_tre_parse + +/* tre-stack.h */ +#define tre_stack_destroy hawk_tre_stackfree +#define tre_stack_new hawk_tre_stacknew +#define tre_stack_num_objects hawk_tre_stacknumobjs +#define tre_stack_pop_int hawk_tre_stackpopint +#define tre_stack_pop_voidptr hawk_tre_stackpopvoidptr +#define tre_stack_push_int hawk_tre_stackpushint +#define tre_stack_push_voidptr hawk_tre_stackpushvoidptr + +/* this tre.h */ +#define tre_compile hawk_tre_compile +#define tre_free hawk_tre_free +#define tre_fill_pmatch hawk_tre_fillpmatch +#define tre_tnfa_run_backtrack hawk_tre_runbacktrack +#define tre_tnfa_run_parallel hawk_tre_runparallel +#define tre_have_backrefs hawk_tre_havebackrefs + +/* Define the character types and functions. */ +#ifdef TRE_WCHAR +# define TRE_CHAR_MAX HAWK_TYPE_MAX(hawk_uch_t) +/* +# ifdef TRE_MULTIBYTE +# define TRE_MB_CUR_MAX (hawk_getmbcurmax()) +# else +# define TRE_MB_CUR_MAX 1 +# endif +*/ +#else /* !TRE_WCHAR */ +# define TRE_CHAR_MAX 255 +/*# define TRE_MB_CUR_MAX 1*/ +#endif /* !TRE_WCHAR */ + +#define DPRINT(msg) + +typedef hawk_ooch_prop_t tre_ctype_t; +#define tre_isctype(c,t) hawk_is_ooch_type(c,t) + +typedef enum { STR_WIDE, STR_BYTE, STR_MBS } tre_str_type_t; + +/* Returns number of bytes to add to (char *)ptr to make it + properly aligned for the type. */ +#define ALIGN(ptr,type) \ + ((((hawk_uintptr_t)ptr) % HAWK_SIZEOF(type))? \ + (HAWK_SIZEOF(type) - (((hawk_uintptr_t)ptr) % HAWK_SIZEOF(type))): 0) + +#undef MAX +#undef MIN +#define MAX(a, b) (((a) >= (b)) ? (a) : (b)) +#define MIN(a, b) (((a) <= (b)) ? (a) : (b)) + +/* Define STRF to the correct printf formatter for strings. */ +#ifdef TRE_WCHAR +#define STRF "ls" +#else /* !TRE_WCHAR */ +#define STRF "s" +#endif /* !TRE_WCHAR */ + +/* TNFA transition type. A TNFA state is an array of transitions, + the terminator is a transition with NULL `state'. */ +typedef struct tnfa_transition tre_tnfa_transition_t; + +struct tnfa_transition +{ + /* Range of accepted characters. */ + /* HAWK indicate that code_min .. code_max is not yet negated for ^ in a bracket */ + int negate_range; + /* END HAWK */ + tre_cint_t code_min; + tre_cint_t code_max; + /* Pointer to the destination state. */ + tre_tnfa_transition_t *state; + /* ID number of the destination state. */ + int state_id; + /* -1 terminated array of tags (or NULL). */ + int *tags; + /* Matching parameters settings (or NULL). */ + int *params; + /* Assertion bitmap. */ + int assertions; + /* Assertion parameters. */ + union + { + /* Character class assertion. */ + tre_ctype_t class; + /* Back reference assertion. */ + int backref; + } u; + /* Negative character class assertions. */ + tre_ctype_t *neg_classes; +}; + + +/* Assertions. */ +#define ASSERT_AT_BOL 1 /* Beginning of line. */ +#define ASSERT_AT_EOL 2 /* End of line. */ +#define ASSERT_CHAR_CLASS 4 /* Character class in `class'. */ +#define ASSERT_CHAR_CLASS_NEG 8 /* Character classes in `neg_classes'. */ +#define ASSERT_AT_BOW 16 /* Beginning of word. */ +#define ASSERT_AT_EOW 32 /* End of word. */ +#define ASSERT_AT_WB 64 /* Word boundary. */ +#define ASSERT_AT_WB_NEG 128 /* Not a word boundary. */ +#define ASSERT_BACKREF 256 /* A back reference in `backref'. */ +#define ASSERT_LAST 256 + +/* Tag directions. */ +typedef enum +{ + TRE_TAG_MINIMIZE = 0, + TRE_TAG_MAXIMIZE = 1 +} tre_tag_direction_t; + +/* Parameters that can be changed dynamically while matching. */ +typedef enum +{ + TRE_PARAM_COST_INS = 0, + TRE_PARAM_COST_DEL = 1, + TRE_PARAM_COST_SUBST = 2, + TRE_PARAM_COST_MAX = 3, + TRE_PARAM_MAX_INS = 4, + TRE_PARAM_MAX_DEL = 5, + TRE_PARAM_MAX_SUBST = 6, + TRE_PARAM_MAX_ERR = 7, + TRE_PARAM_DEPTH = 8, + TRE_PARAM_LAST = 9 +} tre_param_t; + +/* Unset matching parameter */ +#define TRE_PARAM_UNSET -1 + +/* Signifies the default matching parameter value. */ +#define TRE_PARAM_DEFAULT -2 + +/* Instructions to compute submatch register values from tag values + after a successful match. */ +struct tre_submatch_data +{ + /* Tag that gives the value for rm_so (submatch start offset). */ + int so_tag; + /* Tag that gives the value for rm_eo (submatch end offset). */ + int eo_tag; + /* List of submatches this submatch is contained in. */ + int *parents; +}; + +typedef struct tre_submatch_data tre_submatch_data_t; + + +/* TNFA definition. */ +typedef struct tnfa tre_tnfa_t; + +struct tnfa +{ + tre_tnfa_transition_t *transitions; + unsigned int num_transitions; + tre_tnfa_transition_t *initial; + tre_tnfa_transition_t *final; + tre_submatch_data_t *submatch_data; +#if 0 + char *firstpos_chars; +#endif + int first_char; + unsigned int num_submatches; + tre_tag_direction_t *tag_directions; + int *minimal_tags; + int num_tags; + int num_minimals; + int end_tag; + int num_states; + int cflags; + int have_backrefs; + int have_approx; + int params_depth; +}; + + +int tre_compile (regex_t *preg, const tre_char_t *regex, size_t n, int cflags); + +void tre_free (regex_t *preg); + +void tre_fill_pmatch( + size_t nmatch, regmatch_t pmatch[], int cflags, + const tre_tnfa_t *tnfa, int *tags, int match_eo); + +reg_errcode_t tre_tnfa_run_backtrack( + hawk_t* hawk, const tre_tnfa_t *tnfa, const void *string, + int len, tre_str_type_t type, int *match_tags, + int eflags, int *match_end_ofs); + + +reg_errcode_t tre_tnfa_run_parallel( + hawk_t* hawk, const tre_tnfa_t *tnfa, const void *string, int len, + tre_str_type_t type, int *match_tags, int eflags, + int *match_end_ofs); + + +#endif + +/* EOF */ diff --git a/hawk/lib/tre-stack.c b/hawk/lib/tre-stack.c new file mode 100644 index 00000000..9d1742a5 --- /dev/null +++ b/hawk/lib/tre-stack.c @@ -0,0 +1,177 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + tre-stack.c - Simple stack implementation + +This is the license, copyright notice, and disclaimer for TRE, a regex +matching package (library and tools) with support for approximate +matching. + +Copyright (c) 2001-2009 Ville Laurikari +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "tre-prv.h" +#include "tre-stack.h" + +union tre_stack_item +{ + void *voidptr_value; + int int_value; +}; + +struct tre_stack_rec +{ + hawk_t* hawk; + int size; + int max_size; + int increment; + int ptr; + union tre_stack_item *stack; +}; + + +tre_stack_t* tre_stack_new(hawk_t* hawk, int size, int max_size, int increment) +{ + tre_stack_t *s; + + s = xmalloc(hawk, sizeof(*s)); + if (s != NULL) + { + s->stack = xmalloc(hawk, sizeof(*s->stack) * size); + if (s->stack == NULL) + { + xfree(hawk, s); + return NULL; + } + s->size = size; + s->max_size = max_size; + s->increment = increment; + s->ptr = 0; + s->hawk = hawk; + } + return s; +} + +void +tre_stack_destroy(tre_stack_t *s) +{ + xfree(s->hawk,s->stack); + xfree(s->hawk,s); +} + +int +tre_stack_num_objects(tre_stack_t *s) +{ + return s->ptr; +} + +static reg_errcode_t +tre_stack_push(tre_stack_t *s, union tre_stack_item value) +{ + if (s->ptr < s->size) + { + s->stack[s->ptr] = value; + s->ptr++; + } + else + { +/* HAWK added check for s->max_size > 0 + if (s->size >= s->max_size)*/ + if (s->max_size > 0 && s->size >= s->max_size) + { + DPRINT(("tre_stack_push: stack full\n")); + return REG_ESPACE; + } + else + { + union tre_stack_item *new_buffer; + int new_size; + DPRINT(("tre_stack_push: trying to realloc more space\n")); + new_size = s->size + s->increment; +/* HAWK added check for s->max_size > 0 + if (new_size > s->max_size) */ + if (s->max_size > 0 && new_size > s->max_size) + new_size = s->max_size; + new_buffer = xrealloc(s->hawk, s->stack, sizeof(*new_buffer) * new_size); + if (new_buffer == NULL) + { + DPRINT(("tre_stack_push: realloc failed.\n")); + return REG_ESPACE; + } + DPRINT(("tre_stack_push: realloc succeeded.\n")); + assert(new_size > s->size); + s->size = new_size; + s->stack = new_buffer; + tre_stack_push(s, value); + } + } + return REG_OK; +} + +#define define_pushf(typetag, type) \ + declare_pushf(typetag, type) { \ + union tre_stack_item item; \ + item.typetag ## _value = value; \ + return tre_stack_push(s, item); \ +} + +define_pushf(int, int) +define_pushf(voidptr, void *) + +#define define_popf(typetag, type) \ + declare_popf(typetag, type) { \ + return s->stack[--s->ptr].typetag ## _value; \ + } + +define_popf(int, int) +define_popf(voidptr, void *) + +/* EOF */ diff --git a/hawk/lib/tre-stack.h b/hawk/lib/tre-stack.h new file mode 100644 index 00000000..48a0348b --- /dev/null +++ b/hawk/lib/tre-stack.h @@ -0,0 +1,128 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + tre-stack.h: Stack definitions + +This is the license, copyright notice, and disclaimer for TRE, a regex +matching package (library and tools) with support for approximate +matching. + +Copyright (c) 2001-2009 Ville Laurikari +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +#ifndef _HAWK_TRE_STACK_H_ +#define _HAWK_TRE_STACK_H_ + +#include "tre-prv.h" + +typedef struct tre_stack_rec tre_stack_t; + +/* Creates a new stack object. `size' is initial size in bytes, `max_size' + is maximum size, and `increment' specifies how much more space will be + allocated with realloc() if all space gets used up. Returns the stack + object or NULL if out of memory. */ +tre_stack_t * +tre_stack_new(hawk_t* hawk, int size, int max_size, int increment); + +/* Frees the stack object. */ +void +tre_stack_destroy(tre_stack_t *s); + +/* Returns the current number of objects in the stack. */ +int +tre_stack_num_objects(tre_stack_t *s); + +/* Each tre_stack_push_*(tre_stack_t *s, value) function pushes + `value' on top of stack `s'. Returns REG_ESPACE if out of memory. + This tries to realloc() more space before failing if maximum size + has not yet been reached. Returns REG_OK if successful. */ +#define declare_pushf(typetag, type) \ + reg_errcode_t tre_stack_push_ ## typetag(tre_stack_t *s, type value) + +declare_pushf(voidptr, void *); +declare_pushf(int, int); + +/* Each tre_stack_pop_*(tre_stack_t *s) function pops the topmost + element off of stack `s' and returns it. The stack must not be + empty. */ +#define declare_popf(typetag, type) \ + type tre_stack_pop_ ## typetag(tre_stack_t *s) + +declare_popf(voidptr, void *); +declare_popf(int, int); + +/* Just to save some typing. */ +#define STACK_PUSH(s, typetag, value) \ + do \ + { \ + status = tre_stack_push_ ## typetag(s, value); \ + } \ + while (/*CONSTCOND*/0) + +#define STACK_PUSHX(s, typetag, value) \ + { \ + status = tre_stack_push_ ## typetag(s, value); \ + if (status != REG_OK) \ + break; \ + } + +#define STACK_PUSHR(s, typetag, value) \ + { \ + reg_errcode_t _status; \ + _status = tre_stack_push_ ## typetag(s, value); \ + if (_status != REG_OK) \ + return _status; \ + } + +#endif /* TRE_STACK_H */ + +/* EOF */ diff --git a/hawk/lib/tre.c b/hawk/lib/tre.c new file mode 100644 index 00000000..f117d630 --- /dev/null +++ b/hawk/lib/tre.c @@ -0,0 +1,275 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "tre-prv.h" +#include "tre-compile.h" + +hawk_tre_t* hawk_tre_open (hawk_t* hawk, hawk_oow_t xtnsize) +{ + hawk_tre_t* tre; + + tre = (hawk_tre_t*)hawk_allocmem(hawk, HAWK_SIZEOF(hawk_tre_t) + xtnsize); + if (!tre) return HAWK_NULL; + + if (hawk_tre_init(tre, hawk) <= -1) + { + hawk_freemem (hawk, tre); + return HAWK_NULL; + } + + HAWK_MEMSET (tre + 1, 0, xtnsize); + return tre; +} + +void hawk_tre_close (hawk_tre_t* tre) +{ + hawk_tre_fini (tre); + hawk_freemem (tre->hawk, tre); +} + +int hawk_tre_init (hawk_tre_t* tre, hawk_t* hawk) +{ + HAWK_MEMSET (tre, 0, HAWK_SIZEOF(*tre)); + tre->hawk = hawk; + return 0; +} + +void hawk_tre_fini (hawk_tre_t* tre) +{ + if (tre->TRE_REGEX_T_FIELD) + { + tre_free (tre); + tre->TRE_REGEX_T_FIELD = HAWK_NULL; + } +} + +int hawk_tre_compx (hawk_tre_t* tre, const hawk_ooch_t* regex, hawk_oow_t n, unsigned int* nsubmat, int cflags) +{ + int ret; + + if (tre->TRE_REGEX_T_FIELD) + { + tre_free (tre); + tre->TRE_REGEX_T_FIELD = HAWK_NULL; + } + + ret = tre_compile(tre, regex, n, cflags); + if (ret > 0) + { + tre->TRE_REGEX_T_FIELD = HAWK_NULL; /* just to make sure */ + tre->errnum = ret; + return -1; + } + + if (nsubmat) + { + *nsubmat = ((struct tnfa*)tre->TRE_REGEX_T_FIELD)->num_submatches; + } + return 0; +} + +int hawk_tre_comp (hawk_tre_t* tre, const hawk_ooch_t* regex, unsigned int* nsubmat, int cflags) +{ + return hawk_tre_compx(tre, regex, (regex? hawk_count_oocstr(regex):0), nsubmat, cflags); +} + +/* Fills the POSIX.2 regmatch_t array according to the TNFA tag and match + endpoint values. */ +void tre_fill_pmatch(size_t nmatch, regmatch_t pmatch[], int cflags, + const tre_tnfa_t *tnfa, int *tags, int match_eo) +{ + tre_submatch_data_t *submatch_data; + unsigned int i, j; + int *parents; + + i = 0; + if (match_eo >= 0 && !(cflags & REG_NOSUB)) + { + /* Construct submatch offsets from the tags. */ + DPRINT(("end tag = t%d = %d\n", tnfa->end_tag, match_eo)); + submatch_data = tnfa->submatch_data; + while (i < tnfa->num_submatches && i < nmatch) + { + if (submatch_data[i].so_tag == tnfa->end_tag) + pmatch[i].rm_so = match_eo; + else + pmatch[i].rm_so = tags[submatch_data[i].so_tag]; + + if (submatch_data[i].eo_tag == tnfa->end_tag) + pmatch[i].rm_eo = match_eo; + else + pmatch[i].rm_eo = tags[submatch_data[i].eo_tag]; + + /* If either of the endpoints were not used, this submatch + was not part of the match. */ + if (pmatch[i].rm_so == -1 || pmatch[i].rm_eo == -1) + pmatch[i].rm_so = pmatch[i].rm_eo = -1; + + DPRINT(("pmatch[%d] = {t%d = %d, t%d = %d}\n", i, + submatch_data[i].so_tag, pmatch[i].rm_so, + submatch_data[i].eo_tag, pmatch[i].rm_eo)); + i++; + } + /* Reset all submatches that are not within all of their parent + submatches. */ + i = 0; + while (i < tnfa->num_submatches && i < nmatch) + { + if (pmatch[i].rm_eo == -1) + assert(pmatch[i].rm_so == -1); + assert(pmatch[i].rm_so <= pmatch[i].rm_eo); + + parents = submatch_data[i].parents; + if (parents != HAWK_NULL) + for (j = 0; parents[j] >= 0; j++) + { + DPRINT(("pmatch[%d] parent %d\n", i, parents[j])); + if (pmatch[i].rm_so < pmatch[parents[j]].rm_so + || pmatch[i].rm_eo > pmatch[parents[j]].rm_eo) + pmatch[i].rm_so = pmatch[i].rm_eo = -1; + } + i++; + } + } + + while (i < nmatch) + { + pmatch[i].rm_so = -1; + pmatch[i].rm_eo = -1; + i++; + } +} + + +/* + Wrapper functions for POSIX compatible regexp matching. +*/ + +int tre_have_backrefs(const regex_t *preg) +{ + tre_tnfa_t *tnfa = (void *)preg->TRE_REGEX_T_FIELD; + return tnfa->have_backrefs; +} + +static int tre_match( + const regex_t* preg, const void *string, hawk_oow_t len, + tre_str_type_t type, hawk_oow_t nmatch, regmatch_t pmatch[], + int eflags) +{ + tre_tnfa_t *tnfa = (void *)preg->TRE_REGEX_T_FIELD; + reg_errcode_t status; + int *tags = HAWK_NULL, eo; + if (tnfa->num_tags > 0 && nmatch > 0) + { + tags = xmalloc (preg->hawk, sizeof(*tags) * tnfa->num_tags); + if (tags == HAWK_NULL) return REG_ESPACE; + } + + /* Dispatch to the appropriate matcher. */ + if (tnfa->have_backrefs || (eflags & REG_BACKTRACKING_MATCHER)) + { + /* The regex has back references, use the backtracking matcher. */ + status = tre_tnfa_run_backtrack ( + preg->hawk, tnfa, string, (int)len, type, + tags, eflags, &eo); + } + else + { + /* Exact matching, no back references, use the parallel matcher. */ + status = tre_tnfa_run_parallel ( + preg->hawk, tnfa, string, (int)len, type, + tags, eflags, &eo); + } + + if (status == REG_OK) + /* A match was found, so fill the submatch registers. */ + tre_fill_pmatch(nmatch, pmatch, tnfa->cflags, tnfa, tags, eo); + if (tags) xfree (preg->hawk, tags); + return status; +} + +int hawk_tre_execx ( + hawk_tre_t* tre, const hawk_ooch_t *str, hawk_oow_t len, + regmatch_t* pmatch, hawk_oow_t nmatch, int eflags) +{ + int ret; + + if (tre->TRE_REGEX_T_FIELD == HAWK_NULL) + { + /* regular expression is bad as none is compiled yet */ + tre->errnum = HAWK_TRE_EBADPAT; + return -1; + } +#if defined(HAWK_OOCH_IS_UCH) + ret = tre_match (tre, str, len, STR_WIDE, nmatch, pmatch, eflags); +#else + ret = tre_match (tre, str, len, STR_BYTE, nmatch, pmatch, eflags); +#endif + if (ret > 0) + { + tre->errnum = ret; + return -1; + } + + return 0; +} + +int hawk_tre_exec ( + hawk_tre_t* tre, const hawk_ooch_t* str, + regmatch_t* pmatch, hawk_oow_t nmatch, int eflags) +{ + return hawk_tre_execx (tre, str, (hawk_oow_t)-1, pmatch, nmatch, eflags); +} + +hawk_tre_errnum_t hawk_tre_geterrnum (hawk_tre_t* tre) +{ + return tre->errnum; +} + +const hawk_ooch_t* hawk_tre_geterrmsg (hawk_tre_t* tre) +{ + static const hawk_ooch_t* errstr[] = + { + HAWK_T("no error"), + HAWK_T("no sufficient memory available"), + HAWK_T("no match"), + HAWK_T("invalid regular expression"), + HAWK_T("unknown collating element"), + HAWK_T("unknown character class name"), + HAWK_T("trailing backslash"), + HAWK_T("invalid backreference"), + HAWK_T("bracket imbalance"), + HAWK_T("parenthesis imbalance"), + HAWK_T("brace imbalance"), + HAWK_T("invalid bracket content"), + HAWK_T("invalid use of range operator"), + HAWK_T("invalid use of repetition operators") + }; + + return (tre->errnum >= 0 && tre->errnum < HAWK_COUNTOF(errstr))? + errstr[tre->errnum]: HAWK_T("unknown error"); +} + diff --git a/hawk/lib/tree-prv.h b/hawk/lib/tree-prv.h new file mode 100644 index 00000000..15bae803 --- /dev/null +++ b/hawk/lib/tree-prv.h @@ -0,0 +1,353 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_TREE_PRV_H_ +#define _HAWK_TREE_PRV_H_ + +enum hawk_in_type_t +{ + /* the order of these values match + * __in_type_map and __in_opt_map in rio.c */ + + HAWK_IN_PIPE, + HAWK_IN_RWPIPE, + HAWK_IN_FILE, + HAWK_IN_CONSOLE +}; + +enum hawk_out_type_t +{ + /* the order of these values match + * __out_type_map and __out_opt_map in rio.c */ + + HAWK_OUT_PIPE, + HAWK_OUT_RWPIPE, /* dual direction pipe */ + HAWK_OUT_FILE, + HAWK_OUT_APFILE, /* file for appending */ + HAWK_OUT_CONSOLE +}; + +typedef struct hawk_nde_blk_t hawk_nde_blk_t; +typedef struct hawk_nde_grp_t hawk_nde_grp_t; +typedef struct hawk_nde_ass_t hawk_nde_ass_t; +typedef struct hawk_nde_exp_t hawk_nde_exp_t; +typedef struct hawk_nde_cnd_t hawk_nde_cnd_t; +typedef struct hawk_nde_pos_t hawk_nde_pos_t; + +typedef struct hawk_nde_int_t hawk_nde_int_t; +typedef struct hawk_nde_flt_t hawk_nde_flt_t; +typedef struct hawk_nde_str_t hawk_nde_str_t; +typedef struct hawk_nde_mbs_t hawk_nde_mbs_t; +typedef struct hawk_nde_rex_t hawk_nde_rex_t; +typedef struct hawk_nde_fun_t hawk_nde_fun_t; + +typedef struct hawk_nde_var_t hawk_nde_var_t; +typedef struct hawk_nde_fncall_t hawk_nde_fncall_t; +typedef struct hawk_nde_getline_t hawk_nde_getline_t; + +typedef struct hawk_nde_if_t hawk_nde_if_t; +typedef struct hawk_nde_while_t hawk_nde_while_t; +typedef struct hawk_nde_for_t hawk_nde_for_t; +typedef struct hawk_nde_foreach_t hawk_nde_foreach_t; +typedef struct hawk_nde_break_t hawk_nde_break_t; +typedef struct hawk_nde_continue_t hawk_nde_continue_t; +typedef struct hawk_nde_return_t hawk_nde_return_t; +typedef struct hawk_nde_exit_t hawk_nde_exit_t; +typedef struct hawk_nde_next_t hawk_nde_next_t; +typedef struct hawk_nde_nextfile_t hawk_nde_nextfile_t; +typedef struct hawk_nde_delete_t hawk_nde_delete_t; +typedef struct hawk_nde_reset_t hawk_nde_reset_t; +typedef struct hawk_nde_print_t hawk_nde_print_t; + +/* HAWK_NDE_BLK - block statement including top-level blocks */ +struct hawk_nde_blk_t +{ + HAWK_NDE_HDR; + hawk_oow_t nlcls; /* number of local variables */ + hawk_nde_t* body; +}; + +/* HAWK_NDE_GRP - expression group */ +struct hawk_nde_grp_t +{ + HAWK_NDE_HDR; + hawk_nde_t* body; +}; + +/* HAWK_NDE_ASS - assignment */ +struct hawk_nde_ass_t +{ + HAWK_NDE_HDR; + int opcode; + hawk_nde_t* left; + hawk_nde_t* right; +}; + +/* HAWK_NDE_EXP_BIN, HAWK_NDE_EXP_UNR, + * HAWK_NDE_EXP_INCPRE, HAWK_AW_NDE_EXP_INCPST */ +struct hawk_nde_exp_t +{ + HAWK_NDE_HDR; + int opcode; + hawk_nde_t* left; + hawk_nde_t* right; /* HAWK_NULL for UNR, INCPRE, INCPST */ +}; + +/* HAWK_NDE_CND */ +struct hawk_nde_cnd_t +{ + HAWK_NDE_HDR; + hawk_nde_t* test; + hawk_nde_t* left; + hawk_nde_t* right; +}; + +/* HAWK_NDE_POS - positional - $1, $2, $x, etc */ +struct hawk_nde_pos_t +{ + HAWK_NDE_HDR; + hawk_nde_t* val; +}; + +/* HAWK_NDE_INT */ +struct hawk_nde_int_t +{ + HAWK_NDE_HDR; + hawk_int_t val; + hawk_ooch_t* str; + hawk_oow_t len; +}; + +/* HAWK_NDE_FLT */ +struct hawk_nde_flt_t +{ + HAWK_NDE_HDR; + hawk_flt_t val; + hawk_ooch_t* str; + hawk_oow_t len; +}; + +/* HAWK_NDE_STR */ +struct hawk_nde_str_t +{ + HAWK_NDE_HDR; + hawk_ooch_t* ptr; + hawk_oow_t len; +}; + +/* HAWK_NDE_MBS */ +struct hawk_nde_mbs_t +{ + HAWK_NDE_HDR; + hawk_bch_t* ptr; + hawk_oow_t len; +}; + +/* HAWK_NDE_REX */ +struct hawk_nde_rex_t +{ + HAWK_NDE_HDR; + hawk_oocs_t str; + void* code[2]; /* [0]: case sensitive, [1]: case insensitive */ +}; + +/* HAWK_NDE_FUN - function as a value */ +struct hawk_nde_fun_t +{ + HAWK_NDE_HDR; + hawk_oocs_t name; /* function name */ + hawk_fun_t* funptr; /* HAWK_NULL or actual pointer */ +}; + +/* HAWK_NDE_NAMED, HAWK_NDE_GBL, + * HAWK_NDE_LCL, HAWK_NDE_ARG + * HAWK_NDE_NAMEDIDX, HAWK_NDE_GBLIDX, + * HAWK_NDE_LCLIDX, HAWK_NDE_ARGIDX */ +struct hawk_nde_var_t +{ + HAWK_NDE_HDR; + struct + { + hawk_oocs_t name; + hawk_oow_t idxa; + } id; + hawk_nde_t* idx; /* HAWK_NULL for non-XXXXIDX */ +}; + +/* HAWK_NDE_FNCALL_FNC, HAWK_NDE_FNCALL_FUN, HAWK_NDE_FNCALL_VAR */ +struct hawk_nde_fncall_t +{ + HAWK_NDE_HDR; + union + { + struct + { + hawk_oocs_t name; + hawk_fun_t* fun; /* cache it */ + } fun; + + /* minimum information of a intrinsic function + * needed during run-time. */ + struct + { + hawk_fnc_info_t info; + hawk_fnc_spec_t spec; + } fnc; + + struct + { + hawk_nde_var_t* var; + } var; + } u; + hawk_nde_t* args; + hawk_oow_t nargs; +}; + +/* HAWK_NDE_GETLINE */ +struct hawk_nde_getline_t +{ + HAWK_NDE_HDR; + hawk_nde_t* var; + int in_type; /* HAWK_GETLINE_XXX */ + hawk_nde_t* in; +}; + +/* HAWK_NDE_IF */ +struct hawk_nde_if_t +{ + HAWK_NDE_HDR; + hawk_nde_t* test; + hawk_nde_t* then_part; + hawk_nde_t* else_part; /* optional */ +}; + +/* HAWK_NDE_WHILE, HAWK_NDE_DOWHILE */ +struct hawk_nde_while_t +{ + HAWK_NDE_HDR; + hawk_nde_t* test; + hawk_nde_t* body; +}; + +/* HAWK_NDE_FOR */ +struct hawk_nde_for_t +{ + HAWK_NDE_HDR; + hawk_nde_t* init; /* optional */ + hawk_nde_t* test; /* optional */ + hawk_nde_t* incr; /* optional */ + hawk_nde_t* body; +}; + +/* HAWK_NDE_FOREACH */ +struct hawk_nde_foreach_t +{ + HAWK_NDE_HDR; + hawk_nde_t* test; + hawk_nde_t* body; +}; + +/* HAWK_NDE_BREAK */ +struct hawk_nde_break_t +{ + HAWK_NDE_HDR; +}; + +/* HAWK_NDE_CONTINUE */ +struct hawk_nde_continue_t +{ + HAWK_NDE_HDR; +}; + +/* HAWK_NDE_RETURN */ +struct hawk_nde_return_t +{ + HAWK_NDE_HDR; + hawk_nde_t* val; /* optional (no return code if HAWK_NULL) */ +}; + +/* HAWK_NDE_EXIT */ +struct hawk_nde_exit_t +{ + HAWK_NDE_HDR; + hawk_nde_t* val; /* optional (no exit code if HAWK_NULL) */ + int abort; +}; + +/* HAWK_NDE_NEXT */ +struct hawk_nde_next_t +{ + HAWK_NDE_HDR; +}; + +/* HAWK_NDE_NEXTFILE */ +struct hawk_nde_nextfile_t +{ + HAWK_NDE_HDR; + int out; +}; + +/* HAWK_NDE_DELETE */ +struct hawk_nde_delete_t +{ + HAWK_NDE_HDR; + hawk_nde_t* var; +}; + +/* HAWK_NDE_RESET */ +struct hawk_nde_reset_t +{ + HAWK_NDE_HDR; + hawk_nde_t* var; +}; + +/* HAWK_NDE_PRINT */ +struct hawk_nde_print_t +{ + HAWK_NDE_HDR; + hawk_nde_t* args; + int out_type; /* HAWK_OUT_XXX */ + hawk_nde_t* out; +}; + +#if defined(__cplusplus) +extern "C" { +#endif + +/* print the entire tree */ +int hawk_prnpt (hawk_t* awk, hawk_nde_t* tree); +/* print a single top-level node */ +int hawk_prnnde (hawk_t* awk, hawk_nde_t* node); +/* print the pattern part */ +int hawk_prnptnpt (hawk_t* awk, hawk_nde_t* tree); + +void hawk_clrpt (hawk_t* awk, hawk_nde_t* tree); + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/hawk/lib/tree.c b/hawk/lib/tree.c new file mode 100644 index 00000000..5257db58 --- /dev/null +++ b/hawk/lib/tree.c @@ -0,0 +1,1451 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "hawk-prv.h" + +static const hawk_ooch_t* assop_str[] = +{ + /* this table must match hawk_assop_type_t in run.h */ + HAWK_T("="), + HAWK_T("+="), + HAWK_T("-="), + HAWK_T("*="), + HAWK_T("/="), + HAWK_T("\\="), + HAWK_T("%="), + HAWK_T("**="), /* exponentation, also ^= */ + HAWK_T("%%="), + HAWK_T(">>="), + HAWK_T("<<="), + HAWK_T("&="), + HAWK_T("^^="), + HAWK_T("|=") +}; + +static const hawk_ooch_t* binop_str[][2] = +{ + { HAWK_T("||"), HAWK_T("||") }, + { HAWK_T("&&"), HAWK_T("&&") }, + { HAWK_T("in"), HAWK_T("in") }, + + { HAWK_T("|"), HAWK_T("|") }, + { HAWK_T("^^"), HAWK_T("^^") }, + { HAWK_T("&"), HAWK_T("&") }, + + { HAWK_T("==="), HAWK_T("===") }, + { HAWK_T("!=="), HAWK_T("!==") }, + { HAWK_T("=="), HAWK_T("==") }, + { HAWK_T("!="), HAWK_T("!=") }, + { HAWK_T(">"), HAWK_T(">") }, + { HAWK_T(">="), HAWK_T(">=") }, + { HAWK_T("<"), HAWK_T("<") }, + { HAWK_T("<="), HAWK_T("<=") }, + + { HAWK_T("<<"), HAWK_T("<<") }, + { HAWK_T(">>"), HAWK_T(">>") }, + + { HAWK_T("+"), HAWK_T("+") }, + { HAWK_T("-"), HAWK_T("-") }, + { HAWK_T("*"), HAWK_T("*") }, + { HAWK_T("/"), HAWK_T("/") }, + { HAWK_T("\\"), HAWK_T("\\") }, + { HAWK_T("%"), HAWK_T("%") }, + { HAWK_T("**"), HAWK_T("**") }, /* exponentation, also ^ */ + + { HAWK_T(" "), HAWK_T("%%") }, /* take note of this entry */ + { HAWK_T("~"), HAWK_T("~") }, + { HAWK_T("!~"), HAWK_T("!~") } +}; + +static const hawk_ooch_t* unrop_str[] = +{ + HAWK_T("+"), + HAWK_T("-"), + HAWK_T("!"), + HAWK_T("~~"), + HAWK_T("`") +}; + +static const hawk_ooch_t* incop_str[] = +{ + HAWK_T("++"), + HAWK_T("--"), + HAWK_T("++"), + HAWK_T("--") +}; + +static const hawk_ooch_t* getline_inop_str[] = +{ + HAWK_T("|"), + HAWK_T("||"), + HAWK_T("<"), + HAWK_T("") +}; + +static const hawk_ooch_t* print_outop_str[] = +{ + HAWK_T("|"), + HAWK_T("||"), + HAWK_T(">"), + HAWK_T(">>"), + HAWK_T("") +}; + +#define PUT_SRCSTR(awk,str) do { if (hawk_putsroocs (awk, str) == -1) return -1; } while(0) + +#define PUT_NL(awk) do { \ + if (awk->opt.trait & HAWK_CRLF) PUT_SRCSTR (awk, HAWK_T("\r")); \ + PUT_SRCSTR (awk, HAWK_T("\n")); \ +} while(0) + +#define PUT_SRCSTRN(awk,str,len) do { \ + if (hawk_putsroocsn (awk, str, len) == -1) return -1; \ +} while(0) + +#define PRINT_TABS(awk,depth) do { \ + if (print_tabs(awk,depth) == -1) return -1; \ +} while(0) + +#define PRINT_EXPR(awk,nde) do { \ + if (print_expr(awk,nde) == -1) return -1; \ +} while(0) + +#define PRINT_EXPR_LIST(awk,nde) do { \ + if (print_expr_list(awk,nde) == -1) return -1; \ +} while(0) + +#define PRINT_STMTS(awk,nde,depth) do { \ + if (print_stmts(awk,nde,depth) == -1) return -1; \ +} while(0) + +static int print_tabs (hawk_t* awk, int depth); +static int print_expr (hawk_t* awk, hawk_nde_t* nde); +static int print_expr_list (hawk_t* awk, hawk_nde_t* tree); +static int print_stmts (hawk_t* awk, hawk_nde_t* tree, int depth); + +static int print_tabs (hawk_t* awk, int depth) +{ + while (depth > 0) + { + PUT_SRCSTR (awk, HAWK_T("\t")); + depth--; + } + + return 0; +} + +static int print_printx (hawk_t* awk, hawk_nde_print_t* px) +{ + hawk_oocs_t kw; + + if (px->type == HAWK_NDE_PRINT) + { + hawk_getkwname (awk, HAWK_KWID_PRINT, &kw); + PUT_SRCSTRN (awk, kw.ptr, kw.len); + } + else + { + hawk_getkwname (awk, HAWK_KWID_PRINTF, &kw); + PUT_SRCSTRN (awk, kw.ptr, kw.len); + } + + if (px->args != HAWK_NULL) + { + PUT_SRCSTR (awk, HAWK_T(" ")); + PRINT_EXPR_LIST (awk, px->args); + } + + if (px->out != HAWK_NULL) + { + PUT_SRCSTR (awk, HAWK_T(" ")); + PUT_SRCSTR (awk, print_outop_str[px->out_type]); + PUT_SRCSTR (awk, HAWK_T(" ")); + PRINT_EXPR (awk, px->out); + } + + return 0; +} + +static int print_expr (hawk_t* awk, hawk_nde_t* nde) +{ + hawk_oocs_t kw; + + switch (nde->type) + { + case HAWK_NDE_GRP: + { + hawk_nde_t* p = ((hawk_nde_grp_t*)nde)->body; + + PUT_SRCSTR (awk, HAWK_T("(")); + while (p != HAWK_NULL) + { + PRINT_EXPR (awk, p); + if (p->next != HAWK_NULL) + PUT_SRCSTR (awk, HAWK_T(",")); + p = p->next; + } + PUT_SRCSTR (awk, HAWK_T(")")); + break; + } + + case HAWK_NDE_ASS: + { + hawk_nde_ass_t* px = (hawk_nde_ass_t*)nde; + + PRINT_EXPR (awk, px->left); + PUT_SRCSTR (awk, HAWK_T(" ")); + PUT_SRCSTR (awk, assop_str[px->opcode]); + PUT_SRCSTR (awk, HAWK_T(" ")); + PRINT_EXPR (awk, px->right); + + HAWK_ASSERT (awk, px->right->next == HAWK_NULL); + break; + } + + case HAWK_NDE_EXP_BIN: + { + hawk_nde_exp_t* px = (hawk_nde_exp_t*)nde; + + PUT_SRCSTR (awk, HAWK_T("(")); + PRINT_EXPR (awk, px->left); + HAWK_ASSERT (awk, px->left->next == HAWK_NULL); + + PUT_SRCSTR (awk, HAWK_T(" ")); + PUT_SRCSTR (awk, binop_str[px->opcode][(awk->opt.trait & HAWK_BLANKCONCAT)? 0: 1]); + PUT_SRCSTR (awk, HAWK_T(" ")); + + if (px->right->type == HAWK_NDE_ASS) + PUT_SRCSTR (awk, HAWK_T("(")); + PRINT_EXPR (awk, px->right); + if (px->right->type == HAWK_NDE_ASS) + PUT_SRCSTR (awk, HAWK_T(")")); + HAWK_ASSERT (awk, px->right->next == HAWK_NULL); + PUT_SRCSTR (awk, HAWK_T(")")); + break; + } + + case HAWK_NDE_EXP_UNR: + { + hawk_nde_exp_t* px = (hawk_nde_exp_t*)nde; + HAWK_ASSERT (awk, px->right == HAWK_NULL); + + PUT_SRCSTR (awk, HAWK_T("(")); + PUT_SRCSTR (awk, unrop_str[px->opcode]); + PUT_SRCSTR (awk, HAWK_T("(")); + PRINT_EXPR (awk, px->left); + PUT_SRCSTR (awk, HAWK_T(")")); + PUT_SRCSTR (awk, HAWK_T(")")); + break; + } + + case HAWK_NDE_EXP_INCPRE: + { + hawk_nde_exp_t* px = (hawk_nde_exp_t*)nde; + HAWK_ASSERT (awk, px->right == HAWK_NULL); + + PUT_SRCSTR (awk, incop_str[px->opcode]); + PUT_SRCSTR (awk, HAWK_T("(")); + PRINT_EXPR (awk, px->left); + PUT_SRCSTR (awk, HAWK_T(")")); + break; + } + + case HAWK_NDE_EXP_INCPST: + { + hawk_nde_exp_t* px = (hawk_nde_exp_t*)nde; + HAWK_ASSERT (awk, px->right == HAWK_NULL); + + PUT_SRCSTR (awk, HAWK_T("(")); + PRINT_EXPR (awk, px->left); + PUT_SRCSTR (awk, HAWK_T(")")); + PUT_SRCSTR (awk, incop_str[px->opcode]); + break; + } + + case HAWK_NDE_CND: + { + hawk_nde_cnd_t* px = (hawk_nde_cnd_t*)nde; + + PUT_SRCSTR (awk, HAWK_T("(")); + PRINT_EXPR (awk, px->test); + PUT_SRCSTR (awk, HAWK_T(")?")); + + PRINT_EXPR (awk, px->left); + PUT_SRCSTR (awk, HAWK_T(":")); + PRINT_EXPR (awk, px->right); + break; + } + + case HAWK_NDE_INT: + { + if (((hawk_nde_int_t*)nde)->str) + { + PUT_SRCSTRN (awk, + ((hawk_nde_int_t*)nde)->str, + ((hawk_nde_int_t*)nde)->len); + } + else + { + /* Note that the array sizing fomula is not accurate + * but should be good enoug consiering the followings. + * + * size minval digits sign + * 1 -128 3 1 + * 2 -32768 5 1 + * 4 -2147483648 10 1 + * 8 -9223372036854775808 19 1 + * 16 -170141183460469231731687303715884105728 39 1 + */ + hawk_ooch_t buf[HAWK_SIZEOF(hawk_int_t) * 3 + 2]; + + hawk_fmt_intmax_to_oocstr ( + buf, HAWK_COUNTOF(buf), + ((hawk_nde_int_t*)nde)->val, + 10, + -1, + HAWK_T('\0'), + HAWK_NULL + ); + PUT_SRCSTR (awk, buf); + } + break; + } + + case HAWK_NDE_FLT: + { + if (((hawk_nde_flt_t*)nde)->str) + { + PUT_SRCSTRN (awk, + ((hawk_nde_flt_t*)nde)->str, + ((hawk_nde_flt_t*)nde)->len); + } + else + { + hawk_ooch_t buf[96]; + + hawk_fmttooocstr (awk, + buf, HAWK_COUNTOF(buf), + #if defined(HAWK_USE_AWK_FLTMAX) + HAWK_T("%jf"), + #else + HAWK_T("%zf"), + #endif + ((hawk_nde_flt_t*)nde)->val + ); + + PUT_SRCSTR (awk, buf); + } + break; + } + + case HAWK_NDE_STR: + { + hawk_ooch_t* ptr; + hawk_oow_t len, i; + + PUT_SRCSTR (awk, HAWK_T("\"")); + + ptr = ((hawk_nde_str_t*)nde)->ptr; + len = ((hawk_nde_str_t*)nde)->len; + for (i = 0; i < len; i++) + { + /* TODO: maybe more de-escaping?? */ + switch (ptr[i]) + { + case HAWK_T('\n'): + PUT_SRCSTR (awk, HAWK_T("\\n")); + break; + case HAWK_T('\r'): + PUT_SRCSTR (awk, HAWK_T("\\r")); + break; + case HAWK_T('\t'): + PUT_SRCSTR (awk, HAWK_T("\\t")); + break; + case HAWK_T('\f'): + PUT_SRCSTR (awk, HAWK_T("\\f")); + break; + case HAWK_T('\b'): + PUT_SRCSTR (awk, HAWK_T("\\b")); + break; + case HAWK_T('\v'): + PUT_SRCSTR (awk, HAWK_T("\\v")); + break; + case HAWK_T('\a'): + PUT_SRCSTR (awk, HAWK_T("\\a")); + break; + case HAWK_T('\0'): + PUT_SRCSTR (awk, HAWK_T("\\0")); + break; + case HAWK_T('\"'): + PUT_SRCSTR (awk, HAWK_T("\\\"")); + break; + case HAWK_T('\\'): + PUT_SRCSTR (awk, HAWK_T("\\\\")); + break; + default: + PUT_SRCSTRN (awk, &ptr[i], 1); + break; + } + } + PUT_SRCSTR (awk, HAWK_T("\"")); + break; + } + + case HAWK_NDE_MBS: + { + hawk_bch_t* ptr; + hawk_oow_t len, i; + + PUT_SRCSTR (awk, HAWK_T("B\"")); + ptr = ((hawk_nde_mbs_t*)nde)->ptr; + len = ((hawk_nde_mbs_t*)nde)->len; + for (i = 0; i < len; i++) + { + /* TODO: maybe more de-escaping?? */ + switch (ptr[i]) + { + case HAWK_BT('\n'): + PUT_SRCSTR (awk, HAWK_T("\\n")); + break; + case HAWK_BT('\r'): + PUT_SRCSTR (awk, HAWK_T("\\r")); + break; + case HAWK_BT('\t'): + PUT_SRCSTR (awk, HAWK_T("\\t")); + break; + case HAWK_BT('\f'): + PUT_SRCSTR (awk, HAWK_T("\\f")); + break; + case HAWK_BT('\b'): + PUT_SRCSTR (awk, HAWK_T("\\b")); + break; + case HAWK_BT('\v'): + PUT_SRCSTR (awk, HAWK_T("\\v")); + break; + case HAWK_BT('\a'): + PUT_SRCSTR (awk, HAWK_T("\\a")); + break; + case HAWK_BT('\0'): + PUT_SRCSTR (awk, HAWK_T("\\0")); + break; + case HAWK_BT('\"'): + PUT_SRCSTR (awk, HAWK_T("\\\"")); + break; + case HAWK_BT('\\'): + PUT_SRCSTR (awk, HAWK_T("\\\\")); + break; + default: + { + #if defined(HAWK_OOCH_IS_BCH) + PUT_SRCSTRN (awk, &ptr[i], 1); + #else + hawk_ooch_t wc = ptr[i]; + if (HAWK_BYTE_PRINTABLE(wc)) + { + PUT_SRCSTRN (awk, &wc, 1); + } + else + { + hawk_bch_t xbuf[3]; + hawk_byte_to_bcstr (wc, xbuf, HAWK_COUNTOF(xbuf), 16, '0'); + PUT_SRCSTR (awk, HAWK_T("\\x")); + wc = xbuf[0]; PUT_SRCSTRN (awk, &wc, 1); + wc = xbuf[1]; PUT_SRCSTRN (awk, &wc, 1); + } + #endif + break; + } + } + } + PUT_SRCSTR (awk, HAWK_T("\"")); + break; + } + + case HAWK_NDE_REX: + { + PUT_SRCSTR (awk, HAWK_T("/")); + PUT_SRCSTRN (awk, + ((hawk_nde_rex_t*)nde)->str.ptr, + ((hawk_nde_rex_t*)nde)->str.len); + PUT_SRCSTR (awk, HAWK_T("/")); + break; + } + + case HAWK_NDE_FUN: + { + PUT_SRCSTRN (awk, + ((hawk_nde_fun_t*)nde)->name.ptr, + ((hawk_nde_fun_t*)nde)->name.len); + break; + } + + case HAWK_NDE_ARG: + { + hawk_ooch_t tmp[HAWK_SIZEOF(hawk_int_t)*8+2]; + hawk_oow_t n; + hawk_nde_var_t* px = (hawk_nde_var_t*)nde; + HAWK_ASSERT (awk, px->id.idxa != (hawk_oow_t)-1); + + n = hawk_int_to_oocstr(px->id.idxa, 10, HAWK_NULL, tmp, HAWK_COUNTOF(tmp)); + + PUT_SRCSTR (awk, HAWK_T("__p")); + PUT_SRCSTRN (awk, tmp, n); + + HAWK_ASSERT (awk, px->idx == HAWK_NULL); + break; + } + + case HAWK_NDE_ARGIDX: + { + hawk_oow_t n; + hawk_nde_var_t* px = (hawk_nde_var_t*)nde; + HAWK_ASSERT (awk, px->id.idxa != (hawk_oow_t)-1); + HAWK_ASSERT (awk, px->idx != HAWK_NULL); + + PUT_SRCSTR (awk, HAWK_T("__p")); + n = hawk_int_to_oocstr(px->id.idxa, 10, HAWK_NULL, awk->tmp.fmt, HAWK_COUNTOF(awk->tmp.fmt)); + PUT_SRCSTRN (awk, awk->tmp.fmt, n); + PUT_SRCSTR (awk, HAWK_T("[")); + PRINT_EXPR_LIST (awk, px->idx); + PUT_SRCSTR (awk, HAWK_T("]")); + break; + } + + case HAWK_NDE_NAMED: + { + hawk_nde_var_t* px = (hawk_nde_var_t*)nde; + HAWK_ASSERT (awk, px->id.idxa == (hawk_oow_t)-1); + HAWK_ASSERT (awk, px->idx == HAWK_NULL); + + PUT_SRCSTRN (awk, px->id.name.ptr, px->id.name.len); + break; + } + + case HAWK_NDE_NAMEDIDX: + { + hawk_nde_var_t* px = (hawk_nde_var_t*)nde; + HAWK_ASSERT (awk, px->id.idxa == (hawk_oow_t)-1); + HAWK_ASSERT (awk, px->idx != HAWK_NULL); + + PUT_SRCSTRN (awk, px->id.name.ptr, px->id.name.len); + PUT_SRCSTR (awk, HAWK_T("[")); + PRINT_EXPR_LIST (awk, px->idx); + PUT_SRCSTR (awk, HAWK_T("]")); + break; + } + + case HAWK_NDE_GBL: + { + hawk_nde_var_t* px = (hawk_nde_var_t*)nde; + + if (px->id.idxa != (hawk_oow_t)-1) + { + /* deparsing is global. so i can't honor awk->parse.pragma.trait + * which can change in each input file. let me just check awk->opt.trait */ + if (!(awk->opt.trait & HAWK_IMPLICIT)) + { + /* no implicit(named) variable is allowed. + * use the actual name */ + PUT_SRCSTRN (awk, px->id.name.ptr, px->id.name.len); + } + else if (px->id.idxa < awk->tree.ngbls_base) + { + /* static global variables */ + PUT_SRCSTRN (awk, px->id.name.ptr, px->id.name.len); + } + else + { + hawk_ooch_t tmp[HAWK_SIZEOF(hawk_int_t)*8+2]; + hawk_oow_t n; + + PUT_SRCSTR (awk, HAWK_T("__g")); + n = hawk_int_to_oocstr(px->id.idxa, 10, HAWK_NULL, tmp, HAWK_COUNTOF(tmp)); + PUT_SRCSTRN (awk, tmp, n); + } + } + else + { + PUT_SRCSTRN (awk, px->id.name.ptr, px->id.name.len); + } + HAWK_ASSERT (awk, px->idx == HAWK_NULL); + break; + } + + case HAWK_NDE_GBLIDX: + { + hawk_nde_var_t* px = (hawk_nde_var_t*)nde; + + if (px->id.idxa != (hawk_oow_t)-1) + { + /* deparsing is global. so i can't honor awk->parse.pragma.trait + * which can change in each input file. let me just check awk->opt.trait */ + if (!(awk->opt.trait & HAWK_IMPLICIT)) + { + /* no implicit(named) variable is allowed. + * use the actual name */ + PUT_SRCSTRN (awk, px->id.name.ptr, px->id.name.len); + } + else if (px->id.idxa < awk->tree.ngbls_base) + { + /* static global variables */ + PUT_SRCSTRN (awk, px->id.name.ptr, px->id.name.len); + } + else + { + hawk_ooch_t tmp[HAWK_SIZEOF(hawk_int_t)*8+2]; + hawk_oow_t n; + + PUT_SRCSTR (awk, HAWK_T("__g")); + n = hawk_int_to_oocstr(px->id.idxa, 10, HAWK_NULL, tmp, HAWK_COUNTOF(tmp)); + PUT_SRCSTRN (awk, tmp, n); + } + PUT_SRCSTR (awk, HAWK_T("[")); + } + else + { + PUT_SRCSTRN (awk, px->id.name.ptr, px->id.name.len); + PUT_SRCSTR (awk, HAWK_T("[")); + } + HAWK_ASSERT (awk, px->idx != HAWK_NULL); + PRINT_EXPR_LIST (awk, px->idx); + PUT_SRCSTR (awk, HAWK_T("]")); + break; + } + + case HAWK_NDE_LCL: + { + hawk_oow_t n; + hawk_nde_var_t* px = (hawk_nde_var_t*)nde; + + if (px->id.idxa != (hawk_oow_t)-1) + { + PUT_SRCSTR (awk, HAWK_T("__l")); + n = hawk_int_to_oocstr(px->id.idxa, 10, HAWK_NULL, awk->tmp.fmt, HAWK_COUNTOF(awk->tmp.fmt)); + PUT_SRCSTRN (awk, awk->tmp.fmt, n); + } + else + { + PUT_SRCSTRN (awk, px->id.name.ptr, px->id.name.len); + } + HAWK_ASSERT (awk, px->idx == HAWK_NULL); + break; + } + + case HAWK_NDE_LCLIDX: + { + hawk_oow_t n; + hawk_nde_var_t* px = (hawk_nde_var_t*)nde; + + if (px->id.idxa != (hawk_oow_t)-1) + { + PUT_SRCSTR (awk, HAWK_T("__l")); + n = hawk_int_to_oocstr(px->id.idxa, 10, HAWK_NULL, awk->tmp.fmt, HAWK_COUNTOF(awk->tmp.fmt)); + PUT_SRCSTRN (awk, awk->tmp.fmt, n); + PUT_SRCSTR (awk, HAWK_T("[")); + } + else + { + PUT_SRCSTRN (awk, px->id.name.ptr, px->id.name.len); + PUT_SRCSTR (awk, HAWK_T("[")); + } + HAWK_ASSERT (awk, px->idx != HAWK_NULL); + PRINT_EXPR_LIST (awk, px->idx); + PUT_SRCSTR (awk, HAWK_T("]")); + break; + } + + case HAWK_NDE_POS: + { + PUT_SRCSTR (awk, HAWK_T("$")); + PRINT_EXPR (awk, ((hawk_nde_pos_t*)nde)->val); + break; + } + + case HAWK_NDE_FNCALL_FNC: + { + hawk_nde_fncall_t* px = (hawk_nde_fncall_t*)nde; + PUT_SRCSTRN (awk, px->u.fnc.info.name.ptr, px->u.fnc.info.name.len); + PUT_SRCSTR (awk, HAWK_T("(")); + PRINT_EXPR_LIST (awk, px->args); + PUT_SRCSTR (awk, HAWK_T(")")); + break; + } + + case HAWK_NDE_FNCALL_FUN: + { + hawk_nde_fncall_t* px = (hawk_nde_fncall_t*)nde; + PUT_SRCSTRN (awk, px->u.fun.name.ptr, px->u.fun.name.len); + PUT_SRCSTR (awk, HAWK_T("(")); + PRINT_EXPR_LIST (awk, px->args); + PUT_SRCSTR (awk, HAWK_T(")")); + break; + } + + case HAWK_NDE_FNCALL_VAR: + { + hawk_nde_fncall_t* px = (hawk_nde_fncall_t*)nde; + PRINT_EXPR (awk, (hawk_nde_t*)px->u.var.var); + PUT_SRCSTR (awk, HAWK_T("(")); + PRINT_EXPR_LIST (awk, px->args); + PUT_SRCSTR (awk, HAWK_T(")")); + break; + } + + case HAWK_NDE_GETLINE: + { + hawk_nde_getline_t* px = (hawk_nde_getline_t*)nde; + + PUT_SRCSTR (awk, HAWK_T("(")); + + if (px->in != HAWK_NULL && + (px->in_type == HAWK_IN_PIPE || + px->in_type == HAWK_IN_RWPIPE)) + { + PRINT_EXPR (awk, px->in); + PUT_SRCSTR (awk, HAWK_T(" ")); + PUT_SRCSTR (awk, getline_inop_str[px->in_type]); + PUT_SRCSTR (awk, HAWK_T(" ")); + } + + hawk_getkwname (awk, HAWK_KWID_GETLINE, &kw); + PUT_SRCSTRN (awk, kw.ptr, kw.len); + if (px->var != HAWK_NULL) + { + PUT_SRCSTR (awk, HAWK_T(" ")); + PRINT_EXPR (awk, px->var); + } + + if (px->in != HAWK_NULL && + px->in_type == HAWK_IN_FILE) + { + PUT_SRCSTR (awk, HAWK_T(" ")); + PUT_SRCSTR (awk, getline_inop_str[px->in_type]); + PUT_SRCSTR (awk, HAWK_T(" ")); + PRINT_EXPR (awk, px->in); + } + + PUT_SRCSTR (awk, HAWK_T(")")); + break; + } + + case HAWK_NDE_PRINT: + case HAWK_NDE_PRINTF: + { + PUT_SRCSTR (awk, HAWK_T("(")); + if (print_printx (awk, (hawk_nde_print_t*)nde) <= -1) return -1; + PUT_SRCSTR (awk, HAWK_T(")")); + break; + } + + default: + { + hawk_seterrnum (awk, HAWK_EINTERN, HAWK_NULL); + return -1; + } + } + + return 0; +} + +static int print_expr_list (hawk_t* awk, hawk_nde_t* tree) +{ + hawk_nde_t* p = tree; + + while (p != HAWK_NULL) + { + PRINT_EXPR (awk, p); + p = p->next; + if (p != HAWK_NULL) PUT_SRCSTR (awk, HAWK_T(",")); + } + + return 0; +} + +static int print_stmt (hawk_t* awk, hawk_nde_t* p, int depth) +{ + hawk_oow_t i; + hawk_oocs_t kw; + + switch (p->type) + { + case HAWK_NDE_NULL: + { + PRINT_TABS (awk, depth); + PUT_SRCSTR (awk, HAWK_T(";")); + PUT_NL (awk); + break; + } + + case HAWK_NDE_BLK: + { + hawk_oow_t n; + hawk_nde_blk_t* px = (hawk_nde_blk_t*)p; + + PRINT_TABS (awk, depth); + PUT_SRCSTR (awk, HAWK_T("{")); + PUT_NL (awk); + + if (px->nlcls > 0) + { + PRINT_TABS (awk, depth + 1); + + hawk_getkwname (awk, HAWK_KWID_XLOCAL, &kw); + PUT_SRCSTRN (awk, kw.ptr, kw.len); + PUT_SRCSTR (awk, HAWK_T(" ")); + + for (i = 0; i < px->nlcls - 1; i++) + { + PUT_SRCSTR (awk, HAWK_T("__l")); + n = hawk_int_to_oocstr(i, 10, HAWK_NULL, awk->tmp.fmt, HAWK_COUNTOF(awk->tmp.fmt)); + PUT_SRCSTRN (awk, awk->tmp.fmt, n); + PUT_SRCSTR (awk, HAWK_T(", ")); + } + + PUT_SRCSTR (awk, HAWK_T("__l")); + n = hawk_int_to_oocstr(i, 10, HAWK_NULL, awk->tmp.fmt, HAWK_COUNTOF(awk->tmp.fmt)); + PUT_SRCSTRN (awk, awk->tmp.fmt, n); + PUT_SRCSTR (awk, HAWK_T(";")); + PUT_NL (awk); + } + + PRINT_STMTS (awk, px->body, depth + 1); + PRINT_TABS (awk, depth); + PUT_SRCSTR (awk, HAWK_T("}")); + PUT_NL (awk); + break; + } + + case HAWK_NDE_IF: + { + hawk_nde_if_t* px = (hawk_nde_if_t*)p; + + PRINT_TABS (awk, depth); + hawk_getkwname (awk, HAWK_KWID_IF, &kw); + PUT_SRCSTRN (awk, kw.ptr, kw.len); + PUT_SRCSTR (awk, HAWK_T(" (")); + PRINT_EXPR (awk, px->test); + PUT_SRCSTR (awk, HAWK_T(")")); + PUT_NL (awk); + + HAWK_ASSERT (awk, px->then_part != HAWK_NULL); + if (px->then_part->type == HAWK_NDE_BLK) + PRINT_STMTS (awk, px->then_part, depth); + else + PRINT_STMTS (awk, px->then_part, depth + 1); + + if (px->else_part != HAWK_NULL) + { + PRINT_TABS (awk, depth); + hawk_getkwname (awk, HAWK_KWID_ELSE, &kw); + PUT_SRCSTRN (awk, kw.ptr, kw.len); + PUT_NL (awk); + if (px->else_part->type == HAWK_NDE_BLK) + PRINT_STMTS (awk, px->else_part, depth); + else + PRINT_STMTS (awk, px->else_part, depth + 1); + } + break; + } + + case HAWK_NDE_WHILE: + { + hawk_nde_while_t* px = (hawk_nde_while_t*)p; + + PRINT_TABS (awk, depth); + hawk_getkwname (awk, HAWK_KWID_WHILE, &kw); + PUT_SRCSTRN (awk, kw.ptr, kw.len); + PUT_SRCSTR (awk, HAWK_T(" (")); + PRINT_EXPR (awk, px->test); + PUT_SRCSTR (awk, HAWK_T(")")); + PUT_NL (awk); + if (px->body->type == HAWK_NDE_BLK) + { + PRINT_STMTS (awk, px->body, depth); + } + else + { + PRINT_STMTS (awk, px->body, depth + 1); + } + break; + } + + case HAWK_NDE_DOWHILE: + { + hawk_nde_while_t* px = (hawk_nde_while_t*)p; + + PRINT_TABS (awk, depth); + hawk_getkwname (awk, HAWK_KWID_DO, &kw); + PUT_SRCSTRN (awk, kw.ptr, kw.len); + PUT_NL (awk); + if (px->body->type == HAWK_NDE_BLK) + { + PRINT_STMTS (awk, px->body, depth); + } + else + { + PRINT_STMTS (awk, px->body, depth + 1); + } + + PRINT_TABS (awk, depth); + hawk_getkwname (awk, HAWK_KWID_WHILE, &kw); + PUT_SRCSTRN (awk, kw.ptr, kw.len); + PUT_SRCSTR (awk, HAWK_T(" (")); + PRINT_EXPR (awk, px->test); + PUT_SRCSTR (awk, HAWK_T(");")); + PUT_NL (awk); + break; + } + + case HAWK_NDE_FOR: + { + hawk_nde_for_t* px = (hawk_nde_for_t*)p; + + PRINT_TABS (awk, depth); + hawk_getkwname (awk, HAWK_KWID_FOR, &kw); + PUT_SRCSTRN (awk, kw.ptr, kw.len); + PUT_SRCSTR (awk, HAWK_T(" (")); + if (px->init != HAWK_NULL) + { + PRINT_EXPR (awk, px->init); + } + PUT_SRCSTR (awk, HAWK_T("; ")); + if (px->test != HAWK_NULL) + { + PRINT_EXPR (awk, px->test); + } + PUT_SRCSTR (awk, HAWK_T("; ")); + if (px->incr != HAWK_NULL) + { + PRINT_EXPR (awk, px->incr); + } + PUT_SRCSTR (awk, HAWK_T(")")); + PUT_NL (awk); + + if (px->body->type == HAWK_NDE_BLK) + { + PRINT_STMTS (awk, px->body, depth); + } + else + { + PRINT_STMTS (awk, px->body, depth + 1); + } + break; + } + + case HAWK_NDE_FOREACH: + { + hawk_nde_foreach_t* px = (hawk_nde_foreach_t*)p; + + PRINT_TABS (awk, depth); + hawk_getkwname (awk, HAWK_KWID_FOR, &kw); + PUT_SRCSTRN (awk, kw.ptr, kw.len); + PUT_SRCSTR (awk, HAWK_T(" ")); + PRINT_EXPR (awk, px->test); + PUT_NL (awk); + if (px->body->type == HAWK_NDE_BLK) + { + PRINT_STMTS (awk, px->body, depth); + } + else + { + PRINT_STMTS (awk, px->body, depth + 1); + } + break; + } + + case HAWK_NDE_BREAK: + { + PRINT_TABS (awk, depth); + hawk_getkwname (awk, HAWK_KWID_BREAK, &kw); + PUT_SRCSTRN (awk, kw.ptr, kw.len); + PUT_SRCSTR (awk, HAWK_T(";")); + PUT_NL (awk); + break; + } + + case HAWK_NDE_CONTINUE: + { + PRINT_TABS (awk, depth); + hawk_getkwname (awk, HAWK_KWID_CONTINUE, &kw); + PUT_SRCSTRN (awk, kw.ptr, kw.len); + PUT_SRCSTR (awk, HAWK_T(";")); + PUT_NL (awk); + break; + } + + case HAWK_NDE_RETURN: + { + PRINT_TABS (awk, depth); + if (((hawk_nde_return_t*)p)->val == HAWK_NULL) + { + hawk_getkwname (awk, HAWK_KWID_RETURN, &kw); + PUT_SRCSTRN (awk, kw.ptr, kw.len); + PUT_SRCSTR (awk, HAWK_T(";")); + PUT_NL (awk); + } + else + { + hawk_getkwname (awk, HAWK_KWID_RETURN, &kw); + PUT_SRCSTRN (awk, kw.ptr, kw.len); + PUT_SRCSTR (awk, HAWK_T(" ")); + HAWK_ASSERT (awk, ((hawk_nde_return_t*)p)->val->next == HAWK_NULL); + + PRINT_EXPR (awk, ((hawk_nde_return_t*)p)->val); + PUT_SRCSTR (awk, HAWK_T(";")); + PUT_NL (awk); + } + break; + } + + case HAWK_NDE_EXIT: + { + hawk_nde_exit_t* px = (hawk_nde_exit_t*)p; + PRINT_TABS (awk, depth); + + if (px->val == HAWK_NULL) + { + hawk_getkwname (awk, (px->abort? HAWK_KWID_XABORT: HAWK_KWID_EXIT), &kw); + PUT_SRCSTRN (awk, kw.ptr, kw.len); + PUT_SRCSTR (awk, HAWK_T(";")); + PUT_NL (awk); + } + else + { + hawk_getkwname (awk, (px->abort? HAWK_KWID_XABORT: HAWK_KWID_EXIT), &kw); + PUT_SRCSTRN (awk, kw.ptr, kw.len); + PUT_SRCSTR (awk, HAWK_T(" ")); + HAWK_ASSERT (awk, px->val->next == HAWK_NULL); + PRINT_EXPR (awk, px->val); + PUT_SRCSTR (awk, HAWK_T(";")); + PUT_NL (awk); + } + break; + } + + case HAWK_NDE_NEXT: + { + PRINT_TABS (awk, depth); + hawk_getkwname (awk, HAWK_KWID_NEXT, &kw); + PUT_SRCSTRN (awk, kw.ptr, kw.len); + PUT_SRCSTR (awk, HAWK_T(";")); + PUT_NL (awk); + break; + } + + case HAWK_NDE_NEXTFILE: + { + PRINT_TABS (awk, depth); + if (((hawk_nde_nextfile_t*)p)->out) + { + hawk_getkwname (awk, HAWK_KWID_NEXTOFILE, &kw); + PUT_SRCSTRN (awk, kw.ptr, kw.len); + } + else + { + hawk_getkwname (awk, HAWK_KWID_NEXTFILE, &kw); + PUT_SRCSTRN (awk, kw.ptr, kw.len); + } + PUT_SRCSTR (awk, HAWK_T(";")); + PUT_NL (awk); + break; + } + + case HAWK_NDE_DELETE: + { + PRINT_TABS (awk, depth); + hawk_getkwname (awk, HAWK_KWID_DELETE, &kw); + PUT_SRCSTRN (awk, kw.ptr, kw.len); + PUT_SRCSTR (awk, HAWK_T(" ")); + hawk_prnpt (awk, ((hawk_nde_delete_t*)p)->var); + break; + } + + case HAWK_NDE_RESET: + { + PRINT_TABS (awk, depth); + hawk_getkwname (awk, HAWK_KWID_XRESET, &kw); + PUT_SRCSTRN (awk, kw.ptr, kw.len); + PUT_SRCSTR (awk, HAWK_T(" ")); + hawk_prnpt (awk, ((hawk_nde_reset_t*)p)->var); + break; + } + + case HAWK_NDE_PRINT: + case HAWK_NDE_PRINTF: + { + PRINT_TABS (awk, depth); + if (print_printx (awk, (hawk_nde_print_t*)p) <= -1) return -1; + PUT_SRCSTR (awk, HAWK_T(";")); + PUT_NL (awk); + break; + } + + default: + { + PRINT_TABS (awk, depth); + PRINT_EXPR (awk, p); + PUT_SRCSTR (awk, HAWK_T(";")); + PUT_NL (awk); + break; + } + } + + return 0; +} + +static int print_stmts (hawk_t* awk, hawk_nde_t* tree, int depth) +{ + hawk_nde_t* p = tree; + + while (p != HAWK_NULL) + { + if (print_stmt (awk, p, depth) == -1) return -1; + p = p->next; + } + + return 0; +} + +int hawk_prnpt (hawk_t* awk, hawk_nde_t* tree) +{ + return print_stmts (awk, tree, 0); +} + +int hawk_prnnde (hawk_t* awk, hawk_nde_t* tree) +{ + return print_stmt (awk, tree, 0); +} + +int hawk_prnptnpt (hawk_t* awk, hawk_nde_t* tree) +{ + hawk_nde_t* nde = tree; + + while (nde != HAWK_NULL) + { + if (print_expr (awk, nde) == -1) return -1; + if (nde->next == HAWK_NULL) break; + + PUT_SRCSTR (awk, HAWK_T(",")); + nde = nde->next; + } + + return 0; +} + +void hawk_clrpt (hawk_t* awk, hawk_nde_t* tree) +{ + hawk_nde_t* p = tree; + hawk_nde_t* next; + + while (p != HAWK_NULL) + { + next = p->next; + + switch (p->type) + { + case HAWK_NDE_NULL: + { + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_BLK: + { + hawk_clrpt (awk, ((hawk_nde_blk_t*)p)->body); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_IF: + { + hawk_nde_if_t* px = (hawk_nde_if_t*)p; + hawk_clrpt (awk, px->test); + hawk_clrpt (awk, px->then_part); + if (px->else_part) hawk_clrpt (awk, px->else_part); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_WHILE: + case HAWK_NDE_DOWHILE: + { + hawk_clrpt (awk, ((hawk_nde_while_t*)p)->test); + hawk_clrpt (awk, ((hawk_nde_while_t*)p)->body); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_FOR: + { + hawk_nde_for_t* px = (hawk_nde_for_t*)p; + if (px->init) hawk_clrpt (awk, px->init); + if (px->test) hawk_clrpt (awk, px->test); + if (px->incr) hawk_clrpt (awk, px->incr); + hawk_clrpt (awk, px->body); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_FOREACH: + { + hawk_clrpt (awk, ((hawk_nde_foreach_t*)p)->test); + hawk_clrpt (awk, ((hawk_nde_foreach_t*)p)->body); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_BREAK: + { + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_CONTINUE: + { + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_RETURN: + { + hawk_nde_return_t* px = (hawk_nde_return_t*)p; + if (px->val) hawk_clrpt (awk, px->val); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_EXIT: + { + if (((hawk_nde_exit_t*)p)->val != HAWK_NULL) + hawk_clrpt (awk, ((hawk_nde_exit_t*)p)->val); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_NEXT: + case HAWK_NDE_NEXTFILE: + { + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_DELETE: + { + hawk_clrpt (awk, ((hawk_nde_delete_t*)p)->var); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_RESET: + { + hawk_clrpt (awk, ((hawk_nde_reset_t*)p)->var); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_PRINT: + case HAWK_NDE_PRINTF: + { + hawk_nde_print_t* px = (hawk_nde_print_t*)p; + if (px->args) hawk_clrpt (awk, px->args); + if (px->out) hawk_clrpt (awk, px->out); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_GRP: + { + hawk_clrpt (awk, ((hawk_nde_grp_t*)p)->body); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_ASS: + { + hawk_clrpt (awk, ((hawk_nde_ass_t*)p)->left); + hawk_clrpt (awk, ((hawk_nde_ass_t*)p)->right); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_EXP_BIN: + { + hawk_nde_exp_t* px = (hawk_nde_exp_t*)p; + HAWK_ASSERT (awk, px->left->next == HAWK_NULL); + HAWK_ASSERT (awk, px->right->next == HAWK_NULL); + + hawk_clrpt (awk, px->left); + hawk_clrpt (awk, px->right); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_EXP_UNR: + case HAWK_NDE_EXP_INCPRE: + case HAWK_NDE_EXP_INCPST: + { + hawk_nde_exp_t* px = (hawk_nde_exp_t*)p; + HAWK_ASSERT (awk, px->right == HAWK_NULL); + hawk_clrpt (awk, px->left); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_CND: + { + hawk_clrpt (awk, ((hawk_nde_cnd_t*)p)->test); + hawk_clrpt (awk, ((hawk_nde_cnd_t*)p)->left); + hawk_clrpt (awk, ((hawk_nde_cnd_t*)p)->right); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_INT: + { + if (((hawk_nde_int_t*)p)->str) + hawk_freemem (awk, ((hawk_nde_int_t*)p)->str); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_FLT: + { + if (((hawk_nde_flt_t*)p)->str) + hawk_freemem (awk, ((hawk_nde_flt_t*)p)->str); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_STR: + { + hawk_freemem (awk, ((hawk_nde_str_t*)p)->ptr); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_MBS: + { + hawk_freemem (awk, ((hawk_nde_mbs_t*)p)->ptr); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_REX: + { + hawk_nde_rex_t* rex = (hawk_nde_rex_t*)p; + hawk_freerex (awk, rex->code[0], rex->code[1]); + hawk_freemem (awk, ((hawk_nde_rex_t*)p)->str.ptr); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_FUN: + { + hawk_freemem (awk, ((hawk_nde_fun_t*)p)->name.ptr); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_NAMED: + case HAWK_NDE_GBL: + case HAWK_NDE_LCL: + case HAWK_NDE_ARG: + { + hawk_nde_var_t* px = (hawk_nde_var_t*)p; + HAWK_ASSERT (awk, px->idx == HAWK_NULL); + if (px->id.name.ptr) hawk_freemem (awk, px->id.name.ptr); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_NAMEDIDX: + case HAWK_NDE_GBLIDX: + case HAWK_NDE_LCLIDX: + case HAWK_NDE_ARGIDX: + { + hawk_nde_var_t* px = (hawk_nde_var_t*)p; + HAWK_ASSERT (awk, px->idx != HAWK_NULL); + hawk_clrpt (awk, px->idx); + if (px->id.name.ptr) hawk_freemem (awk, px->id.name.ptr); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_POS: + { + hawk_clrpt (awk, ((hawk_nde_pos_t*)p)->val); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_FNCALL_FNC: + { + hawk_nde_fncall_t* px = (hawk_nde_fncall_t*)p; + /* hawk_freemem (awk, px->u.fnc); */ + hawk_freemem (awk, px->u.fnc.info.name.ptr); + hawk_clrpt (awk, px->args); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_FNCALL_FUN: + { + hawk_nde_fncall_t* px = (hawk_nde_fncall_t*)p; + hawk_freemem (awk, px->u.fun.name.ptr); + hawk_clrpt (awk, px->args); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_FNCALL_VAR: + { + hawk_nde_fncall_t* px = (hawk_nde_fncall_t*)p; + hawk_clrpt (awk, (hawk_nde_t*)px->u.var.var); + hawk_clrpt (awk, px->args); + hawk_freemem (awk, p); + break; + } + + case HAWK_NDE_GETLINE: + { + hawk_nde_getline_t* px = (hawk_nde_getline_t*)p; + if (px->var) hawk_clrpt (awk, px->var); + if (px->in) hawk_clrpt (awk, px->in); + hawk_freemem (awk, p); + break; + } + + default: + { + HAWK_ASSERT (awk, !"should never happen - invalid node type"); + hawk_freemem (awk, p); + break; + } + } + + p = next; + } +} diff --git a/hawk/lib/uch-case.h b/hawk/lib/uch-case.h new file mode 100644 index 00000000..51252e81 --- /dev/null +++ b/hawk/lib/uch-case.h @@ -0,0 +1,7367 @@ +/* generated by tools/uni-case.c */ + +#define UCH_CASE_MAX 0xFFFF + +typedef struct uch_case_page_t uch_case_page_t; + +struct uch_case_page_t { + hawk_int32_t upper; + hawk_int32_t lower; +}; + + +static uch_case_page_t uch_case_page_000D[512] = +{ + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0} +}; + +static uch_case_page_t uch_case_page_000C[512] = +{ + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {928, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {38864, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0} +}; + +static uch_case_page_t uch_case_page_000B[512] = +{ + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, -35332}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, -42280}, + {0, 0}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, -42308}, + {0, -42319}, + {0, -42315}, + {0, -42305}, + {0, -42308}, + {0, 0}, + {0, -42258}, + {0, -42282}, + {0, -42261}, + {0, 928}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0} +}; + +static uch_case_page_t uch_case_page_000A[512] = +{ + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, -10743}, + {0, -3814}, + {0, -10727}, + {10795, 0}, + {10792, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, -10780}, + {0, -10749}, + {0, -10783}, + {0, -10782}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, -10815}, + {0, -10815}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {7264, 0}, + {0, 0}, + {7264, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {7264, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0} +}; + +static uch_case_page_t uch_case_page_0009[512] = +{ + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 26}, + {0, 26}, + {0, 26}, + {0, 26}, + {0, 26}, + {0, 26}, + {0, 26}, + {0, 26}, + {0, 26}, + {0, 26}, + {0, 26}, + {0, 26}, + {0, 26}, + {0, 26}, + {0, 26}, + {0, 26}, + {0, 26}, + {0, 26}, + {0, 26}, + {0, 26}, + {0, 26}, + {0, 26}, + {0, 26}, + {0, 26}, + {0, 26}, + {0, 26}, + {26, 0}, + {26, 0}, + {26, 0}, + {26, 0}, + {26, 0}, + {26, 0}, + {26, 0}, + {26, 0}, + {26, 0}, + {26, 0}, + {26, 0}, + {26, 0}, + {26, 0}, + {26, 0}, + {26, 0}, + {26, 0}, + {26, 0}, + {26, 0}, + {26, 0}, + {26, 0}, + {26, 0}, + {26, 0}, + {26, 0}, + {26, 0}, + {26, 0}, + {26, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0} +}; + +static uch_case_page_t uch_case_page_0008[512] = +{ + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, -7517}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, -8383}, + {0, -8262}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 28}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {28, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 16}, + {0, 16}, + {0, 16}, + {0, 16}, + {0, 16}, + {0, 16}, + {0, 16}, + {0, 16}, + {0, 16}, + {0, 16}, + {0, 16}, + {0, 16}, + {0, 16}, + {0, 16}, + {0, 16}, + {0, 16}, + {16, 0}, + {16, 0}, + {16, 0}, + {16, 0}, + {16, 0}, + {16, 0}, + {16, 0}, + {16, 0}, + {16, 0}, + {16, 0}, + {16, 0}, + {16, 0}, + {16, 0}, + {16, 0}, + {16, 0}, + {16, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0} +}; + +static uch_case_page_t uch_case_page_0007[512] = +{ + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {59, 0}, + {0, 0}, + {0, 0}, + {0, -7615}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {0, 0}, + {0, 0}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, 0}, + {0, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {0, 0}, + {0, 0}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, 0}, + {0, 0}, + {0, 0}, + {-8, 0}, + {0, 0}, + {-8, 0}, + {0, 0}, + {-8, 0}, + {0, 0}, + {-8, 0}, + {0, 0}, + {0, -8}, + {0, 0}, + {0, -8}, + {0, 0}, + {0, -8}, + {0, 0}, + {0, -8}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {-74, 0}, + {-74, 0}, + {-86, 0}, + {-86, 0}, + {-86, 0}, + {-86, 0}, + {-100, 0}, + {-100, 0}, + {-128, 0}, + {-128, 0}, + {-112, 0}, + {-112, 0}, + {-126, 0}, + {-126, 0}, + {0, 0}, + {0, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {-8, 0}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {0, -8}, + {-8, 0}, + {-8, 0}, + {0, 0}, + {-9, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, -8}, + {0, -8}, + {0, -74}, + {0, -74}, + {0, -9}, + {0, 0}, + {7205, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {-9, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, -86}, + {0, -86}, + {0, -86}, + {0, -86}, + {0, -9}, + {0, 0}, + {0, 0}, + {0, 0}, + {-8, 0}, + {-8, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, -8}, + {0, -8}, + {0, -100}, + {0, -100}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {-8, 0}, + {-8, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {-7, 0}, + {0, 0}, + {0, 0}, + {0, -8}, + {0, -8}, + {0, -112}, + {0, -112}, + {0, -7}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {-9, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, -128}, + {0, -128}, + {0, -126}, + {0, -126}, + {0, -9}, + {0, 0}, + {0, 0}, + {0, 0} +}; + +static uch_case_page_t uch_case_page_0006[512] = +{ + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {6254, 0}, + {6253, 0}, + {6244, 0}, + {6242, 0}, + {6242, 0}, + {6243, 0}, + {6236, 0}, + {6181, 0}, + {-35266, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, 0}, + {0, 0}, + {0, -3008}, + {0, -3008}, + {0, -3008}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {-35332, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {-3814, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0} +}; + +static uch_case_page_t uch_case_page_0005[512] = +{ + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 38864}, + {0, 8}, + {0, 8}, + {0, 8}, + {0, 8}, + {0, 8}, + {0, 8}, + {0, 0}, + {0, 0}, + {8, 0}, + {8, 0}, + {8, 0}, + {8, 0}, + {8, 0}, + {8, 0}, + {0, 0}, + {0, 0} +}; + +static uch_case_page_t uch_case_page_0004[512] = +{ + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 7264}, + {0, 0}, + {0, 7264}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 7264}, + {0, 0}, + {0, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {0, 0}, + {0, 0}, + {-3008, 0}, + {-3008, 0}, + {-3008, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0} +}; + +static uch_case_page_t uch_case_page_0003[512] = +{ + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0} +}; + +static uch_case_page_t uch_case_page_0002[512] = +{ + {0, 80}, + {0, 80}, + {0, 80}, + {0, 80}, + {0, 80}, + {0, 80}, + {0, 80}, + {0, 80}, + {0, 80}, + {0, 80}, + {0, 80}, + {0, 80}, + {0, 80}, + {0, 80}, + {0, 80}, + {0, 80}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {80, 0}, + {80, 0}, + {80, 0}, + {80, 0}, + {80, 0}, + {80, 0}, + {80, 0}, + {80, 0}, + {80, 0}, + {80, 0}, + {80, 0}, + {80, 0}, + {80, 0}, + {80, 0}, + {80, 0}, + {80, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 15}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {15, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 48}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {48, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0} +}; + +static uch_case_page_t uch_case_page_0001[512] = +{ + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, -130}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 10795}, + {0, 1}, + {1, 0}, + {0, -163}, + {0, 10792}, + {-10815, 0}, + {-10815, 0}, + {0, 1}, + {1, 0}, + {0, -195}, + {0, 69}, + {0, 71}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {-10783, 0}, + {-10780, 0}, + {-10782, 0}, + {210, 0}, + {206, 0}, + {0, 0}, + {205, 0}, + {205, 0}, + {0, 0}, + {202, 0}, + {0, 0}, + {203, 0}, + {-42319, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {205, 0}, + {-42315, 0}, + {0, 0}, + {207, 0}, + {0, 0}, + {-42280, 0}, + {-42308, 0}, + {0, 0}, + {209, 0}, + {211, 0}, + {-42308, 0}, + {-10743, 0}, + {-42305, 0}, + {0, 0}, + {0, 0}, + {211, 0}, + {0, 0}, + {-10749, 0}, + {213, 0}, + {0, 0}, + {0, 0}, + {214, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {-10727, 0}, + {0, 0}, + {0, 0}, + {218, 0}, + {0, 0}, + {0, 0}, + {218, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {-42282, 0}, + {218, 0}, + {69, 0}, + {217, 0}, + {217, 0}, + {71, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {219, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {-42261, 0}, + {-42258, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {-84, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {-130, 0}, + {-130, 0}, + {-130, 0}, + {0, 0}, + {0, 116}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 38}, + {0, 0}, + {0, 37}, + {0, 37}, + {0, 37}, + {0, 0}, + {0, 64}, + {0, 0}, + {0, 63}, + {0, 63}, + {0, 0}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 0}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {38, 0}, + {37, 0}, + {37, 0}, + {37, 0}, + {0, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {31, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {64, 0}, + {63, 0}, + {63, 0}, + {0, 8}, + {62, 0}, + {57, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {47, 0}, + {54, 0}, + {8, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {86, 0}, + {80, 0}, + {-7, 0}, + {116, 0}, + {0, -60}, + {96, 0}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, -7}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, -130}, + {0, -130}, + {0, -130} +}; + +static uch_case_page_t uch_case_page_0000[512] = +{ + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {-743, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 0}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 32}, + {0, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {0, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {32, 0}, + {-121, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, -199}, + {232, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, -121}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {300, 0}, + {-195, 0}, + {0, 210}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 206}, + {0, 1}, + {1, 0}, + {0, 205}, + {0, 205}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 79}, + {0, 202}, + {0, 203}, + {0, 1}, + {1, 0}, + {0, 205}, + {0, 207}, + {-97, 0}, + {0, 211}, + {0, 209}, + {0, 1}, + {1, 0}, + {-163, 0}, + {0, 0}, + {0, 211}, + {0, 213}, + {-130, 0}, + {0, 214}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 218}, + {0, 1}, + {1, 0}, + {0, 218}, + {0, 0}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, 218}, + {0, 1}, + {1, 0}, + {0, 217}, + {0, 217}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 219}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 0}, + {0, 1}, + {1, 0}, + {0, 0}, + {-56, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 2}, + {1, 1}, + {2, 0}, + {0, 2}, + {1, 1}, + {2, 0}, + {0, 2}, + {1, 1}, + {2, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {79, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 0}, + {0, 2}, + {1, 1}, + {2, 0}, + {0, 1}, + {1, 0}, + {0, -97}, + {0, -56}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0}, + {0, 1}, + {1, 0} +}; + +static uch_case_page_t* uch_case_map[128] = +{ + /* 0x0-0x1FF */ uch_case_page_0000, + /* 0x200-0x3FF */ uch_case_page_0001, + /* 0x400-0x5FF */ uch_case_page_0002, + /* 0x600-0x7FF */ uch_case_page_0003, + /* 0x800-0x9FF */ uch_case_page_0003, + /* 0xA00-0xBFF */ uch_case_page_0003, + /* 0xC00-0xDFF */ uch_case_page_0003, + /* 0xE00-0xFFF */ uch_case_page_0003, + /* 0x1000-0x11FF */ uch_case_page_0004, + /* 0x1200-0x13FF */ uch_case_page_0005, + /* 0x1400-0x15FF */ uch_case_page_0003, + /* 0x1600-0x17FF */ uch_case_page_0003, + /* 0x1800-0x19FF */ uch_case_page_0003, + /* 0x1A00-0x1BFF */ uch_case_page_0003, + /* 0x1C00-0x1DFF */ uch_case_page_0006, + /* 0x1E00-0x1FFF */ uch_case_page_0007, + /* 0x2000-0x21FF */ uch_case_page_0008, + /* 0x2200-0x23FF */ uch_case_page_0003, + /* 0x2400-0x25FF */ uch_case_page_0009, + /* 0x2600-0x27FF */ uch_case_page_0003, + /* 0x2800-0x29FF */ uch_case_page_0003, + /* 0x2A00-0x2BFF */ uch_case_page_0003, + /* 0x2C00-0x2DFF */ uch_case_page_000A, + /* 0x2E00-0x2FFF */ uch_case_page_0003, + /* 0x3000-0x31FF */ uch_case_page_0003, + /* 0x3200-0x33FF */ uch_case_page_0003, + /* 0x3400-0x35FF */ uch_case_page_0003, + /* 0x3600-0x37FF */ uch_case_page_0003, + /* 0x3800-0x39FF */ uch_case_page_0003, + /* 0x3A00-0x3BFF */ uch_case_page_0003, + /* 0x3C00-0x3DFF */ uch_case_page_0003, + /* 0x3E00-0x3FFF */ uch_case_page_0003, + /* 0x4000-0x41FF */ uch_case_page_0003, + /* 0x4200-0x43FF */ uch_case_page_0003, + /* 0x4400-0x45FF */ uch_case_page_0003, + /* 0x4600-0x47FF */ uch_case_page_0003, + /* 0x4800-0x49FF */ uch_case_page_0003, + /* 0x4A00-0x4BFF */ uch_case_page_0003, + /* 0x4C00-0x4DFF */ uch_case_page_0003, + /* 0x4E00-0x4FFF */ uch_case_page_0003, + /* 0x5000-0x51FF */ uch_case_page_0003, + /* 0x5200-0x53FF */ uch_case_page_0003, + /* 0x5400-0x55FF */ uch_case_page_0003, + /* 0x5600-0x57FF */ uch_case_page_0003, + /* 0x5800-0x59FF */ uch_case_page_0003, + /* 0x5A00-0x5BFF */ uch_case_page_0003, + /* 0x5C00-0x5DFF */ uch_case_page_0003, + /* 0x5E00-0x5FFF */ uch_case_page_0003, + /* 0x6000-0x61FF */ uch_case_page_0003, + /* 0x6200-0x63FF */ uch_case_page_0003, + /* 0x6400-0x65FF */ uch_case_page_0003, + /* 0x6600-0x67FF */ uch_case_page_0003, + /* 0x6800-0x69FF */ uch_case_page_0003, + /* 0x6A00-0x6BFF */ uch_case_page_0003, + /* 0x6C00-0x6DFF */ uch_case_page_0003, + /* 0x6E00-0x6FFF */ uch_case_page_0003, + /* 0x7000-0x71FF */ uch_case_page_0003, + /* 0x7200-0x73FF */ uch_case_page_0003, + /* 0x7400-0x75FF */ uch_case_page_0003, + /* 0x7600-0x77FF */ uch_case_page_0003, + /* 0x7800-0x79FF */ uch_case_page_0003, + /* 0x7A00-0x7BFF */ uch_case_page_0003, + /* 0x7C00-0x7DFF */ uch_case_page_0003, + /* 0x7E00-0x7FFF */ uch_case_page_0003, + /* 0x8000-0x81FF */ uch_case_page_0003, + /* 0x8200-0x83FF */ uch_case_page_0003, + /* 0x8400-0x85FF */ uch_case_page_0003, + /* 0x8600-0x87FF */ uch_case_page_0003, + /* 0x8800-0x89FF */ uch_case_page_0003, + /* 0x8A00-0x8BFF */ uch_case_page_0003, + /* 0x8C00-0x8DFF */ uch_case_page_0003, + /* 0x8E00-0x8FFF */ uch_case_page_0003, + /* 0x9000-0x91FF */ uch_case_page_0003, + /* 0x9200-0x93FF */ uch_case_page_0003, + /* 0x9400-0x95FF */ uch_case_page_0003, + /* 0x9600-0x97FF */ uch_case_page_0003, + /* 0x9800-0x99FF */ uch_case_page_0003, + /* 0x9A00-0x9BFF */ uch_case_page_0003, + /* 0x9C00-0x9DFF */ uch_case_page_0003, + /* 0x9E00-0x9FFF */ uch_case_page_0003, + /* 0xA000-0xA1FF */ uch_case_page_0003, + /* 0xA200-0xA3FF */ uch_case_page_0003, + /* 0xA400-0xA5FF */ uch_case_page_0003, + /* 0xA600-0xA7FF */ uch_case_page_000B, + /* 0xA800-0xA9FF */ uch_case_page_0003, + /* 0xAA00-0xABFF */ uch_case_page_000C, + /* 0xAC00-0xADFF */ uch_case_page_0003, + /* 0xAE00-0xAFFF */ uch_case_page_0003, + /* 0xB000-0xB1FF */ uch_case_page_0003, + /* 0xB200-0xB3FF */ uch_case_page_0003, + /* 0xB400-0xB5FF */ uch_case_page_0003, + /* 0xB600-0xB7FF */ uch_case_page_0003, + /* 0xB800-0xB9FF */ uch_case_page_0003, + /* 0xBA00-0xBBFF */ uch_case_page_0003, + /* 0xBC00-0xBDFF */ uch_case_page_0003, + /* 0xBE00-0xBFFF */ uch_case_page_0003, + /* 0xC000-0xC1FF */ uch_case_page_0003, + /* 0xC200-0xC3FF */ uch_case_page_0003, + /* 0xC400-0xC5FF */ uch_case_page_0003, + /* 0xC600-0xC7FF */ uch_case_page_0003, + /* 0xC800-0xC9FF */ uch_case_page_0003, + /* 0xCA00-0xCBFF */ uch_case_page_0003, + /* 0xCC00-0xCDFF */ uch_case_page_0003, + /* 0xCE00-0xCFFF */ uch_case_page_0003, + /* 0xD000-0xD1FF */ uch_case_page_0003, + /* 0xD200-0xD3FF */ uch_case_page_0003, + /* 0xD400-0xD5FF */ uch_case_page_0003, + /* 0xD600-0xD7FF */ uch_case_page_0003, + /* 0xD800-0xD9FF */ uch_case_page_0003, + /* 0xDA00-0xDBFF */ uch_case_page_0003, + /* 0xDC00-0xDDFF */ uch_case_page_0003, + /* 0xDE00-0xDFFF */ uch_case_page_0003, + /* 0xE000-0xE1FF */ uch_case_page_0003, + /* 0xE200-0xE3FF */ uch_case_page_0003, + /* 0xE400-0xE5FF */ uch_case_page_0003, + /* 0xE600-0xE7FF */ uch_case_page_0003, + /* 0xE800-0xE9FF */ uch_case_page_0003, + /* 0xEA00-0xEBFF */ uch_case_page_0003, + /* 0xEC00-0xEDFF */ uch_case_page_0003, + /* 0xEE00-0xEFFF */ uch_case_page_0003, + /* 0xF000-0xF1FF */ uch_case_page_0003, + /* 0xF200-0xF3FF */ uch_case_page_0003, + /* 0xF400-0xF5FF */ uch_case_page_0003, + /* 0xF600-0xF7FF */ uch_case_page_0003, + /* 0xF800-0xF9FF */ uch_case_page_0003, + /* 0xFA00-0xFBFF */ uch_case_page_0003, + /* 0xFC00-0xFDFF */ uch_case_page_0003, + /* 0xFE00-0xFFFF */ uch_case_page_000D +}; diff --git a/hawk/lib/uch-prop.h b/hawk/lib/uch-prop.h new file mode 100644 index 00000000..ed903ee3 --- /dev/null +++ b/hawk/lib/uch-prop.h @@ -0,0 +1,15603 @@ +/* generated by tools/uni-prop.c */ + +#define UCH_PROP_MAX 0xFFFF + +static hawk_uint16_t uch_prop_page_003A[256] = +{ + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_0039[256] = +{ + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT +}; + +static hawk_uint16_t uch_prop_page_0038[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_0037[256] = +{ + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH +}; + +static hawk_uint16_t uch_prop_page_0036[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_0035[256] = +{ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_0034[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_0033[256] = +{ + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_0032[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_0031[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0 +}; + +static hawk_uint16_t uch_prop_page_0030[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT +}; + +static hawk_uint16_t uch_prop_page_002F[256] = +{ + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH +}; + +static hawk_uint16_t uch_prop_page_002E[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_002D[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT +}; + +static hawk_uint16_t uch_prop_page_002C[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_002B[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT +}; + +static hawk_uint16_t uch_prop_page_002A[256] = +{ + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0 +}; + +static hawk_uint16_t uch_prop_page_0029[256] = +{ + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH +}; + +static hawk_uint16_t uch_prop_page_0028[256] = +{ + HAWK_UCH_PROP_SPACE | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_BLANK, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH +}; + +static hawk_uint16_t uch_prop_page_0027[256] = +{ + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_0026[256] = +{ + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_0025[256] = +{ + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH +}; + +static hawk_uint16_t uch_prop_page_0024[256] = +{ + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT +}; + +static hawk_uint16_t uch_prop_page_0023[256] = +{ + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0 +}; + +static hawk_uint16_t uch_prop_page_0022[256] = +{ + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT +}; + +static hawk_uint16_t uch_prop_page_0021[256] = +{ + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT +}; + +static hawk_uint16_t uch_prop_page_0020[256] = +{ + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT +}; + +static hawk_uint16_t uch_prop_page_001F[256] = +{ + HAWK_UCH_PROP_SPACE | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_BLANK, + HAWK_UCH_PROP_SPACE | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_BLANK, + HAWK_UCH_PROP_SPACE | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_BLANK, + HAWK_UCH_PROP_SPACE | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_BLANK, + HAWK_UCH_PROP_SPACE | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_BLANK, + HAWK_UCH_PROP_SPACE | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_BLANK, + HAWK_UCH_PROP_SPACE | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_BLANK, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_SPACE | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_BLANK, + HAWK_UCH_PROP_SPACE | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_BLANK, + HAWK_UCH_PROP_SPACE | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_BLANK, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_SPACE | HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_SPACE | HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_SPACE | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_BLANK, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_001E[256] = +{ + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0 +}; + +static hawk_uint16_t uch_prop_page_001D[256] = +{ + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH +}; + +static hawk_uint16_t uch_prop_page_001C[256] = +{ + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT +}; + +static hawk_uint16_t uch_prop_page_001B[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_001A[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT +}; + +static hawk_uint16_t uch_prop_page_0019[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_0018[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT +}; + +static hawk_uint16_t uch_prop_page_0017[256] = +{ + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_0016[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_0015[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_SPACE | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_BLANK, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_0014[256] = +{ + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH +}; + +static hawk_uint16_t uch_prop_page_0013[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_0012[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH +}; + +static hawk_uint16_t uch_prop_page_0011[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH +}; + +static hawk_uint16_t uch_prop_page_0010[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH +}; + +static hawk_uint16_t uch_prop_page_000F[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_000E[256] = +{ + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_000D[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_000C[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_000B[256] = +{ + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_000A[256] = +{ + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT +}; + +static hawk_uint16_t uch_prop_page_0009[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0 +}; + +static hawk_uint16_t uch_prop_page_0008[256] = +{ + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH +}; + +static hawk_uint16_t uch_prop_page_0007[256] = +{ + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT +}; + +static hawk_uint16_t uch_prop_page_0006[256] = +{ + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH +}; + +static hawk_uint16_t uch_prop_page_0005[256] = +{ + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 +}; + +static hawk_uint16_t uch_prop_page_0004[256] = +{ + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH +}; + +static hawk_uint16_t uch_prop_page_0003[256] = +{ + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + 0, + 0, + 0, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + 0, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH +}; + +static hawk_uint16_t uch_prop_page_0002[256] = +{ + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT +}; + +static hawk_uint16_t uch_prop_page_0001[256] = +{ + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH +}; + +static hawk_uint16_t uch_prop_page_0000[256] = +{ + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_SPACE | HAWK_UCH_PROP_CNTRL | HAWK_UCH_PROP_BLANK, + HAWK_UCH_PROP_SPACE | HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_SPACE | HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_SPACE | HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_SPACE | HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_SPACE | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_BLANK, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_DIGIT | HAWK_UCH_PROP_XDIGIT | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_DIGIT | HAWK_UCH_PROP_XDIGIT | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_DIGIT | HAWK_UCH_PROP_XDIGIT | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_DIGIT | HAWK_UCH_PROP_XDIGIT | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_DIGIT | HAWK_UCH_PROP_XDIGIT | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_DIGIT | HAWK_UCH_PROP_XDIGIT | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_DIGIT | HAWK_UCH_PROP_XDIGIT | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_DIGIT | HAWK_UCH_PROP_XDIGIT | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_DIGIT | HAWK_UCH_PROP_XDIGIT | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_DIGIT | HAWK_UCH_PROP_XDIGIT | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_XDIGIT | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_XDIGIT | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_XDIGIT | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_XDIGIT | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_XDIGIT | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_XDIGIT | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_XDIGIT | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_XDIGIT | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_XDIGIT | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_XDIGIT | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_XDIGIT | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_XDIGIT | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_CNTRL, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_UPPER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH | HAWK_UCH_PROP_PUNCT, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH, + HAWK_UCH_PROP_LOWER | HAWK_UCH_PROP_ALPHA | HAWK_UCH_PROP_ALNUM | HAWK_UCH_PROP_PRINT | HAWK_UCH_PROP_GRAPH +}; + +static hawk_uint16_t* uch_prop_map[256] = +{ + /* 0x0-0xFF */ uch_prop_page_0000, + /* 0x100-0x1FF */ uch_prop_page_0001, + /* 0x200-0x2FF */ uch_prop_page_0002, + /* 0x300-0x3FF */ uch_prop_page_0003, + /* 0x400-0x4FF */ uch_prop_page_0004, + /* 0x500-0x5FF */ uch_prop_page_0005, + /* 0x600-0x6FF */ uch_prop_page_0006, + /* 0x700-0x7FF */ uch_prop_page_0007, + /* 0x800-0x8FF */ uch_prop_page_0008, + /* 0x900-0x9FF */ uch_prop_page_0009, + /* 0xA00-0xAFF */ uch_prop_page_000A, + /* 0xB00-0xBFF */ uch_prop_page_000B, + /* 0xC00-0xCFF */ uch_prop_page_000C, + /* 0xD00-0xDFF */ uch_prop_page_000D, + /* 0xE00-0xEFF */ uch_prop_page_000E, + /* 0xF00-0xFFF */ uch_prop_page_000F, + /* 0x1000-0x10FF */ uch_prop_page_0010, + /* 0x1100-0x11FF */ uch_prop_page_0011, + /* 0x1200-0x12FF */ uch_prop_page_0012, + /* 0x1300-0x13FF */ uch_prop_page_0013, + /* 0x1400-0x14FF */ uch_prop_page_0014, + /* 0x1500-0x15FF */ uch_prop_page_0011, + /* 0x1600-0x16FF */ uch_prop_page_0015, + /* 0x1700-0x17FF */ uch_prop_page_0016, + /* 0x1800-0x18FF */ uch_prop_page_0017, + /* 0x1900-0x19FF */ uch_prop_page_0018, + /* 0x1A00-0x1AFF */ uch_prop_page_0019, + /* 0x1B00-0x1BFF */ uch_prop_page_001A, + /* 0x1C00-0x1CFF */ uch_prop_page_001B, + /* 0x1D00-0x1DFF */ uch_prop_page_001C, + /* 0x1E00-0x1EFF */ uch_prop_page_001D, + /* 0x1F00-0x1FFF */ uch_prop_page_001E, + /* 0x2000-0x20FF */ uch_prop_page_001F, + /* 0x2100-0x21FF */ uch_prop_page_0020, + /* 0x2200-0x22FF */ uch_prop_page_0021, + /* 0x2300-0x23FF */ uch_prop_page_0021, + /* 0x2400-0x24FF */ uch_prop_page_0022, + /* 0x2500-0x25FF */ uch_prop_page_0021, + /* 0x2600-0x26FF */ uch_prop_page_0021, + /* 0x2700-0x27FF */ uch_prop_page_0021, + /* 0x2800-0x28FF */ uch_prop_page_0021, + /* 0x2900-0x29FF */ uch_prop_page_0021, + /* 0x2A00-0x2AFF */ uch_prop_page_0021, + /* 0x2B00-0x2BFF */ uch_prop_page_0023, + /* 0x2C00-0x2CFF */ uch_prop_page_0024, + /* 0x2D00-0x2DFF */ uch_prop_page_0025, + /* 0x2E00-0x2EFF */ uch_prop_page_0026, + /* 0x2F00-0x2FFF */ uch_prop_page_0027, + /* 0x3000-0x30FF */ uch_prop_page_0028, + /* 0x3100-0x31FF */ uch_prop_page_0029, + /* 0x3200-0x32FF */ uch_prop_page_002A, + /* 0x3300-0x33FF */ uch_prop_page_0021, + /* 0x3400-0x34FF */ uch_prop_page_0011, + /* 0x3500-0x35FF */ uch_prop_page_0011, + /* 0x3600-0x36FF */ uch_prop_page_0011, + /* 0x3700-0x37FF */ uch_prop_page_0011, + /* 0x3800-0x38FF */ uch_prop_page_0011, + /* 0x3900-0x39FF */ uch_prop_page_0011, + /* 0x3A00-0x3AFF */ uch_prop_page_0011, + /* 0x3B00-0x3BFF */ uch_prop_page_0011, + /* 0x3C00-0x3CFF */ uch_prop_page_0011, + /* 0x3D00-0x3DFF */ uch_prop_page_0011, + /* 0x3E00-0x3EFF */ uch_prop_page_0011, + /* 0x3F00-0x3FFF */ uch_prop_page_0011, + /* 0x4000-0x40FF */ uch_prop_page_0011, + /* 0x4100-0x41FF */ uch_prop_page_0011, + /* 0x4200-0x42FF */ uch_prop_page_0011, + /* 0x4300-0x43FF */ uch_prop_page_0011, + /* 0x4400-0x44FF */ uch_prop_page_0011, + /* 0x4500-0x45FF */ uch_prop_page_0011, + /* 0x4600-0x46FF */ uch_prop_page_0011, + /* 0x4700-0x47FF */ uch_prop_page_0011, + /* 0x4800-0x48FF */ uch_prop_page_0011, + /* 0x4900-0x49FF */ uch_prop_page_0011, + /* 0x4A00-0x4AFF */ uch_prop_page_0011, + /* 0x4B00-0x4BFF */ uch_prop_page_0011, + /* 0x4C00-0x4CFF */ uch_prop_page_0011, + /* 0x4D00-0x4DFF */ uch_prop_page_002B, + /* 0x4E00-0x4EFF */ uch_prop_page_0011, + /* 0x4F00-0x4FFF */ uch_prop_page_0011, + /* 0x5000-0x50FF */ uch_prop_page_0011, + /* 0x5100-0x51FF */ uch_prop_page_0011, + /* 0x5200-0x52FF */ uch_prop_page_0011, + /* 0x5300-0x53FF */ uch_prop_page_0011, + /* 0x5400-0x54FF */ uch_prop_page_0011, + /* 0x5500-0x55FF */ uch_prop_page_0011, + /* 0x5600-0x56FF */ uch_prop_page_0011, + /* 0x5700-0x57FF */ uch_prop_page_0011, + /* 0x5800-0x58FF */ uch_prop_page_0011, + /* 0x5900-0x59FF */ uch_prop_page_0011, + /* 0x5A00-0x5AFF */ uch_prop_page_0011, + /* 0x5B00-0x5BFF */ uch_prop_page_0011, + /* 0x5C00-0x5CFF */ uch_prop_page_0011, + /* 0x5D00-0x5DFF */ uch_prop_page_0011, + /* 0x5E00-0x5EFF */ uch_prop_page_0011, + /* 0x5F00-0x5FFF */ uch_prop_page_0011, + /* 0x6000-0x60FF */ uch_prop_page_0011, + /* 0x6100-0x61FF */ uch_prop_page_0011, + /* 0x6200-0x62FF */ uch_prop_page_0011, + /* 0x6300-0x63FF */ uch_prop_page_0011, + /* 0x6400-0x64FF */ uch_prop_page_0011, + /* 0x6500-0x65FF */ uch_prop_page_0011, + /* 0x6600-0x66FF */ uch_prop_page_0011, + /* 0x6700-0x67FF */ uch_prop_page_0011, + /* 0x6800-0x68FF */ uch_prop_page_0011, + /* 0x6900-0x69FF */ uch_prop_page_0011, + /* 0x6A00-0x6AFF */ uch_prop_page_0011, + /* 0x6B00-0x6BFF */ uch_prop_page_0011, + /* 0x6C00-0x6CFF */ uch_prop_page_0011, + /* 0x6D00-0x6DFF */ uch_prop_page_0011, + /* 0x6E00-0x6EFF */ uch_prop_page_0011, + /* 0x6F00-0x6FFF */ uch_prop_page_0011, + /* 0x7000-0x70FF */ uch_prop_page_0011, + /* 0x7100-0x71FF */ uch_prop_page_0011, + /* 0x7200-0x72FF */ uch_prop_page_0011, + /* 0x7300-0x73FF */ uch_prop_page_0011, + /* 0x7400-0x74FF */ uch_prop_page_0011, + /* 0x7500-0x75FF */ uch_prop_page_0011, + /* 0x7600-0x76FF */ uch_prop_page_0011, + /* 0x7700-0x77FF */ uch_prop_page_0011, + /* 0x7800-0x78FF */ uch_prop_page_0011, + /* 0x7900-0x79FF */ uch_prop_page_0011, + /* 0x7A00-0x7AFF */ uch_prop_page_0011, + /* 0x7B00-0x7BFF */ uch_prop_page_0011, + /* 0x7C00-0x7CFF */ uch_prop_page_0011, + /* 0x7D00-0x7DFF */ uch_prop_page_0011, + /* 0x7E00-0x7EFF */ uch_prop_page_0011, + /* 0x7F00-0x7FFF */ uch_prop_page_0011, + /* 0x8000-0x80FF */ uch_prop_page_0011, + /* 0x8100-0x81FF */ uch_prop_page_0011, + /* 0x8200-0x82FF */ uch_prop_page_0011, + /* 0x8300-0x83FF */ uch_prop_page_0011, + /* 0x8400-0x84FF */ uch_prop_page_0011, + /* 0x8500-0x85FF */ uch_prop_page_0011, + /* 0x8600-0x86FF */ uch_prop_page_0011, + /* 0x8700-0x87FF */ uch_prop_page_0011, + /* 0x8800-0x88FF */ uch_prop_page_0011, + /* 0x8900-0x89FF */ uch_prop_page_0011, + /* 0x8A00-0x8AFF */ uch_prop_page_0011, + /* 0x8B00-0x8BFF */ uch_prop_page_0011, + /* 0x8C00-0x8CFF */ uch_prop_page_0011, + /* 0x8D00-0x8DFF */ uch_prop_page_0011, + /* 0x8E00-0x8EFF */ uch_prop_page_0011, + /* 0x8F00-0x8FFF */ uch_prop_page_0011, + /* 0x9000-0x90FF */ uch_prop_page_0011, + /* 0x9100-0x91FF */ uch_prop_page_0011, + /* 0x9200-0x92FF */ uch_prop_page_0011, + /* 0x9300-0x93FF */ uch_prop_page_0011, + /* 0x9400-0x94FF */ uch_prop_page_0011, + /* 0x9500-0x95FF */ uch_prop_page_0011, + /* 0x9600-0x96FF */ uch_prop_page_0011, + /* 0x9700-0x97FF */ uch_prop_page_0011, + /* 0x9800-0x98FF */ uch_prop_page_0011, + /* 0x9900-0x99FF */ uch_prop_page_0011, + /* 0x9A00-0x9AFF */ uch_prop_page_0011, + /* 0x9B00-0x9BFF */ uch_prop_page_0011, + /* 0x9C00-0x9CFF */ uch_prop_page_0011, + /* 0x9D00-0x9DFF */ uch_prop_page_0011, + /* 0x9E00-0x9EFF */ uch_prop_page_0011, + /* 0x9F00-0x9FFF */ uch_prop_page_002C, + /* 0xA000-0xA0FF */ uch_prop_page_0011, + /* 0xA100-0xA1FF */ uch_prop_page_0011, + /* 0xA200-0xA2FF */ uch_prop_page_0011, + /* 0xA300-0xA3FF */ uch_prop_page_0011, + /* 0xA400-0xA4FF */ uch_prop_page_002D, + /* 0xA500-0xA5FF */ uch_prop_page_0011, + /* 0xA600-0xA6FF */ uch_prop_page_002E, + /* 0xA700-0xA7FF */ uch_prop_page_002F, + /* 0xA800-0xA8FF */ uch_prop_page_0030, + /* 0xA900-0xA9FF */ uch_prop_page_0031, + /* 0xAA00-0xAAFF */ uch_prop_page_0032, + /* 0xAB00-0xABFF */ uch_prop_page_0033, + /* 0xAC00-0xACFF */ uch_prop_page_0011, + /* 0xAD00-0xADFF */ uch_prop_page_0011, + /* 0xAE00-0xAEFF */ uch_prop_page_0011, + /* 0xAF00-0xAFFF */ uch_prop_page_0011, + /* 0xB000-0xB0FF */ uch_prop_page_0011, + /* 0xB100-0xB1FF */ uch_prop_page_0011, + /* 0xB200-0xB2FF */ uch_prop_page_0011, + /* 0xB300-0xB3FF */ uch_prop_page_0011, + /* 0xB400-0xB4FF */ uch_prop_page_0011, + /* 0xB500-0xB5FF */ uch_prop_page_0011, + /* 0xB600-0xB6FF */ uch_prop_page_0011, + /* 0xB700-0xB7FF */ uch_prop_page_0011, + /* 0xB800-0xB8FF */ uch_prop_page_0011, + /* 0xB900-0xB9FF */ uch_prop_page_0011, + /* 0xBA00-0xBAFF */ uch_prop_page_0011, + /* 0xBB00-0xBBFF */ uch_prop_page_0011, + /* 0xBC00-0xBCFF */ uch_prop_page_0011, + /* 0xBD00-0xBDFF */ uch_prop_page_0011, + /* 0xBE00-0xBEFF */ uch_prop_page_0011, + /* 0xBF00-0xBFFF */ uch_prop_page_0011, + /* 0xC000-0xC0FF */ uch_prop_page_0011, + /* 0xC100-0xC1FF */ uch_prop_page_0011, + /* 0xC200-0xC2FF */ uch_prop_page_0011, + /* 0xC300-0xC3FF */ uch_prop_page_0011, + /* 0xC400-0xC4FF */ uch_prop_page_0011, + /* 0xC500-0xC5FF */ uch_prop_page_0011, + /* 0xC600-0xC6FF */ uch_prop_page_0011, + /* 0xC700-0xC7FF */ uch_prop_page_0011, + /* 0xC800-0xC8FF */ uch_prop_page_0011, + /* 0xC900-0xC9FF */ uch_prop_page_0011, + /* 0xCA00-0xCAFF */ uch_prop_page_0011, + /* 0xCB00-0xCBFF */ uch_prop_page_0011, + /* 0xCC00-0xCCFF */ uch_prop_page_0011, + /* 0xCD00-0xCDFF */ uch_prop_page_0011, + /* 0xCE00-0xCEFF */ uch_prop_page_0011, + /* 0xCF00-0xCFFF */ uch_prop_page_0011, + /* 0xD000-0xD0FF */ uch_prop_page_0011, + /* 0xD100-0xD1FF */ uch_prop_page_0011, + /* 0xD200-0xD2FF */ uch_prop_page_0011, + /* 0xD300-0xD3FF */ uch_prop_page_0011, + /* 0xD400-0xD4FF */ uch_prop_page_0011, + /* 0xD500-0xD5FF */ uch_prop_page_0011, + /* 0xD600-0xD6FF */ uch_prop_page_0011, + /* 0xD700-0xD7FF */ uch_prop_page_0034, + /* 0xD800-0xD8FF */ uch_prop_page_0035, + /* 0xD900-0xD9FF */ uch_prop_page_0035, + /* 0xDA00-0xDAFF */ uch_prop_page_0035, + /* 0xDB00-0xDBFF */ uch_prop_page_0035, + /* 0xDC00-0xDCFF */ uch_prop_page_0035, + /* 0xDD00-0xDDFF */ uch_prop_page_0035, + /* 0xDE00-0xDEFF */ uch_prop_page_0035, + /* 0xDF00-0xDFFF */ uch_prop_page_0035, + /* 0xE000-0xE0FF */ uch_prop_page_0021, + /* 0xE100-0xE1FF */ uch_prop_page_0021, + /* 0xE200-0xE2FF */ uch_prop_page_0021, + /* 0xE300-0xE3FF */ uch_prop_page_0021, + /* 0xE400-0xE4FF */ uch_prop_page_0021, + /* 0xE500-0xE5FF */ uch_prop_page_0021, + /* 0xE600-0xE6FF */ uch_prop_page_0021, + /* 0xE700-0xE7FF */ uch_prop_page_0021, + /* 0xE800-0xE8FF */ uch_prop_page_0021, + /* 0xE900-0xE9FF */ uch_prop_page_0021, + /* 0xEA00-0xEAFF */ uch_prop_page_0021, + /* 0xEB00-0xEBFF */ uch_prop_page_0021, + /* 0xEC00-0xECFF */ uch_prop_page_0021, + /* 0xED00-0xEDFF */ uch_prop_page_0021, + /* 0xEE00-0xEEFF */ uch_prop_page_0021, + /* 0xEF00-0xEFFF */ uch_prop_page_0021, + /* 0xF000-0xF0FF */ uch_prop_page_0021, + /* 0xF100-0xF1FF */ uch_prop_page_0021, + /* 0xF200-0xF2FF */ uch_prop_page_0021, + /* 0xF300-0xF3FF */ uch_prop_page_0021, + /* 0xF400-0xF4FF */ uch_prop_page_0021, + /* 0xF500-0xF5FF */ uch_prop_page_0021, + /* 0xF600-0xF6FF */ uch_prop_page_0021, + /* 0xF700-0xF7FF */ uch_prop_page_0021, + /* 0xF800-0xF8FF */ uch_prop_page_0021, + /* 0xF900-0xF9FF */ uch_prop_page_0011, + /* 0xFA00-0xFAFF */ uch_prop_page_0036, + /* 0xFB00-0xFBFF */ uch_prop_page_0037, + /* 0xFC00-0xFCFF */ uch_prop_page_0011, + /* 0xFD00-0xFDFF */ uch_prop_page_0038, + /* 0xFE00-0xFEFF */ uch_prop_page_0039, + /* 0xFF00-0xFFFF */ uch_prop_page_003A +}; diff --git a/hawk/lib/utf16.c b/hawk/lib/utf16.c new file mode 100644 index 00000000..9982bc84 --- /dev/null +++ b/hawk/lib/utf16.c @@ -0,0 +1,85 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "hawk-prv.h" + +/* TODO: handle different endians - UTF16BE or UTF16LE */ + +enum +{ + HIGH_SURROGATE_START = 0xD800, + HIGH_SURROGATE_END = 0xDBFF, + LOW_SURROGATE_START = 0xDC00, + LOW_SURROGATE_END = 0xDFFF +}; + +hawk_oow_t hawk_uc_to_utf16 (hawk_uch_t uc, hawk_bch_t* utf16, hawk_oow_t size) +{ + hawk_uint16_t* u16 = (hawk_uint16_t*)utf16; + + if (uc <= 0xFFFF) + { + u16[0] = (hawk_uint16_t)uc; + return 2; + } +#if (HAWK_SIZEOF_UCH_T > 2) + else if (uc <= 0x10FFFF) + { + u16[0] = HIGH_SURROGATE_START | (((uc >> 16) & 0x1F) - 1) | (uc >> 10); + u16[1] = LOW_SURROGATE_START | (uc & 0x3FF); + return 4; + } +#endif + + return 0; /* illegal character */ +} + +hawk_oow_t hawk_utf16_to_uc (const hawk_bch_t* utf16, hawk_oow_t size, hawk_uch_t* uc) +{ + const hawk_uint16_t* u16 = (const hawk_uint16_t*)utf16; + + if (size < 2) return 0; /* incomplete sequence */ + + if (u16[0] < HIGH_SURROGATE_START || u16[0] > LOW_SURROGATE_END) + { + /* BMP - U+0000 - U+D7FF, U+E000 - U+FFFF */ + *uc = u16[0]; + return 2; + } +#if (HAWK_SIZEOF_UCH_T > 2) + else if (u16[0] >= HIGH_SURROGATE_START && u16[0] <= HIGH_SURROGATE_END) /* high-surrogate */ + { + if (size < 4) return 0; /* incomplete */ + if (u16[1] >= LOW_SURROGATE_START && u16[1] <= LOW_SURROGATE_END) /* low-surrogate */ + { + *uc = (((u16[0] & 0x3FF) << 10) | (u16[1] & 0x3FF)) + 0x10000; + return 4; + } + } +#endif + + return 0; +} diff --git a/hawk/lib/utf8.c b/hawk/lib/utf8.c new file mode 100644 index 00000000..4a80675b --- /dev/null +++ b/hawk/lib/utf8.c @@ -0,0 +1,178 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "hawk-prv.h" + +/* + * from RFC 2279 UTF-8, a transformation format of ISO 10646 + * + * UCS-4 range (hex.) UTF-8 octet sequence (binary) + * 1:2 00000000-0000007F 0xxxxxxx + * 2:2 00000080-000007FF 110xxxxx 10xxxxxx + * 3:2 00000800-0000FFFF 1110xxxx 10xxxxxx 10xxxxxx + * 4:4 00010000-001FFFFF 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx + * inv 00200000-03FFFFFF 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx + * inv 04000000-7FFFFFFF 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx + */ + +struct __utf8_t +{ + hawk_uint32_t lower; + hawk_uint32_t upper; + hawk_uint8_t fbyte; /* mask to the first utf8 byte */ + hawk_uint8_t mask; + hawk_uint8_t fmask; + int length; /* number of bytes */ +}; + +typedef struct __utf8_t __utf8_t; + +static __utf8_t utf8_table[] = +{ + {0x00000000ul, 0x0000007Ful, 0x00, 0x80, 0x7F, 1}, + {0x00000080ul, 0x000007FFul, 0xC0, 0xE0, 0x1F, 2}, + {0x00000800ul, 0x0000FFFFul, 0xE0, 0xF0, 0x0F, 3}, + {0x00010000ul, 0x001FFFFFul, 0xF0, 0xF8, 0x07, 4}, + {0x00200000ul, 0x03FFFFFFul, 0xF8, 0xFC, 0x03, 5}, + {0x04000000ul, 0x7FFFFFFFul, 0xFC, 0xFE, 0x01, 6} +}; + +static HAWK_INLINE __utf8_t* get_utf8_slot (hawk_uch_t uc) +{ + __utf8_t* cur, * end; + + /*HAWK_ASSERT (hawk, HAWK_SIZEOF(hawk_bch_t) == 1); + HAWK_ASSERT (hawk, HAWK_SIZEOF(hawk_uch_t) >= 2);*/ + + end = utf8_table + HAWK_COUNTOF(utf8_table); + cur = utf8_table; + + while (cur < end) + { + if (uc >= cur->lower && uc <= cur->upper) return cur; + cur++; + } + + return HAWK_NULL; /* invalid character */ +} + +hawk_oow_t hawk_uc_to_utf8 (hawk_uch_t uc, hawk_bch_t* utf8, hawk_oow_t size) +{ + __utf8_t* cur = get_utf8_slot (uc); + + if (cur == HAWK_NULL) return 0; /* illegal character */ + + if (utf8 && cur->length <= size) + { + int index = cur->length; + while (index > 1) + { + /* + * 0x3F: 00111111 + * 0x80: 10000000 + */ + utf8[--index] = (uc & 0x3F) | 0x80; + uc >>= 6; + } + + utf8[0] = uc | cur->fbyte; + } + + /* small buffer is also indicated by this return value + * greater than 'size'. */ + return (hawk_oow_t)cur->length; +} + +hawk_oow_t hawk_utf8_to_uc (const hawk_bch_t* utf8, hawk_oow_t size, hawk_uch_t* uc) +{ + __utf8_t* cur, * end; + + /*HAWK_ASSERT (hawk, utf8 != HAWK_NULL); + HAWK_ASSERT (hawk, size > 0); + HAWK_ASSERT (hawk, HAWK_SIZEOF(hawk_bch_t) == 1); + HAWK_ASSERT (hawk, HAWK_SIZEOF(hawk_uch_t) >= 2);*/ + + end = utf8_table + HAWK_COUNTOF(utf8_table); + cur = utf8_table; + + while (cur < end) + { + if ((utf8[0] & cur->mask) == cur->fbyte) + { + + /* if size is less that cur->length, the incomplete-seqeunce + * error is naturally indicated. so validate the string + * only if size is as large as cur->length. */ + + if (size >= cur->length) + { + int i; + + if (uc) + { + hawk_uch_t w; + + w = utf8[0] & cur->fmask; + for (i = 1; i < cur->length; i++) + { + /* in utf8, trailing bytes are all + * set with 0x80. + * + * 10XXXXXX & 11000000 => 10000000 + * + * if not, invalid. */ + if ((utf8[i] & 0xC0) != 0x80) return 0; + w = (w << 6) | (utf8[i] & 0x3F); + } + *uc = w; + } + else + { + for (i = 1; i < cur->length; i++) + { + /* in utf8, trailing bytes are all + * set with 0x80. + * + * 10XXXXXX & 11000000 => 10000000 + * + * if not, invalid. */ + if ((utf8[i] & 0xC0) != 0x80) return 0; + } + } + } + + /* this return value can indicate both + * the correct length (size >= cur->length) + * and + * the incomplete seqeunce error (size < cur->length). + */ + return (hawk_oow_t)cur->length; + } + cur++; + } + + return 0; /* error - invalid sequence */ +} diff --git a/hawk/lib/utl-sort.c b/hawk/lib/utl-sort.c new file mode 100644 index 00000000..17952e5c --- /dev/null +++ b/hawk/lib/utl-sort.c @@ -0,0 +1,480 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +#define qsort_min(a,b) (((a)<(b))? a: b) + +/* + * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function". + */ +#define swapcode(TYPE,parmi,parmj,n) do { \ + hawk_oow_t i = (n) / HAWK_SIZEOF (TYPE); \ + register TYPE *pi = (TYPE*)(parmi); \ + register TYPE *pj = (TYPE*)(parmj); \ + do { \ + register TYPE t = *pi; \ + *pi++ = *pj; \ + *pj++ = t; \ + } while (--i > 0); \ +} while(0) + + +#define get_swaptype(a, elemsize) (((hawk_oob_t*)(a) - (hawk_oob_t*)0) % HAWK_SIZEOF(long) || elemsize % HAWK_SIZEOF(long)? 2 : elemsize == HAWK_SIZEOF(long)? 0 : 1) + +#define swap(a, b, elemsize) do { \ + switch (swaptype) \ + { \ + case 0: \ + { \ + long t = *(long*)(a); \ + *(long*)(a) = *(long*)(b); \ + *(long*)(b) = t; \ + break; \ + } \ + case 1: \ + swapcode(long, a, b, elemsize); \ + break; \ + default: \ + swapcode(hawk_oob_t, a, b, elemsize); \ + break; \ + } \ +} while(0) + + +#define vecswap(a,b,n) do { \ + if ((n) > 0) \ + { \ + if (swaptype <= 1) swapcode(long, a, b, n); \ + else swapcode(hawk_oob_t, a, b, n); \ + } \ +} while(0) + +static HAWK_INLINE hawk_oob_t* med3 (hawk_oob_t* a, hawk_oob_t* b, hawk_oob_t* c, hawk_sort_comper_t comper, void* ctx) +{ + if (comper(a, b, ctx) < 0) + { + if (comper(b, c, ctx) < 0) return b; + return (comper(a, c, ctx) < 0)? c: a; + } + else + { + if (comper(b, c, ctx) > 0) return b; + return (comper(a, c, ctx) > 0)? c: a; + } +} + +static HAWK_INLINE hawk_oob_t* med3x (hawk_oob_t* a, hawk_oob_t* b, hawk_oob_t* c, hawk_sort_comperx_t comper, void* ctx) +{ + int n; + + if (comper(a, b, ctx, &n) <= -1) return HAWK_NULL; + if (n < 0) + { + if (comper(b, c, ctx, &n) <= -1) return HAWK_NULL; + if (n < 0) return b; + + if (comper(a, c, ctx, &n) <= -1) return HAWK_NULL; + return (n < 0)? c: a; + } + else + { + if (comper(b, c, ctx, &n) <= -1) return HAWK_NULL; + if (n > 0) return b; + if (comper(a, c, ctx, &n) <= -1) return HAWK_NULL; + return (n > 0)? c: a; + } +} + +void hawk_qsort (void* base, hawk_oow_t nmemb, hawk_oow_t size, hawk_sort_comper_t comper, void* ctx) +{ + hawk_oob_t* pa, * pb, * pc, * pd, * pl, * pm, * pn; + int swaptype, swap_cnt; + long r; + hawk_oow_t d; + register hawk_oob_t* a = (hawk_oob_t*)base; + +loop: + swaptype = get_swaptype(a, size); + + swap_cnt = 0; + if (nmemb < 7) + { + hawk_oob_t* end = (hawk_oob_t*)a + (nmemb * size); + for (pm = (hawk_oob_t*)a + size; pm < end; pm += size) + { + for (pl = pm; pl > (hawk_oob_t*)a && comper(pl - size, pl, ctx) > 0; pl -= size) + { + swap(pl, pl - size, size); + } + } + return; + } + pm = (hawk_oob_t*)a + (nmemb / 2) * size; + if (nmemb > 7) + { + pl = (hawk_oob_t*)a; + pn = (hawk_oob_t*)a + (nmemb - 1) * size; + if (nmemb > 40) + { + d = (nmemb / 8) * size; + pl = med3(pl, pl + d, pl + 2 * d, comper, ctx); + pm = med3(pm - d, pm, pm + d, comper, ctx); + pn = med3(pn - 2 * d, pn - d, pn, comper, ctx); + } + pm = med3(pl, pm, pn, comper, ctx); + } + swap(a, pm, size); + pa = pb = (hawk_oob_t*)a + size; + + pc = pd = (hawk_oob_t*)a + (nmemb - 1) * size; + for (;;) + { + while (pb <= pc && (r = comper(pb, a, ctx)) <= 0) + { + if (r == 0) + { + swap_cnt = 1; + swap(pa, pb, size); + pa += size; + } + pb += size; + } + while (pb <= pc && (r = comper(pc, a, ctx)) >= 0) + { + if (r == 0) + { + swap_cnt = 1; + swap(pc, pd, size); + pd -= size; + } + pc -= size; + } + if (pb > pc) break; + swap (pb, pc, size); + swap_cnt = 1; + pb += size; + pc -= size; + } + + if (swap_cnt == 0) + { + /* switch to insertion sort */ + for (pm = (hawk_oob_t*)a + size; + pm < (hawk_oob_t*)a + nmemb * size; pm += size) + { + for (pl = pm; pl > (hawk_oob_t*)a && comper(pl - size, pl, ctx) > 0; pl -= size) + { + swap(pl, pl - size, size); + } + } + return; + } + + pn = (hawk_oob_t*)a + nmemb * size; + r = qsort_min(pa - (hawk_oob_t*)a, pb - pa); + vecswap (a, pb - r, r); + r = qsort_min (pd - pc, pn - pd - size); + vecswap (pb, pn - r, r); + + if ((r = pb - pa) > size) hawk_qsort(a, r / size, size, comper, ctx); + + if ((r = pd - pc) > size) + { + /* Iterate rather than recurse to save stack space */ + a = pn - r; + nmemb = r / size; + goto loop; + } +/* qsort(pn - r, r / size, size, comper);*/ +} + +int hawk_qsortx (void* base, hawk_oow_t nmemb, hawk_oow_t size, hawk_sort_comperx_t comper, void* ctx) +{ + hawk_oob_t* pa, * pb, * pc, * pd, * pl, * pm, * pn; + int swaptype, swap_cnt; + long r; + int n; + hawk_oow_t d; + register hawk_oob_t* a = (hawk_oob_t*)base; + +loop: + swaptype = get_swaptype(a, size); + + swap_cnt = 0; + if (nmemb < 7) + { + hawk_oob_t* end = (hawk_oob_t*)a + (nmemb * size); + for (pm = (hawk_oob_t*)a + size; pm < end; pm += size) + { + pl = pm; + while (pl > (hawk_oob_t*)a) + { + hawk_oob_t* pl2 = pl - size; + if (comper(pl2, pl, ctx, &n) <= -1) return -1; + if (n <= 0) break; + swap (pl, pl2, size); + pl = pl2; + } + } + return 0; + } + pm = (hawk_oob_t*)a + (nmemb / 2) * size; + if (nmemb > 7) + { + pl = (hawk_oob_t*)a; + pn = (hawk_oob_t*)a + (nmemb - 1) * size; + if (nmemb > 40) + { + d = (nmemb / 8) * size; + pl = med3x(pl, pl + d, pl + 2 * d, comper, ctx); + if (!pl) return -1; + pm = med3x(pm - d, pm, pm + d, comper, ctx); + if (!pm) return -1; + pn = med3x(pn - 2 * d, pn - d, pn, comper, ctx); + if (!pn) return -1; + } + pm = med3x(pl, pm, pn, comper, ctx); + if (!pm) return -1; + } + swap(a, pm, size); + pa = pb = (hawk_oob_t*)a + size; + + pc = pd = (hawk_oob_t*)a + (nmemb - 1) * size; + for (;;) + { + while (pb <= pc) + { + if (comper(pb, a, ctx, &n) <= -1) return -1; + if (n > 0) break; + + if (n == 0) + { + swap_cnt = 1; + swap(pa, pb, size); + pa += size; + } + pb += size; + } + while (pb <= pc) + { + if (comper(pc, a, ctx, &n) <= -1) return -1; + if (n < 0) break; + + if (n == 0) + { + swap_cnt = 1; + swap(pc, pd, size); + pd -= size; + } + pc -= size; + } + if (pb > pc) break; + swap (pb, pc, size); + swap_cnt = 1; + pb += size; + pc -= size; + } + + if (swap_cnt == 0) + { + /* switch to insertion sort */ + hawk_oob_t* end = (hawk_oob_t*)a + (nmemb * size); + for (pm = (hawk_oob_t*)a + size; pm < end; pm += size) + { + pl = pm; + while (pl > (hawk_oob_t*)a) + { + if (comper(pl - size, pl, ctx, &n) <= -1) return -1; + if (n <= 0) break; + swap(pl, pl - size, size); + pl = pl - size; + } + } + return 0; + } + + pn = (hawk_oob_t*)a + nmemb * size; + r = qsort_min(pa - (hawk_oob_t*)a, pb - pa); + vecswap (a, pb - r, r); + r = qsort_min (pd - pc, pn - pd - size); + vecswap (pb, pn - r, r); + + if ((r = pb - pa) > size) + { + if (hawk_qsortx(a, r / size, size, comper, ctx) <= -1) return -1; + } + + if ((r = pd - pc) > size) + { + /* Iterate rather than recurse to save stack space */ + a = pn - r; + nmemb = r / size; + goto loop; + } +/* qsortx(pn - r, r / size, size, comper);*/ + + return 0; +} + +#if 0 + +/* + * Below is an example of a naive qsort implementation + */ + +#define swap(a,b,size) \ + do { \ + hawk_oow_t i = 0; \ + hawk_oob_t* p1 = (a); \ + hawk_oob_t* p2 = (b); \ + for (i = 0; i < size; i++) { \ + hawk_oob_t t = *p1; \ + *p1 = *p2; \ + *p2 = t; \ + p1++; p2++; \ + } \ + } while (0) + +#define REF(x,i) (&((x)[(i)*size])) + +void hawk_qsort (void* base, hawk_oow_t nmemb, hawk_oow_t size, void* arg, + int (*compar)(const void*, const void*, void*)) +{ + hawk_oow_t pivot, start, end; + hawk_oob_t* p = (hawk_oob_t*)base; + + if (nmemb <= 1) return; + if (nmemb == 2) { + if (compar(REF(p,0), REF(p,1), arg) > 0) + swap (REF(p,0), REF(p,1), size); + return; + } + + pivot = nmemb >> 1; /* choose the middle as the pivot index */ + swap (REF(p,pivot), REF(p,nmemb-1), size); /* swap the pivot with the last item */ + + start = 0; end = nmemb - 2; + + while (1) { + /* look for the larger value than pivot */ + while (start <= end && + compar(REF(p,start), REF(p,nmemb-1), arg) <= 0) start++; + + /* look for the less value than pivot. */ + while (end > start && + compar(REF(p,end), REF(p,nmemb-1), arg) >= 0) end--; + + if (start >= end) break; /* no more to swap */ + swap (REF(p,start), REF(p,end), size); + start++; end--; + } + + swap (REF(p,nmemb-1), REF(p,start), size); + pivot = start; /* adjust the pivot index */ + + hawk_qsort (REF(p,0), pivot, size, arg, compar); + hawk_qsort (REF(p,pivot+1), nmemb - pivot - 1, size, arg, compar); +} + +/* + * For easier understanding, see the following + */ + +#define swap(a, b) do { a ^= b; b ^= a; a ^= b; } while (0) + +void qsort (int* x, size_t n) +{ + size_t index, start, end; + int pivot; + + if (n <= 1) return; + if (n == 2) { + if (x[0] > x[1]) swap (x[0], x[1]); + return; + } + + index = n / 2; /* choose the middle as the pivot index */ + pivot = x[index]; /* store the pivot value */ + swap (x[index], x[n - 1]); /* swap the pivot with the last item */ + + start = 0; end = n - 2; + while (1) { + /* look for the larger value than pivot */ + while (start <= end && x[start] <= pivot) start++; + + /* look for the less value than pivot. */ + while (end > start && x[end] >= pivot) end--; + + if (start >= end) { + /* less values all on the left, + * larger values all on the right + */ + break; + } + + swap (x[start], x[end]); + start++; end--; + } + + x[n - 1] = x[start]; /* restore the pivot value */ + x[start] = pivot; + index = start; /* adjust the pivot index */ + + qsort (x, index); + qsort (&x[index + 1], n - index - 1); +} + +#endif diff --git a/hawk/lib/utl-str.c b/hawk/lib/utl-str.c new file mode 100644 index 00000000..9d881203 --- /dev/null +++ b/hawk/lib/utl-str.c @@ -0,0 +1,2008 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include + +/* some naming conventions + * bchars, uchars -> pointer and length + * bcstr, ucstr -> null-terminated string pointer + * btouchars -> bchars to uchars + * utobchars -> uchars to bchars + * btoucstr -> bcstr to ucstr + * utobcstr -> ucstr to bcstr + */ + +int hawk_equal_uchars (const hawk_uch_t* str1, const hawk_uch_t* str2, hawk_oow_t len) +{ + hawk_oow_t i; + + /* [NOTE] you should call this function after having ensured that + * str1 and str2 are in the same length */ + + for (i = 0; i < len; i++) + { + if (str1[i] != str2[i]) return 0; + } + + return 1; +} + +int hawk_equal_bchars (const hawk_bch_t* str1, const hawk_bch_t* str2, hawk_oow_t len) +{ + hawk_oow_t i; + + /* [NOTE] you should call this function after having ensured that + * str1 and str2 are in the same length */ + + for (i = 0; i < len; i++) + { + if (str1[i] != str2[i]) return 0; + } + + return 1; +} + +int hawk_comp_uchars (const hawk_uch_t* str1, hawk_oow_t len1, const hawk_uch_t* str2, hawk_oow_t len2, int ignorecase) +{ + hawk_uchu_t c1, c2; + const hawk_uch_t* end1 = str1 + len1; + const hawk_uch_t* end2 = str2 + len2; + + if (ignorecase) + { + while (str1 < end1) + { + c1 = hawk_to_uch_lower(*str1); + if (str2 < end2) + { + c2 = hawk_to_uch_lower(*str2); + if (c1 > c2) return 1; + if (c1 < c2) return -1; + } + else return 1; + str1++; str2++; + } + } + else + { + while (str1 < end1) + { + c1 = *str1; + if (str2 < end2) + { + c2 = *str2; + if (c1 > c2) return 1; + if (c1 < c2) return -1; + } + else return 1; + str1++; str2++; + } + } + + return (str2 < end2)? -1: 0; +} + +int hawk_comp_bchars (const hawk_bch_t* str1, hawk_oow_t len1, const hawk_bch_t* str2, hawk_oow_t len2, int ignorecase) +{ + hawk_bchu_t c1, c2; + const hawk_bch_t* end1 = str1 + len1; + const hawk_bch_t* end2 = str2 + len2; + + if (ignorecase) + { + while (str1 < end1) + { + c1 = hawk_to_bch_lower(*str1); + if (str2 < end2) + { + c2 = hawk_to_bch_lower(*str2); + if (c1 > c2) return 1; + if (c1 < c2) return -1; + } + else return 1; + str1++; str2++; + } + } + else + { + while (str1 < end1) + { + c1 = *str1; + if (str2 < end2) + { + c2 = *str2; + if (c1 > c2) return 1; + if (c1 < c2) return -1; + } + else return 1; + str1++; str2++; + } + } + + return (str2 < end2)? -1: 0; +} + +int hawk_comp_ucstr (const hawk_uch_t* str1, const hawk_uch_t* str2, int ignorecase) +{ + if (ignorecase) + { + while (hawk_to_uch_lower(*str1) == hawk_to_uch_lower(*str2)) + { + if (*str1 == '\0') return 0; + str1++; str2++; + } + + return ((hawk_uchu_t)hawk_to_uch_lower(*str1) > (hawk_uchu_t)hawk_to_uch_lower(*str2))? 1: -1; + } + else + { + while (*str1 == *str2) + { + if (*str1 == '\0') return 0; + str1++; str2++; + } + + return ((hawk_uchu_t)*str1 > (hawk_uchu_t)*str2)? 1: -1; + } +} + +int hawk_comp_bcstr (const hawk_bch_t* str1, const hawk_bch_t* str2, int ignorecase) +{ + if (ignorecase) + { + while (hawk_to_bch_lower(*str1) == hawk_to_bch_lower(*str2)) + { + if (*str1 == '\0') return 0; + str1++; str2++; + } + + return ((hawk_bchu_t)hawk_to_bch_lower(*str1) > (hawk_bchu_t)hawk_to_bch_lower(*str2))? 1: -1; + } + else + { + while (*str1 == *str2) + { + if (*str1 == '\0') return 0; + str1++; str2++; + } + + return ((hawk_bchu_t)*str1 > (hawk_bchu_t)*str2)? 1: -1; + } + +} + +int hawk_comp_ucstr_limited (const hawk_uch_t* str1, const hawk_uch_t* str2, hawk_oow_t maxlen) +{ + if (maxlen == 0) return 0; + + while (*str1 == *str2) + { + if (*str1 == '\0' || maxlen == 1) return 0; + str1++; str2++; maxlen--; + } + + return ((hawk_uchu_t)*str1 > (hawk_uchu_t)*str2)? 1: -1; +} + +int hawk_comp_bcstr_limited (const hawk_bch_t* str1, const hawk_bch_t* str2, hawk_oow_t maxlen) +{ + if (maxlen == 0) return 0; + + while (*str1 == *str2) + { + if (*str1 == '\0' || maxlen == 1) return 0; + str1++; str2++; maxlen--; + } + + return ((hawk_bchu_t)*str1 > (hawk_bchu_t)*str2)? 1: -1; +} + +int hawk_comp_ucstr_bcstr (const hawk_uch_t* str1, const hawk_bch_t* str2) +{ + while (*str1 == *str2) + { + if (*str1 == '\0') return 0; + str1++; str2++; + } + + return ((hawk_uchu_t)*str1 > (hawk_bchu_t)*str2)? 1: -1; +} + +int hawk_comp_uchars_ucstr (const hawk_uch_t* str1, hawk_oow_t len, const hawk_uch_t* str2) +{ + /* for "abc\0" of length 4 vs "abc", the fourth character + * of the first string is equal to the terminating null of + * the second string. the first string is still considered + * bigger */ + const hawk_uch_t* end = str1 + len; + while (str1 < end && *str2 != '\0') + { + if (*str1 != *str2) return ((hawk_uchu_t)*str1 > (hawk_uchu_t)*str2)? 1: -1; + str1++; str2++; + } + return (str1 < end)? 1: (*str2 == '\0'? 0: -1); +} + +int hawk_comp_uchars_bcstr (const hawk_uch_t* str1, hawk_oow_t len, const hawk_bch_t* str2) +{ + const hawk_uch_t* end = str1 + len; + while (str1 < end && *str2 != '\0') + { + if (*str1 != *str2) return ((hawk_uchu_t)*str1 > (hawk_bchu_t)*str2)? 1: -1; + str1++; str2++; + } + return (str1 < end)? 1: (*str2 == '\0'? 0: -1); +} + +int hawk_comp_bchars_bcstr (const hawk_bch_t* str1, hawk_oow_t len, const hawk_bch_t* str2) +{ + const hawk_bch_t* end = str1 + len; + while (str1 < end && *str2 != '\0') + { + if (*str1 != *str2) return ((hawk_bchu_t)*str1 > (hawk_bchu_t)*str2)? 1: -1; + str1++; str2++; + } + return (str1 < end)? 1: (*str2 == '\0'? 0: -1); +} + +int hawk_comp_bchars_ucstr (const hawk_bch_t* str1, hawk_oow_t len, const hawk_uch_t* str2) +{ + const hawk_bch_t* end = str1 + len; + while (str1 < end && *str2 != '\0') + { + if (*str1 != *str2) return ((hawk_bchu_t)*str1 > (hawk_uchu_t)*str2)? 1: -1; + str1++; str2++; + } + return (str1 < end)? 1: (*str2 == '\0'? 0: -1); +} + +/* ----------------------------------------------------------------------- */ + +void hawk_copy_uchars (hawk_uch_t* dst, const hawk_uch_t* src, hawk_oow_t len) +{ + /* take note of no forced null termination */ + hawk_oow_t i; + for (i = 0; i < len; i++) dst[i] = src[i]; +} + +void hawk_copy_bchars (hawk_bch_t* dst, const hawk_bch_t* src, hawk_oow_t len) +{ + /* take note of no forced null termination */ + hawk_oow_t i; + for (i = 0; i < len; i++) dst[i] = src[i]; +} + +void hawk_copy_bchars_to_uchars (hawk_uch_t* dst, const hawk_bch_t* src, hawk_oow_t len) +{ + /* copy without conversions. + * use hawk_convbtouchars() for conversion encoding */ + hawk_oow_t i; + for (i = 0; i < len; i++) dst[i] = src[i]; +} + +void hawk_copy_uchars_to_bchars (hawk_bch_t* dst, const hawk_uch_t* src, hawk_oow_t len) +{ + /* copy without conversions. + * use hawk_convutobchars() for conversion encoding */ + hawk_oow_t i; + for (i = 0; i < len; i++) dst[i] = src[i]; +} + +hawk_oow_t hawk_copy_uchars_to_ucstr (hawk_uch_t* dst, hawk_uch_t dlen, const hawk_uch_t* src, hawk_oow_t slen) +{ + hawk_oow_t i; + if (dlen <= 0) return 0; + if (dlen <= slen) slen = dlen - 1; + for (i = 0; i < slen; i++) dst[i] = src[i]; + dst[i] = '\0'; + return i; +} + +hawk_oow_t hawk_copy_bchars_to_bcstr (hawk_bch_t* dst, hawk_bch_t dlen, const hawk_bch_t* src, hawk_oow_t slen) +{ + hawk_oow_t i; + if (dlen <= 0) return 0; + if (dlen <= slen) slen = dlen - 1; + for (i = 0; i < slen; i++) dst[i] = src[i]; + dst[i] = '\0'; + return i; +} + +hawk_oow_t hawk_copy_uchars_to_ucstr_unlimited (hawk_uch_t* dst, const hawk_uch_t* src, hawk_oow_t len) +{ + hawk_oow_t i; + for (i = 0; i < len; i++) dst[i] = src[i]; + dst[i] = '\0'; + return i; +} + +hawk_oow_t hawk_copy_bchars_to_bcstr_unlimited (hawk_bch_t* dst, const hawk_bch_t* src, hawk_oow_t len) +{ + hawk_oow_t i; + for (i = 0; i < len; i++) dst[i] = src[i]; + dst[i] = '\0'; + return i; +} + +hawk_oow_t hawk_copy_ucstr (hawk_uch_t* dst, hawk_oow_t len, const hawk_uch_t* src) +{ + hawk_uch_t* p, * p2; + + p = dst; p2 = dst + len - 1; + + while (p < p2) + { + if (*src == '\0') break; + *p++ = *src++; + } + + if (len > 0) *p = '\0'; + return p - dst; +} + +hawk_oow_t hawk_copy_bcstr (hawk_bch_t* dst, hawk_oow_t len, const hawk_bch_t* src) +{ + hawk_bch_t* p, * p2; + + p = dst; p2 = dst + len - 1; + + while (p < p2) + { + if (*src == '\0') break; + *p++ = *src++; + } + + if (len > 0) *p = '\0'; + return p - dst; +} + + +hawk_oow_t hawk_copy_ucstr_unlimited (hawk_uch_t* dst, const hawk_uch_t* src) +{ + hawk_uch_t* org = dst; + while ((*dst++ = *src++) != '\0'); + return dst - org - 1; +} + +hawk_oow_t hawk_copy_bcstr_unlimited (hawk_bch_t* dst, const hawk_bch_t* src) +{ + hawk_bch_t* org = dst; + while ((*dst++ = *src++) != '\0'); + return dst - org - 1; +} + +/* ----------------------------------------------------------------------- */ + +hawk_oow_t hawk_count_ucstr (const hawk_uch_t* str) +{ + const hawk_uch_t* ptr = str; + while (*ptr != '\0') ptr++; + return ptr - str; +} + +hawk_oow_t hawk_count_ucstr_limited (const hawk_uch_t* str, hawk_oow_t maxlen) +{ + hawk_oow_t i; + for (i = 0; i < maxlen; i++) + { + if (str[i] == '\0') break; + } + return i; +} + +hawk_oow_t hawk_count_bcstr (const hawk_bch_t* str) +{ + const hawk_bch_t* ptr = str; + while (*ptr != '\0') ptr++; + return ptr - str; +} + +hawk_oow_t hawk_count_bcstr_limited (const hawk_bch_t* str, hawk_oow_t maxlen) +{ + hawk_oow_t i; + for (i = 0; i < maxlen; i++) + { + if (str[i] == '\0') break; + } + return i; +} + +/* ----------------------------------------------------------------------- */ + +void hawk_fill_uchars (hawk_uch_t* dst, hawk_uch_t ch, hawk_oow_t len) +{ + hawk_oow_t i; + for (i = 0; i < len; i++) dst[i] = ch; +} + +void hawk_fill_bchars (hawk_bch_t* dst, hawk_bch_t ch, hawk_oow_t len) +{ + hawk_oow_t i; + for (i = 0; i < len; i++) dst[i] = ch; +} + + +/* ----------------------------------------------------------------------- */ + +hawk_uch_t* hawk_find_uchar (const hawk_uch_t* ptr, hawk_oow_t len, hawk_uch_t c) +{ + const hawk_uch_t* end; + + end = ptr + len; + while (ptr < end) + { + if (*ptr == c) return (hawk_uch_t*)ptr; + ptr++; + } + + return HAWK_NULL; +} + +hawk_bch_t* hawk_find_bchar (const hawk_bch_t* ptr, hawk_oow_t len, hawk_bch_t c) +{ + const hawk_bch_t* end; + + end = ptr + len; + while (ptr < end) + { + if (*ptr == c) return (hawk_bch_t*)ptr; + ptr++; + } + + return HAWK_NULL; +} + +hawk_uch_t* hawk_rfind_uchar (const hawk_uch_t* ptr, hawk_oow_t len, hawk_uch_t c) +{ + const hawk_uch_t* cur; + + cur = ptr + len; + while (cur > ptr) + { + --cur; + if (*cur == c) return (hawk_uch_t*)cur; + } + + return HAWK_NULL; +} + +hawk_bch_t* hawk_rfind_bchar (const hawk_bch_t* ptr, hawk_oow_t len, hawk_bch_t c) +{ + const hawk_bch_t* cur; + + cur = ptr + len; + while (cur > ptr) + { + --cur; + if (*cur == c) return (hawk_bch_t*)cur; + } + + return HAWK_NULL; +} + +hawk_uch_t* hawk_find_uchar_in_ucstr (const hawk_uch_t* ptr, hawk_uch_t c) +{ + while (*ptr != '\0') + { + if (*ptr == c) return (hawk_uch_t*)ptr; + ptr++; + } + + return HAWK_NULL; +} + +hawk_bch_t* hawk_find_bchar_in_bcstr (const hawk_bch_t* ptr, hawk_bch_t c) +{ + while (*ptr != '\0') + { + if (*ptr == c) return (hawk_bch_t*)ptr; + ptr++; + } + + return HAWK_NULL; +} +/* ----------------------------------------------------------------------- */ + +hawk_uch_t* hawk_find_uchars_in_uchars (const hawk_uch_t* str, hawk_oow_t strsz, const hawk_uch_t* sub, hawk_oow_t subsz, int ignorecase) +{ + const hawk_uch_t* end, * subp; + + if (subsz == 0) return (hawk_uch_t*)str; + if (strsz < subsz) return HAWK_NULL; + + end = str + strsz - subsz; + subp = sub + subsz; + + if (HAWK_UNLIKELY(ignorecase)) + { + while (str <= end) + { + const hawk_uch_t* x = str; + const hawk_uch_t* y = sub; + + while (1) + { + if (y >= subp) return (hawk_uch_t*)str; + if (hawk_to_uch_lower(*x) != hawk_to_uch_lower(*y)) break; + x++; y++; + } + + str++; + } + } + else + { + while (str <= end) + { + const hawk_uch_t* x = str; + const hawk_uch_t* y = sub; + + while (1) + { + if (y >= subp) return (hawk_uch_t*)str; + if (*x != *y) break; + x++; y++; + } + + str++; + } + } + + return HAWK_NULL; +} + +hawk_bch_t* hawk_find_bchars_in_bchars (const hawk_bch_t* str, hawk_oow_t strsz, const hawk_bch_t* sub, hawk_oow_t subsz, int ignorecase) +{ + const hawk_bch_t* end, * subp; + + if (subsz == 0) return (hawk_bch_t*)str; + if (strsz < subsz) return HAWK_NULL; + + end = str + strsz - subsz; + subp = sub + subsz; + + if (HAWK_UNLIKELY(ignorecase)) + { + while (str <= end) + { + const hawk_bch_t* x = str; + const hawk_bch_t* y = sub; + + while (1) + { + if (y >= subp) return (hawk_bch_t*)str; + if (hawk_to_bch_lower(*x) != hawk_to_bch_lower(*y)) break; + x++; y++; + } + + str++; + } + } + else + { + while (str <= end) + { + const hawk_bch_t* x = str; + const hawk_bch_t* y = sub; + + while (1) + { + if (y >= subp) return (hawk_bch_t*)str; + if (*x != *y) break; + x++; y++; + } + + str++; + } + } + + return HAWK_NULL; +} + +hawk_uch_t* hawk_rfind_uchars_in_uchars (const hawk_uch_t* str, hawk_oow_t strsz, const hawk_uch_t* sub, hawk_oow_t subsz, int ignorecase) +{ + const hawk_uch_t* p = str + strsz; + const hawk_uch_t* subp = sub + subsz; + + if (subsz == 0) return (hawk_uch_t*)p; + if (strsz < subsz) return HAWK_NULL; + + p = p - subsz; + + if (HAWK_UNLIKELY(ignorecase)) + { + while (p >= str) + { + const hawk_uch_t* x = p; + const hawk_uch_t* y = sub; + + while (1) + { + if (y >= subp) return (hawk_uch_t*)p; + if (hawk_to_uch_lower(*x) != hawk_to_uch_lower(*y)) break; + x++; y++; + } + + p--; + } + } + else + { + while (p >= str) + { + const hawk_uch_t* x = p; + const hawk_uch_t* y = sub; + + while (1) + { + if (y >= subp) return (hawk_uch_t*)p; + if (*x != *y) break; + x++; y++; + } + + p--; + } + } + + return HAWK_NULL; +} + +hawk_bch_t* hawk_rfind_bchars_in_bchars (const hawk_bch_t* str, hawk_oow_t strsz, const hawk_bch_t* sub, hawk_oow_t subsz, int ignorecase) +{ + const hawk_bch_t* p = str + strsz; + const hawk_bch_t* subp = sub + subsz; + + if (subsz == 0) return (hawk_bch_t*)p; + if (strsz < subsz) return HAWK_NULL; + + p = p - subsz; + + if (HAWK_UNLIKELY(ignorecase)) + { + while (p >= str) + { + const hawk_bch_t* x = p; + const hawk_bch_t* y = sub; + + while (1) + { + if (y >= subp) return (hawk_bch_t*)p; + if (hawk_to_bch_lower(*x) != hawk_to_bch_lower(*y)) break; + x++; y++; + } + + p--; + } + } + else + { + while (p >= str) + { + const hawk_bch_t* x = p; + const hawk_bch_t* y = sub; + + while (1) + { + if (y >= subp) return (hawk_bch_t*)p; + if (*x != *y) break; + x++; y++; + } + + p--; + } + } + + return HAWK_NULL; +} + +/* ----------------------------------------------------------------------- */ + +hawk_oow_t hawk_compact_uchars (hawk_uch_t* str, hawk_oow_t len) +{ + hawk_uch_t* p = str, * q = str, * end = str + len; + int followed_by_space = 0; + int state = 0; + + while (p < end) + { + if (state == 0) + { + if (!hawk_is_uch_space(*p)) + { + *q++ = *p; + state = 1; + } + } + else if (state == 1) + { + if (hawk_is_uch_space(*p)) + { + if (!followed_by_space) + { + followed_by_space = 1; + *q++ = *p; + } + } + else + { + followed_by_space = 0; + *q++ = *p; + } + } + + p++; + } + + return (followed_by_space) ? (q - str -1): (q - str); +} + +hawk_oow_t hawk_compact_bchars (hawk_bch_t* str, hawk_oow_t len) +{ + hawk_bch_t* p = str, * q = str, * end = str + len; + int followed_by_space = 0; + int state = 0; + + while (p < end) + { + if (state == 0) + { + if (!hawk_is_bch_space(*p)) + { + *q++ = *p; + state = 1; + } + } + else if (state == 1) + { + if (hawk_is_bch_space(*p)) + { + if (!followed_by_space) + { + followed_by_space = 1; + *q++ = *p; + } + } + else + { + followed_by_space = 0; + *q++ = *p; + } + } + + p++; + } + + return (followed_by_space) ? (q - str -1): (q - str); +} + +/* ----------------------------------------------------------------------- */ + +hawk_oow_t hawk_rotate_uchars (hawk_uch_t* str, hawk_oow_t len, int dir, hawk_oow_t n) +{ + hawk_oow_t first, last, count, index, nk; + hawk_uch_t c; + + if (dir == 0 || len == 0) return len; + if ((n %= len) == 0) return len; + + if (dir > 0) n = len - n; + first = 0; nk = len - n; count = 0; + + while (count < n) + { + last = first + nk; + index = first; + c = str[first]; + do + { + count++; + while (index < nk) + { + str[index] = str[index + n]; + index += n; + } + if (index == last) break; + str[index] = str[index - nk]; + index -= nk; + } + while (1); + str[last] = c; first++; + } + return len; +} + +hawk_oow_t hawk_rotate_bchars (hawk_bch_t* str, hawk_oow_t len, int dir, hawk_oow_t n) +{ + hawk_oow_t first, last, count, index, nk; + hawk_bch_t c; + + if (dir == 0 || len == 0) return len; + if ((n %= len) == 0) return len; + + if (dir > 0) n = len - n; + first = 0; nk = len - n; count = 0; + + while (count < n) + { + last = first + nk; + index = first; + c = str[first]; + do + { + count++; + while (index < nk) + { + str[index] = str[index + n]; + index += n; + } + if (index == last) break; + str[index] = str[index - nk]; + index -= nk; + } + while (1); + str[last] = c; first++; + } + return len; +} + +/* ----------------------------------------------------------------------- */ + +hawk_uch_t* hawk_trim_uchars (hawk_uch_t* str, hawk_oow_t* len, int flags) +{ + hawk_uch_t* p = str, * end = str + *len; + + if (p < end) + { + hawk_uch_t* s = HAWK_NULL, * e = HAWK_NULL; + + do + { + if (!hawk_is_uch_space(*p)) + { + if (s == HAWK_NULL) s = p; + e = p; + } + p++; + } + while (p < end); + + if (e) + { + if (flags & HAWK_TRIM_UCHARS_RIGHT) + { + *len -= end - e - 1; + } + if (flags & HAWK_TRIM_UCHARS_LEFT) + { + *len -= s - str; + str = s; + } + } + else + { + /* the entire string need to be deleted */ + if ((flags & HAWK_TRIM_UCHARS_RIGHT) || + (flags & HAWK_TRIM_UCHARS_LEFT)) *len = 0; + } + } + + return str; +} + +hawk_bch_t* hawk_trim_bchars (hawk_bch_t* str, hawk_oow_t* len, int flags) +{ + hawk_bch_t* p = str, * end = str + *len; + + if (p < end) + { + hawk_bch_t* s = HAWK_NULL, * e = HAWK_NULL; + + do + { + if (!hawk_is_bch_space(*p)) + { + if (s == HAWK_NULL) s = p; + e = p; + } + p++; + } + while (p < end); + + if (e) + { + if (flags & HAWK_TRIM_BCHARS_RIGHT) + { + *len -= end - e - 1; + } + if (flags & HAWK_TRIM_BCHARS_LEFT) + { + *len -= s - str; + str = s; + } + } + else + { + /* the entire string need to be deleted */ + if ((flags & HAWK_TRIM_BCHARS_RIGHT) || + (flags & HAWK_TRIM_BCHARS_LEFT)) *len = 0; + } + } + + return str; +} +/* ----------------------------------------------------------------------- */ + +int hawk_split_ucstr (hawk_uch_t* s, const hawk_uch_t* delim, hawk_uch_t lquote, hawk_uch_t rquote, hawk_uch_t escape) +{ + hawk_uch_t* p = s, *d; + hawk_uch_t* sp = HAWK_NULL, * ep = HAWK_NULL; + int delim_mode; + int cnt = 0; + + if (delim == HAWK_NULL) delim_mode = 0; + else + { + delim_mode = 1; + for (d = (hawk_uch_t*)delim; *d != HAWK_UT('\0'); d++) + if (!hawk_is_uch_space(*d)) delim_mode = 2; + } + + if (delim_mode == 0) + { + /* skip preceding space characters */ + while (hawk_is_uch_space(*p)) p++; + + /* when 0 is given as "delim", it has an effect of cutting + preceding and trailing space characters off "s". */ + if (lquote != HAWK_UT('\0') && *p == lquote) + { + hawk_copy_ucstr_unlimited (p, p + 1); + + for (;;) + { + if (*p == HAWK_UT('\0')) return -1; + + if (escape != HAWK_UT('\0') && *p == escape) + { + hawk_copy_ucstr_unlimited (p, p + 1); + } + else + { + if (*p == rquote) + { + p++; + break; + } + } + + if (sp == 0) sp = p; + ep = p; + p++; + } + while (hawk_is_uch_space(*p)) p++; + if (*p != HAWK_UT('\0')) return -1; + + if (sp == 0 && ep == 0) s[0] = HAWK_UT('\0'); + else + { + ep[1] = HAWK_UT('\0'); + if (s != (hawk_uch_t*)sp) hawk_copy_ucstr_unlimited (s, sp); + cnt++; + } + } + else + { + while (*p) + { + if (!hawk_is_uch_space(*p)) + { + if (sp == 0) sp = p; + ep = p; + } + p++; + } + + if (sp == 0 && ep == 0) s[0] = HAWK_UT('\0'); + else + { + ep[1] = HAWK_UT('\0'); + if (s != (hawk_uch_t*)sp) hawk_copy_ucstr_unlimited (s, sp); + cnt++; + } + } + } + else if (delim_mode == 1) + { + hawk_uch_t* o; + + while (*p) + { + o = p; + while (hawk_is_uch_space(*p)) p++; + if (o != p) { hawk_copy_ucstr_unlimited (o, p); p = o; } + + if (lquote != HAWK_UT('\0') && *p == lquote) + { + hawk_copy_ucstr_unlimited (p, p + 1); + + for (;;) + { + if (*p == HAWK_UT('\0')) return -1; + + if (escape != HAWK_UT('\0') && *p == escape) + { + hawk_copy_ucstr_unlimited (p, p + 1); + } + else + { + if (*p == rquote) + { + *p++ = HAWK_UT('\0'); + cnt++; + break; + } + } + p++; + } + } + else + { + o = p; + for (;;) + { + if (*p == HAWK_UT('\0')) + { + if (o != p) cnt++; + break; + } + if (hawk_is_uch_space (*p)) + { + *p++ = HAWK_UT('\0'); + cnt++; + break; + } + p++; + } + } + } + } + else /* if (delim_mode == 2) */ + { + hawk_uch_t* o; + int ok; + + while (*p != HAWK_UT('\0')) + { + o = p; + while (hawk_is_uch_space(*p)) p++; + if (o != p) { hawk_copy_ucstr_unlimited (o, p); p = o; } + + if (lquote != HAWK_UT('\0') && *p == lquote) + { + hawk_copy_ucstr_unlimited (p, p + 1); + + for (;;) + { + if (*p == HAWK_UT('\0')) return -1; + + if (escape != HAWK_UT('\0') && *p == escape) + { + hawk_copy_ucstr_unlimited (p, p + 1); + } + else + { + if (*p == rquote) + { + *p++ = HAWK_UT('\0'); + cnt++; + break; + } + } + p++; + } + + ok = 0; + while (hawk_is_uch_space(*p)) p++; + if (*p == HAWK_UT('\0')) ok = 1; + for (d = (hawk_uch_t*)delim; *d != HAWK_UT('\0'); d++) + { + if (*p == *d) + { + ok = 1; + hawk_copy_ucstr_unlimited (p, p + 1); + break; + } + } + if (ok == 0) return -1; + } + else + { + o = p; sp = ep = 0; + + for (;;) + { + if (*p == HAWK_UT('\0')) + { + if (ep) + { + ep[1] = HAWK_UT('\0'); + p = &ep[1]; + } + cnt++; + break; + } + for (d = (hawk_uch_t*)delim; *d != HAWK_UT('\0'); d++) + { + if (*p == *d) + { + if (sp == HAWK_NULL) + { + hawk_copy_ucstr_unlimited (o, p); p = o; + *p++ = HAWK_UT('\0'); + } + else + { + hawk_copy_ucstr_unlimited (&ep[1], p); + hawk_copy_ucstr_unlimited (o, sp); + o[ep - sp + 1] = HAWK_UT('\0'); + p = &o[ep - sp + 2]; + } + cnt++; + /* last empty field after delim */ + if (*p == HAWK_UT('\0')) cnt++; + goto exit_point; + } + } + + if (!hawk_is_uch_space (*p)) + { + if (sp == HAWK_NULL) sp = p; + ep = p; + } + p++; + } +exit_point: + ; + } + } + } + + return cnt; +} + +int hawk_split_bcstr (hawk_bch_t* s, const hawk_bch_t* delim, hawk_bch_t lquote, hawk_bch_t rquote, hawk_bch_t escape) +{ + hawk_bch_t* p = s, *d; + hawk_bch_t* sp = HAWK_NULL, * ep = HAWK_NULL; + int delim_mode; + int cnt = 0; + + if (delim == HAWK_NULL) delim_mode = 0; + else + { + delim_mode = 1; + for (d = (hawk_bch_t*)delim; *d != HAWK_BT('\0'); d++) + if (!hawk_is_bch_space(*d)) delim_mode = 2; + } + + if (delim_mode == 0) + { + /* skip preceding space characters */ + while (hawk_is_bch_space(*p)) p++; + + /* when 0 is given as "delim", it has an effect of cutting + preceding and trailing space characters off "s". */ + if (lquote != HAWK_BT('\0') && *p == lquote) + { + hawk_copy_bcstr_unlimited (p, p + 1); + + for (;;) + { + if (*p == HAWK_BT('\0')) return -1; + + if (escape != HAWK_BT('\0') && *p == escape) + { + hawk_copy_bcstr_unlimited (p, p + 1); + } + else + { + if (*p == rquote) + { + p++; + break; + } + } + + if (sp == 0) sp = p; + ep = p; + p++; + } + while (hawk_is_bch_space(*p)) p++; + if (*p != HAWK_BT('\0')) return -1; + + if (sp == 0 && ep == 0) s[0] = HAWK_BT('\0'); + else + { + ep[1] = HAWK_BT('\0'); + if (s != (hawk_bch_t*)sp) hawk_copy_bcstr_unlimited (s, sp); + cnt++; + } + } + else + { + while (*p) + { + if (!hawk_is_bch_space(*p)) + { + if (sp == 0) sp = p; + ep = p; + } + p++; + } + + if (sp == 0 && ep == 0) s[0] = HAWK_BT('\0'); + else + { + ep[1] = HAWK_BT('\0'); + if (s != (hawk_bch_t*)sp) hawk_copy_bcstr_unlimited (s, sp); + cnt++; + } + } + } + else if (delim_mode == 1) + { + hawk_bch_t* o; + + while (*p) + { + o = p; + while (hawk_is_bch_space(*p)) p++; + if (o != p) { hawk_copy_bcstr_unlimited (o, p); p = o; } + + if (lquote != HAWK_BT('\0') && *p == lquote) + { + hawk_copy_bcstr_unlimited (p, p + 1); + + for (;;) + { + if (*p == HAWK_BT('\0')) return -1; + + if (escape != HAWK_BT('\0') && *p == escape) + { + hawk_copy_bcstr_unlimited (p, p + 1); + } + else + { + if (*p == rquote) + { + *p++ = HAWK_BT('\0'); + cnt++; + break; + } + } + p++; + } + } + else + { + o = p; + for (;;) + { + if (*p == HAWK_BT('\0')) + { + if (o != p) cnt++; + break; + } + if (hawk_is_bch_space (*p)) + { + *p++ = HAWK_BT('\0'); + cnt++; + break; + } + p++; + } + } + } + } + else /* if (delim_mode == 2) */ + { + hawk_bch_t* o; + int ok; + + while (*p != HAWK_BT('\0')) + { + o = p; + while (hawk_is_bch_space(*p)) p++; + if (o != p) { hawk_copy_bcstr_unlimited (o, p); p = o; } + + if (lquote != HAWK_BT('\0') && *p == lquote) + { + hawk_copy_bcstr_unlimited (p, p + 1); + + for (;;) + { + if (*p == HAWK_BT('\0')) return -1; + + if (escape != HAWK_BT('\0') && *p == escape) + { + hawk_copy_bcstr_unlimited (p, p + 1); + } + else + { + if (*p == rquote) + { + *p++ = HAWK_BT('\0'); + cnt++; + break; + } + } + p++; + } + + ok = 0; + while (hawk_is_bch_space(*p)) p++; + if (*p == HAWK_BT('\0')) ok = 1; + for (d = (hawk_bch_t*)delim; *d != HAWK_BT('\0'); d++) + { + if (*p == *d) + { + ok = 1; + hawk_copy_bcstr_unlimited (p, p + 1); + break; + } + } + if (ok == 0) return -1; + } + else + { + o = p; sp = ep = 0; + + for (;;) + { + if (*p == HAWK_BT('\0')) + { + if (ep) + { + ep[1] = HAWK_BT('\0'); + p = &ep[1]; + } + cnt++; + break; + } + for (d = (hawk_bch_t*)delim; *d != HAWK_BT('\0'); d++) + { + if (*p == *d) + { + if (sp == HAWK_NULL) + { + hawk_copy_bcstr_unlimited (o, p); p = o; + *p++ = HAWK_BT('\0'); + } + else + { + hawk_copy_bcstr_unlimited (&ep[1], p); + hawk_copy_bcstr_unlimited (o, sp); + o[ep - sp + 1] = HAWK_BT('\0'); + p = &o[ep - sp + 2]; + } + cnt++; + /* last empty field after delim */ + if (*p == HAWK_BT('\0')) cnt++; + goto exit_point; + } + } + + if (!hawk_is_bch_space (*p)) + { + if (sp == HAWK_NULL) sp = p; + ep = p; + } + p++; + } +exit_point: + ; + } + } + } + + return cnt; +} + +/* ----------------------------------------------------------------------- */ + +hawk_oow_t hawk_int_to_oocstr (hawk_int_t value, int radix, const hawk_ooch_t* prefix, hawk_ooch_t* buf, hawk_oow_t size) +{ + hawk_int_t t, rem; + hawk_oow_t len, ret, i; + hawk_oow_t prefix_len; + + prefix_len = (prefix != HAWK_NULL)? hawk_count_oocstr(prefix): 0; + + t = value; + if (t == 0) + { + /* zero */ + if (buf == HAWK_NULL) + { + /* if buf is not given, + * return the number of bytes required */ + return prefix_len + 1; + } + + if (size < prefix_len+1) + { + /* buffer too small */ + return (hawk_oow_t)-1; + } + + for (i = 0; i < prefix_len; i++) buf[i] = prefix[i]; + buf[prefix_len] = HAWK_T('0'); + if (size > prefix_len+1) buf[prefix_len+1] = HAWK_T('\0'); + return prefix_len+1; + } + + /* non-zero values */ + len = prefix_len; + if (t < 0) { t = -t; len++; } + while (t > 0) { len++; t /= radix; } + + if (buf == HAWK_NULL) + { + /* if buf is not given, return the number of bytes required */ + return len; + } + + if (size < len) return (hawk_oow_t)-1; /* buffer too small */ + if (size > len) buf[len] = HAWK_T('\0'); + ret = len; + + t = value; + if (t < 0) t = -t; + + while (t > 0) + { + rem = t % radix; + if (rem >= 10) + buf[--len] = (hawk_ooch_t)rem + HAWK_T('a') - 10; + else + buf[--len] = (hawk_ooch_t)rem + HAWK_T('0'); + t /= radix; + } + + if (value < 0) + { + for (i = 1; i <= prefix_len; i++) + { + buf[i] = prefix[i-1]; + len--; + } + buf[--len] = HAWK_T('-'); + } + else + { + for (i = 0; i < prefix_len; i++) buf[i] = prefix[i]; + } + + return ret; +} + +/* ----------------------------------------------------------------------- */ + +int hawk_conv_bchars_to_uchars_with_cmgr ( + const hawk_bch_t* bcs, hawk_oow_t* bcslen, + hawk_uch_t* ucs, hawk_oow_t* ucslen, hawk_cmgr_t* cmgr, int all) +{ + const hawk_bch_t* p; + int ret = 0; + hawk_oow_t mlen; + + if (ucs) + { + /* destination buffer is specified. + * copy the conversion result to the buffer */ + + hawk_uch_t* q, * qend; + + p = bcs; + q = ucs; + qend = ucs + *ucslen; + mlen = *bcslen; + + while (mlen > 0) + { + hawk_oow_t n; + + if (q >= qend) + { + /* buffer too small */ + ret = -2; + break; + } + + n = cmgr->bctouc(p, mlen, q); + if (n == 0) + { + /* invalid sequence */ + if (all) + { + n = 1; + *q = '?'; + } + else + { + ret = -1; + break; + } + } + if (n > mlen) + { + /* incomplete sequence */ + if (all) + { + n = 1; + *q = '?'; + } + else + { + ret = -3; + break; + } + } + + q++; + p += n; + mlen -= n; + } + + *ucslen = q - ucs; + *bcslen = p - bcs; + } + else + { + /* no destination buffer is specified. perform conversion + * but don't copy the result. the caller can call this function + * without a buffer to find the required buffer size, allocate + * a buffer with the size and call this function again with + * the buffer. */ + + hawk_uch_t w; + hawk_oow_t wlen = 0; + + p = bcs; + mlen = *bcslen; + + while (mlen > 0) + { + hawk_oow_t n; + + n = cmgr->bctouc(p, mlen, &w); + if (n == 0) + { + /* invalid sequence */ + if (all) n = 1; + else + { + ret = -1; + break; + } + } + if (n > mlen) + { + /* incomplete sequence */ + if (all) n = 1; + else + { + ret = -3; + break; + } + } + + p += n; + mlen -= n; + wlen += 1; + } + + *ucslen = wlen; + *bcslen = p - bcs; + } + + return ret; +} + +int hawk_conv_bcstr_to_ucstr_with_cmgr ( + const hawk_bch_t* bcs, hawk_oow_t* bcslen, + hawk_uch_t* ucs, hawk_oow_t* ucslen, hawk_cmgr_t* cmgr, int all) +{ + const hawk_bch_t* bp; + hawk_oow_t mlen, wlen; + int n; + + for (bp = bcs; *bp != '\0'; bp++) /* nothing */ ; + + mlen = bp - bcs; wlen = *ucslen; + n = hawk_conv_bchars_to_uchars_with_cmgr(bcs, &mlen, ucs, &wlen, cmgr, all); + if (ucs) + { + /* null-terminate the target buffer if it has room for it. */ + if (wlen < *ucslen) ucs[wlen] = '\0'; + else n = -2; /* buffer too small */ + } + *bcslen = mlen; *ucslen = wlen; + + return n; +} + +int hawk_conv_uchars_to_bchars_with_cmgr ( + const hawk_uch_t* ucs, hawk_oow_t* ucslen, + hawk_bch_t* bcs, hawk_oow_t* bcslen, hawk_cmgr_t* cmgr) +{ + const hawk_uch_t* p = ucs; + const hawk_uch_t* end = ucs + *ucslen; + int ret = 0; + + if (bcs) + { + hawk_oow_t rem = *bcslen; + + while (p < end) + { + hawk_oow_t n; + + if (rem <= 0) + { + ret = -2; /* buffer too small */ + break; + } + + n = cmgr->uctobc(*p, bcs, rem); + if (n == 0) + { + ret = -1; + break; /* illegal character */ + } + if (n > rem) + { + ret = -2; /* buffer too small */ + break; + } + bcs += n; rem -= n; p++; + } + + *bcslen -= rem; + } + else + { + hawk_bch_t bcsbuf[HAWK_BCSIZE_MAX]; + hawk_oow_t mlen = 0; + + while (p < end) + { + hawk_oow_t n; + + n = cmgr->uctobc(*p, bcsbuf, HAWK_COUNTOF(bcsbuf)); + if (n == 0) + { + ret = -1; + break; /* illegal character */ + } + + /* it assumes that bcsbuf is large enough to hold a character */ + /*HAWK_ASSERT (hawk, n <= HAWK_COUNTOF(bcsbuf));*/ + + p++; mlen += n; + } + + /* this length excludes the terminating null character. + * this function doesn't even null-terminate the result. */ + *bcslen = mlen; + } + + *ucslen = p - ucs; + return ret; +} + +int hawk_conv_ucstr_to_bcstr_with_cmgr ( + const hawk_uch_t* ucs, hawk_oow_t* ucslen, + hawk_bch_t* bcs, hawk_oow_t* bcslen, hawk_cmgr_t* cmgr) +{ + const hawk_uch_t* p = ucs; + int ret = 0; + + if (bcs) + { + hawk_oow_t rem = *bcslen; + + while (*p != '\0') + { + hawk_oow_t n; + + if (rem <= 0) + { + ret = -2; + break; + } + + n = cmgr->uctobc(*p, bcs, rem); + if (n == 0) + { + ret = -1; + break; /* illegal character */ + } + if (n > rem) + { + ret = -2; + break; /* buffer too small */ + } + + bcs += n; rem -= n; p++; + } + + /* update bcslen to the length of the bcs string converted excluding + * terminating null */ + *bcslen -= rem; + + /* null-terminate the multibyte sequence if it has sufficient space */ + if (rem > 0) *bcs = '\0'; + else + { + /* if ret is -2 and cs[cslen] == '\0', + * this means that the bcs buffer was lacking one + * slot for the terminating null */ + ret = -2; /* buffer too small */ + } + } + else + { + hawk_bch_t bcsbuf[HAWK_BCSIZE_MAX]; + hawk_oow_t mlen = 0; + + while (*p != '\0') + { + hawk_oow_t n; + + n = cmgr->uctobc(*p, bcsbuf, HAWK_COUNTOF(bcsbuf)); + if (n == 0) + { + ret = -1; + break; /* illegal character */ + } + + /* it assumes that bcs is large enough to hold a character */ + /*HAWK_ASSERT (hawk, n <= HAWK_COUNTOF(bcs));*/ + + p++; mlen += n; + } + + /* this length holds the number of resulting multi-byte characters + * excluding the terminating null character */ + *bcslen = mlen; + } + + *ucslen = p - ucs; /* the number of wide characters handled. */ + return ret; +} + +int hawk_conv_bchars_to_uchars_upto_stopper_with_cmgr ( + const hawk_bch_t* bcs, hawk_oow_t* bcslen, + hawk_uch_t* ucs, hawk_oow_t* ucslen, hawk_uch_t stopper, hawk_cmgr_t* cmgr) +{ + const hawk_bch_t* p; + int ret = 0; + hawk_oow_t blen; + + hawk_uch_t w; + hawk_oow_t ulen = 0; + hawk_uch_t* wend; + + p = bcs; + blen = *bcslen; + + if (ucs) wend = ucs + *ucslen; + + /* since it needs to break when a stopper is met, + * i can't perform bulky conversion using the buffer + * provided. so conversion is conducted character by + * character */ + while (blen > 0) + { + hawk_oow_t n; + + n = cmgr->bctouc(p, blen, &w); + if (n == 0) + { + /* invalid sequence */ + ret = -1; + break; + } + if (n > blen) + { + /* incomplete sequence */ + ret = -3; + break; + } + + if (ucs) + { + if (ucs >= wend) break; + *ucs++ = w; + } + + p += n; + blen -= n; + ulen += 1; + + if (w == stopper) break; + } + + *ucslen = ulen; + *bcslen = p - bcs; + + return ret; +} + +/* ----------------------------------------------------------------------- */ + +static hawk_cmgr_t builtin_cmgr[] = +{ + /* keep the order aligned with hawk_cmgr_id_t values in */ + { hawk_utf8_to_uc, hawk_uc_to_utf8 }, + { hawk_utf16_to_uc, hawk_uc_to_utf16 }, + { hawk_mb8_to_uc, hawk_uc_to_mb8 } +}; + +hawk_cmgr_t* hawk_get_cmgr_by_id (hawk_cmgr_id_t id) +{ + return &builtin_cmgr[id]; +} + + +static struct +{ + const hawk_bch_t* name; + hawk_cmgr_id_t id; +} builtin_cmgr_tab[] = +{ + { "utf8", HAWK_CMGR_UTF8 }, + { "utf16", HAWK_CMGR_UTF16 }, + { "mb8", HAWK_CMGR_MB8 } +}; + +hawk_cmgr_t* hawk_get_cmgr_by_bcstr (const hawk_bch_t* name) +{ + if (name) + { + hawk_oow_t i; + + for (i = 0; i < HAWK_COUNTOF(builtin_cmgr_tab); i++) + { + if (hawk_comp_bcstr(name, builtin_cmgr_tab[i].name, 0) == 0) + { + return &builtin_cmgr[builtin_cmgr_tab[i].id]; + } + } + } + + return HAWK_NULL; +} + +hawk_cmgr_t* hawk_get_cmgr_by_ucstr (const hawk_uch_t* name) +{ + if (name) + { + hawk_oow_t i; + + for (i = 0; i < HAWK_COUNTOF(builtin_cmgr_tab); i++) + { + if (hawk_comp_ucstr_bcstr(name, builtin_cmgr_tab[i].name) == 0) + { + return &builtin_cmgr[builtin_cmgr_tab[i].id]; + } + } + } + + return HAWK_NULL; +} + +/* ----------------------------------------------------------------------- */ + +int hawk_conv_utf8_to_uchars (const hawk_bch_t* bcs, hawk_oow_t* bcslen, hawk_uch_t* ucs, hawk_oow_t* ucslen) +{ + /* the source is length bound */ + return hawk_conv_bchars_to_uchars_with_cmgr(bcs, bcslen, ucs, ucslen, &builtin_cmgr[HAWK_CMGR_UTF8], 0); +} + +int hawk_conv_uchars_to_utf8 (const hawk_uch_t* ucs, hawk_oow_t* ucslen, hawk_bch_t* bcs, hawk_oow_t* bcslen) +{ + /* length bound */ + return hawk_conv_uchars_to_bchars_with_cmgr(ucs, ucslen, bcs, bcslen, &builtin_cmgr[HAWK_CMGR_UTF8]); +} + +int hawk_conv_utf8_to_ucstr (const hawk_bch_t* bcs, hawk_oow_t* bcslen, hawk_uch_t* ucs, hawk_oow_t* ucslen) +{ + /* null-terminated. */ + return hawk_conv_bcstr_to_ucstr_with_cmgr(bcs, bcslen, ucs, ucslen, &builtin_cmgr[HAWK_CMGR_UTF8], 0); +} + +int hawk_conv_ucstr_to_utf8 (const hawk_uch_t* ucs, hawk_oow_t* ucslen, hawk_bch_t* bcs, hawk_oow_t* bcslen) +{ + /* null-terminated */ + return hawk_conv_ucstr_to_bcstr_with_cmgr(ucs, ucslen, bcs, bcslen, &builtin_cmgr[HAWK_CMGR_UTF8]); +} + +/* ----------------------------------------------------------------------- */ + +int hawk_conv_utf16_to_uchars (const hawk_bch_t* bcs, hawk_oow_t* bcslen, hawk_uch_t* ucs, hawk_oow_t* ucslen) +{ + /* the source is length bound */ + return hawk_conv_bchars_to_uchars_with_cmgr(bcs, bcslen, ucs, ucslen, &builtin_cmgr[HAWK_CMGR_UTF16], 0); +} + +int hawk_conv_uchars_to_utf16 (const hawk_uch_t* ucs, hawk_oow_t* ucslen, hawk_bch_t* bcs, hawk_oow_t* bcslen) +{ + /* length bound */ + return hawk_conv_uchars_to_bchars_with_cmgr(ucs, ucslen, bcs, bcslen, &builtin_cmgr[HAWK_CMGR_UTF16]); +} + +int hawk_conv_utf16_to_ucstr (const hawk_bch_t* bcs, hawk_oow_t* bcslen, hawk_uch_t* ucs, hawk_oow_t* ucslen) +{ + /* null-terminated. */ + return hawk_conv_bcstr_to_ucstr_with_cmgr(bcs, bcslen, ucs, ucslen, &builtin_cmgr[HAWK_CMGR_UTF16], 0); +} + +int hawk_conv_ucstr_to_utf16 (const hawk_uch_t* ucs, hawk_oow_t* ucslen, hawk_bch_t* bcs, hawk_oow_t* bcslen) +{ + /* null-terminated */ + return hawk_conv_ucstr_to_bcstr_with_cmgr(ucs, ucslen, bcs, bcslen, &builtin_cmgr[HAWK_CMGR_UTF16]); +} + +/* ----------------------------------------------------------------------- */ + +int hawk_conv_mb8_to_uchars (const hawk_bch_t* bcs, hawk_oow_t* bcslen, hawk_uch_t* ucs, hawk_oow_t* ucslen) +{ + /* the source is length bound */ + return hawk_conv_bchars_to_uchars_with_cmgr(bcs, bcslen, ucs, ucslen, &builtin_cmgr[HAWK_CMGR_MB8], 0); +} + +int hawk_conv_uchars_to_mb8 (const hawk_uch_t* ucs, hawk_oow_t* ucslen, hawk_bch_t* bcs, hawk_oow_t* bcslen) +{ + /* length bound */ + return hawk_conv_uchars_to_bchars_with_cmgr(ucs, ucslen, bcs, bcslen, &builtin_cmgr[HAWK_CMGR_MB8]); +} + +int hawk_conv_mb8_to_ucstr (const hawk_bch_t* bcs, hawk_oow_t* bcslen, hawk_uch_t* ucs, hawk_oow_t* ucslen) +{ + /* null-terminated. */ + return hawk_conv_bcstr_to_ucstr_with_cmgr(bcs, bcslen, ucs, ucslen, &builtin_cmgr[HAWK_CMGR_MB8], 0); +} + +int hawk_conv_ucstr_to_mb8 (const hawk_uch_t* ucs, hawk_oow_t* ucslen, hawk_bch_t* bcs, hawk_oow_t* bcslen) +{ + /* null-terminated */ + return hawk_conv_ucstr_to_bcstr_with_cmgr(ucs, ucslen, bcs, bcslen, &builtin_cmgr[HAWK_CMGR_MB8]); +} + +/* ----------------------------------------------------------------------- */ diff --git a/hawk/lib/utl-sys.c b/hawk/lib/utl-sys.c new file mode 100644 index 00000000..b56239c1 --- /dev/null +++ b/hawk/lib/utl-sys.c @@ -0,0 +1,275 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include + +#if defined(_WIN32) +# include +# include +# define EPOCH_DIFF_YEARS (HAWK_EPOCH_YEAR-HAWK_EPOCH_YEAR_WIN) +# define EPOCH_DIFF_DAYS ((hawk_intptr_t)EPOCH_DIFF_YEARS*365+EPOCH_DIFF_YEARS/4-3) +# define EPOCH_DIFF_SECS ((hawk_intptr_t)EPOCH_DIFF_DAYS*24*60*60) +#elif defined(__OS2__) +# define INCL_DOSDATETIME +# define INCL_DOSERRORS +# include +# include +#elif defined(__DOS__) +# include +# include +#else +# include "syscall.h" +# if defined(HAVE_SYS_TIME_H) +# include +# endif +# if defined(HAVE_TIME_H) +# include +# endif +#endif + +int hawk_get_time (hawk_ntime_t* t) +{ +#if defined(_WIN32) + SYSTEMTIME st; + FILETIME ft; + ULARGE_INTEGER li; + + /* + * MSDN: The FILETIME structure is a 64-bit value representing the + * number of 100-nanosecond intervals since January 1, 1601 (UTC). + */ + + GetSystemTime (&st); + if (SystemTimeToFileTime (&st, &ft) == FALSE) return -1; + + li.LowPart = ft.dwLowDateTime; + li.HighPart = ft.dwHighDateTime; + + /* li.QuadPart is in the 100-nanosecond intervals */ + t->sec = (li.QuadPart / (HAWK_NSECS_PER_SEC / 100)) - EPOCH_DIFF_SECS; + t->nsec = (li.QuadPart % (HAWK_NSECS_PER_SEC / 100)) * 100; + + return 0; + +#elif defined(__OS2__) + + APIRET rc; + DATETIME dt; + hawk_btime_t bt; + + /* Can I use DosQuerySysInfo(QSV_TIME_LOW) and + * DosQuerySysInfo(QSV_TIME_HIGH) for this instead? + * Maybe, resolution too low as it returns values + * in seconds. */ + + rc = DosGetDateTime (&dt); + if (rc != NO_ERROR) return -1; + + bt.year = dt.year - HAWK_BTIME_YEAR_BASE; + bt.mon = dt.month - 1; + bt.mday = dt.day; + bt.hour = dt.hours; + bt.min = dt.minutes; + bt.sec = dt.seconds; + /*bt.msec = dt.hundredths * 10;*/ + bt.isdst = -1; /* determine dst for me */ + + if (hawk_timelocal(&bt, t) <= -1) return -1; + t->nsec = HAWK_MSEC_TO_NSEC(dt.hundredths * 10); + return 0; + +#elif defined(__DOS__) + + struct dostime_t dt; + struct dosdate_t dd; + hawk_btime_t bt; + + _dos_gettime (&dt); + _dos_getdate (&dd); + + bt.year = dd.year - HAWK_BTIME_YEAR_BASE; + bt.mon = dd.month - 1; + bt.mday = dd.day; + bt.hour = dt.hour; + bt.min = dt.minute; + bt.sec = dt.second; + /*bt.msec = dt.hsecond * 10; */ + bt.isdst = -1; /* determine dst for me */ + + if (hawk_timelocal(&bt, t) <= -1) return -1; + t->nsec = HAWK_MSEC_TO_NSEC(dt.hsecond * 10); + return 0; + +#elif defined(macintosh) + unsigned long tv; + + GetDateTime (&tv); + + t->sec = tv; + tv->nsec = 0; + + return 0; + +#elif defined(HAVE_CLOCK_GETTIME) + struct timespec ts; + + if (clock_gettime(CLOCK_REALTIME, &ts) == -1) return -1; + + t->sec = ts.tv_sec; + t->nsec = ts.tv_nsec; + return 0; + +#elif defined(HAVE_GETTIMEOFDAY) + struct timeval tv; + int n; + + n = HAWK_GETTIMEOFDAY(&tv, HAWK_NULL); + if (n == -1) return -1; + + t->sec = tv.tv_sec; + t->nsec = HAWK_USEC_TO_NSEC(tv.tv_usec); + return 0; + +#else + t->sec = time(HAWK_NULL); + t->nsec = 0; + + return 0; +#endif +} + +int hawk_set_time (const hawk_ntime_t* t) +{ +#if defined(_WIN32) + FILETIME ft; + SYSTEMTIME st; + + /**((hawk_int64_t*)&ft) = ((t + EPOCH_DIFF_MSECS) * (10 * 1000));*/ + *((hawk_int64_t*)&ft) = (HAWK_SEC_TO_NSEC(t->sec + EPOCH_DIFF_SECS) / 100) + (t->nsec / 100); + if (FileTimeToSystemTime(&ft, &st) == FALSE) return -1; + if (SetSystemTime(&st) == FALSE) return -1; + return 0; + +#elif defined(__OS2__) + + APIRET rc; + DATETIME dt; + hawk_btime_t bt; + + if (hawk_localtime (t, &bt) <= -1) return -1; + + HAWK_MEMSET (&dt, 0, HAWK_SIZEOF(dt)); + dt.year = bt.year + HAWK_BTIME_YEAR_BASE; + dt.month = bt.mon + 1; + dt.day = bt.mday; + dt.hours = bt.hour; + dt.minutes = bt.min; + dt.seconds = bt.sec; + dt.hundredths = HAWK_NSEC_TO_MSEC(t->nsec) / 10; + + rc = DosSetDateTime(&dt); + return (rc != NO_ERROR)? -1: 0; + +#elif defined(__DOS__) + + struct dostime_t dt; + struct dosdate_t dd; + hawk_btime_t bt; + + if (hawk_localtime(t, &bt) <= -1) return -1; + + dd.year = bt.year + HAWK_BTIME_YEAR_BASE; + dd.month = bt.mon + 1; + dd.day = bt.mday; + dt.hour = bt.hour; + dt.minute = bt.min; + dt.second = bt.sec; + dt.hsecond = HAWK_NSEC_TO_MSEC(t->nsec) / 10; + + if (_dos_settime(&dt) != 0) return -1; + if (_dos_setdate(&dd) != 0) return -1; + + return 0; + +#elif defined(HAVE_SETTIMEOFDAY) + struct timeval tv; + int n; + + tv.tv_sec = t->sec; + tv.tv_usec = HAWK_NSEC_TO_USEC(t->nsec); + +/* +#if defined(CLOCK_REALTIME) && defined(HAVE_CLOCK_SETTIME) + { + int r = clock_settime(CLOCK_REALTIME, ts); + if (r == 0 || errno == EPERM) return r; + } +#elif defined(HAVE_STIME) + return stime (&ts->tv_sec); +#else +*/ + n = HAWK_SETTIMEOFDAY(&tv, HAWK_NULL); + if (n == -1) return -1; + return 0; + +#else + + time_t tv; + tv = t->sec; + return (HAWK_STIME(&tv) == -1)? -1: 0; +#endif +} + +void hawk_add_time (const hawk_ntime_t* x, const hawk_ntime_t* y, hawk_ntime_t* z) +{ + /*HAWK_ASSERT (x->nsec >= 0 && x->nsec < HAWK_NSECS_PER_SEC); + HAWK_ASSERT (y->nsec >= 0 && y->nsec < HAWK_NSECS_PER_SEC);*/ + + z->sec = x->sec + y->sec; + z->nsec = x->nsec + y->nsec; + + if (z->nsec >= HAWK_NSECS_PER_SEC) + { + z->sec = z->sec + 1; + z->nsec = z->nsec - HAWK_NSECS_PER_SEC; + } +} + +void hawk_sub_time (const hawk_ntime_t* x, const hawk_ntime_t* y, hawk_ntime_t* z) +{ + /*HAWK_ASSERT (x->nsec >= 0 && x->nsec < HAWK_NSECS_PER_SEC); + HAWK_ASSERT (y->nsec >= 0 && y->nsec < HAWK_NSECS_PER_SEC);*/ + + z->sec = x->sec - y->sec; + z->nsec = x->nsec - y->nsec; + + if (z->nsec < 0) + { + z->sec = z->sec - 1; + z->nsec = z->nsec + HAWK_NSECS_PER_SEC; + } +} + diff --git a/hawk/lib/utl.c b/hawk/lib/utl.c new file mode 100644 index 00000000..74a0077f --- /dev/null +++ b/hawk/lib/utl.c @@ -0,0 +1,129 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "hawk-prv.h" + +/* ----------------------------------------------------------------------- */ + +hawk_oow_t hawk_byte_to_ucstr (hawk_oob_t byte, hawk_uch_t* buf, hawk_oow_t size, int flagged_radix, hawk_uch_t fill) +{ + hawk_uch_t tmp[(HAWK_SIZEOF(hawk_oob_t) * HAWK_BITS_PER_BYTE)]; + hawk_uch_t* p = tmp, * bp = buf, * be = buf + size - 1; + int radix; + hawk_uch_t radix_char; + + radix = (flagged_radix & HAWK_BYTE_TO_UCSTR_RADIXMASK); + radix_char = (flagged_radix & HAWK_BYTE_TO_UCSTR_LOWERCASE)? 'a': 'A'; + if (radix < 2 || radix > 36 || size <= 0) return 0; + + do + { + hawk_uint8_t digit = byte % radix; + if (digit < 10) *p++ = digit + '0'; + else *p++ = digit + radix_char - 10; + byte /= radix; + } + while (byte > 0); + + if (fill != '\0') + { + while (size - 1 > p - tmp) + { + *bp++ = fill; + size--; + } + } + + while (p > tmp && bp < be) *bp++ = *--p; + *bp = '\0'; + return bp - buf; +} + +hawk_oow_t hawk_byte_to_bcstr (hawk_oob_t byte, hawk_bch_t* buf, hawk_oow_t size, int flagged_radix, hawk_bch_t fill) +{ + hawk_bch_t tmp[(HAWK_SIZEOF(hawk_oob_t) * HAWK_BITS_PER_BYTE)]; + hawk_bch_t* p = tmp, * bp = buf, * be = buf + size - 1; + int radix; + hawk_bch_t radix_char; + + radix = (flagged_radix & HAWK_BYTE_TO_BCSTR_RADIXMASK); + radix_char = (flagged_radix & HAWK_BYTE_TO_BCSTR_LOWERCASE)? 'a': 'A'; + if (radix < 2 || radix > 36 || size <= 0) return 0; + + do + { + hawk_uint8_t digit = byte % radix; + if (digit < 10) *p++ = digit + '0'; + else *p++ = digit + radix_char - 10; + byte /= radix; + } + while (byte > 0); + + if (fill != '\0') + { + while (size - 1 > p - tmp) + { + *bp++ = fill; + size--; + } + } + + while (p > tmp && bp < be) *bp++ = *--p; + *bp = '\0'; + return bp - buf; +} + + +#if defined(_WIN32) || defined(__OS2__) || defined(__DOS__) +# define IS_PATH_SEP(c) ((c) == '/' || (c) == '\\') +#else +# define IS_PATH_SEP(c) ((c) == '/') +#endif + +const hawk_uch_t* hawk_get_base_name_ucstr (const hawk_uch_t* path) +{ + const hawk_uch_t* p, * last = HAWK_NULL; + + for (p = path; *p != '\0'; p++) + { + if (IS_PATH_SEP(*p)) last = p; + } + + return last? (last +1): path; +} + +const hawk_bch_t* hawk_get_base_name_bcstr (const hawk_bch_t* path) +{ + const hawk_bch_t* p, * last = HAWK_NULL; + + for (p = path; *p != '\0'; p++) + { + if (IS_PATH_SEP(*p)) last = p; + } + + return last? (last +1): path; +} + diff --git a/hawk/lib/val-imp.h b/hawk/lib/val-imp.h new file mode 100644 index 00000000..52811931 --- /dev/null +++ b/hawk/lib/val-imp.h @@ -0,0 +1,76 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* this file is supposed to be included by val.c */ + +int awk_rtx_strtonum (hawk_rtx_t* rtx, int option, const char_t* ptr, hawk_oow_t len, hawk_int_t* l, hawk_flt_t* r) +{ + const char_t* endptr; + const char_t* end; + + int strict = HAWK_RTX_OOCSTRTONUM_GET_OPTION_STRICT(option); + int base = HAWK_RTX_STRTONUN_GET_OPTION_BASE(option); + + end = ptr + len; + *l = awk_strxtoint(rtx->awk, ptr, len, base, &endptr); + if (endptr < end) + { + if (*endptr == _T('.') || *endptr == _T('E') || *endptr == _T('e')) + { + handle_float: + *r = awk_strxtoflt(rtx->awk, ptr, len, &endptr); + if (strict && endptr < end) return -1; + return 1; /* flt */ + } + else if (AWK_ISDIGIT(*endptr)) + { + const char_t* p = endptr; + do { p++; } while (p < end && AWK_ISDIGIT(*p)); + if (p < end && (*p == _T('.') || *p == _T('E') || *p == _T('e'))) + { + /* it's probably an floating-point number. + * + * BEGIN { b=99; printf "%f\n", (0 b 1.112); } + * + * for the above code, this function gets '0991.112'. + * and endptr points to '9' after hawk_strxtoint() as + * the numeric string beginning with 0 is treated + * as an octal number. + * + * getting side-tracked, + * BEGIN { b=99; printf "%f\n", (0 b 1.000); } + * the above code cause this function to get 0991, not 0991.000 + * because of the default CONVFMT '%.6g' which doesn't produce '.000'. + * so such a number is not treated as a floating-point number. + */ + goto handle_float; + } + } + } + + if (strict && endptr < end) return -1; + return 0; /* int */ +} diff --git a/hawk/lib/val-prv.h b/hawk/lib/val-prv.h new file mode 100644 index 00000000..456de2fe --- /dev/null +++ b/hawk/lib/val-prv.h @@ -0,0 +1,157 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _HAWK_VAL_PRV_H_ +#define _HAWK_VAL_PRV_H_ + +#define HAWK_VAL_CHUNK_SIZE 100 + +typedef struct hawk_val_chunk_t hawk_val_chunk_t; +typedef struct hawk_val_ichunk_t hawk_val_ichunk_t; +typedef struct hawk_val_rchunk_t hawk_val_rchunk_t; + +struct hawk_val_chunk_t +{ + hawk_val_chunk_t* next; +}; + +struct hawk_val_ichunk_t +{ + hawk_val_chunk_t* next; + /* make sure that it has the same fields as + hawk_val_chunk_t up to this point */ + + hawk_val_int_t slot[HAWK_VAL_CHUNK_SIZE]; +}; + +struct hawk_val_rchunk_t +{ + hawk_val_chunk_t* next; + /* make sure that it has the same fields as + hawk_val_chunk_t up to this point */ + + hawk_val_flt_t slot[HAWK_VAL_CHUNK_SIZE]; +}; + + +/* + * if shared objects link a static library, statically defined objects + * in the static library will be instatiated in the multiple shared objects. + * + * so equality check with a value pointer doesn't work + * if the code crosses the library boundaries. instead, i decided to + * add a field to indicate if a value is static. + * + +#define IS_STATICVAL(val) ((val) == HAWK_NULL || (val) == hawk_val_nil || (val) == hawk_val_zls || (val) == hawk_val_zlm) +*/ +#define IS_STATICVAL(val) ((val)->stat) + + +/* hawk_val_t pointer encoding assumes the pointer is an even number. + * i shift an integer within a certain range and set bit 0 to 1 to + * encode it in a pointer. (vtr = value pointer). + * + * is this a safe assumption? do i have to use memalign or write my own + * aligned malloc()? */ +#define HAWK_VTR_NUM_TYPE_BITS 1 +#define HAWK_VTR_MASK_TYPE_BITS 1 + +#define HAWK_VTR_TYPE_BITS_POINTER 0 +#define HAWK_VTR_TYPE_BITS_QUICKINT 1 +#define HAWK_VTR_SIGN_BIT ((hawk_uintptr_t)1 << (HAWK_SIZEOF_UINTPTR_T * 8 - 1)) + +/* shrink the bit range by 1 more bit to ease signbit handling. + * i want abs(max) == abs(min). + * i don't want abs(max) + 1 == abs(min). e.g min: -32768, max: 32767 + */ +#define HAWK_QUICKINT_MAX ((hawk_int_t)((~(hawk_uintptr_t)0) >> (HAWK_VTR_NUM_TYPE_BITS + 1))) +#define HAWK_QUICKINT_MIN (-HAWK_QUICKINT_MAX) +#define HAWK_IN_QUICKINT_RANGE(i) ((i) >= HAWK_QUICKINT_MIN && (i) <= HAWK_QUICKINT_MAX) + +#define HAWK_VTR_TYPE_BITS(p) (((hawk_uintptr_t)(p)) & HAWK_VTR_MASK_TYPE_BITS) +#define HAWK_VTR_IS_POINTER(p) (HAWK_VTR_TYPE_BITS(p) == HAWK_VTR_TYPE_BITS_POINTER) +#define HAWK_VTR_IS_QUICKINT(p) (HAWK_VTR_TYPE_BITS(p) == HAWK_VTR_TYPE_BITS_QUICKINT) + +#define HAWK_QUICKINT_TO_VTR_POSITIVE(i) \ + (((hawk_uintptr_t)(i) << HAWK_VTR_NUM_TYPE_BITS) | HAWK_VTR_TYPE_BITS_QUICKINT) + +#define HAWK_QUICKINT_TO_VTR_NEGATIVE(i) \ + ((((hawk_uintptr_t)-(i)) << HAWK_VTR_NUM_TYPE_BITS) | HAWK_VTR_TYPE_BITS_QUICKINT | HAWK_VTR_SIGN_BIT) + +#define HAWK_QUICKINT_TO_VTR(i) \ + ((hawk_val_t*)(((i) < 0)? HAWK_QUICKINT_TO_VTR_NEGATIVE(i): HAWK_QUICKINT_TO_VTR_POSITIVE(i))) + +#define HAWK_VTR_ZERO ((hawk_val_t*)HAWK_QUICKINT_TO_VTR_POSITIVE(0)) +#define HAWK_VTR_ONE ((hawk_val_t*)HAWK_QUICKINT_TO_VTR_POSITIVE(1)) +#define HAWK_VTR_NEGONE ((hawk_val_t*)HAWK_QUICKINT_TO_VTR_NEGATIVE(-1)) + +/* sizeof(hawk_intptr_t) may not be the same as sizeof(hawk_int_t). + * so step-by-step type conversions are needed. + * e.g) pointer to uintptr_t, uintptr_t to intptr_t, intptr_t to awk_int_t */ +#define HAWK_VTR_TO_QUICKINT_POSITIVE(p) \ + ((hawk_intptr_t)((hawk_uintptr_t)(p) >> HAWK_VTR_NUM_TYPE_BITS)) +#define HAWK_VTR_TO_QUICKINT_NEGATIVE(p) \ + (-(hawk_intptr_t)(((hawk_uintptr_t)(p) & ~HAWK_VTR_SIGN_BIT) >> HAWK_VTR_NUM_TYPE_BITS)) +#define HAWK_VTR_TO_QUICKINT(p) \ + (((hawk_uintptr_t)(p) & HAWK_VTR_SIGN_BIT)? HAWK_VTR_TO_QUICKINT_NEGATIVE(p): HAWK_VTR_TO_QUICKINT_POSITIVE(p)) + + +#define HAWK_RTX_GETVALTYPE(rtx,p) (HAWK_VTR_IS_QUICKINT(p)? HAWK_VAL_INT: (p)->v_type) +#define HAWK_RTX_GETINTFROMVAL(rtx,p) ((HAWK_VTR_IS_QUICKINT(p)? (hawk_int_t)HAWK_VTR_TO_QUICKINT(p): ((hawk_val_int_t*)(p))->i_val)) + + +#define HAWK_VAL_ZERO HAWK_VTR_ZERO +#define HAWK_VAL_ONE HAWK_VTR_ONE +#define HAWK_VAL_NEGONE HAWK_VTR_NEGONE + +#if defined(__cplusplus) +extern "C" { +#endif + +/* represents a nil value */ +extern hawk_val_t* hawk_val_nil; + +/* represents an empty string */ +extern hawk_val_t* hawk_val_zls; + + +void hawk_rtx_freeval ( + hawk_rtx_t* rtx, + hawk_val_t* val, + int cache +); + +void hawk_rtx_freevalchunk ( + hawk_rtx_t* rtx, + hawk_val_chunk_t* chunk +); + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/hawk/lib/val.c b/hawk/lib/val.c new file mode 100644 index 00000000..1ed3bf9d --- /dev/null +++ b/hawk/lib/val.c @@ -0,0 +1,2142 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "hawk-prv.h" + +#define CHUNKSIZE HAWK_VAL_CHUNK_SIZE + +static hawk_val_nil_t awk_nil = { HAWK_VAL_NIL, 0, 1, 0, 0 }; +static hawk_val_str_t awk_zls = { HAWK_VAL_STR, 0, 1, 0, 0, { HAWK_T(""), 0 } }; +static hawk_val_mbs_t awk_zlm = { HAWK_VAL_MBS, 0, 1, 0, 0, { HAWK_BT(""), 0 } }; + +hawk_val_t* hawk_val_nil = (hawk_val_t*)&awk_nil; +hawk_val_t* hawk_val_zls = (hawk_val_t*)&awk_zls; +hawk_val_t* hawk_val_zlm = (hawk_val_t*)&awk_zlm; + +hawk_val_t* hawk_get_awk_nil_val (void) +{ + return (hawk_val_t*)&awk_nil; +} + +int hawk_rtx_isnilval (hawk_rtx_t* rtx, hawk_val_t* val) +{ + return val->v_type == HAWK_VAL_NIL; +} + +hawk_val_t* hawk_rtx_makenilval (hawk_rtx_t* rtx) +{ + return (hawk_val_t*)&awk_nil; +} + +hawk_val_t* hawk_rtx_makeintval (hawk_rtx_t* rtx, hawk_int_t v) +{ + hawk_val_int_t* val; + + if (HAWK_IN_QUICKINT_RANGE(v)) return HAWK_QUICKINT_TO_VTR(v); + + if (!rtx->vmgr.ifree) + { + hawk_val_ichunk_t* c; + /*hawk_val_int_t* x;*/ + hawk_oow_t i; + + /* use hawk_val_ichunk structure to avoid + * any alignment issues on platforms requiring + * aligned memory access - using the code commented out + * will cause a fault on such a platform */ + + /* c = hawk_rtx_allocmem(rtx, HAWK_SIZEOF(hawk_val_chunk_t) + HAWK_SIZEOF(hawk_val_int_t)*CHUNKSIZE); */ + c = hawk_rtx_allocmem(rtx, HAWK_SIZEOF(hawk_val_ichunk_t)); + if (!c) return HAWK_NULL; + + c->next = rtx->vmgr.ichunk; + /*run->vmgr.ichunk = c;*/ + rtx->vmgr.ichunk = (hawk_val_chunk_t*)c; + + /*x = (hawk_val_int_t*)(c + 1); + for (i = 0; i < CHUNKSIZE-1; i++) + x[i].nde = (hawk_nde_int_t*)&x[i+1]; + x[i].nde = HAWK_NULL; + + run->vmgr.ifree = x; + */ + + for (i = 0; i < CHUNKSIZE-1; i++) + c->slot[i].nde = (hawk_nde_int_t*)&c->slot[i+1]; + c->slot[i].nde = HAWK_NULL; + + rtx->vmgr.ifree = &c->slot[0]; + } + + val = rtx->vmgr.ifree; + rtx->vmgr.ifree = (hawk_val_int_t*)val->nde; + + val->v_type = HAWK_VAL_INT; + val->ref = 0; + val->stat = 0; + val->nstr = 0; + val->fcb = 0; + val->i_val = v; + val->nde = HAWK_NULL; + +#if defined(DEBUG_VAL) + hawk_logfmt (hawk_rtx_getawk(rtx), HAWK_T("makeintval => %jd [%p] - [%O]\n"), (hawk_intmax_t)v, val, val); +#endif + return (hawk_val_t*)val; +} + +hawk_val_t* hawk_rtx_makefltval (hawk_rtx_t* rtx, hawk_flt_t v) +{ + hawk_val_flt_t* val; + + if (rtx->vmgr.rfree == HAWK_NULL) + { + hawk_val_rchunk_t* c; + /*hawk_val_flt_t* x;*/ + hawk_oow_t i; + + /* c = hawk_rtx_allocmem (rtx, HAWK_SIZEOF(hawk_val_chunk_t) + HAWK_SIZEOF(hawk_val_flt_t) * CHUNKSIZE); */ + c = hawk_rtx_allocmem(rtx, HAWK_SIZEOF(hawk_val_rchunk_t)); + if (!c) return HAWK_NULL; + + c->next = rtx->vmgr.rchunk; + /*run->vmgr.rchunk = c;*/ + rtx->vmgr.rchunk = (hawk_val_chunk_t*)c; + + /* + x = (hawk_val_flt_t*)(c + 1); + for (i = 0; i < CHUNKSIZE-1; i++) + x[i].nde = (hawk_nde_flt_t*)&x[i+1]; + x[i].nde = HAWK_NULL; + + run->vmgr.rfree = x; + */ + + for (i = 0; i < CHUNKSIZE-1; i++) + c->slot[i].nde = (hawk_nde_flt_t*)&c->slot[i+1]; + c->slot[i].nde = HAWK_NULL; + + rtx->vmgr.rfree = &c->slot[0]; + } + + val = rtx->vmgr.rfree; + rtx->vmgr.rfree = (hawk_val_flt_t*)val->nde; + + val->v_type = HAWK_VAL_FLT; + val->ref = 0; + val->stat = 0; + val->nstr = 0; + val->fcb = 0; + val->val = v; + val->nde = HAWK_NULL; + +#if defined(DEBUG_VAL) + hawk_logfmt (hawk_rtx_getawk(rtx), HAWK_T("makefltval => %Lf [%p] - [%O]\n"), (double)v, val, val); +#endif + return (hawk_val_t*)val; +} + +static HAWK_INLINE hawk_val_t* make_str_val (hawk_rtx_t* rtx, const hawk_ooch_t* str1, hawk_oow_t len1, const hawk_ooch_t* str2, hawk_oow_t len2) +{ + hawk_val_str_t* val = HAWK_NULL; + hawk_oow_t aligned_len; +#if defined(ENABLE_FEATURE_SCACHE) + hawk_oow_t i; +#endif + + if (len1 <= 0 && len2 <= 0) return hawk_val_zls; + aligned_len = HAWK_ALIGN_POW2((len1 + len2 + 1), FEATURE_SCACHE_BLOCK_UNIT); + +#if defined(ENABLE_FEATURE_SCACHE) + i = aligned_len / FEATURE_SCACHE_BLOCK_UNIT; + if (i < HAWK_COUNTOF(rtx->scache_count)) + { + if (rtx->scache_count[i] > 0) + { + val = rtx->scache[i][--rtx->scache_count[i]]; + goto init; + } + } +#endif + + val = (hawk_val_str_t*)hawk_rtx_callocmem(rtx, HAWK_SIZEOF(hawk_val_str_t) + (aligned_len * HAWK_SIZEOF(hawk_ooch_t))); + if (!val) return HAWK_NULL; + +#if defined(ENABLE_FEATURE_SCACHE) +init: +#endif + val->v_type = HAWK_VAL_STR; + val->ref = 0; + val->stat = 0; + val->nstr = 0; + val->fcb = 0; + val->val.len = len1 + len2; + val->val.ptr = (hawk_ooch_t*)(val + 1); + if (str1) hawk_copy_oochars_to_oocstr_unlimited (&val->val.ptr[0], str1, len1); + if (str2) hawk_copy_oochars_to_oocstr_unlimited (&val->val.ptr[len1], str2, len2); + val->val.ptr[val->val.len] = '\0'; + +#if defined(DEBUG_VAL) + hawk_logfmt (hawk_rtx_getawk(rtx), HAWK_T("make_str_val => %p - [%O]\n"), val, val); +#endif + return (hawk_val_t*)val; +} + + +hawk_val_t* hawk_rtx_makestrvalwithuchars (hawk_rtx_t* rtx, const hawk_uch_t* ucs, hawk_oow_t len) +{ +#if defined(HAWK_OOCH_IS_UCH) + return make_str_val(rtx, ucs, len, HAWK_NULL, 0); +#else + hawk_val_t* v; + hawk_bch_t* bcs; + hawk_oow_t bcslen; + + bcs = hawk_rtx_duputobchars(rtx, ucs, len, &bcslen); + if (!bcs) return HAWK_NULL; + + v = make_str_val(rtx, bcs, bcslen, HAWK_NULL, 0); + hawk_rtx_freemem (rtx, bcs); + return v; +#endif +} + +hawk_val_t* hawk_rtx_makestrvalwithbchars (hawk_rtx_t* rtx, const hawk_bch_t* bcs, hawk_oow_t len) +{ +#if defined(HAWK_OOCH_IS_UCH) + hawk_val_t* v; + hawk_uch_t* ucs; + hawk_oow_t ucslen; + + ucs = hawk_rtx_dupbtouchars(rtx, bcs, len, &ucslen, 1); + if (!ucs) return HAWK_NULL; + + v = make_str_val(rtx, ucs, ucslen, HAWK_NULL, 0); + hawk_rtx_freemem (rtx, ucs); + return v; +#else + return make_str_val(rtx, bcs, len, HAWK_NULL, 0); +#endif +} + +hawk_val_t* hawk_rtx_makestrvalwithbcstr (hawk_rtx_t* rtx, const hawk_bch_t* bcs) +{ + return hawk_rtx_makestrvalwithbchars(rtx, bcs, hawk_count_bcstr(bcs)); +} + +hawk_val_t* hawk_rtx_makestrvalwithucstr (hawk_rtx_t* rtx, const hawk_uch_t* ucs) +{ + return hawk_rtx_makestrvalwithuchars(rtx, ucs, hawk_count_ucstr(ucs)); +} + +hawk_val_t* hawk_rtx_makestrvalwithucs (hawk_rtx_t* rtx, const hawk_ucs_t* ucs) +{ + return hawk_rtx_makestrvalwithuchars(rtx, ucs->ptr, ucs->len); +} + +hawk_val_t* hawk_rtx_makestrvalwithbcs (hawk_rtx_t* rtx, const hawk_bcs_t* bcs) +{ + return hawk_rtx_makestrvalwithbchars(rtx, bcs->ptr, bcs->len); +} + +hawk_val_t* hawk_rtx_makestrvalwithuchars2 (hawk_rtx_t* rtx, const hawk_uch_t* ucs1, hawk_oow_t len1, const hawk_uch_t* ucs2, hawk_oow_t len2) +{ +#if defined(HAWK_OOCH_IS_UCH) + return make_str_val(rtx, ucs1, len1, ucs2, len2); +#else + hawk_val_t* v; + hawk_bch_t* bcs; + hawk_oow_t bcslen; + + bcs = hawk_rtx_dupu2tobchars(rtx, ucs1, len1, ucs2, len2, &bcslen); + if (!bcs) return HAWK_NULL; + + v = make_str_val(rtx, bcs, bcslen, HAWK_NULL, 0); + hawk_rtx_freemem (rtx, bcs); + return v; +#endif +} + +hawk_val_t* hawk_rtx_makestrvalwithbchars2 (hawk_rtx_t* rtx, const hawk_bch_t* bcs1, hawk_oow_t len1, const hawk_bch_t* bcs2, hawk_oow_t len2) +{ +#if defined(HAWK_OOCH_IS_UCH) + hawk_val_t* v; + hawk_uch_t* ucs; + hawk_oow_t ucslen; + + ucs = hawk_rtx_dupb2touchars(rtx, bcs1, len1, bcs2, len2, &ucslen, 1); + if (!ucs) return HAWK_NULL; + + v = make_str_val(rtx, ucs, ucslen, HAWK_NULL, 0); + hawk_rtx_freemem (rtx, ucs); + return v; +#else + return make_str_val(rtx, bcs1, len1, bcs2, len2); +#endif +} + + + +hawk_val_t* hawk_rtx_makenstrvalwithuchars (hawk_rtx_t* rtx, const hawk_uch_t* ptr, hawk_oow_t len) +{ + int x; + hawk_val_t* v; + hawk_int_t l; + hawk_flt_t r; + + x = hawk_rtx_ucharstonum(rtx, HAWK_RTX_OOCSTRTONUM_MAKE_OPTION(1, 0), ptr, len, &l, &r); + v = hawk_rtx_makestrvalwithuchars(rtx, ptr, len); + + if (!v) return HAWK_NULL; + + if (x >= 0) + { + /* set the numeric string flag if a string + * can be converted to a number */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), x == 0 || x == 1); + v->nstr = x + 1; /* long -> 1, real -> 2 */ + } + + return v; +} + + +hawk_val_t* hawk_rtx_makenstrvalwithbchars (hawk_rtx_t* rtx, const hawk_bch_t* ptr, hawk_oow_t len) +{ + int x; + hawk_val_t* v; + hawk_int_t l; + hawk_flt_t r; + + x = hawk_rtx_bcharstonum(rtx, HAWK_RTX_OOCSTRTONUM_MAKE_OPTION(1, 0), ptr, len, &l, &r); + v = hawk_rtx_makestrvalwithbchars(rtx, ptr, len); + + if (!v) return HAWK_NULL; + + if (x >= 0) + { + /* set the numeric string flag if a string + * can be converted to a number */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), x == 0 || x == 1); + v->nstr = x + 1; /* long -> 1, real -> 2 */ + } + + return v; +} + +hawk_val_t* hawk_rtx_makenstrvalwithucstr (hawk_rtx_t* rtx, const hawk_uch_t* str) +{ + return hawk_rtx_makenstrvalwithuchars(rtx, str, hawk_count_ucstr(str)); +} + +hawk_val_t* hawk_rtx_makenstrvalwithbcstr (hawk_rtx_t* rtx, const hawk_bch_t* str) +{ + return hawk_rtx_makenstrvalwithbchars(rtx, str, hawk_count_bcstr(str)); +} + +hawk_val_t* hawk_rtx_makenstrvalwithucs (hawk_rtx_t* rtx, const hawk_ucs_t* str) +{ + return hawk_rtx_makenstrvalwithuchars(rtx, str->ptr, str->len); +} + +hawk_val_t* hawk_rtx_makenstrvalwithbcs (hawk_rtx_t* rtx, const hawk_bcs_t* str) +{ + return hawk_rtx_makenstrvalwithbchars(rtx, str->ptr, str->len); +} + + +hawk_val_t* hawk_rtx_makembsval (hawk_rtx_t* rtx, const hawk_bch_t* ptr, hawk_oow_t len) +{ + hawk_val_mbs_t* val = HAWK_NULL; + hawk_oow_t xsz; + + if (len <= 0) return hawk_val_zlm; + + xsz = len * HAWK_SIZEOF(*ptr); + + val = (hawk_val_mbs_t*)hawk_rtx_callocmem(rtx, HAWK_SIZEOF(hawk_val_mbs_t) + xsz + HAWK_SIZEOF(*ptr)); + if (!val) return HAWK_NULL; + + val->v_type = HAWK_VAL_MBS; + val->ref = 0; + val->stat = 0; + val->nstr = 0; + val->fcb = 0; + val->val.len = len; + val->val.ptr = (hawk_bch_t*)(val + 1); + if (ptr) HAWK_MEMCPY (val->val.ptr, ptr, xsz); + val->val.ptr[len] = HAWK_BT('\0'); + + return (hawk_val_t*)val; +} + +hawk_val_t* hawk_rtx_makembsvalwithbcs (hawk_rtx_t* rtx, const hawk_bcs_t* mxstr) +{ + return hawk_rtx_makembsval(rtx, mxstr->ptr, mxstr->len); +} + +hawk_val_t* hawk_rtx_makerexval (hawk_rtx_t* rtx, const hawk_oocs_t* str, void* code[2]) +{ + hawk_val_rex_t* val; + hawk_oow_t totsz; + + /* the regular expression value holds: + * - header + * - a raw string plus with added a terminating '\0' + * the total size is just large enough for all these. + */ + totsz = HAWK_SIZEOF(*val) + (HAWK_SIZEOF(*str->ptr) * (str->len + 1)); + val = (hawk_val_rex_t*)hawk_rtx_callocmem(rtx, totsz); + if (!val) return HAWK_NULL; + + val->v_type = HAWK_VAL_REX; + val->ref = 0; + val->stat = 0; + val->nstr = 0; + val->fcb = 0; + val->str.len = str->len; + + val->str.ptr = (hawk_ooch_t*)(val + 1); + hawk_copy_oochars_to_oocstr_unlimited (val->str.ptr, str->ptr, str->len); + + val->code[0] = code[0]; + val->code[1] = code[1]; + + return (hawk_val_t*)val; +} + +static void free_mapval (hawk_htb_t* map, void* dptr, hawk_oow_t dlen) +{ + hawk_rtx_t* rtx = *(hawk_rtx_t**)hawk_htb_getxtn(map); + +#if defined(DEBUG_VAL) + hawk_logfmt (hawk_rtx_getawk(rtx), HAWK_T("refdown in map free - [%O]\n"), dptr); +#endif + + hawk_rtx_refdownval (rtx, dptr); +} + +static void same_mapval (hawk_htb_t* map, void* dptr, hawk_oow_t dlen) +{ + hawk_rtx_t* run = *(hawk_rtx_t**)hawk_htb_getxtn(map); +#if defined(DEBUG_VAL) + hawk_logfmt (hawk_rtx_getawk(rtx), HAWK_T("refdown nofree in map free - [%O]\n"), dptr); +#endif + hawk_rtx_refdownval_nofree (run, dptr); +} + +hawk_val_t* hawk_rtx_makemapval (hawk_rtx_t* rtx) +{ + static hawk_htb_style_t style = + { + /* the key is copied inline into a pair and is freed when the pair + * is destroyed. not setting copier for a value means that the pointer + * to the data allocated somewhere else is remembered in a pair. but + * freeing the actual value is handled by free_mapval and same_mapval */ + { + HAWK_HTB_COPIER_INLINE, + HAWK_HTB_COPIER_DEFAULT + }, + { + HAWK_HTB_FREEER_DEFAULT, + free_mapval + }, + HAWK_HTB_COMPER_DEFAULT, + same_mapval, + HAWK_HTB_SIZER_DEFAULT, + HAWK_HTB_HASHER_DEFAULT + }; + hawk_val_map_t* val; + + /* CHECK */ + /* + val = (hawk_val_map_t*)hawk_rtx_callocmem(rtx, HAWK_SIZEOF(hawk_val_map_t)); + if (!val) return HAWK_NULL; + + val->type = HAWK_VAL_MAP; + val->ref = 0; + val->stat = 0; + val->nstr = 0; + val->fcb = 0; + val->map = hawk_htb_open(run, 256, 70, free_mapval, same_mapval, hawk_rtx_getmmgr(run)); + if (val->map == HAWK_NULL) + { + hawk_rtx_freemem (rtx, val); + hawk_rtx_seterrnum (run, HAWK_ENOMEM, HAWK_NULL); + return HAWK_NULL; + } + */ + + val = (hawk_val_map_t*)hawk_rtx_callocmem(rtx, HAWK_SIZEOF(hawk_val_map_t) + HAWK_SIZEOF(hawk_htb_t) + HAWK_SIZEOF(rtx)); + if (!val) return HAWK_NULL; + + val->v_type = HAWK_VAL_MAP; + val->ref = 0; + val->stat = 0; + val->nstr = 0; + val->fcb = 0; + val->map = (hawk_htb_t*)(val + 1); + + if (hawk_htb_init(val->map, hawk_rtx_getawk(rtx), 256, 70, HAWK_SIZEOF(hawk_ooch_t), 1) <= -1) + { + hawk_rtx_freemem (rtx, val); + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return HAWK_NULL; + } + *(hawk_rtx_t**)hawk_htb_getxtn(val->map) = rtx; + hawk_htb_setstyle (val->map, &style); + /* END CHECK */ + + return (hawk_val_t*)val; +} + +hawk_val_t* hawk_rtx_makemapvalwithdata (hawk_rtx_t* rtx, hawk_val_map_data_t data[]) +{ + hawk_val_t* map, * tmp; + hawk_val_map_data_t* p; + + map = hawk_rtx_makemapval(rtx); + if (!map) return HAWK_NULL; + + for (p = data; p->key.ptr; p++) + { + switch (p->type) + { + case HAWK_VAL_MAP_DATA_INT: + tmp = hawk_rtx_makeintval(rtx, *(hawk_int_t*)p->vptr); + break; + + case HAWK_VAL_MAP_DATA_FLT: + tmp = hawk_rtx_makefltval(rtx, *(hawk_flt_t*)p->vptr); + break; + + case HAWK_VAL_MAP_DATA_STR: + tmp = hawk_rtx_makestrvalwithoocstr(rtx, (hawk_ooch_t*)p->vptr); + break; + + case HAWK_VAL_MAP_DATA_MBS: + tmp = hawk_rtx_makestrvalwithbcstr(rtx, (hawk_bch_t*)p->vptr); + break; + + case HAWK_VAL_MAP_DATA_WCS: + tmp = hawk_rtx_makestrvalwithucstr(rtx, (hawk_uch_t*)p->vptr); + break; + + case HAWK_VAL_MAP_DATA_XSTR: + case HAWK_VAL_MAP_DATA_CSTR: + tmp = hawk_rtx_makestrvalwithoocs(rtx, (hawk_oocs_t*)p->vptr); + break; + + case HAWK_VAL_MAP_DATA_MXSTR: + case HAWK_VAL_MAP_DATA_MCSTR: + tmp = hawk_rtx_makestrvalwithbcs(rtx, (hawk_bcs_t*)p->vptr); + break; + + case HAWK_VAL_MAP_DATA_WXSTR: + case HAWK_VAL_MAP_DATA_WCSTR: + tmp = hawk_rtx_makestrvalwithucs(rtx, (hawk_ucs_t*)p->vptr); + break; + + default: + tmp = HAWK_NULL; + hawk_rtx_seterrnum (rtx, HAWK_EINVAL, HAWK_NULL); + break; + } + + if (tmp == HAWK_NULL || hawk_rtx_setmapvalfld (rtx, map, p->key.ptr, p->key.len, tmp) == HAWK_NULL) + { + if (tmp) hawk_rtx_freeval (rtx, tmp, 1); + hawk_rtx_freeval (rtx, map, 1); + return HAWK_NULL; + } + } + + return map; +} + +hawk_val_t* hawk_rtx_setmapvalfld ( + hawk_rtx_t* rtx, hawk_val_t* map, + const hawk_ooch_t* kptr, hawk_oow_t klen, hawk_val_t* v) +{ + HAWK_ASSERT (hawk_rtx_getawk(rtx), HAWK_RTX_GETVALTYPE (rtx, map) == HAWK_VAL_MAP); + + if (hawk_htb_upsert ( + ((hawk_val_map_t*)map)->map, + (hawk_ooch_t*)kptr, klen, v, 0) == HAWK_NULL) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return HAWK_NULL; + } + + /* the value is passed in by an external party. we can't refup() + * and refdown() the value if htb_upsert() fails. that way, the value + * can be destroyed if it was passed with the reference count of 0. + * so we increment the reference count when htb_upsert() is complete */ + hawk_rtx_refupval (rtx, v); + + return v; +} + +hawk_val_t* hawk_rtx_getmapvalfld ( + hawk_rtx_t* rtx, hawk_val_t* map, + const hawk_ooch_t* kptr, hawk_oow_t klen) +{ + hawk_htb_pair_t* pair; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), HAWK_RTX_GETVALTYPE (rtx, map) == HAWK_VAL_MAP); + + pair = hawk_htb_search(((hawk_val_map_t*)map)->map, kptr, klen); + if (pair == HAWK_NULL) + { + /* the given key is not found in the map. + * we return NULL here as this function is called by + * a user unlike the awk statement accessing the map key. + * so you can easily determine if the key is found by + * checking the error number. + */ + hawk_rtx_seterrnum (rtx, HAWK_EINVAL, HAWK_NULL); + return HAWK_NULL; + } + + return HAWK_HTB_VPTR(pair); +} + +hawk_val_map_itr_t* hawk_rtx_getfirstmapvalitr ( + hawk_rtx_t* rtx, hawk_val_t* map, hawk_val_map_itr_t* itr) +{ + HAWK_ASSERT (hawk_rtx_getawk(rtx), HAWK_RTX_GETVALTYPE (rtx, map) == HAWK_VAL_MAP); + itr->pair = hawk_htb_getfirstpair (((hawk_val_map_t*)map)->map, &itr->buckno); + return itr->pair? itr: HAWK_NULL; +} + +hawk_val_map_itr_t* hawk_rtx_getnextmapvalitr ( + hawk_rtx_t* rtx, hawk_val_t* map, hawk_val_map_itr_t* itr) +{ + HAWK_ASSERT (hawk_rtx_getawk(rtx), HAWK_RTX_GETVALTYPE (rtx, map) == HAWK_VAL_MAP); + itr->pair = hawk_htb_getnextpair (((hawk_val_map_t*)map)->map, itr->pair, &itr->buckno); + return itr->pair? itr: HAWK_NULL; +} + +hawk_val_t* hawk_rtx_makerefval (hawk_rtx_t* rtx, int id, hawk_val_t** adr) +{ + hawk_val_ref_t* val; + + if (rtx->rcache_count > 0) + { + val = rtx->rcache[--rtx->rcache_count]; + } + else + { + val = (hawk_val_ref_t*)hawk_rtx_callocmem(rtx, HAWK_SIZEOF(*val)); + if (!val) return HAWK_NULL; + } + + HAWK_RTX_INIT_REF_VAL (val, id, adr, 0); + return (hawk_val_t*)val; +} + +hawk_val_t* hawk_rtx_makefunval (hawk_rtx_t* rtx, const hawk_fun_t* fun) +{ + hawk_val_fun_t* val; + + val = (hawk_val_fun_t*)hawk_rtx_callocmem(rtx, HAWK_SIZEOF(*val)); + if (!val) return HAWK_NULL; + + val->v_type = HAWK_VAL_FUN; + val->ref = 0; + val->stat = 0; + val->nstr = 0; + val->fcb = 0; + val->fun = (hawk_fun_t*)fun; + + return (hawk_val_t*)val; +} + +int HAWK_INLINE hawk_rtx_isstaticval (hawk_rtx_t* rtx, hawk_val_t* val) +{ + return HAWK_VTR_IS_POINTER(val) && IS_STATICVAL(val); +} + +int hawk_rtx_getvaltype (hawk_rtx_t* rtx, hawk_val_t* val) +{ + return HAWK_RTX_GETVALTYPE(rtx, val); +} + +const hawk_ooch_t* hawk_rtx_getvaltypename(hawk_rtx_t* rtx, hawk_val_t* val) +{ + static const hawk_ooch_t* __val_type_name[] = + { + /* synchronize this table with enum hawk_val_type_t in awk.h */ + HAWK_T("nil"), + HAWK_T("int"), + HAWK_T("flt"), + HAWK_T("str"), + HAWK_T("mbs"), + HAWK_T("fun"), + HAWK_T("map"), + HAWK_T("rex"), + HAWK_T("ref") + }; + + return __val_type_name[HAWK_RTX_GETVALTYPE(rtx, val)]; +} + + +int hawk_rtx_getintfromval (hawk_rtx_t* rtx, hawk_val_t* val) +{ + return HAWK_RTX_GETINTFROMVAL(rtx, val); +} + +void hawk_rtx_freeval (hawk_rtx_t* rtx, hawk_val_t* val, int cache) +{ + hawk_val_type_t vtype; + + if (HAWK_VTR_IS_POINTER(val)) + { + if (IS_STATICVAL(val)) return; + + #if defined(DEBUG_VAL) + hawk_logfmt (hawk_rtx_getawk(rtx), HAWK_T("freeing [cache=%d] - [%O]\n"), cache, val); + #endif + + vtype = HAWK_RTX_GETVALTYPE (rtx, val); + switch (vtype) + { + case HAWK_VAL_NIL: + { + hawk_rtx_freemem (rtx, val); + break; + } + + case HAWK_VAL_INT: + { + ((hawk_val_int_t*)val)->nde = (hawk_nde_int_t*)rtx->vmgr.ifree; + rtx->vmgr.ifree = (hawk_val_int_t*)val; + break; + } + + case HAWK_VAL_FLT: + { + ((hawk_val_flt_t*)val)->nde = (hawk_nde_flt_t*)rtx->vmgr.rfree; + rtx->vmgr.rfree = (hawk_val_flt_t*)val; + break; + } + + case HAWK_VAL_STR: + { + #if defined(ENABLE_FEATURE_SCACHE) + if (cache) + { + hawk_val_str_t* v = (hawk_val_str_t*)val; + int i; + + i = v->val.len / FEATURE_SCACHE_BLOCK_UNIT; + if (i < HAWK_COUNTOF(rtx->scache_count) && + rtx->scache_count[i] < HAWK_COUNTOF(rtx->scache[i])) + { + rtx->scache[i][rtx->scache_count[i]++] = v; + v->nstr = 0; + } + else hawk_rtx_freemem (rtx, val); + } + else + #endif + hawk_rtx_freemem (rtx, val); + + break; + } + + case HAWK_VAL_MBS: + hawk_rtx_freemem (rtx, val); + break; + + case HAWK_VAL_REX: + { + /* don't free ptr as it is inlined to val + hawk_rtx_freemem (rtx, ((hawk_val_rex_t*)val)->ptr); + */ + + /* code is just a pointer to a regular expression stored + * in parse tree nodes. so don't free it. + hawk_freerex (rtx->awk, ((hawk_val_rex_t*)val)->code[0], ((hawk_val_rex_t*)val)->code[1]); + */ + + hawk_rtx_freemem (rtx, val); + break; + } + + case HAWK_VAL_FUN: + hawk_rtx_freemem (rtx, val); + break; + + case HAWK_VAL_MAP: + { + hawk_htb_fini (((hawk_val_map_t*)val)->map); + hawk_rtx_freemem (rtx, val); + break; + } + + case HAWK_VAL_REF: + { + if (cache && rtx->rcache_count < HAWK_COUNTOF(rtx->rcache)) + { + rtx->rcache[rtx->rcache_count++] = (hawk_val_ref_t*)val; + } + else hawk_rtx_freemem (rtx, val); + break; + } + + } + } +} + +void hawk_rtx_refupval (hawk_rtx_t* rtx, hawk_val_t* val) +{ + if (HAWK_VTR_IS_POINTER(val)) + { + if (IS_STATICVAL(val)) return; + + #if defined(DEBUG_VAL) + hawk_logfmt (hawk_rtx_getawk(rtx), HAWK_T("ref up [ptr=%p] [count=%d] - [%O]\n"), val, (int)val->ref, val); + #endif + val->ref++; + } +} + +void hawk_rtx_refdownval (hawk_rtx_t* rtx, hawk_val_t* val) +{ + if (HAWK_VTR_IS_POINTER(val)) + { + if (IS_STATICVAL(val)) return; + + #if defined(DEBUG_VAL) + hawk_logfmt (hawk_rtx_getawk(rtx), HAWK_T("ref down [ptr=%p] [count=%d] - [%O]\n"), val, (int)val->ref, val); + #endif + + /* the reference count of a value should be greater than zero for it to be decremented. check the source code for any bugs */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), val->ref > 0); + + + val->ref--; + if (val->ref <= 0) + { + hawk_rtx_freeval(rtx, val, 1); + } + } +} + +void hawk_rtx_refdownval_nofree (hawk_rtx_t* rtx, hawk_val_t* val) +{ + if (HAWK_VTR_IS_POINTER(val)) + { + if (IS_STATICVAL(val)) return; + + /* the reference count of a value should be greater than zero for it to be decremented. check the source code for any bugs */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), val->ref > 0); + + val->ref--; + } +} + +void hawk_rtx_freevalchunk (hawk_rtx_t* rtx, hawk_val_chunk_t* chunk) +{ + while (chunk != HAWK_NULL) + { + hawk_val_chunk_t* next = chunk->next; + hawk_rtx_freemem (rtx, chunk); + chunk = next; + } +} + +static int val_ref_to_bool (hawk_rtx_t* rtx, const hawk_val_ref_t* ref) +{ + switch (ref->id) + { + case HAWK_VAL_REF_POS: + { + hawk_oow_t idx; + + idx = (hawk_oow_t)ref->adr; + if (idx == 0) + { + return HAWK_OOECS_LEN(&rtx->inrec.line) > 0; + } + else if (idx <= rtx->inrec.nflds) + { + return rtx->inrec.flds[idx-1].len > 0; + } + else + { + /* the index is greater than the number of records. + * it's an empty string. so false */ + return 0; + } + } + case HAWK_VAL_REF_GBL: + { + hawk_oow_t idx; + idx = (hawk_oow_t)ref->adr; + return hawk_rtx_valtobool(rtx, RTX_STACK_GBL (rtx, idx)); + } + + default: + { + hawk_val_t** xref = (hawk_val_t**)ref->adr; + + /* A reference value is not able to point to another + * refernce value for the way values are represented + * in HAWKAWK */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), HAWK_RTX_GETVALTYPE (rtx, *xref)!= HAWK_VAL_REF); + + /* make a recursive call back to the caller */ + return hawk_rtx_valtobool(rtx, *xref); + } + } +} + +int hawk_rtx_valtobool (hawk_rtx_t* rtx, const hawk_val_t* val) +{ + hawk_val_type_t vtype; + + if (val == HAWK_NULL) return 0; + + vtype = HAWK_RTX_GETVALTYPE(rtx, val); + switch (vtype) + { + case HAWK_VAL_NIL: + return 0; + case HAWK_VAL_INT: + return HAWK_RTX_GETINTFROMVAL(rtx, val) != 0; + case HAWK_VAL_FLT: + return ((hawk_val_flt_t*)val)->val != 0.0; + case HAWK_VAL_STR: + return ((hawk_val_str_t*)val)->val.len > 0; + case HAWK_VAL_MBS: + return ((hawk_val_mbs_t*)val)->val.len > 0; + case HAWK_VAL_REX: /* TODO: is this correct? */ + return ((hawk_val_rex_t*)val)->str.len > 0; + case HAWK_VAL_FUN: + /* return always true */ + return 1; + case HAWK_VAL_MAP: + /* true if the map size is greater than 0. false if not */ + return HAWK_HTB_SIZE(((hawk_val_map_t*)val)->map) > 0; + case HAWK_VAL_REF: + return val_ref_to_bool(rtx, (hawk_val_ref_t*)val); + } + + /* the type of a value should be one of HAWK_VAL_XXX enumerators defined in hawk-prv.h */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), !"should never happen - invalid value type"); + + return 0; +} + +static int str_to_str (hawk_rtx_t* rtx, const hawk_ooch_t* str, hawk_oow_t str_len, hawk_rtx_valtostr_out_t* out) +{ + int type = out->type & ~HAWK_RTX_VALTOSTR_PRINT; + + switch (type) + { + case HAWK_RTX_VALTOSTR_CPL: + { + out->u.cpl.len = str_len; + out->u.cpl.ptr = (hawk_ooch_t*)str; + return 0; + } + + case HAWK_RTX_VALTOSTR_CPLCPY: + { + if (str_len >= out->u.cplcpy.len) + { + hawk_rtx_seterrnum (rtx, HAWK_EINVAL, HAWK_NULL); + /*out->u.cplcpy.len = str_len + 1;*/ /* set the required length */ + return -1; + } + + out->u.cplcpy.len = hawk_copy_oochars_to_oocstr_unlimited(out->u.cplcpy.ptr, str, str_len); + return 0; + } + + case HAWK_RTX_VALTOSTR_CPLDUP: + { + hawk_ooch_t* tmp; + + tmp = hawk_rtx_dupoochars(rtx, str, str_len); + if (!tmp) return -1; + + out->u.cpldup.ptr = tmp; + out->u.cpldup.len = str_len; + return 0; + } + + case HAWK_RTX_VALTOSTR_STRP: + { + hawk_oow_t n; + + hawk_ooecs_clear (out->u.strp); + n = hawk_ooecs_ncat(out->u.strp, str, str_len); + if (n == (hawk_oow_t)-1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + return 0; + } + + case HAWK_RTX_VALTOSTR_STRPCAT: + { + hawk_oow_t n; + + n = hawk_ooecs_ncat(out->u.strpcat, str, str_len); + if (n == (hawk_oow_t)-1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + return 0; + } + } + + hawk_rtx_seterrnum (rtx, HAWK_EINVAL, HAWK_NULL); + return -1; +} + +#if defined(HAWK_OOCH_IS_BCH) +# define mbs_to_str(rtx,str,str_len,out) str_to_str(rtx,str,str_len,out) +#else +static int mbs_to_str (hawk_rtx_t* rtx, const hawk_bch_t* str, hawk_oow_t str_len, hawk_rtx_valtostr_out_t* out) +{ + int type = out->type & ~HAWK_RTX_VALTOSTR_PRINT; + + switch (type) + { + case HAWK_RTX_VALTOSTR_CPL: + /* conversion is required. i can't simply return it. let CPL + * behave like CPLCPY. fall thru */ + case HAWK_RTX_VALTOSTR_CPLCPY: + { + hawk_oow_t ucslen; + if (HAWK_UNLIKELY(out->u.cplcpy.len <= 0)) + { + hawk_rtx_seterrnum (rtx, HAWK_EBUFFULL, HAWK_NULL); + return -1; + } + /* hawk_rtx_convbtouchars() doesn't null terminate the result. -1 to secure space for '\0' */ + ucslen = out->u.cplcpy.len - 1; + if (hawk_rtx_convbtouchars(rtx, str, &str_len, out->u.cplcpy.ptr, &ucslen, 1) <= -1) return -1; + + out->u.cplcpy.ptr[ucslen] = HAWK_T('\0'); + out->u.cplcpy.len = ucslen; + + return 0; + } + + case HAWK_RTX_VALTOSTR_CPLDUP: + { + hawk_ooch_t* tmp; + hawk_oow_t wcslen; + + tmp = hawk_rtx_dupbtouchars(rtx, str, str_len, &wcslen, 1); + if (!tmp) return -1; + + out->u.cpldup.ptr = tmp; + out->u.cpldup.len = wcslen; + return 0; + } + + case HAWK_RTX_VALTOSTR_STRP: + hawk_ooecs_clear (out->u.strp); + if (hawk_uecs_ncatbchars(out->u.strp, str, str_len, hawk_rtx_getcmgr(rtx), 1) == (hawk_oow_t)-1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + return 0; + + case HAWK_RTX_VALTOSTR_STRPCAT: + if (hawk_uecs_ncatbchars(out->u.strpcat, str, str_len, hawk_rtx_getcmgr(rtx), 1) == (hawk_oow_t)-1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + return 0; + } + + hawk_rtx_seterrnum (rtx, HAWK_EINVAL, HAWK_NULL); + return -1; +} +#endif + + +static int val_int_to_str (hawk_rtx_t* rtx, const hawk_val_int_t* v, hawk_rtx_valtostr_out_t* out) +{ + hawk_ooch_t* tmp; + hawk_oow_t rlen = 0; + int type = out->type & ~HAWK_RTX_VALTOSTR_PRINT; + hawk_int_t orgval = HAWK_RTX_GETINTFROMVAL (rtx, v); + hawk_uint_t t; + + if (orgval == 0) rlen++; + else + { + /* non-zero values */ + if (orgval < 0) + { + t = orgval * -1; rlen++; + } + else t = orgval; + while (t > 0) { rlen++; t /= 10; } + } + + switch (type) + { + case HAWK_RTX_VALTOSTR_CPL: + /* CPL and CPLCP behave the same for int_t. + * i just fall through assuming that cplcpy + * and cpl are the same type. the following + * assertion at least ensure that they have + * the same size. */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), HAWK_SIZEOF(out->u.cpl) == HAWK_SIZEOF(out->u.cplcpy)); + + case HAWK_RTX_VALTOSTR_CPLCPY: + if (rlen >= out->u.cplcpy.len) + { + hawk_rtx_seterrnum (rtx, HAWK_EINVAL, HAWK_NULL); + /* store the buffer size needed */ + out->u.cplcpy.len = rlen + 1; + return -1; + } + + tmp = out->u.cplcpy.ptr; + tmp[rlen] = HAWK_T('\0'); + out->u.cplcpy.len = rlen; + break; + + case HAWK_RTX_VALTOSTR_CPLDUP: + tmp = hawk_rtx_allocmem(rtx, (rlen + 1) * HAWK_SIZEOF(hawk_ooch_t)); + if (!tmp) return -1; + + tmp[rlen] = HAWK_T('\0'); + out->u.cpldup.ptr = tmp; + out->u.cpldup.len = rlen; + break; + + case HAWK_RTX_VALTOSTR_STRP: + { + hawk_oow_t n; + + hawk_ooecs_clear (out->u.strp); + HAWK_ASSERT (hawk_rtx_getawk(rtx), HAWK_OOECS_LEN(out->u.strp) == 0); + + /* point to the beginning of the buffer */ + tmp = HAWK_OOECS_PTR(out->u.strp); + + /* extend the buffer */ + n = hawk_ooecs_nccat(out->u.strp, HAWK_T(' '), rlen); + if (n == (hawk_oow_t)-1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + break; + } + + case HAWK_RTX_VALTOSTR_STRPCAT: + { + hawk_oow_t n; + + /* point to the insertion point */ + tmp = HAWK_OOECS_PTR(out->u.strpcat) + HAWK_OOECS_LEN(out->u.strpcat); + + /* extend the buffer */ + n = hawk_ooecs_nccat(out->u.strpcat, HAWK_T(' '), rlen); + if (n == (hawk_oow_t)-1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + break; + } + + default: + { + hawk_rtx_seterrnum (rtx, HAWK_EINVAL, HAWK_NULL); + return -1; + } + } + + if (orgval == 0) tmp[0] = HAWK_T('0'); + else + { + t = (orgval < 0)? (orgval * -1): orgval; + + /* fill in the buffer with digits */ + while (t > 0) + { + tmp[--rlen] = (hawk_ooch_t)(t % 10) + HAWK_T('0'); + t /= 10; + } + + /* insert the negative sign if necessary */ + if (orgval < 0) tmp[--rlen] = HAWK_T('-'); + } + + return 0; +} + +static int val_flt_to_str (hawk_rtx_t* rtx, const hawk_val_flt_t* v, hawk_rtx_valtostr_out_t* out) +{ + hawk_ooch_t* tmp; + hawk_oow_t tmp_len; + hawk_ooecs_t buf, fbu; + int buf_inited = 0, fbu_inited = 0; + int type = out->type & ~HAWK_RTX_VALTOSTR_PRINT; + + if (out->type & HAWK_RTX_VALTOSTR_PRINT) + { + tmp = rtx->gbl.ofmt.ptr; + tmp_len = rtx->gbl.ofmt.len; + } + else + { + tmp = rtx->gbl.convfmt.ptr; + tmp_len = rtx->gbl.convfmt.len; + } + + if (hawk_ooecs_init(&buf, hawk_rtx_getawk(rtx), 256) <= -1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + buf_inited = 1; + + if (hawk_ooecs_init(&fbu, hawk_rtx_getawk(rtx), 256) <= -1) + { + hawk_ooecs_fini (&buf); + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + return -1; + } + fbu_inited = 1; + + tmp = hawk_rtx_format(rtx, &buf, &fbu, tmp, tmp_len, (hawk_oow_t)-1, (hawk_nde_t*)v, &tmp_len); + if (tmp == HAWK_NULL) goto oops; + + switch (type) + { + case HAWK_RTX_VALTOSTR_CPL: + /* CPL and CPLCP behave the same for flt_t. + * i just fall through assuming that cplcpy + * and cpl are the same type. the following + * assertion at least ensure that they have + * the same size. */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), HAWK_SIZEOF(out->u.cpl) == HAWK_SIZEOF(out->u.cplcpy)); + + case HAWK_RTX_VALTOSTR_CPLCPY: + if (out->u.cplcpy.len <= tmp_len) + { + hawk_rtx_seterrnum (rtx, HAWK_EINVAL, HAWK_NULL); + /* store the buffer size required */ + out->u.cplcpy.len = tmp_len + 1; + goto oops; + } + + hawk_copy_oochars_to_oocstr_unlimited (out->u.cplcpy.ptr, tmp, tmp_len); + out->u.cplcpy.len = tmp_len; + break; + + case HAWK_RTX_VALTOSTR_CPLDUP: + { + hawk_ooecs_yield (&buf, HAWK_NULL, 0); + out->u.cpldup.ptr = tmp; + out->u.cpldup.len = tmp_len; + break; + } + + case HAWK_RTX_VALTOSTR_STRP: + { + hawk_oow_t n; + + hawk_ooecs_clear (out->u.strp); + + n = hawk_ooecs_ncat(out->u.strp, tmp, tmp_len); + if (n == (hawk_oow_t)-1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + goto oops; + } + break; + } + + case HAWK_RTX_VALTOSTR_STRPCAT: + { + hawk_oow_t n; + + n = hawk_ooecs_ncat(out->u.strpcat, tmp, tmp_len); + if (n == (hawk_oow_t)-1) + { + hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL); + goto oops; + } + break; + } + + default: + { + hawk_rtx_seterrnum (rtx, HAWK_EINVAL, HAWK_NULL); + goto oops; + } + } + + hawk_ooecs_fini (&fbu); + hawk_ooecs_fini (&buf); + return 0; + +oops: + if (fbu_inited) hawk_ooecs_fini (&fbu); + if (buf_inited) hawk_ooecs_fini (&buf); + return -1; +} + +static int val_ref_to_str (hawk_rtx_t* rtx, const hawk_val_ref_t* ref, hawk_rtx_valtostr_out_t* out) +{ + switch (ref->id) + { + case HAWK_VAL_REF_POS: + { + hawk_oow_t idx; + + /* special case when the reference value is + * pointing to the positional */ + + idx = (hawk_oow_t)ref->adr; + if (idx == 0) + { + return str_to_str( + rtx, + HAWK_OOECS_PTR(&rtx->inrec.line), + HAWK_OOECS_LEN(&rtx->inrec.line), + out + ); + } + else if (idx <= rtx->inrec.nflds) + { + return str_to_str( + rtx, + rtx->inrec.flds[idx-1].ptr, + rtx->inrec.flds[idx-1].len, + out + ); + } + else + { + return str_to_str(rtx, HAWK_T(""), 0, out); + } + } + + case HAWK_VAL_REF_GBL: + { + hawk_oow_t idx = (hawk_oow_t)ref->adr; + return hawk_rtx_valtostr (rtx, RTX_STACK_GBL (rtx, idx), out); + } + + default: + { + hawk_val_t** xref = (hawk_val_t**)ref->adr; + + /* A reference value is not able to point to another + * refernce value for the way values are represented + * in HAWKAWK */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), HAWK_RTX_GETVALTYPE (rtx, *xref) != HAWK_VAL_REF); + + /* make a recursive call back to the caller */ + return hawk_rtx_valtostr (rtx, *xref, out); + } + } +} + +int hawk_rtx_valtostr (hawk_rtx_t* rtx, const hawk_val_t* v, hawk_rtx_valtostr_out_t* out) +{ + hawk_val_type_t vtype = HAWK_RTX_GETVALTYPE(rtx, v); + + switch (vtype) + { + case HAWK_VAL_NIL: + { + return str_to_str(rtx, HAWK_T(""), 0, out); + } + + case HAWK_VAL_INT: + { + return val_int_to_str(rtx, (hawk_val_int_t*)v, out); + } + + case HAWK_VAL_FLT: + { + return val_flt_to_str(rtx, (hawk_val_flt_t*)v, out); + } + + case HAWK_VAL_STR: + { + hawk_val_str_t* vs = (hawk_val_str_t*)v; + return str_to_str(rtx, vs->val.ptr, vs->val.len, out); + } + + case HAWK_VAL_MBS: + { + hawk_val_mbs_t* vs = (hawk_val_mbs_t*)v; + #if defined(HAWK_OOCH_IS_BCH) + return str_to_str(rtx, vs->val.ptr, vs->val.len, out); + #else + return mbs_to_str(rtx, vs->val.ptr, vs->val.len, out); + #endif + } + + case HAWK_VAL_FUN: + { + return str_to_str(rtx, ((hawk_val_fun_t*)v)->fun->name.ptr, ((hawk_val_fun_t*)v)->fun->name.len, out); + } + + case HAWK_VAL_MAP: + { + if (rtx->awk->opt.trait & HAWK_FLEXMAP) + { + return str_to_str(rtx, HAWK_T("#MAP"), 4, out); + } + break; + } + + case HAWK_VAL_REF: + { + return val_ref_to_str(rtx, (hawk_val_ref_t*)v, out); + } + } + + +#if defined(DEBUG_VAL) + hawk_logfmt (hawk_rtx_getawk(rtx), HAWK_T(">>WRONG VALUE TYPE [%d] in hawk_rtx_valtostr\n"), v->type); +#endif + hawk_rtx_seterrnum (rtx, HAWK_EVALTOSTR, HAWK_NULL); + return -1; +} + +hawk_bch_t* hawk_rtx_valtobcstrdupwithcmgr (hawk_rtx_t* rtx, const hawk_val_t* v, hawk_oow_t* len, hawk_cmgr_t* cmgr) +{ + hawk_bch_t* mbs; + hawk_val_type_t vtype; + + vtype = HAWK_RTX_GETVALTYPE(rtx,v); + + switch (vtype) + { + case HAWK_VAL_MBS: + mbs = hawk_rtx_dupbchars(rtx, ((hawk_val_mbs_t*)v)->val.ptr, ((hawk_val_mbs_t*)v)->val.len); + if (!mbs) return HAWK_NULL; + if (len) *len = ((hawk_val_mbs_t*)v)->val.len; + break; + + case HAWK_VAL_STR: + { + #if defined(HAWK_OOCH_IS_BCH) + mbs = hawk_rtx_dupbchars(rtx, ((hawk_val_str_t*)v)->val.ptr, ((hawk_val_str_t*)v)->val.len); + if (!mbs) return HAWK_NULL; + if (len) *len = ((hawk_val_str_t*)v)->val.len; + #else + hawk_oow_t mbslen, wcslen; + wcslen = ((hawk_val_str_t*)v)->val.len; + mbs = hawk_rtx_duputobcharswithcmgr(rtx, ((hawk_val_str_t*)v)->val.ptr, wcslen, &mbslen, cmgr); + if (!mbs) return HAWK_NULL; + if (len) *len = mbslen; + #endif + break; + } + + default: + { + #if defined(HAWK_OOCH_IS_BCH) + hawk_rtx_valtostr_out_t out; + + out.type = HAWK_RTX_VALTOSTR_CPLDUP; + if (hawk_rtx_valtostr(rtx, v, &out) <= -1) return HAWK_NULL; + + mbs = out.u.cpldup.ptr; + if (len) *len = out.u.cpldup.len; + #else + hawk_oow_t mbslen; + hawk_rtx_valtostr_out_t out; + + out.type = HAWK_RTX_VALTOSTR_CPLDUP; + if (hawk_rtx_valtostr(rtx, v, &out) <= -1) return HAWK_NULL; + + mbs = hawk_rtx_duputobcharswithcmgr(rtx, out.u.cpldup.ptr, out.u.cpldup.len, &mbslen, cmgr); + hawk_rtx_freemem (rtx, out.u.cpldup.ptr); + if (!mbs) return HAWK_NULL; + if (len) *len = mbslen; + #endif + break; + } + } + + return mbs; +} + +hawk_uch_t* hawk_rtx_valtoucstrdupwithcmgr (hawk_rtx_t* rtx, const hawk_val_t* v, hawk_oow_t* len, hawk_cmgr_t* cmgr) +{ + hawk_uch_t* wcs; + hawk_val_type_t vtype; + + vtype = HAWK_RTX_GETVALTYPE(rtx,v); + + switch (vtype) + { + case HAWK_VAL_MBS: + { + hawk_oow_t mbslen, wcslen; + mbslen = ((hawk_val_mbs_t*)v)->val.len; + wcs = hawk_rtx_dupbtoucharswithcmgr(rtx, ((hawk_val_mbs_t*)v)->val.ptr, mbslen, &wcslen, cmgr, 1); + if (!wcs) return HAWK_NULL; + if (len) *len = wcslen; + break; + } + + case HAWK_VAL_STR: + { + #if defined(HAWK_OOCH_IS_BCH) + hawk_oow_t wcslen, mbslen; + mbslen = ((hawk_val_str_t*)v)->val.len; + wcs = hawk_rtx_dupbtoucharswithcmgr(rtx, ((hawk_val_str_t*)v)->val.ptr, mbslen, &wcslen, cmgr, 1); + #else + wcs = hawk_rtx_dupuchars(rtx, ((hawk_val_str_t*)v)->val.ptr, ((hawk_val_str_t*)v)->val.len); + #endif + if (!wcs) return HAWK_NULL; + #if defined(HAWK_OOCH_IS_BCH) + if (len) *len = wcslen; + #else + if (len) *len = ((hawk_val_str_t*)v)->val.len; + #endif + break; + } + + default: + { + #if defined(HAWK_OOCH_IS_BCH) + hawk_oow_t wcslen; + hawk_rtx_valtostr_out_t out; + + out.type = HAWK_RTX_VALTOSTR_CPLDUP; + if (hawk_rtx_valtostr(rtx, v, &out) <= -1) return HAWK_NULL; + + wcs = hawk_rtx_dupbtoucharswithcmgr (rtx, out.u.cpldup.ptr, &out.u.cpldup.len, &wcslen, cmgr, 1); + hawk_rtx_freemem (rtx, out.u.cpldup.ptr); + if (!wcs) return HAWK_NULL; + + if (len) *len = wcslen; + #else + hawk_rtx_valtostr_out_t out; + + out.type = HAWK_RTX_VALTOSTR_CPLDUP; + if (hawk_rtx_valtostr(rtx, v, &out) <= -1) return HAWK_NULL; + + wcs = out.u.cpldup.ptr; + if (len) *len = out.u.cpldup.len; + #endif + break; + } + } + return wcs; +} + +hawk_ooch_t* hawk_rtx_getvaloocstrwithcmgr (hawk_rtx_t* rtx, const hawk_val_t* v, hawk_oow_t* len, hawk_cmgr_t* cmgr) +{ + if (HAWK_RTX_GETVALTYPE(rtx, v) == HAWK_VAL_STR) + { + if (len) *len = ((hawk_val_str_t*)v)->val.len; + return ((hawk_val_str_t*)v)->val.ptr; + } + else + { + return hawk_rtx_valtooocstrdupwithcmgr(rtx, v, len, cmgr); + } +} + +void hawk_rtx_freevaloocstr (hawk_rtx_t* rtx, const hawk_val_t* v, hawk_ooch_t* str) +{ + if (HAWK_RTX_GETVALTYPE(rtx, v) != HAWK_VAL_STR || + str != ((hawk_val_str_t*)v)->val.ptr) + { + hawk_rtx_freemem (rtx, str); + } +} + +hawk_bch_t* hawk_rtx_getvalbcstrwithcmgr (hawk_rtx_t* rtx, const hawk_val_t* v, hawk_oow_t* len, hawk_cmgr_t* cmgr) +{ + if (HAWK_RTX_GETVALTYPE(rtx, v) == HAWK_VAL_MBS) + { + if (len) *len = ((hawk_val_mbs_t*)v)->val.len; + return ((hawk_val_mbs_t*)v)->val.ptr; + } + else + { + return hawk_rtx_valtobcstrdupwithcmgr(rtx, v, len, cmgr); + } +} + +void hawk_rtx_freevalbcstr (hawk_rtx_t* rtx, const hawk_val_t* v, hawk_bch_t* str) +{ + if (HAWK_RTX_GETVALTYPE(rtx, v) != HAWK_VAL_MBS || + str != ((hawk_val_mbs_t*)v)->val.ptr) + { + hawk_rtx_freemem (rtx, str); + } +} + +static int val_ref_to_num (hawk_rtx_t* rtx, const hawk_val_ref_t* ref, hawk_int_t* l, hawk_flt_t* r) +{ + switch (ref->id) + { + case HAWK_VAL_REF_POS: + { + hawk_oow_t idx; + + idx = (hawk_oow_t)ref->adr; + if (idx == 0) + { + return hawk_rtx_oocharstonum( + rtx, + HAWK_RTX_OOCSTRTONUM_MAKE_OPTION(0, 0), + HAWK_OOECS_PTR(&rtx->inrec.line), + HAWK_OOECS_LEN(&rtx->inrec.line), + l, r + ); + } + else if (idx <= rtx->inrec.nflds) + { + return hawk_rtx_oocharstonum( + rtx, + HAWK_RTX_OOCSTRTONUM_MAKE_OPTION(0, 0), + rtx->inrec.flds[idx-1].ptr, + rtx->inrec.flds[idx-1].len, + l, r + ); + } + else + { + return hawk_rtx_oocharstonum( + rtx, HAWK_RTX_OOCSTRTONUM_MAKE_OPTION(0, 0), HAWK_T(""), 0, l, r + ); + } + } + + case HAWK_VAL_REF_GBL: + { + hawk_oow_t idx = (hawk_oow_t)ref->adr; + return hawk_rtx_valtonum (rtx, RTX_STACK_GBL (rtx, idx), l, r); + } + + default: + { + hawk_val_t** xref = (hawk_val_t**)ref->adr; + + /* A reference value is not able to point to another + * refernce value for the way values are represented + * in HAWKAWK */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), HAWK_RTX_GETVALTYPE(rtx, *xref) != HAWK_VAL_REF); + + /* make a recursive call back to the caller */ + return hawk_rtx_valtonum(rtx, *xref, l, r); + } + } +} + + +int hawk_rtx_valtonum (hawk_rtx_t* rtx, const hawk_val_t* v, hawk_int_t* l, hawk_flt_t* r) +{ + hawk_val_type_t vtype = HAWK_RTX_GETVALTYPE(rtx, v); + + switch (vtype) + { + case HAWK_VAL_NIL: + { + *l = 0; + return 0; + } + + case HAWK_VAL_INT: + { + *l = HAWK_RTX_GETINTFROMVAL (rtx, v); + return 0; /* long */ + } + + case HAWK_VAL_FLT: + { + *r = ((hawk_val_flt_t*)v)->val; + return 1; /* real */ + } + + case HAWK_VAL_STR: + { + return hawk_rtx_oocharstonum( + rtx, + HAWK_RTX_OOCSTRTONUM_MAKE_OPTION(0, 0), + ((hawk_val_str_t*)v)->val.ptr, + ((hawk_val_str_t*)v)->val.len, + l, r + ); + } + + case HAWK_VAL_MBS: + { + return hawk_rtx_bcharstonum( + rtx, + HAWK_RTX_OOCSTRTONUM_MAKE_OPTION(0, 0), + ((hawk_val_mbs_t*)v)->val.ptr, + ((hawk_val_mbs_t*)v)->val.len, + l, r + ); + } + + case HAWK_VAL_FUN: + { + /* unable to convert a function to a number */ + break; + } + + case HAWK_VAL_MAP: + { + if (rtx->awk->opt.trait & HAWK_FLEXMAP) + { + *l = HAWK_HTB_SIZE(((hawk_val_map_t*)v)->map); + return 0; /* long */ + } + break; + } + + case HAWK_VAL_REF: + { + return val_ref_to_num(rtx, (hawk_val_ref_t*)v, l, r); + } + } + +#if defined(DEBUG_VAL) + hawk_logfmt (hawk_rtx_getawk(rtx), HAWK_T(">>WRONG VALUE TYPE [%d] in hawk_rtx_valtonum()\n"), v->type); +#endif + + hawk_rtx_seterrnum (rtx, HAWK_EVALTONUM, HAWK_NULL); + return -1; /* error */ +} + +int hawk_rtx_valtoint (hawk_rtx_t* rtx, const hawk_val_t* v, hawk_int_t* l) +{ + int n; + hawk_flt_t r; + + n = hawk_rtx_valtonum(rtx, v, l, &r); + if (n == 1) + { + *l = (hawk_int_t)r; + n = 0; + } + + return n; +} + +int hawk_rtx_valtoflt (hawk_rtx_t* rtx, const hawk_val_t* v, hawk_flt_t* r) +{ + int n; + hawk_int_t l; + + n = hawk_rtx_valtonum(rtx, v, &l, r); + if (n == 0) *r = (hawk_flt_t)l; + else if (n == 1) n = 0; + + return n; +} + +/* ========================================================================== */ +#undef awk_rtx_strtonum +#undef awk_strxtoint +#undef awk_strxtoflt +#undef char_t +#undef AWK_ISDIGIT +#undef _T + +#define awk_rtx_strtonum hawk_rtx_bcharstonum +#define awk_strxtoint hawk_bcharstoint +#define awk_strxtoflt hawk_bcharstoflt +#define char_t hawk_bch_t +#define AWK_ISDIGIT hawk_is_bch_digit +#define _T HAWK_BT +#include "val-imp.h" + +/* ------------------------------------------------------------------------- */ +#undef awk_rtx_strtonum +#undef awk_strxtoint +#undef awk_strxtoflt +#undef char_t +#undef AWK_ISDIGIT +#undef _T +/* ------------------------------------------------------------------------- */ + +#define awk_rtx_strtonum hawk_rtx_ucharstonum +#define awk_strxtoint hawk_ucharstoint +#define awk_strxtoflt hawk_ucharstoflt +#define char_t hawk_uch_t +#define AWK_ISDIGIT hawk_is_uch_digit +#define _T HAWK_UT +#include "val-imp.h" + +#undef awk_rtx_strtonum +#undef awk_strxtoint +#undef awk_strxtoflt +#undef char_t +#undef AWK_ISDIGIT +#undef _T +/* ========================================================================== */ + +static HAWK_INLINE hawk_uint_t hash (hawk_uint8_t* ptr, hawk_oow_t len) +{ + hawk_uint_t h; + HAWK_HASH_BYTES (h, ptr, len); + return h; +} + +hawk_int_t hawk_rtx_hashval (hawk_rtx_t* rtx, hawk_val_t* v) +{ + hawk_val_type_t vtype = HAWK_RTX_GETVALTYPE (rtx, v); + hawk_int_t hv; + + switch (vtype) + { + case HAWK_VAL_NIL: + hv = 0; + break; + + case HAWK_VAL_INT: + { + hawk_int_t tmp = HAWK_RTX_GETINTFROMVAL(rtx, v); + /*hv = ((hawk_val_int_t*)v)->val;*/ + hv = (hawk_int_t)hash((hawk_uint8_t*)&tmp, HAWK_SIZEOF(tmp)); + break; + } + + case HAWK_VAL_FLT: + { + hawk_val_flt_t* dv = (hawk_val_flt_t*)v; + hv = (hawk_int_t)hash((hawk_uint8_t*)&dv->val, HAWK_SIZEOF(dv->val)); + break; + } + + case HAWK_VAL_STR: + { + hawk_val_str_t* dv = (hawk_val_str_t*)v; + hv = (hawk_int_t)hash((hawk_uint8_t*)dv->val.ptr, dv->val.len * HAWK_SIZEOF(*dv->val.ptr)); + break; + } + + case HAWK_VAL_MBS: + { + hawk_val_mbs_t* dv = (hawk_val_mbs_t*)v; + hv = (hawk_int_t)hash((hawk_uint8_t*)dv->val.ptr, dv->val.len * HAWK_SIZEOF(*dv->val.ptr)); + break; + } + + default: + +#if defined(DEBUG_VAL) + hawk_logfmt (hawk_rtx_getawk(rtx), HAWK_T(">>WRONG VALUE TYPE [%d] in hawk_rtx_hashval()\n"), v->type); +#endif + hawk_rtx_seterrnum (rtx, HAWK_EHASHVAL, HAWK_NULL); + return -1; + } + + /* turn off the sign bit */ + return hv & ~(((hawk_uint_t)1) << ((HAWK_SIZEOF(hawk_uint_t) * 8) - 1)); +} + +hawk_val_type_t hawk_rtx_getrefvaltype (hawk_rtx_t* rtx, hawk_val_ref_t* ref) +{ + /* return the type of the value that the reference points to */ + switch (ref->id) + { + case HAWK_VAL_REF_POS: + { + return HAWK_VAL_STR; + } + case HAWK_VAL_REF_GBL: + { + hawk_oow_t idx; + hawk_val_t* v; + idx = (hawk_oow_t)ref->adr; + v = RTX_STACK_GBL(rtx, idx); + return HAWK_RTX_GETVALTYPE(rtx, v); + } + + default: + { + hawk_val_t** xref = (hawk_val_t**)ref->adr; + hawk_val_t* v; + + /* A reference value is not able to point to another + * refernce value for the way values are represented + * in HAWKAWK */ + v = *xref; + HAWK_ASSERT (hawk_rtx_getawk(rtx), HAWK_RTX_GETVALTYPE(rtx, v) != HAWK_VAL_REF); + return HAWK_RTX_GETVALTYPE(rtx, v); + } + } +} + +hawk_val_t* hawk_rtx_getrefval (hawk_rtx_t* rtx, hawk_val_ref_t* ref) +{ + switch (ref->id) + { + case HAWK_VAL_REF_POS: + { + /* a positional doesn't contain a value. you should use hawk_rtx_valtoXXX() + * like hawk_rtx_valtostr(), hawk_rtx_valtoint() */ + return HAWK_NULL; + } + + case HAWK_VAL_REF_GBL: + { + hawk_oow_t idx; + idx = (hawk_oow_t)ref->adr; + return RTX_STACK_GBL(rtx, idx); + } + + default: + { + hawk_val_t** xref = (hawk_val_t**)ref->adr; + /* A reference value is not able to point to another + * refernce value for the way values are represented + * in HAWKAWK */ + HAWK_ASSERT (hawk_rtx_getawk(rtx), HAWK_RTX_GETVALTYPE (rtx, *xref)!= HAWK_VAL_REF); + return *xref; + } + } +} + +int hawk_rtx_setrefval (hawk_rtx_t* rtx, hawk_val_ref_t* ref, hawk_val_t* val) +{ + hawk_val_type_t vtype = HAWK_RTX_GETVALTYPE (rtx, val); + + if (vtype == HAWK_VAL_REX || vtype == HAWK_VAL_REF) + { + /* though it is possible that an intrinsic function handler + * can accept a regular expression withtout evaluation when 'x' + * is specified for the parameter, this function doesn't allow + * regular expression to be set to a reference variable to + * avoid potential chaos. the nature of performing '/rex/ ~ $0' + * for a regular expression without the match operator + * makes it difficult to be implemented. */ + hawk_rtx_seterrnum (rtx, HAWK_EINVAL, HAWK_NULL); + return -1; + } + + switch (ref->id) + { + case HAWK_VAL_REF_POS: + { + switch (vtype) + { + case HAWK_VAL_MAP: + /* a map is assigned to a positional. this is disallowed. */ + hawk_rtx_seterrnum (rtx, HAWK_EMAPTOPOS, HAWK_NULL); + return -1; + + case HAWK_VAL_STR: + { + int x; + /* handle this separately from the default case + * for no duplication. jumping to the default case + * and callinghawk_rtx_valtooocstrdup() would also work, anyway. */ + hawk_rtx_refupval (rtx, val); + x = hawk_rtx_setrec(rtx, (hawk_oow_t)ref->adr, &((hawk_val_str_t*)val)->val); + hawk_rtx_refdownval (rtx, val); + return x; + } + + case HAWK_VAL_MBS: + #if defined(HAWK_OOCH_IS_BCH) + { + /* same as str in the mchar mode */ + int x; + hawk_rtx_refupval (rtx, val); + x = hawk_rtx_setrec(rtx, (hawk_oow_t)ref->adr, &((hawk_val_mbs_t*)val)->val); + hawk_rtx_refdownval (rtx, val); + return x; + } + #endif + /* fall thru otherwise */ + + default: + { + hawk_oocs_t str; + int x; + + str.ptr = hawk_rtx_valtooocstrdup(rtx, val, &str.len); + hawk_rtx_refupval (rtx, val); + x = hawk_rtx_setrec(rtx, (hawk_oow_t)ref->adr, &str); + hawk_rtx_refdownval (rtx, val); + hawk_rtx_freemem (rtx, str.ptr); + return x; + } + } + } + + case HAWK_VAL_REF_GBL: + /* ref->adr is the index to the global variables, not a real pointer address for HAWK_VAL_REF_GBL */ + return hawk_rtx_setgbl(rtx, (int)ref->adr, val); + + case HAWK_VAL_REF_NAMEDIDX: + case HAWK_VAL_REF_GBLIDX: + case HAWK_VAL_REF_LCLIDX: + case HAWK_VAL_REF_ARGIDX: + if (vtype == HAWK_VAL_MAP) + { + /* an indexed variable cannot be assigned a map. + * in other cases, it falls down to the default case. */ + hawk_rtx_seterrnum (rtx, HAWK_EMAPTOIDX, HAWK_NULL); + return -1; + } + /* fall through */ + + default: + { + hawk_val_t** rref; + hawk_val_type_t rref_vtype; + + rref = (hawk_val_t**)ref->adr; /* old value pointer */ + rref_vtype = HAWK_RTX_GETVALTYPE(rtx, *rref); /* old value type */ + if (vtype == HAWK_VAL_MAP) + { + /* new value: map, old value: nil or map => ok */ + if (rref_vtype != HAWK_VAL_NIL && rref_vtype != HAWK_VAL_MAP) + { + if (!(rtx->awk->opt.trait & HAWK_FLEXMAP)) + { + /* cannot change a scalar value to a map */ + hawk_rtx_seterrnum (rtx, HAWK_ESCALARTOMAP, HAWK_NULL); + return -1; + } + } + } + else + { + /* new value: scalar, old value: nil or scalar => ok */ + if (rref_vtype == HAWK_VAL_MAP) + { + if (!(rtx->awk->opt.trait & HAWK_FLEXMAP)) + { + hawk_rtx_seterrnum (rtx, HAWK_EMAPTOSCALAR, HAWK_NULL); + return -1; + } + } + } + + if (*rref != val) + { + /* if the new value is not the same as the old value */ + hawk_rtx_refdownval (rtx, *rref); + *rref = val; + hawk_rtx_refupval (rtx, *rref); + } + return 0; + } + } +} + +#if 0 + +#define hawk_errputstrf hawk_errputstrf + +static hawk_htb_walk_t print_pair (hawk_htb_t* map, hawk_htb_pair_t* pair, void* arg) +{ + hawk_rtx_t* run = (hawk_rtx_t*)arg; + + HAWK_ASSERT (hawk_rtx_getawk(rtx), run == *(hawk_rtx_t**)hawk_htb_getxtn(map)); + + hawk_errputstrf (HAWK_T(" %.*s=>"), + (int)HAWK_HTB_KLEN(pair), HAWK_HTB_KPTR(pair)); + hawk_dprintval ((hawk_rtx_t*)arg, HAWK_HTB_VPTR(pair)); + hawk_errputstrf (HAWK_T(" ")); + + return HAWK_HTB_WALK_FORWARD; +} + +void hawk_dprintval (hawk_rtx_t* run, hawk_val_t* val) +{ + /* TODO: better value printing ... */ + + switch (val->type) + { + case HAWK_VAL_NIL: + hawk_errputstrf (HAWK_T("nil")); + break; + + case HAWK_VAL_INT: + hawk_errputstrf (HAWK_T("%jd"), + (hawk_intmax_t)((hawk_val_int_t*)val)->val); + break; + + case HAWK_VAL_FLT: + hawk_errputstrf (HAWK_T("%jf"), + (hawk_fltmax_t)((hawk_val_flt_t*)val)->val); + break; + + case HAWK_VAL_STR: + hawk_errputstrf (HAWK_T("%s"), ((hawk_val_str_t*)val)->ptr); + break; + + case HAWK_VAL_MBS: + hawk_errputstrf (HAWK_T("%hs"), ((hawk_val_mbs_t*)val)->ptr); + break; + + case HAWK_VAL_REX: + hawk_errputstrf (HAWK_T("/%s/"), ((hawk_val_rex_t*)val)->ptr); + break; + + case HAWK_VAL_FUN: + hawk_errputstrf (HAWK_T("%.*s"), (int)((hawk_val_fun_t*)val)->fun->name.len, ((hawk_val_fun_t*)val)->fun->name.ptr); + break; + + case HAWK_VAL_MAP: + hawk_errputstrf (HAWK_T("MAP[")); + hawk_htb_walk (((hawk_val_map_t*)val)->map, print_pair, run); + hawk_errputstrf (HAWK_T("]")); + break; + + case HAWK_VAL_REF: + hawk_errputstrf (HAWK_T("REF[id=%d,val="), ((hawk_val_ref_t*)val)->id); + hawk_dprintval (run, *((hawk_val_ref_t*)val)->adr); + hawk_errputstrf (HAWK_T("]")); + break; + + default: + hawk_errputstrf (HAWK_T("**** INTERNAL ERROR - INVALID VALUE TYPE ****\n")); + } +} + +#endif diff --git a/hawk/m4/ax_check_sign.m4 b/hawk/m4/ax_check_sign.m4 new file mode 100644 index 00000000..3f2e29f7 --- /dev/null +++ b/hawk/m4/ax_check_sign.m4 @@ -0,0 +1,53 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_check_sign.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_SIGN (TYPE, [ACTION-IF-SIGNED], [ACTION-IF-UNSIGNED], [INCLUDES]) +# +# DESCRIPTION +# +# Checks whether TYPE is signed or not. If no INCLUDES are specified, the +# default includes are used. If ACTION-IF-SIGNED is given, it is +# additional shell code to execute when the type is signed. If +# ACTION-IF-UNSIGNED is given, it is executed when the type is unsigned. +# +# This macro assumes that the type exists. Therefore the existence of the +# type should be checked before calling this macro. For example: +# +# AC_CHECK_HEADERS([wchar.h]) +# AC_CHECK_TYPE([wchar_t],,[ AC_MSG_ERROR([Type wchar_t not found.]) ]) +# AX_CHECK_SIGN([wchar_t], +# [ AC_DEFINE(WCHAR_T_SIGNED, 1, [Define if wchar_t is signed]) ], +# [ AC_DEFINE(WCHAR_T_UNSIGNED, 1, [Define if wchar_t is unsigned]) ], [ +# #ifdef HAVE_WCHAR_H +# #include +# #endif +# ]) +# +# LICENSE +# +# Copyright (c) 2008 Ville Laurikari +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 6 + +AC_DEFUN([AX_CHECK_SIGN], [ + typename=`echo $1 | sed "s/@<:@^a-zA-Z0-9_@:>@/_/g"` + AC_CACHE_CHECK([whether $1 is signed], ax_cv_decl_${typename}_signed, [ + AC_TRY_COMPILE([$4], + [ int foo @<:@ 1 - 2 * !((($1) -1) < 0) @:>@ ], + [ eval "ax_cv_decl_${typename}_signed=\"yes\"" ], + [ eval "ax_cv_decl_${typename}_signed=\"no\"" ])]) + symbolname=`echo $1 | sed "s/@<:@^a-zA-Z0-9_@:>@/_/g" | tr "a-z" "A-Z"` + if eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"yes\""; then + $2 + elif eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"no\""; then + $3 + fi +])dnl diff --git a/hawk/m4/ax_cxx_namespace.m4 b/hawk/m4/ax_cxx_namespace.m4 new file mode 100644 index 00000000..e983bef7 --- /dev/null +++ b/hawk/m4/ax_cxx_namespace.m4 @@ -0,0 +1,25 @@ +dnl @synopsis AX_CXX_NAMESPACE_STD +dnl +dnl If the compiler supports namespace std, define +dnl HAVE_CXX_NAMESPACE_STD. +dnl +dnl @category Cxx +dnl @author Todd Veldhuizen +dnl @author Luc Maisonobe +dnl @version 2004-02-04 +dnl @license AllPermissive + +AC_DEFUN([AX_CXX_NAMESPACE_STD], [ + AC_CACHE_CHECK(if c++ supports namespace std, + ax_cv_cxx_have_std_namespace, + [AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include + std::istream& is = std::cin;],, + ax_cv_cxx_have_std_namespace=yes, ax_cv_cxx_have_std_namespace=no) + AC_LANG_RESTORE + ]) + if test "$ax_cv_cxx_have_std_namespace" = yes; then + AC_DEFINE(HAVE_CXX_NAMESPACE_STD,,[Define if c++ supports namespace std. ]) + fi +]) diff --git a/hawk/m4/ax_numval.m4 b/hawk/m4/ax_numval.m4 new file mode 100644 index 00000000..9b307520 --- /dev/null +++ b/hawk/m4/ax_numval.m4 @@ -0,0 +1,25 @@ +# +# This is a blindly modified variant of AC_CHECK_SIZEOF. +# + +# AX_CHECK_NUMVALOF(TYPE, DEFAULT, [INCLUDES = DEFAULT-INCLUDES]) +# --------------------------------------------------------------- +AC_DEFUN([AX_CHECK_NUMVALOF], + [AS_LITERAL_IF(m4_translit([[$1]], [[$2]], [p]), [], + [m4_fatal([$0: requires literal arguments])])] + + [ + _AC_CACHE_CHECK_INT( + [numeric value of $1], + [AS_TR_SH([ax_cv_numvalof_$1])], + [($1)], + [AC_INCLUDES_DEFAULT([$3])], + [AS_TR_SH([ax_cv_numvalof_$1])=$2]) + + AC_DEFINE_UNQUOTED( + AS_TR_CPP(numvalof_$1), + $AS_TR_SH([ax_cv_numvalof_$1]), + [The size of `$1', as computed by valueof.]) + ] +)# AX_CHECK_NUMVALOF + diff --git a/hawk/m4/ax_pthread.m4 b/hawk/m4/ax_pthread.m4 new file mode 100644 index 00000000..5fbf9fe0 --- /dev/null +++ b/hawk/m4/ax_pthread.m4 @@ -0,0 +1,485 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_pthread.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro figures out how to build C programs using POSIX threads. It +# sets the PTHREAD_LIBS output variable to the threads library and linker +# flags, and the PTHREAD_CFLAGS output variable to any special C compiler +# flags that are needed. (The user can also force certain compiler +# flags/libs to be tested by setting these environment variables.) +# +# Also sets PTHREAD_CC to any special C compiler that is needed for +# multi-threaded programs (defaults to the value of CC otherwise). (This +# is necessary on AIX to use the special cc_r compiler alias.) +# +# NOTE: You are assumed to not only compile your program with these flags, +# but also to link with them as well. For example, you might link with +# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# +# If you are only building threaded programs, you may wish to use these +# variables in your default LIBS, CFLAGS, and CC: +# +# LIBS="$PTHREAD_LIBS $LIBS" +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CC="$PTHREAD_CC" +# +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant +# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to +# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# +# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the +# PTHREAD_PRIO_INHERIT symbol is defined when compiling with +# PTHREAD_CFLAGS. +# +# ACTION-IF-FOUND is a list of shell commands to run if a threads library +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it +# is not found. If ACTION-IF-FOUND is not specified, the default action +# will define HAVE_PTHREAD. +# +# Please let the authors know if this macro fails on any platform, or if +# you have any other suggestions or comments. This macro was based on work +# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help +# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by +# Alejandro Forero Cuervo to the autoconf macro repository. We are also +# grateful for the helpful feedback of numerous users. +# +# Updated for Autoconf 2.68 by Daniel Richard G. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2011 Daniel Richard G. +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# 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 General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 24 + +AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) +AC_DEFUN([AX_PTHREAD], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_CC]) +AC_REQUIRE([AC_PROG_SED]) +AC_LANG_PUSH([C]) +ax_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on Tru64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then + ax_pthread_save_CC="$CC" + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) + AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes]) + AC_MSG_RESULT([$ax_pthread_ok]) + if test "x$ax_pthread_ok" = "xno"; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + CC="$ax_pthread_save_CC" + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 +# (Note: HP C rejects this with "bad form for `-t' option") +# -pthreads: Solaris/gcc (Note: HP C also rejects) +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads and +# -D_REENTRANT too), HP C (must be checked before -lpthread, which +# is present but should not be used directly; and before -mthreads, +# because the compiler interprets this as "-mt" + "-hreads") +# -mthreads: Mingw32/gcc, Lynx/gcc +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case $host_os in + + freebsd*) + + # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) + # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) + + ax_pthread_flags="-kthread lthread $ax_pthread_flags" + ;; + + hpux*) + + # From the cc(1) man page: "[-mt] Sets various -D flags to enable + # multi-threading and also sets -lpthread." + + ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" + ;; + + openedition*) + + # IBM z/OS requires a feature-test macro to be defined in order to + # enable POSIX threads at all, so give the user a hint if this is + # not set. (We don't define these ourselves, as they can affect + # other portions of the system API in unpredictable ways.) + + AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING], + [ +# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) + AX_PTHREAD_ZOS_MISSING +# endif + ], + [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])]) + ;; + + solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (N.B.: The stubs are missing + # pthread_cleanup_push, or rather a function called by this macro, + # so we could check for that, but who knows whether they'll stub + # that too in a future libc.) So we'll check first for the + # standard Solaris way of linking pthreads (-mt -lpthread). + + ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags" + ;; +esac + +# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) + +AS_IF([test "x$GCC" = "xyes"], + [ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"]) + +# The presence of a feature test macro requesting re-entrant function +# definitions is, on some systems, a strong hint that pthreads support is +# correctly enabled + +case $host_os in + darwin* | hpux* | linux* | osf* | solaris*) + ax_pthread_check_macro="_REENTRANT" + ;; + + aix*) + ax_pthread_check_macro="_THREAD_SAFE" + ;; + + *) + ax_pthread_check_macro="--" + ;; +esac +AS_IF([test "x$ax_pthread_check_macro" = "x--"], + [ax_pthread_check_cond=0], + [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"]) + +# Are we compiling with Clang? + +AC_CACHE_CHECK([whether $CC is Clang], + [ax_cv_PTHREAD_CLANG], + [ax_cv_PTHREAD_CLANG=no + # Note that Autoconf sets GCC=yes for Clang as well as GCC + if test "x$GCC" = "xyes"; then + AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG], + [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ +# if defined(__clang__) && defined(__llvm__) + AX_PTHREAD_CC_IS_CLANG +# endif + ], + [ax_cv_PTHREAD_CLANG=yes]) + fi + ]) +ax_pthread_clang="$ax_cv_PTHREAD_CLANG" + +ax_pthread_clang_warning=no + +# Clang needs special handling, because older versions handle the -pthread +# option in a rather... idiosyncratic way + +if test "x$ax_pthread_clang" = "xyes"; then + + # Clang takes -pthread; it has never supported any other flag + + # (Note 1: This will need to be revisited if a system that Clang + # supports has POSIX threads in a separate library. This tends not + # to be the way of modern systems, but it's conceivable.) + + # (Note 2: On some systems, notably Darwin, -pthread is not needed + # to get POSIX threads support; the API is always present and + # active. We could reasonably leave PTHREAD_CFLAGS empty. But + # -pthread does define _REENTRANT, and while the Darwin headers + # ignore this macro, third-party headers might not.) + + PTHREAD_CFLAGS="-pthread" + PTHREAD_LIBS= + + ax_pthread_ok=yes + + # However, older versions of Clang make a point of warning the user + # that, in an invocation where only linking and no compilation is + # taking place, the -pthread option has no effect ("argument unused + # during compilation"). They expect -pthread to be passed in only + # when source code is being compiled. + # + # Problem is, this is at odds with the way Automake and most other + # C build frameworks function, which is that the same flags used in + # compilation (CFLAGS) are also used in linking. Many systems + # supported by AX_PTHREAD require exactly this for POSIX threads + # support, and in fact it is often not straightforward to specify a + # flag that is used only in the compilation phase and not in + # linking. Such a scenario is extremely rare in practice. + # + # Even though use of the -pthread flag in linking would only print + # a warning, this can be a nuisance for well-run software projects + # that build with -Werror. So if the active version of Clang has + # this misfeature, we search for an option to squash it. + + AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread], + [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG], + [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown + # Create an alternate version of $ac_link that compiles and + # links in two steps (.c -> .o, .o -> exe) instead of one + # (.c -> exe), because the warning occurs only in the second + # step + ax_pthread_save_ac_link="$ac_link" + ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' + ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"` + ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" + ax_pthread_save_CFLAGS="$CFLAGS" + for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do + AS_IF([test "x$ax_pthread_try" = "xunknown"], [break]) + CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" + ac_link="$ax_pthread_save_ac_link" + AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], + [ac_link="$ax_pthread_2step_ac_link" + AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], + [break]) + ]) + done + ac_link="$ax_pthread_save_ac_link" + CFLAGS="$ax_pthread_save_CFLAGS" + AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no]) + ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" + ]) + + case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in + no | unknown) ;; + *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; + esac + +fi # $ax_pthread_clang = yes + +if test "x$ax_pthread_ok" = "xno"; then +for ax_pthread_try_flag in $ax_pthread_flags; do + + case $ax_pthread_try_flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags]) + ;; + + -mt,pthread) + AC_MSG_CHECKING([whether pthreads work with -mt -lpthread]) + PTHREAD_CFLAGS="-mt" + PTHREAD_LIBS="-lpthread" + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) + PTHREAD_CFLAGS="$ax_pthread_try_flag" + ;; + + pthread-config) + AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) + AS_IF([test "x$ax_pthread_config" = "xno"], [continue]) + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag]) + PTHREAD_LIBS="-l$ax_pthread_try_flag" + ;; + esac + + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include +# if $ax_pthread_check_cond +# error "$ax_pthread_check_macro must be defined" +# endif + static void routine(void *a) { a = 0; } + static void *start_routine(void *a) { return a; }], + [pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */])], + [ax_pthread_ok=yes], + []) + + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" + + AC_MSG_RESULT([$ax_pthread_ok]) + AS_IF([test "x$ax_pthread_ok" = "xyes"], [break]) + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$ax_pthread_ok" = "xyes"; then + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + AC_CACHE_CHECK([for joinable pthread attribute], + [ax_cv_PTHREAD_JOINABLE_ATTR], + [ax_cv_PTHREAD_JOINABLE_ATTR=unknown + for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], + [int attr = $ax_pthread_attr; return attr /* ; */])], + [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break], + []) + done + ]) + AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ + test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ + test "x$ax_pthread_joinable_attr_defined" != "xyes"], + [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], + [$ax_cv_PTHREAD_JOINABLE_ATTR], + [Define to necessary symbol if this constant + uses a non-standard name on your system.]) + ax_pthread_joinable_attr_defined=yes + ]) + + AC_CACHE_CHECK([whether more special flags are required for pthreads], + [ax_cv_PTHREAD_SPECIAL_FLAGS], + [ax_cv_PTHREAD_SPECIAL_FLAGS=no + case $host_os in + solaris*) + ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" + ;; + esac + ]) + AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ + test "x$ax_pthread_special_flags_added" != "xyes"], + [PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" + ax_pthread_special_flags_added=yes]) + + AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], + [ax_cv_PTHREAD_PRIO_INHERIT], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[int i = PTHREAD_PRIO_INHERIT;]])], + [ax_cv_PTHREAD_PRIO_INHERIT=yes], + [ax_cv_PTHREAD_PRIO_INHERIT=no]) + ]) + AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ + test "x$ax_pthread_prio_inherit_defined" != "xyes"], + [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.]) + ax_pthread_prio_inherit_defined=yes + ]) + + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" + + # More AIX lossage: compile with *_r variant + if test "x$GCC" != "xyes"; then + case $host_os in + aix*) + AS_CASE(["x/$CC"], + [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], + [#handle absolute path differently from PATH based program lookup + AS_CASE(["x$CC"], + [x/*], + [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])], + [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])]) + ;; + esac + fi +fi + +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" + +AC_SUBST([PTHREAD_LIBS]) +AC_SUBST([PTHREAD_CFLAGS]) +AC_SUBST([PTHREAD_CC]) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test "x$ax_pthread_ok" = "xyes"; then + ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) + : +else + ax_pthread_ok=no + $2 +fi +AC_LANG_POP +])dnl AX_PTHREAD diff --git a/hawk/m4/libtool.m4 b/hawk/m4/libtool.m4 new file mode 100644 index 00000000..a644432f --- /dev/null +++ b/hawk/m4/libtool.m4 @@ -0,0 +1,8372 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file 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. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +]) + +# serial 58 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS=$ltmain + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_PREPARE_CC_BASENAME +# ----------------------- +m4_defun([_LT_PREPARE_CC_BASENAME], [ +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in @S|@*""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} +])# _LT_PREPARE_CC_BASENAME + + +# _LT_CC_BASENAME(CC) +# ------------------- +# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, +# but that macro is also expanded into generated libtool script, which +# arranges for $SED and $ECHO to be set by different means. +m4_defun([_LT_CC_BASENAME], +[m4_require([_LT_PREPARE_CC_BASENAME])dnl +AC_REQUIRE([_LT_DECL_SED])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +func_cc_basename $1 +cc_basename=$func_cc_basename_result +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl +m4_require([_LT_CMD_TRUNCATE])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options that allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld=$lt_cv_prog_gnu_ld + +old_CC=$CC +old_CFLAGS=$CFLAGS + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from 'configure', and 'config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# 'config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain=$ac_aux_dir/ltmain.sh +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the 'libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to 'config.status' so that its +# declaration there will have the same value as in 'configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags='_LT_TAGS'dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into 'config.status', and then the shell code to quote escape them in +# for loops in 'config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# '#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test 0 = "$lt_write_fail" && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +'$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test 0 != $[#] +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try '$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try '$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test yes = "$silent" && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options that allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + + cfgfile=${ofile}T + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL +# Generated automatically by $as_me ($PACKAGE) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +_LT_COPYING +_LT_LIBTOOL_TAGS + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +_LT_PREPARE_MUNGE_PATH_LIST +_LT_PREPARE_CC_BASENAME + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +m4_ifndef([AC_PROG_GO], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "$LT_MULTI_MODULE"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS=$save_LDFLAGS + ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[[012]][[,.]]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test yes = "$lt_cv_apple_cc_single_mod"; then + _lt_dar_single_mod='$single_module' + fi + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' + fi + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + if test yes = "$lt_cv_ld_force_load"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + m4_if([$1], [CXX], +[ if test yes != "$lt_cv_apple_cc_single_mod"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script that will find a shell with a builtin +# printf (that we can use as an echo command). +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case $ECHO in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac + +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], + [Search for dependent libraries within DIR (or the compiler's sysroot + if not specified).])], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case $with_sysroot in #( + yes) + if test yes = "$GCC"; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([$with_sysroot]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and where our libraries should be installed.])]) + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test no = "$enable_libtool_lock" || enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE=32 + ;; + *ELF-64*) + HPUX_IA64_MODE=64 + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test yes = "$lt_cv_prog_gnu_ld"; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + emul=elf + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `/usr/bin/file conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test yes != "$lt_cv_cc_needs_belf"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS=$SAVE_CFLAGS + fi + ;; +*-*solaris*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*|x86_64-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD=${LD-ld}_sol2 + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks=$enable_libtool_lock +])# _LT_ENABLE_LOCK + + +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test 0 -eq "$ac_status"; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test 0 -ne "$ac_status"; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test no = "$lt_cv_ar_at_file"; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[_LT_PROG_AR + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + bitrig* | openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test yes = "[$]$2"; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS +]) + +if test yes = "[$]$2"; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring=ABCD + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test 17 != "$i" # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n "$lt_cv_sys_max_cmd_len"; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test yes = "$cross_compiling"; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test yes != "$enable_dlopen"; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen=load_add_on + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen=LoadLibrary + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ + lt_cv_dlopen=dyld + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen=shl_load], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen=dlopen], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test no = "$lt_cv_dlopen"; then + enable_dlopen=no + else + enable_dlopen=yes + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS=$LDFLAGS + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS=$LIBS + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test yes = "$lt_cv_dlopen_self"; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links=nottested +if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test no = "$hard_links"; then + AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", + [Define to the sub-directory where libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then + + # We can hardcode non-existent directories. + if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && + test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || + test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP"; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_PREPARE_MUNGE_PATH_LIST +# --------------------------- +# Make sure func_munge_path_list() is defined correctly. +m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], +[[# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x@S|@2 in + x) + ;; + *:) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" + ;; + x:*) + eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" + ;; + *) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + esac +} +]])# _LT_PREPARE_PATH_LIST + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test yes = "$GCC"; then + case $host_os in + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary... + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo = "/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +AC_ARG_VAR([LT_SYS_LIBRARY_PATH], +[User-defined run-time library search path.]) + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[[4-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a[(]lib.so.V[)]' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[23]].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[[3-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], + [Detected run-time system search path for libraries]) +_LT_DECL([], [configure_time_lt_sys_library_path], [2], + [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program that can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$1"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac]) +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program that can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test no = "$withval" || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], +[if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi]) +rm -f conftest.i conftest2.i conftest.out]) +])# _LT_PATH_DD + + +# _LT_CMD_TRUNCATE +# ---------------- +# find command to truncate a binary pipe +m4_defun([_LT_CMD_TRUNCATE], +[m4_require([_LT_PATH_DD]) +AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], +[printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) +_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], + [Command to truncate a binary pipe]) +])# _LT_CMD_TRUNCATE + + +# _LT_CHECK_MAGIC_METHOD +# ---------------------- +# how to check for library dependencies +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_MAGIC_METHOD], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +AC_CACHE_CHECK([how to recognize dependent libraries], +lt_cv_deplibs_check_method, +[lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# 'unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[[4-9]]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[[45]]*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM=$NM +else + lt_nm_to_check=${ac_tool_prefix}nm + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break 2 + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break 2 + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS=$lt_save_ifs + done + : ${lt_cv_path_NM=no} +fi]) +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols -headers" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test : != "$DUMPBIN"; then + NM=$DUMPBIN + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd=$ECHO + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test yes != "$lt_cv_path_mainfest_tool"; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + + +# _LT_DLL_DEF_P([FILE]) +# --------------------- +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with func_dll_def_p in the libtool script +AC_DEFUN([_LT_DLL_DEF_P], +[dnl + test DEF = "`$SED -n dnl + -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace + -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments + -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl + -e q dnl Only consider the first "real" line + $1`" dnl +])# _LT_DLL_DEF_P + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM=-lm) + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test yes = "$GCC"; then + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test ia64 = "$host_cpu"; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT@&t@_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS=conftstm.$ac_objext + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test yes = "$pipe_works"; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], + [Transform the output of nm into a list of symbols to manually relocate]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([nm_interface], [lt_cv_nm_interface], [1], + [The name lister interface]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test yes = "$GXX"; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + if test ia64 != "$host_cpu"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64, which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test yes = "$GCC"; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64, which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test yes != "$GCC"; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd* | bitrig*) + with_gnu_ld=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test yes = "$with_gnu_ld"; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test yes = "$lt_use_gnu_ld_interface"; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='$wl' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test ia64 != "$host_cpu"; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test linux-dietlibc = "$host_os"; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test no = "$tmp_diet" + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + + if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + tcc*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' + ;; + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + aix_use_runtimelinking=yes + break + fi + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac + + if test yes = "$GCC"; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + ;; + + hpux10*) + if test yes,no = "$GCC,$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test yes,no = "$GCC,$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + ;; + esac + fi + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS=$save_LDFLAGS]) + if test yes = "$lt_cv_irix_exported_symbol"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + fi + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(ld_shlibs, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + osf3*) + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test yes = "$GCC"; then + wlarc='$wl' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='$wl' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. GCC discards it without '$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test yes = "$GCC"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test sequent = "$host_vendor"; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test sni = "$host_vendor"; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting $shlibpath_var if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC=$CC +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report what library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC=$lt_save_CC +])# _LT_LANG_C_CONFIG + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test no != "$CXX" && + ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || + (test g++ != "$CXX"))); then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_caught_CXX_error"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test yes = "$GXX"; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test yes = "$GXX"; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test yes = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='$wl' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac + + if test yes = "$GXX"; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag=$shared_flag' $wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + # The "-G" linker flag allows undefined symbols. + _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared + # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require '-G' NOT '-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no + + _LT_TAGVAR(GCC, $1)=$GXX + _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test yes != "$_lt_caught_CXX_error" + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case @S|@2 in + .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; + *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF +]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $prev$p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test x-L = "$p" || + test x-R = "$p"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test no = "$pre_test_object_deps_done"; then + case $prev in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)=$prev$p + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test no = "$pre_test_object_deps_done"; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)=$p + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)=$p + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test no = "$F77"; then + _lt_disable_F77=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_disable_F77"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${F77-"f77"} + CFLAGS=$FFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)=$G77 + _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test yes != "$_lt_disable_F77" + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test no = "$FC"; then + _lt_disable_FC=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_disable_FC"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${FC-"f95"} + CFLAGS=$FCFLAGS + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu + _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test yes != "$_lt_disable_FC" + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)=$LD +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)=$LD +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code=$lt_simple_compile_test_code + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +CFLAGS= +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f "$lt_ac_sed" && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test 10 -lt "$lt_ac_count" && break + lt_ac_count=`expr $lt_ac_count + 1` + if test "$lt_ac_count" -gt "$lt_ac_max"; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine what file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac +]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS diff --git a/hawk/m4/ltoptions.m4 b/hawk/m4/ltoptions.m4 new file mode 100644 index 00000000..94b08297 --- /dev/null +++ b/hawk/m4/ltoptions.m4 @@ -0,0 +1,437 @@ +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software +# Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file 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. + +# serial 8 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option '$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl 'shared' nor 'disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], + [_LT_WITH_AIX_SONAME([aix])]) + ]) +])# _LT_SET_OPTIONS + + +## --------------------------------- ## +## Macros to handle LT_INIT options. ## +## --------------------------------- ## + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the 'dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [1], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the 'win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the 'shared' and +# 'disable-shared' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the 'static' and +# 'disable-static' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the 'fast-install' +# and 'disable-fast-install' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the 'fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the 'disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_AIX_SONAME([DEFAULT]) +# ---------------------------------- +# implement the --with-aix-soname flag, and support the `aix-soname=aix' +# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT +# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. +m4_define([_LT_WITH_AIX_SONAME], +[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl +shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[[5-9]]*,yes) + AC_MSG_CHECKING([which variant of shared library versioning to provide]) + AC_ARG_WITH([aix-soname], + [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], + [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], + [case $withval in + aix|svr4|both) + ;; + *) + AC_MSG_ERROR([Unknown argument to --with-aix-soname]) + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname], + [AC_CACHE_VAL([lt_cv_with_aix_soname], + [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) + with_aix_soname=$lt_cv_with_aix_soname]) + AC_MSG_RESULT([$with_aix_soname]) + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + +_LT_DECL([], [shared_archive_member_spec], [0], + [Shared archive member basename, for filename based shared library versioning on AIX])dnl +])# _LT_WITH_AIX_SONAME + +LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the 'pic-only' and 'no-pic' +# LT_INIT options. +# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [pic_mode=m4_default([$1], [default])]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the 'pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + +## ----------------- ## +## LTDL_INIT Options ## +## ----------------- ## + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) diff --git a/hawk/m4/ltsugar.m4 b/hawk/m4/ltsugar.m4 new file mode 100644 index 00000000..48bc9344 --- /dev/null +++ b/hawk/m4/ltsugar.m4 @@ -0,0 +1,124 @@ +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file 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. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59, which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) diff --git a/hawk/m4/ltversion.m4 b/hawk/m4/ltversion.m4 new file mode 100644 index 00000000..fa04b52a --- /dev/null +++ b/hawk/m4/ltversion.m4 @@ -0,0 +1,23 @@ +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file 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. + +# @configure_input@ + +# serial 4179 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.4.6]) +m4_define([LT_PACKAGE_REVISION], [2.4.6]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.4.6' +macro_revision='2.4.6' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) diff --git a/hawk/m4/lt~obsolete.m4 b/hawk/m4/lt~obsolete.m4 new file mode 100644 index 00000000..c6b26f88 --- /dev/null +++ b/hawk/m4/lt~obsolete.m4 @@ -0,0 +1,99 @@ +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software +# Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file 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. + +# serial 5 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff --git a/hawk/mod/Makefile.am b/hawk/mod/Makefile.am new file mode 100644 index 00000000..712ec1ba --- /dev/null +++ b/hawk/mod/Makefile.am @@ -0,0 +1,71 @@ +AUTOMAKE_OPTIONS = nostdinc + +##AM_CFLAGS = $(PTHREAD_CFLAGS) + +CPPFLAGS_COMMON = \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/include \ + -I$(includedir) + +################################################## +if ENABLE_STATIC_MODULE +################################################## + +#------------------------------------------------- +# STATIC MODULES BUILT INTO MAIN LIBRARY +#------------------------------------------------- +LDFLAGS_COMMON =-L$(libdir) -version-info 1:0:0 -no-undefined +LIBADD_COMMON = + +noinst_LTLIBRARIES = + +if ENABLE_MOD_MYSQL +noinst_LTLIBRARIES += libhawk-mysql.la +endif + +if ENABLE_MOD_UCI +noinst_LTLIBRARIES += libhawk-uci.la +endif + +################################################## +else +################################################## + +#------------------------------------------------- +# DYNAMIC MODULES +#------------------------------------------------- +LDFLAGS_COMMON = -L../awk -L$(libdir) -version-info 1:0:0 -no-undefined +LIBADD_COMMON = -lhawk + +pkgmodexecdir = $(libdir) +pkgmodexec_LTLIBRARIES = + +if ENABLE_MOD_MYSQL +pkgmodexec_LTLIBRARIES += libhawk-mysql.la +endif + +if ENABLE_MOD_UCI +pkgmodexec_LTLIBRARIES += libhawk-uci.la +endif + +################################################## +endif +################################################## + + +#------------------------------------------------- +# ACTUAL MODULES +#------------------------------------------------- +if ENABLE_MOD_MYSQL +libhawk_mysql_la_SOURCES = mod-mysql.c mod-mysql.h +libhawk_mysql_la_CPPFLAGS = $(CPPFLAGS_COMMON) $(MYSQL_CFLAGS) +libhawk_mysql_la_LDFLAGS = $(LDFLAGS_COMMON) $(MYSQL_LDFLAGS) +libhawk_mysql_la_LIBADD = $(LIBADD_COMMON) +endif + +if ENABLE_MOD_UCI +libhawk_uci_la_SOURCES = mod-uci.c mod-uci.h +libhawk_uci_la_CPPFLAGS = $(CPPFLAGS_COMMON) +libhawk_uci_la_LDFLAGS = $(LDFLAGS_COMMON) +libhawk_uci_la_LIBADD = $(LIBADD_COMMON) $(UCI_LIBS) +endif diff --git a/hawk/mod/Makefile.in b/hawk/mod/Makefile.in new file mode 100644 index 00000000..49229843 --- /dev/null +++ b/hawk/mod/Makefile.in @@ -0,0 +1,797 @@ +# Makefile.in generated by automake 1.16.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2018 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@ +@ENABLE_MOD_MYSQL_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_1 = libhawk-mysql.la +@ENABLE_MOD_UCI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_2 = libhawk-uci.la +@ENABLE_MOD_MYSQL_TRUE@@ENABLE_STATIC_MODULE_FALSE@am__append_3 = libhawk-mysql.la +@ENABLE_MOD_UCI_TRUE@@ENABLE_STATIC_MODULE_FALSE@am__append_4 = libhawk-uci.la +subdir = mod +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ + $(top_srcdir)/m4/ax_cxx_namespace.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)/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)/lib/hawk-cfg.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(pkgmodexecdir)" +LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkgmodexec_LTLIBRARIES) +am__DEPENDENCIES_1 = +@ENABLE_MOD_MYSQL_TRUE@libhawk_mysql_la_DEPENDENCIES = \ +@ENABLE_MOD_MYSQL_TRUE@ $(am__DEPENDENCIES_1) +am__libhawk_mysql_la_SOURCES_DIST = mod-mysql.c mod-mysql.h +@ENABLE_MOD_MYSQL_TRUE@am_libhawk_mysql_la_OBJECTS = \ +@ENABLE_MOD_MYSQL_TRUE@ libhawk_mysql_la-mod-mysql.lo +libhawk_mysql_la_OBJECTS = $(am_libhawk_mysql_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libhawk_mysql_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libhawk_mysql_la_LDFLAGS) $(LDFLAGS) \ + -o $@ +@ENABLE_MOD_MYSQL_TRUE@@ENABLE_STATIC_MODULE_FALSE@am_libhawk_mysql_la_rpath = \ +@ENABLE_MOD_MYSQL_TRUE@@ENABLE_STATIC_MODULE_FALSE@ -rpath \ +@ENABLE_MOD_MYSQL_TRUE@@ENABLE_STATIC_MODULE_FALSE@ $(pkgmodexecdir) +@ENABLE_MOD_MYSQL_TRUE@@ENABLE_STATIC_MODULE_TRUE@am_libhawk_mysql_la_rpath = +@ENABLE_MOD_UCI_TRUE@libhawk_uci_la_DEPENDENCIES = \ +@ENABLE_MOD_UCI_TRUE@ $(am__DEPENDENCIES_1) +am__libhawk_uci_la_SOURCES_DIST = mod-uci.c mod-uci.h +@ENABLE_MOD_UCI_TRUE@am_libhawk_uci_la_OBJECTS = \ +@ENABLE_MOD_UCI_TRUE@ libhawk_uci_la-mod-uci.lo +libhawk_uci_la_OBJECTS = $(am_libhawk_uci_la_OBJECTS) +libhawk_uci_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libhawk_uci_la_LDFLAGS) $(LDFLAGS) -o \ + $@ +@ENABLE_MOD_UCI_TRUE@@ENABLE_STATIC_MODULE_FALSE@am_libhawk_uci_la_rpath = \ +@ENABLE_MOD_UCI_TRUE@@ENABLE_STATIC_MODULE_FALSE@ -rpath \ +@ENABLE_MOD_UCI_TRUE@@ENABLE_STATIC_MODULE_FALSE@ $(pkgmodexecdir) +@ENABLE_MOD_UCI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am_libhawk_uci_la_rpath = +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 = +DEFAULT_INCLUDES = +depcomp = $(SHELL) $(top_srcdir)/ac/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/libhawk_mysql_la-mod-mysql.Plo \ + ./$(DEPDIR)/libhawk_uci_la-mod-uci.Plo +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libhawk_mysql_la_SOURCES) $(libhawk_uci_la_SOURCES) +DIST_SOURCES = $(am__libhawk_mysql_la_SOURCES_DIST) \ + $(am__libhawk_uci_la_SOURCES_DIST) +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) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/ac/depcomp +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@ +DYNCALL_LIBS = @DYNCALL_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FFI_LIBS = @FFI_LIBS@ +FGREP = @FGREP@ +GREP = @GREP@ +HAVE_CXX = @HAVE_CXX@ +HAWK_PROJECT_AUTHOR = @HAWK_PROJECT_AUTHOR@ +HAWK_PROJECT_URL = @HAWK_PROJECT_URL@ +HAWK_SIZEOF_CHAR = @HAWK_SIZEOF_CHAR@ +HAWK_SIZEOF_DOUBLE = @HAWK_SIZEOF_DOUBLE@ +HAWK_SIZEOF_FLOAT = @HAWK_SIZEOF_FLOAT@ +HAWK_SIZEOF_INT = @HAWK_SIZEOF_INT@ +HAWK_SIZEOF_LONG = @HAWK_SIZEOF_LONG@ +HAWK_SIZEOF_LONG_DOUBLE = @HAWK_SIZEOF_LONG_DOUBLE@ +HAWK_SIZEOF_LONG_LONG = @HAWK_SIZEOF_LONG_LONG@ +HAWK_SIZEOF_OFF64_T = @HAWK_SIZEOF_OFF64_T@ +HAWK_SIZEOF_OFF_T = @HAWK_SIZEOF_OFF_T@ +HAWK_SIZEOF_SHORT = @HAWK_SIZEOF_SHORT@ +HAWK_SIZEOF_VOID_P = @HAWK_SIZEOF_VOID_P@ +HAWK_SIZEOF_WCHAR_T = @HAWK_SIZEOF_WCHAR_T@ +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@ +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@ +QUADMATH_LIBS = @QUADMATH_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SOCKET_LIBS = @SOCKET_LIBS@ +STRIP = @STRIP@ +UNICOWS_LIBS = @UNICOWS_LIBS@ +UNWIND_LIBS = @UNWIND_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@ +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 = nostdinc +CPPFLAGS_COMMON = \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/include \ + -I$(includedir) + + +################################################## +################################################## + +#------------------------------------------------- +# DYNAMIC MODULES +#------------------------------------------------- +@ENABLE_STATIC_MODULE_FALSE@LDFLAGS_COMMON = -L../awk -L$(libdir) -version-info 1:0:0 -no-undefined + +################################################## +################################################## + +#------------------------------------------------- +# STATIC MODULES BUILT INTO MAIN LIBRARY +#------------------------------------------------- +@ENABLE_STATIC_MODULE_TRUE@LDFLAGS_COMMON = -L$(libdir) -version-info 1:0:0 -no-undefined +@ENABLE_STATIC_MODULE_FALSE@LIBADD_COMMON = -lhawk +@ENABLE_STATIC_MODULE_TRUE@LIBADD_COMMON = +@ENABLE_STATIC_MODULE_TRUE@noinst_LTLIBRARIES = $(am__append_1) \ +@ENABLE_STATIC_MODULE_TRUE@ $(am__append_2) +@ENABLE_STATIC_MODULE_FALSE@pkgmodexecdir = $(libdir) +@ENABLE_STATIC_MODULE_FALSE@pkgmodexec_LTLIBRARIES = $(am__append_3) \ +@ENABLE_STATIC_MODULE_FALSE@ $(am__append_4) + +################################################## +################################################## + +#------------------------------------------------- +# ACTUAL MODULES +#------------------------------------------------- +@ENABLE_MOD_MYSQL_TRUE@libhawk_mysql_la_SOURCES = mod-mysql.c mod-mysql.h +@ENABLE_MOD_MYSQL_TRUE@libhawk_mysql_la_CPPFLAGS = $(CPPFLAGS_COMMON) $(MYSQL_CFLAGS) +@ENABLE_MOD_MYSQL_TRUE@libhawk_mysql_la_LDFLAGS = $(LDFLAGS_COMMON) $(MYSQL_LDFLAGS) +@ENABLE_MOD_MYSQL_TRUE@libhawk_mysql_la_LIBADD = $(LIBADD_COMMON) +@ENABLE_MOD_UCI_TRUE@libhawk_uci_la_SOURCES = mod-uci.c mod-uci.h +@ENABLE_MOD_UCI_TRUE@libhawk_uci_la_CPPFLAGS = $(CPPFLAGS_COMMON) +@ENABLE_MOD_UCI_TRUE@libhawk_uci_la_LDFLAGS = $(LDFLAGS_COMMON) +@ENABLE_MOD_UCI_TRUE@libhawk_uci_la_LIBADD = $(LIBADD_COMMON) $(UCI_LIBS) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(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 mod/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign mod/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): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +install-pkgmodexecLTLIBRARIES: $(pkgmodexec_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(pkgmodexec_LTLIBRARIES)'; test -n "$(pkgmodexecdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgmodexecdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgmodexecdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkgmodexecdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkgmodexecdir)"; \ + } + +uninstall-pkgmodexecLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkgmodexec_LTLIBRARIES)'; test -n "$(pkgmodexecdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkgmodexecdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkgmodexecdir)/$$f"; \ + done + +clean-pkgmodexecLTLIBRARIES: + -test -z "$(pkgmodexec_LTLIBRARIES)" || rm -f $(pkgmodexec_LTLIBRARIES) + @list='$(pkgmodexec_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libhawk-mysql.la: $(libhawk_mysql_la_OBJECTS) $(libhawk_mysql_la_DEPENDENCIES) $(EXTRA_libhawk_mysql_la_DEPENDENCIES) + $(AM_V_CCLD)$(libhawk_mysql_la_LINK) $(am_libhawk_mysql_la_rpath) $(libhawk_mysql_la_OBJECTS) $(libhawk_mysql_la_LIBADD) $(LIBS) + +libhawk-uci.la: $(libhawk_uci_la_OBJECTS) $(libhawk_uci_la_DEPENDENCIES) $(EXTRA_libhawk_uci_la_DEPENDENCIES) + $(AM_V_CCLD)$(libhawk_uci_la_LINK) $(am_libhawk_uci_la_rpath) $(libhawk_uci_la_OBJECTS) $(libhawk_uci_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_mysql_la-mod-mysql.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_uci_la-mod-uci.Plo@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +libhawk_mysql_la-mod-mysql.lo: mod-mysql.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_mysql_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_mysql_la-mod-mysql.lo -MD -MP -MF $(DEPDIR)/libhawk_mysql_la-mod-mysql.Tpo -c -o libhawk_mysql_la-mod-mysql.lo `test -f 'mod-mysql.c' || echo '$(srcdir)/'`mod-mysql.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_mysql_la-mod-mysql.Tpo $(DEPDIR)/libhawk_mysql_la-mod-mysql.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mod-mysql.c' object='libhawk_mysql_la-mod-mysql.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_mysql_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_mysql_la-mod-mysql.lo `test -f 'mod-mysql.c' || echo '$(srcdir)/'`mod-mysql.c + +libhawk_uci_la-mod-uci.lo: mod-uci.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_uci_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhawk_uci_la-mod-uci.lo -MD -MP -MF $(DEPDIR)/libhawk_uci_la-mod-uci.Tpo -c -o libhawk_uci_la-mod-uci.lo `test -f 'mod-uci.c' || echo '$(srcdir)/'`mod-uci.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_uci_la-mod-uci.Tpo $(DEPDIR)/libhawk_uci_la-mod-uci.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mod-uci.c' object='libhawk_uci_la-mod-uci.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_uci_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhawk_uci_la-mod-uci.lo `test -f 'mod-uci.c' || echo '$(srcdir)/'`mod-uci.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +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 $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(pkgmodexecdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +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 clean-noinstLTLIBRARIES \ + clean-pkgmodexecLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/libhawk_mysql_la-mod-mysql.Plo + -rm -f ./$(DEPDIR)/libhawk_uci_la-mod-uci.Plo + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +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-pkgmodexecLTLIBRARIES + +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 ./$(DEPDIR)/libhawk_mysql_la-mod-mysql.Plo + -rm -f ./$(DEPDIR)/libhawk_uci_la-mod-uci.Plo + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkgmodexecLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libtool clean-noinstLTLIBRARIES \ + clean-pkgmodexecLTLIBRARIES cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags 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-pkgmodexecLTLIBRARIES install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-pkgmodexecLTLIBRARIES + +.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: diff --git a/hawk/mod/mod-mysql.c b/hawk/mod/mod-mysql.c new file mode 100644 index 00000000..33abaf24 --- /dev/null +++ b/hawk/mod/mod-mysql.c @@ -0,0 +1,1185 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "mod-mysql.h" +#include +#include "../cmn/mem-prv.h" +#include +#include + +#if !defined(MYSQL_OPT_RECONNECT) +# define DUMMY_OPT_RECONNECT 31231 /* randomly chosen */ +#endif + +#define __IMAP_NODE_T_DATA MYSQL* mysql; int connect_ever_attempted; +#define __IMAP_LIST_T_DATA int errnum; qse_char_t errmsg[256]; +#define __IMAP_LIST_T sql_list_t +#define __IMAP_NODE_T sql_node_t +#define __MAKE_IMAP_NODE __new_sql_node +#define __FREE_IMAP_NODE __free_sql_node +#include "../lib/awk/imap-imp.h" + +#undef __IMAP_NODE_T_DATA +#undef __IMAP_LIST_T_DATA +#undef __IMAP_LIST_T +#undef __IMAP_NODE_T +#undef __MAKE_IMAP_NODE +#undef __FREE_IMAP_NODE + +#define __IMAP_NODE_T_DATA MYSQL_RES* res; unsigned int num_fields; +#define __IMAP_LIST_T_DATA /* int errnum; */ +#define __IMAP_LIST_T res_list_t +#define __IMAP_NODE_T res_node_t +#define __MAKE_IMAP_NODE __new_res_node +#define __FREE_IMAP_NODE __free_res_node +#include "../lib/awk/imap-imp.h" + +struct rtx_data_t +{ + sql_list_t sql_list; + res_list_t res_list; +}; +typedef struct rtx_data_t rtx_data_t; + +static sql_node_t* new_sql_node (qse_awk_rtx_t* rtx, sql_list_t* sql_list) +{ + sql_node_t* sql_node; + + sql_node = __new_sql_node(rtx, sql_list); + if (!sql_node) return QSE_NULL; + + sql_node->mysql = mysql_init(QSE_NULL); + if (!sql_node->mysql) + { + qse_awk_rtx_seterrfmt (rtx, QSE_AWK_ENOMEM, QSE_NULL, QSE_T("unable to allocate a mysql object")); + return QSE_NULL; + } + + return sql_node; +} + +static void free_sql_node (qse_awk_rtx_t* rtx, sql_list_t* sql_list, sql_node_t* sql_node) +{ + mysql_close (sql_node->mysql); + sql_node->mysql = QSE_NULL; + __free_sql_node (rtx, sql_list, sql_node); +} + + +static res_node_t* new_res_node (qse_awk_rtx_t* rtx, res_list_t* res_list, MYSQL_RES* res) +{ + res_node_t* res_node; + + res_node = __new_res_node(rtx, res_list); + if (!res_node) return QSE_NULL; + + res_node->res = res; + res_node->num_fields = mysql_num_fields(res); + + return res_node; +} + +static void free_res_node (qse_awk_rtx_t* rtx, res_list_t* res_list, res_node_t* res_node) +{ + mysql_free_result (res_node->res); + res_node->res = QSE_NULL; + __free_res_node (rtx, res_list, res_node); +} + +/* ------------------------------------------------------------------------ */ + +static QSE_INLINE sql_list_t* rtx_to_sql_list (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + qse_rbt_pair_t* pair; + rtx_data_t* data; + pair = qse_rbt_search((qse_rbt_t*)fi->mod->ctx, &rtx, QSE_SIZEOF(rtx)); + QSE_ASSERT (pair != QSE_NULL); + data = (rtx_data_t*)QSE_RBT_VPTR(pair); + return &data->sql_list; +} + +static QSE_INLINE sql_node_t* get_sql_list_node (sql_list_t* sql_list, qse_awk_int_t id) +{ + if (id < 0 || id >= sql_list->map.high || !sql_list->map.tab[id]) return QSE_NULL; + return sql_list->map.tab[id]; +} + +static QSE_INLINE res_list_t* rtx_to_res_list (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + qse_rbt_pair_t* pair; + rtx_data_t* data; + pair = qse_rbt_search((qse_rbt_t*)fi->mod->ctx, &rtx, QSE_SIZEOF(rtx)); + QSE_ASSERT (pair != QSE_NULL); + data = (rtx_data_t*)QSE_RBT_VPTR(pair); + return &data->res_list; +} + +static QSE_INLINE res_node_t* get_res_list_node (res_list_t* res_list, qse_awk_int_t id) +{ + if (id < 0 || id >= res_list->map.high || !res_list->map.tab[id]) return QSE_NULL; + return res_list->map.tab[id]; +} + +/* ------------------------------------------------------------------------ */ + +static void set_error_on_sql_list (qse_awk_rtx_t* rtx, sql_list_t* sql_list, const qse_char_t* errfmt, ...) +{ + if (errfmt) + { + va_list ap; + va_start (ap, errfmt); + qse_strxvfmt (sql_list->errmsg, QSE_COUNTOF(sql_list->errmsg), errfmt, ap); + va_end (ap); + } + else + { + qse_strxcpy (sql_list->errmsg, QSE_COUNTOF(sql_list->errmsg), qse_awk_rtx_geterrmsg(rtx)); + } +} + +static int fnc_errmsg (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + sql_list_t* sql_list; + qse_awk_val_t* retv; + + sql_list = rtx_to_sql_list(rtx, fi); + retv = qse_awk_rtx_makestrvalwithstr(rtx, sql_list->errmsg); + if (!retv) return -1; + + qse_awk_rtx_setretval (rtx, retv); + return 0; +} + +/* ------------------------------------------------------------------------ */ + +static sql_node_t* get_sql_list_node_with_arg (qse_awk_rtx_t* rtx, sql_list_t* sql_list, qse_awk_val_t* arg) +{ + qse_awk_int_t id; + sql_node_t* sql_node; + + if (qse_awk_rtx_valtoint(rtx, arg, &id) <= -1) + { + set_error_on_sql_list (rtx, sql_list, QSE_T("illegal instance id")); + return QSE_NULL; + } + else if (!(sql_node = get_sql_list_node(sql_list, id))) + { + set_error_on_sql_list (rtx, sql_list, QSE_T("invalid instance id - %zd"), (qse_size_t)id); + return QSE_NULL; + } + + return sql_node; +} + +static res_node_t* get_res_list_node_with_arg (qse_awk_rtx_t* rtx, sql_list_t* sql_list, res_list_t* res_list, qse_awk_val_t* arg) +{ + qse_awk_int_t id; + res_node_t* res_node; + + if (qse_awk_rtx_valtoint(rtx, arg, &id) <= -1) + { + set_error_on_sql_list (rtx, sql_list, QSE_T("illegal result id")); + return QSE_NULL; + } + else if (!(res_node = get_res_list_node(res_list, id))) + { + set_error_on_sql_list (rtx, sql_list, QSE_T("invalid result id - %zd"), (qse_size_t)id); + return QSE_NULL; + } + + return res_node; +} + +/* ------------------------------------------------------------------------ */ +static int fnc_open (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + sql_list_t* sql_list; + sql_node_t* sql_node = QSE_NULL; + qse_awk_int_t ret = -1; + qse_awk_val_t* retv; + + sql_list = rtx_to_sql_list(rtx, fi); + + sql_node = new_sql_node(rtx, sql_list); + if (sql_node) ret = sql_node->id; + else set_error_on_sql_list (rtx, sql_list, QSE_NULL); + + /* ret may not be a statically managed number. + * error checking is required */ + retv = qse_awk_rtx_makeintval(rtx, ret); + if (retv == QSE_NULL) + { + if (sql_node) free_sql_node (rtx, sql_list, sql_node); + return -1; + } + + qse_awk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_close (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + sql_list_t* sql_list; + sql_node_t* sql_node; + int ret = -1; + + sql_list = rtx_to_sql_list(rtx, fi); + sql_node = get_sql_list_node_with_arg(rtx, sql_list, qse_awk_rtx_getarg(rtx, 0)); + if (sql_node) + { + free_sql_node (rtx, sql_list, sql_node); + ret = 0; + } + + qse_awk_rtx_setretval (rtx, qse_awk_rtx_makeintval(rtx, ret)); + return 0; +} + +#if 0 +static int fnc_get_option (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + sql_list_t* sql_list; + sql_node_t* sql_node; + int ret = -1, take_rtx_err = 0; + + sql_list = rtx_to_sql_list(rtx, fi); + sql_node = get_sql_list_node_with_arg(rtx, sql_list, qse_awk_rtx_getarg(rtx, 0)); + if (sql_node) + { + qse_awk_int_t id, tv; + union + { + unsigned int ui; + int b; + } v; + + if (qse_awk_rtx_valtoint(rtx, qse_awk_rtx_getarg(rtx, 1), &id) <= -1) + { + take_rtx_err = 1; + goto oops; + } + + switch (id) + { + case MYSQL_OPT_CONNECT_TIMEOUT: + case MYSQL_OPT_READ_TIMEOUT: + case MYSQL_OPT_WRITE_TIMEOUT: + /* unsigned int * */ + if (mysql_get_option(sql_node->mysql, id, &v.ui) != 0) + { + set_error_on_sql_list (rtx, sql_list, QSE_T("%hs"), mysql_errstr(sql_node->mysql)); + goto done; + } + + retv = qse_awk_rtx_makeintval(rtx, v.ui); + if (qse_awk_rtx_setrefval(rtx, (qse_awk_val_ref_t*)qse_awk_rtx_getarg(rtx, 2), retv) <= -1) + { + qse_awk_rtx_refupval(rtx, retv); + qse_awk_rtx_refdownval(rtx, retv); + goto oops; + } + break; + + #if defined(MYSQL_OPT_RECONNECT) + case MYSQL_OPT_RECONNECT: + /* bool * */ + if (mysql_get_option(sql_node->mysql, id, &v.b) != 0) + { + set_error_on_sql_list (rtx, sql_list, QSE_T("%hs"), mysql_errstr(sql_node->mysql)); + goto done; + } + + retv = qse_awk_rtx_makeintval(rtx, v.b); + if (!retv) goto oops; + + if (qse_awk_rtx_setrefval(rtx, (qse_awk_val_ref_t*)qse_awk_rtx_getarg(rtx, 2), retv) <= -1) + { + qse_awk_rtx_refupval(rtx, retv); + qse_awk_rtx_refdownval(rtx, retv); + goto oops; + } + break; + #else + /* the system without MYSQL_OPT_RECONNECT available. return 1 all the time */ + if (qse_awk_rtx_setrefval(rtx, (qse_awk_val_ref_t*)qse_awk_rtx_getarg(rtx, 2), qse_awk_rtx_makeintval(rtx, 1)) <= -1) + { + qse_awk_rtx_refupval(rtx, retv); + qse_awk_rtx_refdownval(rtx, retv); + goto oops; + } + break; + #endif + + default: + set_error_on_sql_list (rtx, sql_list, QSE_T("unsupported option id - %zd"), (qse_size_t)id); + goto done; + } + + ret = 0; + } + +done: + if (take_rtx_err) set_error_on_sql_list (rtx, sql_list, QSE_NULL); + qse_awk_rtx_setretval (rtx, qse_awk_rtx_makeintval(rtx, ret)); + return 0; + +oops: + if (take_rtx_err) set_error_on_sql_list (rtx, sql_list, QSE_NULL); + return -1; +} +#endif + +static int fnc_set_option (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + sql_list_t* sql_list; + sql_node_t* sql_node; + int ret = -1, take_rtx_err = 0; + + sql_list = rtx_to_sql_list(rtx, fi); + sql_node = get_sql_list_node_with_arg(rtx, sql_list, qse_awk_rtx_getarg(rtx, 0)); + if (sql_node) + { + qse_awk_int_t id, tv; + void* vptr; + union + { + unsigned int ui; + int b; + } v; + + if (qse_awk_rtx_valtoint(rtx, qse_awk_rtx_getarg(rtx, 1), &id) <= -1) + { + take_rtx_err = 1; + goto oops; + } + + /* this function must not check sql_node->connect_ever_attempted */ + + switch (id) + { + case MYSQL_OPT_CONNECT_TIMEOUT: + case MYSQL_OPT_READ_TIMEOUT: + case MYSQL_OPT_WRITE_TIMEOUT: + /* unsigned int * */ + if (qse_awk_rtx_valtoint(rtx, qse_awk_rtx_getarg(rtx, 2), &tv) <= -1) + { + take_rtx_err = 1; + goto oops; + } + + v.ui = tv; + vptr = &v.ui; + break; + + #if defined(MYSQL_OPT_RECONNECT) + case MYSQL_OPT_RECONNECT: + /* bool * */ + if (qse_awk_rtx_valtoint(rtx, qse_awk_rtx_getarg(rtx, 2), &tv) <= -1) + { + take_rtx_err = 1; + goto oops; + } + + v.b = tv; + vptr = &v.b; + break; + #else + case DUMMY_OPT_RECONNECT: + ret = 0; + goto done; + #endif + + default: + set_error_on_sql_list (rtx, sql_list, QSE_T("unsupported option id - %zd"), (qse_size_t)id); + goto done; + } + + if (mysql_options(sql_node->mysql, id, vptr) != 0) + { + set_error_on_sql_list (rtx, sql_list, QSE_T("%hs"), mysql_error(sql_node->mysql)); + goto done; + } + + ret = 0; + } + +done: + if (take_rtx_err) set_error_on_sql_list (rtx, sql_list, QSE_NULL); + qse_awk_rtx_setretval (rtx, qse_awk_rtx_makeintval(rtx, ret)); + return 0; + +oops: + if (take_rtx_err) set_error_on_sql_list (rtx, sql_list, QSE_NULL); + return -1; +} + +static int fnc_connect (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + sql_list_t* sql_list; + sql_node_t* sql_node; + int ret = -1, take_rtx_err = 0; + + qse_awk_val_t* a1, * a2, * a3, * a4, * a6; + qse_mchar_t* host = QSE_NULL; + qse_mchar_t* user = QSE_NULL; + qse_mchar_t* pass = QSE_NULL; + qse_mchar_t* db = QSE_NULL; + qse_awk_int_t port = 0; + qse_mchar_t* usck = QSE_NULL; + + sql_list = rtx_to_sql_list(rtx, fi); + sql_node = get_sql_list_node_with_arg(rtx, sql_list, qse_awk_rtx_getarg(rtx, 0)); + if (sql_node) + { + qse_size_t nargs; + + nargs = qse_awk_rtx_getnargs(rtx); + + a1 = qse_awk_rtx_getarg(rtx, 1); + a2 = qse_awk_rtx_getarg(rtx, 2); + a3 = qse_awk_rtx_getarg(rtx, 3); + + if (!(host = qse_awk_rtx_getvalmbs(rtx, a1, QSE_NULL)) || + !(user = qse_awk_rtx_getvalmbs(rtx, a2, QSE_NULL)) || + !(pass = qse_awk_rtx_getvalmbs(rtx, a3, QSE_NULL))) + { + arg_fail: + take_rtx_err = 1; + goto done; + } + + if (nargs >= 5) + { + a4 = qse_awk_rtx_getarg(rtx, 4); + if (!(db = qse_awk_rtx_getvalmbs(rtx, a4, QSE_NULL))) goto arg_fail; + if (nargs >= 6 && qse_awk_rtx_valtoint(rtx, qse_awk_rtx_getarg(rtx, 5), &port) <= -1) goto arg_fail; + + if (nargs >= 7) + { + a6 = qse_awk_rtx_getarg(rtx, 6); + if (!(usck = qse_awk_rtx_getvalmbs(rtx, a6, QSE_NULL))) goto arg_fail; + } + } + + if (!mysql_real_connect(sql_node->mysql, host, user, pass, db, port, usck, 0)) + { + set_error_on_sql_list (rtx, sql_list, QSE_T("%hs"), mysql_error(sql_node->mysql)); + sql_node->connect_ever_attempted = 1; /* doesn't matter if mysql_real_connect() failed */ + goto done; + } + + sql_node->connect_ever_attempted = 1; + ret = 0; + } + +done: + if (take_rtx_err) set_error_on_sql_list (rtx, sql_list, QSE_NULL); + if (usck) qse_awk_rtx_freevalmbs (rtx, a6, usck); + if (db) qse_awk_rtx_freevalmbs (rtx, a4, db); + if (pass) qse_awk_rtx_freevalmbs (rtx, a3, pass); + if (user) qse_awk_rtx_freevalmbs (rtx, a2, user); + if (host) qse_awk_rtx_freevalmbs (rtx, a1, host); + + qse_awk_rtx_setretval (rtx, qse_awk_rtx_makeintval(rtx, ret)); + return 0; +} + +#define ENSURE_CONNECT_EVER_ATTEMPTED(rtx, sql_list, sql_node) \ + do { \ + if (!(sql_node)->connect_ever_attempted) \ + { \ + set_error_on_sql_list (rtx, sql_list, QSE_T("not connected")); \ + goto done; \ + } \ + } while(0) + +static int fnc_ping (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + sql_list_t* sql_list; + sql_node_t* sql_node; + int ret = -1, take_rtx_err = 0; + + sql_list = rtx_to_sql_list(rtx, fi); + sql_node = get_sql_list_node_with_arg(rtx, sql_list, qse_awk_rtx_getarg(rtx, 0)); + if (sql_node) + { + ENSURE_CONNECT_EVER_ATTEMPTED(rtx, sql_list, sql_node); + + if (mysql_ping(sql_node->mysql) != 0) + { + set_error_on_sql_list (rtx, sql_list, QSE_T("%hs"), mysql_error(sql_node->mysql)); + goto done; + } + + ret = 0; + } + +done: + if (take_rtx_err) set_error_on_sql_list (rtx, sql_list, QSE_NULL); + qse_awk_rtx_setretval (rtx, qse_awk_rtx_makeintval(rtx, ret)); + return 0; + +oops: + if (take_rtx_err) set_error_on_sql_list (rtx, sql_list, QSE_NULL); + return -1; +} + +static int fnc_select_db (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + sql_list_t* sql_list; + sql_node_t* sql_node; + qse_awk_val_t* a1; + qse_mchar_t* db = QSE_NULL; + int ret = -1, take_rtx_err = 0; + + sql_list = rtx_to_sql_list(rtx, fi); + sql_node = get_sql_list_node_with_arg(rtx, sql_list, qse_awk_rtx_getarg(rtx, 0)); + if (sql_node) + { + a1 = qse_awk_rtx_getarg(rtx, 1); + + if (!(db = qse_awk_rtx_getvalmbs(rtx, a1, QSE_NULL))) { take_rtx_err = 1; goto oops; } + + ENSURE_CONNECT_EVER_ATTEMPTED(rtx, sql_list, sql_node); + + if (mysql_select_db(sql_node->mysql, db) != 0) + { + set_error_on_sql_list (rtx, sql_list, QSE_T("%hs"), mysql_error(sql_node->mysql)); + goto done; + } + + ret = 0; + } + +done: + if (take_rtx_err) set_error_on_sql_list (rtx, sql_list, QSE_NULL); + if (db) qse_awk_rtx_freevalmbs (rtx, a1, db); + qse_awk_rtx_setretval (rtx, qse_awk_rtx_makeintval(rtx, ret)); + return 0; + +oops: + if (take_rtx_err) set_error_on_sql_list (rtx, sql_list, QSE_NULL); + return -1; +} + + +static int fnc_autocommit (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + sql_list_t* sql_list; + sql_node_t* sql_node; + int ret = -1, take_rtx_err = 0; + + sql_list = rtx_to_sql_list(rtx, fi); + sql_node = get_sql_list_node_with_arg(rtx, sql_list, qse_awk_rtx_getarg(rtx, 0)); + if (sql_node) + { + int v; + + v = qse_awk_rtx_valtobool(rtx, qse_awk_rtx_getarg(rtx, 1)); + + ENSURE_CONNECT_EVER_ATTEMPTED(rtx, sql_list, sql_node); + + if (mysql_autocommit(sql_node->mysql, v) != 0) + { + set_error_on_sql_list (rtx, sql_list, QSE_T("%hs"), mysql_error(sql_node->mysql)); + goto done; + } + + ret = 0; + } + +done: + if (take_rtx_err) set_error_on_sql_list (rtx, sql_list, QSE_NULL); + qse_awk_rtx_setretval (rtx, qse_awk_rtx_makeintval(rtx, ret)); + return 0; + +oops: + if (take_rtx_err) set_error_on_sql_list (rtx, sql_list, QSE_NULL); + return -1; +} + +static int fnc_commit (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + sql_list_t* sql_list; + sql_node_t* sql_node; + int ret = -1, take_rtx_err = 0; + + sql_list = rtx_to_sql_list(rtx, fi); + sql_node = get_sql_list_node_with_arg(rtx, sql_list, qse_awk_rtx_getarg(rtx, 0)); + if (sql_node) + { + int v; + + v = qse_awk_rtx_valtobool(rtx, qse_awk_rtx_getarg(rtx, 1)); + + ENSURE_CONNECT_EVER_ATTEMPTED(rtx, sql_list, sql_node); + + if (mysql_commit(sql_node->mysql) != 0) + { + set_error_on_sql_list (rtx, sql_list, QSE_T("%hs"), mysql_error(sql_node->mysql)); + goto done; + } + + ret = 0; + } + +done: + if (take_rtx_err) set_error_on_sql_list (rtx, sql_list, QSE_NULL); + qse_awk_rtx_setretval (rtx, qse_awk_rtx_makeintval(rtx, ret)); + return 0; + +oops: + if (take_rtx_err) set_error_on_sql_list (rtx, sql_list, QSE_NULL); + return -1; +} + +static int fnc_rollback (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + sql_list_t* sql_list; + sql_node_t* sql_node; + int ret = -1, take_rtx_err = 0; + + sql_list = rtx_to_sql_list(rtx, fi); + sql_node = get_sql_list_node_with_arg(rtx, sql_list, qse_awk_rtx_getarg(rtx, 0)); + if (sql_node) + { + int v; + + v = qse_awk_rtx_valtobool(rtx, qse_awk_rtx_getarg(rtx, 1)); + + ENSURE_CONNECT_EVER_ATTEMPTED(rtx, sql_list, sql_node); + + if (mysql_rollback(sql_node->mysql) != 0) + { + set_error_on_sql_list (rtx, sql_list, QSE_T("%hs"), mysql_error(sql_node->mysql)); + goto done; + } + + ret = 0; + } + +done: + if (take_rtx_err) set_error_on_sql_list (rtx, sql_list, QSE_NULL); + qse_awk_rtx_setretval (rtx, qse_awk_rtx_makeintval(rtx, ret)); + return 0; + +oops: + if (take_rtx_err) set_error_on_sql_list (rtx, sql_list, QSE_NULL); + return -1; +} + +static int fnc_affected_rows (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + sql_list_t* sql_list; + sql_node_t* sql_node; + int ret = -1, take_rtx_err = 0; + + sql_list = rtx_to_sql_list(rtx, fi); + sql_node = get_sql_list_node_with_arg(rtx, sql_list, qse_awk_rtx_getarg(rtx, 0)); + if (sql_node) + { + my_ulonglong nrows; + qse_awk_val_t* vrows; + + ENSURE_CONNECT_EVER_ATTEMPTED(rtx, sql_list, sql_node); + + nrows = mysql_affected_rows(sql_node->mysql); + if (nrows == (my_ulonglong)-1) + { + set_error_on_sql_list (rtx, sql_list, QSE_T("%hs"), mysql_error(sql_node->mysql)); + goto done; + } + + vrows = qse_awk_rtx_makeintval(rtx, nrows); + if (!vrows) + { + take_rtx_err = 1; + goto oops; + } + + if (qse_awk_rtx_setrefval(rtx, (qse_awk_val_ref_t*)qse_awk_rtx_getarg(rtx, 1), vrows) <= -1) + { + qse_awk_rtx_refupval (rtx, vrows); + qse_awk_rtx_refdownval (rtx, vrows); + take_rtx_err = 1; + goto oops; + } + + ret = 0; + } + +done: + if (take_rtx_err) set_error_on_sql_list (rtx, sql_list, QSE_NULL); + qse_awk_rtx_setretval (rtx, qse_awk_rtx_makeintval(rtx, ret)); + return 0; + +oops: + if (take_rtx_err) set_error_on_sql_list (rtx, sql_list, QSE_NULL); + return -1; +} + +static int fnc_escape_string (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + sql_list_t* sql_list; + sql_node_t* sql_node; + int ret = -1, take_rtx_err = 0; + + qse_awk_val_t* a1, *retv; + qse_mchar_t* qstr = QSE_NULL; + qse_mchar_t* ebuf = QSE_NULL; + + sql_list = rtx_to_sql_list(rtx, fi); + sql_node = get_sql_list_node_with_arg(rtx, sql_list, qse_awk_rtx_getarg(rtx, 0)); + if (sql_node) + { + qse_size_t qlen; + + a1 = qse_awk_rtx_getarg(rtx, 1); + + qstr = qse_awk_rtx_getvalmbs(rtx, a1, &qlen); + if (!qstr) { take_rtx_err = 1; goto oops; } + + ebuf = qse_awk_rtx_allocmem(rtx, (qlen * 2 + 1) * QSE_SIZEOF(*qstr)); + if (!ebuf) { take_rtx_err = 1; goto oops; } + + ENSURE_CONNECT_EVER_ATTEMPTED(rtx, sql_list, sql_node); + mysql_real_escape_string(sql_node->mysql, ebuf, qstr, qlen); + + retv = qse_awk_rtx_makestrvalwithmbs(rtx, ebuf); + if (!retv) + { + take_rtx_err = 1; + goto oops; + } + + if (qse_awk_rtx_setrefval(rtx, (qse_awk_val_ref_t*)qse_awk_rtx_getarg(rtx, 2), retv) <= -1) + { + qse_awk_rtx_refupval (rtx, retv); + qse_awk_rtx_refdownval (rtx, retv); + take_rtx_err = 1; + goto oops; + } + + ret = 0; + } + +done: + if (take_rtx_err) set_error_on_sql_list (rtx, sql_list, QSE_NULL); + if (take_rtx_err) set_error_on_sql_list (rtx, sql_list, QSE_NULL); + if (ebuf) qse_awk_rtx_freemem (rtx, ebuf); + if (qstr) qse_awk_rtx_freevalmbs (rtx, a1, qstr); + qse_awk_rtx_setretval (rtx, qse_awk_rtx_makeintval(rtx, ret)); + return 0; + +oops: + if (ebuf) qse_awk_rtx_freemem (rtx, ebuf); + if (qstr) qse_awk_rtx_freevalmbs (rtx, a1, qstr); + return -1; +} + +static int fnc_query (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + sql_list_t* sql_list; + sql_node_t* sql_node; + int ret = -1, take_rtx_err = 0; + + qse_awk_val_t* a1; + qse_mchar_t* qstr = QSE_NULL; + + sql_list = rtx_to_sql_list(rtx, fi); + sql_node = get_sql_list_node_with_arg(rtx, sql_list, qse_awk_rtx_getarg(rtx, 0)); + if (sql_node) + { + qse_size_t qlen; + a1 = qse_awk_rtx_getarg(rtx, 1); + + qstr = qse_awk_rtx_getvalmbs(rtx, a1, &qlen); + if (!qstr) { take_rtx_err = 1; goto oops; } + + ENSURE_CONNECT_EVER_ATTEMPTED(rtx, sql_list, sql_node); + + if (mysql_real_query(sql_node->mysql, qstr, qlen) != 0) + { + set_error_on_sql_list (rtx, sql_list, QSE_T("%hs"), mysql_error(sql_node->mysql)); + goto done; + } + + ret = 0; + } + +done: + if (take_rtx_err) set_error_on_sql_list (rtx, sql_list, QSE_NULL); + if (qstr) qse_awk_rtx_freevalmbs (rtx, a1, qstr); + qse_awk_rtx_setretval (rtx, qse_awk_rtx_makeintval(rtx, ret)); + return 0; + +oops: + if (take_rtx_err) set_error_on_sql_list (rtx, sql_list, QSE_NULL); + if (qstr) qse_awk_rtx_freevalmbs (rtx, a1, qstr); + return -1; +} + +static int fnc_store_result (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + sql_list_t* sql_list; + sql_node_t* sql_node; + int ret = -1, take_rtx_err = 0; + + sql_list = rtx_to_sql_list(rtx, fi); + sql_node = get_sql_list_node_with_arg(rtx, sql_list, qse_awk_rtx_getarg(rtx, 0)); + if (sql_node) + { + res_list_t* res_list; + res_node_t* res_node; + MYSQL_RES* res; + + res_list = rtx_to_res_list(rtx, fi); + + ENSURE_CONNECT_EVER_ATTEMPTED(rtx, sql_list, sql_node); + + res = mysql_store_result(sql_node->mysql); + if (!res) + { + if (mysql_errno(sql_node->mysql) == 0) + set_error_on_sql_list (rtx, sql_list, QSE_T("no result")); + else + set_error_on_sql_list (rtx, sql_list, QSE_T("%hs"), mysql_error(sql_node->mysql)); + goto done; + } + + res_node = new_res_node(rtx, res_list, res); + if (!res_node) + { + mysql_free_result (res); + take_rtx_err = 1; + goto done; + } + + ret = res_node->id; + } + +done: + if (take_rtx_err) set_error_on_sql_list (rtx, sql_list, QSE_NULL); + qse_awk_rtx_setretval (rtx, qse_awk_rtx_makeintval(rtx, ret)); + return 0; +} + +static int fnc_free_result (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + sql_list_t* sql_list; + res_list_t* res_list; + res_node_t* res_node; + int ret = -1; + + sql_list = rtx_to_sql_list(rtx, fi); + res_list = rtx_to_res_list(rtx, fi); + res_node = get_res_list_node_with_arg(rtx, sql_list, res_list, qse_awk_rtx_getarg(rtx, 0)); + if (res_node) + { + free_res_node (rtx, res_list, res_node); + ret = 0; + } + + qse_awk_rtx_setretval (rtx, qse_awk_rtx_makeintval(rtx, ret)); + return 0; +} + +static int fnc_fetch_row (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + sql_list_t* sql_list; + res_list_t* res_list; + res_node_t* res_node; + int ret = -1, take_rtx_err = 0; + qse_awk_val_t* row_map = QSE_NULL; + + sql_list = rtx_to_sql_list(rtx, fi); + res_list = rtx_to_res_list(rtx, fi); + res_node = get_res_list_node_with_arg(rtx, sql_list, res_list, qse_awk_rtx_getarg(rtx, 0)); + if (res_node) + { + MYSQL_ROW row; + unsigned int i; + qse_awk_val_t* row_val; + int x; + + row = mysql_fetch_row(res_node->res); + if (!row) + { + /* no more row in the result */ + ret = 0; + goto done; + } + + row_map = qse_awk_rtx_makemapval(rtx); + if (!row_map) goto oops; + + qse_awk_rtx_refupval (rtx, row_map); + + for (i = 0; i < res_node->num_fields; ) + { + qse_char_t key_buf[QSE_SIZEOF(qse_awk_int_t) * 8 + 2]; + qse_size_t key_len; + + if (row[i]) + { +/* TODO: consider using make multi byte string - qse_awk_rtx_makembsstr */ + row_val = qse_awk_rtx_makestrvalwithmbs(rtx, row[i]); + if (!row_val) goto oops; + } + else + { + row_val = qse_awk_rtx_makenilval(rtx); + } + + ++i; + + /* put it into the map */ + key_len = qse_awk_inttostr(qse_awk_rtx_getawk(rtx), i, 10, QSE_NULL, key_buf, QSE_COUNTOF(key_buf)); + QSE_ASSERT (key_len != (qse_size_t)-1); + + if (qse_awk_rtx_setmapvalfld(rtx, row_map, key_buf, key_len, row_val) == QSE_NULL) + { + qse_awk_rtx_refupval (rtx, row_val); + qse_awk_rtx_refdownval (rtx, row_val); + goto oops; + } + } + + x = qse_awk_rtx_setrefval(rtx, (qse_awk_val_ref_t*)qse_awk_rtx_getarg(rtx, 1), row_map); + + qse_awk_rtx_refdownval (rtx, row_map); + row_map = QSE_NULL; + + if (x <= -1) goto oops; + ret = 1; /* indicate that there is a row */ + } + +done: + if (take_rtx_err) set_error_on_sql_list (rtx, sql_list, QSE_NULL); + qse_awk_rtx_setretval (rtx, qse_awk_rtx_makeintval(rtx, ret)); + return 0; + + +oops: + if (row_map) qse_awk_rtx_refdownval (rtx, row_map); + return -1; +} + +typedef struct fnctab_t fnctab_t; +struct fnctab_t +{ + const qse_char_t* name; + qse_awk_mod_sym_fnc_t info; +}; + +typedef struct inttab_t inttab_t; +struct inttab_t +{ + const qse_char_t* name; + qse_awk_mod_sym_int_t info; +}; + + +#define A_MAX QSE_TYPE_MAX(int) + +static fnctab_t fnctab[] = +{ + /* keep this table sorted for binary search in query(). */ + { QSE_T("affected_rows"), { { 2, 2, QSE_T("vr") }, fnc_affected_rows, 0 } }, + { QSE_T("autocommit"), { { 2, 2, QSE_NULL }, fnc_autocommit, 0 } }, + { QSE_T("close"), { { 1, 1, QSE_NULL }, fnc_close, 0 } }, + { QSE_T("commit"), { { 1, 1, QSE_NULL }, fnc_commit, 0 } }, + { QSE_T("connect"), { { 4, 7, QSE_NULL }, fnc_connect, 0 } }, + { QSE_T("errmsg"), { { 0, 0, QSE_NULL }, fnc_errmsg, 0 } }, + { QSE_T("escape_string"), { { 3, 3, QSE_T("vvr") }, fnc_escape_string, 0 } }, + { QSE_T("fetch_row"), { { 2, 2, QSE_T("vr") }, fnc_fetch_row, 0 } }, + { QSE_T("free_result"), { { 1, 1, QSE_NULL }, fnc_free_result, 0 } }, + /*{ QSE_T("get_option"), { { 3, 3, QSE_T("vr") }, fnc_get_option, 0 } },*/ + { QSE_T("open"), { { 0, 0, QSE_NULL }, fnc_open, 0 } }, + { QSE_T("ping"), { { 1, 1, QSE_NULL }, fnc_ping, 0 } }, + { QSE_T("query"), { { 2, 2, QSE_NULL }, fnc_query, 0 } }, + { QSE_T("rollback"), { { 1, 1, QSE_NULL }, fnc_rollback, 0 } }, + { QSE_T("select_db"), { { 2, 2, QSE_NULL }, fnc_select_db, 0 } }, + { QSE_T("set_option"), { { 3, 3, QSE_NULL }, fnc_set_option, 0 } }, + { QSE_T("store_result"), { { 1, 1, QSE_NULL }, fnc_store_result, 0 } } +}; + +static inttab_t inttab[] = +{ + /* keep this table sorted for binary search in query(). */ + { QSE_T("OPT_CONNECT_TIMEOUT"), { MYSQL_OPT_CONNECT_TIMEOUT } }, + { QSE_T("OPT_READ_TIMEOUT"), { MYSQL_OPT_READ_TIMEOUT } }, +#if defined(MYSQL_OPT_RECONNECT) + { QSE_T("OPT_RECONNECT"), { MYSQL_OPT_RECONNECT } }, +#else + { QSE_T("OPT_RECONNECT"), { DUMMY_OPT_RECONNECT } }, +#endif + { QSE_T("OPT_WRITE_TIMEOUT"), { MYSQL_OPT_WRITE_TIMEOUT } } +}; + +static int query (qse_awk_mod_t* mod, qse_awk_t* awk, const qse_char_t* name, qse_awk_mod_sym_t* sym) +{ + qse_cstr_t ea; + int left, right, mid, n; + + left = 0; right = QSE_COUNTOF(fnctab) - 1; + + while (left <= right) + { + mid = left + (right - left) / 2; + + n = qse_strcmp (fnctab[mid].name, name); + if (n > 0) right = mid - 1; + else if (n < 0) left = mid + 1; + else + { + sym->type = QSE_AWK_MOD_FNC; + sym->u.fnc = fnctab[mid].info; + return 0; + } + } + + left = 0; right = QSE_COUNTOF(inttab) - 1; + while (left <= right) + { + mid = left + (right - left) / 2; + + n = qse_strcmp (inttab[mid].name, name); + if (n > 0) right = mid - 1; + else if (n < 0) left = mid + 1; + else + { + sym->type = QSE_AWK_MOD_INT; + sym->u.in = inttab[mid].info; + return 0; + } + } + + + ea.ptr = (qse_char_t*)name; + ea.len = qse_strlen(name); + qse_awk_seterror (awk, QSE_AWK_ENOENT, &ea, QSE_NULL); + return -1; +} + +static int init (qse_awk_mod_t* mod, qse_awk_rtx_t* rtx) +{ + qse_rbt_t* rbt; + rtx_data_t data; + + rbt = (qse_rbt_t*)mod->ctx; + + QSE_MEMSET (&data, 0, QSE_SIZEOF(data)); + if (qse_rbt_insert(rbt, &rtx, QSE_SIZEOF(rtx), &data, QSE_SIZEOF(data)) == QSE_NULL) + { + qse_awk_rtx_seterrnum (rtx, QSE_AWK_ENOMEM, QSE_NULL); + return -1; + } + + return 0; +} + +static void fini (qse_awk_mod_t* mod, qse_awk_rtx_t* rtx) +{ + qse_rbt_t* rbt; + qse_rbt_pair_t* pair; + + rbt = (qse_rbt_t*)mod->ctx; + + /* garbage clean-up */ + pair = qse_rbt_search(rbt, &rtx, QSE_SIZEOF(rtx)); + if (pair) + { + rtx_data_t* data; + sql_node_t* sql_node, * sql_next; + res_node_t* res_node, * res_next; + + data = (rtx_data_t*)QSE_RBT_VPTR(pair); + + res_node = data->res_list.head; + while (res_node) + { + res_next = res_node->next; + free_res_node (rtx, &data->res_list, res_node); + res_node = res_next; + } + + sql_node = data->sql_list.head; + while (sql_node) + { + sql_next = sql_node->next; + free_sql_node (rtx, &data->sql_list, sql_node); + sql_node = sql_next; + } + + qse_rbt_delete (rbt, &rtx, QSE_SIZEOF(rtx)); + } +} + +static void unload (qse_awk_mod_t* mod, qse_awk_t* awk) +{ + qse_rbt_t* rbt; + + rbt = (qse_rbt_t*)mod->ctx; + + QSE_ASSERT (QSE_RBT_SIZE(rbt) == 0); + qse_rbt_close (rbt); +//mysql_library_end (); +} + +int qse_awk_mod_mysql (qse_awk_mod_t* mod, qse_awk_t* awk) +{ + qse_rbt_t* rbt; + + mod->query = query; + mod->unload = unload; + + mod->init = init; + mod->fini = fini; + + rbt = qse_rbt_open(qse_awk_getmmgr(awk), 0, 1, 1); + if (rbt == QSE_NULL) + { + qse_awk_seterrnum (awk, QSE_AWK_ENOMEM, QSE_NULL); + return -1; + } + qse_rbt_setstyle (rbt, qse_getrbtstyle(QSE_RBT_STYLE_INLINE_COPIERS)); + + mod->ctx = rbt; + return 0; +} + + +QSE_EXPORT int qse_awk_mod_mysql_init (int argc, qse_achar_t* argv[]) +{ + if (mysql_library_init(argc, argv, QSE_NULL) != 0) return -1; + return 0; +} + +QSE_EXPORT void qse_awk_mod_mysql_fini (void) +{ + mysql_library_end (); +} diff --git a/hawk/mod/mod-mysql.h b/hawk/mod/mod-mysql.h new file mode 100644 index 00000000..8c90d1cb --- /dev/null +++ b/hawk/mod/mod-mysql.h @@ -0,0 +1,43 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _QSE_LIB_AWKMOD_MYSQL_H_ +#define _QSE_LIB_AWKMOD_MYSQL_H_ + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +QSE_EXPORT int qse_awk_mod_mysql (qse_awk_mod_t* mod, qse_awk_t* awk); + +#if defined(__cplusplus) +} +#endif + +#endif + diff --git a/hawk/mod/mod-uci.c b/hawk/mod/mod-uci.c new file mode 100644 index 00000000..c58210fc --- /dev/null +++ b/hawk/mod/mod-uci.c @@ -0,0 +1,1439 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "mod-uci.h" +#include +#include +#include +#include +#include "../cmn/mem-prv.h" + +#if defined(HAVE_UCI_H) +# include +#else +# error this module needs uci.h +#endif + +typedef struct uctx_list_t uctx_list_t; +typedef struct uctx_node_t uctx_node_t; + +struct uctx_node_t +{ + int id; + struct uci_context* ctx; + uctx_node_t* prev; + uctx_node_t* next; +}; + +struct uctx_list_t +{ + uctx_node_t* head; + uctx_node_t* tail; + uctx_node_t* free; + + /* mapping table to map 'id' to 'node' */ + struct + { + uctx_node_t** tab; + int capa; + int high; + } map; + + int errnum; +}; + +static uctx_node_t* new_uctx_node (qse_awk_rtx_t* rtx, uctx_list_t* list) +{ + /* create a new context node and append it to the list tail */ + uctx_node_t* node; + + node = QSE_NULL; + + if (list->free) node = list->free; + else + { + node = qse_awk_rtx_callocmem (rtx, QSE_SIZEOF(*node)); + if (!node) goto oops; + } + + node->ctx = uci_alloc_context(); + if (!node->ctx) goto oops; + + if (node == list->free) list->free = node->next; + else + { + if (list->map.high <= list->map.capa) + { + int newcapa; + uctx_node_t** tmp; + + newcapa = list->map.capa + 64; + if (newcapa < list->map.capa) goto oops; /* overflow */ + + tmp = (uctx_node_t**) qse_awk_rtx_reallocmem ( + rtx, list->map.tab, QSE_SIZEOF(*tmp) * newcapa); + if (!tmp) goto oops; + + QSE_MEMSET (&tmp[list->map.capa], 0, + QSE_SIZEOF(*tmp) * (newcapa - list->map.capa)); + + list->map.tab = tmp; + list->map.capa = newcapa; + } + + node->id = list->map.high; + QSE_ASSERT (list->map.tab[node->id] == QSE_NULL); + list->map.tab[node->id] = node; + list->map.high++; + } + + /* append it to the tail */ + node->next = QSE_NULL; + node->prev = list->tail; + if (list->tail) list->tail->next = node; + else list->head = node; + list->tail = node; + + return node; + +oops: + if (node) qse_awk_rtx_freemem (rtx, node); + qse_awk_rtx_seterrnum (rtx, QSE_AWK_ENOMEM, QSE_NULL); + return QSE_NULL; +} + +static void free_uctx_node (qse_awk_rtx_t* rtx, uctx_list_t* list, uctx_node_t* node) +{ + if (node->prev) node->prev->next = node->next; + if (node->next) node->next->prev = node->prev; + if (list->head == node) list->head = node->next; + if (list->tail == node) list->tail = node->prev; + + list->map.tab[node->id] = QSE_NULL; + + if (node->ctx) + { + uci_free_context (node->ctx); + } + + if (list->map.high == node->id + 1) + { + /* destroy the actual node if the node to be freed has the + * highest id */ + QSE_MMGR_FREE (qse_awk_rtx_getmmgr(rtx), node); + list->map.high--; + } + else + { + /* otherwise, chain the node to the free list */ + node->ctx = QSE_NULL; + node->next = list->free; + list->free = node; + } + + /* however, i destroy the whole free list when all the nodes are + * chanined to the free list */ + if (list->head == QSE_NULL) + { + qse_mmgr_t* mmgr; + uctx_node_t* curnode; + + mmgr = qse_awk_rtx_getmmgr(rtx); + + while (list->free) + { + curnode = list->free; + list->free = list->free->next; + QSE_ASSERT (curnode->ctx == QSE_NULL); + QSE_MMGR_FREE (mmgr, curnode); + } + + QSE_MMGR_FREE (mmgr, list->map.tab); + list->map.high = 0; + list->map.capa = 0; + list->map.tab = QSE_NULL; + } +} + +/* ------------------------------------------------------------------------ */ + +static int close_byid (qse_awk_rtx_t* rtx, uctx_list_t* list, qse_awk_int_t id) +{ + int x = UCI_ERR_INVAL; + + if (id >= 0 && id < list->map.high && list->map.tab[id]) + { + free_uctx_node (rtx, list, list->map.tab[id]); + x = UCI_OK; + } + + return -x; +} + +static int load_byid ( + qse_awk_rtx_t* rtx, uctx_list_t* list, qse_awk_int_t id, qse_mchar_t* path) +{ + int x = UCI_ERR_INVAL; + + if (id >= 0 && id < list->map.high && list->map.tab[id]) + { + x = uci_load (list->map.tab[id]->ctx, path, QSE_NULL); + } + + return -x; +} + +static int unload_byid (qse_awk_rtx_t* rtx, uctx_list_t* list, qse_awk_int_t id) +{ + int x = UCI_ERR_INVAL; + + if (id >= 0 && id < list->map.high && list->map.tab[id]) + { + x = uci_unload (list->map.tab[id]->ctx, QSE_NULL); + return 0; + } + + return -x; +} + +static int save_byid (qse_awk_rtx_t* rtx, uctx_list_t* list, qse_awk_int_t id, qse_mchar_t* item) +{ + int x = UCI_ERR_INVAL; + + if (id >= 0 && id < list->map.high && list->map.tab[id]) + { + struct uci_ptr ptr; + + x = uci_lookup_ptr (list->map.tab[id]->ctx, &ptr, item, 1); + + if (x == UCI_OK) + { + + if (!ptr.value && (ptr.flags & UCI_LOOKUP_COMPLETE) && (ptr.last->type == UCI_TYPE_PACKAGE)) + x = uci_save (list->map.tab[id]->ctx, ptr.p); + else + x = UCI_ERR_NOTFOUND; + } + } + + return -x; +} + +static int commit_byid (qse_awk_rtx_t* rtx, uctx_list_t* list, qse_awk_int_t id, qse_mchar_t* item) +{ + int x = UCI_ERR_INVAL; + + if (id >= 0 && id < list->map.high && list->map.tab[id]) + { + struct uci_ptr ptr; + + x = uci_lookup_ptr (list->map.tab[id]->ctx, &ptr, item, 1); + + if (x == UCI_OK) + { + if (!ptr.value && (ptr.flags & UCI_LOOKUP_COMPLETE) && (ptr.last->type == UCI_TYPE_PACKAGE)) + x = uci_commit (list->map.tab[id]->ctx, &ptr.p, 0); + else + x = UCI_ERR_NOTFOUND; + } + } + + return -x; +} + +static int revert_byid (qse_awk_rtx_t* rtx, uctx_list_t* list, qse_awk_int_t id, qse_mchar_t* item) +{ + int x = UCI_ERR_INVAL; + + if (id >= 0 && id < list->map.high && list->map.tab[id]) + { + struct uci_ptr ptr; + + x = uci_lookup_ptr (list->map.tab[id]->ctx, &ptr, item, 1); + + if (x == UCI_OK) + { + if (!ptr.value && (ptr.flags & UCI_LOOKUP_COMPLETE)) + x = uci_revert (list->map.tab[id]->ctx, &ptr); + else + x = UCI_ERR_NOTFOUND; + } + } + + return -x; +} + +static int delete_byid (qse_awk_rtx_t* rtx, uctx_list_t* list, qse_awk_int_t id, qse_mchar_t* item) +{ + int x = UCI_ERR_INVAL; + + if (id >= 0 && id < list->map.high && list->map.tab[id]) + { + struct uci_ptr ptr; + + x = uci_lookup_ptr (list->map.tab[id]->ctx, &ptr, item, 1); + + if (x == UCI_OK) + { + if (!ptr.value && (ptr.flags & UCI_LOOKUP_COMPLETE)) + x = uci_delete (list->map.tab[id]->ctx, &ptr); + else + x = UCI_ERR_NOTFOUND; + } + } + + return -x; +} + +static int rename_byid (qse_awk_rtx_t* rtx, uctx_list_t* list, qse_awk_int_t id, qse_mchar_t* item) +{ + int x = UCI_ERR_INVAL; + + if (id >= 0 && id < list->map.high && list->map.tab[id]) + { + struct uci_ptr ptr; + + x = uci_lookup_ptr (list->map.tab[id]->ctx, &ptr, item, 1); + + if (x == UCI_OK) + { + if (ptr.value && (ptr.flags & UCI_LOOKUP_COMPLETE)) + x = uci_rename (list->map.tab[id]->ctx, &ptr); + else + x = UCI_ERR_NOTFOUND; + } + } + + return -x; +} + +static int set_byid (qse_awk_rtx_t* rtx, uctx_list_t* list, qse_awk_int_t id, qse_mchar_t* item) +{ + int x = UCI_ERR_INVAL; + + if (id >= 0 && id < list->map.high && list->map.tab[id]) + { + struct uci_ptr ptr; + + x = uci_lookup_ptr (list->map.tab[id]->ctx, &ptr, item, 1); + + if (x == UCI_OK) + { + x = ptr.value? uci_set (list->map.tab[id]->ctx, &ptr): UCI_ERR_INVAL; + } + } + + return -x; +} + +static int addsection_byid (qse_awk_rtx_t* rtx, uctx_list_t* list, qse_awk_int_t id, qse_mchar_t* item, qse_mchar_t* type) +{ + int x = UCI_ERR_INVAL; + + if (id >= 0 && id < list->map.high && list->map.tab[id]) + { + struct uci_ptr ptr; + + x = uci_lookup_ptr (list->map.tab[id]->ctx, &ptr, item, 1); + + if (x == UCI_OK) + { + /* add an unnamed section. use set to add a named section */ + struct uci_section* s = QSE_NULL; + if (!ptr.value && (ptr.flags & UCI_LOOKUP_COMPLETE) && (ptr.last->type == UCI_TYPE_PACKAGE)) + x = uci_add_section (list->map.tab[id]->ctx, ptr.p, type, &s); + else x = UCI_ERR_INVAL; + } + } + + return -x; +} + +static int addlist_byid (qse_awk_rtx_t* rtx, uctx_list_t* list, qse_awk_int_t id, qse_mchar_t* item) +{ + int x = UCI_ERR_INVAL; + + if (id >= 0 && id < list->map.high && list->map.tab[id]) + { + struct uci_ptr ptr; + + x = uci_lookup_ptr (list->map.tab[id]->ctx, &ptr, item, 1); + + if (x == UCI_OK) + { + x = ptr.value? uci_add_list (list->map.tab[id]->ctx, &ptr): UCI_ERR_INVAL; + } + } + + return -x; +} + +static int setconfdir_byid ( + qse_awk_rtx_t* rtx, uctx_list_t* list, qse_awk_int_t id, qse_mchar_t* path) +{ + int x = UCI_ERR_INVAL; + + if (id >= 0 && id < list->map.high && list->map.tab[id]) + { + x = uci_set_confdir (list->map.tab[id]->ctx, path); + } + + return -x; +} + +static int setsavedir_byid ( + qse_awk_rtx_t* rtx, uctx_list_t* list, qse_awk_int_t id, qse_mchar_t* path) +{ + int x = UCI_ERR_INVAL; + + if (id >= 0 && id < list->map.high && list->map.tab[id]) + { + x = uci_set_savedir (list->map.tab[id]->ctx, path); + } + + return -x; +} + +static int adddeltapath_byid ( + qse_awk_rtx_t* rtx, uctx_list_t* list, qse_awk_int_t id, qse_mchar_t* path) +{ + int x = UCI_ERR_INVAL; + + if (id >= 0 && id < list->map.high && list->map.tab[id]) + { + x = uci_add_delta_path (list->map.tab[id]->ctx, path); + } + + return -x; +} + +static int getsection_byid ( + qse_awk_rtx_t* rtx, uctx_list_t* list, qse_awk_int_t id, + qse_mchar_t* tuple, qse_awk_val_ref_t* ref) +{ + int x = UCI_ERR_INVAL; + + if (id >= 0 && id < list->map.high && list->map.tab[id]) + { + struct uci_ptr ptr; + + x = uci_lookup_ptr (list->map.tab[id]->ctx, &ptr, tuple, 1); + if (x == UCI_OK) + { + /* ptr.value is not null if the tuple specified contains + assignment like network.wan.ifname=eth0 */ + if (!ptr.value && (ptr.flags & UCI_LOOKUP_COMPLETE)) + { + struct uci_element* e; + + e = ptr.last; + if (e->type == UCI_TYPE_SECTION) + { + qse_awk_val_map_data_t md[4]; + qse_awk_int_t lv; + qse_awk_val_t* tmp; + + QSE_MEMSET (md, 0, QSE_SIZEOF(md)); + + md[0].key.ptr = QSE_T("type"); + md[0].key.len = 4; + md[0].type = QSE_AWK_VAL_MAP_DATA_MBS; + md[0].vptr = ptr.s->type; + + md[1].key.ptr = QSE_T("name"); + md[1].key.len = 4; + md[1].type = QSE_AWK_VAL_MAP_DATA_MBS; + md[1].vptr = ptr.s->e.name; /* e->name == ptr.s->e.name */ + + md[2].key.ptr = QSE_T("anon"); + md[2].key.len = 4; + md[2].vptr = QSE_AWK_VAL_MAP_DATA_INT; + lv = ptr.s->anonymous; + md[2].vptr = &lv; + + tmp = qse_awk_rtx_makemapvalwithdata (rtx, md); + if (tmp) + { + int n; + qse_awk_rtx_refupval (rtx, tmp); + n = qse_awk_rtx_setrefval (rtx, ref, tmp); + qse_awk_rtx_refdownval (rtx, tmp); + if (n <= -1) return -9999; + } + else x = UCI_ERR_MEM; + } + else x = UCI_ERR_NOTFOUND; + + } + else x = UCI_ERR_NOTFOUND; + } + } + + return -x; +} + +static int getoption_byid ( + qse_awk_rtx_t* rtx, uctx_list_t* list, qse_awk_int_t id, + qse_mchar_t* tuple, qse_awk_val_ref_t* ref) +{ + int x = UCI_ERR_INVAL; + + if (id >= 0 && id < list->map.high && list->map.tab[id]) + { + struct uci_ptr ptr; + + x = uci_lookup_ptr (list->map.tab[id]->ctx, &ptr, tuple, 1); + if (x == UCI_OK) + { + /* ptr.value is not null if the tuple specified contains + assignment like network.wan.ifname=eth0 */ + if (!ptr.value && (ptr.flags & UCI_LOOKUP_COMPLETE)) + { + struct uci_element* e; + + e = ptr.last; + if (e->type == UCI_TYPE_OPTION) + { + struct uci_option* uo = ptr.o; + + if (uo->type == UCI_TYPE_STRING) + { + qse_awk_val_t* map; + qse_awk_val_map_data_t md[3]; + + QSE_MEMSET (md, 0, QSE_SIZEOF(md)); + + md[0].key.ptr = QSE_T("type"); + md[0].key.len = 4; + md[0].type = QSE_AWK_VAL_MAP_DATA_STR; + md[0].vptr = QSE_T("string"); + + md[1].key.ptr = QSE_T("value"); + md[1].key.len = 5; + md[1].type = QSE_AWK_VAL_MAP_DATA_MBS; + md[1].vptr = uo->v.string; + + map = qse_awk_rtx_makemapvalwithdata (rtx, md); + if (map) + { + int n; + qse_awk_rtx_refupval (rtx, map); + n = qse_awk_rtx_setrefval (rtx, ref, map); + qse_awk_rtx_refdownval (rtx, map); + if (n <= -1) + { + map = QSE_NULL; + return -9999; + } + } + else x = UCI_ERR_MEM; + } + else if (uo->type == UCI_TYPE_LIST) + { + qse_awk_val_t* map, * fld; + qse_awk_val_map_data_t md[3]; + struct uci_element* tmp; + qse_awk_int_t count; + + count = 0; + uci_foreach_element(&uo->v.list, tmp) { count++; } + + QSE_MEMSET (md, 0, QSE_SIZEOF(md)); + + md[0].key.ptr = QSE_T("type"); + md[0].key.len = 4; + md[0].type = QSE_AWK_VAL_MAP_DATA_STR; + md[0].vptr = QSE_T("list"); + + md[1].key.ptr = QSE_T("count"); + md[1].key.len = 5; + md[1].type = QSE_AWK_VAL_MAP_DATA_INT; + md[1].vptr = &count; + + map = qse_awk_rtx_makemapvalwithdata (rtx, md); + if (map) + { + count = 1; + uci_foreach_element(&uo->v.list, tmp) + { + const qse_cstr_t* subsep; + qse_cstr_t k[4]; + qse_char_t idxbuf[64]; + qse_char_t* kp; + qse_size_t kl; + + fld = qse_awk_rtx_makestrvalwithmbs (rtx, tmp->name); + if (!fld) + { + qse_awk_rtx_refupval (rtx, map); + qse_awk_rtx_refdownval (rtx, map); + map = QSE_NULL; + x = UCI_ERR_MEM; + break; + } + + subsep = qse_awk_rtx_getsubsep (rtx); + + k[0].ptr = QSE_T("value"); + k[0].len = 5; + k[1].ptr = subsep->ptr; + k[1].len = subsep->len; + k[2].ptr = idxbuf; + k[2].len = qse_fmtuintmax (idxbuf, QSE_COUNTOF(idxbuf), count, 10, -1, QSE_T('\0'), QSE_NULL); + k[3].ptr = QSE_NULL; + k[3].len = 0; + + kp = qse_wcstradup (k, &kl, qse_awk_rtx_getmmgr(rtx)); + if (kp == QSE_NULL || qse_awk_rtx_setmapvalfld (rtx, map, kp, kl, fld) == QSE_NULL) + { + if (kp) QSE_MMGR_FREE (qse_awk_rtx_getmmgr(rtx), kp); + qse_awk_rtx_refupval (rtx, fld); + qse_awk_rtx_refdownval (rtx, fld); + qse_awk_rtx_refupval (rtx, map); + qse_awk_rtx_refdownval (rtx, map); + map = QSE_NULL; + x = UCI_ERR_MEM; + break; + } + + QSE_MMGR_FREE (qse_awk_rtx_getmmgr(rtx), kp); + count++; + } + + if (map) + { + if (qse_awk_rtx_setrefval (rtx, ref, map) <= -1) + { + qse_awk_rtx_refupval (rtx, map); + qse_awk_rtx_refdownval (rtx, map); + map = QSE_NULL; + return -9999; + } + } + } + else x = UCI_ERR_MEM; + } + else x = UCI_ERR_INVAL; /* uo->type */ + } + else x = UCI_ERR_NOTFOUND; /* e->type */ + } + else x = UCI_ERR_NOTFOUND; + } + } + + return -x; +} +/* ------------------------------------------------------------------------ */ + +static QSE_INLINE uctx_list_t* rtx_to_list (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + qse_rbt_pair_t* pair; + pair = qse_rbt_search ((qse_rbt_t*)fi->mod->ctx, &rtx, QSE_SIZEOF(rtx)); + QSE_ASSERT (pair != QSE_NULL); + return (uctx_list_t*)QSE_RBT_VPTR(pair); +} + +static int fnc_uci_errno (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + uctx_list_t* list; + qse_awk_val_t* retv; + + list = rtx_to_list (rtx, fi); + + retv = qse_awk_rtx_makeintval (rtx, list->errnum); + if (retv == QSE_NULL) return -1; + + qse_awk_rtx_setretval (rtx, retv); + return 0; +} + +static qse_char_t* errmsg[] = +{ + QSE_T("no error"), + QSE_T("out of memory"), + QSE_T("invalid data"), + QSE_T("not found"), + QSE_T("I/O error"), + QSE_T("parse error"), + QSE_T("duplicate data"), + QSE_T("unknown error") +}; + +static int fnc_uci_errstr (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + uctx_list_t* list; + qse_awk_val_t* retv; + qse_awk_int_t errnum; + + list = rtx_to_list (rtx, fi); + + if (qse_awk_rtx_getnargs (rtx) <= 0 || + qse_awk_rtx_valtoint (rtx, qse_awk_rtx_getarg (rtx, 0), &errnum) <= -1) + { + errnum = list->errnum; + } + + if (errnum < 0 || errnum >= QSE_COUNTOF(errmsg)) errnum = QSE_COUNTOF(errmsg) - 1; + + retv = qse_awk_rtx_makestrvalwithstr (rtx, errmsg[errnum]); + if (retv == QSE_NULL) return -1; + + qse_awk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_uci_open (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + uctx_list_t* list; + uctx_node_t* node; + qse_awk_int_t ret; + qse_awk_val_t* retv; + + list = rtx_to_list (rtx, fi); + node = new_uctx_node (rtx, list); + ret = node? node->id: -UCI_ERR_MEM; + + if (ret <= -1) + { + list->errnum = -ret; + ret = -1; + } + + retv = qse_awk_rtx_makeintval (rtx, ret); + if (retv == QSE_NULL) return -1; + + qse_awk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_uci_close (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + uctx_list_t* list; + qse_awk_val_t* retv; + qse_awk_int_t id; + int ret; + + list = rtx_to_list (rtx, fi); + + ret = qse_awk_rtx_valtoint (rtx, qse_awk_rtx_getarg (rtx, 0), &id); + if (ret <= -1) ret = -UCI_ERR_INVAL; + else ret = close_byid (rtx, list, id); + + if (ret <= -1) + { + list->errnum = -ret; + ret = -1; + } + + retv = qse_awk_rtx_makeintval (rtx, ret); + if (retv == QSE_NULL) return -1; + + qse_awk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_uci_load (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + uctx_list_t* list; + qse_awk_val_t* retv; + qse_awk_int_t id; + int ret; + + list = rtx_to_list (rtx, fi); + + ret = qse_awk_rtx_valtoint (rtx, qse_awk_rtx_getarg (rtx, 0), &id); + if (ret <= -1) ret = -UCI_ERR_INVAL; + else + { + qse_mchar_t* item; + + item = qse_awk_rtx_valtombsdup(rtx, qse_awk_rtx_getarg(rtx, 1), QSE_NULL); + if (item) + { + ret = load_byid (rtx, list, id, item); + qse_awk_rtx_freemem (rtx, item); + } + else ret = -UCI_ERR_MEM; + } + + if (ret <= -1) + { + list->errnum = -ret; + ret = -1; + } + + retv = qse_awk_rtx_makeintval (rtx, ret); + if (retv == QSE_NULL) return -1; + + qse_awk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_uci_unload (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + uctx_list_t* list; + qse_awk_val_t* retv; + qse_awk_int_t id; + int ret; + + list = rtx_to_list (rtx, fi); + + ret = qse_awk_rtx_valtoint (rtx, qse_awk_rtx_getarg (rtx, 0), &id); + if (ret <= -1) ret = -UCI_ERR_INVAL; + else ret = unload_byid (rtx, list, id); + + if (ret <= -1) + { + list->errnum = -ret; + ret = -1; + } + + retv = qse_awk_rtx_makeintval (rtx, ret); + if (retv == QSE_NULL) return -1; + + qse_awk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_uci_save (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + uctx_list_t* list; + qse_awk_val_t* retv; + qse_awk_int_t id; + int ret; + + list = rtx_to_list (rtx, fi); + + ret = qse_awk_rtx_valtoint (rtx, qse_awk_rtx_getarg (rtx, 0), &id); + if (ret <= -1) ret = -UCI_ERR_INVAL; + else + { + qse_mchar_t* item; + + item = qse_awk_rtx_valtombsdup(rtx, qse_awk_rtx_getarg(rtx, 1), QSE_NULL); + if (item) + { + ret = save_byid (rtx, list, id, item); + qse_awk_rtx_freemem (rtx, item); + } + else ret = -UCI_ERR_MEM; + } + + if (ret <= -1) + { + list->errnum = -ret; + ret = -1; + } + + retv = qse_awk_rtx_makeintval (rtx, ret); + if (retv == QSE_NULL) return -1; + + qse_awk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_uci_commit (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + uctx_list_t* list; + qse_awk_val_t* retv; + qse_awk_int_t id; + int ret; + + list = rtx_to_list (rtx, fi); + + ret = qse_awk_rtx_valtoint (rtx, qse_awk_rtx_getarg (rtx, 0), &id); + if (ret <= -1) ret = -UCI_ERR_INVAL; + else + { + qse_mchar_t* item; + + item = qse_awk_rtx_valtombsdup(rtx, qse_awk_rtx_getarg(rtx, 1), QSE_NULL); + if (item) + { + ret = commit_byid (rtx, list, id, item); + qse_awk_rtx_freemem (rtx, item); + } + else ret = -UCI_ERR_MEM; + } + + if (ret <= -1) + { + list->errnum = -ret; + ret = -1; + } + + retv = qse_awk_rtx_makeintval (rtx, ret); + if (retv == QSE_NULL) return -1; + + qse_awk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_uci_revert (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + uctx_list_t* list; + qse_awk_val_t* retv; + qse_awk_int_t id; + int ret; + + list = rtx_to_list (rtx, fi); + + ret = qse_awk_rtx_valtoint (rtx, qse_awk_rtx_getarg (rtx, 0), &id); + if (ret <= -1) ret = -UCI_ERR_INVAL; + else + { + qse_mchar_t* item; + + item = qse_awk_rtx_valtombsdup(rtx, qse_awk_rtx_getarg(rtx, 1), QSE_NULL); + if (item) + { + ret = revert_byid (rtx, list, id, item); + qse_awk_rtx_freemem (rtx, item); + } + else ret = -UCI_ERR_MEM; + } + + if (ret <= -1) + { + list->errnum = -ret; + ret = -1; + } + + retv = qse_awk_rtx_makeintval (rtx, ret); + if (retv == QSE_NULL) return -1; + + qse_awk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_uci_delete (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + uctx_list_t* list; + qse_awk_val_t* retv; + qse_awk_int_t id; + int ret; + + list = rtx_to_list (rtx, fi); + + ret = qse_awk_rtx_valtoint (rtx, qse_awk_rtx_getarg (rtx, 0), &id); + if (ret <= -1) ret = -UCI_ERR_INVAL; + else + { + qse_mchar_t* item; + + item = qse_awk_rtx_valtombsdup(rtx, qse_awk_rtx_getarg(rtx, 1), QSE_NULL); + if (item) + { + ret = delete_byid (rtx, list, id, item); + qse_awk_rtx_freemem (rtx, item); + } + else ret = -UCI_ERR_MEM; + } + + if (ret <= -1) + { + list->errnum = -ret; + ret = -1; + } + + retv = qse_awk_rtx_makeintval (rtx, ret); + if (retv == QSE_NULL) return -1; + + qse_awk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_uci_rename (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + uctx_list_t* list; + qse_awk_val_t* retv; + qse_awk_int_t id; + int ret; + + list = rtx_to_list (rtx, fi); + + ret = qse_awk_rtx_valtoint (rtx, qse_awk_rtx_getarg (rtx, 0), &id); + if (ret <= -1) ret = -UCI_ERR_INVAL; + else + { + qse_mchar_t* item; + + item = qse_awk_rtx_valtombsdup(rtx, qse_awk_rtx_getarg(rtx, 1), QSE_NULL); + if (item) + { + ret = rename_byid (rtx, list, id, item); + qse_awk_rtx_freemem (rtx, item); + } + else ret = -UCI_ERR_MEM; + } + + if (ret <= -1) + { + list->errnum = -ret; + ret = -1; + } + + retv = qse_awk_rtx_makeintval (rtx, ret); + if (retv == QSE_NULL) return -1; + + qse_awk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_uci_set (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + uctx_list_t* list; + qse_awk_val_t* retv; + qse_awk_int_t id; + int ret; + + list = rtx_to_list (rtx, fi); + + ret = qse_awk_rtx_valtoint (rtx, qse_awk_rtx_getarg (rtx, 0), &id); + if (ret <= -1) ret = -UCI_ERR_INVAL; + else + { + qse_mchar_t* item; + + item = qse_awk_rtx_valtombsdup(rtx, qse_awk_rtx_getarg(rtx, 1), QSE_NULL); + if (item) + { + ret = set_byid (rtx, list, id, item); + qse_awk_rtx_freemem (rtx, item); + } + else ret = -UCI_ERR_MEM; + } + + if (ret <= -1) + { + list->errnum = -ret; + ret = -1; + } + + retv = qse_awk_rtx_makeintval (rtx, ret); + if (retv == QSE_NULL) return -1; + + qse_awk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_uci_addsection (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + uctx_list_t* list; + qse_awk_val_t* retv; + qse_awk_int_t id; + int ret; + + list = rtx_to_list (rtx, fi); + + ret = qse_awk_rtx_valtoint (rtx, qse_awk_rtx_getarg (rtx, 0), &id); + if (ret <= -1) ret = -UCI_ERR_INVAL; + else + { + qse_mchar_t* item, * type; + + item = qse_awk_rtx_valtombsdup(rtx, qse_awk_rtx_getarg(rtx, 1), QSE_NULL); + type = qse_awk_rtx_valtombsdup(rtx, qse_awk_rtx_getarg(rtx, 2), QSE_NULL); + if (item && type) + { + ret = addsection_byid (rtx, list, id, item, type); + } + else ret = -UCI_ERR_MEM; + + if (type) qse_awk_rtx_freemem (rtx, type); + if (item) qse_awk_rtx_freemem (rtx, item); + } + + if (ret <= -1) + { + list->errnum = -ret; + ret = -1; + } + + retv = qse_awk_rtx_makeintval (rtx, ret); + if (retv == QSE_NULL) return -1; + + qse_awk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_uci_addlist (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + uctx_list_t* list; + qse_awk_val_t* retv; + qse_awk_int_t id; + int ret; + + list = rtx_to_list (rtx, fi); + + ret = qse_awk_rtx_valtoint (rtx, qse_awk_rtx_getarg (rtx, 0), &id); + if (ret <= -1) ret = -UCI_ERR_INVAL; + else + { + qse_mchar_t* item; + + item = qse_awk_rtx_valtombsdup(rtx, qse_awk_rtx_getarg(rtx, 1), QSE_NULL); + if (item) + { + ret = addlist_byid (rtx, list, id, item); + qse_awk_rtx_freemem (rtx, item); + } + else ret = -UCI_ERR_MEM; + } + + if (ret <= -1) + { + list->errnum = -ret; + ret = -1; + } + + retv = qse_awk_rtx_makeintval (rtx, ret); + if (retv == QSE_NULL) return -1; + + qse_awk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_uci_setconfdir (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + uctx_list_t* list; + qse_awk_val_t* retv; + qse_awk_int_t id; + int ret; + + list = rtx_to_list (rtx, fi); + + ret = qse_awk_rtx_valtoint (rtx, qse_awk_rtx_getarg (rtx, 0), &id); + if (ret <= -1) ret = -UCI_ERR_INVAL; + else + { + qse_mchar_t* item; + + item = qse_awk_rtx_valtombsdup(rtx, qse_awk_rtx_getarg(rtx, 1), QSE_NULL); + if (item) + { + ret = setconfdir_byid (rtx, list, id, item); + qse_awk_rtx_freemem (rtx, item); + } + else ret = -UCI_ERR_MEM; + } + + if (ret <= -1) + { + list->errnum = -ret; + ret = -1; + } + + retv = qse_awk_rtx_makeintval (rtx, ret); + if (retv == QSE_NULL) return -1; + + qse_awk_rtx_setretval (rtx, retv); + return 0; +} + + +static int fnc_uci_setsavedir (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + uctx_list_t* list; + qse_awk_val_t* retv; + qse_awk_int_t id; + int ret; + + list = rtx_to_list (rtx, fi); + + ret = qse_awk_rtx_valtoint (rtx, qse_awk_rtx_getarg (rtx, 0), &id); + if (ret <= -1) ret = -UCI_ERR_INVAL; + else + { + qse_mchar_t* item; + + item = qse_awk_rtx_valtombsdup(rtx, qse_awk_rtx_getarg(rtx, 1), QSE_NULL); + if (item) + { + ret = setsavedir_byid (rtx, list, id, item); + qse_awk_rtx_freemem (rtx, item); + } + else ret = -UCI_ERR_MEM; + } + + if (ret <= -1) + { + list->errnum = -ret; + ret = -1; + } + + retv = qse_awk_rtx_makeintval (rtx, ret); + if (retv == QSE_NULL) return -1; + + qse_awk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_uci_adddeltapath (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + uctx_list_t* list; + qse_awk_val_t* retv; + qse_awk_int_t id; + int ret; + + list = rtx_to_list (rtx, fi); + + ret = qse_awk_rtx_valtoint (rtx, qse_awk_rtx_getarg (rtx, 0), &id); + if (ret <= -1) ret = -UCI_ERR_INVAL; + else + { + qse_mchar_t* item; + + item = qse_awk_rtx_valtombsdup(rtx, qse_awk_rtx_getarg(rtx, 1), QSE_NULL); + if (item) + { + ret = adddeltapath_byid (rtx, list, id, item); + qse_awk_rtx_freemem (rtx, item); + } + else ret = -UCI_ERR_MEM; + } + + if (ret <= -1) + { + list->errnum = -ret; + ret = -1; + } + + retv = qse_awk_rtx_makeintval (rtx, ret); + if (retv == QSE_NULL) return -1; + + qse_awk_rtx_setretval (rtx, retv); + return 0; +} + +static int fnc_uci_getoption (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + uctx_list_t* list; + qse_awk_int_t id; + int ret; + + list = rtx_to_list (rtx, fi); + + ret = qse_awk_rtx_valtoint (rtx, qse_awk_rtx_getarg (rtx, 0), &id); + if (ret <= -1) ret = -UCI_ERR_INVAL; + else + { + qse_mchar_t* item; + + item = qse_awk_rtx_valtombsdup(rtx, qse_awk_rtx_getarg(rtx, 1), QSE_NULL); + if (item) + { + ret = getoption_byid (rtx, list, id, item, qse_awk_rtx_getarg (rtx, 2)); + qse_awk_rtx_freemem (rtx, item); + if (ret == -9999) return -1; + } + else ret = -UCI_ERR_MEM; + } + + if (ret <= -1) + { + list->errnum = -ret; + ret = -1; + } + else ret = 0; + + qse_awk_rtx_setretval (rtx, qse_awk_rtx_makeintval (rtx, ret)); + return 0; +} + +static int fnc_uci_getsection (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi) +{ + uctx_list_t* list; + qse_awk_int_t id; + int ret; + + list = rtx_to_list (rtx, fi); + + ret = qse_awk_rtx_valtoint(rtx, qse_awk_rtx_getarg (rtx, 0), &id); + if (ret <= -1) ret = -UCI_ERR_INVAL; + else + { + qse_mchar_t* item; + + item = qse_awk_rtx_valtombsdup(rtx, qse_awk_rtx_getarg (rtx, 1), QSE_NULL); + if (item) + { + ret = getsection_byid(rtx, list, id, item, qse_awk_rtx_getarg (rtx, 2)); + qse_awk_rtx_freemem (rtx, item); + if (ret == -9999) return -1; + } + else ret = -UCI_ERR_MEM; + } + + if (ret <= -1) + { + list->errnum = -ret; + ret = -1; + } + else ret = 0; + + qse_awk_rtx_setretval (rtx, qse_awk_rtx_makeintval (rtx, ret)); + return 0; +} + +/* ------------------------------------------------------------------------ */ + +typedef struct fnctab_t fnctab_t; +struct fnctab_t +{ + const qse_char_t* name; + qse_awk_mod_sym_fnc_t info; +}; + +static fnctab_t fnctab[] = +{ + { QSE_T("adddeltapath"), { { 2, 2, QSE_NULL }, fnc_uci_adddeltapath, 0 } }, + { QSE_T("addlist"), { { 2, 2, QSE_NULL }, fnc_uci_addlist, 0 } }, + { QSE_T("addsection"), { { 3, 3, QSE_NULL }, fnc_uci_addsection, 0 } }, + { QSE_T("close"), { { 1, 1, QSE_NULL }, fnc_uci_close, 0 } }, + { QSE_T("commit"), { { 2, 2, QSE_NULL }, fnc_uci_commit, 0 } }, + { QSE_T("delete"), { { 2, 2, QSE_NULL }, fnc_uci_delete, 0 } }, + { QSE_T("errno"), { { 0, 0, QSE_NULL }, fnc_uci_errno, 0 } }, + { QSE_T("errstr"), { { 0, 1, QSE_NULL }, fnc_uci_errstr, 0 } }, + { QSE_T("getoption"), { { 3, 3, QSE_T("vvr")}, fnc_uci_getoption, 0 } }, + { QSE_T("getsection"), { { 3, 3, QSE_T("vvr")}, fnc_uci_getsection, 0 } }, + { QSE_T("load"), { { 2, 2, QSE_NULL }, fnc_uci_load, 0 } }, + { QSE_T("open"), { { 0, 0, QSE_NULL }, fnc_uci_open, 0 } }, + { QSE_T("rename"), { { 2, 2, QSE_NULL }, fnc_uci_rename, 0 } }, + { QSE_T("revert"), { { 2, 2, QSE_NULL }, fnc_uci_revert, 0 } }, + { QSE_T("save"), { { 2, 2, QSE_NULL }, fnc_uci_save, 0 } }, + { QSE_T("set"), { { 2, 2, QSE_NULL }, fnc_uci_set, 0 } }, + { QSE_T("setconfdir"), { { 2, 2, QSE_NULL }, fnc_uci_setconfdir, 0 } }, + { QSE_T("setsavedir"), { { 2, 2, QSE_NULL }, fnc_uci_setsavedir, 0 } }, + { QSE_T("unload"), { { 1, 1, QSE_NULL }, fnc_uci_unload, 0 } } +}; + +/* ------------------------------------------------------------------------ */ + +static int query (qse_awk_mod_t* mod, qse_awk_t* awk, const qse_char_t* name, qse_awk_mod_sym_t* sym) +{ + qse_cstr_t ea; + int left, right, mid, n; + + left = 0; right = QSE_COUNTOF(fnctab) - 1; + + while (left <= right) + { + mid = left + (right - left) / 2; + + n = qse_strcmp (fnctab[mid].name, name); + if (n > 0) right = mid - 1; + else if (n < 0) left = mid + 1; + else + { + sym->type = QSE_AWK_MOD_FNC; + sym->u.fnc = fnctab[mid].info; + return 0; + } + } + + ea.ptr = name; + ea.len = qse_strlen(name); + qse_awk_seterror (awk, QSE_AWK_ENOENT, &ea, QSE_NULL); + return -1; +} + +static int init (qse_awk_mod_t* mod, qse_awk_rtx_t* rtx) +{ + qse_rbt_t* rbt; + uctx_list_t list; + + rbt = (qse_rbt_t*)mod->ctx; + + QSE_MEMSET (&list, 0, QSE_SIZEOF(list)); + if (qse_rbt_insert (rbt, &rtx, QSE_SIZEOF(rtx), &list, QSE_SIZEOF(list)) == QSE_NULL) + { + qse_awk_rtx_seterrnum (rtx, QSE_AWK_ENOMEM, QSE_NULL); + return -1; + } + + return 0; +} + +static void fini (qse_awk_mod_t* mod, qse_awk_rtx_t* rtx) +{ + qse_rbt_t* rbt; + qse_rbt_pair_t* pair; + + rbt = (qse_rbt_t*)mod->ctx; + + /* garbage clean-up */ + pair = qse_rbt_search (rbt, &rtx, QSE_SIZEOF(rtx)); + if (pair) + { + uctx_list_t* list; + uctx_node_t* node, * next; + + list = QSE_RBT_VPTR(pair); + node = list->head; + while (node) + { + next = node->next; + free_uctx_node (rtx, list, node); + node = next; + } + + qse_rbt_delete (rbt, &rtx, QSE_SIZEOF(rtx)); + } +} + +static void unload (qse_awk_mod_t* mod, qse_awk_t* awk) +{ + qse_rbt_t* rbt; + + rbt = (qse_rbt_t*)mod->ctx; + + QSE_ASSERT (QSE_RBT_SIZE(rbt) == 0); + qse_rbt_close (rbt); +} + +int qse_awk_mod_uci (qse_awk_mod_t* mod, qse_awk_t* awk) +{ + qse_rbt_t* rbt; + + mod->query = query; + mod->unload = unload; + + mod->init = init; + mod->fini = fini; + + rbt = qse_rbt_open (qse_awk_getmmgr(awk), 0, 1, 1); + if (rbt == QSE_NULL) + { + qse_awk_seterrnum (awk, QSE_AWK_ENOMEM, QSE_NULL); + return -1; + } + qse_rbt_setstyle (rbt, qse_getrbtstyle(QSE_RBT_STYLE_INLINE_COPIERS)); + + mod->ctx = rbt; + return 0; +} + diff --git a/hawk/mod/mod-uci.h b/hawk/mod/mod-uci.h new file mode 100644 index 00000000..6688e737 --- /dev/null +++ b/hawk/mod/mod-uci.h @@ -0,0 +1,43 @@ +/* + * $Id$ + * + Copyright (c) 2006-2019 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _QSE_LIB_AWKMOD_UCI_H_ +#define _QSE_LIB_AWKMOD_UCI_H_ + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +QSE_EXPORT int qse_awk_mod_uci (qse_awk_mod_t* mod, qse_awk_t* awk); + +#if defined(__cplusplus) +} +#endif + +#endif + diff --git a/hawk/t/Makefile.am b/hawk/t/Makefile.am new file mode 100644 index 00000000..4b267899 --- /dev/null +++ b/hawk/t/Makefile.am @@ -0,0 +1,34 @@ +AUTOMAKE_OPTIONS = nostdinc + +AM_CFLAGS = $(PTHREAD_CFLAGS) + +AM_CPPFLAGS = \ + -I$(abs_builddir) \ + -I$(abs_builddir)/../lib \ + -I$(abs_srcdir) \ + -I$(abs_srcdir)/../lib \ + -I$(includedir) + +AM_LDFLAGS = -L$(abs_builddir)/../lib -L$(libdir) +LDADD = $(PTHREAD_LIBS) + +##bin_PROGRAMS = t-001 t-002 t-003 t-004 +bin_PROGRAMS = t-001 t-002 t-005 + +t_001_SOURCES = t-001.c + +t_002_SOURCES = t-002.c +t_002_LDADD = -lhawk $(LDADD) +t_002_DEPENDENCIES = ../lib/libhawk.la + +#t_003_SOURCES = t-003.c +#t_003_LDADD = -lhawk $(LDADD) +#t_003_DEPENDENCIES = ../lib/libhawk.la +# +#t_004_SOURCES = t-004.c +#t_004_LDADD = -lhawk $(LDADD) +#t_004_DEPENDENCIES = ../lib/libhawk.la + +t_005_SOURCES = t-005.c +t_005_LDADD = -lhawk $(LDADD) +t_005_DEPENDENCIES = ../lib/libhawk.la diff --git a/hawk/t/Makefile.in b/hawk/t/Makefile.in new file mode 100644 index 00000000..bc2fed64 --- /dev/null +++ b/hawk/t/Makefile.in @@ -0,0 +1,724 @@ +# Makefile.in generated by automake 1.16.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2018 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@ +bin_PROGRAMS = t-001$(EXEEXT) t-002$(EXEEXT) t-005$(EXEEXT) +subdir = t +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ + $(top_srcdir)/m4/ax_cxx_namespace.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)/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)/lib/hawk-cfg.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_t_001_OBJECTS = t-001.$(OBJEXT) +t_001_OBJECTS = $(am_t_001_OBJECTS) +t_001_LDADD = $(LDADD) +am__DEPENDENCIES_1 = +t_001_DEPENDENCIES = $(am__DEPENDENCIES_1) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +am_t_002_OBJECTS = t-002.$(OBJEXT) +t_002_OBJECTS = $(am_t_002_OBJECTS) +am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) +am_t_005_OBJECTS = t-005.$(OBJEXT) +t_005_OBJECTS = $(am_t_005_OBJECTS) +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 = +DEFAULT_INCLUDES = +depcomp = $(SHELL) $(top_srcdir)/ac/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/t-001.Po ./$(DEPDIR)/t-002.Po \ + ./$(DEPDIR)/t-005.Po +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(t_001_SOURCES) $(t_002_SOURCES) $(t_005_SOURCES) +DIST_SOURCES = $(t_001_SOURCES) $(t_002_SOURCES) $(t_005_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) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/ac/depcomp +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@ +DYNCALL_LIBS = @DYNCALL_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FFI_LIBS = @FFI_LIBS@ +FGREP = @FGREP@ +GREP = @GREP@ +HAVE_CXX = @HAVE_CXX@ +HAWK_PROJECT_AUTHOR = @HAWK_PROJECT_AUTHOR@ +HAWK_PROJECT_URL = @HAWK_PROJECT_URL@ +HAWK_SIZEOF_CHAR = @HAWK_SIZEOF_CHAR@ +HAWK_SIZEOF_DOUBLE = @HAWK_SIZEOF_DOUBLE@ +HAWK_SIZEOF_FLOAT = @HAWK_SIZEOF_FLOAT@ +HAWK_SIZEOF_INT = @HAWK_SIZEOF_INT@ +HAWK_SIZEOF_LONG = @HAWK_SIZEOF_LONG@ +HAWK_SIZEOF_LONG_DOUBLE = @HAWK_SIZEOF_LONG_DOUBLE@ +HAWK_SIZEOF_LONG_LONG = @HAWK_SIZEOF_LONG_LONG@ +HAWK_SIZEOF_OFF64_T = @HAWK_SIZEOF_OFF64_T@ +HAWK_SIZEOF_OFF_T = @HAWK_SIZEOF_OFF_T@ +HAWK_SIZEOF_SHORT = @HAWK_SIZEOF_SHORT@ +HAWK_SIZEOF_VOID_P = @HAWK_SIZEOF_VOID_P@ +HAWK_SIZEOF_WCHAR_T = @HAWK_SIZEOF_WCHAR_T@ +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@ +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@ +QUADMATH_LIBS = @QUADMATH_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SOCKET_LIBS = @SOCKET_LIBS@ +STRIP = @STRIP@ +UNICOWS_LIBS = @UNICOWS_LIBS@ +UNWIND_LIBS = @UNWIND_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@ +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 = nostdinc +AM_CFLAGS = $(PTHREAD_CFLAGS) +AM_CPPFLAGS = \ + -I$(abs_builddir) \ + -I$(abs_builddir)/../lib \ + -I$(abs_srcdir) \ + -I$(abs_srcdir)/../lib \ + -I$(includedir) + +AM_LDFLAGS = -L$(abs_builddir)/../lib -L$(libdir) +LDADD = $(PTHREAD_LIBS) +t_001_SOURCES = t-001.c +t_002_SOURCES = t-002.c +t_002_LDADD = -lhawk $(LDADD) +t_002_DEPENDENCIES = ../lib/libhawk.la + +#t_003_SOURCES = t-003.c +#t_003_LDADD = -lhawk $(LDADD) +#t_003_DEPENDENCIES = ../lib/libhawk.la +# +#t_004_SOURCES = t-004.c +#t_004_LDADD = -lhawk $(LDADD) +#t_004_DEPENDENCIES = ../lib/libhawk.la +t_005_SOURCES = t-005.c +t_005_LDADD = -lhawk $(LDADD) +t_005_DEPENDENCIES = ../lib/libhawk.la +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(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 t/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign t/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): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +t-001$(EXEEXT): $(t_001_OBJECTS) $(t_001_DEPENDENCIES) $(EXTRA_t_001_DEPENDENCIES) + @rm -f t-001$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(t_001_OBJECTS) $(t_001_LDADD) $(LIBS) + +t-002$(EXEEXT): $(t_002_OBJECTS) $(t_002_DEPENDENCIES) $(EXTRA_t_002_DEPENDENCIES) + @rm -f t-002$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(t_002_OBJECTS) $(t_002_LDADD) $(LIBS) + +t-005$(EXEEXT): $(t_005_OBJECTS) $(t_005_DEPENDENCIES) $(EXTRA_t_005_DEPENDENCIES) + @rm -f t-005$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(t_005_OBJECTS) $(t_005_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-001.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-002.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-005.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +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 $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +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-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/t-001.Po + -rm -f ./$(DEPDIR)/t-002.Po + -rm -f ./$(DEPDIR)/t-005.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +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-binPROGRAMS + +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 ./$(DEPDIR)/t-001.Po + -rm -f ./$(DEPDIR)/t-002.Po + -rm -f ./$(DEPDIR)/t-005.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + 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-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-binPROGRAMS + +.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: diff --git a/hawk/t/t-001.c b/hawk/t/t-001.c new file mode 100644 index 00000000..be14d166 --- /dev/null +++ b/hawk/t/t-001.c @@ -0,0 +1,149 @@ +/* test endian conversion macros */ + +#include +#include +#include "t.h" + +int main () +{ + { + union { + hawk_uint16_t u16; + hawk_uint8_t arr[2]; + } x; + + x.arr[0] = 0x11; + x.arr[1] = 0x22; + + printf("x.u16 = 0x%04x\n", x.u16); + printf("htole16(x.u16) = 0x%04x\n", hawk_htole16(x.u16)); + printf("htobe16(x.u16) = 0x%04x\n", hawk_htobe16(x.u16)); + + T_ASSERT1 (x.u16 != hawk_htole16(x.u16) || x.u16 != hawk_htobe16(x.u16), "u16 endian conversion #0"); + T_ASSERT1 (x.u16 == hawk_le16toh(hawk_htole16(x.u16)), "u16 endian conversion #1"); + T_ASSERT1 (x.u16 == hawk_be16toh(hawk_htobe16(x.u16)), "u16 endian conversion #2"); + T_ASSERT1 (x.u16 == hawk_ntoh16(hawk_hton16(x.u16)), "u16 endian conversion #3"); + + #define X_CONST (0x1122) + T_ASSERT1 (X_CONST != HAWK_CONST_HTOLE16(X_CONST) || X_CONST != HAWK_CONST_HTOBE16(X_CONST), "u16 constant endian conversion #0"); + T_ASSERT1 (X_CONST == HAWK_CONST_LE16TOH(HAWK_CONST_HTOLE16(X_CONST)), "u16 constant endian conversion #1"); + T_ASSERT1 (X_CONST == HAWK_CONST_BE16TOH(HAWK_CONST_HTOBE16(X_CONST)), "u16 constant endian conversion #2"); + T_ASSERT1 (X_CONST == HAWK_CONST_NTOH16(HAWK_CONST_HTON16(X_CONST)), "u16 constant endian conversion #3"); + #undef X_CONST + } + + + { + union { + hawk_uint32_t u32; + hawk_uint8_t arr[4]; + } x; + + x.arr[0] = 0x11; + x.arr[1] = 0x22; + x.arr[2] = 0x33; + x.arr[3] = 0x44; + + printf("x.u32 = 0x%08x\n", x.u32); + printf("htole32(x.u32) = 0x%08x\n", hawk_htole32(x.u32)); + printf("htobe32(x.u32) = 0x%08x\n", hawk_htobe32(x.u32)); + + T_ASSERT1 (x.u32 != hawk_htole32(x.u32) || x.u32 != hawk_htobe32(x.u32), "u32 endian conversion #0"); + T_ASSERT1 (x.u32 == hawk_le32toh(hawk_htole32(x.u32)), "u32 endian conversion #1"); + T_ASSERT1 (x.u32 == hawk_be32toh(hawk_htobe32(x.u32)), "u32 endian conversion #2"); + T_ASSERT1 (x.u32 == hawk_ntoh32(hawk_hton32(x.u32)), "u32 endian conversion #3"); + + #define X_CONST (0x11223344) + T_ASSERT1 (X_CONST != HAWK_CONST_HTOLE32(X_CONST) || X_CONST != HAWK_CONST_HTOBE32(X_CONST), "u32 constant endian conversion #0"); + T_ASSERT1 (X_CONST == HAWK_CONST_LE32TOH(HAWK_CONST_HTOLE32(X_CONST)), "u32 constant endian conversion #1"); + T_ASSERT1 (X_CONST == HAWK_CONST_BE32TOH(HAWK_CONST_HTOBE32(X_CONST)), "u32 constant endian conversion #2"); + T_ASSERT1 (X_CONST == HAWK_CONST_NTOH32(HAWK_CONST_HTON32(X_CONST)), "u32 constant endian conversion #3"); + #undef X_CONST + } + +#if defined(HAWK_HAVE_UINT64_T) + { + union { + hawk_uint64_t u64; + hawk_uint8_t arr[8]; + } x; + + x.arr[0] = 0x11; + x.arr[1] = 0x22; + x.arr[2] = 0x33; + x.arr[3] = 0x44; + x.arr[4] = 0x55; + x.arr[5] = 0x66; + x.arr[6] = 0x77; + x.arr[7] = 0x88; + + printf("x.u64 = 0x%016llx\n", (unsigned long long)x.u64); + printf("htole64(x.u64) = 0x%016llx\n", (unsigned long long)hawk_htole64(x.u64)); + printf("htobe64(x.u64) = 0x%016llx\n", (unsigned long long)hawk_htobe64(x.u64)); + + T_ASSERT1 (x.u64 != hawk_htole64(x.u64) || x.u64 != hawk_htobe64(x.u64), "u64 endian conversion #0"); + T_ASSERT1 (x.u64 == hawk_le64toh(hawk_htole64(x.u64)), "u64 endian conversion #1"); + T_ASSERT1 (x.u64 == hawk_be64toh(hawk_htobe64(x.u64)), "u64 endian conversion #2"); + T_ASSERT1 (x.u64 == hawk_ntoh64(hawk_hton64(x.u64)), "u64 endian conversion #3"); + + #define X_CONST (((hawk_uint64_t)0x11223344 << 32) | (hawk_uint64_t)0x55667788) + T_ASSERT1 (X_CONST != HAWK_CONST_HTOLE64(X_CONST) || X_CONST != HAWK_CONST_HTOBE64(X_CONST), "u64 constant endian conversion #0"); + T_ASSERT1 (X_CONST == HAWK_CONST_LE64TOH(HAWK_CONST_HTOLE64(X_CONST)), "u64 constant endian conversion #1"); + T_ASSERT1 (X_CONST == HAWK_CONST_BE64TOH(HAWK_CONST_HTOBE64(X_CONST)), "u64 constant endian conversion #2"); + T_ASSERT1 (X_CONST == HAWK_CONST_NTOH64(HAWK_CONST_HTON64(X_CONST)), "u64 constant endian conversion #3"); + #undef X_CONST + } +#endif + +#if defined(HAWK_HAVE_UINT128_T) + { + union { + hawk_uint128_t u128; + hawk_uint8_t arr[16]; + } x; + hawk_uint128_t tmp; + + x.arr[0] = 0x11; + x.arr[1] = 0x22; + x.arr[2] = 0x33; + x.arr[3] = 0x44; + x.arr[4] = 0x55; + x.arr[5] = 0x66; + x.arr[6] = 0x77; + x.arr[7] = 0x88; + x.arr[8] = 0x99; + x.arr[9] = 0xaa; + x.arr[10] = 0xbb; + x.arr[11] = 0xcc; + x.arr[12] = 0xdd; + x.arr[13] = 0xee; + x.arr[14] = 0xff; + x.arr[15] = 0xfa; + + printf("x.u128 = 0x%016llx%016llx\n", (unsigned long long)(hawk_uint64_t)(x.u128 >> 64), (unsigned long long)(hawk_uint64_t)(x.u128 >> 0)); + + tmp = hawk_htole128(x.u128); + printf("htole128(tmp) = 0x%016llx%016llx\n", (unsigned long long)(hawk_uint64_t)(tmp >> 64), (unsigned long long)(hawk_uint64_t)(tmp >> 0)); + + tmp = hawk_htobe128(x.u128); + printf("htobe128(tmp) = 0x%016llx%016llx\n", (unsigned long long)(hawk_uint64_t)(tmp >> 64), (unsigned long long)(hawk_uint64_t)(tmp >> 0)); + + T_ASSERT1 (x.u128 != hawk_htole128(x.u128) || x.u128 != hawk_htobe128(x.u128), "u128 endian conversion #0"); + T_ASSERT1 (x.u128 == hawk_le128toh(hawk_htole128(x.u128)), "u128 endian conversion #1"); + T_ASSERT1 (x.u128 == hawk_be128toh(hawk_htobe128(x.u128)), "u128 endian conversion #2"); + T_ASSERT1 (x.u128 == hawk_ntoh128(hawk_hton128(x.u128)), "u128 endian conversion #3"); + + #define X_CONST (((hawk_uint128_t)0x11223344 << 96) | ((hawk_uint128_t)0x55667788 << 64) | ((hawk_uint128_t)0x99aabbcc << 32) | ((hawk_uint128_t)0xddeefffa)) + T_ASSERT1 (X_CONST != HAWK_CONST_HTOLE128(X_CONST) || X_CONST != HAWK_CONST_HTOBE128(X_CONST), "u128 constant endian conversion #0"); + T_ASSERT1 (X_CONST == HAWK_CONST_LE128TOH(HAWK_CONST_HTOLE128(X_CONST)), "u128 constant endian conversion #1"); + T_ASSERT1 (X_CONST == HAWK_CONST_BE128TOH(HAWK_CONST_HTOBE128(X_CONST)), "u128 constant endian conversion #2"); + T_ASSERT1 (X_CONST == HAWK_CONST_NTOH128(HAWK_CONST_HTON128(X_CONST)), "u128 constant endian conversion #3"); + #undef X_CONST + } +#endif + + return 0; + +oops: + return -1; +} diff --git a/hawk/t/t-002.c b/hawk/t/t-002.c new file mode 100644 index 00000000..21171507 --- /dev/null +++ b/hawk/t/t-002.c @@ -0,0 +1,35 @@ +/* test bit position functions */ + +#include +#include +#include "t.h" + +int main () +{ + int i, j; + hawk_oow_t v; + + printf ("QSE_OOW_BITS => %d, sizeof(hawk_oow_t)=%d\n", (int)HAWK_OOW_BITS, (int)sizeof(hawk_oow_t)); + for (i = 0; i < HAWK_OOW_BITS; i++) + { + v = ((hawk_oow_t)1 << i); + j = hawk_get_pos_of_msb_set_pow2(v); + printf ("msb(pow2) %d %d ==> %llx\n", i, j, (long long int)v); + T_ASSERT1 (i == j, "msb(pow2) position tester"); + } + + for (i = 0; i < HAWK_OOW_BITS; i++) + { + v = ((hawk_oow_t)1 << i); + v |= 1; + j = hawk_get_pos_of_msb_set(v); + printf ("msb %d %d ==> %llx\n", i, j, (long long int)v); + T_ASSERT1 (i == j, "msb position tester"); + } + + + return 0; + +oops: + return -1; +} diff --git a/hawk/t/t-003.c b/hawk/t/t-003.c new file mode 100644 index 00000000..1b0d5d41 --- /dev/null +++ b/hawk/t/t-003.c @@ -0,0 +1,77 @@ +#include +#include +#include +#include +#include +#include "t.h" + +static int put_bcs (hawk_fmtout_t* fmtout, const hawk_bch_t* c, hawk_oow_t len) +{ + while (len > 0) + { + putchar (*c); + c++; + len--; + } + return 1; +} + +static int put_ucs (hawk_fmtout_t* fmtout, const hawk_uch_t* c, hawk_oow_t len) +{ + hawk_cmgr_t* cmgr = hawk_get_utf8_cmgr(); + hawk_bch_t bcs[HAWK_BCSIZE_MAX]; + hawk_oow_t bcslen, i; + + while (len > 0) + { + bcslen = cmgr->uctobc(*c, bcs, HAWK_COUNTOF(bcs)); + /*putwchar (*c);*/ + for (i = 0; i < bcslen; i++) putchar(bcs[i]); + c++; + len--; + } + return 1; +} + +static hawk_ooi_t bfmt_out (const hawk_bch_t* fmt, ...) +{ + hawk_fmtout_t fmtout; + va_list ap; + int n; + + memset (&fmtout, 0, HAWK_SIZEOF(fmtout)); + fmtout.putbcs = put_bcs; + fmtout.putucs = put_ucs; + + va_start (ap, fmt); + n = hawk_bfmt_outv (&fmtout, fmt, ap); + va_end (ap); + + return (n <= -1)? -1: fmtout.count; +} + +int main () +{ + hawk_uch_t x[] = { 'A', L'\uBB33', L'\uBB34', L'\uBB35', 'Q', '\0' }; + hawk_ooi_t cnt; + + setlocale (LC_ALL, NULL); + cnt = bfmt_out ("[%s %d %020X %ls %s %w %.*lk]\n", "test", 10, 0x1232, x, "code", x, HAWK_SIZEOF_UCH_T * 3, x); + + /* this unit is the number of characters written. but some are written as bch and some other as uch. + * if uch and bch data are mixed, the count returned doesn't really tell how many bytes or characters written */ + bfmt_out ("wrote [%ld] units\n", cnt); +#if (HAWK_SIZEOF_UCH_T == 2) +# define EXPECTED_LEN 98 +#elif (HAWK_SIZEOF_UCH_T == 4) +# define EXPECTED_LEN 122 +#else +# error UNSUPPORTED UCH SIZE +#endif + T_ASSERT1 (cnt == EXPECTED_LEN, "bfmt_out test #1"); + + return 0; + +oops: + return -1; +} diff --git a/hawk/t/t-004.c b/hawk/t/t-004.c new file mode 100644 index 00000000..df6a16c1 --- /dev/null +++ b/hawk/t/t-004.c @@ -0,0 +1,37 @@ +#include +#include +#include +#include "t.h" + +int main () +{ + hawk_t* hawk = HAWK_NULL; + hawk_uch_t ufmt1[] = { '%', '0', '5', 'd', ' ', '%', '-', '9', 'h', 's', '\0' }; + hawk_uch_t ufmt2[] = { '%', '0', '5', 'd', ' ', '%', '-', '9', 'h', 's', ' ', '%','O','\0' }; + + hawk = hawk_openstd(0, HAWK_NULL, HAWK_NULL); + if (!hawk) + { + fprintf (stderr, "Unable to open hawk\n"); + return -1; + } + + hawk_seterrbfmt (hawk, HAWK_EINVAL, "%d %ld %s %hs", 10, 20L, "hawk", "hawk"); + T_ASSERT1 (hawk_comp_oocstr_bcstr(hawk_geterrmsg(hawk), "10 20 hawk hawk") == 0, "hawk seterrbfmt #1"); + hawk_logbfmt (hawk, HAWK_LOG_STDERR, "[%js]\n", hawk_geterrmsg(hawk)); + + hawk_seterrufmt (hawk, HAWK_EINVAL, ufmt1, 9923, "hawk"); + T_ASSERT1 (hawk_comp_oocstr_bcstr(hawk_geterrmsg(hawk), "09923 hawk ") == 0, "hawk seterrufmt #1"); + hawk_logbfmt (hawk, HAWK_LOG_STDERR, "[%js]\n", hawk_geterrmsg(hawk)); + + hawk_seterrufmt (hawk, HAWK_EINVAL, ufmt2, 9923, "hawk", HAWK_SMPTR_TO_OOP(0x12345678)); + T_ASSERT1 (hawk_comp_oocstr_bcstr(hawk_geterrmsg(hawk), "09923 hawk #\\p12345678") == 0, "hawk seterrufmt #1"); + hawk_logbfmt (hawk, HAWK_LOG_STDERR, "[%js]\n", hawk_geterrmsg(hawk)); + + hawk_close (hawk); + return 0; + +oops: + if (hawk) hawk_close (hawk); + return -1; +} diff --git a/hawk/t/t-005.c b/hawk/t/t-005.c new file mode 100644 index 00000000..0c2c0f05 --- /dev/null +++ b/hawk/t/t-005.c @@ -0,0 +1,83 @@ +#include +#include +#include +#include +#include +#include "t.h" + +static void* sys_alloc (hawk_mmgr_t* mmgr, hawk_oow_t size) +{ + return malloc(size); +} + +static void* sys_realloc (hawk_mmgr_t* mmgr, void* ptr, hawk_oow_t size) +{ + return realloc(ptr, size); +} + +static void sys_free (hawk_mmgr_t* mmgr, void* ptr) +{ + free (ptr); +} + +static hawk_mmgr_t sys_mmgr = +{ + sys_alloc, + sys_realloc, + sys_free, + HAWK_NULL +}; + +static int test1 (void) +{ + hawk_becs_t* b; + hawk_alt_t hawk_dummy; + hawk_t* t = (hawk_t*)&hawk_dummy; + hawk_dummy._mmgr = &sys_mmgr; + + + b = hawk_becs_open (t, 0, 5); + hawk_becs_cat (b, "hello"); + T_ASSERT0 (hawk_becs_getlen(b) == 5); + + hawk_becs_cat (b, "hello again"); + T_ASSERT0 (hawk_becs_getlen(b) == 16); + + hawk_becs_del (b, 11, 3); + T_ASSERT0 (hawk_becs_getlen(b) == 13); + T_ASSERT0 (HAWK_BECS_CHAR(b, 12) == 'n'); + T_ASSERT0 (HAWK_BECS_CHAR(b, 13) == '\0'); + + printf ("[%s]\n", HAWK_BECS_PTR(b)); + return 0; + +oops: + return -1; +} + +static int test2 (void) +{ + hawk_uch_t src[8] = {'a','b','c','d','e','f','g','h'}; + hawk_uch_t dst[6] = {'0','1','2','3','4','5'}; + hawk_oow_t q, i; + + q = hawk_copy_uchars_to_ucstr (dst, HAWK_COUNTOF(dst), src, 7); + T_ASSERT0 (q == HAWK_COUNTOF(buf) - 1); + T_ASSERT0 (dst[HAWK_COUNTOF(dst) - 1] == '\0'); + for (i = 0; i < q; i++) T_ASSERT0 (dst[i] == src[i]); + + return 0; + +oops: + return -1; +} + +int main () +{ + if (test1() <= -1) goto oops; + if (test2() <= -1) goto oops; + return 0; + +oops: + return -1; +} diff --git a/hawk/t/t.h b/hawk/t/t.h new file mode 100644 index 00000000..2c0ca500 --- /dev/null +++ b/hawk/t/t.h @@ -0,0 +1,21 @@ +#ifndef _HAWK_T_T_H_ +#define _HAWK_T_T_H_ + +#include + +#if defined(__STDC_VERSION__) && (__STDC_VERSION__>=199901L) +# define T_ASSERT_FAIL0() printf("FAILURE in %s:%s[%d]\n", __FILE__, __func__, (int)__LINE__) +# define T_ASSERT_FAIL1(msg1) printf("FAILURE in %s:%s[%d] - %s\n", __FILE__, __func__, (int)__LINE__, msg1) +# define T_ASSERT_FAIL2(msg1,msg2) printf("FAILURE in %s:%s[%d] - %s - %s\n", __FILE__, __func__, (int)__LINE__, msg1, msg2) +#else +# define T_ASSERT_FAIL1() printf("FAILURE in %s[%d]\n", __FILE__, (int)__LINE__) +# define T_ASSERT_FAIL1(msg1) printf("FAILURE in %s[%d] - %s\n", __FILE__, (int)__LINE__, msg1) +# define T_ASSERT_FAIL2(msg1,msg2) printf("FAILURE in %s[%d] - %s - %s\n", __FILE__, (int)__LINE__, msg1, msg2) +#endif + +#define T_ASSERT0(test) do { if (!(test)) { T_ASSERT_FAIL0(); goto oops; } } while(0) +#define T_ASSERT1(test,msg1) do { if (!(test)) { T_ASSERT_FAIL1(msg1); goto oops; } } while(0) +#define T_ASSERT2(test,msg1,msg2) do { if (!(test)) { T_ASSERT_FAIL2(msg1,msg2); goto oops; } } while(0) + + +#endif diff --git a/hawk/tools/Makefile.am b/hawk/tools/Makefile.am new file mode 100644 index 00000000..81089d2d --- /dev/null +++ b/hawk/tools/Makefile.am @@ -0,0 +1,28 @@ +AUTOMAKE_OPTIONS = nostdinc + +CPPFLAGS_ALL_COMMON = \ + -I$(abs_builddir) \ + -I$(abs_builddir)/../lib \ + -I$(abs_srcdir) \ + -I$(abs_srcdir)/../lib \ + -I$(includedir) + +LDFLAGS_ALL_COMMON = -L$(abs_builddir) -L$(abs_builddir)/../lib -L$(libdir) + +CPPFLAGS_BIN_COMMON = $(CPPFLAGS_ALL_COMMON) +LDFLAGS_BIN_COMMON = $(LDFLAGS_ALL_COMMON) -version-info 1:0:0 -no-undefined +LIBADD_BIN_COMMON = $(LIBM) + +bin_PROGRAMS = uni-case uni-prop + +uni_case_SOURCES = uni-case.c +uni_case_CPPFLAGS = $(CPPFLAGS_ALL_COMMON) +uni_case_LDFLAGS = $(LDFLAGS_ALL_COMMON) +uni_case_LDADD = $(LIBADD_BIN_COMMON) +uni_case_DEPENDENCIES = + +uni_prop_SOURCES = uni-prop.c +uni_prop_CPPFLAGS = $(CPPFLAGS_ALL_COMMON) +uni_prop_LDFLAGS = $(LDFLAGS_ALL_COMMON) +uni_prop_LDADD = $(LIBADD_BIN_COMMON) +uni_prop_DEPENDENCIES = diff --git a/hawk/tools/Makefile.in b/hawk/tools/Makefile.in new file mode 100644 index 00000000..1530f522 --- /dev/null +++ b/hawk/tools/Makefile.in @@ -0,0 +1,743 @@ +# Makefile.in generated by automake 1.16.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2018 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@ +bin_PROGRAMS = uni-case$(EXEEXT) uni-prop$(EXEEXT) +subdir = tools +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ + $(top_srcdir)/m4/ax_cxx_namespace.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)/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)/lib/hawk-cfg.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_uni_case_OBJECTS = uni_case-uni-case.$(OBJEXT) +uni_case_OBJECTS = $(am_uni_case_OBJECTS) +am__DEPENDENCIES_1 = +am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +uni_case_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(uni_case_LDFLAGS) $(LDFLAGS) -o $@ +am_uni_prop_OBJECTS = uni_prop-uni-prop.$(OBJEXT) +uni_prop_OBJECTS = $(am_uni_prop_OBJECTS) +uni_prop_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(uni_prop_LDFLAGS) $(LDFLAGS) -o $@ +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 = +DEFAULT_INCLUDES = +depcomp = $(SHELL) $(top_srcdir)/ac/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/uni_case-uni-case.Po \ + ./$(DEPDIR)/uni_prop-uni-prop.Po +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(uni_case_SOURCES) $(uni_prop_SOURCES) +DIST_SOURCES = $(uni_case_SOURCES) $(uni_prop_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) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/ac/depcomp +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@ +DYNCALL_LIBS = @DYNCALL_LIBS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FFI_LIBS = @FFI_LIBS@ +FGREP = @FGREP@ +GREP = @GREP@ +HAVE_CXX = @HAVE_CXX@ +HAWK_PROJECT_AUTHOR = @HAWK_PROJECT_AUTHOR@ +HAWK_PROJECT_URL = @HAWK_PROJECT_URL@ +HAWK_SIZEOF_CHAR = @HAWK_SIZEOF_CHAR@ +HAWK_SIZEOF_DOUBLE = @HAWK_SIZEOF_DOUBLE@ +HAWK_SIZEOF_FLOAT = @HAWK_SIZEOF_FLOAT@ +HAWK_SIZEOF_INT = @HAWK_SIZEOF_INT@ +HAWK_SIZEOF_LONG = @HAWK_SIZEOF_LONG@ +HAWK_SIZEOF_LONG_DOUBLE = @HAWK_SIZEOF_LONG_DOUBLE@ +HAWK_SIZEOF_LONG_LONG = @HAWK_SIZEOF_LONG_LONG@ +HAWK_SIZEOF_OFF64_T = @HAWK_SIZEOF_OFF64_T@ +HAWK_SIZEOF_OFF_T = @HAWK_SIZEOF_OFF_T@ +HAWK_SIZEOF_SHORT = @HAWK_SIZEOF_SHORT@ +HAWK_SIZEOF_VOID_P = @HAWK_SIZEOF_VOID_P@ +HAWK_SIZEOF_WCHAR_T = @HAWK_SIZEOF_WCHAR_T@ +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@ +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@ +QUADMATH_LIBS = @QUADMATH_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SOCKET_LIBS = @SOCKET_LIBS@ +STRIP = @STRIP@ +UNICOWS_LIBS = @UNICOWS_LIBS@ +UNWIND_LIBS = @UNWIND_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@ +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 = nostdinc +CPPFLAGS_ALL_COMMON = \ + -I$(abs_builddir) \ + -I$(abs_builddir)/../lib \ + -I$(abs_srcdir) \ + -I$(abs_srcdir)/../lib \ + -I$(includedir) + +LDFLAGS_ALL_COMMON = -L$(abs_builddir) -L$(abs_builddir)/../lib -L$(libdir) +CPPFLAGS_BIN_COMMON = $(CPPFLAGS_ALL_COMMON) +LDFLAGS_BIN_COMMON = $(LDFLAGS_ALL_COMMON) -version-info 1:0:0 -no-undefined +LIBADD_BIN_COMMON = $(LIBM) +uni_case_SOURCES = uni-case.c +uni_case_CPPFLAGS = $(CPPFLAGS_ALL_COMMON) +uni_case_LDFLAGS = $(LDFLAGS_ALL_COMMON) +uni_case_LDADD = $(LIBADD_BIN_COMMON) +uni_case_DEPENDENCIES = +uni_prop_SOURCES = uni-prop.c +uni_prop_CPPFLAGS = $(CPPFLAGS_ALL_COMMON) +uni_prop_LDFLAGS = $(LDFLAGS_ALL_COMMON) +uni_prop_LDADD = $(LIBADD_BIN_COMMON) +uni_prop_DEPENDENCIES = +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(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): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +uni-case$(EXEEXT): $(uni_case_OBJECTS) $(uni_case_DEPENDENCIES) $(EXTRA_uni_case_DEPENDENCIES) + @rm -f uni-case$(EXEEXT) + $(AM_V_CCLD)$(uni_case_LINK) $(uni_case_OBJECTS) $(uni_case_LDADD) $(LIBS) + +uni-prop$(EXEEXT): $(uni_prop_OBJECTS) $(uni_prop_DEPENDENCIES) $(EXTRA_uni_prop_DEPENDENCIES) + @rm -f uni-prop$(EXEEXT) + $(AM_V_CCLD)$(uni_prop_LINK) $(uni_prop_OBJECTS) $(uni_prop_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uni_case-uni-case.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uni_prop-uni-prop.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +uni_case-uni-case.o: uni-case.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uni_case_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT uni_case-uni-case.o -MD -MP -MF $(DEPDIR)/uni_case-uni-case.Tpo -c -o uni_case-uni-case.o `test -f 'uni-case.c' || echo '$(srcdir)/'`uni-case.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uni_case-uni-case.Tpo $(DEPDIR)/uni_case-uni-case.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uni-case.c' object='uni_case-uni-case.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uni_case_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o uni_case-uni-case.o `test -f 'uni-case.c' || echo '$(srcdir)/'`uni-case.c + +uni_case-uni-case.obj: uni-case.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uni_case_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT uni_case-uni-case.obj -MD -MP -MF $(DEPDIR)/uni_case-uni-case.Tpo -c -o uni_case-uni-case.obj `if test -f 'uni-case.c'; then $(CYGPATH_W) 'uni-case.c'; else $(CYGPATH_W) '$(srcdir)/uni-case.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uni_case-uni-case.Tpo $(DEPDIR)/uni_case-uni-case.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uni-case.c' object='uni_case-uni-case.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uni_case_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o uni_case-uni-case.obj `if test -f 'uni-case.c'; then $(CYGPATH_W) 'uni-case.c'; else $(CYGPATH_W) '$(srcdir)/uni-case.c'; fi` + +uni_prop-uni-prop.o: uni-prop.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uni_prop_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT uni_prop-uni-prop.o -MD -MP -MF $(DEPDIR)/uni_prop-uni-prop.Tpo -c -o uni_prop-uni-prop.o `test -f 'uni-prop.c' || echo '$(srcdir)/'`uni-prop.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uni_prop-uni-prop.Tpo $(DEPDIR)/uni_prop-uni-prop.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uni-prop.c' object='uni_prop-uni-prop.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uni_prop_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o uni_prop-uni-prop.o `test -f 'uni-prop.c' || echo '$(srcdir)/'`uni-prop.c + +uni_prop-uni-prop.obj: uni-prop.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uni_prop_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT uni_prop-uni-prop.obj -MD -MP -MF $(DEPDIR)/uni_prop-uni-prop.Tpo -c -o uni_prop-uni-prop.obj `if test -f 'uni-prop.c'; then $(CYGPATH_W) 'uni-prop.c'; else $(CYGPATH_W) '$(srcdir)/uni-prop.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/uni_prop-uni-prop.Tpo $(DEPDIR)/uni_prop-uni-prop.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uni-prop.c' object='uni_prop-uni-prop.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uni_prop_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o uni_prop-uni-prop.obj `if test -f 'uni-prop.c'; then $(CYGPATH_W) 'uni-prop.c'; else $(CYGPATH_W) '$(srcdir)/uni-prop.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +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 $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +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-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/uni_case-uni-case.Po + -rm -f ./$(DEPDIR)/uni_prop-uni-prop.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +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-binPROGRAMS + +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 ./$(DEPDIR)/uni_case-uni-case.Po + -rm -f ./$(DEPDIR)/uni_prop-uni-prop.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + 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-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-binPROGRAMS + +.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: diff --git a/hawk/tools/uni-case.c b/hawk/tools/uni-case.c new file mode 100644 index 00000000..a24f061e --- /dev/null +++ b/hawk/tools/uni-case.c @@ -0,0 +1,175 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if HAWK_SIZEOF_WCHAR_T == HAWK_SIZEOF_INT16_T + #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 (hawk_uci_t start, hawk_uci_t end) +{ + hawk_uci_t code, c; + 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; + + printf ("static uch_case_page_t uch_case_page_%04X[%u] =\n{\n", + (unsigned int)page->no, (unsigned int)CASE_PAGE_SIZE); + + for (i = 0; i < CASE_PAGE_SIZE; i++) + { + upper = page->upper[i]; + lower = page->lower[i]; + + if (i != 0) printf (",\n"); + printf ("\t"); + + #if 0 + 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); + } + #endif + + printf ("{%ld, %ld}", (long int)upper, (long int)lower); + } + + printf ("\n};\n"); +} + +void emit_case_map () +{ + size_t i; + + + printf ("static uch_case_page_t* uch_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%lX-0x%lX */ ", + (unsigned long int)(i * CASE_PAGE_SIZE), + (unsigned long int)((i + 1) * CASE_PAGE_SIZE - 1)); + printf ("uch_case_page_%04X", (int)case_maps[i]->no); + } + + printf ("\n};\n"); +} + +static void emit_case_macros (void) +{ + printf ("/* generated by tools/uni-case.c */\n\n"); + printf ("#define UCH_CASE_MAX 0x%lX\n\n", (unsigned long)MAX_CHAR); + printf ("typedef struct uch_case_page_t uch_case_page_t;\n\n"); + printf ("struct uch_case_page_t {\n"); + + printf (" hawk_int32_t upper;\n"); + printf (" hawk_int32_t lower;\n"); + printf ("};\n\n"); + printf ("\n"); +} + +int main () +{ + hawk_uci_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; +} + diff --git a/hawk/tools/uni-prop.c b/hawk/tools/uni-prop.c new file mode 100644 index 00000000..1e178925 --- /dev/null +++ b/hawk/tools/uni-prop.c @@ -0,0 +1,282 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#if HAWK_SIZEOF_UCH_T == HAWK_SIZEOF_INT16_T + #define MAX_CHAR 0xFFFF +#else + /*#define MAX_CHAR 0xE01EF*/ + #define MAX_CHAR 0x10FFFF +#endif + +#define UCH_PROP_PAGE_SIZE 256 +#define MAX_UCH_PROP_PAGE_COUNT ((MAX_CHAR + UCH_PROP_PAGE_SIZE) / UCH_PROP_PAGE_SIZE) + +typedef struct prop_page_t prop_page_t; +struct prop_page_t +{ + size_t no; + hawk_uint16_t props[UCH_PROP_PAGE_SIZE]; + prop_page_t* next; +}; + +size_t prop_page_count = 0; +prop_page_t* prop_pages = NULL; + +size_t prop_map_count = 0; +prop_page_t* prop_maps[MAX_UCH_PROP_PAGE_COUNT]; + +enum +{ + UCH_PROP_UPPER = (1 << 0), + UCH_PROP_LOWER = (1 << 1), + UCH_PROP_ALPHA = (1 << 2), + UCH_PROP_DIGIT = (1 << 3), + UCH_PROP_XDIGIT = (1 << 4), + UCH_PROP_ALNUM = (1 << 5), + UCH_PROP_SPACE = (1 << 6), + UCH_PROP_PRINT = (1 << 8), + UCH_PROP_GRAPH = (1 << 9), + UCH_PROP_CNTRL = (1 << 10), + UCH_PROP_PUNCT = (1 << 11), + UCH_PROP_BLANK = (1 << 12) +}; + +int get_prop (hawk_uci_t code) +{ + int prop = 0; + + if (iswupper(code)) prop |= UCH_PROP_UPPER; + if (iswlower(code)) prop |= UCH_PROP_LOWER; + if (iswalpha(code)) prop |= UCH_PROP_ALPHA; + if (iswdigit(code)) prop |= UCH_PROP_DIGIT; + if (iswxdigit(code)) prop |= UCH_PROP_XDIGIT; + if (iswalnum(code)) prop |= UCH_PROP_ALNUM; + if (iswspace(code)) prop |= UCH_PROP_SPACE; + if (iswprint(code)) prop |= UCH_PROP_PRINT; + if (iswgraph(code)) prop |= UCH_PROP_GRAPH; + if (iswcntrl(code)) prop |= UCH_PROP_CNTRL; + if (iswpunct(code)) prop |= UCH_PROP_PUNCT; + if (iswblank(code)) prop |= UCH_PROP_BLANK; + /* + if (iswascii(code)) prop |= UCH_PROP_ASCII; + if (isphonogram(code)) prop |= UCH_PROP_PHONO; + if (isideogram(code)) prop |= UCH_PROP_IDEOG; + if (isenglish(code)) prop |= UCH_PROP_ENGLI; + */ + + return prop; +} + +void make_prop_page (hawk_uci_t start, hawk_uci_t end) +{ + hawk_uci_t code; + hawk_uint16_t props[UCH_PROP_PAGE_SIZE]; + prop_page_t* page; + + memset (props, 0, sizeof(props)); + for (code = start; code <= end; code++) { + props[code - start] = get_prop(code); + } + + for (page = prop_pages; page != NULL; page = page->next) { + if (memcmp (props, page->props, sizeof(props)) == 0) { + prop_maps[prop_map_count++] = page; + return; + } + } + + page = (prop_page_t*)malloc (sizeof(prop_page_t)); + page->no = prop_page_count++; + memcpy (page->props, props, sizeof(props)); + page->next = prop_pages; + + prop_pages = page; + prop_maps[prop_map_count++] = page; +} + +void emit_prop_page (prop_page_t* page) +{ + size_t i; + int prop, need_or; + + printf ("static hawk_uint16_t uch_prop_page_%04X[%u] =\n{\n", + (unsigned int)page->no, (unsigned int)UCH_PROP_PAGE_SIZE); + + for (i = 0; i < UCH_PROP_PAGE_SIZE; i++) { + + need_or = 0; + prop = page->props[i]; + + if (i != 0) printf (",\n"); + printf ("\t"); + + if (prop == 0) { + printf ("0"); + continue; + } + + if (prop & UCH_PROP_UPPER) { + if (need_or) printf (" | "); + printf ("HAWK_UCH_PROP_UPPER"); + need_or = 1; + } + + if (prop & UCH_PROP_LOWER) { + if (need_or) printf (" | "); + printf ("HAWK_UCH_PROP_LOWER"); + need_or = 1; + } + + if (prop & UCH_PROP_ALPHA) { + if (need_or) printf (" | "); + printf ("HAWK_UCH_PROP_ALPHA"); + need_or = 1; + } + + if (prop & UCH_PROP_DIGIT) { + if (need_or) printf (" | "); + printf ("HAWK_UCH_PROP_DIGIT"); + need_or = 1; + } + + if (prop & UCH_PROP_XDIGIT) { + if (need_or) printf (" | "); + printf ("HAWK_UCH_PROP_XDIGIT"); + need_or = 1; + } + + if (prop & UCH_PROP_ALNUM) { + if (need_or) printf (" | "); + printf ("HAWK_UCH_PROP_ALNUM"); + need_or = 1; + } + + if (prop & UCH_PROP_SPACE) { + if (need_or) printf (" | "); + printf ("HAWK_UCH_PROP_SPACE"); + need_or = 1; + } + + if (prop & UCH_PROP_PRINT) { + if (need_or) printf (" | "); + printf ("HAWK_UCH_PROP_PRINT"); + need_or = 1; + } + + if (prop & UCH_PROP_GRAPH) { + if (need_or) printf (" | "); + printf ("HAWK_UCH_PROP_GRAPH"); + need_or = 1; + } + + if (prop & UCH_PROP_CNTRL) { + if (need_or) printf (" | "); + printf ("HAWK_UCH_PROP_CNTRL"); + need_or = 1; + } + + if (prop & UCH_PROP_PUNCT) { + if (need_or) printf (" | "); + printf ("HAWK_UCH_PROP_PUNCT"); + need_or = 1; + } + + if (prop & UCH_PROP_BLANK) { + if (need_or) printf (" | "); + printf ("HAWK_UCH_PROP_BLANK"); + need_or = 1; + } + + + /* + if (prop & UCH_PROP_ASCII) { + if (need_or) printf (" | "); + printf ("HAWK_UCH_PROP_ASCII"); + need_or = 1; + } + + if (prop & UCH_PROP_IDEOG) { + if (need_or) printf (" | "); + printf ("HAWK_UCH_PROP_IDEOG"); + need_or = 1; + } + + if (prop & UCH_PROP_PHONO) { + if (need_or) printf (" | "); + printf ("HAWK_UCH_PROP_PHONO"); + need_or = 1; + } + + if (prop & UCH_PROP_ENGLI) { + if (need_or) printf (" | "); + printf ("HAWK_UCH_PROP_ENGLI"); + need_or = 1; + } + */ + + } + + printf ("\n};\n"); +} + +void emit_prop_map () +{ + size_t i; + + printf ("static hawk_uint16_t* uch_prop_map[%u] =\n{\n", (unsigned int)prop_map_count); + + for (i = 0; i < prop_map_count; i++) { + if (i != 0) printf (",\n"); + printf ("\t /* 0x%lX-0x%lX */ ", + (unsigned long int)(i * UCH_PROP_PAGE_SIZE), + (unsigned long int)((i + 1) * UCH_PROP_PAGE_SIZE - 1)); + printf ("uch_prop_page_%04X", (int)prop_maps[i]->no); + } + + printf ("\n};\n"); +} + +static void emit_prop_macros (void) +{ + printf ("/* generated by tools/uni-prop.c */\n\n"); + printf ("#define UCH_PROP_MAX 0x%lX\n", (unsigned long)MAX_CHAR); + printf ("\n"); +} + +int main () +{ + hawk_uci_t code; + prop_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 += UCH_PROP_PAGE_SIZE) { + make_prop_page (code, code + UCH_PROP_PAGE_SIZE - 1); + } + + emit_prop_macros (); + + for (page = prop_pages; page != NULL; page = page->next) { + emit_prop_page (page); + printf ("\n"); + } + + emit_prop_map (); + + return 0; +} +