implementing mod-ffi

This commit is contained in:
hyung-hwan 2020-12-17 10:12:57 +00:00
parent 214c2bee3a
commit 49efdd3caf
12 changed files with 1463 additions and 23 deletions

34
hawk/configure vendored
View File

@ -641,6 +641,8 @@ ENABLE_MOD_UCI_FALSE
ENABLE_MOD_UCI_TRUE
ENABLE_MOD_MYSQL_FALSE
ENABLE_MOD_MYSQL_TRUE
ENABLE_MOD_FFI_FALSE
ENABLE_MOD_FFI_TRUE
ENABLE_LIBUNWIND_FALSE
ENABLE_LIBUNWIND_TRUE
ENABLE_LIBLTDL_FALSE
@ -827,6 +829,7 @@ enable_dynamic_module
enable_static_module
enable_libltdl
enable_libunwind
enable_mod_ffi
enable_mod_mysql
enable_mod_uci
enable_pthread_flags
@ -1489,6 +1492,7 @@ Optional Features:
library(default. no)
--enable-libltdl use libltdl(default. no)
--enable-libunwind use libunwind(default. no)
--enable-mod-ffi enable mod/ffi (default. yes)
--enable-mod-mysql enable mod/mysql (default. yes)
--enable-mod-uci enable mod/uci (default. no)
--enable-pthread-flags add thread flags to CFLAGS, CXXFLAGS, LIBS(default.
@ -24128,6 +24132,32 @@ fi
# Check whether --enable-mod-ffi was given.
if test "${enable_mod_ffi+set}" = set; then :
enableval=$enable_mod_ffi; enable_mod_ffi_is=$enableval
else
enable_mod_ffi_is=yes
fi
if test "x${ac_cv_lib_ffi_ffi_call}" != "xyes" -a "x${ac_cv_lib_dyncall_s_dcNewCallVM}" != "xyes"
then
enable_mod_ffi_is="no"
fi
if test "${enable_mod_ffi_is}" = "yes"
then
$as_echo "#define HAWK_ENABLE_MOD_FFI 1" >>confdefs.h
fi
if test "${enable_mod_ffi_is}" = "yes"; then
ENABLE_MOD_FFI_TRUE=
ENABLE_MOD_FFI_FALSE='#'
else
ENABLE_MOD_FFI_TRUE='#'
ENABLE_MOD_FFI_FALSE=
fi
# Check whether --enable-mod-mysql was given.
if test "${enable_mod_mysql+set}" = set; then :
@ -24375,6 +24405,10 @@ if test -z "${ENABLE_LIBUNWIND_TRUE}" && test -z "${ENABLE_LIBUNWIND_FALSE}"; th
as_fn_error $? "conditional \"ENABLE_LIBUNWIND\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${ENABLE_MOD_FFI_TRUE}" && test -z "${ENABLE_MOD_FFI_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_MOD_FFI\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${ENABLE_MOD_MYSQL_TRUE}" && test -z "${ENABLE_MOD_MYSQL_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_MOD_MYSQL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5

View File

@ -986,6 +986,21 @@ fi
AM_CONDITIONAL(ENABLE_LIBUNWIND, test "x${enable_libunwind_is}" = "xyes")
dnl ===== enable-mod-ffi =====
AC_ARG_ENABLE([mod-ffi],
[AS_HELP_STRING([--enable-mod-ffi],[enable mod/ffi (default. yes)])],
enable_mod_ffi_is=$enableval,
enable_mod_ffi_is=yes
)
if test "x${ac_cv_lib_ffi_ffi_call}" != "xyes" -a "x${ac_cv_lib_dyncall_s_dcNewCallVM}" != "xyes"
then
enable_mod_ffi_is="no"
fi
if test "${enable_mod_ffi_is}" = "yes"
then
AC_DEFINE([HAWK_ENABLE_MOD_FFI],[1],[build mod/ffi])
fi
AM_CONDITIONAL(ENABLE_MOD_FFI, test "${enable_mod_ffi_is}" = "yes")
dnl ===== enable-mod-mysql =====
AC_ARG_ENABLE([mod-mysql],

View File

@ -199,6 +199,10 @@ libhawk_la_SOURCES += \
mod-sys.c mod-sys.h
libhawk_la_LIBADD += $(SOCKET_LIBS)
if ENABLE_MOD_FFI
libhawk_la_LIBADD += ../mod/libhawk-ffi.la
endif
if ENABLE_MOD_MYSQL
libhawk_la_LIBADD += ../mod/libhawk-mysql.la
endif

View File

@ -106,12 +106,13 @@ host_triplet = @host@
@ENABLE_STATIC_MODULE_TRUE@ mod-sys.c mod-sys.h
@ENABLE_STATIC_MODULE_TRUE@am__append_10 = $(SOCKET_LIBS)
@ENABLE_MOD_MYSQL_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_11 = ../mod/libhawk-mysql.la
@ENABLE_MOD_UCI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_12 = ../mod/libhawk-uci.la
@ENABLE_MOD_FFI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_11 = ../mod/libhawk-ffi.la
@ENABLE_MOD_MYSQL_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_12 = ../mod/libhawk-mysql.la
@ENABLE_MOD_UCI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_13 = ../mod/libhawk-uci.la
#pkglibdir = $(libdir)
#pkglib_LTLIBRARIES =
@ENABLE_STATIC_MODULE_FALSE@am__append_13 = libhawk-hawk.la \
@ENABLE_STATIC_MODULE_FALSE@am__append_14 = libhawk-hawk.la \
@ENABLE_STATIC_MODULE_FALSE@ libhawk-math.la libhawk-str.la \
@ENABLE_STATIC_MODULE_FALSE@ libhawk-sys.la
subdir = lib
@ -225,7 +226,7 @@ libhawk_sys_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
libhawk_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
$(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) $(am__append_11) \
$(am__append_12)
$(am__append_12) $(am__append_13)
am__libhawk_la_SOURCES_DIST = hawk.h hawk-arr.h hawk-chr.h hawk-cmn.h \
hawk-dir.h hawk-ecs.h hawk-fmt.h hawk-gem.h hawk-htb.h \
hawk-map.h hawk-rbt.h hawk-pack1.h hawk-utl.h hawk-std.h \
@ -597,7 +598,7 @@ pkginclude_HEADERS = hawk.h hawk-arr.h hawk-chr.h hawk-cmn.h \
hawk-dir.h hawk-ecs.h hawk-fmt.h hawk-gem.h hawk-htb.h \
hawk-map.h hawk-rbt.h hawk-pack1.h hawk-utl.h hawk-std.h \
hawk-tre.h hawk-unpack.h hawk-xma.h $(am__append_7)
pkglib_LTLIBRARIES = libhawk.la $(am__append_13)
pkglib_LTLIBRARIES = libhawk.la $(am__append_14)
libhawk_la_SOURCES = $(pkginclude_HEADERS) arr.c chr.c dir.c ecs-imp.h \
ecs.c err-prv.h err.c err-sys.c fmt-imp.h fmt.c fnc-prv.h \
fnc.c htb.c gem.c gem-skad.c gem-nwif.c gem-nwif2.c hawk-prv.h \
@ -619,7 +620,7 @@ libhawk_la_CXXFLAGS = $(CXXFLAGS_ALL_COMMON)
libhawk_la_LDFLAGS = $(LDFLAGS_ALL_COMMON) -version-info 1:0:0 -no-undefined
libhawk_la_LIBADD = $(LIBM) $(SOCKET_LIBS) $(am__append_4) \
$(am__append_5) $(am__append_6) $(am__append_10) \
$(am__append_11) $(am__append_12)
$(am__append_11) $(am__append_12) $(am__append_13)
@ENABLE_CXX_FALSE@libhawk_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
@ENABLE_CXX_FALSE@ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) \
@ENABLE_CXX_FALSE@ $(CFLAGS) $(libhawk_la_LDFLAGS) $(LDFLAGS) -o $@

View File

@ -693,6 +693,9 @@
/* use libunwind for backtracing stack frames */
#undef HAWK_ENABLE_LIBUNWIND
/* build mod/ffi */
#undef HAWK_ENABLE_MOD_FFI
/* build mod/mysql */
#undef HAWK_ENABLE_MOD_MYSQL

View File

@ -608,3 +608,32 @@ int hawk_buildrex (hawk_t* hawk, const hawk_ooch_t* ptn, hawk_oow_t len, hawk_tr
{
return hawk_gem_buildrex(hawk_getgem(hawk), ptn, len, !(hawk->opt.trait & HAWK_REXBOUND), code, icode);
}
/* ------------------------------------------------------------------------ */
int hawk_finmodsymfnc (hawk_t* hawk, hawk_mod_fnc_tab_t* fnctab, hawk_oow_t count, const hawk_ooch_t* name, hawk_oow_t namelen, hawk_mod_sym_t* sym)
{
int n;
/* binary search */
/* [NOTE] this algorithm is underflow safe with hawk_oow_t types */
hawk_oow_t base, mid, lim;
for (base = 0, lim = count; lim > 0; lim >>= 1)
{
mid = base + (lim >> 1);
n = hawk_comp_oochars_oocstr(name, namelen, fnctab[mid].name);
if (n == 0)
{
sym->type = HAWK_MOD_FNC;
sym->u.fnc = fnctab[mid].info;
return 0;
}
if (n > 0) { base = mid + 1; lim--; }
}
hawk_seterrbfmt (hawk, HAWK_NULL, HAWK_ENOENT, "'%js' not found", name);
return -1;
}

View File

@ -1046,6 +1046,14 @@ struct hawk_mod_sym_t
} u;
};
/* ------------------------------------------------------------------------ */
typedef struct hawk_mod_fnc_tab_t hawk_mod_fnc_tab_t;
struct hawk_mod_fnc_tab_t
{
const hawk_ooch_t* name;
hawk_mod_sym_fnc_t info;
};
/* ------------------------------------------------------------------------ */

