ongoing code refactoring

This commit is contained in:
hyung-hwan 2019-12-14 06:11:30 +00:00
parent 62211e8934
commit cd5dfcd504
35 changed files with 3150 additions and 3397 deletions

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -141,7 +141,7 @@ am__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
cscope distdir 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
@ -166,8 +166,8 @@ 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/depcomp \
ac/install-sh ac/ltmain.sh ac/missing
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)
@ -355,6 +355,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@ -392,8 +393,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/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);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -520,10 +521,7 @@ 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)
distdir: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@ -588,7 +586,7 @@ distdir-am: $(DISTFILES)
! -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
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
@ -614,7 +612,7 @@ 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
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
@ -632,7 +630,7 @@ dist dist-all:
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
@ -642,7 +640,7 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac

View File

@ -4,7 +4,7 @@
me=ar-lib
scriptversion=2012-03-01.08; # UTC
# Copyright (C) 2010-2018 Free Software Foundation, Inc.
# Copyright (C) 2010-2014 Free Software Foundation, Inc.
# Written by Peter Rosin <peda@lysator.liu.se>.
#
# This program is free software; you can redistribute it and/or modify
@ -18,7 +18,7 @@ scriptversion=2012-03-01.08; # UTC
# 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 <https://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a

View File

@ -1,9 +1,9 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2018-03-07.03; # UTC
scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
@ -17,7 +17,7 @@ scriptversion=2018-03-07.03; # UTC
# 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 <https://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@ -255,8 +255,7 @@ EOF
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
@ -340,9 +339,9 @@ exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

666
hawk/ac/config.guess vendored

File diff suppressed because it is too large Load Diff

2711
hawk/ac/config.sub vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,9 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2018-03-07.03; # UTC
scriptversion=2013-05-30.07; # UTC
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
# Copyright (C) 1999-2014 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
@ -16,7 +16,7 @@ scriptversion=2018-03-07.03; # UTC
# 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 <https://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@ -783,9 +783,9 @@ exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

View File

@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2018-03-11.20; # UTC
scriptversion=2014-09-12.12; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@ -271,18 +271,15 @@ do
fi
dst=$dst_arg
# If destination is a directory, append the input filename.
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
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
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
dstdir=`dirname "$dst"`
@ -291,11 +288,6 @@ do
fi
fi
case $dstdir in
*/) dstdirslash=$dstdir;;
*) dstdirslash=$dstdir/;;
esac
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
@ -332,16 +324,14 @@ do
# 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.
# $RANDOM is not portable (e.g. dash); use it when possible 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.
# As "mkdir -p" follows symlinks and we work in /tmp possibly; so
# create the $tmpdir first (and fail if unsuccessful) to make sure
# that nobody tries to guess the $tmpdir name.
if (umask $mkdir_umask &&
$mkdirprog $mkdir_mode "$tmpdir" &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
@ -444,8 +434,8 @@ do
else
# Make a couple of temp file names in the proper directory.
dsttmp=${dstdirslash}_inst.$$_
rmtmp=${dstdirslash}_rm.$$_
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
@ -510,9 +500,9 @@ do
done
# Local variables:
# eval: (add-hook 'before-save-hook 'time-stamp)
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

View File

@ -31,7 +31,7 @@
PROGRAM=libtool
PACKAGE=libtool
VERSION=2.4.6
VERSION="2.4.6 Debian-2.4.6-2"
package_revision=2.4.6
@ -2068,12 +2068,12 @@ include the following information:
compiler: $LTCC
compiler flags: $LTCFLAGS
linker: $LD (gnu? $with_gnu_ld)
version: $progname (GNU libtool) 2.4.6
version: $progname $scriptversion Debian-2.4.6-2
automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
Report bugs to <bug-libtool@gnu.org>.
GNU libtool home page: <http://www.gnu.org/software/libtool/>.
GNU libtool home page: <http://www.gnu.org/s/libtool/>.
General help using GNU software: <http://www.gnu.org/gethelp/>."
exit 0
}
@ -2124,7 +2124,7 @@ fi
# a configuration failure hint, and exit.
func_fatal_configuration ()
{
func_fatal_error ${1+"$@"} \
func__fatal_error ${1+"$@"} \
"See the $PACKAGE documentation for more information." \
"Fatal configuration error."
}
@ -7274,10 +7274,11 @@ func_mode_link ()
# -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
# -specs=* GCC specs files
# -stdlib=* select c++ std lib with clang
# -fsanitize=* Clang/GCC memory and address sanitizer
-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=*)
-specs=*|-fsanitize=*)
func_quote_for_eval "$arg"
arg=$func_quote_for_eval_result
func_append compile_command " $arg"
@ -7570,7 +7571,10 @@ func_mode_link ()
case $pass in
dlopen) libs=$dlfiles ;;
dlpreopen) libs=$dlprefiles ;;
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
link)
libs="$deplibs %DEPLIBS%"
test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
;;
esac
fi
if test lib,dlpreopen = "$linkmode,$pass"; then
@ -7889,19 +7893,19 @@ func_mode_link ()
# 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"
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
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
@ -8825,6 +8829,9 @@ func_mode_link ()
revision=$number_minor
lt_irix_increment=no
;;
*)
func_fatal_configuration "$modename: unknown library version type '$version_type'"
;;
esac
;;
no)

View File

@ -1,9 +1,9 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
scriptversion=2018-03-07.03; # UTC
scriptversion=2013-10-28.13; # UTC
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
@ -17,7 +17,7 @@ scriptversion=2018-03-07.03; # UTC
# 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 <https://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@ -101,9 +101,9 @@ else
exit $st
fi
perl_URL=https://www.perl.org/
flex_URL=https://github.com/westes/flex
gnu_software_URL=https://www.gnu.org/software
perl_URL=http://www.perl.org/
flex_URL=http://flex.sourceforge.net/
gnu_software_URL=http://www.gnu.org/software
program_details ()
{
@ -207,9 +207,9 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \
exit $st
# Local variables:
# eval: (add-hook 'before-save-hook 'time-stamp)
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

191
hawk/aclocal.m4 vendored
View File

@ -1,6 +1,6 @@
# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
# generated automatically by aclocal 1.15 -*- Autoconf -*-
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -20,7 +20,7 @@ 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.
# Copyright (C) 2002-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
# 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'
[am__api_version='1.15'
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], [],
m4_if([$1], [1.15], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@ -51,12 +51,12 @@ m4_define([_AM_AUTOCONF_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
[AM_AUTOMAKE_VERSION([1.15])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.
# Copyright (C) 2011-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -118,7 +118,7 @@ AC_SUBST([AR])dnl
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001-2018 Free Software Foundation, Inc.
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -170,7 +170,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2018 Free Software Foundation, Inc.
# Copyright (C) 1997-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -201,7 +201,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -392,12 +392,13 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
# Copyright (C) 1999-2014 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],
@ -405,41 +406,49 @@ 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])
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
for 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
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named 'Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: 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=$?
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running 'make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "$am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
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
@ -448,17 +457,18 @@ AC_DEFUN([_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.
# This code is only required when automatic dependency tracking
# is enabled. FIXME. This creates each '.P' file that we will
# 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}"])])
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -545,8 +555,8 @@ 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:
# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
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.
@ -613,7 +623,7 @@ 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: <https://www.gnu.org/software/coreutils/>.
that behaves properly: <http://www.gnu.org/software/coreutils/>.
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@ -655,7 +665,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001-2018 Free Software Foundation, Inc.
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -676,7 +686,7 @@ if test x"${install_sh+set}" != xset; then
fi
AC_SUBST([install_sh])])
# Copyright (C) 2003-2018 Free Software Foundation, Inc.
# Copyright (C) 2003-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -697,7 +707,7 @@ AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001-2018 Free Software Foundation, Inc.
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -705,42 +715,49 @@ AC_SUBST([am__leading_dot])])
# AM_MAKE_INCLUDE()
# -----------------
# Check whether make has an 'include' directive that can support all
# the idioms we need for our automatic dependency tracking code.
# Check to see how make treats includes.
AC_DEFUN([AM_MAKE_INCLUDE],
[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
cat > confinc.mk << 'END'
[am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
@echo this is the am__doit target >confinc.out
@echo this is the am__doit target
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
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])])
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# Ignore all kinds of additional output from 'make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
am__quote=
_am_result=GNU
;;
esac
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=.include
am__quote="\""
_am_result=BSD
;;
esac
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997-2018 Free Software Foundation, Inc.
# Copyright (C) 1997-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -779,7 +796,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001-2018 Free Software Foundation, Inc.
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -808,7 +825,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -855,7 +872,7 @@ 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.
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -874,7 +891,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -955,7 +972,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
# Copyright (C) 2009-2018 Free Software Foundation, Inc.
# Copyright (C) 2009-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -1015,7 +1032,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
# Copyright (C) 2001-2018 Free Software Foundation, Inc.
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -1043,7 +1060,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006-2018 Free Software Foundation, Inc.
# Copyright (C) 2006-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -1062,7 +1079,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004-2018 Free Software Foundation, Inc.
# Copyright (C) 2004-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -131,8 +131,7 @@ 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__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@ -325,6 +324,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@ -375,8 +375,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*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);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -447,13 +447,7 @@ mostlyclean-compile:
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)
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hawk-main.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@ -551,10 +545,7 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@ -626,7 +617,7 @@ clean: clean-am
clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f ./$(DEPDIR)/hawk-main.Po
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@ -672,7 +663,7 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f ./$(DEPDIR)/hawk-main.Po
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@ -693,7 +684,7 @@ uninstall-am: uninstall-binPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
.PHONY: CTAGS GTAGS TAGS all all-am 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 \

265
hawk/configure vendored
View File

