added some builtin modules, but without many functions in them

This commit is contained in:
hyung-hwan 2018-02-15 15:36:15 +00:00
parent 2a0551df2d
commit 270a762e32
20 changed files with 1312 additions and 88 deletions

View File

@ -3,7 +3,14 @@ ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = EXTRA_DIST =
SUBDIRS = lib SUBDIRS =
if ENABLE_STATIC_MODULE
SUBDIRS += mod lib
else
SUBDIRS += lib mod
endif
DIST_SUBDIRS = $(SUBDIRS) DIST_SUBDIRS = $(SUBDIRS)
distclean-local: distclean-local:

View File

@ -87,6 +87,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
build_triplet = @build@ build_triplet = @build@
host_triplet = @host@ host_triplet = @host@
@ENABLE_STATIC_MODULE_TRUE@am__append_1 = mod lib
@ENABLE_STATIC_MODULE_FALSE@am__append_2 = lib mod
subdir = . subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_namespace.m4 \ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_namespace.m4 \
@ -163,8 +165,8 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/ac/ar-lib \
$(top_srcdir)/ac/compile $(top_srcdir)/ac/config.guess \ $(top_srcdir)/ac/compile $(top_srcdir)/ac/config.guess \
$(top_srcdir)/ac/config.sub $(top_srcdir)/ac/install-sh \ $(top_srcdir)/ac/config.sub $(top_srcdir)/ac/install-sh \
$(top_srcdir)/ac/ltmain.sh $(top_srcdir)/ac/missing ac/ar-lib \ $(top_srcdir)/ac/ltmain.sh $(top_srcdir)/ac/missing ac/ar-lib \
ac/compile ac/config.guess ac/config.sub ac/depcomp \ ac/compile ac/config.guess ac/config.sub ac/install-sh \
ac/install-sh ac/ltmain.sh ac/missing 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)
@ -354,7 +356,7 @@ top_srcdir = @top_srcdir@
AUTOMAKE_OPTION = foreign AUTOMAKE_OPTION = foreign
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = EXTRA_DIST =
SUBDIRS = lib SUBDIRS = $(am__append_1) $(am__append_2)
DIST_SUBDIRS = $(SUBDIRS) DIST_SUBDIRS = $(SUBDIRS)
all: all-recursive all: all-recursive

3
configure vendored
View File

@ -19439,7 +19439,7 @@ HCL_PROJECT_AUTHOR="${PACKAGE_BUGREPORT}"
HCL_PROJECT_URL="${PACKAGE_URL}" HCL_PROJECT_URL="${PACKAGE_URL}"
ac_config_files="$ac_config_files Makefile lib/Makefile" ac_config_files="$ac_config_files Makefile lib/Makefile mod/Makefile"
cat >confcache <<\_ACEOF cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure # This file is a shell script that caches the results of configure
@ -20578,6 +20578,7 @@ do
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
"mod/Makefile") CONFIG_FILES="$CONFIG_FILES mod/Makefile" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac esac

View File

@ -465,6 +465,7 @@ AC_SUBST(HCL_PROJECT_URL, "${PACKAGE_URL}")
AC_CONFIG_FILES([ AC_CONFIG_FILES([
Makefile Makefile
lib/Makefile lib/Makefile
mod/Makefile
]) ])
AC_OUTPUT AC_OUTPUT

View File

@ -5,7 +5,12 @@ CPPFLAGS_ALL_COMMON = \
-I$(abs_srcdir) \ -I$(abs_srcdir) \
-I$(includedir) -I$(includedir)
if ENABLE_STATIC_MODULE
LDFLAGS_ALL_COMMON = -L$(abs_builddir)/../mod -L$(abs_builddir) -L$(libdir)
else
LDFLAGS_ALL_COMMON = -L$(abs_builddir) -L$(libdir) LDFLAGS_ALL_COMMON = -L$(abs_builddir) -L$(libdir)
endif
################################################## ##################################################
# MAIN LIBRARY # MAIN LIBRARY
@ -60,13 +65,29 @@ libhcl_la_SOURCES = \
libhcl_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) libhcl_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
libhcl_la_LDFLAGS = $(LDFLAGS_LIB_COMMON) libhcl_la_LDFLAGS = $(LDFLAGS_LIB_COMMON)
libhcl_la_LIBADD = $(LIBADD_LIB_COMMON) libhcl_la_LIBADD = $(LIBADD_LIB_COMMON)
libhcl_la_DEPENDENCIES =
if ENABLE_STATIC_MODULE
libhcl_la_LIBADD += -lhcl-arr
libhcl_la_DEPENDENCIES += $(abs_builddir)/../mod/libhcl-arr.la
libhcl_la_LIBADD += -lhcl-dic
libhcl_la_DEPENDENCIES += $(abs_builddir)/../mod/libhcl-dic.la
libhcl_la_LIBADD += -lhcl-str
libhcl_la_DEPENDENCIES += $(abs_builddir)/../mod/libhcl-str.la
endif
bin_PROGRAMS = hcl bin_PROGRAMS = hcl
hcl_SOURCES = main.c hcl_SOURCES = main.c
hcl_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) hcl_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
hcl_LDFLAGS = $(LDFLAGS_LIB_COMMON) hcl_LDFLAGS = $(LDFLAGS_LIB_COMMON)
hcl_LDADD = $(LIBADD_LIB_COMMON) -lhcl #-ldyncall_s hcl_LDADD = $(LIBADD_LIB_COMMON) -lhcl #-ldyncall_s
if ENABLE_STATIC_MODULE
hcl_DEPENDENCIES = libhcl.la hcl_DEPENDENCIES = libhcl.la
endif
install-data-hook: install-data-hook:

View File

