restructured client and server code into a single library libhclex.

also migrated socket related functions into the library
This commit is contained in:
hyung-hwan 2018-04-10 13:57:17 +00:00
parent dfee95436f
commit 64acfe3aec
15 changed files with 386 additions and 382 deletions

View File

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

55
configure vendored
View File

@ -651,10 +651,8 @@ HCL_SIZEOF_LONG_LONG
HCL_SIZEOF_CHAR32_T
HCL_SIZEOF_CHAR16_T
HCL_SIZEOF_WCHAR_T
ENABLE_HCLC_FALSE
ENABLE_HCLC_TRUE
ENABLE_HCLS_FALSE
ENABLE_HCLS_TRUE
ENABLE_HCLEX_FALSE
ENABLE_HCLEX_TRUE
ENABLE_LIBLTDL_FALSE
ENABLE_LIBLTDL_TRUE
ENABLE_STATIC_MODULE_FALSE
@ -820,8 +818,7 @@ enable_cxx
enable_dynamic_module
enable_static_module
enable_libltdl
enable_hcls
enable_hclc
enable_hclex
'
ac_precious_vars='build_alias
host_alias
@ -1487,8 +1484,7 @@ Optional Features:
--enable-static-module build modules statically into the main
library(default. no)
--enable-libltdl use libltdl(default. no)
--enable-hcls build libhcls and hcls(default. no)
--enable-hclc build libhclc and hclc(default. no)
--enable-hclex build libhclex(default. no)
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@ -21152,37 +21148,20 @@ else
fi
# Check whether --enable-hcls was given.
if test "${enable_hcls+set}" = set; then :
enableval=$enable_hcls; enable_hcls_is=$enableval
# Check whether --enable-hclex was given.
if test "${enable_hclex+set}" = set; then :
enableval=$enable_hclex; enable_hclex_is=$enableval
else
enable_hcls_is=no
enable_hclex_is=no
fi
if test "x${enable_hcls_is}" = "xyes"; then
ENABLE_HCLS_TRUE=
ENABLE_HCLS_FALSE='#'
if test "x${enable_hclex_is}" = "xyes"; then
ENABLE_HCLEX_TRUE=
ENABLE_HCLEX_FALSE='#'
else
ENABLE_HCLS_TRUE='#'
ENABLE_HCLS_FALSE=
fi
# Check whether --enable-hclc was given.
if test "${enable_hclc+set}" = set; then :
enableval=$enable_hclc; enable_hclc_is=$enableval
else
enable_hclc_is=no
fi
if test "x${enable_hclc_is}" = "xyes"; then
ENABLE_HCLC_TRUE=
ENABLE_HCLC_FALSE='#'
else
ENABLE_HCLC_TRUE='#'
ENABLE_HCLC_FALSE=
ENABLE_HCLEX_TRUE='#'
ENABLE_HCLEX_FALSE=
fi
@ -21384,12 +21363,8 @@ if test -z "${ENABLE_LIBLTDL_TRUE}" && test -z "${ENABLE_LIBLTDL_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_LIBLTDL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${ENABLE_HCLS_TRUE}" && test -z "${ENABLE_HCLS_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_HCLS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${ENABLE_HCLC_TRUE}" && test -z "${ENABLE_HCLC_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_HCLC\" was never defined.
if test -z "${ENABLE_HCLEX_TRUE}" && test -z "${ENABLE_HCLEX_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_HCLEX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi

View File

