raised the version to 0.9.7.
All checks were successful
continuous-integration/drone/push Build is passing

added Hawk::Value::getTypeName().
fixed some build issues
This commit is contained in:
hyung-hwan 2024-04-16 12:05:50 +09:00
parent 0b9d05e5c3
commit 0407dd648c
14 changed files with 53 additions and 42 deletions

View File

@ -93,7 +93,7 @@ subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \
$(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
$(top_srcdir)/m4/ax_cxx_namespace.m4 \ $(top_srcdir)/m4/ax_cxx_namespaces.m4 \
$(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/ax_numval.m4 \ $(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/ax_numval.m4 \
$(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \
$(top_srcdir)/m4/hawk_try_cflags.m4 \ $(top_srcdir)/m4/hawk_try_cflags.m4 \
@ -168,7 +168,7 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/ac/ar-lib \
$(top_srcdir)/ac/ltmain.sh $(top_srcdir)/ac/missing \ $(top_srcdir)/ac/ltmain.sh $(top_srcdir)/ac/missing \
$(top_srcdir)/ac/tap-driver.sh $(top_srcdir)/pkgs/hawk.spec.in \ $(top_srcdir)/ac/tap-driver.sh $(top_srcdir)/pkgs/hawk.spec.in \
README.md ac/ar-lib ac/compile ac/config.guess ac/config.sub \ README.md ac/ar-lib ac/compile ac/config.guess ac/config.sub \
ac/depcomp ac/install-sh ac/ltmain.sh ac/missing ac/install-sh ac/ltmain.sh ac/missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION) distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir) top_distdir = $(distdir)

2
aclocal.m4 vendored
View File

@ -1210,7 +1210,7 @@ AC_SUBST([am__untar])
m4_include([m4/ax_check_sign.m4]) m4_include([m4/ax_check_sign.m4])
m4_include([m4/ax_cxx_compile_stdcxx.m4]) m4_include([m4/ax_cxx_compile_stdcxx.m4])
m4_include([m4/ax_cxx_namespace.m4]) m4_include([m4/ax_cxx_namespaces.m4])
m4_include([m4/ax_lib_mysql.m4]) m4_include([m4/ax_lib_mysql.m4])
m4_include([m4/ax_numval.m4]) m4_include([m4/ax_numval.m4])
m4_include([m4/ax_pthread.m4]) m4_include([m4/ax_pthread.m4])

View File

@ -93,7 +93,7 @@ subdir = bin
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \
$(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
$(top_srcdir)/m4/ax_cxx_namespace.m4 \ $(top_srcdir)/m4/ax_cxx_namespaces.m4 \
$(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/ax_numval.m4 \ $(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/ax_numval.m4 \
$(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \
$(top_srcdir)/m4/hawk_try_cflags.m4 \ $(top_srcdir)/m4/hawk_try_cflags.m4 \

24
configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for hawk 0.9.6. # Generated by GNU Autoconf 2.71 for hawk 0.9.7.
# #
# Report bugs to <Chung, Hyung-Hwan (hyunghwan.chung@gmail.com)>. # Report bugs to <Chung, Hyung-Hwan (hyunghwan.chung@gmail.com)>.
# #
@ -621,8 +621,8 @@ MAKEFLAGS=
# Identity of this package. # Identity of this package.
PACKAGE_NAME='hawk' PACKAGE_NAME='hawk'
PACKAGE_TARNAME='hawk' PACKAGE_TARNAME='hawk'
PACKAGE_VERSION='0.9.6' PACKAGE_VERSION='0.9.7'
PACKAGE_STRING='hawk 0.9.6' PACKAGE_STRING='hawk 0.9.7'
PACKAGE_BUGREPORT='Chung, Hyung-Hwan (hyunghwan.chung@gmail.com)' PACKAGE_BUGREPORT='Chung, Hyung-Hwan (hyunghwan.chung@gmail.com)'
PACKAGE_URL='https://code.miflux.net/hyung-hwan/hawk' PACKAGE_URL='https://code.miflux.net/hyung-hwan/hawk'
@ -1431,7 +1431,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures hawk 0.9.6 to adapt to many kinds of systems. \`configure' configures hawk 0.9.7 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1502,7 +1502,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of hawk 0.9.6:";; short | recursive ) echo "Configuration of hawk 0.9.7:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
@ -1641,7 +1641,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
hawk configure 0.9.6 hawk configure 0.9.7
generated by GNU Autoconf 2.71 generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc. Copyright (C) 2021 Free Software Foundation, Inc.
@ -2370,7 +2370,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by hawk $as_me 0.9.6, which was It was created by hawk $as_me 0.9.7, which was
generated by GNU Autoconf 2.71. Invocation command line was generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw $ $0$ac_configure_args_raw
@ -3868,7 +3868,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE='hawk' PACKAGE='hawk'
VERSION='0.9.6' VERSION='0.9.7'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@ -25790,7 +25790,7 @@ else $as_nop
fi fi
test "${HAVE_CXX}" = "yes" || enable_cxx_is="no" test "${HAVE_CXX}" = "yes" || enable_cxx_is="no"
test "${ax_cv_cxx_have_std_namespace}" = "yes" || enable_cxx_is="no" test "${ax_cv_cxx_namespaces}" = "yes" || enable_cxx_is="no"
if test "${enable_cxx_is}" = "yes" ; then if test "${enable_cxx_is}" = "yes" ; then
ENABLE_CXX_TRUE= ENABLE_CXX_TRUE=
@ -25966,7 +25966,7 @@ fi
if test "x${enable_mod_mysql_is}" = "xauto" || test "x${enable_mod_mysql_is}" = "xyes" if test "x${enable_mod_mysql_is}" = "xauto" || test "x${enable_mod_mysql_is}" = "xyes"
then then
if ! test ${with_mysql+y} if test ${with_mysql+y}
then then
## as if --with-mysql is specified for AX_LIB_MYSQL below ## as if --with-mysql is specified for AX_LIB_MYSQL below
with_mysql=yes with_mysql=yes
@ -26939,7 +26939,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by hawk $as_me 0.9.6, which was This file was extended by hawk $as_me 0.9.7, which was
generated by GNU Autoconf 2.71. Invocation command line was generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
@ -27008,7 +27008,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped' ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\ ac_cs_version="\\
hawk config.status 0.9.6 hawk config.status 0.9.7
configured by $0, generated by GNU Autoconf 2.71, configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\" with options \\"\$ac_cs_config\\"

View File

@ -1,6 +1,6 @@
dnl AC_PREREQ([2.71]) dnl AC_PREREQ([2.71])
AC_INIT([hawk],[0.9.6],[Chung, Hyung-Hwan (hyunghwan.chung@gmail.com)],[],[https://code.miflux.net/hyung-hwan/hawk]) AC_INIT([hawk],[0.9.7],[Chung, Hyung-Hwan (hyunghwan.chung@gmail.com)],[],[https://code.miflux.net/hyung-hwan/hawk])
AC_CONFIG_HEADERS([lib/hawk-cfg.h]) AC_CONFIG_HEADERS([lib/hawk-cfg.h])
AC_CONFIG_AUX_DIR([ac]) AC_CONFIG_AUX_DIR([ac])
@ -889,7 +889,7 @@ AC_ARG_ENABLE([cxx],
dnl disable c++ if no c++ compiler was found dnl disable c++ if no c++ compiler was found
test "${HAVE_CXX}" = "yes" || enable_cxx_is="no" test "${HAVE_CXX}" = "yes" || enable_cxx_is="no"
dnl disable c++ if the compiler is too old. dnl disable c++ if the compiler is too old.
test "${ax_cv_cxx_have_std_namespace}" = "yes" || enable_cxx_is="no" test "${ax_cv_cxx_namespaces}" = "yes" || enable_cxx_is="no"
AM_CONDITIONAL(ENABLE_CXX, test "${enable_cxx_is}" = "yes" ) AM_CONDITIONAL(ENABLE_CXX, test "${enable_cxx_is}" = "yes" )

View File

@ -1046,6 +1046,7 @@ public:
} }
int getType () const { return hawk_get_val_type(this->val); } int getType () const { return hawk_get_val_type(this->val); }
const hawk_ooch_t* getTypeName () const { return hawk_get_val_type_name(this->val); }
int getInt (hawk_int_t* v) const; int getInt (hawk_int_t* v) const;
int getFlt (hawk_flt_t* v) const; int getFlt (hawk_flt_t* v) const;

View File

@ -120,7 +120,7 @@ subdir = lib
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \
$(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
$(top_srcdir)/m4/ax_cxx_namespace.m4 \ $(top_srcdir)/m4/ax_cxx_namespaces.m4 \
$(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/ax_numval.m4 \ $(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/ax_numval.m4 \
$(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \
$(top_srcdir)/m4/hawk_try_cflags.m4 \ $(top_srcdir)/m4/hawk_try_cflags.m4 \

View File

@ -3663,6 +3663,10 @@ HAWK_EXPORT int hawk_get_val_type (
hawk_val_t* val hawk_val_t* val
); );
HAWK_EXPORT const hawk_ooch_t* hawk_get_val_type_name (
hawk_val_t* val
);
#if defined(__cplusplus) #if defined(__cplusplus)
} }
#endif #endif

View File

@ -27,13 +27,32 @@
#define CHUNKSIZE HAWK_VAL_CHUNK_SIZE #define CHUNKSIZE HAWK_VAL_CHUNK_SIZE
static hawk_val_nil_t hawk_nil = { HAWK_VAL_NIL, 0, 1, 0, 0 }; static hawk_val_nil_t hawk_nil = { HAWK_VAL_NIL, 0, 1, 0, 0 };
/* zero-length string */
static hawk_val_str_t hawk_zls = { HAWK_VAL_STR, 0, 1, 0, 0, { HAWK_T(""), 0 } }; static hawk_val_str_t hawk_zls = { HAWK_VAL_STR, 0, 1, 0, 0, { HAWK_T(""), 0 } };
/* zero-length byte string */
static hawk_val_mbs_t hawk_zlbs = { HAWK_VAL_MBS, 0, 1, 0, 0, { HAWK_BT(""), 0 } }; static hawk_val_mbs_t hawk_zlbs = { HAWK_VAL_MBS, 0, 1, 0, 0, { HAWK_BT(""), 0 } };
hawk_val_t* hawk_val_nil = (hawk_val_t*)&hawk_nil; hawk_val_t* hawk_val_nil = (hawk_val_t*)&hawk_nil;
hawk_val_t* hawk_val_zls = (hawk_val_t*)&hawk_zls; hawk_val_t* hawk_val_zls = (hawk_val_t*)&hawk_zls;
hawk_val_t* hawk_val_zlbs = (hawk_val_t*)&hawk_zlbs; hawk_val_t* hawk_val_zlbs = (hawk_val_t*)&hawk_zlbs;
static const hawk_ooch_t* val_type_name[] =
{
/* synchronize this table with enum hawk_val_type_t in hawk.h */
HAWK_T("nil"),
HAWK_T("char"),
HAWK_T("bchar"),
HAWK_T("int"),
HAWK_T("flt"),
HAWK_T("str"),
HAWK_T("mbs"),
HAWK_T("fun"),
HAWK_T("map"),
HAWK_T("array"),
HAWK_T("rex"),
HAWK_T("ref")
};
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
@ -472,6 +491,11 @@ int hawk_get_val_type (hawk_val_t* val)
return HAWK_GET_VAL_TYPE(val); return HAWK_GET_VAL_TYPE(val);
} }
const hawk_ooch_t* hawk_get_val_type_name (hawk_val_t* val)
{
return val_type_name[HAWK_GET_VAL_TYPE(val)];
}
hawk_val_t* hawk_get_nil_val (void) hawk_val_t* hawk_get_nil_val (void)
{ {
return (hawk_val_t*)&hawk_nil; return (hawk_val_t*)&hawk_nil;
@ -1431,25 +1455,7 @@ int hawk_rtx_getvaltype (hawk_rtx_t* rtx, const hawk_val_t* val)
const hawk_ooch_t* hawk_rtx_getvaltypename(hawk_rtx_t* rtx, const hawk_val_t* val) const hawk_ooch_t* hawk_rtx_getvaltypename(hawk_rtx_t* rtx, const hawk_val_t* val)
{ {
static const hawk_ooch_t* __val_type_name[] = return val_type_name[HAWK_RTX_GETVALTYPE(rtx, val)];
{
/* synchronize this table with enum hawk_val_type_t in hawk.h */
HAWK_T("nil"),
HAWK_T("char"),
HAWK_T("bchar"),
HAWK_T("int"),
HAWK_T("flt"),
HAWK_T("str"),
HAWK_T("mbs"),
HAWK_T("fun"),
HAWK_T("map"),
HAWK_T("array"),
HAWK_T("rex"),
HAWK_T("ref")
};
return __val_type_name[HAWK_RTX_GETVALTYPE(rtx, val)];
} }
int hawk_rtx_getintfromval (hawk_rtx_t* rtx, const hawk_val_t* val) int hawk_rtx_getintfromval (hawk_rtx_t* rtx, const hawk_val_t* val)

View File

@ -100,7 +100,7 @@ subdir = mod
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \
$(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
$(top_srcdir)/m4/ax_cxx_namespace.m4 \ $(top_srcdir)/m4/ax_cxx_namespaces.m4 \
$(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/ax_numval.m4 \ $(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/ax_numval.m4 \
$(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \
$(top_srcdir)/m4/hawk_try_cflags.m4 \ $(top_srcdir)/m4/hawk_try_cflags.m4 \

View File

@ -94,7 +94,7 @@ subdir = samples
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \
$(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
$(top_srcdir)/m4/ax_cxx_namespace.m4 \ $(top_srcdir)/m4/ax_cxx_namespaces.m4 \
$(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/ax_numval.m4 \ $(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/ax_numval.m4 \
$(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \
$(top_srcdir)/m4/hawk_try_cflags.m4 \ $(top_srcdir)/m4/hawk_try_cflags.m4 \

View File

@ -93,7 +93,7 @@ subdir = t
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \
$(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
$(top_srcdir)/m4/ax_cxx_namespace.m4 \ $(top_srcdir)/m4/ax_cxx_namespaces.m4 \
$(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/ax_numval.m4 \ $(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/ax_numval.m4 \
$(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \
$(top_srcdir)/m4/hawk_try_cflags.m4 \ $(top_srcdir)/m4/hawk_try_cflags.m4 \

View File

@ -93,7 +93,7 @@ subdir = tools
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \
$(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
$(top_srcdir)/m4/ax_cxx_namespace.m4 \ $(top_srcdir)/m4/ax_cxx_namespaces.m4 \
$(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/ax_numval.m4 \ $(top_srcdir)/m4/ax_lib_mysql.m4 $(top_srcdir)/m4/ax_numval.m4 \
$(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \
$(top_srcdir)/m4/hawk_try_cflags.m4 \ $(top_srcdir)/m4/hawk_try_cflags.m4 \