@ -88,7 +88,13 @@ PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
build_triplet = @build@ build_triplet = @build@
host_triplet = @host@ host_triplet = @host@
@ENABLE_STATIC_MODULE_TRUE@am__append_1 = -lhcl-arr -lhcl-dic \
@ENABLE_STATIC_MODULE_TRUE@ -lhcl-str
@ENABLE_STATIC_MODULE_TRUE@am__append_2 = $(abs_builddir)/../mod/libhcl-arr.la \
@ENABLE_STATIC_MODULE_TRUE@ $(abs_builddir)/../mod/libhcl-dic.la \
@ENABLE_STATIC_MODULE_TRUE@ $(abs_builddir)/../mod/libhcl-str.la
bin_PROGRAMS = hcl$(EXEEXT) bin_PROGRAMS = hcl$(EXEEXT)
@ENABLE_STATIC_MODULE_FALSE@hcl_DEPENDENCIES = $(am__DEPENDENCIES_2)
subdir = lib subdir = lib
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_namespace.m4 \ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_namespace.m4 \
@ -136,7 +142,6 @@ am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(bindir)" \
LTLIBRARIES = $(pkglib_LTLIBRARIES) LTLIBRARIES = $(pkglib_LTLIBRARIES)
am__DEPENDENCIES_1 = am__DEPENDENCIES_1 =
am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
libhcl_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
am_libhcl_la_OBJECTS = libhcl_la-bigint.lo libhcl_la-comp.lo \ am_libhcl_la_OBJECTS = libhcl_la-bigint.lo libhcl_la-comp.lo \
libhcl_la-debug.lo libhcl_la-decode.lo libhcl_la-dic.lo \ libhcl_la-debug.lo libhcl_la-decode.lo libhcl_la-dic.lo \
libhcl_la-err.lo libhcl_la-exec.lo libhcl_la-gc.lo \ libhcl_la-err.lo libhcl_la-exec.lo libhcl_la-gc.lo \
@ -376,7 +381,8 @@ CPPFLAGS_ALL_COMMON = \
-I$(abs_srcdir) \ -I$(abs_srcdir) \
-I$(includedir) -I$(includedir)
LDFLAGS_ALL_COMMON = -L$(abs_builddir) -L$(libdir) @ENABLE_STATIC_MODULE_FALSE@LDFLAGS_ALL_COMMON = -L$(abs_builddir) -L$(libdir)
@ENABLE_STATIC_MODULE_TRUE@LDFLAGS_ALL_COMMON = -L$(abs_builddir)/../mod -L$(abs_builddir) -L$(libdir)
################################################## ##################################################
# MAIN LIBRARY # MAIN LIBRARY
@ -424,12 +430,13 @@ libhcl_la_SOURCES = \
libhcl_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) libhcl_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
libhcl_la_LDFLAGS = $(LDFLAGS_LIB_COMMON) libhcl_la_LDFLAGS = $(LDFLAGS_LIB_COMMON)
libhcl_la_LIBADD = $(LIBADD_LIB_COMMON) libhcl_la_LIBADD = $(LIBADD_LIB_COMMON) $(am__append_1)
libhcl_la_DEPENDENCIES = $(am__append_2)
hcl_SOURCES = main.c hcl_SOURCES = main.c
hcl_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) hcl_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
hcl_LDFLAGS = $(LDFLAGS_LIB_COMMON) hcl_LDFLAGS = $(LDFLAGS_LIB_COMMON)
hcl_LDADD = $(LIBADD_LIB_COMMON) -lhcl #-ldyncall_s hcl_LDADD = $(LIBADD_LIB_COMMON) -lhcl #-ldyncall_s
hcl_DEPENDENCIES = libhcl.la @ENABLE_STATIC_MODULE_TRUE@hcl_DEPENDENCIES = libhcl.la
all: hcl-cfg.h all: hcl-cfg.h
$(MAKE) $(AM_MAKEFLAGS) all-am $(MAKE) $(AM_MAKEFLAGS) all-am

View File