@ -643,21 +643,13 @@ then
fi
AM_CONDITIONAL(ENABLE_LIBLTDL, test "x${enable_libltdl_is}" = "xyes")
dnl ===== enable-hcls =====
AC_ARG_ENABLE([hcls],
[AS_HELP_STRING([--enable-hcls],[build libhcls and hcls(default. no)])],
enable_hcls_is=$enableval,
enable_hcls_is=no
dnl ===== enable-hclex =====
AC_ARG_ENABLE([hclex],
[AS_HELP_STRING([--enable-hclex],[build libhclex(default. no)])],
enable_hclex_is=$enableval,
enable_hclex_is=no
)
AM_CONDITIONAL(ENABLE_HCLS, test "x${enable_hcls_is}" = "xyes")
dnl ===== enable-hclc =====
AC_ARG_ENABLE([hclc],
[AS_HELP_STRING([--enable-hclc],[build libhclc and hclc(default. no)])],
enable_hclc_is=$enableval,
enable_hclc_is=no
)
AM_CONDITIONAL(ENABLE_HCLC, test "x${enable_hclc_is}" = "xyes")
AM_CONDITIONAL(ENABLE_HCLEX, test "x${enable_hclex_is}" = "xyes")
AC_SUBST(HCL_SIZEOF_WCHAR_T, $ac_cv_sizeof_wchar_t)
AC_SUBST(HCL_SIZEOF_CHAR16_T, $ac_cv_sizeof_char16_t)

View File

@ -37,7 +37,6 @@ pkginclude_HEADERS = \
hcl-cmn.h \
hcl-opt.h \
hcl-rbt.h \
hcl-tmr.h \
hcl-utl.h
pkglib_LTLIBRARIES = libhcl.la
@ -46,7 +45,6 @@ libhcl_la_SOURCES = \
hcl-cmn.h \
hcl-opt.h \
hcl-rbt.h \
hcl-tmr.h \
hcl-utl.h \
hcl-prv.h \
bigint.c \
@ -70,35 +68,13 @@ libhcl_la_SOURCES = \
rbt.c \
read.c \
sym.c \
tmr.c \
utf8.c \
sa-utl.h \
utl.c
libhcl_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
libhcl_la_LDFLAGS = $(LDFLAGS_LIB_COMMON)
libhcl_la_LIBADD = $(LIBADD_LIB_COMMON)
libhcl_la_DEPENDENCIES =
if ENABLE_HCLS
pkglib_LTLIBRARIES += libhcls.la
pkginclude_HEADERS += hcl-s.h
libhcls_la_SOURCES = hcl-s.c hcl-s.h
libhcls_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
libhcls_la_LDFLAGS = $(LDFLAGS_LIB_COMMON)
libhcls_la_LIBADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS)
libhcls_la_DEPENDENCIES =
endif
if ENABLE_HCLC
pkglib_LTLIBRARIES += libhclc.la
pkginclude_HEADERS += hcl-c.h
libhclc_la_SOURCES = hcl-c.c hcl-c.h
libhclc_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
libhclc_la_LDFLAGS = $(LDFLAGS_LIB_COMMON)
libhclc_la_LIBADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS)
libhclc_la_DEPENDENCIES =
endif
if ENABLE_STATIC_MODULE
libhcl_la_LIBADD += -lhcl-arr
libhcl_la_DEPENDENCIES += $(abs_builddir)/../mod/libhcl-arr.la
@ -113,32 +89,37 @@ hcl_SOURCES = main.c
hcl_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
hcl_LDFLAGS = $(LDFLAGS_LIB_COMMON)
hcl_LDADD = $(LIBADD_LIB_COMMON) -lhcl
if ENABLE_STATIC_MODULE
hcl_DEPENDENCIES = libhcl.la
endif
if ENABLE_HCLS
if ENABLE_HCLEX
pkglib_LTLIBRARIES += libhclex.la
pkginclude_HEADERS += hcl-c.h hcl-s.h hcl-tmr.h hcl-xutl.h
libhclex_la_SOURCES = \
tmr.c hcl-tmr.h \
xutl.c xutl-sa.h hcl-xutl.h \
hcl-s.c hcl-s.h \
hcl-c.c hcl-c.h
libhclex_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
libhclex_la_LDFLAGS = $(LDFLAGS_LIB_COMMON)
libhclex_la_LIBADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhcl
libhclex_la_DEPENDENCIES = libhcl.la
bin_PROGRAMS += hcls
hcls_SOURCES = main-s.c
hcls_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
hcls_LDFLAGS = $(LDFLAGS_LIB_COMMON)
hcls_LDADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhcl -lhcls
if ENABLE_STATIC_MODULE
hcls_DEPENDENCIES = libhcl.la libhcls.la
endif
endif
hcls_LDADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhcl -lhclex
hcls_DEPENDENCIES = libhclex.la
if ENABLE_HCLC
bin_PROGRAMS += hclc
hclc_SOURCES = main-c.c
hclc_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
hclc_LDFLAGS = $(LDFLAGS_LIB_COMMON)
hclc_LDADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhcl -lhclc
if ENABLE_STATIC_MODULE
hclc_DEPENDENCIES = libhcl.la libhclc.la
endif
hclc_LDADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhcl -lhclex
hclc_DEPENDENCIES = libhclex.la
endif
install-data-hook:
@echo "#ifndef _HCL_CFG_H_" > "$(DESTDIR)$(pkgincludedir)/hcl-cfg.h"
@echo "#define _HCL_CFG_H_" >> "$(DESTDIR)$(pkgincludedir)/hcl-cfg.h"

View File

