refactored fmt code

This commit is contained in:
hyung-hwan 2019-05-31 10:54:13 +00:00
parent 4ce47cb435
commit a161944682
15 changed files with 364 additions and 2801 deletions

View File

@ -32,27 +32,27 @@ hcl_DEPENDENCIES = ../lib/libhcl.la
if ENABLE_HCLEX
## cb-impl.c is included in libhclex.
## cb-impl.c is included in libhclx.
## so ../lib/cb-impl.h and ../lib/cb-impl.c are not listed as sources
bin_PROGRAMS += hcls
hcls_SOURCES = main-s.c
hcls_CPPFLAGS = $(CPPFLAGS_ALL_COMMON)
hcls_LDFLAGS = $(LDFLAGS_ALL_COMMON)
hcls_LDADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhcl -lhclex
hcls_DEPENDENCIES = ../lib/libhclex.la
hcls_LDADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhclx
hcls_DEPENDENCIES = ../lib/libhclx.la
bin_PROGRAMS += hclc
hclc_SOURCES = main-c.c
hclc_CPPFLAGS = $(CPPFLAGS_ALL_COMMON)
hclc_LDFLAGS = $(LDFLAGS_ALL_COMMON)
hclc_LDADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhcl -lhclex
hclc_DEPENDENCIES = ../lib/libhclex.la
hclc_LDADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhclx
hclc_DEPENDENCIES = ../lib/libhclx.la
bin_PROGRAMS += hclj
hclj_SOURCES = main-j.c
hclj_CPPFLAGS = $(CPPFLAGS_ALL_COMMON)
hclj_LDFLAGS = $(LDFLAGS_ALL_COMMON)
hclj_LDADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhcl -lhclex
hclj_DEPENDENCIES = ../lib/libhclex.la
hclj_LDADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhclx
hclj_DEPENDENCIES = ../lib/libhclx.la
endif

View File

@ -384,18 +384,18 @@ hcl_DEPENDENCIES = ../lib/libhcl.la
@ENABLE_HCLEX_TRUE@hcls_SOURCES = main-s.c
@ENABLE_HCLEX_TRUE@hcls_CPPFLAGS = $(CPPFLAGS_ALL_COMMON)
@ENABLE_HCLEX_TRUE@hcls_LDFLAGS = $(LDFLAGS_ALL_COMMON)
@ENABLE_HCLEX_TRUE@hcls_LDADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhcl -lhclex
@ENABLE_HCLEX_TRUE@hcls_DEPENDENCIES = ../lib/libhclex.la
@ENABLE_HCLEX_TRUE@hcls_LDADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhclx
@ENABLE_HCLEX_TRUE@hcls_DEPENDENCIES = ../lib/libhclx.la
@ENABLE_HCLEX_TRUE@hclc_SOURCES = main-c.c
@ENABLE_HCLEX_TRUE@hclc_CPPFLAGS = $(CPPFLAGS_ALL_COMMON)
@ENABLE_HCLEX_TRUE@hclc_LDFLAGS = $(LDFLAGS_ALL_COMMON)
@ENABLE_HCLEX_TRUE@hclc_LDADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhcl -lhclex
@ENABLE_HCLEX_TRUE@hclc_DEPENDENCIES = ../lib/libhclex.la
@ENABLE_HCLEX_TRUE@hclc_LDADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhclx
@ENABLE_HCLEX_TRUE@hclc_DEPENDENCIES = ../lib/libhclx.la
@ENABLE_HCLEX_TRUE@hclj_SOURCES = main-j.c
@ENABLE_HCLEX_TRUE@hclj_CPPFLAGS = $(CPPFLAGS_ALL_COMMON)
@ENABLE_HCLEX_TRUE@hclj_LDFLAGS = $(LDFLAGS_ALL_COMMON)
@ENABLE_HCLEX_TRUE@hclj_LDADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhcl -lhclex
@ENABLE_HCLEX_TRUE@hclj_DEPENDENCIES = ../lib/libhclex.la
@ENABLE_HCLEX_TRUE@hclj_LDADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhclx
@ENABLE_HCLEX_TRUE@hclj_DEPENDENCIES = ../lib/libhclx.la
all: all-am
.SUFFIXES:

View File

@ -1192,7 +1192,7 @@ count++;
code_offset = hcl_getbclen(hcl);
if (verbose) hcl_proutbfmt (hcl, 0, "\n"); /* flush the output buffer by hcl_print above */
if (verbose) hcl_prbfmt (hcl, "\n"); /* flush the output buffer by hcl_print above */
if (hcl_compile(hcl, obj) <= -1)
{
if (hcl->errnum == HCL_ESYNERR)

View File

@ -70,11 +70,10 @@ libhcl_la_SOURCES = \
dic.c \
err.c \
exec.c \
fmt.c \
gc.c \
hcl.c \
heap.c \
logfmtv.h \
logfmt.c \
number.c \
obj.c \
opt-impl.h \
@ -103,19 +102,19 @@ libhcl_la_DEPENDENCIES += $(abs_builddir)/../mod/libhcl-sys.la
endif
if ENABLE_HCLEX
pkglib_LTLIBRARIES += libhclex.la
pkglib_LTLIBRARIES += libhclx.la
pkginclude_HEADERS += hcl-c.h hcl-s.h hcl-tmr.h hcl-xutl.h hcl-json.h
libhclex_la_SOURCES = \
libhclx_la_SOURCES = \
tmr.c hcl-tmr.h \
xutl.c xutl-sa.h hcl-xutl.h \
json.c hcl-json.h \
cb-impl.h cb-impl.c \
hcl-s.c hcl-s.h \
hcl-c.c hcl-c.h
libhclex_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) $(CPPFLAGS_PFMOD)
libhclex_la_LDFLAGS = $(LDFLAGS_LIB_COMMON)
libhclex_la_LIBADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhcl
libhclex_la_DEPENDENCIES = libhcl.la
libhclx_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) $(CPPFLAGS_PFMOD)
libhclx_la_LDFLAGS = $(LDFLAGS_LIB_COMMON)
libhclx_la_LIBADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhcl
libhclx_la_DEPENDENCIES = libhcl.la
endif