@ -281,7 +281,7 @@ int hcl_inttoooi (hcl_t* hcl, hcl_oop_t x, hcl_ooi_t* i)
hcl_oow_t w; hcl_oow_t w;
int n; int n;
n = hcl_inttooow (hcl, x, &w); n = hcl_inttooow(hcl, x, &w);
if (n < 0) if (n < 0)
{ {
HCL_ASSERT (hcl, HCL_TYPE_MAX(hcl_ooi_t) + HCL_TYPE_MIN(hcl_ooi_t) == -1); /* assume 2's complement */ HCL_ASSERT (hcl, HCL_TYPE_MAX(hcl_ooi_t) + HCL_TYPE_MIN(hcl_ooi_t) == -1); /* assume 2's complement */

View File

@ -1378,6 +1378,8 @@ static int compile_cons_xlist_expression (hcl_t* hcl, hcl_oop_t obj)
} }
else else
{ {
hcl_oop_cons_t sdc;
if (HCL_BRANDOF(hcl, cdr) != HCL_BRAND_CONS) if (HCL_BRANDOF(hcl, cdr) != HCL_BRAND_CONS)
{ {
/* (funname . 10) */ /* (funname . 10) */
@ -1388,10 +1390,25 @@ static int compile_cons_xlist_expression (hcl_t* hcl, hcl_oop_t obj)
nargs = hcl_countcons(hcl, cdr); nargs = hcl_countcons(hcl, cdr);
if (nargs > MAX_CODE_PARAM) if (nargs > MAX_CODE_PARAM)
{ {
/* TODO: change to syntax error */
hcl_setsynerrbfmt (hcl, HCL_SYNERR_ARGFLOOD, HCL_NULL, HCL_NULL, "too many(%zd) parameters in function call - %O", nargs, obj); hcl_setsynerrbfmt (hcl, HCL_SYNERR_ARGFLOOD, HCL_NULL, HCL_NULL, "too many(%zd) parameters in function call - %O", nargs, obj);
return -1; return -1;
} }
sdc = hcl_getatsysdic(hcl, car);
if (sdc)
{
hcl_oop_word_t sdv;
sdv = (hcl_oop_word_t)HCL_CONS_CDR(sdc);
if (HCL_IS_PRIM(hcl, sdv))
{
if (nargs < sdv->slot[1] || nargs > sdv->slot[2])
{
hcl_setsynerrbfmt (hcl, HCL_SYNERR_ARGCOUNT, HCL_NULL, HCL_NULL,
"parameters count(%zd) mismatch in function call - %O - expecting %zu-%zu parameters", nargs, obj, sdv->slot[1], sdv->slot[2]);
return -1;
}
}
};
} }
/* redundant cdr check is performed inside compile_object_list() */ /* redundant cdr check is performed inside compile_object_list() */
PUSH_SUBCFRAME (hcl, COP_COMPILE_ARGUMENT_LIST, cdr); PUSH_SUBCFRAME (hcl, COP_COMPILE_ARGUMENT_LIST, cdr);

View File

@ -158,7 +158,7 @@ static HCL_INLINE int prepare_to_alloc_pid (hcl_t* hcl)
#if defined(HCL_DEBUG_VM_PROCESSOR) #if defined(HCL_DEBUG_VM_PROCESSOR)
HCL_LOG0 (hcl, HCL_LOG_IC | HCL_LOG_FATAL, "Processor - too many processes\n"); HCL_LOG0 (hcl, HCL_LOG_IC | HCL_LOG_FATAL, "Processor - too many processes\n");
#endif #endif
hcl_seterrnum (hcl, HCL_EPFULL); hcl_seterrbfmt (hcl, HCL_EPFULL, "maximum number(%zd) of processes reached", HCL_SMOOI_MAX);
return -1; return -1;
} }
@ -227,7 +227,7 @@ static hcl_oop_process_t make_process (hcl_t* hcl, hcl_oop_context_t c)
stksize = HCL_TYPE_MAX(hcl_oow_t) - HCL_PROCESS_NAMED_INSTVARS; stksize = HCL_TYPE_MAX(hcl_oow_t) - HCL_PROCESS_NAMED_INSTVARS;
hcl_pushtmp (hcl, (hcl_oop_t*)&c); hcl_pushtmp (hcl, (hcl_oop_t*)&c);
proc = (hcl_oop_process_t)hcl_allocoopobj (hcl, HCL_BRAND_PROCESS, HCL_PROCESS_NAMED_INSTVARS + stksize); proc = (hcl_oop_process_t)hcl_allocoopobj (hcl, HCL_BRAND_PROCESS, HCL_PROCESS_NAMED_INSTVARS + stksize);
hcl_poptmp (hcl); hcl_poptmp (hcl);
if (!proc) return HCL_NULL; if (!proc) return HCL_NULL;
@ -348,6 +348,7 @@ static HCL_INLINE int chain_into_processor (hcl_t* hcl, hcl_oop_process_t proc,
HCL_LOG0 (hcl, HCL_LOG_IC | HCL_LOG_FATAL, "Processor - too many process\n"); HCL_LOG0 (hcl, HCL_LOG_IC | HCL_LOG_FATAL, "Processor - too many process\n");
#endif #endif
hcl_seterrnum (hcl, HCL_EPFULL); hcl_seterrnum (hcl, HCL_EPFULL);
hcl_seterrbfmt (hcl, HCL_EPFULL, "maximum number(%zd) of processes reached", HCL_SMOOI_MAX);
return -1; return -1;
} }
@ -1878,10 +1879,6 @@ static int execute (hcl_t* hcl)
break; break;
} }
/* TODO:
case HCL_CODE_MAKE_BYTEARRAY:
case HCL_CODE_POP_INTO_BYTEARRAY:
*/
/* -------------------------------------------------------- */ /* -------------------------------------------------------- */
case BCODE_DUP_STACKTOP: case BCODE_DUP_STACKTOP:
@ -2011,16 +2008,13 @@ static int execute (hcl_t* hcl)
case HCL_CODE_RETURN_FROM_BLOCK: case HCL_CODE_RETURN_FROM_BLOCK:
LOG_INST_0 (hcl, "return_from_block"); LOG_INST_0 (hcl, "return_from_block");
/* HCL_ASSERT(hcl, HCL_IS_CONTEXT(hcl, hcl->active_context));
// HCL_ASSERT(HCL_CLASSOF(hcl, hcl->active_context) == hcl->_block_context);
*/
if (hcl->active_context == hcl->processor->active->initial_context) if (hcl->active_context == hcl->processor->active->initial_context)
{ {
/* the active context to return from is an initial context of /* the active context to return from is an initial context of
* the active process. this process must have been created * the active process. this process must have been created
* over a block using the newProcess method. let's terminate * over a block using the newProcess method. let's terminate
* the process. */ * the process. */
HCL_ASSERT (hcl, (hcl_oop_t)hcl->active_context->sender == hcl->_nil); HCL_ASSERT (hcl, (hcl_oop_t)hcl->active_context->sender == hcl->_nil);
terminate_process (hcl, hcl->processor->active); terminate_process (hcl, hcl->processor->active);
} }
@ -2197,7 +2191,7 @@ oops:
/* TODO: anything to do here? */ /* TODO: anything to do here? */
if (hcl->processor->active != hcl->nil_process) if (hcl->processor->active != hcl->nil_process)
{ {
HCL_LOG1 (hcl, HCL_LOG_IC | HCL_LOG_INFO, "TERMINATING ACTIVE PROCESS ... = %zu\n", inst_counter); HCL_LOG1 (hcl, HCL_LOG_IC | HCL_LOG_INFO, "TERMINATING ACTIVE PROCESS ... = %zd\n", HCL_OOP_TO_SMOOI(hcl->processor->active->id));
terminate_process (hcl, hcl->processor->active); terminate_process (hcl, hcl->processor->active);
} }
return -1; return -1;