@ -90,23 +90,15 @@ build_triplet = @build@
host_triplet = @host@
@ENABLE_LIBLTDL_TRUE@am__append_1 = $(LTDL_LIBS)
@ENABLE_LIBLTDL_FALSE@am__append_2 = $(DL_LIBS)
@ENABLE_HCLS_TRUE@am__append_3 = libhcls.la
@ENABLE_HCLS_TRUE@am__append_4 = hcl-s.h
@ENABLE_HCLC_TRUE@am__append_5 = libhclc.la
@ENABLE_HCLC_TRUE@am__append_6 = hcl-c.h
@ENABLE_STATIC_MODULE_TRUE@am__append_7 = -lhcl-arr -lhcl-dic \
@ENABLE_STATIC_MODULE_TRUE@am__append_3 = -lhcl-arr -lhcl-dic \
@ENABLE_STATIC_MODULE_TRUE@ -lhcl-str
@ENABLE_STATIC_MODULE_TRUE@am__append_8 = $(abs_builddir)/../mod/libhcl-arr.la \
@ENABLE_STATIC_MODULE_TRUE@am__append_4 = $(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) $(am__EXEEXT_1) $(am__EXEEXT_2)
@ENABLE_STATIC_MODULE_FALSE@hcl_DEPENDENCIES = $(am__DEPENDENCIES_4)
@ENABLE_HCLS_TRUE@am__append_9 = hcls
@ENABLE_HCLS_TRUE@@ENABLE_STATIC_MODULE_FALSE@hcls_DEPENDENCIES = $(am__DEPENDENCIES_4) \
@ENABLE_HCLS_TRUE@@ENABLE_STATIC_MODULE_FALSE@ $(am__DEPENDENCIES_1)
@ENABLE_HCLC_TRUE@am__append_10 = hclc
@ENABLE_HCLC_TRUE@@ENABLE_STATIC_MODULE_FALSE@hclc_DEPENDENCIES = $(am__DEPENDENCIES_4) \
@ENABLE_HCLC_TRUE@@ENABLE_STATIC_MODULE_FALSE@ $(am__DEPENDENCIES_1)
bin_PROGRAMS = hcl$(EXEEXT) $(am__EXEEXT_1)
@ENABLE_HCLEX_TRUE@am__append_5 = libhclex.la
@ENABLE_HCLEX_TRUE@am__append_6 = hcl-c.h hcl-s.h hcl-tmr.h hcl-xutl.h
@ENABLE_HCLEX_TRUE@am__append_7 = hcls hclc
subdir = lib
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \
@ -164,8 +156,8 @@ am_libhcl_la_OBJECTS = libhcl_la-bigint.lo libhcl_la-comp.lo \
libhcl_la-hcl.lo libhcl_la-heap.lo libhcl_la-logfmt.lo \
libhcl_la-number.lo libhcl_la-obj.lo libhcl_la-opt.lo \
libhcl_la-prim.lo libhcl_la-print.lo libhcl_la-rbt.lo \
libhcl_la-read.lo libhcl_la-sym.lo libhcl_la-tmr.lo \
libhcl_la-utf8.lo libhcl_la-utl.lo
libhcl_la-read.lo libhcl_la-sym.lo libhcl_la-utf8.lo \
libhcl_la-utl.lo
libhcl_la_OBJECTS = $(am_libhcl_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@ -174,22 +166,17 @@ am__v_lt_1 =
libhcl_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libhcl_la_LDFLAGS) $(LDFLAGS) -o $@
am__libhclc_la_SOURCES_DIST = hcl-c.c hcl-c.h
@ENABLE_HCLC_TRUE@am_libhclc_la_OBJECTS = libhclc_la-hcl-c.lo
libhclc_la_OBJECTS = $(am_libhclc_la_OBJECTS)
libhclc_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
am__libhclex_la_SOURCES_DIST = tmr.c hcl-tmr.h xutl.c xutl-sa.h \
hcl-xutl.h hcl-s.c hcl-s.h hcl-c.c hcl-c.h
@ENABLE_HCLEX_TRUE@am_libhclex_la_OBJECTS = libhclex_la-tmr.lo \
@ENABLE_HCLEX_TRUE@ libhclex_la-xutl.lo libhclex_la-hcl-s.lo \
@ENABLE_HCLEX_TRUE@ libhclex_la-hcl-c.lo
libhclex_la_OBJECTS = $(am_libhclex_la_OBJECTS)
libhclex_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libhclc_la_LDFLAGS) $(LDFLAGS) -o $@
@ENABLE_HCLC_TRUE@am_libhclc_la_rpath = -rpath $(pkglibdir)
am__libhcls_la_SOURCES_DIST = hcl-s.c hcl-s.h
@ENABLE_HCLS_TRUE@am_libhcls_la_OBJECTS = libhcls_la-hcl-s.lo
libhcls_la_OBJECTS = $(am_libhcls_la_OBJECTS)
libhcls_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libhcls_la_LDFLAGS) $(LDFLAGS) -o $@
@ENABLE_HCLS_TRUE@am_libhcls_la_rpath = -rpath $(pkglibdir)
@ENABLE_HCLS_TRUE@am__EXEEXT_1 = hcls$(EXEEXT)
@ENABLE_HCLC_TRUE@am__EXEEXT_2 = hclc$(EXEEXT)
$(libhclex_la_LDFLAGS) $(LDFLAGS) -o $@
@ENABLE_HCLEX_TRUE@am_libhclex_la_rpath = -rpath $(pkglibdir)
@ENABLE_HCLEX_TRUE@am__EXEEXT_1 = hcls$(EXEEXT) hclc$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS)
am_hcl_OBJECTS = hcl-main.$(OBJEXT)
hcl_OBJECTS = $(am_hcl_OBJECTS)
@ -197,13 +184,13 @@ hcl_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(hcl_LDFLAGS) $(LDFLAGS) -o $@
am__hclc_SOURCES_DIST = main-c.c
@ENABLE_HCLC_TRUE@am_hclc_OBJECTS = hclc-main-c.$(OBJEXT)
@ENABLE_HCLEX_TRUE@am_hclc_OBJECTS = hclc-main-c.$(OBJEXT)
hclc_OBJECTS = $(am_hclc_OBJECTS)
hclc_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(hclc_LDFLAGS) $(LDFLAGS) -o $@
am__hcls_SOURCES_DIST = main-s.c
@ENABLE_HCLS_TRUE@am_hcls_OBJECTS = hcls-main-s.$(OBJEXT)
@ENABLE_HCLEX_TRUE@am_hcls_OBJECTS = hcls-main-s.$(OBJEXT)
hcls_OBJECTS = $(am_hcls_OBJECTS)
hcls_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
@ -242,19 +229,18 @@ 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_la_SOURCES) $(libhclc_la_SOURCES) \
$(libhcls_la_SOURCES) $(hcl_SOURCES) $(hclc_SOURCES) \
$(hcls_SOURCES)
DIST_SOURCES = $(libhcl_la_SOURCES) $(am__libhclc_la_SOURCES_DIST) \
$(am__libhcls_la_SOURCES_DIST) $(hcl_SOURCES) \
$(am__hclc_SOURCES_DIST) $(am__hcls_SOURCES_DIST)
SOURCES = $(libhcl_la_SOURCES) $(libhclex_la_SOURCES) $(hcl_SOURCES) \
$(hclc_SOURCES) $(hcls_SOURCES)
DIST_SOURCES = $(libhcl_la_SOURCES) $(am__libhclex_la_SOURCES_DIST) \
$(hcl_SOURCES) $(am__hclc_SOURCES_DIST) \
$(am__hcls_SOURCES_DIST)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__pkginclude_HEADERS_DIST = hcl.h hcl-cmn.h hcl-opt.h hcl-rbt.h \
hcl-tmr.h hcl-utl.h hcl-s.h hcl-c.h
hcl-utl.h hcl-c.h hcl-s.h hcl-tmr.h hcl-xutl.h
HEADERS = $(pkginclude_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
$(LISP)hcl-cfg.h.in
@ -449,15 +435,14 @@ CPPFLAGS_ALL_COMMON = \
CPPFLAGS_LIB_COMMON = $(CPPFLAGS_ALL_COMMON)
LDFLAGS_LIB_COMMON = $(LDFLAGS_ALL_COMMON) -version-info 1:0:0 -no-undefined
LIBADD_LIB_COMMON = $(LIBM) $(am__append_1) $(am__append_2)
pkginclude_HEADERS = hcl.h hcl-cmn.h hcl-opt.h hcl-rbt.h hcl-tmr.h \
hcl-utl.h $(am__append_4) $(am__append_6)
pkglib_LTLIBRARIES = libhcl.la $(am__append_3) $(am__append_5)
pkginclude_HEADERS = hcl.h hcl-cmn.h hcl-opt.h hcl-rbt.h hcl-utl.h \
$(am__append_6)
pkglib_LTLIBRARIES = libhcl.la $(am__append_5)
libhcl_la_SOURCES = \
hcl.h \
hcl-cmn.h \
hcl-opt.h \
hcl-rbt.h \
hcl-tmr.h \
hcl-utl.h \
hcl-prv.h \
bigint.c \
@ -481,40 +466,38 @@ libhcl_la_SOURCES = \
rbt.c \
read.c \
sym.c \
tmr.c \
utf8.c \
sa-utl.h \
utl.c
libhcl_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
libhcl_la_LDFLAGS = $(LDFLAGS_LIB_COMMON)
libhcl_la_LIBADD = $(LIBADD_LIB_COMMON) $(am__append_7)
libhcl_la_DEPENDENCIES = $(am__append_8)
@ENABLE_HCLS_TRUE@libhcls_la_SOURCES = hcl-s.c hcl-s.h
@ENABLE_HCLS_TRUE@libhcls_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
@ENABLE_HCLS_TRUE@libhcls_la_LDFLAGS = $(LDFLAGS_LIB_COMMON)
@ENABLE_HCLS_TRUE@libhcls_la_LIBADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS)
@ENABLE_HCLS_TRUE@libhcls_la_DEPENDENCIES =
@ENABLE_HCLC_TRUE@libhclc_la_SOURCES = hcl-c.c hcl-c.h
@ENABLE_HCLC_TRUE@libhclc_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
@ENABLE_HCLC_TRUE@libhclc_la_LDFLAGS = $(LDFLAGS_LIB_COMMON)
@ENABLE_HCLC_TRUE@libhclc_la_LIBADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS)
@ENABLE_HCLC_TRUE@libhclc_la_DEPENDENCIES =
libhcl_la_LIBADD = $(LIBADD_LIB_COMMON) $(am__append_3)
libhcl_la_DEPENDENCIES = $(am__append_4)
hcl_SOURCES = main.c
hcl_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
hcl_LDFLAGS = $(LDFLAGS_LIB_COMMON)
hcl_LDADD = $(LIBADD_LIB_COMMON) -lhcl
@ENABLE_STATIC_MODULE_TRUE@hcl_DEPENDENCIES = libhcl.la
@ENABLE_HCLS_TRUE@hcls_SOURCES = main-s.c
@ENABLE_HCLS_TRUE@hcls_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
@ENABLE_HCLS_TRUE@hcls_LDFLAGS = $(LDFLAGS_LIB_COMMON)
@ENABLE_HCLS_TRUE@hcls_LDADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhcl -lhcls
@ENABLE_HCLS_TRUE@@ENABLE_STATIC_MODULE_TRUE@hcls_DEPENDENCIES = libhcl.la libhcls.la
@ENABLE_HCLC_TRUE@hclc_SOURCES = main-c.c
@ENABLE_HCLC_TRUE@hclc_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
@ENABLE_HCLC_TRUE@hclc_LDFLAGS = $(LDFLAGS_LIB_COMMON)
@ENABLE_HCLC_TRUE@hclc_LDADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhcl -lhclc
@ENABLE_HCLC_TRUE@@ENABLE_STATIC_MODULE_TRUE@hclc_DEPENDENCIES = libhcl.la libhclc.la
hcl_DEPENDENCIES = libhcl.la
@ENABLE_HCLEX_TRUE@libhclex_la_SOURCES = \
@ENABLE_HCLEX_TRUE@ tmr.c hcl-tmr.h \
@ENABLE_HCLEX_TRUE@ xutl.c xutl-sa.h hcl-xutl.h \
@ENABLE_HCLEX_TRUE@ hcl-s.c hcl-s.h \
@ENABLE_HCLEX_TRUE@ hcl-c.c hcl-c.h
@ENABLE_HCLEX_TRUE@libhclex_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
@ENABLE_HCLEX_TRUE@libhclex_la_LDFLAGS = $(LDFLAGS_LIB_COMMON)
@ENABLE_HCLEX_TRUE@libhclex_la_LIBADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhcl
@ENABLE_HCLEX_TRUE@libhclex_la_DEPENDENCIES = libhcl.la
@ENABLE_HCLEX_TRUE@hcls_SOURCES = main-s.c
@ENABLE_HCLEX_TRUE@hcls_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
@ENABLE_HCLEX_TRUE@hcls_LDFLAGS = $(LDFLAGS_LIB_COMMON)
@ENABLE_HCLEX_TRUE@hcls_LDADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhcl -lhclex
@ENABLE_HCLEX_TRUE@hcls_DEPENDENCIES = libhclex.la
@ENABLE_HCLEX_TRUE@hclc_SOURCES = main-c.c
@ENABLE_HCLEX_TRUE@hclc_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
@ENABLE_HCLEX_TRUE@hclc_LDFLAGS = $(LDFLAGS_LIB_COMMON)
@ENABLE_HCLEX_TRUE@hclc_LDADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhcl -lhclex
@ENABLE_HCLEX_TRUE@hclc_DEPENDENCIES = libhclex.la
all: hcl-cfg.h
$(MAKE) $(AM_MAKEFLAGS) all-am
@ -603,11 +586,8 @@ clean-pkglibLTLIBRARIES:
libhcl.la: $(libhcl_la_OBJECTS) $(libhcl_la_DEPENDENCIES) $(EXTRA_libhcl_la_DEPENDENCIES)
$(AM_V_CCLD)$(libhcl_la_LINK) -rpath $(pkglibdir) $(libhcl_la_OBJECTS) $(libhcl_la_LIBADD) $(LIBS)
libhclc.la: $(libhclc_la_OBJECTS) $(libhclc_la_DEPENDENCIES) $(EXTRA_libhclc_la_DEPENDENCIES)
$(AM_V_CCLD)$(libhclc_la_LINK) $(am_libhclc_la_rpath) $(libhclc_la_OBJECTS) $(libhclc_la_LIBADD) $(LIBS)
libhcls.la: $(libhcls_la_OBJECTS) $(libhcls_la_DEPENDENCIES) $(EXTRA_libhcls_la_DEPENDENCIES)
$(AM_V_CCLD)$(libhcls_la_LINK) $(am_libhcls_la_rpath) $(libhcls_la_OBJECTS) $(libhcls_la_LIBADD) $(LIBS)
libhclex.la: $(libhclex_la_OBJECTS) $(libhclex_la_DEPENDENCIES) $(EXTRA_libhclex_la_DEPENDENCIES)
$(AM_V_CCLD)$(libhclex_la_LINK) $(am_libhclex_la_rpath) $(libhclex_la_OBJECTS) $(libhclex_la_LIBADD) $(LIBS)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
@ -698,11 +678,12 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhcl_la-rbt.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhcl_la-read.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhcl_la-sym.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhcl_la-tmr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhcl_la-utf8.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhcl_la-utl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhclc_la-hcl-c.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhcls_la-hcl-s.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhclex_la-hcl-c.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhclex_la-hcl-s.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhclex_la-tmr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhclex_la-xutl.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@ -861,13 +842,6 @@ libhcl_la-sym.lo: sym.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) $(libhcl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhcl_la-sym.lo `test -f 'sym.c' || echo '$(srcdir)/'`sym.c
libhcl_la-tmr.lo: tmr.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhcl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhcl_la-tmr.lo -MD -MP -MF $(DEPDIR)/libhcl_la-tmr.Tpo -c -o libhcl_la-tmr.lo `test -f 'tmr.c' || echo '$(srcdir)/'`tmr.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhcl_la-tmr.Tpo $(DEPDIR)/libhcl_la-tmr.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tmr.c' object='libhcl_la-tmr.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_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhcl_la-tmr.lo `test -f 'tmr.c' || echo '$(srcdir)/'`tmr.c
libhcl_la-utf8.lo: utf8.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhcl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhcl_la-utf8.lo -MD -MP -MF $(DEPDIR)/libhcl_la-utf8.Tpo -c -o libhcl_la-utf8.lo `test -f 'utf8.c' || echo '$(srcdir)/'`utf8.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhcl_la-utf8.Tpo $(DEPDIR)/libhcl_la-utf8.Plo
@ -882,19 +856,33 @@ libhcl_la-utl.lo: utl.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) $(libhcl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhcl_la-utl.lo `test -f 'utl.c' || echo '$(srcdir)/'`utl.c
libhclc_la-hcl-c.lo: hcl-c.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhclc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhclc_la-hcl-c.lo -MD -MP -MF $(DEPDIR)/libhclc_la-hcl-c.Tpo -c -o libhclc_la-hcl-c.lo `test -f 'hcl-c.c' || echo '$(srcdir)/'`hcl-c.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhclc_la-hcl-c.Tpo $(DEPDIR)/libhclc_la-hcl-c.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hcl-c.c' object='libhclc_la-hcl-c.lo' libtool=yes @AMDEPBACKSLASH@
libhclex_la-tmr.lo: tmr.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhclex_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhclex_la-tmr.lo -MD -MP -MF $(DEPDIR)/libhclex_la-tmr.Tpo -c -o libhclex_la-tmr.lo `test -f 'tmr.c' || echo '$(srcdir)/'`tmr.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhclex_la-tmr.Tpo $(DEPDIR)/libhclex_la-tmr.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tmr.c' object='libhclex_la-tmr.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) $(libhclc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhclc_la-hcl-c.lo `test -f 'hcl-c.c' || echo '$(srcdir)/'`hcl-c.c
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhclex_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhclex_la-tmr.lo `test -f 'tmr.c' || echo '$(srcdir)/'`tmr.c
libhcls_la-hcl-s.lo: hcl-s.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhcls_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhcls_la-hcl-s.lo -MD -MP -MF $(DEPDIR)/libhcls_la-hcl-s.Tpo -c -o libhcls_la-hcl-s.lo `test -f 'hcl-s.c' || echo '$(srcdir)/'`hcl-s.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhcls_la-hcl-s.Tpo $(DEPDIR)/libhcls_la-hcl-s.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hcl-s.c' object='libhcls_la-hcl-s.lo' libtool=yes @AMDEPBACKSLASH@
libhclex_la-xutl.lo: xutl.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhclex_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhclex_la-xutl.lo -MD -MP -MF $(DEPDIR)/libhclex_la-xutl.Tpo -c -o libhclex_la-xutl.lo `test -f 'xutl.c' || echo '$(srcdir)/'`xutl.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhclex_la-xutl.Tpo $(DEPDIR)/libhclex_la-xutl.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xutl.c' object='libhclex_la-xutl.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) $(libhcls_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhcls_la-hcl-s.lo `test -f 'hcl-s.c' || echo '$(srcdir)/'`hcl-s.c
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhclex_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhclex_la-xutl.lo `test -f 'xutl.c' || echo '$(srcdir)/'`xutl.c
libhclex_la-hcl-s.lo: hcl-s.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhclex_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhclex_la-hcl-s.lo -MD -MP -MF $(DEPDIR)/libhclex_la-hcl-s.Tpo -c -o libhclex_la-hcl-s.lo `test -f 'hcl-s.c' || echo '$(srcdir)/'`hcl-s.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhclex_la-hcl-s.Tpo $(DEPDIR)/libhclex_la-hcl-s.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hcl-s.c' object='libhclex_la-hcl-s.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) $(libhclex_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhclex_la-hcl-s.lo `test -f 'hcl-s.c' || echo '$(srcdir)/'`hcl-s.c
libhclex_la-hcl-c.lo: hcl-c.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhclex_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhclex_la-hcl-c.lo -MD -MP -MF $(DEPDIR)/libhclex_la-hcl-c.Tpo -c -o libhclex_la-hcl-c.lo `test -f 'hcl-c.c' || echo '$(srcdir)/'`hcl-c.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhclex_la-hcl-c.Tpo $(DEPDIR)/libhclex_la-hcl-c.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hcl-c.c' object='libhclex_la-hcl-c.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) $(libhclex_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhclex_la-hcl-c.lo `test -f 'hcl-c.c' || echo '$(srcdir)/'`hcl-c.c
hcl-main.o: main.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hcl_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hcl-main.o -MD -MP -MF $(DEPDIR)/hcl-main.Tpo -c -o hcl-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c

View File

@ -29,7 +29,6 @@
#include <hcl.h>
typedef struct hcl_client_t hcl_client_t;
enum hcl_client_option_t

View File

@ -27,6 +27,7 @@
#include "hcl-s.h"
#include "hcl-prv.h"
#include "hcl-tmr.h"
#include "hcl-xutl.h"
#include <stdio.h>
#include <string.h>

View File

@ -198,6 +198,8 @@ HCL_EXPORT void hcl_server_freemem (
void* ptr
);
HCL_EXPORT int hcl_server_proto_feed_reply (
hcl_server_proto_t* proto,
const hcl_ooch_t* ptr,

View File

@ -60,7 +60,7 @@
#define HCL_APPEND_TO_OOP_LIST(hcl, list, node_type, node, _link) do { \
(node)->_link.next = (node_type)(hcl)->_nil; \
(node)->_link.prev = (list)->last; \
(node)->_link.prev = (extern "C" {list)->last; \
if ((hcl_oop_t)(list)->last != (hcl)->_nil) (list)->last->_link.next = (node); \
else (list)->first = (node); \
(list)->last = (node); \
@ -116,69 +116,6 @@
#endif
#if (HCL_SIZEOF_SOCKLEN_T == 1)
#if defined(HCL_SOCKLEN_T_IS_SIGNED)
typedef hcl_int8_t hcl_scklen_t;
#else
typedef hcl_uint8_t hcl_scklen_t;
#endif
#elif (HCL_SIZEOF_SOCKLEN_T == 2)
#if defined(HCL_SOCKLEN_T_IS_SIGNED)
typedef hcl_int16_t hcl_scklen_t;
#else
typedef hcl_uint16_t hcl_scklen_t;
#endif
#elif (HCL_SIZEOF_SOCKLEN_T == 4)
#if defined(HCL_SOCKLEN_T_IS_SIGNED)
typedef hcl_int32_t hcl_scklen_t;
#else
typedef hcl_uint32_t hcl_scklen_t;
#endif
#elif (HCL_SIZEOF_SOCKLEN_T == 8)
#if defined(HCL_SOCKLEN_T_IS_SIGNED)
typedef hcl_int64_t hcl_scklen_t;
#else
typedef hcl_uint64_t hcl_scklen_t;
#endif
#else
#undef HCL_SIZEOF_SOCKLEN_T
#define HCL_SIZEOF_SOCKLEN_T HCL_SIZEOF_INT
#define HCL_SOCKLEN_T_IS_SIGNED
typedef int hcl_scklen_t;
#endif
struct hcl_sckaddr_t
{
#define HCL_SCKADDR_DATA_SIZE 0
#if (HCL_SIZEOF_STRUCT_SOCKADDR_IN > HCL_SCKADDR_DATA_SIZE)
#undef HCL_SCKADDR_DATA_SIZE
#define HCL_SCKADDR_DATA_SIZE HCL_SIZEOF_STRUCT_SOCKADDR_IN
#endif
#if (HCL_SIZEOF_STRUCT_SOCKADDR_IN6 > HCL_SCKADDR_DATA_SIZE)
#undef HCL_SCKADDR_DATA_SIZE
#define HCL_SCKADDR_DATA_SIZE HCL_SIZEOF_STRUCT_SOCKADDR_IN6
#endif
#if (HCL_SIZEOF_STRUCT_SOCKADDR_UN > HCL_SCKADDR_DATA_SIZE)
#undef HCL_SCKADDR_DATA_SIZE
#define HCL_SCKADDR_DATA_SIZE HCL_SIZEOF_STRUCT_SOCKADDR_UN
#endif
#if (HCL_SIZEOF_STRUCT_SOCKADDR_LL > HCL_SCKADDR_DATA_SIZE)
#undef HCL_SCKADDR_DATA_SIZE
#define HCL_SCKADDR_DATA_SIZE HCL_SIZEOF_STRUCT_SOCKADDR_LL
#endif
#if (HCL_SCKADDR_DATA_SIZE == 0)
#undef HCL_SCKADDR_DATA_SIZE
#define HCL_SCKADDR_DATA_SIZE 64
#endif
hcl_uint8_t storage[HCL_SCKADDR_DATA_SIZE];
};
typedef struct hcl_sckaddr_t hcl_sckaddr_t;
#if defined(__cplusplus)
extern "C" {
#endif
@ -587,54 +524,6 @@ HCL_EXPORT hcl_uint128_t hcl_hton128 (
#endif
HCL_EXPORT int hcl_ucharstosckaddr (
hcl_t* hcl,
const hcl_uch_t* str,
hcl_oow_t len,
hcl_sckaddr_t* sckaddr,
hcl_scklen_t* scklen
);
HCL_EXPORT int hcl_bcharstosckaddr (
hcl_t* hcl,
const hcl_bch_t* str,
hcl_oow_t len,
hcl_sckaddr_t* sckaddr,
hcl_scklen_t* scklen
);
#if defined(HCL_HAVE_INLINE)
static HCL_INLINE int hcl_uchars_to_sckaddr (const hcl_uch_t* str, hcl_oow_t len, hcl_sckaddr_t* sckaddr, hcl_scklen_t* scklen)
{
return hcl_ucharstosckaddr(HCL_NULL, str, len, sckaddr, scklen);
}
static HCL_INLINE int hcl_bchars_to_sckaddr (const hcl_bch_t* str, hcl_oow_t len, hcl_sckaddr_t* sckaddr, hcl_scklen_t* scklen)
{
return hcl_bcharstosckaddr(HCL_NULL, str, len, sckaddr, scklen);
}
#else
#define hcl_uchars_to_sckaddr(str,len,sckaddr,scklen) hcl_ucharstosckaddr(HCL_NULL,str,len,sckaddr,scklen)
#define hcl_bchars_to_sckaddr(str,len,sckaddr,scklen) hcl_bcharstosckaddr(HCL_NULL,str,len,sckaddr,scklen)
#endif
#if defined(HCL_OOCH_IS_UCH)
# define hcl_oocharstosckaddr hcl_ucharstosckaddr
# define hcl_oochars_to_sckaddr hcl_uchars_to_sckaddr
#else
# define hcl_oocharstosckaddr hcl_bcharstosckaddr
# define hcl_oochars_to_sckaddr hcl_bchars_to_sckaddr
#endif
/**
* The hcl_get_sckaddr_info() function returns the socket family.
* if \a scklen is not #HCL_NULL, it also sets the actual address length
* in the memory pointed to by it.
*/
HCL_EXPORT int hcl_get_sckaddr_info (
const hcl_sckaddr_t* sckaddr,
hcl_scklen_t* scklen
);
#if defined(__cplusplus)
}
#endif

150
lib/hcl-xutl.h Normal file
View File

@ -0,0 +1,150 @@
/*
* $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_XUTL_H_
#define _HCL_XUTL_H_
#include "hcl-cmn.h"
#if (HCL_SIZEOF_SOCKLEN_T == 1)
#if defined(HCL_SOCKLEN_T_IS_SIGNED)
typedef hcl_int8_t hcl_scklen_t;
#else
typedef hcl_uint8_t hcl_scklen_t;
#endif
#elif (HCL_SIZEOF_SOCKLEN_T == 2)
#if defined(HCL_SOCKLEN_T_IS_SIGNED)
typedef hcl_int16_t hcl_scklen_t;
#else
typedef hcl_uint16_t hcl_scklen_t;
#endif
#elif (HCL_SIZEOF_SOCKLEN_T == 4)
#if defined(HCL_SOCKLEN_T_IS_SIGNED)
typedef hcl_int32_t hcl_scklen_t;
#else
typedef hcl_uint32_t hcl_scklen_t;
#endif
#elif (HCL_SIZEOF_SOCKLEN_T == 8)
#if defined(HCL_SOCKLEN_T_IS_SIGNED)
typedef hcl_int64_t hcl_scklen_t;
#else
typedef hcl_uint64_t hcl_scklen_t;
#endif
#else
#undef HCL_SIZEOF_SOCKLEN_T
#define HCL_SIZEOF_SOCKLEN_T HCL_SIZEOF_INT
#define HCL_SOCKLEN_T_IS_SIGNED
typedef int hcl_scklen_t;
#endif
struct hcl_sckaddr_t
{
#define HCL_SCKADDR_DATA_SIZE 0
#if (HCL_SIZEOF_STRUCT_SOCKADDR_IN > HCL_SCKADDR_DATA_SIZE)
#undef HCL_SCKADDR_DATA_SIZE
#define HCL_SCKADDR_DATA_SIZE HCL_SIZEOF_STRUCT_SOCKADDR_IN
#endif
#if (HCL_SIZEOF_STRUCT_SOCKADDR_IN6 > HCL_SCKADDR_DATA_SIZE)
#undef HCL_SCKADDR_DATA_SIZE
#define HCL_SCKADDR_DATA_SIZE HCL_SIZEOF_STRUCT_SOCKADDR_IN6
#endif
#if (HCL_SIZEOF_STRUCT_SOCKADDR_UN > HCL_SCKADDR_DATA_SIZE)
#undef HCL_SCKADDR_DATA_SIZE
#define HCL_SCKADDR_DATA_SIZE HCL_SIZEOF_STRUCT_SOCKADDR_UN
#endif
#if (HCL_SIZEOF_STRUCT_SOCKADDR_LL > HCL_SCKADDR_DATA_SIZE)
#undef HCL_SCKADDR_DATA_SIZE
#define HCL_SCKADDR_DATA_SIZE HCL_SIZEOF_STRUCT_SOCKADDR_LL
#endif
#if (HCL_SCKADDR_DATA_SIZE == 0)
#undef HCL_SCKADDR_DATA_SIZE
#define HCL_SCKADDR_DATA_SIZE 64
#endif
hcl_uint8_t storage[HCL_SCKADDR_DATA_SIZE];
};
typedef struct hcl_sckaddr_t hcl_sckaddr_t;
#if defined(__cplusplus)
extern "C" {
#endif
HCL_EXPORT int hcl_ucharstosckaddr (
hcl_t* hcl,
const hcl_uch_t* str,
hcl_oow_t len,
hcl_sckaddr_t* sckaddr,
hcl_scklen_t* scklen
);
HCL_EXPORT int hcl_bcharstosckaddr (
hcl_t* hcl,
const hcl_bch_t* str,
hcl_oow_t len,
hcl_sckaddr_t* sckaddr,
hcl_scklen_t* scklen
);
#if defined(HCL_HAVE_INLINE)
static HCL_INLINE int hcl_uchars_to_sckaddr (const hcl_uch_t* str, hcl_oow_t len, hcl_sckaddr_t* sckaddr, hcl_scklen_t* scklen)
{
return hcl_ucharstosckaddr(HCL_NULL, str, len, sckaddr, scklen);
}
static HCL_INLINE int hcl_bchars_to_sckaddr (const hcl_bch_t* str, hcl_oow_t len, hcl_sckaddr_t* sckaddr, hcl_scklen_t* scklen)
{
return hcl_bcharstosckaddr(HCL_NULL, str, len, sckaddr, scklen);
}
#else
#define hcl_uchars_to_sckaddr(str,len,sckaddr,scklen) hcl_ucharstosckaddr(HCL_NULL,str,len,sckaddr,scklen)
#define hcl_bchars_to_sckaddr(str,len,sckaddr,scklen) hcl_bcharstosckaddr(HCL_NULL,str,len,sckaddr,scklen)
#endif
#if defined(HCL_OOCH_IS_UCH)
# define hcl_oocharstosckaddr hcl_ucharstosckaddr
# define hcl_oochars_to_sckaddr hcl_uchars_to_sckaddr
#else
# define hcl_oocharstosckaddr hcl_bcharstosckaddr
# define hcl_oochars_to_sckaddr hcl_bchars_to_sckaddr
#endif
/**
* The hcl_get_sckaddr_info() function returns the socket family.
* if \a scklen is not #HCL_NULL, it also sets the actual address length
* in the memory pointed to by it.
*/
HCL_EXPORT int hcl_get_sckaddr_info (
const hcl_sckaddr_t* sckaddr,
hcl_scklen_t* scklen
);
#if defined(__cplusplus)
}
#endif
#endif

View File

@ -27,6 +27,7 @@
#include "hcl-c.h"
#include "hcl-opt.h"
#include "hcl-utl.h"
#include "hcl-xutl.h"
#include <stdio.h>
#include <stdlib.h>

View File

@ -27,6 +27,7 @@
#include "hcl-s.h"
#include "hcl-opt.h"
#include "hcl-utl.h"
#include "hcl-xutl.h"
#include <stdio.h>
#include <stdlib.h>

View File

@ -1068,85 +1068,3 @@ hcl_uint128_t hcl_hton128 (hcl_uint128_t x)
#endif
/* --------------------------------------------------------------- */
#if defined(_WIN32)
# include <winsock2.h>
# include <ws2tcpip.h> /* sockaddr_in6 */
# include <windows.h>
#elif defined(__OS2__)
# if defined(TCPV40HDRS)
# define BSD_SELECT
# endif
# include <types.h>
# include <sys/socket.h>
# include <netinet/in.h>
#else
# include <netinet/in.h>
#endif
union sockaddr_t
{
struct sockaddr sa;
#if (HCL_SIZEOF_STRUCT_SOCKADDR_IN > 0)
struct sockaddr_in in4;
#endif
#if (HCL_SIZEOF_STRUCT_SOCKADDR_IN6 > 0)
struct sockaddr_in6 in6;
#endif
};
typedef union sockaddr_t sockaddr_t;
#undef ooch_t
#undef oocs_t
#undef str_to_ipv4
#undef str_to_ipv6
#undef str_to_sockaddr
#define ooch_t hcl_bch_t
#define oocs_t hcl_bcs_t
#define str_to_ipv4 bchars_to_ipv4
#define str_to_ipv6 bchars_to_ipv6
#define str_to_sockaddr hcl_bcharstosckaddr
#include "sa-utl.h"
#undef ooch_t
#undef oocs_t
#undef str_to_ipv4
#undef str_to_ipv6
#undef str_to_sockaddr
#define ooch_t hcl_uch_t
#define oocs_t hcl_ucs_t
#define str_to_ipv4 uchars_to_ipv4
#define str_to_ipv6 uchars_to_ipv6
#define str_to_sockaddr hcl_ucharstosckaddr
#include "sa-utl.h"
int hcl_get_sckaddr_info (const hcl_sckaddr_t* sckaddr, hcl_scklen_t* scklen)
{
sockaddr_t* sa = (sockaddr_t*)sckaddr;
if (scklen)
{
switch (sa->sa.sa_family)
{
#if (HCL_SIZEOF_STRUCT_SOCKADDR_IN > 0)
case AF_INET:
*scklen = HCL_SIZEOF(sa->in4);
break;
#endif
#if (HCL_SIZEOF_STRUCT_SOCKADDR_IN6 > 0)
case AF_INET6:
*scklen = HCL_SIZEOF(sa->in6);
break;
#endif
default:
*scklen = 0; /* unknown */
break;
}
}
return sa->sa.sa_family;
}

107
lib/xutl.c Normal file
View File

@ -0,0 +1,107 @@
/*
* $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 <hcl-xutl.h>
#include "hcl-prv.h"
#if defined(_WIN32)
# include <winsock2.h>
# include <ws2tcpip.h> /* sockaddr_in6 */
# include <windows.h>
#elif defined(__OS2__)
# if defined(TCPV40HDRS)
# define BSD_SELECT
# endif
# include <types.h>
# include <sys/socket.h>
# include <netinet/in.h>
#else
# include <netinet/in.h>
#endif
union sockaddr_t
{
struct sockaddr sa;
#if (HCL_SIZEOF_STRUCT_SOCKADDR_IN > 0)
struct sockaddr_in in4;
#endif
#if (HCL_SIZEOF_STRUCT_SOCKADDR_IN6 > 0)
struct sockaddr_in6 in6;
#endif
};
typedef union sockaddr_t sockaddr_t;
#undef ooch_t
#undef oocs_t
#undef str_to_ipv4
#undef str_to_ipv6
#undef str_to_sockaddr
#define ooch_t hcl_bch_t
#define oocs_t hcl_bcs_t
#define str_to_ipv4 bchars_to_ipv4
#define str_to_ipv6 bchars_to_ipv6
#define str_to_sockaddr hcl_bcharstosckaddr
#include "xutl-sa.h"
#undef ooch_t
#undef oocs_t
#undef str_to_ipv4
#undef str_to_ipv6
#undef str_to_sockaddr
#define ooch_t hcl_uch_t
#define oocs_t hcl_ucs_t
#define str_to_ipv4 uchars_to_ipv4
#define str_to_ipv6 uchars_to_ipv6
#define str_to_sockaddr hcl_ucharstosckaddr
#include "xutl-sa.h"
int hcl_get_sckaddr_info (const hcl_sckaddr_t* sckaddr, hcl_scklen_t* scklen)
{
sockaddr_t* sa = (sockaddr_t*)sckaddr;
if (scklen)
{
switch (sa->sa.sa_family)
{
#if (HCL_SIZEOF_STRUCT_SOCKADDR_IN > 0)
case AF_INET:
*scklen = HCL_SIZEOF(sa->in4);
break;
#endif
#if (HCL_SIZEOF_STRUCT_SOCKADDR_IN6 > 0)
case AF_INET6:
*scklen = HCL_SIZEOF(sa->in6);
break;
#endif
default:
*scklen = 0; /* unknown */
break;
}
}
return sa->sa.sa_family;
}