View File

@ -98,7 +98,7 @@ host_triplet = @host@
@ENABLE_STATIC_MODULE_TRUE@ $(abs_builddir)/../mod/libhcl-dic.la \
@ENABLE_STATIC_MODULE_TRUE@ $(abs_builddir)/../mod/libhcl-str.la \
@ENABLE_STATIC_MODULE_TRUE@ $(abs_builddir)/../mod/libhcl-sys.la
@ENABLE_HCLEX_TRUE@am__append_8 = libhclex.la
@ENABLE_HCLEX_TRUE@am__append_8 = libhclx.la
@ENABLE_HCLEX_TRUE@am__append_9 = hcl-c.h hcl-s.h hcl-tmr.h hcl-xutl.h hcl-json.h
subdir = lib
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@ -154,8 +154,8 @@ am__DEPENDENCIES_5 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \
$(am__DEPENDENCIES_3) $(am__DEPENDENCIES_4)
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-err.lo libhcl_la-exec.lo libhcl_la-gc.lo \
libhcl_la-hcl.lo libhcl_la-heap.lo libhcl_la-logfmt.lo \
libhcl_la-err.lo libhcl_la-exec.lo libhcl_la-fmt.lo \
libhcl_la-gc.lo libhcl_la-hcl.lo libhcl_la-heap.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-utf8.lo \
@ -168,18 +168,18 @@ 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__libhclex_la_SOURCES_DIST = tmr.c hcl-tmr.h xutl.c xutl-sa.h \
am__libhclx_la_SOURCES_DIST = tmr.c hcl-tmr.h xutl.c xutl-sa.h \
hcl-xutl.h json.c hcl-json.h cb-impl.h cb-impl.c 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-json.lo \
@ENABLE_HCLEX_TRUE@ libhclex_la-cb-impl.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) \
@ENABLE_HCLEX_TRUE@am_libhclx_la_OBJECTS = libhclx_la-tmr.lo \
@ENABLE_HCLEX_TRUE@ libhclx_la-xutl.lo libhclx_la-json.lo \
@ENABLE_HCLEX_TRUE@ libhclx_la-cb-impl.lo libhclx_la-hcl-s.lo \
@ENABLE_HCLEX_TRUE@ libhclx_la-hcl-c.lo
libhclx_la_OBJECTS = $(am_libhclx_la_OBJECTS)
libhclx_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libhclex_la_LDFLAGS) $(LDFLAGS) -o $@
@ENABLE_HCLEX_TRUE@am_libhclex_la_rpath = -rpath $(pkglibdir)
$(libhclx_la_LDFLAGS) $(LDFLAGS) -o $@
@ENABLE_HCLEX_TRUE@am_libhclx_la_rpath = -rpath $(pkglibdir)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@ -214,8 +214,8 @@ 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) $(libhclex_la_SOURCES)
DIST_SOURCES = $(libhcl_la_SOURCES) $(am__libhclex_la_SOURCES_DIST)
SOURCES = $(libhcl_la_SOURCES) $(libhclx_la_SOURCES)
DIST_SOURCES = $(libhcl_la_SOURCES) $(am__libhclx_la_SOURCES_DIST)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@ -444,11 +444,10 @@ libhcl_la_SOURCES = \
dic.c \
err.c \
exec.c \
fmt.c \
gc.c \
hcl.c \
heap.c \
logfmtv.h \
logfmt.c \
number.c \
obj.c \
opt-impl.h \
@ -465,7 +464,7 @@ libhcl_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
libhcl_la_LDFLAGS = $(LDFLAGS_LIB_COMMON)
libhcl_la_LIBADD = $(LIBADD_LIB_COMMON) $(am__append_6)
libhcl_la_DEPENDENCIES = $(am__append_7)
@ENABLE_HCLEX_TRUE@libhclex_la_SOURCES = \
@ENABLE_HCLEX_TRUE@libhclx_la_SOURCES = \
@ENABLE_HCLEX_TRUE@ tmr.c hcl-tmr.h \
@ENABLE_HCLEX_TRUE@ xutl.c xutl-sa.h hcl-xutl.h \
@ENABLE_HCLEX_TRUE@ json.c hcl-json.h \
@ -473,10 +472,10 @@ libhcl_la_DEPENDENCIES = $(am__append_7)
@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) $(CPPFLAGS_PFMOD)
@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@libhclx_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) $(CPPFLAGS_PFMOD)
@ENABLE_HCLEX_TRUE@libhclx_la_LDFLAGS = $(LDFLAGS_LIB_COMMON)
@ENABLE_HCLEX_TRUE@libhclx_la_LIBADD = $(LIBADD_LIB_COMMON) $(PTHREAD_LIBS) -lhcl
@ENABLE_HCLEX_TRUE@libhclx_la_DEPENDENCIES = libhcl.la
all: hcl-cfg.h
$(MAKE) $(AM_MAKEFLAGS) all-am
@ -565,8 +564,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)
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)
libhclx.la: $(libhclx_la_OBJECTS) $(libhclx_la_DEPENDENCIES) $(EXTRA_libhclx_la_DEPENDENCIES)
$(AM_V_CCLD)$(libhclx_la_LINK) $(am_libhclx_la_rpath) $(libhclx_la_OBJECTS) $(libhclx_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@ -581,10 +580,10 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhcl_la-dic.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhcl_la-err.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhcl_la-exec.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhcl_la-fmt.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhcl_la-gc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhcl_la-hcl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhcl_la-heap.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhcl_la-logfmt.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhcl_la-number.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhcl_la-obj.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhcl_la-opt.Plo@am__quote@
@ -595,12 +594,12 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhcl_la-sym.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)/libhclex_la-cb-impl.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-json.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@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhclx_la-cb-impl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhclx_la-hcl-c.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhclx_la-hcl-s.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhclx_la-json.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhclx_la-tmr.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhclx_la-xutl.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@ -675,6 +674,13 @@ libhcl_la-exec.lo: exec.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-exec.lo `test -f 'exec.c' || echo '$(srcdir)/'`exec.c
libhcl_la-fmt.lo: fmt.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-fmt.lo -MD -MP -MF $(DEPDIR)/libhcl_la-fmt.Tpo -c -o libhcl_la-fmt.lo `test -f 'fmt.c' || echo '$(srcdir)/'`fmt.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhcl_la-fmt.Tpo $(DEPDIR)/libhcl_la-fmt.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fmt.c' object='libhcl_la-fmt.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-fmt.lo `test -f 'fmt.c' || echo '$(srcdir)/'`fmt.c
libhcl_la-gc.lo: gc.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-gc.lo -MD -MP -MF $(DEPDIR)/libhcl_la-gc.Tpo -c -o libhcl_la-gc.lo `test -f 'gc.c' || echo '$(srcdir)/'`gc.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhcl_la-gc.Tpo $(DEPDIR)/libhcl_la-gc.Plo
@ -696,13 +702,6 @@ libhcl_la-heap.lo: heap.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-heap.lo `test -f 'heap.c' || echo '$(srcdir)/'`heap.c
libhcl_la-logfmt.lo: logfmt.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-logfmt.lo -MD -MP -MF $(DEPDIR)/libhcl_la-logfmt.Tpo -c -o libhcl_la-logfmt.lo `test -f 'logfmt.c' || echo '$(srcdir)/'`logfmt.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhcl_la-logfmt.Tpo $(DEPDIR)/libhcl_la-logfmt.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='logfmt.c' object='libhcl_la-logfmt.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-logfmt.lo `test -f 'logfmt.c' || echo '$(srcdir)/'`logfmt.c
libhcl_la-number.lo: number.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-number.lo -MD -MP -MF $(DEPDIR)/libhcl_la-number.Tpo -c -o libhcl_la-number.lo `test -f 'number.c' || echo '$(srcdir)/'`number.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhcl_la-number.Tpo $(DEPDIR)/libhcl_la-number.Plo
@ -773,47 +772,47 @@ 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
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@
libhclx_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) $(libhclx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhclx_la-tmr.lo -MD -MP -MF $(DEPDIR)/libhclx_la-tmr.Tpo -c -o libhclx_la-tmr.lo `test -f 'tmr.c' || echo '$(srcdir)/'`tmr.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhclx_la-tmr.Tpo $(DEPDIR)/libhclx_la-tmr.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tmr.c' object='libhclx_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) $(libhclex_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhclex_la-tmr.lo `test -f 'tmr.c' || echo '$(srcdir)/'`tmr.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) $(libhclx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhclx_la-tmr.lo `test -f 'tmr.c' || echo '$(srcdir)/'`tmr.c
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@
libhclx_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) $(libhclx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhclx_la-xutl.lo -MD -MP -MF $(DEPDIR)/libhclx_la-xutl.Tpo -c -o libhclx_la-xutl.lo `test -f 'xutl.c' || echo '$(srcdir)/'`xutl.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhclx_la-xutl.Tpo $(DEPDIR)/libhclx_la-xutl.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xutl.c' object='libhclx_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) $(libhclex_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhclex_la-xutl.lo `test -f 'xutl.c' || echo '$(srcdir)/'`xutl.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) $(libhclx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhclx_la-xutl.lo `test -f 'xutl.c' || echo '$(srcdir)/'`xutl.c
libhclex_la-json.lo: json.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-json.lo -MD -MP -MF $(DEPDIR)/libhclex_la-json.Tpo -c -o libhclex_la-json.lo `test -f 'json.c' || echo '$(srcdir)/'`json.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhclex_la-json.Tpo $(DEPDIR)/libhclex_la-json.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='json.c' object='libhclex_la-json.lo' libtool=yes @AMDEPBACKSLASH@
libhclx_la-json.lo: json.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhclx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhclx_la-json.lo -MD -MP -MF $(DEPDIR)/libhclx_la-json.Tpo -c -o libhclx_la-json.lo `test -f 'json.c' || echo '$(srcdir)/'`json.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhclx_la-json.Tpo $(DEPDIR)/libhclx_la-json.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='json.c' object='libhclx_la-json.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-json.lo `test -f 'json.c' || echo '$(srcdir)/'`json.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) $(libhclx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhclx_la-json.lo `test -f 'json.c' || echo '$(srcdir)/'`json.c
libhclex_la-cb-impl.lo: cb-impl.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-cb-impl.lo -MD -MP -MF $(DEPDIR)/libhclex_la-cb-impl.Tpo -c -o libhclex_la-cb-impl.lo `test -f 'cb-impl.c' || echo '$(srcdir)/'`cb-impl.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhclex_la-cb-impl.Tpo $(DEPDIR)/libhclex_la-cb-impl.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cb-impl.c' object='libhclex_la-cb-impl.lo' libtool=yes @AMDEPBACKSLASH@
libhclx_la-cb-impl.lo: cb-impl.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhclx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhclx_la-cb-impl.lo -MD -MP -MF $(DEPDIR)/libhclx_la-cb-impl.Tpo -c -o libhclx_la-cb-impl.lo `test -f 'cb-impl.c' || echo '$(srcdir)/'`cb-impl.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhclx_la-cb-impl.Tpo $(DEPDIR)/libhclx_la-cb-impl.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cb-impl.c' object='libhclx_la-cb-impl.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-cb-impl.lo `test -f 'cb-impl.c' || echo '$(srcdir)/'`cb-impl.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) $(libhclx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhclx_la-cb-impl.lo `test -f 'cb-impl.c' || echo '$(srcdir)/'`cb-impl.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@
libhclx_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) $(libhclx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhclx_la-hcl-s.lo -MD -MP -MF $(DEPDIR)/libhclx_la-hcl-s.Tpo -c -o libhclx_la-hcl-s.lo `test -f 'hcl-s.c' || echo '$(srcdir)/'`hcl-s.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhclx_la-hcl-s.Tpo $(DEPDIR)/libhclx_la-hcl-s.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hcl-s.c' object='libhclx_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
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhclx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhclx_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@
libhclx_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) $(libhclx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libhclx_la-hcl-c.lo -MD -MP -MF $(DEPDIR)/libhclx_la-hcl-c.Tpo -c -o libhclx_la-hcl-c.lo `test -f 'hcl-c.c' || echo '$(srcdir)/'`hcl-c.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libhclx_la-hcl-c.Tpo $(DEPDIR)/libhclx_la-hcl-c.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hcl-c.c' object='libhclx_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
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libhclx_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libhclx_la-hcl-c.lo `test -f 'hcl-c.c' || echo '$(srcdir)/'`hcl-c.c
mostlyclean-libtool:
-rm -f *.lo

126
lib/err.c
View File

@ -191,6 +191,132 @@ void hcl_seterrnum (hcl_t* hcl, hcl_errnum_t errnum)
hcl->errmsg.len = 0;
}
static int err_bcs (hcl_fmtout_t* fmtout, const hcl_bch_t* ptr, hcl_oow_t len)
{
hcl_t* hcl = (hcl_t*)fmtout->ctx;
hcl_oow_t max;
max = HCL_COUNTOF(hcl->errmsg.buf) - hcl->errmsg.len - 1;
#if defined(HCL_OOCH_IS_UCH)
if (max <= 0) return 1;
hcl_conv_bchars_to_uchars_with_cmgr (ptr, &len, &hcl->errmsg.buf[hcl->errmsg.len], &max, hcl->cmgr, 1);
hcl->errmsg.len += max;
#else
if (len > max) len = max;
if (len <= 0) return 1;
HCL_MEMCPY (&hcl->errmsg.buf[hcl->errmsg.len], ptr, len * HCL_SIZEOF(*ptr));
hcl->errmsg.len += len;
#endif
hcl->errmsg.buf[hcl->errmsg.len] = '\0';
return 1; /* success */
}
static int err_ucs (hcl_fmtout_t* fmtout, const hcl_uch_t* ptr, hcl_oow_t len)
{
hcl_t* hcl = (hcl_t*)fmtout->ctx;
hcl_oow_t max;
max = HCL_COUNTOF(hcl->errmsg.buf) - hcl->errmsg.len - 1;
#if defined(HCL_OOCH_IS_UCH)
if (len > max) len = max;
if (len <= 0) return 1;
HCL_MEMCPY (&hcl->errmsg.buf[hcl->errmsg.len], ptr, len * HCL_SIZEOF(*ptr));
hcl->errmsg.len += len;
#else
if (max <= 0) return 1;
hcl_conv_uchars_to_bchars_with_cmgr (ptr, &len, &hcl->errmsg.buf[hcl->errmsg.len], &max, hcl->cmgr);
hcl->errmsg.len += max;
#endif
hcl->errmsg.buf[hcl->errmsg.len] = '\0';
return 1; /* success */
}
void hcl_seterrbfmt (hcl_t* hcl, hcl_errnum_t errnum, const hcl_bch_t* fmt, ...)
{
va_list ap;
hcl_fmtout_t fo;
if (hcl->shuterr) return;
hcl->errmsg.len = 0;
HCL_MEMSET (&fo, 0, HCL_SIZEOF(fo));
fo.putbcs = err_bcs;
fo.putucs = err_ucs;
fo.putobj = hcl_fmt_object_;
fo.ctx = hcl;
va_start (ap, fmt);
hcl_bfmt_outv (&fo, fmt, ap);
va_end (ap);
hcl->errnum = errnum;
}
void hcl_seterrufmt (hcl_t* hcl, hcl_errnum_t errnum, const hcl_uch_t* fmt, ...)
{
va_list ap;
hcl_fmtout_t fo;
if (hcl->shuterr) return;
hcl->errmsg.len = 0;
HCL_MEMSET (&fo, 0, HCL_SIZEOF(fo));
fo.putbcs = err_bcs;
fo.putucs = err_ucs;
fo.putobj = hcl_fmt_object_;
fo.ctx = hcl;
va_start (ap, fmt);
hcl_ufmt_outv (&fo, fmt, ap);
va_end (ap);
hcl->errnum = errnum;
}
void hcl_seterrbfmtv (hcl_t* hcl, hcl_errnum_t errnum, const hcl_bch_t* fmt, va_list ap)
{
hcl_fmtout_t fo;
if (hcl->shuterr) return;
hcl->errmsg.len = 0;
HCL_MEMSET (&fo, 0, HCL_SIZEOF(fo));
fo.putbcs = err_bcs;
fo.putucs = err_ucs;
fo.putobj = hcl_fmt_object_;
fo.ctx = hcl;
hcl_bfmt_outv (&fo, fmt, ap);
hcl->errnum = errnum;
}
void hcl_seterrufmtv (hcl_t* hcl, hcl_errnum_t errnum, const hcl_uch_t* fmt, va_list ap)
{
hcl_fmtout_t fo;
if (hcl->shuterr) return;
hcl->errmsg.len = 0;
HCL_MEMSET (&fo, 0, HCL_SIZEOF(fo));
fo.putbcs = err_bcs;
fo.putucs = err_ucs;
fo.putobj = hcl_fmt_object_;
fo.ctx = hcl;
hcl_ufmt_outv (&fo, fmt, ap);
hcl->errnum = errnum;
}
void hcl_seterrwithsyserr (hcl_t* hcl, int syserr_type, int syserr_code)
{
hcl_errnum_t errnum;

View File

@ -421,6 +421,8 @@ typedef struct hcl_bcs_t hcl_bcs_t;
# define HCL_SIZEOF_OOCH_T HCL_SIZEOF_BCH_T
#endif
typedef unsigned int hcl_bitmask_t;
/* =========================================================================
* BASIC OOP ENCODING
* ========================================================================= */

View File

@ -1094,26 +1094,24 @@ hcl_pfbase_t* hcl_querymod (
);
/* ========================================================================= */
/* logfmt.c */
/* fmt.c */
/* ========================================================================= */
int hcl_outfmtobj (
hcl_t* hcl,
hcl_bitmask_t mask,
hcl_oop_t obj,
hcl_outbfmt_t outbfmt
int hcl_fmt_object_ (
hcl_fmtout_t* fmtout,
hcl_oop_t oop
);
int hcl_printfmtst (
int hcl_prfmtcallstack (
hcl_t* hcl,
hcl_ooi_t nargs
);
int hcl_logfmtst (
int hcl_logfmtcallstack (
hcl_t* hcl,
hcl_ooi_t nargs
);
int hcl_sprintfmtst (
int hcl_strfmtcallstack (
hcl_t* hcl,
hcl_ooi_t nargs
);

View File

@ -1290,7 +1290,7 @@ static void show_server_workers (hcl_server_proto_t* proto)
for (w = server->worker_list[HCL_SERVER_WORKER_STATE_ALIVE].head; w; w = w->next_worker)
{
/* TODO: implement this better... */
hcl_proutbfmt (proto->hcl, 0, "%zu %d %d\n", w->wid, w->sck, 1000);
hcl_prbfmt (proto->hcl, "%zu %d %d\n", w->wid, w->sck, 1000);
}
pthread_mutex_unlock (&server->worker_mutex);
}

View File

@ -28,6 +28,7 @@
#define _HCL_UTL_H_
#include "hcl-cmn.h"
#include <stdarg.h>
/* =========================================================================
* DOUBLY LINKED LIST
@ -288,6 +289,51 @@
/* =========================================================================
* FORMATTED OUTPUT
* ========================================================================= */
typedef struct hcl_fmtout_t hcl_fmtout_t;
typedef int (*hcl_fmtout_putbcs_t) (
hcl_fmtout_t* fmtout,
const hcl_bch_t* ptr,
hcl_oow_t len
);
typedef int (*hcl_fmtout_putucs_t) (
hcl_fmtout_t* fmtout,
const hcl_uch_t* ptr,
hcl_oow_t len
);
typedef int (*hcl_fmtout_putobj_t) (
hcl_fmtout_t* fmtout,
hcl_oop_t obj
);
enum hcl_fmtout_fmt_type_t
{
HCL_FMTOUT_FMT_TYPE_BCH = 0,
HCL_FMTOUT_FMT_TYPE_UCH
};
typedef enum hcl_fmtout_fmt_type_t hcl_fmtout_fmt_type_t;
struct hcl_fmtout_t
{
hcl_oow_t count; /* out */
hcl_fmtout_putbcs_t putbcs; /* in */
hcl_fmtout_putucs_t putucs; /* in */
hcl_fmtout_putobj_t putobj; /* in - %O is not handled if it's not set. */
hcl_bitmask_t mask; /* in */
void* ctx; /* in */
hcl_fmtout_fmt_type_t fmt_type;
const void* fmt_str;
};
#if defined(__cplusplus)
extern "C" {
#endif
@ -684,6 +730,33 @@ HCL_EXPORT int hcl_ucwidth (
hcl_uch_t uc
);
/* =========================================================================
* FORMATTED OUTPUT
* ========================================================================= */
HCL_EXPORT int hcl_bfmt_outv (
hcl_fmtout_t* fmtout,
const hcl_bch_t* fmt,
va_list ap
);
HCL_EXPORT int hcl_ufmt_outv (
hcl_fmtout_t* fmtout,
const hcl_uch_t* fmt,
va_list ap
);
HCL_EXPORT int hcl_bfmt_out (
hcl_fmtout_t* fmtout,
const hcl_bch_t* fmt,
...
);
HCL_EXPORT int hcl_ufmt_out (
hcl_fmtout_t* fmtout,
const hcl_uch_t* fmt,
...
);
/* =========================================================================
* BIT SWAP

View File

@ -37,7 +37,7 @@
/* ========================================================================== */
typedef struct hcl_mod_t hcl_mod_t;
typedef unsigned int hcl_bitmask_t;
/* ========================================================================== */
/**
@ -1819,6 +1819,17 @@ HCL_EXPORT hcl_ooi_t hcl_logufmtv (
# define hcl_logoofmtv hcl_logbfmtv
#endif
HCL_EXPORT hcl_ooi_t hcl_prbfmt (
hcl_t* hcl,
const hcl_bch_t* fmt,
...
);
HCL_EXPORT hcl_ooi_t hcl_prufmt (
hcl_t* hcl,
const hcl_uch_t* fmt,
...
);
/* =========================================================================
* OBJECT MANAGEMENT

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -169,7 +169,7 @@ static hcl_pfrc_t pf_log (hcl_t* hcl, hcl_mod_t* mod, hcl_ooi_t nargs)
static hcl_pfrc_t pf_logf (hcl_t* hcl, hcl_mod_t* mod, hcl_ooi_t nargs)
{
if (hcl_logfmtst(hcl, nargs) <= -1)
if (hcl_logfmtcallstack(hcl, nargs) <= -1)
{
HCL_STACK_SETRETTOERRNUM (hcl, nargs);
}
@ -184,7 +184,7 @@ static hcl_pfrc_t pf_logf (hcl_t* hcl, hcl_mod_t* mod, hcl_ooi_t nargs)
static hcl_pfrc_t pf_printf (hcl_t* hcl, hcl_mod_t* mod, hcl_ooi_t nargs)
{
if (hcl_printfmtst(hcl, nargs) <= -1)
if (hcl_prfmtcallstack(hcl, nargs) <= -1)
{
HCL_STACK_SETRETTOERRNUM (hcl, nargs);
}
@ -199,7 +199,7 @@ static hcl_pfrc_t pf_printf (hcl_t* hcl, hcl_mod_t* mod, hcl_ooi_t nargs)
static hcl_pfrc_t pf_sprintf (hcl_t* hcl, hcl_mod_t* mod, hcl_ooi_t nargs)
{
if (hcl_sprintfmtst(hcl, nargs) <= -1)
if (hcl_strfmtcallstack(hcl, nargs) <= -1)
{
HCL_STACK_SETRETTOERRNUM (hcl, nargs);
}

View File

@ -113,12 +113,12 @@ static struct
{ 12, { '#','<','S','E','M','A','P','H','O','R','E','>' } }
};
static HCL_INLINE int print_single_char (hcl_t* hcl, hcl_bitmask_t mask, hcl_ooch_t ch, hcl_outbfmt_t outbfmt)
static HCL_INLINE int print_single_char (hcl_fmtout_t* fmtout, hcl_ooch_t ch)
{
hcl_oochu_t chu = (hcl_oochu_t)ch;
if (chu == '\\' || chu == '\"')
{
if (outbfmt(hcl, mask, "\\%jc", chu) <= -1) return -1;
if (hcl_bfmt_out(fmtout, "\\%jc", chu) <= -1) return -1;
}
#if defined(HCL_OOCH_IS_UCH)
else if (chu < ' ')
@ -164,7 +164,7 @@ static HCL_INLINE int print_single_char (hcl_t* hcl, hcl_bitmask_t mask, hcl_ooc
#if (HCL_SIZEOF_OOCH_T >= 4)
if (chu >= 0x10000u)
{
if (outbfmt(hcl, mask, "\\U%08X", chu) <= -1) return -1;
if (hcl_bfmt_out(fmtout, "\\U%08X", chu) <= -1) return -1;
}
else
#endif
@ -172,30 +172,31 @@ static HCL_INLINE int print_single_char (hcl_t* hcl, hcl_bitmask_t mask, hcl_ooc
#if (HCL_SIZEOF_OOCH_T >= 2)
if (chu >= 0x100u)
{
if (outbfmt(hcl, mask, "\\u%04X", chu) <= -1) return -1;
if (hcl_bfmt_out(fmtout, "\\u%04X", chu) <= -1) return -1;
}
else
#endif
{
if (outbfmt(hcl, mask, "\\x%02X", chu) <= -1) return -1;
if (hcl_bfmt_out(fmtout, "\\x%02X", chu) <= -1) return -1;
}
}
}
else
{
if (outbfmt(hcl, mask, "\\%jc", escaped) <= -1) return -1;
if (hcl_bfmt_out(fmtout, "\\%jc", escaped) <= -1) return -1;
}
}
else
{
if (outbfmt(hcl, mask, "%jc", ch) <= -1) return -1;
if (hcl_bfmt_out(fmtout, "%jc", ch) <= -1) return -1;
}
return 0;
}
static HCL_INLINE int outfmt_obj (hcl_t* hcl, hcl_bitmask_t mask, hcl_oop_t obj, hcl_outbfmt_t outbfmt)
int hcl_fmt_object_ (hcl_fmtout_t* fmtout, hcl_oop_t obj)
{
hcl_t* hcl = (hcl_t*)fmtout->ctx;
hcl_oop_t cur;
print_stack_t ps;
int brand;
@ -226,29 +227,29 @@ static HCL_INLINE int outfmt_obj (hcl_t* hcl, hcl_bitmask_t mask, hcl_oop_t obj,
{ " ", ":" } /* key value breaker */
};
json = !!(mask & HCL_LOG_PREFER_JSON);
json = !!(fmtout->mask & HCL_LOG_PREFER_JSON);
next:
switch ((brand = HCL_BRANDOF(hcl, obj)))
{
case HCL_BRAND_SMOOI:
if (outbfmt(hcl, mask, "%zd", HCL_OOP_TO_SMOOI(obj)) <= -1) return -1;
if (hcl_bfmt_out(fmtout, "%zd", HCL_OOP_TO_SMOOI(obj)) <= -1) return -1;
goto done;
case HCL_BRAND_SMPTR:
if (outbfmt(hcl, mask, "#p%zX", (hcl_oow_t)HCL_OOP_TO_SMPTR(obj)) <= -1) return -1;
if (hcl_bfmt_out(fmtout, "#p%zX", (hcl_oow_t)HCL_OOP_TO_SMPTR(obj)) <= -1) return -1;
goto done;
case HCL_BRAND_ERROR:
if (outbfmt(hcl, mask, "#e%zd", (hcl_ooi_t)HCL_OOP_TO_ERROR(obj)) <= -1) return -1;
if (hcl_bfmt_out(fmtout, "#e%zd", (hcl_ooi_t)HCL_OOP_TO_ERROR(obj)) <= -1) return -1;
goto done;
case HCL_BRAND_CHARACTER:
{
hcl_ooch_t ch = HCL_OOP_TO_CHAR(obj);
if (outbfmt(hcl, mask, "\'") <= -1 ||
print_single_char(hcl, mask, ch, outbfmt) <= -1 ||
outbfmt(hcl, mask, "\'") <= -1) return -1;
if (hcl_bfmt_out(fmtout, "\'") <= -1 ||
print_single_char(fmtout, ch) <= -1 ||
hcl_bfmt_out(fmtout, "\'") <= -1) return -1;
goto done;
}
@ -276,7 +277,7 @@ next:
if (!tmp) return -1;
HCL_ASSERT (hcl, (hcl_oop_t)tmp == hcl->_nil);
if (outbfmt(hcl, mask, "%.*js", hcl->inttostr.xbuf.len, hcl->inttostr.xbuf.ptr) <= -1) return -1;
if (hcl_bfmt_out(fmtout, "%.*js", hcl->inttostr.xbuf.len, hcl->inttostr.xbuf.ptr) <= -1) return -1;
break;
}
@ -291,11 +292,11 @@ next:
{
if (scale == 0)
{
if (outbfmt(hcl, mask, "0.") <= -1) return -1;
if (hcl_bfmt_out(fmtout, "0.") <= -1) return -1;
}
else
{
if (outbfmt(hcl, mask, "0.%0*d", scale, 0) <= -1) return -1;
if (hcl_bfmt_out(fmtout, "0.%0*d", scale, 0) <= -1) return -1;
}
}
else
@ -313,13 +314,13 @@ next:
{
if (scale == len)
{
if (outbfmt(hcl, mask, "%.*js0.%.*js",
if (hcl_bfmt_out(fmtout, "%.*js0.%.*js",
adj, hcl->inttostr.xbuf.ptr,
len, &hcl->inttostr.xbuf.ptr[adj]) <= -1) return -1;
}
else
{
if (outbfmt(hcl, mask, "%.*js0.%0*d%.*js",
if (hcl_bfmt_out(fmtout, "%.*js0.%0*d%.*js",
adj, hcl->inttostr.xbuf.ptr,
scale - len, 0,
len, &hcl->inttostr.xbuf.ptr[adj]) <= -1) return -1;
@ -329,7 +330,7 @@ next:
{
hcl_ooi_t ndigits;
ndigits = hcl->inttostr.xbuf.len - scale;
if (outbfmt(hcl, mask, "%.*js.%.*js", ndigits, hcl->inttostr.xbuf.ptr, scale, &hcl->inttostr.xbuf.ptr[ndigits]) <= -1) return -1;
if (hcl_bfmt_out(fmtout, "%.*js.%.*js", ndigits, hcl->inttostr.xbuf.ptr, scale, &hcl->inttostr.xbuf.ptr[ndigits]) <= -1) return -1;
}
}
break;
@ -359,7 +360,7 @@ next:
/* Any needs for special action if SYNT(obj) is true?
* I simply treat the syntax symbol as a normal symbol
* for printing currently. */
if (outbfmt(hcl, mask, "%.*js", HCL_OBJ_GET_SIZE(obj), HCL_OBJ_GET_CHAR_SLOT(obj)) <= -1) return -1;
if (hcl_bfmt_out(fmtout, "%.*js", HCL_OBJ_GET_SIZE(obj), HCL_OBJ_GET_CHAR_SLOT(obj)) <= -1) return -1;
break;
case HCL_BRAND_STRING:
@ -380,17 +381,17 @@ next:
if (escape)
{
if (outbfmt(hcl, mask, "\"") <= -1) return -1;
if (hcl_bfmt_out(fmtout, "\"") <= -1) return -1;
for (i = 0; i < HCL_OBJ_GET_SIZE(obj); i++)
{
ch = ((hcl_oop_char_t)obj)->slot[i];
if (print_single_char(hcl, mask, ch, outbfmt) <= -1) return -1;
if (print_single_char(fmtout, ch) <= -1) return -1;
}
if (outbfmt(hcl, mask, "\"") <= -1) return -1;
if (hcl_bfmt_out(fmtout, "\"") <= -1) return -1;
}
else
{
if (outbfmt(hcl, mask, "\"%.*js\"", HCL_OBJ_GET_SIZE(obj), HCL_OBJ_GET_CHAR_SLOT(obj)) <= -1) return -1;
if (hcl_bfmt_out(fmtout, "\"%.*js\"", HCL_OBJ_GET_SIZE(obj), HCL_OBJ_GET_CHAR_SLOT(obj)) <= -1) return -1;
}
break;
}
@ -403,7 +404,7 @@ next:
* request to output in the json format */
concode = HCL_OBJ_GET_FLAGS_SYNCODE(obj);
if (outbfmt(hcl, mask, opening_parens[concode][0]) <= -1) return -1;
if (hcl_bfmt_out(fmtout, opening_parens[concode][0]) <= -1) return -1;
cur = obj;
do
@ -438,7 +439,7 @@ next:
if (!HCL_OOP_IS_POINTER(cur) || HCL_OBJ_GET_FLAGS_BRAND(cur) != HCL_BRAND_CONS)
{
/* The CDR part does not point to a pair. */
if (outbfmt(hcl, mask, " . ") <= -1) return -1;
if (hcl_bfmt_out(fmtout, " . ") <= -1) return -1;
/* Push NIL so that the HCL_IS_NIL(hcl,p) test in
* the 'if' statement above breaks the loop
@ -455,11 +456,11 @@ next:
}
/* The CDR part points to a pair. proceed to it */
if (outbfmt(hcl, mask, breakers[0][0]) <= -1) return -1;
if (hcl_bfmt_out(fmtout, breakers[0][0]) <= -1) return -1;
}
while (1);
if (outbfmt(hcl, mask, closing_parens[concode][0]) <= -1) return -1;
if (hcl_bfmt_out(fmtout, closing_parens[concode][0]) <= -1) return -1;
break;
}
@ -467,11 +468,11 @@ next:
{
hcl_oow_t arridx;
if (outbfmt(hcl, mask, opening_parens[HCL_CONCODE_ARRAY][json]) <= -1) return -1;
if (hcl_bfmt_out(fmtout, opening_parens[HCL_CONCODE_ARRAY][json]) <= -1) return -1;
if (HCL_OBJ_GET_SIZE(obj) <= 0)
{
if (outbfmt(hcl, mask, closing_parens[HCL_CONCODE_ARRAY][json]) <= -1) return -1;
if (hcl_bfmt_out(fmtout, closing_parens[HCL_CONCODE_ARRAY][json]) <= -1) return -1;
break;
}
arridx = 0;
@ -499,7 +500,7 @@ next:
obj = ((hcl_oop_oop_t)obj)->slot[arridx];
if (arridx > 0)
{
if (outbfmt(hcl, mask, breakers[0][json]) <= -1) return -1;
if (hcl_bfmt_out(fmtout, breakers[0][json]) <= -1) return -1;
}
/* Jump to the 'next' label so that the object
* pointed to by 'obj' is printed. Once it
@ -519,16 +520,16 @@ next:
case HCL_BRAND_BYTE_ARRAY:
{
hcl_oow_t i;
if (outbfmt(hcl, mask, opening_parens[HCL_CONCODE_BYTEARRAY][json]) <= -1) return -1;
if (hcl_bfmt_out(fmtout, opening_parens[HCL_CONCODE_BYTEARRAY][json]) <= -1) return -1;
if (HCL_OBJ_GET_SIZE(obj) > 0)
{
if (outbfmt(hcl, mask, "%d", ((hcl_oop_byte_t)obj)->slot[0]) <= -1) return -1;
if (hcl_bfmt_out(fmtout, "%d", ((hcl_oop_byte_t)obj)->slot[0]) <= -1) return -1;
for (i = 1; i < HCL_OBJ_GET_SIZE(obj); i++)
{
if (outbfmt(hcl, mask, "%hs%d", breakers[0][json], ((hcl_oop_byte_t)obj)->slot[i]) <= -1) return -1;
if (hcl_bfmt_out(fmtout, "%hs%d", breakers[0][json], ((hcl_oop_byte_t)obj)->slot[i]) <= -1) return -1;
}
}
if (outbfmt(hcl, mask, closing_parens[HCL_CONCODE_BYTEARRAY][json]) <= -1) return -1;
if (hcl_bfmt_out(fmtout, closing_parens[HCL_CONCODE_BYTEARRAY][json]) <= -1) return -1;
break;
}
@ -537,13 +538,13 @@ next:
hcl_oow_t bucidx, bucsize, buctally;
hcl_oop_dic_t dic;
if (outbfmt(hcl, mask, opening_parens[HCL_CONCODE_DIC][json]) <= -1) return -1;
if (hcl_bfmt_out(fmtout, opening_parens[HCL_CONCODE_DIC][json]) <= -1) return -1;
dic = (hcl_oop_dic_t)obj;
HCL_ASSERT (hcl, HCL_OOP_IS_SMOOI(dic->tally));
if (HCL_OOP_TO_SMOOI(dic->tally) <= 0)
{
if (outbfmt(hcl, mask, closing_parens[HCL_CONCODE_DIC][json]) <= -1) return -1;
if (hcl_bfmt_out(fmtout, closing_parens[HCL_CONCODE_DIC][json]) <= -1) return -1;
break;
}
bucidx = 0;
@ -569,7 +570,7 @@ next:
if (bucidx >= bucsize)
{
/* done. scanned the entire bucket */
if (outbfmt(hcl, mask, closing_parens[HCL_CONCODE_DIC][json]) <= -1) return -1;
if (hcl_bfmt_out(fmtout, closing_parens[HCL_CONCODE_DIC][json]) <= -1) return -1;
break;
}
@ -610,7 +611,7 @@ next:
if (buctally > 0)
{
if (outbfmt(hcl, mask, breakers[buctally & 1][json]) <= -1) return -1;
if (hcl_bfmt_out(fmtout, breakers[buctally & 1][json]) <= -1) return -1;
}
/* Jump to the 'next' label so that the object
@ -636,15 +637,15 @@ next:
{
hcl_oow_t i;
if (outbfmt(hcl, mask, "|") <= -1) return -1;
if (hcl_bfmt_out(fmtout, "|") <= -1) return -1;
for (i = 0; i < HCL_OBJ_GET_SIZE(obj); i++)
{
hcl_oop_t s;
s = ((hcl_oop_oop_t)obj)->slot[i];
if (outbfmt(hcl, mask, " %.*js", HCL_OBJ_GET_SIZE(s), HCL_OBJ_GET_CHAR_SLOT(s)) <= -1) return -1;
if (hcl_bfmt_out(fmtout, " %.*js", HCL_OBJ_GET_SIZE(s), HCL_OBJ_GET_CHAR_SLOT(s)) <= -1) return -1;
}
if (outbfmt(hcl, mask, " |") <= -1) return -1;
if (hcl_bfmt_out(fmtout, " |") <= -1) return -1;
break;
}
@ -679,7 +680,7 @@ next:
return -1;
print_word:
if (outbfmt(hcl, mask, "%.*js", word[word_index].len, word[word_index].ptr) <= -1) return -1;
if (hcl_bfmt_out(fmtout, "%.*js", word[word_index].len, word[word_index].ptr) <= -1) return -1;
break;
}
@ -697,14 +698,14 @@ done:
goto resume_array;
case PRINT_STACK_ARRAY_END:
if (outbfmt(hcl, mask, closing_parens[HCL_CONCODE_ARRAY][json]) <= -1) return -1;
if (hcl_bfmt_out(fmtout, closing_parens[HCL_CONCODE_ARRAY][json]) <= -1) return -1;
break;
case PRINT_STACK_DIC:
goto resume_dic;
case PRINT_STACK_DIC_END:
if (outbfmt(hcl, mask, closing_parens[HCL_CONCODE_DIC][json]) <= -1) return -1;
if (hcl_bfmt_out(fmtout, closing_parens[HCL_CONCODE_DIC][json]) <= -1) return -1;
break;
default:
@ -716,6 +717,7 @@ done:
return 0;
}
#if 0
int hcl_outfmtobj (hcl_t* hcl, hcl_bitmask_t mask, hcl_oop_t obj, hcl_outbfmt_t outbfmt)
{
int n;
@ -724,7 +726,7 @@ int hcl_outfmtobj (hcl_t* hcl, hcl_bitmask_t mask, hcl_oop_t obj, hcl_outbfmt_t
HCL_ASSERT (hcl, hcl->p.s.size == 0);
hcl->p.e = obj; /* remember the head of the object to print */
n = outfmt_obj(hcl, mask, obj, outbfmt);
n = hcl_proutbfmt(hcl, mask, obj);
hcl->p.e = hcl->_nil; /* reset what's remembered */
/* clear the printing stack if an error has occurred for GC not to keep
@ -736,9 +738,11 @@ int hcl_outfmtobj (hcl_t* hcl, hcl_bitmask_t mask, hcl_oop_t obj, hcl_outbfmt_t
return n;
}
#endif
int hcl_print (hcl_t* hcl, hcl_oop_t obj)
{
HCL_ASSERT (hcl, hcl->c->printer != HCL_NULL);
return hcl_outfmtobj (hcl, HCL_LOG_APP | HCL_LOG_FATAL, obj, hcl_proutbfmt);
/*return hcl_outfmtobj(hcl, HCL_LOG_APP | HCL_LOG_FATAL, obj);*/
return hcl_prbfmt(hcl, "%O", obj);
}