View File

@ -402,8 +402,6 @@ void hcl_freemem (hcl_t* hcl, void* ptr)
} }
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
#define MOD_PREFIX "hcl_mod_" #define MOD_PREFIX "hcl_mod_"
@ -411,13 +409,9 @@ void hcl_freemem (hcl_t* hcl, void* ptr)
#if defined(HCL_ENABLE_STATIC_MODULE) #if defined(HCL_ENABLE_STATIC_MODULE)
/*#include "../mod/_array.h"*/ #include "../mod/_arr.h"
#include "../mod/_dic.h"
static int hcl_mod_fake (hcl_t* hcl, hcl_mod_t* mod) #include "../mod/_str.h"
{
hcl_seterrbfmt (hcl, HCL_EPERM, "not allowed to load ___fake___ module");
return -1;
}
static struct static struct
{ {
@ -426,7 +420,9 @@ static struct
} }
static_modtab[] = static_modtab[] =
{ {
{ "___fake___", hcl_mod_fake }, { "arr", hcl_mod_arr },
{ "dic", hcl_mod_dic },
{ "str", hcl_mod_str }
}; };
#endif #endif

View File

@ -1250,6 +1250,7 @@ typedef enum hcl_concode_t hcl_concode_t;
#define HCL_IS_PBIGINT(hcl,v) (HCL_OOP_IS_POINTER(v) && HCL_OBJ_GET_FLAGS_BRAND(v) == HCL_BRAND_PBIGINT) #define HCL_IS_PBIGINT(hcl,v) (HCL_OOP_IS_POINTER(v) && HCL_OBJ_GET_FLAGS_BRAND(v) == HCL_BRAND_PBIGINT)
#define HCL_IS_NBIGINT(hcl,v) (HCL_OOP_IS_POINTER(v) && HCL_OBJ_GET_FLAGS_BRAND(v) == HCL_BRAND_NBIGINT) #define HCL_IS_NBIGINT(hcl,v) (HCL_OOP_IS_POINTER(v) && HCL_OBJ_GET_FLAGS_BRAND(v) == HCL_BRAND_NBIGINT)
#define HCL_IS_BIGINT(hcl,v) (HCL_OOP_IS_POINTER(v) && (HCL_OBJ_GET_FLAGS_BRAND(v) == HCL_BRAND_PBIGINT || HCL_OBJ_GET_FLAGS_BRAND(v) == HCL_BRAND_NBIGINT)) #define HCL_IS_BIGINT(hcl,v) (HCL_OOP_IS_POINTER(v) && (HCL_OBJ_GET_FLAGS_BRAND(v) == HCL_BRAND_PBIGINT || HCL_OBJ_GET_FLAGS_BRAND(v) == HCL_BRAND_NBIGINT))
#define HCL_IS_STRING(hcl,v) (HCL_OOP_IS_POINTER(v) && HCL_OBJ_GET_FLAGS_BRAND(v) == HCL_BRAND_STRING)
#define HCL_CONS_CAR(v) (((hcl_cons_t*)(v))->car) #define HCL_CONS_CAR(v) (((hcl_cons_t*)(v))->car)
#define HCL_CONS_CDR(v) (((hcl_cons_t*)(v))->cdr) #define HCL_CONS_CDR(v) (((hcl_cons_t*)(v))->cdr)

View File

@ -98,7 +98,7 @@ start_over:
static hcl_pfrc_t pf_log (hcl_t* hcl, hcl_ooi_t nargs) static hcl_pfrc_t pf_log (hcl_t* hcl, hcl_ooi_t nargs)
{ {
/* TODO: accept log level */ /* TODO: accept log level */
hcl_oop_t msg, level; hcl_oop_t msg;
hcl_oow_t mask; hcl_oow_t mask;
hcl_ooi_t k; hcl_ooi_t k;
@ -421,58 +421,3 @@ int hcl_addbuiltinprims (hcl_t* hcl)
return 0; return 0;
} }
/* ------------------------------------------------------------------------- */
static hcl_pfrc_t pf_hello (hcl_t* hcl, hcl_ooi_t nargs)
{
return pf_log(hcl, nargs);
}
static int walker (hcl_t* hcl, hcl_oop_dic_t dic, hcl_oop_cons_t pair, void* ctx)
{
HCL_DEBUG2 (hcl, "walker ===> %O =====> %O\n", HCL_CONS_CAR(pair), HCL_CONS_CDR(pair));
return 0;
}
static hcl_pfrc_t pf_walk (hcl_t* hcl, hcl_ooi_t nargs)
{
hcl_oop_t arg;
arg = HCL_STACK_GETARG(hcl, nargs, 0);
if (!HCL_IS_DIC(hcl,arg))
{
hcl_seterrbfmt (hcl, HCL_EINVAL, "parameter not a dictionary - %O", arg);
return HCL_PF_FAILURE;
}
hcl_walkdic (hcl, (hcl_oop_dic_t)arg, walker, HCL_NULL);
HCL_STACK_SETRET (hcl, nargs, hcl->_true);
return HCL_PF_SUCCESS;
}
static hcl_pfinfo_t pfinfos[] =
{
{ { 'h','e','l','l','o','\0' }, 0, { pf_hello, 1, 1 } },
{ { 'w','a','l','k','\0' }, 0, { pf_walk, 1, 1 } }
};
/* ------------------------------------------------------------------------ */
static hcl_pfbase_t* query (hcl_t* hcl, hcl_mod_t* mod, const hcl_ooch_t* name, hcl_oow_t namelen)
{
return hcl_findpfbase (hcl, pfinfos, HCL_COUNTOF(pfinfos), name, namelen);
}
static void unload (hcl_t* hcl, hcl_mod_t* mod)
{
}
int hcl_mod_fake_test (hcl_t* hcl, hcl_mod_t* mod)
{
mod->query = query;
mod->unload = unload;
mod->ctx = HCL_NULL;
return 0;
}