View File

@ -7373,6 +7373,10 @@ int hawk_putsrcoochars (hawk_t* hawk, const hawk_ooch_t* str, hawk_oow_t len)
#include "mod-str.h"
#include "mod-sys.h"
#if defined(HAWK_ENABLE_MOD_FFI)
#include "../mod/mod-ffi.h"
#endif
#if defined(HAWK_ENABLE_MOD_MYSQL)
#include "../mod/mod-mysql.h"
#endif

View File

@ -21,6 +21,10 @@ LIBADD_COMMON =
noinst_LTLIBRARIES =
if ENABLE_MOD_FFI
noinst_LTLIBRARIES += libhawk-ffi.la
endif
if ENABLE_MOD_MYSQL
noinst_LTLIBRARIES += libhawk-mysql.la
endif
@ -42,6 +46,10 @@ LIBADD_COMMON = -lhawk
pkgmodexecdir = $(libdir)
pkgmodexec_LTLIBRARIES =
if ENABLE_MOD_FFI
pkgmodexec_LTLIBRARIES += libhawk-ffi.la
endif
if ENABLE_MOD_MYSQL
pkgmodexec_LTLIBRARIES += libhawk-mysql.la
endif
@ -58,6 +66,14 @@ endif
#-------------------------------------------------
# ACTUAL MODULES
#-------------------------------------------------
if ENABLE_MOD_FFI
libhawk_ffi_la_SOURCES = mod-ffi.c mod-ffi.h
libhawk_ffi_la_CPPFLAGS = $(CPPFLAGS_COMMON) $(MYSQL_CFLAGS)
libhawk_ffi_la_CFLAGS = $(CFLAGS_COMMON)
libhawk_ffi_la_LDFLAGS = $(LDFLAGS_COMMON) $(MYSQL_LDFLAGS)
libhawk_ffi_la_LIBADD = $(LIBADD_COMMON) $(MYSQL_LIBS)
endif
if ENABLE_MOD_MYSQL
libhawk_mysql_la_SOURCES = mod-mysql.c mod-mysql.h
libhawk_mysql_la_CPPFLAGS = $(CPPFLAGS_COMMON) $(MYSQL_CFLAGS)