@ -731,6 +731,7 @@ am__nodep
AMDEPBACKSLASH
AMDEP_FALSE
AMDEP_TRUE
am__quote
am__include
DEPDIR
OBJEXT
@ -788,6 +789,7 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
@ -806,8 +808,7 @@ PACKAGE_VERSION
PACKAGE_TARNAME
PACKAGE_NAME
PATH_SEPARATOR
SHELL
am__quote'
SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
@ -888,6 +889,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@ -1140,6 +1142,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@ -1277,7 +1288,7 @@ fi
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
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@ -1430,6 +1441,7 @@ Fine tuning of the installation directories:
--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]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@ -2713,7 +2725,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
am__api_version='1.16'
am__api_version='1.15'
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@ -3229,8 +3241,8 @@ 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:
# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)'
# We need awk for the "check" target (and possibly the TAP driver). The
@ -3281,7 +3293,7 @@ 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: <https://www.gnu.org/software/coreutils/>.
that behaves properly: <http://www.gnu.org/software/coreutils/>.
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@ -3296,45 +3308,45 @@ 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_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
@echo this is the am__doit target >confinc.out
@echo this is the am__doit target
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
$as_echo_n "checking for style of include used by $am_make... " >&6; }
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 ;; #(
*) :
;;
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# Ignore all kinds of additional output from 'make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
am__quote=
_am_result=GNU
;;
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; }
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=.include
am__quote="\""
_am_result=BSD
;;
esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
$as_echo "$_am_result" >&6; }
rm -f confinc confmf
# Check whether --enable-dependency-tracking was given.
if test "${enable_dependency_tracking+set}" = set; then :
@ -7125,7 +7137,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;
netbsd*)
netbsd* | netbsdelf*-gnu)
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
@ -10827,6 +10839,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
openbsd* | bitrig*)
with_gnu_ld=no
;;
linux* | k*bsd*-gnu | gnu*)
link_all_deplibs=no
;;
esac
ld_shlibs=yes
@ -11081,7 +11096,7 @@ _LT_EOF
fi
;;
netbsd*)
netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
@ -11751,6 +11766,7 @@ $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
link_all_deplibs=no
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'
@ -11772,7 +11788,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
esac
;;
netbsd*)
netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
@ -12867,9 +12883,6 @@ fi
# 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
@ -12878,7 +12891,7 @@ fi
# 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"
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
@ -12890,6 +12903,18 @@ fi
dynamic_linker='GNU/Linux ld.so'
;;
netbsdelf*-gnu)
version_type=linux
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='NetBSD ld.elf_so'
;;
netbsd*)
version_type=sunos
need_lib_prefix=no
@ -15784,7 +15809,7 @@ lt_prog_compiler_static_CXX=
;;
esac
;;
netbsd*)
netbsd* | netbsdelf*-gnu)
;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
@ -16159,6 +16184,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
;;
esac
;;
linux* | k*bsd*-gnu | gnu*)
link_all_deplibs_CXX=no
;;
*)
export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
@ -16832,9 +16860,6 @@ fi
# 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
@ -16843,7 +16868,7 @@ fi
# 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"
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
@ -16855,6 +16880,18 @@ fi
dynamic_linker='GNU/Linux ld.so'
;;
netbsdelf*-gnu)
version_type=linux
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='NetBSD ld.elf_so'
;;
netbsd*)
version_type=sunos
need_lib_prefix=no
@ -17250,7 +17287,7 @@ else
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))
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@ -17296,7 +17333,7 @@ else
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))
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@ -17320,7 +17357,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
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))
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@ -17365,7 +17402,7 @@ else
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))
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@ -17389,7 +17426,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
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))
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@ -23400,7 +23437,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#
# INIT-COMMANDS
#
AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
# The HP-UX ksh and POSIX shell print the target directory to stdout
@ -24399,35 +24436,29 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
# 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
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
for 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
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named 'Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: 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" |
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`$as_dirname -- "$mf" ||
$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$mf" : 'X\(//\)[^/]' \| \
X"$mf" : 'X\(//\)$' \| \
X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$mf" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@ -24445,48 +24476,53 @@ $as_echo X"$am_mf" |
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 '/^.*\/\([^/][^/]*\)\/*$/{
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running 'make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "$am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`$as_dirname -- "$file" ||
$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$file" : 'X\(//\)[^/]' \| \
X"$file" : 'X\(//\)$' \| \
X"$file" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\/\(\/\).*/{
/^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=$?
as_dir=$dirpart/$fdir; as_fn_mkdir_p
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
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)
@ -24504,7 +24540,6 @@ See \`config.log' for more details" "$LINENO" 5; }
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.

View File

@ -87,7 +87,6 @@ libhawk_la_SOURCES = \
hawk-prv.h \
hawk.c \
mb8.c \
misc-imp.h \
misc-prv.h \
misc.c \
parse-prv.h \
@ -120,7 +119,6 @@ libhawk_la_SOURCES = \
utl-str.c \
utl-sys.c \
utl.c \
val-imp.h \
val-prv.h \
val.c

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -163,16 +163,16 @@ am__libhawk_la_SOURCES_DIST = hawk.h hawk-chr.h hawk-cmn.h hawk-ecs.h \
hawk-fmt.h hawk-gem.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 gem.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
fnc-prv.h fnc.c htb.c gem.c hawk-prv.h hawk.c mb8.c 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-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
@ -221,38 +221,7 @@ 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-gem.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__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@ -477,6 +446,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@ -529,16 +499,15 @@ pkginclude_HEADERS = \
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 gem.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)
hawk-prv.h hawk.c mb8.c 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-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) \
@ -580,8 +549,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*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);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -655,55 +624,49 @@ mostlyclean-compile:
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-gem.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)
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-arr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-chr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-cli.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-ecs.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-err.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-fio.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-fmt.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-fnc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-gem.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-hawk.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-htb.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-mb8.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-misc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-mod-math.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-mod-str.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-mtx.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-parse.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-pio.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-pma.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-rbt.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-rec.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-rio.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-run.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-sio.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-std.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-tio.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-tre-ast.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-tre-compile.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-tre-match-bt.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-tre-match-pa.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-tre-parse.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-tre-stack.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-tre.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-tree.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-utf16.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-utf8.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-utl-sort.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-utl-str.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-utl-sys.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-utl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_la-val.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawkxx_la-Hawk.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawkxx_la-StdHawk.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@ -1133,10 +1096,7 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@ -1209,49 +1169,7 @@ 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-gem.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 -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-tags
@ -1297,49 +1215,7 @@ 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-gem.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 -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@ -1360,15 +1236,15 @@ 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 \
.PHONY: CTAGS GTAGS TAGS all all-am 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 \

View File

@ -25,16 +25,16 @@
*/
str_t* FN(open) (hawk_t* hawk, hawk_oow_t xtnsize, hawk_oow_t capa)
str_t* FN(open) (hawk_gem_t* gem, hawk_oow_t xtnsize, hawk_oow_t capa)
{
str_t* str;
str = (str_t*)hawk_allocmem(hawk, HAWK_SIZEOF(str_t) + xtnsize);
str = (str_t*)hawk_gem_allocmem(gem, HAWK_SIZEOF(str_t) + xtnsize);
if (str)
{
if (FN(init)(str, hawk, capa) <= -1)
if (FN(init)(str, gem, capa) <= -1)
{
hawk_freemem (hawk, str);
hawk_gem_freemem (gem, str);
str = HAWK_NULL;
}
else
@ -48,20 +48,20 @@ str_t* FN(open) (hawk_t* hawk, hawk_oow_t xtnsize, hawk_oow_t capa)
void FN(close) (str_t* str)
{
FN(fini) (str);
hawk_freemem (str->hawk, str);
hawk_gem_freemem (str->gem, str);
}
int FN(init) (str_t* str, hawk_t* hawk, hawk_oow_t capa)
int FN(init) (str_t* str, hawk_gem_t* gem, hawk_oow_t capa)
{
HAWK_MEMSET (str, 0, HAWK_SIZEOF(str_t));
str->hawk = hawk;
str->gem = gem;
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));
str->val.ptr = (char_t*)hawk_gem_allocmem(gem, HAWK_SIZEOF(char_t) * (capa + 1));
if (!str->val.ptr) return -1;
str->val.ptr[0] = '\0';
}
@ -74,7 +74,7 @@ int FN(init) (str_t* str, hawk_t* hawk, hawk_oow_t capa)
void FN(fini) (str_t* str)
{
if (str->val.ptr) hawk_freemem (str->hawk, str->val.ptr);
if (str->val.ptr) hawk_gem_freemem (str->gem, str->val.ptr);
}
int FN(yield) (str_t* str, cstr_t* buf, hawk_oow_t newcapa)
@ -84,7 +84,7 @@ int FN(yield) (str_t* str, cstr_t* buf, hawk_oow_t newcapa)
if (newcapa == 0) tmp = HAWK_NULL;
else
{
tmp = (char_t*)hawk_allocmem(str->hawk, HAWK_SIZEOF(char_t) * (newcapa + 1));
tmp = (char_t*)hawk_gem_allocmem(str->gem, HAWK_SIZEOF(char_t) * (newcapa + 1));
if (!tmp) return -1;
tmp[0] = '\0';
}
@ -112,7 +112,7 @@ hawk_oow_t FN(setcapa) (str_t* str, hawk_oow_t capa)
if (capa == str->capa) return capa;
tmp = (char_t*)hawk_reallocmem(str->hawk, str->val.ptr, HAWK_SIZEOF(char_t) * (capa+1));
tmp = (char_t*)hawk_gem_reallocmem(str->gem, str->val.ptr, HAWK_SIZEOF(char_t) * (capa+1));
if (!tmp) return (hawk_oow_t)-1;
if (capa < str->val.len)
@ -152,7 +152,7 @@ void FN(clear) (str_t* str)
str->val.len = 0;
if (str->val.ptr)
{
HAWK_ASSERT (str->hawk, str->capa >= 1);
HAWK_ASSERT (str->gem, str->capa >= 1);
str->val.ptr[0] = '\0';
}
}
@ -164,17 +164,17 @@ void FN(swap) (str_t* str, str_t* str1)
tmp.val.ptr = str->val.ptr;
tmp.val.len = str->val.len;
tmp.capa = str->capa;
tmp.hawk = str->hawk;
tmp.gem = str->gem;
str->val.ptr = str1->val.ptr;
str->val.len = str1->val.len;
str->capa = str1->capa;
str->hawk = str1->hawk;
str->gem = str1->gem;
str1->val.ptr = tmp.val.ptr;
str1->val.len = tmp.val.len;
str1->capa = tmp.capa;
str1->hawk = tmp.hawk;
str1->gem = tmp.gem;
}
@ -251,8 +251,8 @@ static int FN(resize_for_ncat) (str_t* str, hawk_oow_t len)
}
else if (str->capa <= 0 && len <= 0)
{
HAWK_ASSERT (str->hawk, str->val.ptr == HAWK_NULL);
HAWK_ASSERT (str->hawk, str->val.len <= 0);
HAWK_ASSERT (str->gem, str->val.ptr == HAWK_NULL);
HAWK_ASSERT (str->gem, str->val.len <= 0);
if (FN(setcapa)(str, 1) == (hawk_oow_t)-1) return -1;
}
@ -366,14 +366,9 @@ hawk_oow_t FN(amend) (str_t* str, hawk_oow_t pos, hawk_oow_t len, const char_t*
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;
if (hawk_uecs_ncatbchars(uecs, ptr, len, uecs->gem->cmgr, 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;
@ -388,7 +383,7 @@ static int FN(put_uchars) (hawk_fmtout_t* fmtout, const hawk_uch_t* ptr, hawk_oo
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;
if (hawk_becs_ncatuchars(becs, ptr, len, becs->gem->cmgr) == (hawk_oow_t)-1) return -1;
#endif
return 1; /* success. carry on */
}
@ -398,7 +393,7 @@ 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.mmgr = str->gem->mmgr;
fo.putbchars = FN(put_bchars);
fo.putuchars = FN(put_uchars);
fo.ctx = str;
@ -428,7 +423,7 @@ 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.mmgr = str->gem->mmgr;
fo.putbchars = FN(put_bchars);
fo.putuchars = FN(put_uchars);
fo.ctx = str;

View File

@ -292,7 +292,6 @@ static hawk_fnc_t* find_fnc (hawk_t* awk, const hawk_oocs_t* name)
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];
}
@ -1003,13 +1002,9 @@ oops:
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_gethawk(rtx), nargs == 1);
a0 = hawk_rtx_getarg (rtx, 0);
if (HAWK_RTX_GETVALTYPE(rtx, a0) == HAWK_VAL_MBS)
{
@ -1041,13 +1036,9 @@ int hawk_fnc_tolower (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi)
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_gethawk(rtx), nargs == 1);
a0 = hawk_rtx_getarg (rtx, 0);
if (HAWK_RTX_GETVALTYPE(rtx, a0) == HAWK_VAL_MBS)
{
@ -1097,13 +1088,12 @@ static int __substitute (hawk_rtx_t* rtx, hawk_int_t max_count)
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);
nargs = hawk_rtx_getnargs(rtx);
HAWK_ASSERT (hawk_rtx_gethawk(rtx), nargs >= 2 && nargs <= 3);
a0 = hawk_rtx_getarg(rtx, 0);
@ -1124,12 +1114,12 @@ static int __substitute (hawk_rtx_t* rtx, hawk_int_t max_count)
}
else
{
s0.ptr = hawk_rtx_valtooocstrdup (rtx, a0, &s0.len);
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);
s1.ptr = hawk_rtx_getvaloocstr(rtx, a1, &s1.len);
if (s1.ptr == HAWK_NULL) goto oops;
if (a2 == HAWK_NULL)
@ -1140,16 +1130,12 @@ static int __substitute (hawk_rtx_t* rtx, hawk_int_t max_count)
}
else
{
s2.ptr = hawk_rtx_valtooocstrdup (rtx, a2, &s2.len);
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_gethawk(rtx), s2.len) <= -1)
{
hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL);
goto oops;
}
if (hawk_ooecs_init(&new, hawk_rtx_getgem(rtx), s2.len) <= -1) goto oops;
new_inited = 1;
if (a0_vtype != HAWK_VAL_REX)
@ -1158,9 +1144,9 @@ static int __substitute (hawk_rtx_t* rtx, hawk_int_t max_count)
int x;
if (rtx->gbl.ignorecase)
x = hawk_buildrex (hawk_rtx_gethawk(rtx), s0.ptr, s0.len, &errnum, HAWK_NULL, &rex);
x = hawk_buildrex(hawk_rtx_gethawk(rtx), s0.ptr, s0.len, &errnum, HAWK_NULL, &rex);
else
x = hawk_buildrex (hawk_rtx_gethawk(rtx), s0.ptr, s0.len, &errnum, &rex, HAWK_NULL);
x = hawk_buildrex(hawk_rtx_gethawk(rtx), s0.ptr, s0.len, &errnum, &rex, HAWK_NULL);
if (x <= -1)
{
@ -1205,12 +1191,7 @@ static int __substitute (hawk_rtx_t* rtx, hawk_int_t max_count)
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;
}
if (hawk_ooecs_ncat(&new, cur.ptr, cur.len) == (hawk_oow_t)-1) goto oops;
break;
}
@ -1221,11 +1202,7 @@ static int __substitute (hawk_rtx_t* rtx, hawk_int_t max_count)
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;
}
if (hawk_ooecs_ncat(&new, cur.ptr, mat.ptr - cur.ptr) == (hawk_oow_t)-1) goto oops;
for (i = 0; i < s1.len; i++)
{
@ -1243,11 +1220,7 @@ static int __substitute (hawk_rtx_t* rtx, hawk_int_t max_count)
m = hawk_ooecs_ccat (&new, s1.ptr[i]);
}
if (m == (hawk_oow_t)-1)
{
hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL);
goto oops;
}
if (m == (hawk_oow_t)-1) goto oops;
}
sub_count++;
@ -1261,12 +1234,8 @@ static int __substitute (hawk_rtx_t* rtx, hawk_int_t max_count)
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;
}
m = hawk_ooecs_ncat(&new, cur.ptr, 1);
if (m == (hawk_oow_t)-1) goto oops;
cur.ptr++; cur.len--;
}
@ -1421,7 +1390,7 @@ int hawk_fnc_match (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi)
hawk_oow_t i, xlen;
hawk_val_t* tv;
tmpbuf = hawk_ooecs_open(hawk_rtx_gethawk(rtx), 0, 64);
tmpbuf = hawk_ooecs_open(hawk_rtx_getgem(rtx), 0, 64);
if (!tmpbuf) goto oops;
x2 = hawk_rtx_makemapval(rtx);
@ -1495,7 +1464,7 @@ 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);
nargs = hawk_rtx_getnargs(rtx);
HAWK_ASSERT (hawk_rtx_gethawk(rtx), nargs > 0);
a0 = hawk_rtx_getarg(rtx, 0);
@ -1506,18 +1475,10 @@ int hawk_fnc_sprintf (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi)
hawk_bcs_t cs0;
hawk_bcs_t x;
if (hawk_becs_init(&out, hawk_rtx_gethawk(rtx), 256) <= -1)
{
hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL);
goto oops_mbs;
}
if (hawk_becs_init(&out, hawk_rtx_getgem(rtx), 256) <= -1) goto oops_mbs;
out_inited = 1;
if (hawk_becs_init(&fbu, hawk_rtx_gethawk(rtx), 256) <= -1)
{
hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL);
goto oops_mbs;
}
if (hawk_becs_init(&fbu, hawk_rtx_getgem(rtx), 256) <= -1) goto oops_mbs;
fbu_inited = 1;
cs0.ptr = hawk_rtx_getvalbcstr(rtx, a0, &cs0.len);
@ -1547,18 +1508,10 @@ int hawk_fnc_sprintf (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi)
hawk_oocs_t cs0;
hawk_oocs_t x;
if (hawk_ooecs_init(&out, hawk_rtx_gethawk(rtx), 256) <= -1)
{
hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL);
goto oops;
}
if (hawk_ooecs_init(&out, hawk_rtx_getgem(rtx), 256) <= -1) goto oops;
out_inited = 1;
if (hawk_ooecs_init(&fbu, hawk_rtx_gethawk(rtx), 256) <= -1)
{
hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL);
goto oops;
}
if (hawk_ooecs_init(&fbu, hawk_rtx_getgem(rtx), 256) <= -1) goto oops;
fbu_inited = 1;
cs0.ptr = hawk_rtx_getvaloocstr(rtx, a0, &cs0.len);
@ -1585,15 +1538,11 @@ int hawk_fnc_sprintf (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi)
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_gethawk(rtx), nargs == 1);
a0 = hawk_rtx_getarg(rtx, 0);
n = hawk_rtx_valtoint(rtx, a0, &lv);

View File

@ -101,7 +101,7 @@ typedef hawk_oow_t (*hawk_uecs_sizer_t) (
*/
struct hawk_becs_t
{
hawk_t* hawk;
hawk_gem_t* gem;
hawk_becs_sizer_t sizer; /**< buffer resizer function */
hawk_bcs_t val; /**< buffer/string pointer and lengh */
hawk_oow_t capa; /**< buffer capacity */
@ -112,7 +112,7 @@ struct hawk_becs_t
*/
struct hawk_uecs_t
{
hawk_t* hawk;
hawk_gem_t* gem;
hawk_uecs_sizer_t sizer; /**< buffer resizer function */
hawk_ucs_t val; /**< buffer/string pointer and lengh */
hawk_oow_t capa; /**< buffer capacity */
@ -127,7 +127,7 @@ extern "C" {
* The hawk_becs_open() function creates a dynamically resizable multibyte string.
*/
HAWK_EXPORT hawk_becs_t* hawk_becs_open (
hawk_t* hawk,
hawk_gem_t* gem,
hawk_oow_t xtnsize,
hawk_oow_t capa
);
@ -144,7 +144,7 @@ HAWK_EXPORT void hawk_becs_close (
*/
HAWK_EXPORT int hawk_becs_init (
hawk_becs_t* becs,
hawk_t* hawk,
hawk_gem_t* gem,
hawk_oow_t capa
);
@ -341,7 +341,7 @@ HAWK_EXPORT hawk_oow_t hawk_becs_fmt (
* The hawk_uecs_open() function creates a dynamically resizable multibyte string.
*/
HAWK_EXPORT hawk_uecs_t* hawk_uecs_open (
hawk_t* hawk,
hawk_gem_t* gem,
hawk_oow_t xtnsize,
hawk_oow_t capa
);
@ -358,7 +358,7 @@ HAWK_EXPORT void hawk_uecs_close (
*/
HAWK_EXPORT int hawk_uecs_init (
hawk_uecs_t* uecs,
hawk_t* hawk,
hawk_gem_t* gem,
hawk_oow_t capa
);

View File

@ -840,6 +840,97 @@ HAWK_EXPORT hawk_oow_t hawk_int_to_oocstr (
hawk_oow_t size
);
/**
* The hawk_uchars_to_int() function converts a wide character string to an integer.
*/
HAWK_EXPORT hawk_int_t hawk_uchars_to_int (
const hawk_uch_t* str,
hawk_oow_t len,
int base,
const hawk_uch_t** endptr,
int stripspc
);
/**
* The hawk_bchars_to_int() function converts a multi-byte string to an integer.
*/
HAWK_EXPORT hawk_int_t hawk_bchars_to_int (
const hawk_bch_t* str,
hawk_oow_t len,
int base,
const hawk_bch_t** endptr,
int stripspc
);
/**
* The hawk_uchars_to_flt() function converts a wide character string to a floating-point
* number.
*/
HAWK_EXPORT hawk_flt_t hawk_uchars_to_flt (
const hawk_uch_t* str,
hawk_oow_t len,
const hawk_uch_t** endptr,
int stripspc
);
/**
* The hawk_bchars_to_flt() function converts a multi-byte string to a floating-point
* number.
*/
HAWK_EXPORT hawk_flt_t hawk_bchars_to_flt (
const hawk_bch_t* str,
hawk_oow_t len,
const hawk_bch_t** endptr,
int stripspc
);
/**
* The hawk_oochars_to_num() 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_OOCHARS_TO_NUM_MAKE_OPTION(strict,stripspc,base) (((!!(strict)) << 0) | ((!!(stripspc)) << 1) | ((base) << 8))
#define HAWK_OOCHARS_TO_NUM_GET_OPTION_STRICT(option) ((option) & 1)
#define HAWK_OOCHARS_TO_NUM_GET_OPTION_STRIPSPC(option) ((option) & 2)
#define HAWK_OOCHARS_TO_NUM_GET_OPTION_BASE(option) ((option) >> 8)
HAWK_EXPORT int hawk_bchars_to_num (
int option,
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_uchars_to_num (
int option,
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_UCH)
# define hawk_oochars_to_int hawk_uchars_to_int
# define hawk_oocstr_to_flt hawk_ucstr_to_flt
# define hawk_oochars_to_flt hawk_uchars_to_flt
# define hawk_oochars_to_num hawk_uchars_to_num
#else
# define hawk_oochars_to_int hawk_bchars_to_int
# define hawk_oocstr_to_flt hawk_bcstr_to_flt
# define hawk_oochars_to_flt hawk_bchars_to_flt
# define hawk_oochars_to_num hawk_bchars_to_num
#endif
/* ------------------------------------------------------------------------- */
HAWK_EXPORT hawk_cmgr_t* hawk_get_cmgr_by_id (

View File

@ -46,9 +46,9 @@ static void free_fnc (hawk_htb_t* map, void* vptr, hawk_oow_t vlen)
hawk_freemem (awk, f);
}
static int init_token (hawk_t* awk, hawk_tok_t* tok)
static int init_token (hawk_t* hawk, hawk_tok_t* tok)
{
tok->name = hawk_ooecs_open(awk, 0, 128);
tok->name = hawk_ooecs_open(hawk_getgem(hawk), 0, 128);
if (!tok->name) return -1;
tok->type = 0;

View File

@ -1964,65 +1964,6 @@ static HAWK_INLINE hawk_oow_t hawk_fmttobcstr (hawk_t* hawk, hawk_bch_t* buf, ha
/* ----------------------------------------------------------------------- */
/**
* 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,
@ -3098,47 +3039,6 @@ HAWK_EXPORT int hawk_rtx_valtoflt (
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.
@ -3148,7 +3048,6 @@ HAWK_EXPORT hawk_int_t hawk_rtx_hashval (
hawk_val_t* v
);
/**
* The hawk_rtx_getrefvaltype() function returns the type of the value
* that the given reference points to.

View File

@ -1,530 +0,0 @@
/*
* $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;
}

View File

@ -34,57 +34,6 @@
# include <hawk-tre.h>
#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,

View File

@ -356,32 +356,32 @@ static int fnc_dir_reset (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi)
list = rtx_to_list(rtx, fi);
ret = hawk_rtx_valtoint (rtx, hawk_rtx_getarg (rtx, 0), &id);
ret = hawk_rtx_valtoint(rtx, hawk_rtx_getarg (rtx, 0), &id);
if (ret <= -1)
{
list->errnum = awk_err_to_errnum (hawk_rtx_geterrnum (rtx));
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);
a1 = hawk_rtx_getarg(rtx, 1);
path = hawk_rtx_getvaloocstr(rtx, a1, HAWK_NULL);
if (path)
{
ret = reset_byid (rtx, list, id, 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));
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));
hawk_rtx_setretval (rtx, hawk_rtx_makeintval(rtx, ret));
return 0;
}

View File

@ -469,6 +469,7 @@ static int fnc_tonum (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi)
/* str::tonum(value) */
/* str::tonum(string, base) */
hawk_t* hawk = hawk_rtx_gethawk(rtx);
hawk_val_t* retv;
hawk_val_t* a0;
hawk_int_t lv;
@ -485,9 +486,8 @@ static int fnc_tonum (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi)
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),
rx = hawk_bchars_to_num(
HAWK_OOCHARS_TO_NUM_MAKE_OPTION(0, (hawk->opt.trait & HAWK_STRIPSTRSPC), base),
((hawk_val_mbs_t*)a0)->val.ptr,
((hawk_val_mbs_t*)a0)->val.len,
&lv, &rv
@ -501,9 +501,8 @@ static int fnc_tonum (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi)
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),
rx = hawk_oochars_to_num(
HAWK_OOCHARS_TO_NUM_MAKE_OPTION(0, (hawk->opt.trait & HAWK_STRIPSTRSPC), base),
((hawk_val_str_t*)a0)->val.ptr,
((hawk_val_str_t*)a0)->val.len,
&lv, &rv

View File

@ -988,7 +988,7 @@ static int parse_progunit (hawk_t* awk)
return -1;
}
sl = hawk_strxtoint(awk, HAWK_OOECS_PTR(awk->tok.name), HAWK_OOECS_LEN(awk->tok.name), 0, HAWK_NULL);
sl = hawk_oochars_to_int(HAWK_OOECS_PTR(awk->tok.name), HAWK_OOECS_LEN(awk->tok.name), 0, HAWK_NULL, (awk->opt.trait & HAWK_STRIPSTRSPC));
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 */
@ -4511,71 +4511,61 @@ static HAWK_INLINE int isfnname (hawk_t* awk, const hawk_oocs_t* name)
return isfunname(awk, name, HAWK_NULL);
}
static hawk_nde_t* parse_primary_int (hawk_t* awk, const hawk_loc_t* xloc)
static hawk_nde_t* parse_primary_int (hawk_t* hawk, 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
),
hawk,
hawk_oochars_to_int (HAWK_OOECS_PTR(hawk->tok.name), HAWK_OOECS_LEN(hawk->tok.name), 0, HAWK_NULL, (hawk->opt.trait & HAWK_STRIPSTRSPC)),
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)));
HAWK_ASSERT (hawk, HAWK_OOECS_LEN(hawk->tok.name) == hawk_count_oocstr(HAWK_OOECS_PTR(hawk->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;
nde->len = HAWK_OOECS_LEN(hawk->tok.name);
nde->str = hawk_dupoocs(hawk, HAWK_OOECS_OOCS(hawk->tok.name));
if (nde->str == HAWK_NULL || get_token(hawk) <= -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);
HAWK_ASSERT (hawk, nde != HAWK_NULL);
if (nde->str) hawk_freemem (hawk, nde->str);
hawk_freemem (hawk, nde);
return HAWK_NULL;
}
static hawk_nde_t* parse_primary_flt (hawk_t* awk, const hawk_loc_t* xloc)
static hawk_nde_t* parse_primary_flt (hawk_t* hawk, 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
),
nde = (hawk_nde_flt_t*)new_flt_node(
hawk,
hawk_oochars_to_flt(HAWK_OOECS_PTR(hawk->tok.name), HAWK_OOECS_LEN(hawk->tok.name), HAWK_NULL, (hawk->opt.trait & HAWK_STRIPSTRSPC)),
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)));
HAWK_ASSERT (hawk,
HAWK_OOECS_LEN(hawk->tok.name) ==
hawk_count_oocstr(HAWK_OOECS_PTR(hawk->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;
nde->len = HAWK_OOECS_LEN(hawk->tok.name);
nde->str = hawk_dupoocs(hawk, HAWK_OOECS_OOCS(hawk->tok.name));
if (nde->str == HAWK_NULL || get_token(hawk) <= -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);
HAWK_ASSERT (hawk, nde != HAWK_NULL);
if (nde->str) hawk_freemem (hawk, nde->str);
hawk_freemem (hawk, nde);
return HAWK_NULL;
}

View File

@ -118,7 +118,7 @@ static int get_highest_fd (hawk_pio_t* pio)
if (de->d_name[0] == HAWK_BT('.')) continue;
l = hawk_bcharstoint(pio->hawk, de->d_name, hawk_count_bcstr(de->d_name), 10, &endptr);
l = hawk_bchars_to_int(de->d_name, hawk_count_bcstr(de->d_name), 10, &endptr, 0);
if (*endptr == HAWK_BT('\0'))
{
fd = (int)l;
@ -190,8 +190,7 @@ static int close_open_fds_using_proc (hawk_pio_t* pio, int* excepts, hawk_oow_t
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);
l = hawk_bchars_to_int(de->d_name, hawk_count_bcstr(de->d_name), 10, &endptr, 0);
if (*endptr == HAWK_BT('\0'))
{
int fd = (int)l;

View File

@ -930,14 +930,14 @@ static int init_rtx (hawk_rtx_t* rtx, hawk_t* awk, hawk_rio_cbs_t* rio)
rtx->inrec.maxflds = 0;
rtx->inrec.d0 = hawk_val_nil;
if (hawk_ooecs_init(&rtx->inrec.line, hawk_rtx_gethawk(rtx), DEF_BUF_CAPA) <= -1) goto oops_1;
if (hawk_ooecs_init(&rtx->inrec.linew, hawk_rtx_gethawk(rtx), DEF_BUF_CAPA) <= -1) goto oops_2;
if (hawk_ooecs_init(&rtx->inrec.lineg, hawk_rtx_gethawk(rtx), DEF_BUF_CAPA) <= -1) goto oops_3;
if (hawk_ooecs_init(&rtx->format.out, hawk_rtx_gethawk(rtx), 256) <= -1) goto oops_4;
if (hawk_ooecs_init(&rtx->format.fmt, hawk_rtx_gethawk(rtx), 256) <= -1) goto oops_5;
if (hawk_ooecs_init(&rtx->inrec.line, hawk_rtx_getgem(rtx), DEF_BUF_CAPA) <= -1) goto oops_1;
if (hawk_ooecs_init(&rtx->inrec.linew, hawk_rtx_getgem(rtx), DEF_BUF_CAPA) <= -1) goto oops_2;
if (hawk_ooecs_init(&rtx->inrec.lineg, hawk_rtx_getgem(rtx), DEF_BUF_CAPA) <= -1) goto oops_3;
if (hawk_ooecs_init(&rtx->format.out, hawk_rtx_getgem(rtx), 256) <= -1) goto oops_4;
if (hawk_ooecs_init(&rtx->format.fmt, hawk_rtx_getgem(rtx), 256) <= -1) goto oops_5;
if (hawk_becs_init(&rtx->formatmbs.out, hawk_rtx_gethawk(rtx), 256) <= -1) goto oops_6;
if (hawk_becs_init(&rtx->formatmbs.fmt, hawk_rtx_gethawk(rtx), 256) <= -1) goto oops_7;
if (hawk_becs_init(&rtx->formatmbs.out, hawk_rtx_getgem(rtx), 256) <= -1) goto oops_6;
if (hawk_becs_init(&rtx->formatmbs.fmt, hawk_rtx_getgem(rtx), 256) <= -1) goto oops_7;
rtx->named = hawk_htb_open(hawk_rtx_gethawk(rtx), HAWK_SIZEOF(rtx), 1024, 70, HAWK_SIZEOF(hawk_ooch_t), 1);
if (!rtx->named) goto oops_8;
@ -1002,7 +1002,6 @@ oops_2:
oops_1:
hawk_rtx_freemem (rtx, rtx->stack);
oops_0:
hawk_seterrnum (awk, HAWK_ENOMEM, HAWK_NULL);
return -1;
}
@ -4263,19 +4262,19 @@ static HAWK_INLINE int __cmp_int_flt (
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_t* hawk = hawk_rtx_gethawk(rtx);
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*/)
if ((hawk->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),
n = hawk_oochars_to_num(
HAWK_OOCHARS_TO_NUM_MAKE_OPTION(1, (hawk->opt.trait & HAWK_STRIPSTRSPC), 0),
((hawk_val_str_t*)right)->val.ptr,
((hawk_val_str_t*)right)->val.len,
&ll, &rr
@ -4304,18 +4303,18 @@ static HAWK_INLINE int __cmp_int_str (hawk_rtx_t* rtx, hawk_val_t* left, hawk_va
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_t* hawk = hawk_rtx_gethawk(rtx);
hawk_bch_t* str0;
hawk_oow_t len0;
int n;
if ((rtx->awk->opt.trait & HAWK_NCMPONSTR) || right->nstr /*> 0*/)
if ((hawk->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),
n = hawk_bchars_to_num (
HAWK_OOCHARS_TO_NUM_MAKE_OPTION(1, (hawk->opt.trait & HAWK_STRIPSTRSPC), 0),
((hawk_val_mbs_t*)right)->val.ptr,
((hawk_val_mbs_t*)right)->val.len,
&ll, &rr
@ -4385,17 +4384,18 @@ static HAWK_INLINE int __cmp_flt_flt (hawk_rtx_t* rtx, hawk_val_t* left, hawk_va
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_t* hawk = hawk_rtx_gethawk(rtx);
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*/)
if (hawk->opt.trait & HAWK_NCMPONSTR || right->nstr /*> 0*/)
{
const hawk_ooch_t* end;
hawk_flt_t rr;
rr = hawk_strxtoflt(hawk_rtx_gethawk(rtx), ((hawk_val_str_t*)right)->val.ptr, ((hawk_val_str_t*)right)->val.len, &end);
rr = hawk_oochars_to_flt(((hawk_val_str_t*)right)->val.ptr, ((hawk_val_str_t*)right)->val.len, &end, (hawk->opt.trait & HAWK_STRIPSTRSPC));
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:
@ -4413,16 +4413,17 @@ static HAWK_INLINE int __cmp_flt_str (hawk_rtx_t* rtx, hawk_val_t* left, hawk_va
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_t* hawk = hawk_rtx_gethawk(rtx);
hawk_bch_t* str0;
hawk_oow_t len0;
int n;
if (rtx->awk->opt.trait & HAWK_NCMPONSTR || right->nstr /*> 0*/)
if (hawk->opt.trait & HAWK_NCMPONSTR || right->nstr /*> 0*/)
{
const hawk_bch_t* end;
hawk_flt_t rr;
rr = hawk_bcharstoflt(hawk_rtx_gethawk(rtx), ((hawk_val_mbs_t*)right)->val.ptr, ((hawk_val_mbs_t*)right)->val.len, &end);
rr = hawk_bchars_to_flt(((hawk_val_mbs_t*)right)->val.ptr, ((hawk_val_mbs_t*)right)->val.len, &end, (hawk->opt.trait & HAWK_STRIPSTRSPC));
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:
@ -4477,7 +4478,9 @@ static HAWK_INLINE int __cmp_str_flt (hawk_rtx_t* rtx, hawk_val_t* left, hawk_va
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_t* hawk = hawk_rtx_gethawk(rtx);
hawk_val_str_t* ls, * rs;
ls = (hawk_val_str_t*)left;
rs = (hawk_val_str_t*)right;
@ -4492,13 +4495,13 @@ static HAWK_INLINE int __cmp_str_str (hawk_rtx_t* rtx, hawk_val_t* left, hawk_va
{
hawk_int_t ll;
ll = hawk_strxtoint(hawk_rtx_gethawk(rtx), ls->val.ptr, ls->val.len, 0, HAWK_NULL);
ll = hawk_oochars_to_int(ls->val.ptr, ls->val.len, 0, HAWK_NULL, (hawk->opt.trait & HAWK_STRIPSTRSPC));
if (rs->nstr == 1)
{
hawk_int_t rr;
rr = hawk_strxtoint(hawk_rtx_gethawk(rtx), rs->val.ptr, rs->val.len, 0, HAWK_NULL);
rr = hawk_oochars_to_int(rs->val.ptr, rs->val.len, 0, HAWK_NULL, (hawk->opt.trait & HAWK_STRIPSTRSPC));
return (ll > rr)? 1:
(ll < rr)? -1: 0;
@ -4507,9 +4510,9 @@ static HAWK_INLINE int __cmp_str_str (hawk_rtx_t* rtx, hawk_val_t* left, hawk_va
{
hawk_flt_t rr;
HAWK_ASSERT (hawk_rtx_gethawk(rtx), rs->nstr == 2);
HAWK_ASSERT (hawk, rs->nstr == 2);
rr = hawk_strxtoflt(hawk_rtx_gethawk(rtx), rs->val.ptr, rs->val.len, HAWK_NULL);
rr = hawk_oochars_to_flt(rs->val.ptr, rs->val.len, HAWK_NULL, (hawk->opt.trait & HAWK_STRIPSTRSPC));
return (ll > rr)? 1:
(ll < rr)? -1: 0;
@ -4519,15 +4522,15 @@ static HAWK_INLINE int __cmp_str_str (hawk_rtx_t* rtx, hawk_val_t* left, hawk_va
{
hawk_flt_t ll;
HAWK_ASSERT (hawk_rtx_gethawk(rtx), ls->nstr == 2);
HAWK_ASSERT (hawk, ls->nstr == 2);
ll = hawk_strxtoflt(hawk_rtx_gethawk(rtx), ls->val.ptr, ls->val.len, HAWK_NULL);
ll = hawk_oochars_to_flt(ls->val.ptr, ls->val.len, HAWK_NULL, (hawk->opt.trait & HAWK_STRIPSTRSPC));
if (rs->nstr == 1)
{
hawk_int_t rr;
rr = hawk_strxtoint(hawk_rtx_gethawk(rtx), rs->val.ptr, rs->val.len, 0, HAWK_NULL);
rr = hawk_oochars_to_int(rs->val.ptr, rs->val.len, 0, HAWK_NULL, (hawk->opt.trait & HAWK_STRIPSTRSPC));
return (ll > rr)? 1:
(ll < rr)? -1: 0;
@ -4536,9 +4539,9 @@ static HAWK_INLINE int __cmp_str_str (hawk_rtx_t* rtx, hawk_val_t* left, hawk_va
{
hawk_flt_t rr;
HAWK_ASSERT (hawk_rtx_gethawk(rtx), rs->nstr == 2);
HAWK_ASSERT (hawk, rs->nstr == 2);
rr = hawk_strxtoflt(hawk_rtx_gethawk(rtx), rs->val.ptr, rs->val.len, HAWK_NULL);
rr = hawk_oochars_to_flt(rs->val.ptr, rs->val.len, HAWK_NULL, (hawk->opt.trait & HAWK_STRIPSTRSPC));
return (ll > rr)? 1:
(ll < rr)? -1: 0;
@ -6892,11 +6895,10 @@ static int shorten_record (hawk_rtx_t* rtx, hawk_oow_t nflds)
}
}
if (hawk_ooecs_init(&tmp, hawk_rtx_gethawk(rtx), HAWK_OOECS_LEN(&rtx->inrec.line)) <= -1)
if (hawk_ooecs_init(&tmp, hawk_rtx_getgem(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;
}
@ -6907,16 +6909,14 @@ static int shorten_record (hawk_rtx_t* rtx, hawk_oow_t nflds)
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)
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;
}
}
@ -7009,9 +7009,9 @@ static hawk_ooch_t* idxnde_to_str (hawk_rtx_t* rtx, hawk_nde_t* nde, hawk_ooch_t
out.type = HAWK_RTX_VALTOSTR_STRPCAT;
out.u.strpcat = &idxstr;
if (hawk_ooecs_init(&idxstr, hawk_rtx_gethawk(rtx), DEF_BUF_CAPA) <= -1)
if (hawk_ooecs_init(&idxstr, hawk_rtx_getgem(rtx), DEF_BUF_CAPA) <= -1)
{
SETERR_LOC (rtx, HAWK_ENOMEM, &nde->loc);
ADJERR_LOC (rtx, &nde->loc);
return HAWK_NULL;
}
@ -7030,7 +7030,7 @@ static hawk_ooch_t* idxnde_to_str (hawk_rtx_t* rtx, hawk_nde_t* nde, hawk_ooch_t
{
hawk_rtx_refdownval (rtx, idx);
hawk_ooecs_fini (&idxstr);
SETERR_LOC (rtx, HAWK_ENOMEM, &nde->loc);
ADJERR_LOC (rtx, &nde->loc);
return HAWK_NULL;
}
@ -7066,37 +7066,13 @@ hawk_ooch_t* hawk_rtx_format (
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_CHAR(c) do { if (hawk_ooecs_ccat(out, (c)) == (hawk_oow_t)-1) 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 OUT_STR(ptr,len) do { if (hawk_ooecs_ncat(out, (ptr), (len)) == (hawk_oow_t)-1) 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_CHAR(c) do { if (hawk_ooecs_ccat(fbu, (c)) == (hawk_oow_t)-1) 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 FMT_STR(ptr,len) do { if (hawk_ooecs_ncat(fbu, (ptr), (len)) == (hawk_oow_t)-1) return HAWK_NULL; } while(0)
#define GROW(buf) do { \
if ((buf)->ptr) \
@ -7561,15 +7537,11 @@ wp_mod_main:
}
hawk_rtx_refupval (rtx, v);
n = hawk_rtx_valtoflt (rtx, v, &r);
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;
}
if (hawk_ooecs_fcat(out, HAWK_OOECS_PTR(fbu), r) == (hawk_oow_t)-1) return HAWK_NULL;
}
else if (fmt[i] == HAWK_T('c'))
{
@ -7665,7 +7637,6 @@ wp_mod_main:
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]--;
@ -7677,7 +7648,6 @@ wp_mod_main:
if (hawk_ooecs_ccat(out, ch) == (hawk_oow_t)-1)
{
hawk_rtx_refdownval (rtx, v);
SETERR_COD (rtx, HAWK_ENOMEM);
return HAWK_NULL;
}
}
@ -7690,7 +7660,6 @@ wp_mod_main:
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]--;
@ -7797,7 +7766,6 @@ wp_mod_main:
{
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]--;
@ -7857,7 +7825,6 @@ wp_mod_main:
s_fail:
if (str_free) hawk_rtx_freemem (rtx, str_free);
hawk_rtx_refdownval (rtx, v);
SETERR_COD (rtx, HAWK_ENOMEM);
return HAWK_NULL;
}
}
@ -7873,7 +7840,6 @@ wp_mod_main:
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]--;
@ -7913,37 +7879,13 @@ hawk_bch_t* hawk_rtx_formatmbs (
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_MCHAR(c) do { if (hawk_becs_ccat(out, (c)) == (hawk_oow_t)-1) 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 OUT_MBS(ptr,len) do { if (hawk_becs_ncat(out, (ptr), (len)) == (hawk_oow_t)-1) 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_MCHAR(c) do { if (hawk_becs_ccat(fbu, (c)) == (hawk_oow_t)-1) 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 FMT_MBS(ptr,len) do { if (hawk_becs_ncat(fbu, (ptr), (len)) == (hawk_oow_t)-1) return HAWK_NULL; } while(0)
#define GROW_MBSBUF(buf) do { \
if ((buf)->ptr) \
@ -8414,11 +8356,7 @@ wp_mod_main:
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;
}
if (hawk_becs_fcat(out, HAWK_BECS_PTR(fbu), r) == (hawk_oow_t)-1) return HAWK_NULL;
}
else if (fmt[i] == HAWK_BT('c'))
{
@ -8515,7 +8453,6 @@ wp_mod_main:
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]--;
@ -8527,7 +8464,6 @@ wp_mod_main:
if (hawk_becs_ccat(out, ch) == (hawk_oow_t)-1)
{
hawk_rtx_refdownval (rtx, v);
SETERR_COD (rtx, HAWK_ENOMEM);
return HAWK_NULL;
}
}
@ -8540,7 +8476,6 @@ wp_mod_main:
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]--;
@ -8649,7 +8584,6 @@ wp_mod_main:
{
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]--;
@ -8703,7 +8637,6 @@ wp_mod_main:
s_fail:
if (str_free) hawk_rtx_freemem (rtx, str_free);
hawk_rtx_refdownval (rtx, v);
SETERR_COD (rtx, HAWK_ENOMEM);
return HAWK_NULL;
}
}
@ -8719,7 +8652,6 @@ wp_mod_main:
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]--;

View File

@ -1146,17 +1146,17 @@ static hawk_ooi_t sf_out (hawk_t* awk, hawk_sio_cmd_t cmd, hawk_sio_arg_t* arg,
return 1;
case HAWK_PARSESTD_OOCS:
xtn->s.out.u.oocs.buf = hawk_ooecs_open(awk, 0, 512);
xtn->s.out.u.oocs.buf = hawk_ooecs_open(hawk_getgem(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);
xtn->s.out.u.bcs.buf = hawk_becs_open(hawk_getgem(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);
xtn->s.out.u.ucs.buf = hawk_uecs_open(hawk_getgem(awk), 0, 512);
if (xtn->s.out.u.ucs.buf == HAWK_NULL) return -1;
return 1;
}
@ -2503,6 +2503,7 @@ static ioattr_t* find_or_make_ioattr (
static int fnc_setioattr (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi)
{
hawk_t* hawk = hawk_rtx_gethawk(rtx);
rxtn_t* rxtn;
hawk_val_t* v[3];
hawk_ooch_t* ptr[3];
@ -2511,12 +2512,12 @@ static int fnc_setioattr (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi)
int tmout;
rxtn = GET_RXTN(rtx);
HAWK_ASSERT (hawk_rtx_gethawk(rtx), rxtn->cmgrtab_inited == 1);
HAWK_ASSERT (hawk, 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]);
v[i] = hawk_rtx_getarg(rtx, i);
ptr[i] = hawk_rtx_getvaloocstr(rtx, v[i], &len[i]);
if (ptr[i] == HAWK_NULL)
{
ret = -1;
@ -2530,7 +2531,7 @@ static int fnc_setioattr (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi)
}
}
if ((tmout = timeout_code (ptr[1])) >= 0)
if ((tmout = timeout_code(ptr[1])) >= 0)
{
ioattr_t* ioattr;
@ -2540,7 +2541,7 @@ static int fnc_setioattr (hawk_rtx_t* rtx, const hawk_fnc_info_t* fi)
/* 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);
x = hawk_oochars_to_num(HAWK_OOCHARS_TO_NUM_MAKE_OPTION(0, (hawk->opt.trait & HAWK_STRIPSTRSPC), 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]);

View File

@ -280,7 +280,7 @@ int hawk_comp_bchars_ucstr (const hawk_bch_t* str1, hawk_oow_t len, const hawk_u
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)
{
@ -395,7 +395,7 @@ hawk_oow_t hawk_copy_bcstr_unlimited (hawk_bch_t* dst, const hawk_bch_t* src)
return dst - org - 1;
}
/* ----------------------------------------------------------------------- */
/* ------------------------------------------------------------------------ */
hawk_oow_t hawk_count_ucstr (const hawk_uch_t* str)
{
@ -431,7 +431,7 @@ hawk_oow_t hawk_count_bcstr_limited (const hawk_bch_t* str, hawk_oow_t maxlen)
return i;
}
/* ----------------------------------------------------------------------- */
/* ------------------------------------------------------------------------ */
void hawk_fill_uchars (hawk_uch_t* dst, hawk_uch_t ch, hawk_oow_t len)
{
@ -446,7 +446,7 @@ void hawk_fill_bchars (hawk_bch_t* dst, hawk_bch_t ch, hawk_oow_t len)
}
/* ----------------------------------------------------------------------- */
/* ------------------------------------------------------------------------ */
hawk_uch_t* hawk_find_uchar (const hawk_uch_t* ptr, hawk_oow_t len, hawk_uch_t c)
{
@ -525,7 +525,7 @@ hawk_bch_t* hawk_find_bchar_in_bcstr (const hawk_bch_t* ptr, hawk_bch_t c)
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)
{
@ -719,7 +719,7 @@ hawk_bch_t* hawk_rfind_bchars_in_bchars (const hawk_bch_t* str, hawk_oow_t strsz
return HAWK_NULL;
}
/* ----------------------------------------------------------------------- */
/* ------------------------------------------------------------------------ */
hawk_oow_t hawk_compact_uchars (hawk_uch_t* str, hawk_oow_t len)
{
@ -799,7 +799,7 @@ hawk_oow_t hawk_compact_bchars (hawk_bch_t* str, hawk_oow_t len)
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)
{
@ -869,7 +869,7 @@ hawk_oow_t hawk_rotate_bchars (hawk_bch_t* str, hawk_oow_t len, int dir, hawk_oo
return len;
}
/* ----------------------------------------------------------------------- */
/* ------------------------------------------------------------------------ */
hawk_uch_t* hawk_trim_uchars (hawk_uch_t* str, hawk_oow_t* len, int flags)
{
@ -954,7 +954,7 @@ hawk_bch_t* hawk_trim_bchars (hawk_bch_t* str, hawk_oow_t* len, int flags)
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)
{
@ -1432,7 +1432,7 @@ 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)
{
@ -1461,7 +1461,7 @@ hawk_oow_t hawk_int_to_oocstr (hawk_int_t value, int radix, const hawk_ooch_t* p
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');
if (size > prefix_len+1) buf[prefix_len+1] = '\0';
return prefix_len+1;
}
@ -1477,7 +1477,7 @@ hawk_oow_t hawk_int_to_oocstr (hawk_int_t value, int radix, const hawk_ooch_t* p
}
if (size < len) return (hawk_oow_t)-1; /* buffer too small */
if (size > len) buf[len] = HAWK_T('\0');
if (size > len) buf[len] = '\0';
ret = len;
t = value;
@ -1487,9 +1487,9 @@ hawk_oow_t hawk_int_to_oocstr (hawk_int_t value, int radix, const hawk_ooch_t* p
{
rem = t % radix;
if (rem >= 10)
buf[--len] = (hawk_ooch_t)rem + HAWK_T('a') - 10;
buf[--len] = (hawk_ooch_t)rem + 'a' - 10;
else
buf[--len] = (hawk_ooch_t)rem + HAWK_T('0');
buf[--len] = (hawk_ooch_t)rem + '0';
t /= radix;
}
@ -1500,7 +1500,7 @@ hawk_oow_t hawk_int_to_oocstr (hawk_int_t value, int radix, const hawk_ooch_t* p
buf[i] = prefix[i-1];
len--;
}
buf[--len] = HAWK_T('-');
buf[--len] = '-';
}
else
{
@ -1510,7 +1510,708 @@ hawk_oow_t hawk_int_to_oocstr (hawk_int_t value, int radix, const hawk_ooch_t* p
return ret;
}
/* ----------------------------------------------------------------------- */
/* ------------------------------------------------------------------------ */
hawk_int_t hawk_uchars_to_int (const hawk_uch_t* str, hawk_oow_t len, int base, const hawk_uch_t** endptr, int stripspc)
{
hawk_int_t n = 0;
const hawk_uch_t* p;
const hawk_uch_t* end;
hawk_oow_t rem;
int digit, negative = 0;
p = str;
end = str + len;
if (stripspc)
{
/* strip off leading spaces */
while (p < end && hawk_is_uch_space(*p)) p++;
}
/* check for a sign */
while (p < end)
{
if (*p == '-')
{
negative = ~negative;
p++;
}
else if (*p == '+') p++;
else break;
}
/* check for a binary/octal/hexadecimal notation */
rem = end - p;
if (base == 0)
{
if (rem >= 1 && *p == '0')
{
p++;
if (rem == 1) base = 8;
else if (*p == 'x' || *p == 'X')
{
p++; base = 16;
}
else if (*p == 'b' || *p == 'B')
{
p++; base = 2;
}
else base = 8;
}
else base = 10;
}
else if (rem >= 2 && base == 16)
{
if (*p == '0' &&
(*(p + 1) == 'x' || *(p + 1) == 'X')) p += 2;
}
else if (rem >= 2 && base == 2)
{
if (*p == '0' &&
(*(p + 1) == 'b' || *(p + 1) == 'B')) p += 2;
}
/* process the digits */
while (p < end)
{
if (*p >= '0' && *p <= '9')
digit = *p - '0';
else if (*p >= 'A' && *p <= 'Z')
digit = *p - 'A' + 10;
else if (*p >= 'a' && *p <= 'z')
digit = *p - 'a' + 10;
else break;
if (digit >= base) break;
n = n * base + digit;
p++;
}
if (endptr) *endptr = p;
return (negative)? -n: n;
}
hawk_int_t hawk_bchars_to_int (const hawk_bch_t* str, hawk_oow_t len, int base, const hawk_bch_t** endptr, int stripspc)
{
hawk_int_t n = 0;
const hawk_bch_t* p;
const hawk_bch_t* end;
hawk_oow_t rem;
int digit, negative = 0;
p = str;
end = str + len;
if (stripspc)
{
/* strip off leading spaces */
while (p < end && hawk_is_bch_space(*p)) p++;
}
/* check for a sign */
while (p < end)
{
if (*p == '-')
{
negative = ~negative;
p++;
}
else if (*p == '+') p++;
else break;
}
/* check for a binary/octal/hexadecimal notation */
rem = end - p;
if (base == 0)
{
if (rem >= 1 && *p == '0')
{
p++;
if (rem == 1) base = 8;
else if (*p == 'x' || *p == 'X')
{
p++; base = 16;
}
else if (*p == 'b' || *p == 'B')
{
p++; base = 2;
}
else base = 8;
}
else base = 10;
}
else if (rem >= 2 && base == 16)
{
if (*p == '0' &&
(*(p + 1) == 'x' || *(p + 1) == 'X')) p += 2;
}
else if (rem >= 2 && base == 2)
{
if (*p == '0' &&
(*(p + 1) == 'b' || *(p + 1) == 'B')) p += 2;
}
/* process the digits */
while (p < end)
{
if (*p >= '0' && *p <= '9')
digit = *p - '0';
else if (*p >= 'A' && *p <= 'Z')
digit = *p - 'A' + 10;
else if (*p >= 'a' && *p <= 'z')
digit = *p - 'a' + 10;
else break;
if (digit >= base) break;
n = n * base + digit;
p++;
}
if (endptr) *endptr = p;
return (negative)? -n: n;
}
/*
* hawk_uchars_to_flt/hawk_bchars_to_flt 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 FLT_MAX_EXPONENT 511
hawk_flt_t hawk_uchars_to_flt (const hawk_uch_t* str, hawk_oow_t len, const hawk_uch_t** endptr, int stripspc)
{
/*
* 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 hawk_uch_t* p, * end;
hawk_uci_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 hawk_uch_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++;*/
if (stripspc)
{
/* strip off leading spaces */
while (p < end && hawk_is_uch_space(*p)) p++;
}
/*while (*p != _T('\0')) */
while (p < end)
{
if (*p == '-')
{
negative = ~negative;
p++;
}
else if (*p == '+') 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 (!hawk_is_uch_digit(c))
{
if (c != '.' || 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 == '.')
{
c = *p;
p++;
}
frac1 = 10 * frac1 + (c - '0');
}
frac2 = 0;
for (; mant_size > 0; mant_size--)
{
c = *p++;
if (c == '.')
{
c = *p;
p++;
}
frac2 = 10 * frac2 + (c - '0');
}
fraction = (1.0e9 * frac1) + frac2;
}
/* Skim off the exponent */
p = pexp;
if (p < end && (*p == 'E' || *p == 'e'))
{
p++;
if (p < end)
{
if (*p == '-')
{
exp_negative = 1;
p++;
}
else
{
if (*p == '+') p++;
exp_negative = 0;
}
}
else exp_negative = 0;
if (!(p < end && hawk_is_uch_digit(*p)))
{
/*p = pexp;*/
/*goto done;*/
goto no_exp;
}
while (p < end && hawk_is_uch_digit(*p))
{
exp = exp * 10 + (*p - '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 > FLT_MAX_EXPONENT) exp = FLT_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;
}
hawk_flt_t hawk_bchars_to_flt (const hawk_bch_t* str, hawk_oow_t len, const hawk_bch_t** endptr, int stripspc)
{
/*
* 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 hawk_bch_t* p, * end;
hawk_bci_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 hawk_bch_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++;*/
if (stripspc)
{
/* strip off leading spaces */
while (p < end && hawk_is_bch_space(*p)) p++;
}
/*while (*p != _T('\0')) */
while (p < end)
{
if (*p == '-')
{
negative = ~negative;
p++;
}
else if (*p == '+') 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 (!hawk_is_bch_digit(c))
{
if (c != '.' || 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 == '.')
{
c = *p;
p++;
}
frac1 = 10 * frac1 + (c - '0');
}
frac2 = 0;
for (; mant_size > 0; mant_size--)
{
c = *p++;
if (c == '.')
{
c = *p;
p++;
}
frac2 = 10 * frac2 + (c - '0');
}
fraction = (1.0e9 * frac1) + frac2;
}
/* Skim off the exponent */
p = pexp;
if (p < end && (*p == 'E' || *p == 'e'))
{
p++;
if (p < end)
{
if (*p == '-')
{
exp_negative = 1;
p++;
}
else
{
if (*p == '+') p++;
exp_negative = 0;
}
}
else exp_negative = 0;
if (!(p < end && hawk_is_bch_digit(*p)))
{
/*p = pexp;*/
/*goto done;*/
goto no_exp;
}
while (p < end && hawk_is_bch_digit(*p))
{
exp = exp * 10 + (*p - '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 > FLT_MAX_EXPONENT) exp = FLT_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;
}
int hawk_uchars_to_num (int option, const hawk_uch_t* ptr, hawk_oow_t len, hawk_int_t* l, hawk_flt_t* r)
{
const hawk_uch_t* endptr;
const hawk_uch_t* end;
int strict = HAWK_OOCHARS_TO_NUM_GET_OPTION_STRICT(option);
int stripspc = HAWK_OOCHARS_TO_NUM_GET_OPTION_STRIPSPC(option);
int base = HAWK_OOCHARS_TO_NUM_GET_OPTION_BASE(option);
end = ptr + len;
*l = hawk_uchars_to_int(ptr, len, base, &endptr, stripspc);
if (endptr < end)
{
if (*endptr == '.' || *endptr == 'E' || *endptr == 'e')
{
handle_float:
*r = hawk_uchars_to_flt(ptr, len, &endptr, stripspc);
if (strict && endptr < end) return -1;
return 1; /* flt */
}
else if (hawk_is_uch_digit(*endptr))
{
const hawk_uch_t* p = endptr;
do { p++; } while (p < end && hawk_is_uch_digit(*p));
if (p < end && (*p == '.' || *p == 'E' || *p == '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 */
}
int hawk_bchars_to_num (int option, const hawk_bch_t* ptr, hawk_oow_t len, hawk_int_t* l, hawk_flt_t* r)
{
const hawk_bch_t* endptr;
const hawk_bch_t* end;
int strict = HAWK_OOCHARS_TO_NUM_GET_OPTION_STRICT(option);
int stripspc = HAWK_OOCHARS_TO_NUM_GET_OPTION_STRIPSPC(option);
int base = HAWK_OOCHARS_TO_NUM_GET_OPTION_BASE(option);
end = ptr + len;
*l = hawk_bchars_to_int(ptr, len, base, &endptr, stripspc);
if (endptr < end)
{
if (*endptr == '.' || *endptr == 'E' || *endptr == 'e')
{
handle_float:
*r = hawk_bchars_to_flt(ptr, len, &endptr, stripspc);
if (strict && endptr < end) return -1;
return 1; /* flt */
}
else if (hawk_is_uch_digit(*endptr))
{
const hawk_bch_t* p = endptr;
do { p++; } while (p < end && hawk_is_bch_digit(*p));
if (p < end && (*p == '.' || *p == 'E' || *p == '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 */
}
/* ------------------------------------------------------------------------ */
int hawk_conv_bchars_to_uchars_with_cmgr (
const hawk_bch_t* bcs, hawk_oow_t* bcslen,
@ -1864,7 +2565,7 @@ int hawk_conv_bchars_to_uchars_upto_stopper_with_cmgr (
return ret;
}
/* ----------------------------------------------------------------------- */
/* ------------------------------------------------------------------------ */
static hawk_cmgr_t builtin_cmgr[] =
{
@ -1927,7 +2628,7 @@ hawk_cmgr_t* hawk_get_cmgr_by_ucstr (const hawk_uch_t* name)
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)
{
@ -1953,7 +2654,7 @@ int hawk_conv_ucstr_to_utf8 (const hawk_uch_t* ucs, hawk_oow_t* ucslen, hawk_bch
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)
{
@ -1979,7 +2680,7 @@ int hawk_conv_ucstr_to_utf16 (const hawk_uch_t* ucs, hawk_oow_t* ucslen, hawk_bc
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)
{
@ -2005,4 +2706,4 @@ int hawk_conv_ucstr_to_mb8 (const hawk_uch_t* ucs, hawk_oow_t* ucslen, hawk_bch_
return hawk_conv_ucstr_to_bcstr_with_cmgr(ucs, ucslen, bcs, bcslen, &builtin_cmgr[HAWK_CMGR_MB8]);
}
/* ----------------------------------------------------------------------- */
/* ------------------------------------------------------------------------ */

View File

@ -1,76 +0,0 @@
/*
* $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(hawk_rtx_gethawk(rtx), ptr, len, base, &endptr);
if (endptr < end)
{
if (*endptr == _T('.') || *endptr == _T('E') || *endptr == _T('e'))
{
handle_float:
*r = awk_strxtoflt(hawk_rtx_gethawk(rtx), 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 */
}

View File

@ -302,12 +302,13 @@ hawk_val_t* hawk_rtx_makestrvalwithbchars2 (hawk_rtx_t* rtx, const hawk_bch_t* b
hawk_val_t* hawk_rtx_makenstrvalwithuchars (hawk_rtx_t* rtx, const hawk_uch_t* ptr, hawk_oow_t len)
{
hawk_t* hawk = hawk_rtx_gethawk(rtx);
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);
x = hawk_uchars_to_num(HAWK_OOCHARS_TO_NUM_MAKE_OPTION(1, (hawk->opt.trait & HAWK_STRIPSTRSPC), 0), ptr, len, &l, &r);
v = hawk_rtx_makestrvalwithuchars(rtx, ptr, len);
if (!v) return HAWK_NULL;
@ -316,7 +317,7 @@ hawk_val_t* hawk_rtx_makenstrvalwithuchars (hawk_rtx_t* rtx, const hawk_uch_t* p
{
/* set the numeric string flag if a string
* can be converted to a number */
HAWK_ASSERT (hawk_rtx_gethawk(rtx), x == 0 || x == 1);
HAWK_ASSERT (hawk, x == 0 || x == 1);
v->nstr = x + 1; /* long -> 1, real -> 2 */
}
@ -326,12 +327,13 @@ hawk_val_t* hawk_rtx_makenstrvalwithuchars (hawk_rtx_t* rtx, const hawk_uch_t* p
hawk_val_t* hawk_rtx_makenstrvalwithbchars (hawk_rtx_t* rtx, const hawk_bch_t* ptr, hawk_oow_t len)
{
hawk_t* hawk = hawk_rtx_gethawk(rtx);
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);
x = hawk_bchars_to_num(HAWK_OOCHARS_TO_NUM_MAKE_OPTION(1, (hawk->opt.trait & HAWK_STRIPSTRSPC), 0), ptr, len, &l, &r);
v = hawk_rtx_makestrvalwithbchars(rtx, ptr, len);
if (!v) return HAWK_NULL;
@ -340,7 +342,7 @@ hawk_val_t* hawk_rtx_makenstrvalwithbchars (hawk_rtx_t* rtx, const hawk_bch_t* p
{
/* set the numeric string flag if a string
* can be converted to a number */
HAWK_ASSERT (hawk_rtx_gethawk(rtx), x == 0 || x == 1);
HAWK_ASSERT (hawk, x == 0 || x == 1);
v->nstr = x + 1; /* long -> 1, real -> 2 */
}
@ -1226,17 +1228,12 @@ static int val_flt_to_str (hawk_rtx_t* rtx, const hawk_val_flt_t* v, hawk_rtx_va
tmp_len = rtx->gbl.convfmt.len;
}
if (hawk_ooecs_init(&buf, hawk_rtx_gethawk(rtx), 256) <= -1)
{
hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL);
return -1;
}
if (hawk_ooecs_init(&buf, hawk_rtx_getgem(rtx), 256) <= -1) return -1;
buf_inited = 1;
if (hawk_ooecs_init(&fbu, hawk_rtx_gethawk(rtx), 256) <= -1)
if (hawk_ooecs_init(&fbu, hawk_rtx_getgem(rtx), 256) <= -1)
{
hawk_ooecs_fini (&buf);
hawk_rtx_seterrnum (rtx, HAWK_ENOMEM, HAWK_NULL);
return -1;
}
fbu_inited = 1;
@ -1614,6 +1611,8 @@ void hawk_rtx_freevalbcstr (hawk_rtx_t* rtx, const hawk_val_t* v, hawk_bch_t* st
static int val_ref_to_num (hawk_rtx_t* rtx, const hawk_val_ref_t* ref, hawk_int_t* l, hawk_flt_t* r)
{
hawk_t* hawk = hawk_rtx_gethawk(rtx);
switch (ref->id)
{
case HAWK_VAL_REF_POS:
@ -1623,9 +1622,8 @@ static int val_ref_to_num (hawk_rtx_t* rtx, const hawk_val_ref_t* ref, hawk_int_
idx = (hawk_oow_t)ref->adr;
if (idx == 0)
{
return hawk_rtx_oocharstonum(
rtx,
HAWK_RTX_OOCSTRTONUM_MAKE_OPTION(0, 0),
return hawk_oochars_to_num(
HAWK_OOCHARS_TO_NUM_MAKE_OPTION(0, (hawk->opt.trait & HAWK_STRIPSTRSPC), 0),
HAWK_OOECS_PTR(&rtx->inrec.line),
HAWK_OOECS_LEN(&rtx->inrec.line),
l, r
@ -1633,9 +1631,8 @@ static int val_ref_to_num (hawk_rtx_t* rtx, const hawk_val_ref_t* ref, hawk_int_
}
else if (idx <= rtx->inrec.nflds)
{
return hawk_rtx_oocharstonum(
rtx,
HAWK_RTX_OOCSTRTONUM_MAKE_OPTION(0, 0),
return hawk_oochars_to_num(
HAWK_OOCHARS_TO_NUM_MAKE_OPTION(0, (hawk->opt.trait & HAWK_STRIPSTRSPC), 0),
rtx->inrec.flds[idx-1].ptr,
rtx->inrec.flds[idx-1].len,
l, r
@ -1643,16 +1640,14 @@ static int val_ref_to_num (hawk_rtx_t* rtx, const hawk_val_ref_t* ref, hawk_int_
}
else
{
return hawk_rtx_oocharstonum(
rtx, HAWK_RTX_OOCSTRTONUM_MAKE_OPTION(0, 0), HAWK_T(""), 0, l, r
);
return hawk_oochars_to_num(HAWK_OOCHARS_TO_NUM_MAKE_OPTION(0, (hawk->opt.trait & HAWK_STRIPSTRSPC), 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);
return hawk_rtx_valtonum(rtx, RTX_STACK_GBL (rtx, idx), l, r);
}
default:
@ -1662,7 +1657,7 @@ static int val_ref_to_num (hawk_rtx_t* rtx, const hawk_val_ref_t* ref, hawk_int_
/* A reference value is not able to point to another
* refernce value for the way values are represented
* in HAWKAWK */
HAWK_ASSERT (hawk_rtx_gethawk(rtx), HAWK_RTX_GETVALTYPE(rtx, *xref) != HAWK_VAL_REF);
HAWK_ASSERT (hawk, HAWK_RTX_GETVALTYPE(rtx, *xref) != HAWK_VAL_REF);
/* make a recursive call back to the caller */
return hawk_rtx_valtonum(rtx, *xref, l, r);
@ -1674,6 +1669,7 @@ static int val_ref_to_num (hawk_rtx_t* rtx, const hawk_val_ref_t* ref, hawk_int_
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);
hawk_t* hawk = hawk_rtx_gethawk(rtx);
switch (vtype)
{
@ -1685,7 +1681,7 @@ int hawk_rtx_valtonum (hawk_rtx_t* rtx, const hawk_val_t* v, hawk_int_t* l, hawk
case HAWK_VAL_INT:
{
*l = HAWK_RTX_GETINTFROMVAL (rtx, v);
*l = HAWK_RTX_GETINTFROMVAL(rtx, v);
return 0; /* long */
}
@ -1697,9 +1693,8 @@ int hawk_rtx_valtonum (hawk_rtx_t* rtx, const hawk_val_t* v, hawk_int_t* l, hawk
case HAWK_VAL_STR:
{
return hawk_rtx_oocharstonum(
rtx,
HAWK_RTX_OOCSTRTONUM_MAKE_OPTION(0, 0),
return hawk_oochars_to_num(
HAWK_OOCHARS_TO_NUM_MAKE_OPTION(0, (hawk->opt.trait & HAWK_STRIPSTRSPC), 0),
((hawk_val_str_t*)v)->val.ptr,
((hawk_val_str_t*)v)->val.len,
l, r
@ -1708,9 +1703,8 @@ int hawk_rtx_valtonum (hawk_rtx_t* rtx, const hawk_val_t* v, hawk_int_t* l, hawk
case HAWK_VAL_MBS:
{
return hawk_rtx_bcharstonum(
rtx,
HAWK_RTX_OOCSTRTONUM_MAKE_OPTION(0, 0),
return hawk_bchars_to_num(
HAWK_OOCHARS_TO_NUM_MAKE_OPTION(0, (hawk->opt.trait & HAWK_STRIPSTRSPC), 0),
((hawk_val_mbs_t*)v)->val.ptr,
((hawk_val_mbs_t*)v)->val.len,
l, r
@ -1740,7 +1734,7 @@ int hawk_rtx_valtonum (hawk_rtx_t* rtx, const hawk_val_t* v, hawk_int_t* l, hawk
}
#if defined(DEBUG_VAL)
hawk_logfmt (hawk_rtx_gethawk(rtx), HAWK_T(">>WRONG VALUE TYPE [%d] in hawk_rtx_valtonum()\n"), v->type);
hawk_logfmt (hawk, HAWK_T(">>WRONG VALUE TYPE [%d] in hawk_rtx_valtonum()\n"), v->type);
#endif
hawk_rtx_seterrnum (rtx, HAWK_EVALTONUM, HAWK_NULL);
@ -1774,45 +1768,6 @@ int hawk_rtx_valtoflt (hawk_rtx_t* rtx, const hawk_val_t* v, hawk_flt_t* r)
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)

33
hawk/m4/libtool.m4 vendored
View File

@ -728,7 +728,6 @@ _LT_CONFIG_SAVE_COMMANDS([
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.
@ -2867,9 +2866,6 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
# 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
@ -2878,7 +2874,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
# 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"
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
@ -2890,6 +2886,18 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
dynamic_linker='GNU/Linux ld.so'
;;
netbsdelf*-gnu)
version_type=linux
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='NetBSD ld.elf_so'
;;
netbsd*)
version_type=sunos
need_lib_prefix=no
@ -3549,7 +3557,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;
netbsd*)
netbsd* | netbsdelf*-gnu)
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
@ -4427,7 +4435,7 @@ m4_if([$1], [CXX], [
;;
esac
;;
netbsd*)
netbsd* | netbsdelf*-gnu)
;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
@ -4939,6 +4947,9 @@ m4_if([$1], [CXX], [
;;
esac
;;
linux* | k*bsd*-gnu | gnu*)
_LT_TAGVAR(link_all_deplibs, $1)=no
;;
*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
@ -5001,6 +5012,9 @@ dnl Note also adjust exclude_expsyms for C++ above.
openbsd* | bitrig*)
with_gnu_ld=no
;;
linux* | k*bsd*-gnu | gnu*)
_LT_TAGVAR(link_all_deplibs, $1)=no
;;
esac
_LT_TAGVAR(ld_shlibs, $1)=yes
@ -5255,7 +5269,7 @@ _LT_EOF
fi
;;
netbsd*)
netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
@ -5776,6 +5790,7 @@ _LT_EOF
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
_LT_TAGVAR(link_all_deplibs, $1)=no
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'
@ -5797,7 +5812,7 @@ _LT_EOF
esac
;;
netbsd*)
netbsd* | netbsdelf*-gnu)
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

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -183,9 +183,7 @@ 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__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@ -379,6 +377,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@ -452,8 +451,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*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);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -523,14 +522,8 @@ mostlyclean-compile:
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)
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_mysql_la-mod-mysql.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_uci_la-mod-uci.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@ -628,10 +621,7 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@ -704,8 +694,7 @@ 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 -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@ -751,8 +740,7 @@ 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 -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@ -773,8 +761,8 @@ 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 \
.PHONY: CTAGS GTAGS TAGS all all-am 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 \

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -134,9 +134,7 @@ 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__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@ -329,6 +327,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@ -384,8 +383,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*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);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -464,15 +463,9 @@ mostlyclean-compile:
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)
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-001.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-002.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-005.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@ -556,10 +549,7 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@ -631,9 +621,7 @@ 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 -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@ -679,9 +667,7 @@ 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 -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@ -702,7 +688,7 @@ uninstall-am: uninstall-binPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
.PHONY: CTAGS GTAGS TAGS all all-am 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 \

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -136,9 +136,7 @@ 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__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@ -331,6 +329,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@ -382,8 +381,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*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);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@ -458,14 +457,8 @@ mostlyclean-compile:
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)
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uni_case-uni-case.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uni_prop-uni-prop.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@ -577,10 +570,7 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@ -652,8 +642,7 @@ 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 -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@ -699,8 +688,7 @@ 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 -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@ -721,7 +709,7 @@ uninstall-am: uninstall-binPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
.PHONY: CTAGS GTAGS TAGS all all-am 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 \