64
mod/Makefile.am Normal file
View File

@ -0,0 +1,64 @@
AUTOMAKE_OPTIONS = nostdinc
##AM_CFLAGS = $(PTHREAD_CFLAGS)
CPPFLAGS_COMMON = \
-I$(abs_builddir) \
-I$(abs_builddir)/../lib \
-I$(abs_srcdir) \
-I$(abs_srcdir)/../lib \
-I$(includedir)
if WIN32
# you must adjust the value of DEFAULT_PFMODPOSTFIX according
# to the first number in -version-info above
CPPFLAGS_COMMON += -DHCL_DEFAULT_PFMODPREFIX=\"libhcl-\" -DHCL_DEFAULT_PFMODPOSTFIX=\"-1\"
else
CPPFLAGS_COMMON += -DHCL_DEFAULT_PFMODPREFIX=\"$(libdir)/libhcl-\" -DHCL_DEFAULT_PFMODPOSTFIX=\"\"
endif
if ENABLE_STATIC_MODULE
##################################################
# STATIC MODULES BUILT INTO MAIN LIBRARY
##################################################
LDFLAGS_COMMON =-L$(libdir) -version-info 1:0:0 -no-undefined
LIBADD_COMMON =
noinst_LTLIBRARIES =
noinst_LTLIBRARIES += libhcl-arr.la
noinst_LTLIBRARIES += libhcl-dic.la
noinst_LTLIBRARIES += libhcl-str.la
else
##################################################
# DYNAMIC MODULES
##################################################
LDFLAGS_COMMON = -L$(abs_builddir)/../lib -L$(libdir) -version-info 1:0:0 -no-undefined
LIBADD_COMMON = -lhcl
pkgmodexecdir = $(libdir)
pkgmodexec_LTLIBRARIES =
pkgmodexec_LTLIBRARIES += libhcl-arr.la
pkgmodexec_LTLIBRARIES += libhcl-dic.la
pkgmodexec_LTLIBRARIES += libhcl-str.la
endif
libhcl_arr_la_SOURCES = arr.c _arr.h
libhcl_arr_la_CPPFLAGS = $(CPPFLAGS_COMMON)
libhcl_arr_la_LDFLAGS = $(LDFLAGS_COMMON)
libhcl_arr_la_LIBADD = $(LIBADD_COMMON)
libhcl_dic_la_SOURCES = dic.c _dic.h
libhcl_dic_la_CPPFLAGS = $(CPPFLAGS_COMMON)
libhcl_dic_la_LDFLAGS = $(LDFLAGS_COMMON)
libhcl_dic_la_LIBADD = $(LIBADD_COMMON)
libhcl_str_la_SOURCES = str.c _str.h
libhcl_str_la_CPPFLAGS = $(CPPFLAGS_COMMON)
libhcl_str_la_LDFLAGS = $(LDFLAGS_COMMON)
libhcl_str_la_LIBADD = $(LIBADD_COMMON)

775
mod/Makefile.in Normal file
View File

