adding mod-mysql. work in progress

This commit is contained in:
hyung-hwan 2019-05-09 08:29:00 +00:00
parent 7a49f16742
commit 8682cc32e7
16 changed files with 306 additions and 42 deletions

View File

@ -165,7 +165,7 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/ac/ar-lib \
$(top_srcdir)/ac/compile $(top_srcdir)/ac/config.guess \
$(top_srcdir)/ac/config.sub $(top_srcdir)/ac/install-sh \
$(top_srcdir)/ac/ltmain.sh $(top_srcdir)/ac/missing README \
ac/ar-lib ac/compile ac/config.guess ac/config.sub \
ac/ar-lib ac/compile ac/config.guess ac/config.sub ac/depcomp \
ac/install-sh ac/ltmain.sh ac/missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)

View File

@ -33,8 +33,3 @@ if WCHAR
qseawk_LDADD += $(UNICOWS_LIBS)
endif
endif
if ENABLE_STATIC_MODULE
qseawk_LDFLAGS += -L../../lib/sed
qseawk_LDADD += -lqsesed
endif

View File

@ -97,8 +97,6 @@ bin_PROGRAMS = qseawk$(EXEEXT)
@ENABLE_LIBLTDL_TRUE@am__append_3 = $(LTDL_LIBS)
@ENABLE_LIBLTDL_FALSE@am__append_4 = $(DL_LIBS)
@WCHAR_TRUE@@WIN32_TRUE@am__append_5 = $(UNICOWS_LIBS)
@ENABLE_STATIC_MODULE_TRUE@am__append_6 = -L../../lib/sed
@ENABLE_STATIC_MODULE_TRUE@am__append_7 = -lqsesed
subdir = cmd/awk
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \
@ -125,7 +123,7 @@ am__DEPENDENCIES_1 =
@WCHAR_TRUE@@WIN32_TRUE@am__DEPENDENCIES_4 = $(am__DEPENDENCIES_1)
qseawk_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
$(am__DEPENDENCIES_4) $(am__DEPENDENCIES_1)
$(am__DEPENDENCIES_4)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
@ -365,11 +363,9 @@ AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include \
$(LTDLINCL) $(am__append_1) $(am__append_2)
qseawk_SOURCES = awk.c
qseawk_CFLAGS = $(PTHREAD_CFLAGS)
qseawk_LDFLAGS = -L../../lib/awk -L../../lib/si -L../../lib/cmn \
$(am__append_6)
qseawk_LDFLAGS = -L../../lib/awk -L../../lib/si -L../../lib/cmn
qseawk_LDADD = -lqseawk -lqsesi -lqsecmn $(LIBM) $(PTHREAD_LIBS) \
$(am__append_3) $(am__append_4) $(am__append_5) \
$(am__append_7)
$(am__append_3) $(am__append_4) $(am__append_5)
all: all-am
.SUFFIXES:

26
qse/configure vendored
View File

@ -653,6 +653,8 @@ ENABLE_AWKMOD_UCI_FALSE
ENABLE_AWKMOD_UCI_TRUE
ENABLE_AWKMOD_SED_FALSE
ENABLE_AWKMOD_SED_TRUE
ENABLE_AWKMOD_MYSQL_FALSE
ENABLE_AWKMOD_MYSQL_TRUE
ENABLE_AWKMOD_MPI_FALSE
ENABLE_AWKMOD_MPI_TRUE
ENABLE_STATIC_MODULE_FALSE
@ -853,6 +855,7 @@ enable_awk_fltmax
enable_sed_tracer
enable_static_module
enable_awkmod_mpi
enable_awkmod_mysql
enable_awkmod_sed
enable_awkmod_uci
'
@ -1524,6 +1527,7 @@ Optional Features:
--enable-static-module build modules statically into the main
library(default. no)
--enable-awkmod-mpi enable the mpi module for awk(default. yes)
--enable-awkmod-mysql enable the mysql module for awk(default. yes)
--enable-awkmod-sed enable the sed module for awk(default. yes)
--enable-awkmod-uci enable the uci module for awk(default. no)
@ -23606,6 +23610,24 @@ else
fi
# Check whether --enable-awkmod-mysql was given.
if test "${enable_awkmod_mysql+set}" = set; then :
enableval=$enable_awkmod_mysql; enable_awkmod_mysql_is=$enableval
else
enable_awkmod_mysql_is=yes
fi
if test "x${enable_awkmod_mysql_is}" = "xyes"; then
ENABLE_AWKMOD_MYSQL_TRUE=
ENABLE_AWKMOD_MYSQL_FALSE='#'
else
ENABLE_AWKMOD_MYSQL_TRUE='#'
ENABLE_AWKMOD_MYSQL_FALSE=
fi
# Check whether --enable-awkmod-sed was given.
if test "${enable_awkmod_sed+set}" = set; then :
enableval=$enable_awkmod_sed; enable_awkmod_sed_is=$enableval
@ -23859,6 +23881,10 @@ if test -z "${ENABLE_AWKMOD_MPI_TRUE}" && test -z "${ENABLE_AWKMOD_MPI_FALSE}";
as_fn_error $? "conditional \"ENABLE_AWKMOD_MPI\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${ENABLE_AWKMOD_MYSQL_TRUE}" && test -z "${ENABLE_AWKMOD_MYSQL_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_AWKMOD_MYSQL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${ENABLE_AWKMOD_SED_TRUE}" && test -z "${ENABLE_AWKMOD_SED_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_AWKMOD_SED\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5