View File

@ -88,10 +88,12 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@ENABLE_MOD_MYSQL_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_1 = libhawk-mysql.la
@ENABLE_MOD_UCI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_2 = libhawk-uci.la
@ENABLE_MOD_MYSQL_TRUE@@ENABLE_STATIC_MODULE_FALSE@am__append_3 = libhawk-mysql.la
@ENABLE_MOD_UCI_TRUE@@ENABLE_STATIC_MODULE_FALSE@am__append_4 = libhawk-uci.la
@ENABLE_MOD_FFI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_1 = libhawk-ffi.la
@ENABLE_MOD_MYSQL_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_2 = libhawk-mysql.la
@ENABLE_MOD_UCI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_3 = libhawk-uci.la
@ENABLE_MOD_FFI_TRUE@@ENABLE_STATIC_MODULE_FALSE@am__append_4 = libhawk-ffi.la
@ENABLE_MOD_MYSQL_TRUE@@ENABLE_STATIC_MODULE_FALSE@am__append_5 = libhawk-mysql.la
@ENABLE_MOD_UCI_TRUE@@ENABLE_STATIC_MODULE_FALSE@am__append_6 = libhawk-uci.la
subdir = mod
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \
@ -140,6 +142,25 @@ am__uninstall_files_from_dir = { \
am__installdirs = "$(DESTDIR)$(pkgmodexecdir)"
LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkgmodexec_LTLIBRARIES)
am__DEPENDENCIES_1 =
@ENABLE_MOD_FFI_TRUE@libhawk_ffi_la_DEPENDENCIES = \
@ENABLE_MOD_FFI_TRUE@ $(am__DEPENDENCIES_1) \
@ENABLE_MOD_FFI_TRUE@ $(am__DEPENDENCIES_1)
am__libhawk_ffi_la_SOURCES_DIST = mod-ffi.c mod-ffi.h
@ENABLE_MOD_FFI_TRUE@am_libhawk_ffi_la_OBJECTS = \
@ENABLE_MOD_FFI_TRUE@ libhawk_ffi_la-mod-ffi.lo
libhawk_ffi_la_OBJECTS = $(am_libhawk_ffi_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
libhawk_ffi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(libhawk_ffi_la_CFLAGS) $(CFLAGS) $(libhawk_ffi_la_LDFLAGS) \
$(LDFLAGS) -o $@
@ENABLE_MOD_FFI_TRUE@@ENABLE_STATIC_MODULE_FALSE@am_libhawk_ffi_la_rpath = \
@ENABLE_MOD_FFI_TRUE@@ENABLE_STATIC_MODULE_FALSE@ -rpath \
@ENABLE_MOD_FFI_TRUE@@ENABLE_STATIC_MODULE_FALSE@ $(pkgmodexecdir)
@ENABLE_MOD_FFI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am_libhawk_ffi_la_rpath =
@ENABLE_MOD_MYSQL_TRUE@libhawk_mysql_la_DEPENDENCIES = \
@ENABLE_MOD_MYSQL_TRUE@ $(am__DEPENDENCIES_1) \
@ENABLE_MOD_MYSQL_TRUE@ $(am__DEPENDENCIES_1)
@ -147,10 +168,6 @@ am__libhawk_mysql_la_SOURCES_DIST = mod-mysql.c mod-mysql.h
@ENABLE_MOD_MYSQL_TRUE@am_libhawk_mysql_la_OBJECTS = \
@ENABLE_MOD_MYSQL_TRUE@ libhawk_mysql_la-mod-mysql.lo
libhawk_mysql_la_OBJECTS = $(am_libhawk_mysql_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
libhawk_mysql_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(libhawk_mysql_la_CFLAGS) $(CFLAGS) \
@ -189,7 +206,8 @@ 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 \
am__depfiles_remade = ./$(DEPDIR)/libhawk_ffi_la-mod-ffi.Plo \
./$(DEPDIR)/libhawk_mysql_la-mod-mysql.Plo \
./$(DEPDIR)/libhawk_uci_la-mod-uci.Plo
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@ -210,8 +228,10 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(libhawk_mysql_la_SOURCES) $(libhawk_uci_la_SOURCES)
DIST_SOURCES = $(am__libhawk_mysql_la_SOURCES_DIST) \
SOURCES = $(libhawk_ffi_la_SOURCES) $(libhawk_mysql_la_SOURCES) \
$(libhawk_uci_la_SOURCES)
DIST_SOURCES = $(am__libhawk_ffi_la_SOURCES_DIST) \
$(am__libhawk_mysql_la_SOURCES_DIST) \
$(am__libhawk_uci_la_SOURCES_DIST)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
@ -411,14 +431,14 @@ CFLAGS_COMMON =
#-------------------------------------------------
# STATIC MODULES BUILT INTO MAIN LIBRARY
#-------------------------------------------------
@ENABLE_STATIC_MODULE_TRUE@LDFLAGS_COMMON = -L$(libdir) -version-info 1:0:0 -no-undefined
@ENABLE_STATIC_MODULE_TRUE@LDFLAGS_COMMON = -L$(libdir)
@ENABLE_STATIC_MODULE_FALSE@LIBADD_COMMON = -lhawk
@ENABLE_STATIC_MODULE_TRUE@LIBADD_COMMON =
@ENABLE_STATIC_MODULE_TRUE@noinst_LTLIBRARIES = $(am__append_1) \
@ENABLE_STATIC_MODULE_TRUE@ $(am__append_2)
@ENABLE_STATIC_MODULE_TRUE@ $(am__append_2) $(am__append_3)
@ENABLE_STATIC_MODULE_FALSE@pkgmodexecdir = $(libdir)
@ENABLE_STATIC_MODULE_FALSE@pkgmodexec_LTLIBRARIES = $(am__append_3) \
@ENABLE_STATIC_MODULE_FALSE@ $(am__append_4)
@ENABLE_STATIC_MODULE_FALSE@pkgmodexec_LTLIBRARIES = $(am__append_4) \
@ENABLE_STATIC_MODULE_FALSE@ $(am__append_5) $(am__append_6)
##################################################
##################################################
@ -426,6 +446,11 @@ CFLAGS_COMMON =
#-------------------------------------------------
# ACTUAL MODULES
#-------------------------------------------------
@ENABLE_MOD_FFI_TRUE@libhawk_ffi_la_SOURCES = mod-ffi.c mod-ffi.h
@ENABLE_MOD_FFI_TRUE@libhawk_ffi_la_CPPFLAGS = $(CPPFLAGS_COMMON) $(MYSQL_CFLAGS)
@ENABLE_MOD_FFI_TRUE@libhawk_ffi_la_CFLAGS = $(CFLAGS_COMMON)
@ENABLE_MOD_FFI_TRUE@libhawk_ffi_la_LDFLAGS = $(LDFLAGS_COMMON) $(MYSQL_LDFLAGS)
@ENABLE_MOD_FFI_TRUE@libhawk_ffi_la_LIBADD = $(LIBADD_COMMON) $(MYSQL_LIBS)
@ENABLE_MOD_MYSQL_TRUE@libhawk_mysql_la_SOURCES = mod-mysql.c mod-mysql.h
@ENABLE_MOD_MYSQL_TRUE@libhawk_mysql_la_CPPFLAGS = $(CPPFLAGS_COMMON) $(MYSQL_CFLAGS)
@ENABLE_MOD_MYSQL_TRUE@libhawk_mysql_la_CFLAGS = $(CFLAGS_COMMON)
@ -516,6 +541,9 @@ clean-pkgmodexecLTLIBRARIES:
rm -f $${locs}; \
}
libhawk-ffi.la: $(libhawk_ffi_la_OBJECTS) $(libhawk_ffi_la_DEPENDENCIES) $(EXTRA_libhawk_ffi_la_DEPENDENCIES)
$(AM_V_CCLD)$(libhawk_ffi_la_LINK) $(am_libhawk_ffi_la_rpath) $(libhawk_ffi_la_OBJECTS) $(libhawk_ffi_la_LIBADD) $(LIBS)
libhawk-mysql.la: $(libhawk_mysql_la_OBJECTS) $(libhawk_mysql_la_DEPENDENCIES) $(EXTRA_libhawk_mysql_la_DEPENDENCIES)
$(AM_V_CCLD)$(libhawk_mysql_la_LINK) $(am_libhawk_mysql_la_rpath) $(libhawk_mysql_la_OBJECTS) $(libhawk_mysql_la_LIBADD) $(LIBS)
@ -528,6 +556,7 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhawk_ffi_la-mod-ffi.Plo@am__quote@ # am--include-marker
@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
@ -561,6 +590,13 @@ am--depfiles: $(am__depfiles_remade)
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
libhawk_ffi_la-mod-ffi.lo: mod-ffi.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_ffi_la_CPPFLAGS) $(CPPFLAGS) $(libhawk_ffi_la_CFLAGS) $(CFLAGS) -MT libhawk_ffi_la-mod-ffi.lo -MD -MP -MF $(DEPDIR)/libhawk_ffi_la-mod-ffi.Tpo -c -o libhawk_ffi_la-mod-ffi.lo `test -f 'mod-ffi.c' || echo '$(srcdir)/'`mod-ffi.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_ffi_la-mod-ffi.Tpo $(DEPDIR)/libhawk_ffi_la-mod-ffi.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mod-ffi.c' object='libhawk_ffi_la-mod-ffi.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_ffi_la_CPPFLAGS) $(CPPFLAGS) $(libhawk_ffi_la_CFLAGS) $(CFLAGS) -c -o libhawk_ffi_la-mod-ffi.lo `test -f 'mod-ffi.c' || echo '$(srcdir)/'`mod-ffi.c
libhawk_mysql_la-mod-mysql.lo: mod-mysql.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhawk_mysql_la_CPPFLAGS) $(CPPFLAGS) $(libhawk_mysql_la_CFLAGS) $(CFLAGS) -MT libhawk_mysql_la-mod-mysql.lo -MD -MP -MF $(DEPDIR)/libhawk_mysql_la-mod-mysql.Tpo -c -o libhawk_mysql_la-mod-mysql.lo `test -f 'mod-mysql.c' || echo '$(srcdir)/'`mod-mysql.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhawk_mysql_la-mod-mysql.Tpo $(DEPDIR)/libhawk_mysql_la-mod-mysql.Plo
@ -709,7 +745,8 @@ 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_ffi_la-mod-ffi.Plo
-rm -f ./$(DEPDIR)/libhawk_mysql_la-mod-mysql.Plo
-rm -f ./$(DEPDIR)/libhawk_uci_la-mod-uci.Plo
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
@ -756,7 +793,8 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f ./$(DEPDIR)/libhawk_mysql_la-mod-mysql.Plo
-rm -f ./$(DEPDIR)/libhawk_ffi_la-mod-ffi.Plo
-rm -f ./$(DEPDIR)/libhawk_mysql_la-mod-mysql.Plo
-rm -f ./$(DEPDIR)/libhawk_uci_la-mod-uci.Plo
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

1245
hawk/mod/mod-ffi.c Normal file

File diff suppressed because it is too large Load Diff

43
hawk/mod/mod-ffi.h Normal file
View File

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