@ -0,0 +1,775 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# 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,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
# you must adjust the value of DEFAULT_PFMODPOSTFIX according
# to the first number in -version-info above
@WIN32_TRUE@am__append_1 = -DHCL_DEFAULT_PFMODPREFIX=\"libhcl-\" -DHCL_DEFAULT_PFMODPOSTFIX=\"-1\"
@WIN32_FALSE@am__append_2 = -DHCL_DEFAULT_PFMODPREFIX=\"$(libdir)/libhcl-\" -DHCL_DEFAULT_PFMODPOSTFIX=\"\"
subdir = mod
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_namespace.m4 \
$(top_srcdir)/m4/ax_numval.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/lib/hcl-cfg.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(pkgmodexecdir)"
LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkgmodexec_LTLIBRARIES)
am__DEPENDENCIES_1 =
libhcl_arr_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_libhcl_arr_la_OBJECTS = libhcl_arr_la-arr.lo
libhcl_arr_la_OBJECTS = $(am_libhcl_arr_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
libhcl_arr_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libhcl_arr_la_LDFLAGS) $(LDFLAGS) -o $@
@ENABLE_STATIC_MODULE_FALSE@am_libhcl_arr_la_rpath = -rpath \
@ENABLE_STATIC_MODULE_FALSE@ $(pkgmodexecdir)
@ENABLE_STATIC_MODULE_TRUE@am_libhcl_arr_la_rpath =
libhcl_dic_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_libhcl_dic_la_OBJECTS = libhcl_dic_la-dic.lo
libhcl_dic_la_OBJECTS = $(am_libhcl_dic_la_OBJECTS)
libhcl_dic_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libhcl_dic_la_LDFLAGS) $(LDFLAGS) -o $@
@ENABLE_STATIC_MODULE_FALSE@am_libhcl_dic_la_rpath = -rpath \
@ENABLE_STATIC_MODULE_FALSE@ $(pkgmodexecdir)
@ENABLE_STATIC_MODULE_TRUE@am_libhcl_dic_la_rpath =
libhcl_str_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_libhcl_str_la_OBJECTS = libhcl_str_la-str.lo
libhcl_str_la_OBJECTS = $(am_libhcl_str_la_OBJECTS)
libhcl_str_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libhcl_str_la_LDFLAGS) $(LDFLAGS) -o $@
@ENABLE_STATIC_MODULE_FALSE@am_libhcl_str_la_rpath = -rpath \
@ENABLE_STATIC_MODULE_FALSE@ $(pkgmodexecdir)
@ENABLE_STATIC_MODULE_TRUE@am_libhcl_str_la_rpath =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES =
depcomp = $(SHELL) $(top_srcdir)/ac/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(libhcl_arr_la_SOURCES) $(libhcl_dic_la_SOURCES) \
$(libhcl_str_la_SOURCES)
DIST_SOURCES = $(libhcl_arr_la_SOURCES) $(libhcl_dic_la_SOURCES) \
$(libhcl_str_la_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/ac/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BUILD_MODE = @BUILD_MODE@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DL_LIBS = @DL_LIBS@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HAVE_CXX = @HAVE_CXX@
HCL_PROJECT_AUTHOR = @HCL_PROJECT_AUTHOR@
HCL_PROJECT_URL = @HCL_PROJECT_URL@
HCL_SIZEOF_CHAR = @HCL_SIZEOF_CHAR@
HCL_SIZEOF_DOUBLE = @HCL_SIZEOF_DOUBLE@
HCL_SIZEOF_FLOAT = @HCL_SIZEOF_FLOAT@
HCL_SIZEOF_INT = @HCL_SIZEOF_INT@
HCL_SIZEOF_LONG = @HCL_SIZEOF_LONG@
HCL_SIZEOF_LONG_DOUBLE = @HCL_SIZEOF_LONG_DOUBLE@
HCL_SIZEOF_LONG_LONG = @HCL_SIZEOF_LONG_LONG@
HCL_SIZEOF_OFF64_T = @HCL_SIZEOF_OFF64_T@
HCL_SIZEOF_OFF_T = @HCL_SIZEOF_OFF_T@
HCL_SIZEOF_SHORT = @HCL_SIZEOF_SHORT@
HCL_SIZEOF_VOID_P = @HCL_SIZEOF_VOID_P@
HCL_SIZEOF_WCHAR_T = @HCL_SIZEOF_WCHAR_T@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBM = @LIBM@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBTOOL_DEPS = @LIBTOOL_DEPS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@
PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@
PACKAGE_VERSION_PATCH = @PACKAGE_VERSION_PATCH@
PATH_SEPARATOR = @PATH_SEPARATOR@
QUADMATH_LIBS = @QUADMATH_LIBS@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
UNICOWS_LIBS = @UNICOWS_LIBS@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = nostdinc
CPPFLAGS_COMMON = -I$(abs_builddir) -I$(abs_builddir)/../lib \
-I$(abs_srcdir) -I$(abs_srcdir)/../lib -I$(includedir) \
$(am__append_1) $(am__append_2)
##################################################
# DYNAMIC MODULES
##################################################
@ENABLE_STATIC_MODULE_FALSE@LDFLAGS_COMMON = -L$(abs_builddir)/../lib -L$(libdir) -version-info 1:0:0 -no-undefined
##################################################
# STATIC MODULES BUILT INTO MAIN LIBRARY
##################################################
@ENABLE_STATIC_MODULE_TRUE@LDFLAGS_COMMON = -L$(libdir) -version-info 1:0:0 -no-undefined
@ENABLE_STATIC_MODULE_FALSE@LIBADD_COMMON = -lhcl
@ENABLE_STATIC_MODULE_TRUE@LIBADD_COMMON =
@ENABLE_STATIC_MODULE_TRUE@noinst_LTLIBRARIES = libhcl-arr.la \
@ENABLE_STATIC_MODULE_TRUE@ libhcl-dic.la libhcl-str.la
@ENABLE_STATIC_MODULE_FALSE@pkgmodexecdir = $(libdir)
@ENABLE_STATIC_MODULE_FALSE@pkgmodexec_LTLIBRARIES = libhcl-arr.la \
@ENABLE_STATIC_MODULE_FALSE@ libhcl-dic.la libhcl-str.la
libhcl_arr_la_SOURCES = arr.c _arr.h
libhcl_arr_la_CPPFLAGS = $(CPPFLAGS_COMMON)
libhcl_arr_la_LDFLAGS = $(LDFLAGS_COMMON)
libhcl_arr_la_LIBADD = $(LIBADD_COMMON)
libhcl_dic_la_SOURCES = dic.c _dic.h
libhcl_dic_la_CPPFLAGS = $(CPPFLAGS_COMMON)
libhcl_dic_la_LDFLAGS = $(LDFLAGS_COMMON)
libhcl_dic_la_LIBADD = $(LIBADD_COMMON)
libhcl_str_la_SOURCES = str.c _str.h
libhcl_str_la_CPPFLAGS = $(CPPFLAGS_COMMON)
libhcl_str_la_LDFLAGS = $(LDFLAGS_COMMON)
libhcl_str_la_LIBADD = $(LIBADD_COMMON)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign mod/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign mod/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
@list='$(noinst_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
install-pkgmodexecLTLIBRARIES: $(pkgmodexec_LTLIBRARIES)
@$(NORMAL_INSTALL)
@list='$(pkgmodexec_LTLIBRARIES)'; test -n "$(pkgmodexecdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
echo " $(MKDIR_P) '$(DESTDIR)$(pkgmodexecdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(pkgmodexecdir)" || exit 1; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkgmodexecdir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkgmodexecdir)"; \
}
uninstall-pkgmodexecLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(pkgmodexec_LTLIBRARIES)'; test -n "$(pkgmodexecdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkgmodexecdir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkgmodexecdir)/$$f"; \
done
clean-pkgmodexecLTLIBRARIES:
-test -z "$(pkgmodexec_LTLIBRARIES)" || rm -f $(pkgmodexec_LTLIBRARIES)
@list='$(pkgmodexec_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
libhcl-arr.la: $(libhcl_arr_la_OBJECTS) $(libhcl_arr_la_DEPENDENCIES) $(EXTRA_libhcl_arr_la_DEPENDENCIES)
$(AM_V_CCLD)$(libhcl_arr_la_LINK) $(am_libhcl_arr_la_rpath) $(libhcl_arr_la_OBJECTS) $(libhcl_arr_la_LIBADD) $(LIBS)
libhcl-dic.la: $(libhcl_dic_la_OBJECTS) $(libhcl_dic_la_DEPENDENCIES) $(EXTRA_libhcl_dic_la_DEPENDENCIES)
$(AM_V_CCLD)$(libhcl_dic_la_LINK) $(am_libhcl_dic_la_rpath) $(libhcl_dic_la_OBJECTS) $(libhcl_dic_la_LIBADD) $(LIBS)
libhcl-str.la: $(libhcl_str_la_OBJECTS) $(libhcl_str_la_DEPENDENCIES) $(EXTRA_libhcl_str_la_DEPENDENCIES)
$(AM_V_CCLD)$(libhcl_str_la_LINK) $(am_libhcl_str_la_rpath) $(libhcl_str_la_OBJECTS) $(libhcl_str_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhcl_arr_la-arr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhcl_dic_la-dic.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhcl_str_la-str.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
libhcl_arr_la-arr.lo: arr.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhcl_arr_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhcl_arr_la-arr.lo -MD -MP -MF $(DEPDIR)/libhcl_arr_la-arr.Tpo -c -o libhcl_arr_la-arr.lo `test -f 'arr.c' || echo '$(srcdir)/'`arr.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhcl_arr_la-arr.Tpo $(DEPDIR)/libhcl_arr_la-arr.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arr.c' object='libhcl_arr_la-arr.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhcl_arr_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhcl_arr_la-arr.lo `test -f 'arr.c' || echo '$(srcdir)/'`arr.c
libhcl_dic_la-dic.lo: dic.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhcl_dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhcl_dic_la-dic.lo -MD -MP -MF $(DEPDIR)/libhcl_dic_la-dic.Tpo -c -o libhcl_dic_la-dic.lo `test -f 'dic.c' || echo '$(srcdir)/'`dic.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhcl_dic_la-dic.Tpo $(DEPDIR)/libhcl_dic_la-dic.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dic.c' object='libhcl_dic_la-dic.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhcl_dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhcl_dic_la-dic.lo `test -f 'dic.c' || echo '$(srcdir)/'`dic.c
libhcl_str_la-str.lo: str.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhcl_str_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhcl_str_la-str.lo -MD -MP -MF $(DEPDIR)/libhcl_str_la-str.Tpo -c -o libhcl_str_la-str.lo `test -f 'str.c' || echo '$(srcdir)/'`str.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhcl_str_la-str.Tpo $(DEPDIR)/libhcl_str_la-str.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='str.c' object='libhcl_str_la-str.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhcl_str_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhcl_str_la-str.lo `test -f 'str.c' || echo '$(srcdir)/'`str.c
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES)
installdirs:
for dir in "$(DESTDIR)$(pkgmodexecdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
clean-pkgmodexecLTLIBRARIES mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-pkgmodexecLTLIBRARIES
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-pkgmodexecLTLIBRARIES
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstLTLIBRARIES \
clean-pkgmodexecLTLIBRARIES cscopelist-am ctags ctags-am \
distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-pkgmodexecLTLIBRARIES install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
uninstall-pkgmodexecLTLIBRARIES
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