View File

@ -956,6 +956,19 @@ then
fi
AM_CONDITIONAL(ENABLE_AWKMOD_MPI, test "x${enable_awkmod_mpi_is}" = "xyes")
dnl ==== enable-awkawk-mysql ====
AC_ARG_ENABLE([awkmod-mysql],
[AS_HELP_STRING([--enable-awkmod-mysql],[enable the mysql module for awk(default. yes)])],
enable_awkmod_mysql_is=$enableval,
enable_awkmod_mysql_is=yes
)
dnl if test "x${have_C_mysql}" != "xyes"
dnl then
dnl enable_awkmod_mysql_is="no"
dnl fi
AM_CONDITIONAL(ENABLE_AWKMOD_MYSQL, test "x${enable_awkmod_mysql_is}" = "xyes")
dnl ==== enable-awkawk-sed ====
AC_ARG_ENABLE([awkmod-sed],
[AS_HELP_STRING([--enable-awkmod-sed],[enable the sed module for awk(default. yes)])],

View File

@ -69,6 +69,11 @@ libqseawk_la_LIBADD += -lqseawk-mpi
libqseawk_la_DEPENDENCIES += ../awkmod/libqseawk-mpi.la
endif
if ENABLE_AWKMOD_MYSQL
libqseawk_la_LIBADD += -lqseawk-mysql
libqseawk_la_DEPENDENCIES += ../awkmod/libqseawk-mysql.la
endif
if ENABLE_AWKMOD_SED
libqseawk_la_LIBADD += -lqseawk-sed
libqseawk_la_DEPENDENCIES += ../awkmod/libqseawk-sed.la

View File

@ -109,10 +109,12 @@ host_triplet = @host@
@ENABLE_AWKMOD_MPI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_7 = -lqseawk-mpi
@ENABLE_AWKMOD_MPI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_8 = ../awkmod/libqseawk-mpi.la
@ENABLE_AWKMOD_SED_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_9 = -lqseawk-sed
@ENABLE_AWKMOD_SED_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_10 = ../awkmod/libqseawk-sed.la
@ENABLE_AWKMOD_UCI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_11 = -lqseawk-uci
@ENABLE_AWKMOD_UCI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_12 = ../awkmod/libqseawk-uci.la
@ENABLE_AWKMOD_MYSQL_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_9 = -lqseawk-mysql
@ENABLE_AWKMOD_MYSQL_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_10 = ../awkmod/libqseawk-mysql.la
@ENABLE_AWKMOD_SED_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_11 = -lqseawk-sed
@ENABLE_AWKMOD_SED_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_12 = ../awkmod/libqseawk-sed.la
@ENABLE_AWKMOD_UCI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_13 = -lqseawk-uci
@ENABLE_AWKMOD_UCI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_14 = ../awkmod/libqseawk-uci.la
subdir = lib/awk
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \
@ -519,9 +521,9 @@ libqseawk_la_SOURCES = awk.c err.c tree.c parse.c run.c rec.c val.c \
libqseawk_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
libqseawk_la_LDFLAGS = $(LDFLAGS_LIB_COMMON)
libqseawk_la_LIBADD = $(LIBADD_LIB_COMMON) $(am__append_7) \
$(am__append_9) $(am__append_11)
$(am__append_9) $(am__append_11) $(am__append_13)
libqseawk_la_DEPENDENCIES = $(am__append_8) $(am__append_10) \
$(am__append_12)
$(am__append_12) $(am__append_14)
@ENABLE_CXX_TRUE@libqseawkxx_la_SOURCES = Awk.cpp StdAwk.cpp
@ENABLE_CXX_TRUE@libqseawkxx_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
@ENABLE_CXX_TRUE@libqseawkxx_la_LDFLAGS = $(LDFLAGS_LIB_COMMON)

View File

@ -6840,15 +6840,16 @@ int qse_awk_putsrcstrn (
#include "mod-str.h"
#include "mod-sys.h"
#if defined(MOO_ENABLE_AWKMOD_SED)
#include "../../mod/awk/mod-sed.h"
#if defined(MOO_ENABLE_AWKMOD_MPI)
#include "../awkmod/mod-sed.h"
#endif
#if defined(HAVE_MPI)
# include "mod-mpi.h"
#if defined(MOO_ENABLE_AWKMOD_SED)
#include "../awkmod/mod-sed.h"
#endif
#if defined(HAVE_UCI)
# include "mod-uci.h"
#if defined(MOO_ENABLE_AWKMOD_UCI)
#include "../awkmod/mod-uci.h"
#endif
/*

View File

@ -23,6 +23,10 @@ if ENABLE_AWKMOD_MPI
noinst_LTLIBRARIES += libqseawk-mpi.la
endif
if ENABLE_AWKMOD_MYSQL
noinst_LTLIBRARIES += libqseawk-mysql.la
endif
if ENABLE_AWKMOD_SED
noinst_LTLIBRARIES += libqseawk-sed.la
endif
@ -71,6 +75,13 @@ libqseawk_mpi_la_LDFLAGS = $(LDFLAGS_COMMON) $(MPI_CLDFLAGS)
libqseawk_mpi_la_LIBADD = $(LIBADD_COMMON)
endif
if ENABLE_AWKMOD_MYSQL
libqseawk_mysql_la_SOURCES = mod-mysql.c mod-mysql.h
libqseawk_mysql_la_CPPFLAGS = $(CPPFLAGS_COMMON)
libqseawk_mysql_la_LDFLAGS = $(LDFLAGS_COMMON)
libqseawk_mysql_la_LIBADD = $(LIBADD_COMMON) -lmysqlclient_r
endif
if ENABLE_AWKMOD_SED
libqseawk_sed_la_SOURCES = mod-sed.c mod-sed.h
libqseawk_sed_la_CPPFLAGS = $(CPPFLAGS_COMMON)

View File

@ -89,11 +89,12 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@ENABLE_AWKMOD_MPI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_1 = libqseawk-mpi.la
@ENABLE_AWKMOD_SED_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_2 = libqseawk-sed.la
@ENABLE_AWKMOD_UCI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_3 = libqseawk-uci.la
@ENABLE_AWKMOD_MPI_TRUE@@ENABLE_STATIC_MODULE_FALSE@am__append_4 = libqseawk-mpi.la
@ENABLE_AWKMOD_SED_TRUE@@ENABLE_STATIC_MODULE_FALSE@am__append_5 = libqseawk-sed.la
@ENABLE_AWKMOD_UCI_TRUE@@ENABLE_STATIC_MODULE_FALSE@am__append_6 = libqseawk-uci.la
@ENABLE_AWKMOD_MYSQL_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_2 = libqseawk-mysql.la
@ENABLE_AWKMOD_SED_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_3 = libqseawk-sed.la
@ENABLE_AWKMOD_UCI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_4 = libqseawk-uci.la
@ENABLE_AWKMOD_MPI_TRUE@@ENABLE_STATIC_MODULE_FALSE@am__append_5 = libqseawk-mpi.la
@ENABLE_AWKMOD_SED_TRUE@@ENABLE_STATIC_MODULE_FALSE@am__append_6 = libqseawk-sed.la
@ENABLE_AWKMOD_UCI_TRUE@@ENABLE_STATIC_MODULE_FALSE@am__append_7 = libqseawk-uci.la
subdir = lib/awkmod
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \
@ -158,6 +159,17 @@ libqseawk_mpi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
@ENABLE_AWKMOD_MPI_TRUE@@ENABLE_STATIC_MODULE_FALSE@ -rpath \
@ENABLE_AWKMOD_MPI_TRUE@@ENABLE_STATIC_MODULE_FALSE@ $(pkgmodexecdir)
@ENABLE_AWKMOD_MPI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am_libqseawk_mpi_la_rpath =
@ENABLE_AWKMOD_MYSQL_TRUE@libqseawk_mysql_la_DEPENDENCIES = \
@ENABLE_AWKMOD_MYSQL_TRUE@ $(am__DEPENDENCIES_1)
am__libqseawk_mysql_la_SOURCES_DIST = mod-mysql.c mod-mysql.h
@ENABLE_AWKMOD_MYSQL_TRUE@am_libqseawk_mysql_la_OBJECTS = \
@ENABLE_AWKMOD_MYSQL_TRUE@ libqseawk_mysql_la-mod-mysql.lo
libqseawk_mysql_la_OBJECTS = $(am_libqseawk_mysql_la_OBJECTS)
libqseawk_mysql_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(AM_CFLAGS) $(CFLAGS) $(libqseawk_mysql_la_LDFLAGS) \
$(LDFLAGS) -o $@
@ENABLE_AWKMOD_MYSQL_TRUE@@ENABLE_STATIC_MODULE_TRUE@am_libqseawk_mysql_la_rpath =
@ENABLE_AWKMOD_SED_TRUE@libqseawk_sed_la_DEPENDENCIES = \
@ENABLE_AWKMOD_SED_TRUE@ $(am__DEPENDENCIES_1)
am__libqseawk_sed_la_SOURCES_DIST = mod-sed.c mod-sed.h
@ -221,9 +233,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 = $(libqseawk_mpi_la_SOURCES) $(libqseawk_sed_la_SOURCES) \
$(libqseawk_uci_la_SOURCES)
SOURCES = $(libqseawk_mpi_la_SOURCES) $(libqseawk_mysql_la_SOURCES) \
$(libqseawk_sed_la_SOURCES) $(libqseawk_uci_la_SOURCES)
DIST_SOURCES = $(am__libqseawk_mpi_la_SOURCES_DIST) \
$(am__libqseawk_mysql_la_SOURCES_DIST) \
$(am__libqseawk_sed_la_SOURCES_DIST) \
$(am__libqseawk_uci_la_SOURCES_DIST)
am__can_run_installinfo = \
@ -442,10 +455,11 @@ CPPFLAGS_COMMON = \
@ENABLE_STATIC_MODULE_FALSE@LIBADD_COMMON = -lqseawk -lqsesi -lqsecmn
@ENABLE_STATIC_MODULE_TRUE@LIBADD_COMMON =
@ENABLE_STATIC_MODULE_TRUE@noinst_LTLIBRARIES = $(am__append_1) \
@ENABLE_STATIC_MODULE_TRUE@ $(am__append_2) $(am__append_3)
@ENABLE_STATIC_MODULE_TRUE@ $(am__append_2) $(am__append_3) \
@ENABLE_STATIC_MODULE_TRUE@ $(am__append_4)
@ENABLE_STATIC_MODULE_FALSE@pkgmodexecdir = $(libdir)
@ENABLE_STATIC_MODULE_FALSE@pkgmodexec_LTLIBRARIES = $(am__append_4) \
@ENABLE_STATIC_MODULE_FALSE@ $(am__append_5) $(am__append_6)
@ENABLE_STATIC_MODULE_FALSE@pkgmodexec_LTLIBRARIES = $(am__append_5) \
@ENABLE_STATIC_MODULE_FALSE@ $(am__append_6) $(am__append_7)
##################################################
##################################################
@ -457,6 +471,10 @@ CPPFLAGS_COMMON = \
@ENABLE_AWKMOD_MPI_TRUE@libqseawk_mpi_la_CPPFLAGS = $(CPPFLAGS_COMMON) $(MPI_CFLAGS)
@ENABLE_AWKMOD_MPI_TRUE@libqseawk_mpi_la_LDFLAGS = $(LDFLAGS_COMMON) $(MPI_CLDFLAGS)
@ENABLE_AWKMOD_MPI_TRUE@libqseawk_mpi_la_LIBADD = $(LIBADD_COMMON)
@ENABLE_AWKMOD_MYSQL_TRUE@libqseawk_mysql_la_SOURCES = mod-mysql.c mod-mysql.h
@ENABLE_AWKMOD_MYSQL_TRUE@libqseawk_mysql_la_CPPFLAGS = $(CPPFLAGS_COMMON)
@ENABLE_AWKMOD_MYSQL_TRUE@libqseawk_mysql_la_LDFLAGS = $(LDFLAGS_COMMON)
@ENABLE_AWKMOD_MYSQL_TRUE@libqseawk_mysql_la_LIBADD = $(LIBADD_COMMON) -lmysqlclient_r
@ENABLE_AWKMOD_SED_TRUE@libqseawk_sed_la_SOURCES = mod-sed.c mod-sed.h
@ENABLE_AWKMOD_SED_TRUE@libqseawk_sed_la_CPPFLAGS = $(CPPFLAGS_COMMON)
@ENABLE_AWKMOD_SED_TRUE@libqseawk_sed_la_LDFLAGS = $(LDFLAGS_COMMON) -L../sed
@ -548,6 +566,9 @@ clean-pkgmodexecLTLIBRARIES:
libqseawk-mpi.la: $(libqseawk_mpi_la_OBJECTS) $(libqseawk_mpi_la_DEPENDENCIES) $(EXTRA_libqseawk_mpi_la_DEPENDENCIES)
$(AM_V_CCLD)$(libqseawk_mpi_la_LINK) $(am_libqseawk_mpi_la_rpath) $(libqseawk_mpi_la_OBJECTS) $(libqseawk_mpi_la_LIBADD) $(LIBS)
libqseawk-mysql.la: $(libqseawk_mysql_la_OBJECTS) $(libqseawk_mysql_la_DEPENDENCIES) $(EXTRA_libqseawk_mysql_la_DEPENDENCIES)
$(AM_V_CCLD)$(libqseawk_mysql_la_LINK) $(am_libqseawk_mysql_la_rpath) $(libqseawk_mysql_la_OBJECTS) $(libqseawk_mysql_la_LIBADD) $(LIBS)
libqseawk-sed.la: $(libqseawk_sed_la_OBJECTS) $(libqseawk_sed_la_DEPENDENCIES) $(EXTRA_libqseawk_sed_la_DEPENDENCIES)
$(AM_V_CCLD)$(libqseawk_sed_la_LINK) $(am_libqseawk_sed_la_rpath) $(libqseawk_sed_la_OBJECTS) $(libqseawk_sed_la_LIBADD) $(LIBS)
@ -561,6 +582,7 @@ distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libqseawk_mpi_la-mod-mpi.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libqseawk_mysql_la-mod-mysql.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libqseawk_sed_la-mod-sed.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libqseawk_uci_la-mod-uci.Plo@am__quote@
@ -592,6 +614,13 @@ libqseawk_mpi_la-mod-mpi.lo: mod-mpi.c
@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) $(libqseawk_mpi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libqseawk_mpi_la-mod-mpi.lo `test -f 'mod-mpi.c' || echo '$(srcdir)/'`mod-mpi.c
libqseawk_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) $(libqseawk_mysql_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libqseawk_mysql_la-mod-mysql.lo -MD -MP -MF $(DEPDIR)/libqseawk_mysql_la-mod-mysql.Tpo -c -o libqseawk_mysql_la-mod-mysql.lo `test -f 'mod-mysql.c' || echo '$(srcdir)/'`mod-mysql.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libqseawk_mysql_la-mod-mysql.Tpo $(DEPDIR)/libqseawk_mysql_la-mod-mysql.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mod-mysql.c' object='libqseawk_mysql_la-mod-mysql.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libqseawk_mysql_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libqseawk_mysql_la-mod-mysql.lo `test -f 'mod-mysql.c' || echo '$(srcdir)/'`mod-mysql.c
libqseawk_sed_la-mod-sed.lo: mod-sed.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libqseawk_sed_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libqseawk_sed_la-mod-sed.lo -MD -MP -MF $(DEPDIR)/libqseawk_sed_la-mod-sed.Tpo -c -o libqseawk_sed_la-mod-sed.lo `test -f 'mod-sed.c' || echo '$(srcdir)/'`mod-sed.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libqseawk_sed_la-mod-sed.Tpo $(DEPDIR)/libqseawk_sed_la-mod-sed.Plo

View File

@ -200,7 +200,7 @@ static inttab_t inttab[] =
static int query (qse_awk_mod_t* mod, qse_awk_t* awk, const qse_char_t* name, qse_awk_mod_sym_t* sym)
{
qse_cstr_t ea;
int left, right, mid, n;
int left, right, mid, n;
left = 0; right = QSE_COUNTOF(fnctab) - 1;

View File

@ -24,8 +24,8 @@
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _QSE_LIB_AWK_MOD_MPI_H_
#define _QSE_LIB_AWK_MOD_MPI_H_
#ifndef _QSE_LIB_AWKMOD_MPI_H_
#define _QSE_LIB_AWKMOD_MPI_H_
#include <qse/awk/awk.h>

143
qse/lib/awkmod/mod-mysql.c Normal file
View File

@ -0,0 +1,143 @@
/*
* $Id$
*
Copyright (c) 2006-2014 Chung, Hyung-Hwan. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "mod-mysql.h"
static int fnc_open (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
{
return -1;
}
static int fnc_close (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
{
return -1;
}
static int fnc_connect (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
{
return -1;
}
static int fnc_query (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
{
return -1;
}
typedef struct fnctab_t fnctab_t;
struct fnctab_t
{
const qse_char_t* name;
qse_awk_mod_sym_fnc_t info;
};
#define A_MAX QSE_TYPE_MAX(int)
static fnctab_t fnctab[] =
{
/* keep this table sorted for binary search in query(). */
{ QSE_T("close"), { { 1, 1, QSE_NULL }, fnc_close, 0 } },
{ QSE_T("connect"), { { 1, 1, QSE_NULL }, fnc_connect, 0 } },
{ QSE_T("open"), { { 1, 1, QSE_NULL }, fnc_open, 0 } },
{ QSE_T("query"), { { 2, 3, QSE_NULL }, fnc_query, 0 } },
};
static int query (qse_awk_mod_t* mod, qse_awk_t* awk, const qse_char_t* name, qse_awk_mod_sym_t* sym)
{
qse_cstr_t ea;
int left, right, mid, n;
left = 0; right = QSE_COUNTOF(fnctab) - 1;
while (left <= right)
{
mid = left + (right - left) / 2;
n = qse_strcmp (fnctab[mid].name, name);
if (n > 0) right = mid - 1;
else if (n < 0) left = mid + 1;
else
{
sym->type = QSE_AWK_MOD_FNC;
sym->u.fnc = fnctab[mid].info;
return 0;
}
}
#if 0
left = 0; right = QSE_COUNTOF(inttab) - 1;
while (left <= right)
{
mid = left + (right - left) / 2;
n = qse_strcmp (inttab[mid].name, name);
if (n > 0) right = mid - 1;
else if (n < 0) left = mid + 1;
else
{
sym->type = QSE_AWK_MOD_INT;
sym->u.in = inttab[mid].info;
return 0;
}
}
#endif
ea.ptr = (qse_char_t*)name;
ea.len = qse_strlen(name);
qse_awk_seterror (awk, QSE_AWK_ENOENT, &ea, QSE_NULL);
return -1;
}
/* TODO: proper resource management */
static int init (qse_awk_mod_t* mod, qse_awk_rtx_t* rtx)
{
return 0;
}
static void fini (qse_awk_mod_t* mod, qse_awk_rtx_t* rtx)
{
/* TODO: anything */
}
static void unload (qse_awk_mod_t* mod, qse_awk_t* awk)
{
/* TODO: anything */
}
int qse_awk_mod_mysql (qse_awk_mod_t* mod, qse_awk_t* awk)
{
mod->query = query;
mod->unload = unload;
mod->init = init;
mod->fini = fini;
/*
mod->ctx...
*/
return 0;
}

View File

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

View File

@ -24,8 +24,8 @@
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _QSE_LIB_AWK_MOD_SED_H_
#define _QSE_LIB_AWK_MOD_SED_H_
#ifndef _QSE_LIB_AWKMOD_SED_H_
#define _QSE_LIB_AWKMOD_SED_H_
#include <qse/awk/awk.h>

View File

@ -24,8 +24,8 @@
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _QSE_LIB_AWK_MOD_UCI_H_
#define _QSE_LIB_AWK_MOD_UCI_H_
#ifndef _QSE_LIB_AWKMOD_UCI_H_
#define _QSE_LIB_AWKMOD_UCI_H_
#include <qse/awk/awk.h>