43
mod/_arr.h Normal file
View File

@ -0,0 +1,43 @@
/*
* $Id$
*
Copyright (c) 2016-2018 Chung, Hyung-Hwan. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _HCL_MOD_ARR_H_
#define _HCL_MOD_ARR_H_
#include <hcl.h>
#if defined(__cplusplus)
extern "C" {
#endif
HCL_EXPORT int hcl_mod_arr (hcl_t* hcl, hcl_mod_t* mod);
#if defined(__cplusplus)
}
#endif
#endif

43
mod/_dic.h Normal file
View File

@ -0,0 +1,43 @@
/*
* $Id$
*
Copyright (c) 2016-2018 Chung, Hyung-Hwan. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _HCL_MOD_DIC_H_
#define _HCL_MOD_DIC_H_
#include <hcl.h>
#if defined(__cplusplus)
extern "C" {
#endif
HCL_EXPORT int hcl_mod_dic (hcl_t* hcl, hcl_mod_t* mod);
#if defined(__cplusplus)
}
#endif
#endif

43
mod/_str.h Normal file
View File

@ -0,0 +1,43 @@
/*
* $Id$
*
Copyright (c) 2016-2018 Chung, Hyung-Hwan. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _HCL_MOD_STR_H_
#define _HCL_MOD_STR_H_
#include <hcl.h>
#if defined(__cplusplus)
extern "C" {
#endif
HCL_EXPORT int hcl_mod_str (hcl_t* hcl, hcl_mod_t* mod);
#if defined(__cplusplus)
}
#endif
#endif

82
mod/arr.c Normal file
View File

@ -0,0 +1,82 @@
/*
* $Id$
*
Copyright (c) 2016-2018 Chung, Hyung-Hwan. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "_arr.h"
static hcl_pfrc_t pf_arr_get (hcl_t* hcl, hcl_ooi_t nargs)
{
hcl_oop_oop_t arr;
hcl_oop_t idx;
hcl_oow_t index;
arr = (hcl_oop_oop_t)HCL_STACK_GETARG(hcl, nargs, 0);
idx = HCL_STACK_GETARG(hcl, nargs, 1);
if (!HCL_IS_ARRAY(hcl,arr))
{
hcl_seterrbfmt (hcl, HCL_EINVAL, "parameter not an array - %O", arr);
return HCL_PF_FAILURE;
}
if (hcl_inttooow(hcl, idx, &index) == 0) return HCL_PF_FAILURE;
if (index >= HCL_OBJ_GET_SIZE(arr))
{
hcl_seterrbfmt (hcl, HCL_EINVAL, "array index(%zu) out of bounds(0-%zu)", index, HCL_OBJ_GET_SIZE(arr) - 1);
return HCL_PF_FAILURE;
}
HCL_STACK_SETRET (hcl, nargs, arr->slot[index]);
return HCL_PF_SUCCESS;
}
static hcl_pfinfo_t pfinfos[] =
{
{ { 'g','e','t','\0' }, 0, { pf_arr_get, 2, 2 } },
/* { { 'm','a','k','e','\0' }, 0, { pf_arr_make, 1, 1 } },
{ { 'p','u','t','\0' }, 0, { pf_arr_put, 3, 3 } }*/
};
/* ------------------------------------------------------------------------ */
static hcl_pfbase_t* query (hcl_t* hcl, hcl_mod_t* mod, const hcl_ooch_t* name, hcl_oow_t namelen)
{
return hcl_findpfbase(hcl, pfinfos, HCL_COUNTOF(pfinfos), name, namelen);
}
static void unload (hcl_t* hcl, hcl_mod_t* mod)
{
}
int hcl_mod_arr (hcl_t* hcl, hcl_mod_t* mod)
{
mod->query = query;
mod->unload = unload;
mod->ctx = HCL_NULL;
return 0;
}

112
mod/dic.c Normal file
View File

@ -0,0 +1,112 @@
/*
* $Id$
*
Copyright (c) 2016-2018 Chung, Hyung-Hwan. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "_dic.h"
static hcl_pfrc_t pf_dic_get (hcl_t* hcl, hcl_ooi_t nargs)
{
hcl_oop_t dic;
hcl_oop_t key;
hcl_oop_cons_t pair;
dic = HCL_STACK_GETARG(hcl, nargs, 0);
key = HCL_STACK_GETARG(hcl, nargs, 1);
if (!HCL_IS_DIC(hcl,dic))
{
hcl_seterrbfmt (hcl, HCL_EINVAL, "parameter not an dictionary - %O", dic);
return HCL_PF_FAILURE;
}
pair = hcl_getatdic(hcl, (hcl_oop_dic_t)dic, key);
if (!pair)
{
/* TODO: arrange to return ERROR instead of returnin HCL_PF_FAILURE*/
hcl_seterrbfmt (hcl, HCL_EINVAL, "invalid key - %O", key);
return HCL_PF_FAILURE;
}
HCL_STACK_SETRET (hcl, nargs, HCL_CONS_CDR(pair));
return HCL_PF_SUCCESS;
}
static int walker (hcl_t* hcl, hcl_oop_dic_t dic, hcl_oop_cons_t pair, void* ctx)
{
HCL_DEBUG2 (hcl, "walker ===> %O =====> %O\n", HCL_CONS_CAR(pair), HCL_CONS_CDR(pair));
return 0;
}
static hcl_pfrc_t pf_dic_walk (hcl_t* hcl, hcl_ooi_t nargs)
{
/* TODO: write a proper function
* (dic.apply #{ ... } callable-or-lambda)
*/
hcl_oop_t arg;
arg = HCL_STACK_GETARG(hcl, nargs, 0);
if (!HCL_IS_DIC(hcl,arg))
{
hcl_seterrbfmt (hcl, HCL_EINVAL, "parameter not a dictionary - %O", arg);
return HCL_PF_FAILURE;
}
hcl_walkdic (hcl, (hcl_oop_dic_t)arg, walker, HCL_NULL);
HCL_STACK_SETRET (hcl, nargs, hcl->_true);
return HCL_PF_SUCCESS;
}
static hcl_pfinfo_t pfinfos[] =
{
{ { 'g','e','t','\0' }, 0, { pf_dic_get, 2, 2 } },
/* { { 'm','a','k','e','\0' }, 0, { pf_dic_make, 1, 1 } },
{ { 'p','u','t','\0' }, 0, { pf_dic_put, 3, 3 } },*/
{ { 'w','a','l','k','\0' }, 0, { pf_dic_walk, 2, 2 } },
};
/* ------------------------------------------------------------------------ */
static hcl_pfbase_t* query (hcl_t* hcl, hcl_mod_t* mod, const hcl_ooch_t* name, hcl_oow_t namelen)
{
return hcl_findpfbase(hcl, pfinfos, HCL_COUNTOF(pfinfos), name, namelen);
}
static void unload (hcl_t* hcl, hcl_mod_t* mod)
{
}
int hcl_mod_dic (hcl_t* hcl, hcl_mod_t* mod)
{
mod->query = query;
mod->unload = unload;
mod->ctx = HCL_NULL;
return 0;
}

70
mod/str.c Normal file
View File

@ -0,0 +1,70 @@
/*
* $Id$
*
Copyright (c) 2016-2018 Chung, Hyung-Hwan. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "_str.h"
static hcl_pfrc_t pf_str_length (hcl_t* hcl, hcl_ooi_t nargs)
{
hcl_oop_t str;
hcl_ooi_t size;
str = HCL_STACK_GETARG(hcl, nargs, 0);
if (!HCL_IS_STRING(hcl,str))
{
hcl_seterrbfmt (hcl, HCL_EINVAL, "parameter not a string - %O", str);
return HCL_PF_FAILURE;
}
size = HCL_OBJ_GET_SIZE(str);
HCL_STACK_SETRET (hcl, nargs, HCL_SMOOI_TO_OOP(size));
return HCL_PF_SUCCESS;
}
static hcl_pfinfo_t pfinfos[] =
{
{ { 'l','e','n','g','t','h','\0' }, 0, { pf_str_length, 1, 1 } }
};
/* ------------------------------------------------------------------------ */
static hcl_pfbase_t* query (hcl_t* hcl, hcl_mod_t* mod, const hcl_ooch_t* name, hcl_oow_t namelen)
{
return hcl_findpfbase(hcl, pfinfos, HCL_COUNTOF(pfinfos), name, namelen);
}
static void unload (hcl_t* hcl, hcl_mod_t* mod)
{
}
int hcl_mod_str (hcl_t* hcl, hcl_mod_t* mod)
{
mod->query = query;
mod->unload = unload;
mod->ctx = HCL_NULL;
return 0;
}