renamed mio/MIO to hio/HIO

This commit is contained in:
2021-07-22 07:30:20 +00:00
parent 19e6906670
commit 072491b1e3
70 changed files with 21526 additions and 21368 deletions

View File

@ -8,53 +8,53 @@ CPPFLAGS_COMMON = \
-I$(includedir)
CFLAGS_COMMON =
LDFLAGS_COMMON = -L$(abs_builddir)/../lib -L$(libdir)
LIBADD_COMMON = ../lib/libmio.la
LIBADD_COMMON = ../lib/libhio.la
bin_PROGRAMS = mio-execd
mio_execd_SOURCES = execd.c
mio_execd_CPPFLAGS = $(CPPFLAGS_COMMON)
mio_execd_CFLAGS = $(CFLAGS_COMMON)
mio_execd_LDFLAGS = $(LDFLAGS_COMMON)
mio_execd_LDADD = $(LIBADD_COMMON)
bin_PROGRAMS = hio-execd
hio_execd_SOURCES = execd.c
hio_execd_CPPFLAGS = $(CPPFLAGS_COMMON)
hio_execd_CFLAGS = $(CFLAGS_COMMON)
hio_execd_LDFLAGS = $(LDFLAGS_COMMON)
hio_execd_LDADD = $(LIBADD_COMMON)
bin_PROGRAMS += mio-t01
mio_t01_SOURCES = t01.c
mio_t01_CPPFLAGS = $(CPPFLAGS_COMMON)
mio_t01_CFLAGS = $(CFLAGS_COMMON)
mio_t01_LDFLAGS = $(LDFLAGS_COMMON)
mio_t01_LDADD = $(LIBADD_COMMON)
bin_PROGRAMS += hio-t01
hio_t01_SOURCES = t01.c
hio_t01_CPPFLAGS = $(CPPFLAGS_COMMON)
hio_t01_CFLAGS = $(CFLAGS_COMMON)
hio_t01_LDFLAGS = $(LDFLAGS_COMMON)
hio_t01_LDADD = $(LIBADD_COMMON)
bin_PROGRAMS += mio-t02
mio_t02_SOURCES = t02.c
mio_t02_CPPFLAGS = $(CPPFLAGS_COMMON)
mio_t02_CFLAGS = $(CFLAGS_COMMON)
mio_t02_LDFLAGS = $(LDFLAGS_COMMON)
mio_t02_LDADD = $(LIBADD_COMMON)
bin_PROGRAMS += hio-t02
hio_t02_SOURCES = t02.c
hio_t02_CPPFLAGS = $(CPPFLAGS_COMMON)
hio_t02_CFLAGS = $(CFLAGS_COMMON)
hio_t02_LDFLAGS = $(LDFLAGS_COMMON)
hio_t02_LDADD = $(LIBADD_COMMON)
bin_PROGRAMS += mio-t03
mio_t03_SOURCES = t03.c
mio_t03_CPPFLAGS = $(CPPFLAGS_COMMON)
mio_t03_CFLAGS = $(CFLAGS_COMMON)
mio_t03_LDFLAGS = $(LDFLAGS_COMMON)
mio_t03_LDADD = $(LIBADD_COMMON)
bin_PROGRAMS += hio-t03
hio_t03_SOURCES = t03.c
hio_t03_CPPFLAGS = $(CPPFLAGS_COMMON)
hio_t03_CFLAGS = $(CFLAGS_COMMON)
hio_t03_LDFLAGS = $(LDFLAGS_COMMON)
hio_t03_LDADD = $(LIBADD_COMMON)
bin_PROGRAMS += mio-t04
mio_t04_SOURCES = t04.c
mio_t04_CPPFLAGS = $(CPPFLAGS_COMMON)
mio_t04_CFLAGS = $(CFLAGS_COMMON)
mio_t04_LDFLAGS = $(LDFLAGS_COMMON)
mio_t04_LDADD = $(LIBADD_COMMON)
bin_PROGRAMS += hio-t04
hio_t04_SOURCES = t04.c
hio_t04_CPPFLAGS = $(CPPFLAGS_COMMON)
hio_t04_CFLAGS = $(CFLAGS_COMMON)
hio_t04_LDFLAGS = $(LDFLAGS_COMMON)
hio_t04_LDADD = $(LIBADD_COMMON)
bin_PROGRAMS += mio-t05
mio_t05_SOURCES = t05.c
mio_t05_CPPFLAGS = $(CPPFLAGS_COMMON)
mio_t05_CFLAGS = $(CFLAGS_COMMON)
mio_t05_LDFLAGS = $(LDFLAGS_COMMON)
mio_t05_LDADD = $(LIBADD_COMMON)
bin_PROGRAMS += hio-t05
hio_t05_SOURCES = t05.c
hio_t05_CPPFLAGS = $(CPPFLAGS_COMMON)
hio_t05_CFLAGS = $(CFLAGS_COMMON)
hio_t05_LDFLAGS = $(LDFLAGS_COMMON)
hio_t05_LDADD = $(LIBADD_COMMON)
bin_PROGRAMS += mio-t06
mio_t06_SOURCES = t06.c
mio_t06_CPPFLAGS = $(CPPFLAGS_COMMON)
mio_t06_CFLAGS = $(CFLAGS_COMMON)
mio_t06_LDFLAGS = $(LDFLAGS_COMMON)
mio_t06_LDADD = $(LIBADD_COMMON)
bin_PROGRAMS += hio-t06
hio_t06_SOURCES = t06.c
hio_t06_CPPFLAGS = $(CPPFLAGS_COMMON)
hio_t06_CFLAGS = $(CFLAGS_COMMON)
hio_t06_LDFLAGS = $(LDFLAGS_COMMON)
hio_t06_LDADD = $(LIBADD_COMMON)

View File

@ -88,9 +88,9 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = mio-execd$(EXEEXT) mio-t01$(EXEEXT) mio-t02$(EXEEXT) \
mio-t03$(EXEEXT) mio-t04$(EXEEXT) mio-t05$(EXEEXT) \
mio-t06$(EXEEXT)
bin_PROGRAMS = hio-execd$(EXEEXT) hio-t01$(EXEEXT) hio-t02$(EXEEXT) \
hio-t03$(EXEEXT) hio-t04$(EXEEXT) hio-t05$(EXEEXT) \
hio-t06$(EXEEXT)
subdir = bin
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \
@ -103,57 +103,57 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/lib/mio-cfg.h
CONFIG_HEADER = $(top_builddir)/lib/hio-cfg.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
am_mio_execd_OBJECTS = mio_execd-execd.$(OBJEXT)
mio_execd_OBJECTS = $(am_mio_execd_OBJECTS)
mio_execd_DEPENDENCIES = $(LIBADD_COMMON)
am_hio_execd_OBJECTS = hio_execd-execd.$(OBJEXT)
hio_execd_OBJECTS = $(am_hio_execd_OBJECTS)
hio_execd_DEPENDENCIES = $(LIBADD_COMMON)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
mio_execd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(mio_execd_CFLAGS) \
$(CFLAGS) $(mio_execd_LDFLAGS) $(LDFLAGS) -o $@
am_mio_t01_OBJECTS = mio_t01-t01.$(OBJEXT)
mio_t01_OBJECTS = $(am_mio_t01_OBJECTS)
mio_t01_DEPENDENCIES = $(LIBADD_COMMON)
mio_t01_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(mio_t01_CFLAGS) \
$(CFLAGS) $(mio_t01_LDFLAGS) $(LDFLAGS) -o $@
am_mio_t02_OBJECTS = mio_t02-t02.$(OBJEXT)
mio_t02_OBJECTS = $(am_mio_t02_OBJECTS)
mio_t02_DEPENDENCIES = $(LIBADD_COMMON)
mio_t02_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(mio_t02_CFLAGS) \
$(CFLAGS) $(mio_t02_LDFLAGS) $(LDFLAGS) -o $@
am_mio_t03_OBJECTS = mio_t03-t03.$(OBJEXT)
mio_t03_OBJECTS = $(am_mio_t03_OBJECTS)
mio_t03_DEPENDENCIES = $(LIBADD_COMMON)
mio_t03_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(mio_t03_CFLAGS) \
$(CFLAGS) $(mio_t03_LDFLAGS) $(LDFLAGS) -o $@
am_mio_t04_OBJECTS = mio_t04-t04.$(OBJEXT)
mio_t04_OBJECTS = $(am_mio_t04_OBJECTS)
mio_t04_DEPENDENCIES = $(LIBADD_COMMON)
mio_t04_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(mio_t04_CFLAGS) \
$(CFLAGS) $(mio_t04_LDFLAGS) $(LDFLAGS) -o $@
am_mio_t05_OBJECTS = mio_t05-t05.$(OBJEXT)
mio_t05_OBJECTS = $(am_mio_t05_OBJECTS)
mio_t05_DEPENDENCIES = $(LIBADD_COMMON)
mio_t05_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(mio_t05_CFLAGS) \
$(CFLAGS) $(mio_t05_LDFLAGS) $(LDFLAGS) -o $@
am_mio_t06_OBJECTS = mio_t06-t06.$(OBJEXT)
mio_t06_OBJECTS = $(am_mio_t06_OBJECTS)
mio_t06_DEPENDENCIES = $(LIBADD_COMMON)
mio_t06_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(mio_t06_CFLAGS) \
$(CFLAGS) $(mio_t06_LDFLAGS) $(LDFLAGS) -o $@
hio_execd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(hio_execd_CFLAGS) \
$(CFLAGS) $(hio_execd_LDFLAGS) $(LDFLAGS) -o $@
am_hio_t01_OBJECTS = hio_t01-t01.$(OBJEXT)
hio_t01_OBJECTS = $(am_hio_t01_OBJECTS)
hio_t01_DEPENDENCIES = $(LIBADD_COMMON)
hio_t01_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(hio_t01_CFLAGS) \
$(CFLAGS) $(hio_t01_LDFLAGS) $(LDFLAGS) -o $@
am_hio_t02_OBJECTS = hio_t02-t02.$(OBJEXT)
hio_t02_OBJECTS = $(am_hio_t02_OBJECTS)
hio_t02_DEPENDENCIES = $(LIBADD_COMMON)
hio_t02_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(hio_t02_CFLAGS) \
$(CFLAGS) $(hio_t02_LDFLAGS) $(LDFLAGS) -o $@
am_hio_t03_OBJECTS = hio_t03-t03.$(OBJEXT)
hio_t03_OBJECTS = $(am_hio_t03_OBJECTS)
hio_t03_DEPENDENCIES = $(LIBADD_COMMON)
hio_t03_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(hio_t03_CFLAGS) \
$(CFLAGS) $(hio_t03_LDFLAGS) $(LDFLAGS) -o $@
am_hio_t04_OBJECTS = hio_t04-t04.$(OBJEXT)
hio_t04_OBJECTS = $(am_hio_t04_OBJECTS)
hio_t04_DEPENDENCIES = $(LIBADD_COMMON)
hio_t04_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(hio_t04_CFLAGS) \
$(CFLAGS) $(hio_t04_LDFLAGS) $(LDFLAGS) -o $@
am_hio_t05_OBJECTS = hio_t05-t05.$(OBJEXT)
hio_t05_OBJECTS = $(am_hio_t05_OBJECTS)
hio_t05_DEPENDENCIES = $(LIBADD_COMMON)
hio_t05_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(hio_t05_CFLAGS) \
$(CFLAGS) $(hio_t05_LDFLAGS) $(LDFLAGS) -o $@
am_hio_t06_OBJECTS = hio_t06-t06.$(OBJEXT)
hio_t06_OBJECTS = $(am_hio_t06_OBJECTS)
hio_t06_DEPENDENCIES = $(LIBADD_COMMON)
hio_t06_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(hio_t06_CFLAGS) \
$(CFLAGS) $(hio_t06_LDFLAGS) $(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@ -169,10 +169,10 @@ am__v_at_1 =
DEFAULT_INCLUDES =
depcomp = $(SHELL) $(top_srcdir)/ac/depcomp
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/mio_execd-execd.Po \
./$(DEPDIR)/mio_t01-t01.Po ./$(DEPDIR)/mio_t02-t02.Po \
./$(DEPDIR)/mio_t03-t03.Po ./$(DEPDIR)/mio_t04-t04.Po \
./$(DEPDIR)/mio_t05-t05.Po ./$(DEPDIR)/mio_t06-t06.Po
am__depfiles_remade = ./$(DEPDIR)/hio_execd-execd.Po \
./$(DEPDIR)/hio_t01-t01.Po ./$(DEPDIR)/hio_t02-t02.Po \
./$(DEPDIR)/hio_t03-t03.Po ./$(DEPDIR)/hio_t04-t04.Po \
./$(DEPDIR)/hio_t05-t05.Po ./$(DEPDIR)/hio_t06-t06.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@ -192,12 +192,12 @@ 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 = $(mio_execd_SOURCES) $(mio_t01_SOURCES) $(mio_t02_SOURCES) \
$(mio_t03_SOURCES) $(mio_t04_SOURCES) $(mio_t05_SOURCES) \
$(mio_t06_SOURCES)
DIST_SOURCES = $(mio_execd_SOURCES) $(mio_t01_SOURCES) \
$(mio_t02_SOURCES) $(mio_t03_SOURCES) $(mio_t04_SOURCES) \
$(mio_t05_SOURCES) $(mio_t06_SOURCES)
SOURCES = $(hio_execd_SOURCES) $(hio_t01_SOURCES) $(hio_t02_SOURCES) \
$(hio_t03_SOURCES) $(hio_t04_SOURCES) $(hio_t05_SOURCES) \
$(hio_t06_SOURCES)
DIST_SOURCES = $(hio_execd_SOURCES) $(hio_t01_SOURCES) \
$(hio_t02_SOURCES) $(hio_t03_SOURCES) $(hio_t04_SOURCES) \
$(hio_t05_SOURCES) $(hio_t06_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@ -251,6 +251,8 @@ EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HIO_PROJECT_AUTHOR = @HIO_PROJECT_AUTHOR@
HIO_PROJECT_URL = @HIO_PROJECT_URL@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@ -274,8 +276,6 @@ MARIADB_CONFIG = @MARIADB_CONFIG@
MARIADB_LDFLAGS = @MARIADB_LDFLAGS@
MARIADB_LIBS = @MARIADB_LIBS@
MARIADB_VERSION = @MARIADB_VERSION@
MIO_PROJECT_AUTHOR = @MIO_PROJECT_AUTHOR@
MIO_PROJECT_URL = @MIO_PROJECT_URL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
@ -372,42 +372,42 @@ CPPFLAGS_COMMON = \
CFLAGS_COMMON =
LDFLAGS_COMMON = -L$(abs_builddir)/../lib -L$(libdir)
LIBADD_COMMON = ../lib/libmio.la
mio_execd_SOURCES = execd.c
mio_execd_CPPFLAGS = $(CPPFLAGS_COMMON)
mio_execd_CFLAGS = $(CFLAGS_COMMON)
mio_execd_LDFLAGS = $(LDFLAGS_COMMON)
mio_execd_LDADD = $(LIBADD_COMMON)
mio_t01_SOURCES = t01.c
mio_t01_CPPFLAGS = $(CPPFLAGS_COMMON)
mio_t01_CFLAGS = $(CFLAGS_COMMON)
mio_t01_LDFLAGS = $(LDFLAGS_COMMON)
mio_t01_LDADD = $(LIBADD_COMMON)
mio_t02_SOURCES = t02.c
mio_t02_CPPFLAGS = $(CPPFLAGS_COMMON)
mio_t02_CFLAGS = $(CFLAGS_COMMON)
mio_t02_LDFLAGS = $(LDFLAGS_COMMON)
mio_t02_LDADD = $(LIBADD_COMMON)
mio_t03_SOURCES = t03.c
mio_t03_CPPFLAGS = $(CPPFLAGS_COMMON)
mio_t03_CFLAGS = $(CFLAGS_COMMON)
mio_t03_LDFLAGS = $(LDFLAGS_COMMON)
mio_t03_LDADD = $(LIBADD_COMMON)
mio_t04_SOURCES = t04.c
mio_t04_CPPFLAGS = $(CPPFLAGS_COMMON)
mio_t04_CFLAGS = $(CFLAGS_COMMON)
mio_t04_LDFLAGS = $(LDFLAGS_COMMON)
mio_t04_LDADD = $(LIBADD_COMMON)
mio_t05_SOURCES = t05.c
mio_t05_CPPFLAGS = $(CPPFLAGS_COMMON)
mio_t05_CFLAGS = $(CFLAGS_COMMON)
mio_t05_LDFLAGS = $(LDFLAGS_COMMON)
mio_t05_LDADD = $(LIBADD_COMMON)
mio_t06_SOURCES = t06.c
mio_t06_CPPFLAGS = $(CPPFLAGS_COMMON)
mio_t06_CFLAGS = $(CFLAGS_COMMON)
mio_t06_LDFLAGS = $(LDFLAGS_COMMON)
mio_t06_LDADD = $(LIBADD_COMMON)
LIBADD_COMMON = ../lib/libhio.la
hio_execd_SOURCES = execd.c
hio_execd_CPPFLAGS = $(CPPFLAGS_COMMON)
hio_execd_CFLAGS = $(CFLAGS_COMMON)
hio_execd_LDFLAGS = $(LDFLAGS_COMMON)
hio_execd_LDADD = $(LIBADD_COMMON)
hio_t01_SOURCES = t01.c
hio_t01_CPPFLAGS = $(CPPFLAGS_COMMON)
hio_t01_CFLAGS = $(CFLAGS_COMMON)
hio_t01_LDFLAGS = $(LDFLAGS_COMMON)
hio_t01_LDADD = $(LIBADD_COMMON)
hio_t02_SOURCES = t02.c
hio_t02_CPPFLAGS = $(CPPFLAGS_COMMON)
hio_t02_CFLAGS = $(CFLAGS_COMMON)
hio_t02_LDFLAGS = $(LDFLAGS_COMMON)
hio_t02_LDADD = $(LIBADD_COMMON)
hio_t03_SOURCES = t03.c
hio_t03_CPPFLAGS = $(CPPFLAGS_COMMON)
hio_t03_CFLAGS = $(CFLAGS_COMMON)
hio_t03_LDFLAGS = $(LDFLAGS_COMMON)
hio_t03_LDADD = $(LIBADD_COMMON)
hio_t04_SOURCES = t04.c
hio_t04_CPPFLAGS = $(CPPFLAGS_COMMON)
hio_t04_CFLAGS = $(CFLAGS_COMMON)
hio_t04_LDFLAGS = $(LDFLAGS_COMMON)
hio_t04_LDADD = $(LIBADD_COMMON)
hio_t05_SOURCES = t05.c
hio_t05_CPPFLAGS = $(CPPFLAGS_COMMON)
hio_t05_CFLAGS = $(CFLAGS_COMMON)
hio_t05_LDFLAGS = $(LDFLAGS_COMMON)
hio_t05_LDADD = $(LIBADD_COMMON)
hio_t06_SOURCES = t06.c
hio_t06_CPPFLAGS = $(CPPFLAGS_COMMON)
hio_t06_CFLAGS = $(CFLAGS_COMMON)
hio_t06_LDFLAGS = $(LDFLAGS_COMMON)
hio_t06_LDADD = $(LIBADD_COMMON)
all: all-am
.SUFFIXES:
@ -491,33 +491,33 @@ clean-binPROGRAMS:
echo " rm -f" $$list; \
rm -f $$list
mio-execd$(EXEEXT): $(mio_execd_OBJECTS) $(mio_execd_DEPENDENCIES) $(EXTRA_mio_execd_DEPENDENCIES)
@rm -f mio-execd$(EXEEXT)
$(AM_V_CCLD)$(mio_execd_LINK) $(mio_execd_OBJECTS) $(mio_execd_LDADD) $(LIBS)
hio-execd$(EXEEXT): $(hio_execd_OBJECTS) $(hio_execd_DEPENDENCIES) $(EXTRA_hio_execd_DEPENDENCIES)
@rm -f hio-execd$(EXEEXT)
$(AM_V_CCLD)$(hio_execd_LINK) $(hio_execd_OBJECTS) $(hio_execd_LDADD) $(LIBS)
mio-t01$(EXEEXT): $(mio_t01_OBJECTS) $(mio_t01_DEPENDENCIES) $(EXTRA_mio_t01_DEPENDENCIES)
@rm -f mio-t01$(EXEEXT)
$(AM_V_CCLD)$(mio_t01_LINK) $(mio_t01_OBJECTS) $(mio_t01_LDADD) $(LIBS)
hio-t01$(EXEEXT): $(hio_t01_OBJECTS) $(hio_t01_DEPENDENCIES) $(EXTRA_hio_t01_DEPENDENCIES)
@rm -f hio-t01$(EXEEXT)
$(AM_V_CCLD)$(hio_t01_LINK) $(hio_t01_OBJECTS) $(hio_t01_LDADD) $(LIBS)
mio-t02$(EXEEXT): $(mio_t02_OBJECTS) $(mio_t02_DEPENDENCIES) $(EXTRA_mio_t02_DEPENDENCIES)
@rm -f mio-t02$(EXEEXT)
$(AM_V_CCLD)$(mio_t02_LINK) $(mio_t02_OBJECTS) $(mio_t02_LDADD) $(LIBS)
hio-t02$(EXEEXT): $(hio_t02_OBJECTS) $(hio_t02_DEPENDENCIES) $(EXTRA_hio_t02_DEPENDENCIES)
@rm -f hio-t02$(EXEEXT)
$(AM_V_CCLD)$(hio_t02_LINK) $(hio_t02_OBJECTS) $(hio_t02_LDADD) $(LIBS)
mio-t03$(EXEEXT): $(mio_t03_OBJECTS) $(mio_t03_DEPENDENCIES) $(EXTRA_mio_t03_DEPENDENCIES)
@rm -f mio-t03$(EXEEXT)
$(AM_V_CCLD)$(mio_t03_LINK) $(mio_t03_OBJECTS) $(mio_t03_LDADD) $(LIBS)
hio-t03$(EXEEXT): $(hio_t03_OBJECTS) $(hio_t03_DEPENDENCIES) $(EXTRA_hio_t03_DEPENDENCIES)
@rm -f hio-t03$(EXEEXT)
$(AM_V_CCLD)$(hio_t03_LINK) $(hio_t03_OBJECTS) $(hio_t03_LDADD) $(LIBS)
mio-t04$(EXEEXT): $(mio_t04_OBJECTS) $(mio_t04_DEPENDENCIES) $(EXTRA_mio_t04_DEPENDENCIES)
@rm -f mio-t04$(EXEEXT)
$(AM_V_CCLD)$(mio_t04_LINK) $(mio_t04_OBJECTS) $(mio_t04_LDADD) $(LIBS)
hio-t04$(EXEEXT): $(hio_t04_OBJECTS) $(hio_t04_DEPENDENCIES) $(EXTRA_hio_t04_DEPENDENCIES)
@rm -f hio-t04$(EXEEXT)
$(AM_V_CCLD)$(hio_t04_LINK) $(hio_t04_OBJECTS) $(hio_t04_LDADD) $(LIBS)
mio-t05$(EXEEXT): $(mio_t05_OBJECTS) $(mio_t05_DEPENDENCIES) $(EXTRA_mio_t05_DEPENDENCIES)
@rm -f mio-t05$(EXEEXT)
$(AM_V_CCLD)$(mio_t05_LINK) $(mio_t05_OBJECTS) $(mio_t05_LDADD) $(LIBS)
hio-t05$(EXEEXT): $(hio_t05_OBJECTS) $(hio_t05_DEPENDENCIES) $(EXTRA_hio_t05_DEPENDENCIES)
@rm -f hio-t05$(EXEEXT)
$(AM_V_CCLD)$(hio_t05_LINK) $(hio_t05_OBJECTS) $(hio_t05_LDADD) $(LIBS)
mio-t06$(EXEEXT): $(mio_t06_OBJECTS) $(mio_t06_DEPENDENCIES) $(EXTRA_mio_t06_DEPENDENCIES)
@rm -f mio-t06$(EXEEXT)
$(AM_V_CCLD)$(mio_t06_LINK) $(mio_t06_OBJECTS) $(mio_t06_LDADD) $(LIBS)
hio-t06$(EXEEXT): $(hio_t06_OBJECTS) $(hio_t06_DEPENDENCIES) $(EXTRA_hio_t06_DEPENDENCIES)
@rm -f hio-t06$(EXEEXT)
$(AM_V_CCLD)$(hio_t06_LINK) $(hio_t06_OBJECTS) $(hio_t06_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@ -525,13 +525,13 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mio_execd-execd.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mio_t01-t01.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mio_t02-t02.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mio_t03-t03.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mio_t04-t04.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mio_t05-t05.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mio_t06-t06.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hio_execd-execd.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hio_t01-t01.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hio_t02-t02.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hio_t03-t03.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hio_t04-t04.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hio_t05-t05.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hio_t06-t06.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@ -563,103 +563,103 @@ am--depfiles: $(am__depfiles_remade)
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
mio_execd-execd.o: execd.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_execd_CPPFLAGS) $(CPPFLAGS) $(mio_execd_CFLAGS) $(CFLAGS) -MT mio_execd-execd.o -MD -MP -MF $(DEPDIR)/mio_execd-execd.Tpo -c -o mio_execd-execd.o `test -f 'execd.c' || echo '$(srcdir)/'`execd.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mio_execd-execd.Tpo $(DEPDIR)/mio_execd-execd.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='execd.c' object='mio_execd-execd.o' libtool=no @AMDEPBACKSLASH@
hio_execd-execd.o: execd.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_execd_CPPFLAGS) $(CPPFLAGS) $(hio_execd_CFLAGS) $(CFLAGS) -MT hio_execd-execd.o -MD -MP -MF $(DEPDIR)/hio_execd-execd.Tpo -c -o hio_execd-execd.o `test -f 'execd.c' || echo '$(srcdir)/'`execd.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hio_execd-execd.Tpo $(DEPDIR)/hio_execd-execd.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='execd.c' object='hio_execd-execd.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_execd_CPPFLAGS) $(CPPFLAGS) $(mio_execd_CFLAGS) $(CFLAGS) -c -o mio_execd-execd.o `test -f 'execd.c' || echo '$(srcdir)/'`execd.c
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_execd_CPPFLAGS) $(CPPFLAGS) $(hio_execd_CFLAGS) $(CFLAGS) -c -o hio_execd-execd.o `test -f 'execd.c' || echo '$(srcdir)/'`execd.c
mio_execd-execd.obj: execd.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_execd_CPPFLAGS) $(CPPFLAGS) $(mio_execd_CFLAGS) $(CFLAGS) -MT mio_execd-execd.obj -MD -MP -MF $(DEPDIR)/mio_execd-execd.Tpo -c -o mio_execd-execd.obj `if test -f 'execd.c'; then $(CYGPATH_W) 'execd.c'; else $(CYGPATH_W) '$(srcdir)/execd.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mio_execd-execd.Tpo $(DEPDIR)/mio_execd-execd.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='execd.c' object='mio_execd-execd.obj' libtool=no @AMDEPBACKSLASH@
hio_execd-execd.obj: execd.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_execd_CPPFLAGS) $(CPPFLAGS) $(hio_execd_CFLAGS) $(CFLAGS) -MT hio_execd-execd.obj -MD -MP -MF $(DEPDIR)/hio_execd-execd.Tpo -c -o hio_execd-execd.obj `if test -f 'execd.c'; then $(CYGPATH_W) 'execd.c'; else $(CYGPATH_W) '$(srcdir)/execd.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hio_execd-execd.Tpo $(DEPDIR)/hio_execd-execd.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='execd.c' object='hio_execd-execd.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_execd_CPPFLAGS) $(CPPFLAGS) $(mio_execd_CFLAGS) $(CFLAGS) -c -o mio_execd-execd.obj `if test -f 'execd.c'; then $(CYGPATH_W) 'execd.c'; else $(CYGPATH_W) '$(srcdir)/execd.c'; fi`
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_execd_CPPFLAGS) $(CPPFLAGS) $(hio_execd_CFLAGS) $(CFLAGS) -c -o hio_execd-execd.obj `if test -f 'execd.c'; then $(CYGPATH_W) 'execd.c'; else $(CYGPATH_W) '$(srcdir)/execd.c'; fi`
mio_t01-t01.o: t01.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t01_CPPFLAGS) $(CPPFLAGS) $(mio_t01_CFLAGS) $(CFLAGS) -MT mio_t01-t01.o -MD -MP -MF $(DEPDIR)/mio_t01-t01.Tpo -c -o mio_t01-t01.o `test -f 't01.c' || echo '$(srcdir)/'`t01.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mio_t01-t01.Tpo $(DEPDIR)/mio_t01-t01.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t01.c' object='mio_t01-t01.o' libtool=no @AMDEPBACKSLASH@
hio_t01-t01.o: t01.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t01_CPPFLAGS) $(CPPFLAGS) $(hio_t01_CFLAGS) $(CFLAGS) -MT hio_t01-t01.o -MD -MP -MF $(DEPDIR)/hio_t01-t01.Tpo -c -o hio_t01-t01.o `test -f 't01.c' || echo '$(srcdir)/'`t01.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hio_t01-t01.Tpo $(DEPDIR)/hio_t01-t01.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t01.c' object='hio_t01-t01.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t01_CPPFLAGS) $(CPPFLAGS) $(mio_t01_CFLAGS) $(CFLAGS) -c -o mio_t01-t01.o `test -f 't01.c' || echo '$(srcdir)/'`t01.c
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t01_CPPFLAGS) $(CPPFLAGS) $(hio_t01_CFLAGS) $(CFLAGS) -c -o hio_t01-t01.o `test -f 't01.c' || echo '$(srcdir)/'`t01.c
mio_t01-t01.obj: t01.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t01_CPPFLAGS) $(CPPFLAGS) $(mio_t01_CFLAGS) $(CFLAGS) -MT mio_t01-t01.obj -MD -MP -MF $(DEPDIR)/mio_t01-t01.Tpo -c -o mio_t01-t01.obj `if test -f 't01.c'; then $(CYGPATH_W) 't01.c'; else $(CYGPATH_W) '$(srcdir)/t01.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mio_t01-t01.Tpo $(DEPDIR)/mio_t01-t01.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t01.c' object='mio_t01-t01.obj' libtool=no @AMDEPBACKSLASH@
hio_t01-t01.obj: t01.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t01_CPPFLAGS) $(CPPFLAGS) $(hio_t01_CFLAGS) $(CFLAGS) -MT hio_t01-t01.obj -MD -MP -MF $(DEPDIR)/hio_t01-t01.Tpo -c -o hio_t01-t01.obj `if test -f 't01.c'; then $(CYGPATH_W) 't01.c'; else $(CYGPATH_W) '$(srcdir)/t01.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hio_t01-t01.Tpo $(DEPDIR)/hio_t01-t01.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t01.c' object='hio_t01-t01.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t01_CPPFLAGS) $(CPPFLAGS) $(mio_t01_CFLAGS) $(CFLAGS) -c -o mio_t01-t01.obj `if test -f 't01.c'; then $(CYGPATH_W) 't01.c'; else $(CYGPATH_W) '$(srcdir)/t01.c'; fi`
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t01_CPPFLAGS) $(CPPFLAGS) $(hio_t01_CFLAGS) $(CFLAGS) -c -o hio_t01-t01.obj `if test -f 't01.c'; then $(CYGPATH_W) 't01.c'; else $(CYGPATH_W) '$(srcdir)/t01.c'; fi`
mio_t02-t02.o: t02.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t02_CPPFLAGS) $(CPPFLAGS) $(mio_t02_CFLAGS) $(CFLAGS) -MT mio_t02-t02.o -MD -MP -MF $(DEPDIR)/mio_t02-t02.Tpo -c -o mio_t02-t02.o `test -f 't02.c' || echo '$(srcdir)/'`t02.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mio_t02-t02.Tpo $(DEPDIR)/mio_t02-t02.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t02.c' object='mio_t02-t02.o' libtool=no @AMDEPBACKSLASH@
hio_t02-t02.o: t02.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t02_CPPFLAGS) $(CPPFLAGS) $(hio_t02_CFLAGS) $(CFLAGS) -MT hio_t02-t02.o -MD -MP -MF $(DEPDIR)/hio_t02-t02.Tpo -c -o hio_t02-t02.o `test -f 't02.c' || echo '$(srcdir)/'`t02.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hio_t02-t02.Tpo $(DEPDIR)/hio_t02-t02.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t02.c' object='hio_t02-t02.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t02_CPPFLAGS) $(CPPFLAGS) $(mio_t02_CFLAGS) $(CFLAGS) -c -o mio_t02-t02.o `test -f 't02.c' || echo '$(srcdir)/'`t02.c
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t02_CPPFLAGS) $(CPPFLAGS) $(hio_t02_CFLAGS) $(CFLAGS) -c -o hio_t02-t02.o `test -f 't02.c' || echo '$(srcdir)/'`t02.c
mio_t02-t02.obj: t02.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t02_CPPFLAGS) $(CPPFLAGS) $(mio_t02_CFLAGS) $(CFLAGS) -MT mio_t02-t02.obj -MD -MP -MF $(DEPDIR)/mio_t02-t02.Tpo -c -o mio_t02-t02.obj `if test -f 't02.c'; then $(CYGPATH_W) 't02.c'; else $(CYGPATH_W) '$(srcdir)/t02.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mio_t02-t02.Tpo $(DEPDIR)/mio_t02-t02.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t02.c' object='mio_t02-t02.obj' libtool=no @AMDEPBACKSLASH@
hio_t02-t02.obj: t02.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t02_CPPFLAGS) $(CPPFLAGS) $(hio_t02_CFLAGS) $(CFLAGS) -MT hio_t02-t02.obj -MD -MP -MF $(DEPDIR)/hio_t02-t02.Tpo -c -o hio_t02-t02.obj `if test -f 't02.c'; then $(CYGPATH_W) 't02.c'; else $(CYGPATH_W) '$(srcdir)/t02.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hio_t02-t02.Tpo $(DEPDIR)/hio_t02-t02.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t02.c' object='hio_t02-t02.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t02_CPPFLAGS) $(CPPFLAGS) $(mio_t02_CFLAGS) $(CFLAGS) -c -o mio_t02-t02.obj `if test -f 't02.c'; then $(CYGPATH_W) 't02.c'; else $(CYGPATH_W) '$(srcdir)/t02.c'; fi`
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t02_CPPFLAGS) $(CPPFLAGS) $(hio_t02_CFLAGS) $(CFLAGS) -c -o hio_t02-t02.obj `if test -f 't02.c'; then $(CYGPATH_W) 't02.c'; else $(CYGPATH_W) '$(srcdir)/t02.c'; fi`
mio_t03-t03.o: t03.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t03_CPPFLAGS) $(CPPFLAGS) $(mio_t03_CFLAGS) $(CFLAGS) -MT mio_t03-t03.o -MD -MP -MF $(DEPDIR)/mio_t03-t03.Tpo -c -o mio_t03-t03.o `test -f 't03.c' || echo '$(srcdir)/'`t03.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mio_t03-t03.Tpo $(DEPDIR)/mio_t03-t03.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t03.c' object='mio_t03-t03.o' libtool=no @AMDEPBACKSLASH@
hio_t03-t03.o: t03.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t03_CPPFLAGS) $(CPPFLAGS) $(hio_t03_CFLAGS) $(CFLAGS) -MT hio_t03-t03.o -MD -MP -MF $(DEPDIR)/hio_t03-t03.Tpo -c -o hio_t03-t03.o `test -f 't03.c' || echo '$(srcdir)/'`t03.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hio_t03-t03.Tpo $(DEPDIR)/hio_t03-t03.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t03.c' object='hio_t03-t03.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t03_CPPFLAGS) $(CPPFLAGS) $(mio_t03_CFLAGS) $(CFLAGS) -c -o mio_t03-t03.o `test -f 't03.c' || echo '$(srcdir)/'`t03.c
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t03_CPPFLAGS) $(CPPFLAGS) $(hio_t03_CFLAGS) $(CFLAGS) -c -o hio_t03-t03.o `test -f 't03.c' || echo '$(srcdir)/'`t03.c
mio_t03-t03.obj: t03.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t03_CPPFLAGS) $(CPPFLAGS) $(mio_t03_CFLAGS) $(CFLAGS) -MT mio_t03-t03.obj -MD -MP -MF $(DEPDIR)/mio_t03-t03.Tpo -c -o mio_t03-t03.obj `if test -f 't03.c'; then $(CYGPATH_W) 't03.c'; else $(CYGPATH_W) '$(srcdir)/t03.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mio_t03-t03.Tpo $(DEPDIR)/mio_t03-t03.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t03.c' object='mio_t03-t03.obj' libtool=no @AMDEPBACKSLASH@
hio_t03-t03.obj: t03.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t03_CPPFLAGS) $(CPPFLAGS) $(hio_t03_CFLAGS) $(CFLAGS) -MT hio_t03-t03.obj -MD -MP -MF $(DEPDIR)/hio_t03-t03.Tpo -c -o hio_t03-t03.obj `if test -f 't03.c'; then $(CYGPATH_W) 't03.c'; else $(CYGPATH_W) '$(srcdir)/t03.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hio_t03-t03.Tpo $(DEPDIR)/hio_t03-t03.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t03.c' object='hio_t03-t03.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t03_CPPFLAGS) $(CPPFLAGS) $(mio_t03_CFLAGS) $(CFLAGS) -c -o mio_t03-t03.obj `if test -f 't03.c'; then $(CYGPATH_W) 't03.c'; else $(CYGPATH_W) '$(srcdir)/t03.c'; fi`
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t03_CPPFLAGS) $(CPPFLAGS) $(hio_t03_CFLAGS) $(CFLAGS) -c -o hio_t03-t03.obj `if test -f 't03.c'; then $(CYGPATH_W) 't03.c'; else $(CYGPATH_W) '$(srcdir)/t03.c'; fi`
mio_t04-t04.o: t04.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t04_CPPFLAGS) $(CPPFLAGS) $(mio_t04_CFLAGS) $(CFLAGS) -MT mio_t04-t04.o -MD -MP -MF $(DEPDIR)/mio_t04-t04.Tpo -c -o mio_t04-t04.o `test -f 't04.c' || echo '$(srcdir)/'`t04.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mio_t04-t04.Tpo $(DEPDIR)/mio_t04-t04.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t04.c' object='mio_t04-t04.o' libtool=no @AMDEPBACKSLASH@
hio_t04-t04.o: t04.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t04_CPPFLAGS) $(CPPFLAGS) $(hio_t04_CFLAGS) $(CFLAGS) -MT hio_t04-t04.o -MD -MP -MF $(DEPDIR)/hio_t04-t04.Tpo -c -o hio_t04-t04.o `test -f 't04.c' || echo '$(srcdir)/'`t04.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hio_t04-t04.Tpo $(DEPDIR)/hio_t04-t04.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t04.c' object='hio_t04-t04.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t04_CPPFLAGS) $(CPPFLAGS) $(mio_t04_CFLAGS) $(CFLAGS) -c -o mio_t04-t04.o `test -f 't04.c' || echo '$(srcdir)/'`t04.c
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t04_CPPFLAGS) $(CPPFLAGS) $(hio_t04_CFLAGS) $(CFLAGS) -c -o hio_t04-t04.o `test -f 't04.c' || echo '$(srcdir)/'`t04.c
mio_t04-t04.obj: t04.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t04_CPPFLAGS) $(CPPFLAGS) $(mio_t04_CFLAGS) $(CFLAGS) -MT mio_t04-t04.obj -MD -MP -MF $(DEPDIR)/mio_t04-t04.Tpo -c -o mio_t04-t04.obj `if test -f 't04.c'; then $(CYGPATH_W) 't04.c'; else $(CYGPATH_W) '$(srcdir)/t04.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mio_t04-t04.Tpo $(DEPDIR)/mio_t04-t04.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t04.c' object='mio_t04-t04.obj' libtool=no @AMDEPBACKSLASH@
hio_t04-t04.obj: t04.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t04_CPPFLAGS) $(CPPFLAGS) $(hio_t04_CFLAGS) $(CFLAGS) -MT hio_t04-t04.obj -MD -MP -MF $(DEPDIR)/hio_t04-t04.Tpo -c -o hio_t04-t04.obj `if test -f 't04.c'; then $(CYGPATH_W) 't04.c'; else $(CYGPATH_W) '$(srcdir)/t04.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hio_t04-t04.Tpo $(DEPDIR)/hio_t04-t04.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t04.c' object='hio_t04-t04.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t04_CPPFLAGS) $(CPPFLAGS) $(mio_t04_CFLAGS) $(CFLAGS) -c -o mio_t04-t04.obj `if test -f 't04.c'; then $(CYGPATH_W) 't04.c'; else $(CYGPATH_W) '$(srcdir)/t04.c'; fi`
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t04_CPPFLAGS) $(CPPFLAGS) $(hio_t04_CFLAGS) $(CFLAGS) -c -o hio_t04-t04.obj `if test -f 't04.c'; then $(CYGPATH_W) 't04.c'; else $(CYGPATH_W) '$(srcdir)/t04.c'; fi`
mio_t05-t05.o: t05.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t05_CPPFLAGS) $(CPPFLAGS) $(mio_t05_CFLAGS) $(CFLAGS) -MT mio_t05-t05.o -MD -MP -MF $(DEPDIR)/mio_t05-t05.Tpo -c -o mio_t05-t05.o `test -f 't05.c' || echo '$(srcdir)/'`t05.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mio_t05-t05.Tpo $(DEPDIR)/mio_t05-t05.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t05.c' object='mio_t05-t05.o' libtool=no @AMDEPBACKSLASH@
hio_t05-t05.o: t05.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t05_CPPFLAGS) $(CPPFLAGS) $(hio_t05_CFLAGS) $(CFLAGS) -MT hio_t05-t05.o -MD -MP -MF $(DEPDIR)/hio_t05-t05.Tpo -c -o hio_t05-t05.o `test -f 't05.c' || echo '$(srcdir)/'`t05.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hio_t05-t05.Tpo $(DEPDIR)/hio_t05-t05.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t05.c' object='hio_t05-t05.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t05_CPPFLAGS) $(CPPFLAGS) $(mio_t05_CFLAGS) $(CFLAGS) -c -o mio_t05-t05.o `test -f 't05.c' || echo '$(srcdir)/'`t05.c
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t05_CPPFLAGS) $(CPPFLAGS) $(hio_t05_CFLAGS) $(CFLAGS) -c -o hio_t05-t05.o `test -f 't05.c' || echo '$(srcdir)/'`t05.c
mio_t05-t05.obj: t05.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t05_CPPFLAGS) $(CPPFLAGS) $(mio_t05_CFLAGS) $(CFLAGS) -MT mio_t05-t05.obj -MD -MP -MF $(DEPDIR)/mio_t05-t05.Tpo -c -o mio_t05-t05.obj `if test -f 't05.c'; then $(CYGPATH_W) 't05.c'; else $(CYGPATH_W) '$(srcdir)/t05.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mio_t05-t05.Tpo $(DEPDIR)/mio_t05-t05.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t05.c' object='mio_t05-t05.obj' libtool=no @AMDEPBACKSLASH@
hio_t05-t05.obj: t05.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t05_CPPFLAGS) $(CPPFLAGS) $(hio_t05_CFLAGS) $(CFLAGS) -MT hio_t05-t05.obj -MD -MP -MF $(DEPDIR)/hio_t05-t05.Tpo -c -o hio_t05-t05.obj `if test -f 't05.c'; then $(CYGPATH_W) 't05.c'; else $(CYGPATH_W) '$(srcdir)/t05.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hio_t05-t05.Tpo $(DEPDIR)/hio_t05-t05.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t05.c' object='hio_t05-t05.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t05_CPPFLAGS) $(CPPFLAGS) $(mio_t05_CFLAGS) $(CFLAGS) -c -o mio_t05-t05.obj `if test -f 't05.c'; then $(CYGPATH_W) 't05.c'; else $(CYGPATH_W) '$(srcdir)/t05.c'; fi`
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t05_CPPFLAGS) $(CPPFLAGS) $(hio_t05_CFLAGS) $(CFLAGS) -c -o hio_t05-t05.obj `if test -f 't05.c'; then $(CYGPATH_W) 't05.c'; else $(CYGPATH_W) '$(srcdir)/t05.c'; fi`
mio_t06-t06.o: t06.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t06_CPPFLAGS) $(CPPFLAGS) $(mio_t06_CFLAGS) $(CFLAGS) -MT mio_t06-t06.o -MD -MP -MF $(DEPDIR)/mio_t06-t06.Tpo -c -o mio_t06-t06.o `test -f 't06.c' || echo '$(srcdir)/'`t06.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mio_t06-t06.Tpo $(DEPDIR)/mio_t06-t06.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t06.c' object='mio_t06-t06.o' libtool=no @AMDEPBACKSLASH@
hio_t06-t06.o: t06.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t06_CPPFLAGS) $(CPPFLAGS) $(hio_t06_CFLAGS) $(CFLAGS) -MT hio_t06-t06.o -MD -MP -MF $(DEPDIR)/hio_t06-t06.Tpo -c -o hio_t06-t06.o `test -f 't06.c' || echo '$(srcdir)/'`t06.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hio_t06-t06.Tpo $(DEPDIR)/hio_t06-t06.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t06.c' object='hio_t06-t06.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t06_CPPFLAGS) $(CPPFLAGS) $(mio_t06_CFLAGS) $(CFLAGS) -c -o mio_t06-t06.o `test -f 't06.c' || echo '$(srcdir)/'`t06.c
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t06_CPPFLAGS) $(CPPFLAGS) $(hio_t06_CFLAGS) $(CFLAGS) -c -o hio_t06-t06.o `test -f 't06.c' || echo '$(srcdir)/'`t06.c
mio_t06-t06.obj: t06.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t06_CPPFLAGS) $(CPPFLAGS) $(mio_t06_CFLAGS) $(CFLAGS) -MT mio_t06-t06.obj -MD -MP -MF $(DEPDIR)/mio_t06-t06.Tpo -c -o mio_t06-t06.obj `if test -f 't06.c'; then $(CYGPATH_W) 't06.c'; else $(CYGPATH_W) '$(srcdir)/t06.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mio_t06-t06.Tpo $(DEPDIR)/mio_t06-t06.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t06.c' object='mio_t06-t06.obj' libtool=no @AMDEPBACKSLASH@
hio_t06-t06.obj: t06.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t06_CPPFLAGS) $(CPPFLAGS) $(hio_t06_CFLAGS) $(CFLAGS) -MT hio_t06-t06.obj -MD -MP -MF $(DEPDIR)/hio_t06-t06.Tpo -c -o hio_t06-t06.obj `if test -f 't06.c'; then $(CYGPATH_W) 't06.c'; else $(CYGPATH_W) '$(srcdir)/t06.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hio_t06-t06.Tpo $(DEPDIR)/hio_t06-t06.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='t06.c' object='hio_t06-t06.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mio_t06_CPPFLAGS) $(CPPFLAGS) $(mio_t06_CFLAGS) $(CFLAGS) -c -o mio_t06-t06.obj `if test -f 't06.c'; then $(CYGPATH_W) 't06.c'; else $(CYGPATH_W) '$(srcdir)/t06.c'; fi`
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(hio_t06_CPPFLAGS) $(CPPFLAGS) $(hio_t06_CFLAGS) $(CFLAGS) -c -o hio_t06-t06.obj `if test -f 't06.c'; then $(CYGPATH_W) 't06.c'; else $(CYGPATH_W) '$(srcdir)/t06.c'; fi`
mostlyclean-libtool:
-rm -f *.lo
@ -794,13 +794,13 @@ clean: clean-am
clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f ./$(DEPDIR)/mio_execd-execd.Po
-rm -f ./$(DEPDIR)/mio_t01-t01.Po
-rm -f ./$(DEPDIR)/mio_t02-t02.Po
-rm -f ./$(DEPDIR)/mio_t03-t03.Po
-rm -f ./$(DEPDIR)/mio_t04-t04.Po
-rm -f ./$(DEPDIR)/mio_t05-t05.Po
-rm -f ./$(DEPDIR)/mio_t06-t06.Po
-rm -f ./$(DEPDIR)/hio_execd-execd.Po
-rm -f ./$(DEPDIR)/hio_t01-t01.Po
-rm -f ./$(DEPDIR)/hio_t02-t02.Po
-rm -f ./$(DEPDIR)/hio_t03-t03.Po
-rm -f ./$(DEPDIR)/hio_t04-t04.Po
-rm -f ./$(DEPDIR)/hio_t05-t05.Po
-rm -f ./$(DEPDIR)/hio_t06-t06.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@ -846,13 +846,13 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f ./$(DEPDIR)/mio_execd-execd.Po
-rm -f ./$(DEPDIR)/mio_t01-t01.Po
-rm -f ./$(DEPDIR)/mio_t02-t02.Po
-rm -f ./$(DEPDIR)/mio_t03-t03.Po
-rm -f ./$(DEPDIR)/mio_t04-t04.Po
-rm -f ./$(DEPDIR)/mio_t05-t05.Po
-rm -f ./$(DEPDIR)/mio_t06-t06.Po
-rm -f ./$(DEPDIR)/hio_execd-execd.Po
-rm -f ./$(DEPDIR)/hio_t01-t01.Po
-rm -f ./$(DEPDIR)/hio_t02-t02.Po
-rm -f ./$(DEPDIR)/hio_t03-t03.Po
-rm -f ./$(DEPDIR)/hio_t04-t04.Po
-rm -f ./$(DEPDIR)/hio_t05-t05.Po
-rm -f ./$(DEPDIR)/hio_t06-t06.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

View File

@ -25,10 +25,10 @@
*/
#include <mio.h>
#include <mio-utl.h>
#include <mio-sck.h>
#include <mio-pro.h>
#include <hio.h>
#include <hio-utl.h>
#include <hio-sck.h>
#include <hio-pro.h>
#include <stdlib.h>
#include <string.h>
@ -57,14 +57,14 @@
struct mmgr_stat_t
{
mio_oow_t total_count;
hio_oow_t total_count;
};
typedef struct mmgr_stat_t mmgr_stat_t;
static mmgr_stat_t mmgr_stat;
static void* mmgr_alloc (mio_mmgr_t* mmgr, mio_oow_t size)
static void* mmgr_alloc (hio_mmgr_t* mmgr, hio_oow_t size)
{
void* x;
@ -72,7 +72,7 @@ static void* mmgr_alloc (mio_mmgr_t* mmgr, mio_oow_t size)
if (((mmgr_stat_t*)mmgr->ctx)->total_count > 300)
{
printf ("CRITICAL ERROR ---> too many heap chunks...\n");
return MIO_NULL;
return HIO_NULL;
}
#endif
@ -81,19 +81,19 @@ printf ("CRITICAL ERROR ---> too many heap chunks...\n");
return x;
}
static void* mmgr_realloc (mio_mmgr_t* mmgr, void* ptr, mio_oow_t size)
static void* mmgr_realloc (hio_mmgr_t* mmgr, void* ptr, hio_oow_t size)
{
return realloc (ptr, size);
}
static void mmgr_free (mio_mmgr_t* mmgr, void* ptr)
static void mmgr_free (hio_mmgr_t* mmgr, void* ptr)
{
((mmgr_stat_t*)mmgr->ctx)->total_count--;
return free (ptr);
}
static mio_mmgr_t mmgr =
static hio_mmgr_t mmgr =
{
mmgr_alloc,
mmgr_realloc,
@ -125,139 +125,139 @@ struct tcp_server_t
};
typedef struct tcp_server_t tcp_server_t;
static void tcp_sck_on_disconnect (mio_dev_sck_t* tcp)
static void tcp_sck_on_disconnect (hio_dev_sck_t* tcp)
{
switch (MIO_DEV_SCK_GET_PROGRESS(tcp))
switch (HIO_DEV_SCK_GET_PROGRESS(tcp))
{
case MIO_DEV_SCK_CONNECTING:
MIO_INFO1 (tcp->mio, "OUTGOING SESSION DISCONNECTED - FAILED TO CONNECT (%d) TO REMOTE SERVER\n", (int)tcp->hnd);
case HIO_DEV_SCK_CONNECTING:
HIO_INFO1 (tcp->hio, "OUTGOING SESSION DISCONNECTED - FAILED TO CONNECT (%d) TO REMOTE SERVER\n", (int)tcp->hnd);
break;
case MIO_DEV_SCK_CONNECTING_SSL:
MIO_INFO1 (tcp->mio, "OUTGOING SESSION DISCONNECTED - FAILED TO SSL-CONNECT (%d) TO REMOTE SERVER\n", (int)tcp->hnd);
case HIO_DEV_SCK_CONNECTING_SSL:
HIO_INFO1 (tcp->hio, "OUTGOING SESSION DISCONNECTED - FAILED TO SSL-CONNECT (%d) TO REMOTE SERVER\n", (int)tcp->hnd);
break;
case MIO_DEV_SCK_LISTENING:
MIO_INFO1 (tcp->mio, "SHUTTING DOWN THE SERVER SOCKET(%d)...\n", (int)tcp->hnd);
case HIO_DEV_SCK_LISTENING:
HIO_INFO1 (tcp->hio, "SHUTTING DOWN THE SERVER SOCKET(%d)...\n", (int)tcp->hnd);
break;
case MIO_DEV_SCK_CONNECTED:
MIO_INFO1 (tcp->mio, "OUTGOING CLIENT CONNECTION GOT TORN DOWN(%d).......\n", (int)tcp->hnd);
case HIO_DEV_SCK_CONNECTED:
HIO_INFO1 (tcp->hio, "OUTGOING CLIENT CONNECTION GOT TORN DOWN(%d).......\n", (int)tcp->hnd);
break;
case MIO_DEV_SCK_ACCEPTING_SSL:
MIO_INFO1 (tcp->mio, "INCOMING SSL-ACCEPT GOT DISCONNECTED(%d) ....\n", (int)tcp->hnd);
case HIO_DEV_SCK_ACCEPTING_SSL:
HIO_INFO1 (tcp->hio, "INCOMING SSL-ACCEPT GOT DISCONNECTED(%d) ....\n", (int)tcp->hnd);
break;
case MIO_DEV_SCK_ACCEPTED:
MIO_INFO1 (tcp->mio, "INCOMING CLIENT BEING SERVED GOT DISCONNECTED(%d).......\n", (int)tcp->hnd);
case HIO_DEV_SCK_ACCEPTED:
HIO_INFO1 (tcp->hio, "INCOMING CLIENT BEING SERVED GOT DISCONNECTED(%d).......\n", (int)tcp->hnd);
break;
default:
MIO_INFO2 (tcp->mio, "SOCKET DEVICE DISCONNECTED (%d - %x)\n", (int)tcp->hnd, (unsigned int)tcp->state);
HIO_INFO2 (tcp->hio, "SOCKET DEVICE DISCONNECTED (%d - %x)\n", (int)tcp->hnd, (unsigned int)tcp->state);
break;
}
}
static void tcp_sck_on_connect (mio_dev_sck_t* tcp)
static void tcp_sck_on_connect (hio_dev_sck_t* tcp)
{
mio_bch_t buf1[128], buf2[128];
hio_bch_t buf1[128], buf2[128];
mio_skadtobcstr (tcp->mio, &tcp->localaddr, buf1, MIO_COUNTOF(buf1), MIO_SKAD_TO_BCSTR_ADDR | MIO_SKAD_TO_BCSTR_PORT);
mio_skadtobcstr (tcp->mio, &tcp->remoteaddr, buf2, MIO_COUNTOF(buf2), MIO_SKAD_TO_BCSTR_ADDR | MIO_SKAD_TO_BCSTR_PORT);
hio_skadtobcstr (tcp->hio, &tcp->localaddr, buf1, HIO_COUNTOF(buf1), HIO_SKAD_TO_BCSTR_ADDR | HIO_SKAD_TO_BCSTR_PORT);
hio_skadtobcstr (tcp->hio, &tcp->remoteaddr, buf2, HIO_COUNTOF(buf2), HIO_SKAD_TO_BCSTR_ADDR | HIO_SKAD_TO_BCSTR_PORT);
if (tcp->state & MIO_DEV_SCK_CONNECTED)
if (tcp->state & HIO_DEV_SCK_CONNECTED)
{
MIO_INFO3 (tcp->mio, "DEVICE connected to a remote server... LOCAL %hs REMOTE %hs SCK: %d\n", buf1, buf2, tcp->hnd);
HIO_INFO3 (tcp->hio, "DEVICE connected to a remote server... LOCAL %hs REMOTE %hs SCK: %d\n", buf1, buf2, tcp->hnd);
}
else if (tcp->state & MIO_DEV_SCK_ACCEPTED)
else if (tcp->state & HIO_DEV_SCK_ACCEPTED)
{
MIO_INFO3 (tcp->mio, "DEVICE accepted client device... .LOCAL %hs REMOTE %hs SCK: %d\n", buf1, buf2, tcp->hnd);
HIO_INFO3 (tcp->hio, "DEVICE accepted client device... .LOCAL %hs REMOTE %hs SCK: %d\n", buf1, buf2, tcp->hnd);
}
if (mio_dev_sck_write(tcp, "hello", 5, MIO_NULL, MIO_NULL) <= -1)
if (hio_dev_sck_write(tcp, "hello", 5, HIO_NULL, HIO_NULL) <= -1)
{
mio_dev_sck_halt (tcp);
hio_dev_sck_halt (tcp);
}
}
static int tcp_sck_on_write (mio_dev_sck_t* tcp, mio_iolen_t wrlen, void* wrctx, const mio_skad_t* dstaddr)
static int tcp_sck_on_write (hio_dev_sck_t* tcp, hio_iolen_t wrlen, void* wrctx, const hio_skad_t* dstaddr)
{
tcp_server_t* ts;
mio_ntime_t tmout;
hio_ntime_t tmout;
if (wrlen <= -1)
{
MIO_INFO1 (tcp->mio, "TCP_SCK_ON_WRITE(%d) >>> SEDING TIMED OUT...........\n", (int)tcp->hnd);
mio_dev_sck_halt (tcp);
HIO_INFO1 (tcp->hio, "TCP_SCK_ON_WRITE(%d) >>> SEDING TIMED OUT...........\n", (int)tcp->hnd);
hio_dev_sck_halt (tcp);
}
else
{
ts = (tcp_server_t*)(tcp + 1);
if (wrlen == 0)
{
MIO_INFO1 (tcp->mio, "TCP_SCK_ON_WRITE(%d) >>> CLOSED WRITING END\n", (int)tcp->hnd);
HIO_INFO1 (tcp->hio, "TCP_SCK_ON_WRITE(%d) >>> CLOSED WRITING END\n", (int)tcp->hnd);
}
else
{
MIO_INFO3 (tcp->mio, "TCP_SCK_ON_WRITE(%d) >>> SENT MESSAGE %d of length %ld\n", (int)tcp->hnd, ts->tally, (long int)wrlen);
HIO_INFO3 (tcp->hio, "TCP_SCK_ON_WRITE(%d) >>> SENT MESSAGE %d of length %ld\n", (int)tcp->hnd, ts->tally, (long int)wrlen);
}
ts->tally++;
// if (ts->tally >= 2) mio_dev_sck_halt (tcp);
// if (ts->tally >= 2) hio_dev_sck_halt (tcp);
MIO_INIT_NTIME (&tmout, 5, 0);
//mio_dev_sck_read (tcp, 1);
HIO_INIT_NTIME (&tmout, 5, 0);
//hio_dev_sck_read (tcp, 1);
MIO_INFO3 (tcp->mio, "TCP_SCK_ON_WRITE(%d) >>> REQUESTING to READ with timeout of %ld.%08ld\n", (int)tcp->hnd, (long int)tmout.sec, (long int)tmout.nsec);
mio_dev_sck_timedread (tcp, 1, &tmout);
HIO_INFO3 (tcp->hio, "TCP_SCK_ON_WRITE(%d) >>> REQUESTING to READ with timeout of %ld.%08ld\n", (int)tcp->hnd, (long int)tmout.sec, (long int)tmout.nsec);
hio_dev_sck_timedread (tcp, 1, &tmout);
}
return 0;
}
static int tcp_sck_on_read (mio_dev_sck_t* tcp, const void* buf, mio_iolen_t len, const mio_skad_t* srcaddr)
static int tcp_sck_on_read (hio_dev_sck_t* tcp, const void* buf, hio_iolen_t len, const hio_skad_t* srcaddr)
{
int n;
if (len <= -1)
{
MIO_INFO1 (tcp->mio, "TCP_SCK_ON_READ(%d) STREAM DEVICE: TIMED OUT...\n", (int)tcp->hnd);
mio_dev_sck_halt (tcp);
HIO_INFO1 (tcp->hio, "TCP_SCK_ON_READ(%d) STREAM DEVICE: TIMED OUT...\n", (int)tcp->hnd);
hio_dev_sck_halt (tcp);
return 0;
}
else if (len <= 0)
{
MIO_INFO1 (tcp->mio, "TCP_SCK_ON_READ(%d) STREAM DEVICE: EOF RECEIVED...\n", (int)tcp->hnd);
HIO_INFO1 (tcp->hio, "TCP_SCK_ON_READ(%d) STREAM DEVICE: EOF RECEIVED...\n", (int)tcp->hnd);
/* no outstanding request. but EOF */
mio_dev_sck_halt (tcp);
hio_dev_sck_halt (tcp);
return 0;
}
MIO_INFO2 (tcp->mio, "TCP_SCK_ON_READ(%d) - received %d bytes\n", (int)tcp->hnd, (int)len);
HIO_INFO2 (tcp->hio, "TCP_SCK_ON_READ(%d) - received %d bytes\n", (int)tcp->hnd, (int)len);
{
mio_ntime_t tmout;
hio_ntime_t tmout;
static char a ='A';
static char xxx[1000000];
memset (xxx, a++ , MIO_SIZEOF(xxx));
memset (xxx, a++ , HIO_SIZEOF(xxx));
MIO_INFO2 (tcp->mio, "TCP_SCK_ON_READ(%d) >>> REQUESTING to write data of %d bytes\n", (int)tcp->hnd, MIO_SIZEOF(xxx));
//return mio_dev_sck_write (tcp, "HELLO", 5, MIO_NULL);
MIO_INIT_NTIME (&tmout, 5, 0);
n = mio_dev_sck_timedwrite(tcp, xxx, MIO_SIZEOF(xxx), &tmout, MIO_NULL, MIO_NULL);
HIO_INFO2 (tcp->hio, "TCP_SCK_ON_READ(%d) >>> REQUESTING to write data of %d bytes\n", (int)tcp->hnd, HIO_SIZEOF(xxx));
//return hio_dev_sck_write (tcp, "HELLO", 5, HIO_NULL);
HIO_INIT_NTIME (&tmout, 5, 0);
n = hio_dev_sck_timedwrite(tcp, xxx, HIO_SIZEOF(xxx), &tmout, HIO_NULL, HIO_NULL);
if (n <= -1) return -1;
}
MIO_INFO1 (tcp->mio, "TCP_SCK_ON_READ(%d) - REQUESTING TO STOP READ\n", (int)tcp->hnd);
mio_dev_sck_read (tcp, 0);
HIO_INFO1 (tcp->hio, "TCP_SCK_ON_READ(%d) - REQUESTING TO STOP READ\n", (int)tcp->hnd);
hio_dev_sck_read (tcp, 0);
#if 0
MIO_INFO1 (tcp->mio, "TCP_SCK_ON_READ(%d) - REQUESTING TO CLOSE WRITING END\n", (int)tcp->hnd);
HIO_INFO1 (tcp->hio, "TCP_SCK_ON_READ(%d) - REQUESTING TO CLOSE WRITING END\n", (int)tcp->hnd);
/* post the write finisher - close the writing end */
n = mio_dev_sck_write(tcp, MIO_NULL, 0, MIO_NULL, MIO_NULL);
n = hio_dev_sck_write(tcp, HIO_NULL, 0, HIO_NULL, HIO_NULL);
if (n <= -1) return -1;
#endif
@ -268,57 +268,57 @@ static int tcp_sck_on_read (mio_dev_sck_t* tcp, const void* buf, mio_iolen_t len
/* ========================================================================= */
static void pro_on_close (mio_dev_pro_t* pro, mio_dev_pro_sid_t sid)
static void pro_on_close (hio_dev_pro_t* pro, hio_dev_pro_sid_t sid)
{
mio_t* mio = pro->mio;
if (sid == MIO_DEV_PRO_MASTER)
MIO_INFO1 (mio, "PROCESS(%d) CLOSE MASTER\n", (int)pro->child_pid);
hio_t* hio = pro->hio;
if (sid == HIO_DEV_PRO_MASTER)
HIO_INFO1 (hio, "PROCESS(%d) CLOSE MASTER\n", (int)pro->child_pid);
else
MIO_INFO2 (mio, "PROCESS(%d) CLOSE SLAVE[%d]\n", (int)pro->child_pid, sid);
HIO_INFO2 (hio, "PROCESS(%d) CLOSE SLAVE[%d]\n", (int)pro->child_pid, sid);
}
static int pro_on_read (mio_dev_pro_t* pro, mio_dev_pro_sid_t sid, const void* data, mio_iolen_t dlen)
static int pro_on_read (hio_dev_pro_t* pro, hio_dev_pro_sid_t sid, const void* data, hio_iolen_t dlen)
{
mio_t* mio = pro->mio;
hio_t* hio = pro->hio;
if (dlen <= -1)
{
MIO_INFO1 (mio, "PROCESS(%d): READ TIMED OUT...\n", (int)pro->child_pid);
mio_dev_pro_halt (pro);
HIO_INFO1 (hio, "PROCESS(%d): READ TIMED OUT...\n", (int)pro->child_pid);
hio_dev_pro_halt (pro);
return 0;
}
else if (dlen <= 0)
{
MIO_INFO1 (mio, "PROCESS(%d): EOF RECEIVED...\n", (int)pro->child_pid);
HIO_INFO1 (hio, "PROCESS(%d): EOF RECEIVED...\n", (int)pro->child_pid);
/* no outstanding request. but EOF */
mio_dev_pro_halt (pro);
hio_dev_pro_halt (pro);
return 0;
}
MIO_INFO5 (mio, "PROCESS(%d) READ DATA ON SLAVE[%d] len=%d [%.*hs]\n", (int)pro->child_pid, (int)sid, (int)dlen, dlen, (char*)data);
if (sid == MIO_DEV_PRO_OUT)
HIO_INFO5 (hio, "PROCESS(%d) READ DATA ON SLAVE[%d] len=%d [%.*hs]\n", (int)pro->child_pid, (int)sid, (int)dlen, dlen, (char*)data);
if (sid == HIO_DEV_PRO_OUT)
{
mio_dev_pro_read (pro, sid, 0);
mio_dev_pro_write (pro, "HELLO\n", 6, MIO_NULL);
hio_dev_pro_read (pro, sid, 0);
hio_dev_pro_write (pro, "HELLO\n", 6, HIO_NULL);
}
return 0;
}
static int pro_on_write (mio_dev_pro_t* pro, mio_iolen_t wrlen, void* wrctx)
static int pro_on_write (hio_dev_pro_t* pro, hio_iolen_t wrlen, void* wrctx)
{
mio_t* mio = pro->mio;
mio_ntime_t tmout;
hio_t* hio = pro->hio;
hio_ntime_t tmout;
if (wrlen <= -1)
{
MIO_INFO1 (mio, "PROCESS(%d): WRITE TIMED OUT...\n", (int)pro->child_pid);
mio_dev_pro_halt (pro);
HIO_INFO1 (hio, "PROCESS(%d): WRITE TIMED OUT...\n", (int)pro->child_pid);
hio_dev_pro_halt (pro);
return 0;
}
MIO_DEBUG2 (mio, "PROCESS(%d) wrote data of %d bytes\n", (int)pro->child_pid, (int)wrlen);
/*mio_dev_pro_read (pro, MIO_DEV_PRO_OUT, 1);*/
MIO_INIT_NTIME (&tmout, 5, 0);
mio_dev_pro_timedread (pro, MIO_DEV_PRO_OUT, 1, &tmout);
HIO_DEBUG2 (hio, "PROCESS(%d) wrote data of %d bytes\n", (int)pro->child_pid, (int)wrlen);
/*hio_dev_pro_read (pro, HIO_DEV_PRO_OUT, 1);*/
HIO_INIT_NTIME (&tmout, 5, 0);
hio_dev_pro_timedread (pro, HIO_DEV_PRO_OUT, 1, &tmout);
return 0;
}
@ -326,35 +326,35 @@ static int pro_on_write (mio_dev_pro_t* pro, mio_iolen_t wrlen, void* wrctx)
/* ========================================================================= */
static mio_t* g_mio;
static hio_t* g_hio;
static void handle_signal (int sig)
{
if (g_mio) mio_stop (g_mio, MIO_STOPREQ_TERMINATION);
if (g_hio) hio_stop (g_hio, HIO_STOPREQ_TERMINATION);
}
int main (int argc, char* argv[])
{
mio_t* mio = MIO_NULL;
mio_dev_sck_t* tcpsvr;
mio_dev_sck_make_t tcp_make;
mio_dev_sck_connect_t tcp_conn;
hio_t* hio = HIO_NULL;
hio_dev_sck_t* tcpsvr;
hio_dev_sck_make_t tcp_make;
hio_dev_sck_connect_t tcp_conn;
tcp_server_t* ts;
mio = mio_open(&mmgr, 0, MIO_NULL, MIO_FEATURE_ALL, 512, MIO_NULL);
if (!mio)
hio = hio_open(&mmgr, 0, HIO_NULL, HIO_FEATURE_ALL, 512, HIO_NULL);
if (!hio)
{
printf ("Cannot open mio\n");
printf ("Cannot open hio\n");
goto oops;
}
memset (&tcp_make, 0, MIO_SIZEOF(tcp_make));
tcp_make.type = MIO_DEV_SCK_TCP4;
memset (&tcp_make, 0, HIO_SIZEOF(tcp_make));
tcp_make.type = HIO_DEV_SCK_TCP4;
tcp_make.on_write = tcp_sck_on_write;
tcp_make.on_read = tcp_sck_on_read;
tcp_make.on_connect = tcp_sck_on_connect;
tcp_make.on_disconnect = tcp_sck_on_disconnect;
tcpsvr = mio_dev_sck_make(mio, MIO_SIZEOF(tcp_server_t), &tcp_make);
tcpsvr = hio_dev_sck_make(hio, HIO_SIZEOF(tcp_server_t), &tcp_make);
if (!tcpsvr)
{
printf ("Cannot make a tcp server\n");
@ -364,23 +364,23 @@ int main (int argc, char* argv[])
ts = (tcp_server_t*)(tcpsvr + 1);
ts->tally = 0;
memset (&tcp_conn, 0, MIO_SIZEOF(tcp_conn));
mio_bcstrtoskad(mio, "127.0.0.1:9999", &tcp_conn.remoteaddr);
MIO_INIT_NTIME (&tcp_conn.connect_tmout, 5, 0);
memset (&tcp_conn, 0, HIO_SIZEOF(tcp_conn));
hio_bcstrtoskad(hio, "127.0.0.1:9999", &tcp_conn.remoteaddr);
HIO_INIT_NTIME (&tcp_conn.connect_tmout, 5, 0);
tcp_conn.options = 0;
if (mio_dev_sck_connect(tcpsvr, &tcp_conn) <= -1)
if (hio_dev_sck_connect(tcpsvr, &tcp_conn) <= -1)
{
}
#if 0
while (1)
{
mio_exec (mio);
hio_exec (hio);
}
#endif
mio_loop (mio);
hio_loop (hio);
oops:
if (mio) mio_close (mio);
if (hio) hio_close (hio);
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,29 +1,29 @@
#include <mio.h>
#include <mio-utl.h>
#include <mio-sck.h>
#include <hio.h>
#include <hio-utl.h>
#include <hio-sck.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
struct mmgr_stat_t
{
mio_oow_t total_count;
hio_oow_t total_count;
};
typedef struct mmgr_stat_t mmgr_stat_t;
static mmgr_stat_t mmgr_stat;
static void* mmgr_alloc (mio_mmgr_t* mmgr, mio_oow_t size)
static void* mmgr_alloc (hio_mmgr_t* mmgr, hio_oow_t size)
{
void* x;
if (((mmgr_stat_t*)mmgr->ctx)->total_count > 3000)
{
printf ("CRITICAL ERROR ---> too many heap chunks...\n");
return MIO_NULL;
return HIO_NULL;
}
x = malloc (size);
@ -31,19 +31,19 @@ printf ("CRITICAL ERROR ---> too many heap chunks...\n");
return x;
}
static void* mmgr_realloc (mio_mmgr_t* mmgr, void* ptr, mio_oow_t size)
static void* mmgr_realloc (hio_mmgr_t* mmgr, void* ptr, hio_oow_t size)
{
return realloc (ptr, size);
}
static void mmgr_free (mio_mmgr_t* mmgr, void* ptr)
static void mmgr_free (hio_mmgr_t* mmgr, void* ptr)
{
((mmgr_stat_t*)mmgr->ctx)->total_count--;
return free (ptr);
}
static mio_mmgr_t mmgr =
static hio_mmgr_t mmgr =
{
mmgr_alloc,
mmgr_realloc,
@ -59,139 +59,139 @@ struct tcp_xtn_t
typedef struct tcp_xtn_t tcp_xtn_t;
static void tcp_sck_on_disconnect (mio_dev_sck_t* tcp)
static void tcp_sck_on_disconnect (hio_dev_sck_t* tcp)
{
switch (MIO_DEV_SCK_GET_PROGRESS(tcp))
switch (HIO_DEV_SCK_GET_PROGRESS(tcp))
{
case MIO_DEV_SCK_CONNECTING:
MIO_INFO1 (tcp->mio, "OUTGOING SESSION DISCONNECTED - FAILED TO CONNECT (%d) TO REMOTE SERVER\n", (int)tcp->hnd);
case HIO_DEV_SCK_CONNECTING:
HIO_INFO1 (tcp->hio, "OUTGOING SESSION DISCONNECTED - FAILED TO CONNECT (%d) TO REMOTE SERVER\n", (int)tcp->hnd);
break;
case MIO_DEV_SCK_CONNECTING_SSL:
MIO_INFO1 (tcp->mio, "OUTGOING SESSION DISCONNECTED - FAILED TO SSL-CONNECT (%d) TO REMOTE SERVER\n", (int)tcp->hnd);
case HIO_DEV_SCK_CONNECTING_SSL:
HIO_INFO1 (tcp->hio, "OUTGOING SESSION DISCONNECTED - FAILED TO SSL-CONNECT (%d) TO REMOTE SERVER\n", (int)tcp->hnd);
break;
case MIO_DEV_SCK_LISTENING:
MIO_INFO1 (tcp->mio, "SHUTTING DOWN THE SERVER SOCKET(%d)...\n", (int)tcp->hnd);
case HIO_DEV_SCK_LISTENING:
HIO_INFO1 (tcp->hio, "SHUTTING DOWN THE SERVER SOCKET(%d)...\n", (int)tcp->hnd);
break;
case MIO_DEV_SCK_CONNECTED:
MIO_INFO1 (tcp->mio, "OUTGOING CLIENT CONNECTION GOT TORN DOWN(%d).......\n", (int)tcp->hnd);
case HIO_DEV_SCK_CONNECTED:
HIO_INFO1 (tcp->hio, "OUTGOING CLIENT CONNECTION GOT TORN DOWN(%d).......\n", (int)tcp->hnd);
break;
case MIO_DEV_SCK_ACCEPTING_SSL:
MIO_INFO1 (tcp->mio, "INCOMING SSL-ACCEPT GOT DISCONNECTED(%d) ....\n", (int)tcp->hnd);
case HIO_DEV_SCK_ACCEPTING_SSL:
HIO_INFO1 (tcp->hio, "INCOMING SSL-ACCEPT GOT DISCONNECTED(%d) ....\n", (int)tcp->hnd);
break;
case MIO_DEV_SCK_ACCEPTED:
MIO_INFO1 (tcp->mio, "INCOMING CLIENT BEING SERVED GOT DISCONNECTED(%d).......\n", (int)tcp->hnd);
case HIO_DEV_SCK_ACCEPTED:
HIO_INFO1 (tcp->hio, "INCOMING CLIENT BEING SERVED GOT DISCONNECTED(%d).......\n", (int)tcp->hnd);
break;
default:
MIO_INFO2 (tcp->mio, "SOCKET DEVICE DISCONNECTED (%d - %x)\n", (int)tcp->hnd, (unsigned int)tcp->state);
HIO_INFO2 (tcp->hio, "SOCKET DEVICE DISCONNECTED (%d - %x)\n", (int)tcp->hnd, (unsigned int)tcp->state);
break;
}
}
static void tcp_sck_on_connect (mio_dev_sck_t* tcp)
static void tcp_sck_on_connect (hio_dev_sck_t* tcp)
{
mio_bch_t buf1[128], buf2[128];
hio_bch_t buf1[128], buf2[128];
mio_skadtobcstr (tcp->mio, &tcp->localaddr, buf1, MIO_COUNTOF(buf1), MIO_SKAD_TO_BCSTR_ADDR | MIO_SKAD_TO_BCSTR_PORT);
mio_skadtobcstr (tcp->mio, &tcp->remoteaddr, buf2, MIO_COUNTOF(buf2), MIO_SKAD_TO_BCSTR_ADDR | MIO_SKAD_TO_BCSTR_PORT);
hio_skadtobcstr (tcp->hio, &tcp->localaddr, buf1, HIO_COUNTOF(buf1), HIO_SKAD_TO_BCSTR_ADDR | HIO_SKAD_TO_BCSTR_PORT);
hio_skadtobcstr (tcp->hio, &tcp->remoteaddr, buf2, HIO_COUNTOF(buf2), HIO_SKAD_TO_BCSTR_ADDR | HIO_SKAD_TO_BCSTR_PORT);
if (tcp->state & MIO_DEV_SCK_CONNECTED)
if (tcp->state & HIO_DEV_SCK_CONNECTED)
{
MIO_INFO3 (tcp->mio, "DEVICE connected to a remote server... LOCAL %hs REMOTE %hs SCK: %d\n", buf1, buf2, tcp->hnd);
HIO_INFO3 (tcp->hio, "DEVICE connected to a remote server... LOCAL %hs REMOTE %hs SCK: %d\n", buf1, buf2, tcp->hnd);
}
else if (tcp->state & MIO_DEV_SCK_ACCEPTED)
else if (tcp->state & HIO_DEV_SCK_ACCEPTED)
{
MIO_INFO3 (tcp->mio, "DEVICE accepted client device... .LOCAL %hs REMOTE %hs SCK: %d\n", buf1, buf2, tcp->hnd);
HIO_INFO3 (tcp->hio, "DEVICE accepted client device... .LOCAL %hs REMOTE %hs SCK: %d\n", buf1, buf2, tcp->hnd);
}
if (mio_dev_sck_write(tcp, "hello", 5, MIO_NULL, MIO_NULL) <= -1)
if (hio_dev_sck_write(tcp, "hello", 5, HIO_NULL, HIO_NULL) <= -1)
{
mio_dev_sck_halt (tcp);
hio_dev_sck_halt (tcp);
}
}
static int tcp_sck_on_write (mio_dev_sck_t* tcp, mio_iolen_t wrlen, void* wrctx, const mio_skad_t* dstaddr)
static int tcp_sck_on_write (hio_dev_sck_t* tcp, hio_iolen_t wrlen, void* wrctx, const hio_skad_t* dstaddr)
{
tcp_xtn_t* ts;
mio_ntime_t tmout;
hio_ntime_t tmout;
if (wrlen <= -1)
{
MIO_INFO1 (tcp->mio, "TCP_SCK_ON_WRITE(%d) >>> SEDING TIMED OUT...........\n", (int)tcp->hnd);
mio_dev_sck_halt (tcp);
HIO_INFO1 (tcp->hio, "TCP_SCK_ON_WRITE(%d) >>> SEDING TIMED OUT...........\n", (int)tcp->hnd);
hio_dev_sck_halt (tcp);
}
else
{
ts = (tcp_xtn_t*)(tcp + 1);
if (wrlen == 0)
{
MIO_INFO1 (tcp->mio, "TCP_SCK_ON_WRITE(%d) >>> CLOSED WRITING END\n", (int)tcp->hnd);
HIO_INFO1 (tcp->hio, "TCP_SCK_ON_WRITE(%d) >>> CLOSED WRITING END\n", (int)tcp->hnd);
}
else
{
MIO_INFO3 (tcp->mio, "TCP_SCK_ON_WRITE(%d) >>> SENT MESSAGE %d of length %ld\n", (int)tcp->hnd, ts->tally, (long int)wrlen);
HIO_INFO3 (tcp->hio, "TCP_SCK_ON_WRITE(%d) >>> SENT MESSAGE %d of length %ld\n", (int)tcp->hnd, ts->tally, (long int)wrlen);
}
ts->tally++;
// if (ts->tally >= 2) mio_dev_sck_halt (tcp);
// if (ts->tally >= 2) hio_dev_sck_halt (tcp);
MIO_INIT_NTIME (&tmout, 5, 0);
//mio_dev_sck_read (tcp, 1);
HIO_INIT_NTIME (&tmout, 5, 0);
//hio_dev_sck_read (tcp, 1);
MIO_INFO3 (tcp->mio, "TCP_SCK_ON_WRITE(%d) >>> REQUESTING to READ with timeout of %ld.%08ld\n", (int)tcp->hnd, (long int)tmout.sec, (long int)tmout.nsec);
mio_dev_sck_timedread (tcp, 1, &tmout);
HIO_INFO3 (tcp->hio, "TCP_SCK_ON_WRITE(%d) >>> REQUESTING to READ with timeout of %ld.%08ld\n", (int)tcp->hnd, (long int)tmout.sec, (long int)tmout.nsec);
hio_dev_sck_timedread (tcp, 1, &tmout);
}
return 0;
}
static int tcp_sck_on_read (mio_dev_sck_t* tcp, const void* buf, mio_iolen_t len, const mio_skad_t* srcaddr)
static int tcp_sck_on_read (hio_dev_sck_t* tcp, const void* buf, hio_iolen_t len, const hio_skad_t* srcaddr)
{
int n;
if (len <= -1)
{
MIO_INFO1 (tcp->mio, "TCP_SCK_ON_READ(%d) STREAM DEVICE: TIMED OUT...\n", (int)tcp->hnd);
mio_dev_sck_halt (tcp);
HIO_INFO1 (tcp->hio, "TCP_SCK_ON_READ(%d) STREAM DEVICE: TIMED OUT...\n", (int)tcp->hnd);
hio_dev_sck_halt (tcp);
return 0;
}
else if (len <= 0)
{
MIO_INFO1 (tcp->mio, "TCP_SCK_ON_READ(%d) STREAM DEVICE: EOF RECEIVED...\n", (int)tcp->hnd);
HIO_INFO1 (tcp->hio, "TCP_SCK_ON_READ(%d) STREAM DEVICE: EOF RECEIVED...\n", (int)tcp->hnd);
/* no outstanding request. but EOF */
mio_dev_sck_halt (tcp);
hio_dev_sck_halt (tcp);
return 0;
}
MIO_INFO2 (tcp->mio, "TCP_SCK_ON_READ(%d) - received %d bytes\n", (int)tcp->hnd, (int)len);
HIO_INFO2 (tcp->hio, "TCP_SCK_ON_READ(%d) - received %d bytes\n", (int)tcp->hnd, (int)len);
{
mio_ntime_t tmout;
hio_ntime_t tmout;
static char a ='A';
static char xxx[1000000];
memset (xxx, a++ , MIO_SIZEOF(xxx));
memset (xxx, a++ , HIO_SIZEOF(xxx));
MIO_INFO2 (tcp->mio, "TCP_SCK_ON_READ(%d) >>> REQUESTING to write data of %d bytes\n", (int)tcp->hnd, MIO_SIZEOF(xxx));
//return mio_dev_sck_write (tcp, "HELLO", 5, MIO_NULL);
MIO_INIT_NTIME (&tmout, 5, 0);
n = mio_dev_sck_timedwrite(tcp, xxx, MIO_SIZEOF(xxx), &tmout, MIO_NULL, MIO_NULL);
HIO_INFO2 (tcp->hio, "TCP_SCK_ON_READ(%d) >>> REQUESTING to write data of %d bytes\n", (int)tcp->hnd, HIO_SIZEOF(xxx));
//return hio_dev_sck_write (tcp, "HELLO", 5, HIO_NULL);
HIO_INIT_NTIME (&tmout, 5, 0);
n = hio_dev_sck_timedwrite(tcp, xxx, HIO_SIZEOF(xxx), &tmout, HIO_NULL, HIO_NULL);
if (n <= -1) return -1;
}
MIO_INFO1 (tcp->mio, "TCP_SCK_ON_READ(%d) - REQUESTING TO STOP READ\n", (int)tcp->hnd);
mio_dev_sck_read (tcp, 0);
HIO_INFO1 (tcp->hio, "TCP_SCK_ON_READ(%d) - REQUESTING TO STOP READ\n", (int)tcp->hnd);
hio_dev_sck_read (tcp, 0);
#if 0
MIO_INFO1 (tcp->mio, "TCP_SCK_ON_READ(%d) - REQUESTING TO CLOSE WRITING END\n", (int)tcp->hnd);
HIO_INFO1 (tcp->hio, "TCP_SCK_ON_READ(%d) - REQUESTING TO CLOSE WRITING END\n", (int)tcp->hnd);
/* post the write finisher - close the writing end */
n = mio_dev_sck_write(tcp, MIO_NULL, 0, MIO_NULL, MIO_NULL);
n = hio_dev_sck_write(tcp, HIO_NULL, 0, HIO_NULL, HIO_NULL);
if (n <= -1) return -1;
#endif
@ -204,10 +204,10 @@ static int tcp_sck_on_read (mio_dev_sck_t* tcp, const void* buf, mio_iolen_t len
int main (int argc, char* argv[])
{
mio_t* mio = MIO_NULL;
mio_dev_sck_t* tcpsvr;
mio_dev_sck_make_t tcp_make;
mio_dev_sck_connect_t tcp_conn;
hio_t* hio = HIO_NULL;
hio_dev_sck_t* tcpsvr;
hio_dev_sck_make_t tcp_make;
hio_dev_sck_connect_t tcp_conn;
tcp_xtn_t* ts;
if (argc != 2)
@ -215,25 +215,25 @@ int main (int argc, char* argv[])
fprintf (stderr, "Usage: %s ipaddr:port\n", argv[0]);
return -1;
}
mio = mio_open(&mmgr, 0, MIO_NULL, MIO_FEATURE_ALL, 512, MIO_NULL);
if (!mio)
hio = hio_open(&mmgr, 0, HIO_NULL, HIO_FEATURE_ALL, 512, HIO_NULL);
if (!hio)
{
printf ("Cannot open mio\n");
printf ("Cannot open hio\n");
goto oops;
}
memset (&tcp_conn, 0, MIO_SIZEOF(tcp_conn));
mio_bcstrtoskad(mio, argv[1], &tcp_conn.remoteaddr);
MIO_INIT_NTIME (&tcp_conn.connect_tmout, 5, 0);
memset (&tcp_conn, 0, HIO_SIZEOF(tcp_conn));
hio_bcstrtoskad(hio, argv[1], &tcp_conn.remoteaddr);
HIO_INIT_NTIME (&tcp_conn.connect_tmout, 5, 0);
tcp_conn.options = 0;
memset (&tcp_make, 0, MIO_SIZEOF(tcp_make));
tcp_make.type = mio_skad_family(&tcp_conn.remoteaddr) == MIO_AF_INET? MIO_DEV_SCK_TCP4: MIO_DEV_SCK_TCP6;
memset (&tcp_make, 0, HIO_SIZEOF(tcp_make));
tcp_make.type = hio_skad_family(&tcp_conn.remoteaddr) == HIO_AF_INET? HIO_DEV_SCK_TCP4: HIO_DEV_SCK_TCP6;
tcp_make.on_write = tcp_sck_on_write;
tcp_make.on_read = tcp_sck_on_read;
tcp_make.on_connect = tcp_sck_on_connect;
tcp_make.on_disconnect = tcp_sck_on_disconnect;
tcpsvr = mio_dev_sck_make(mio, MIO_SIZEOF(tcp_xtn_t), &tcp_make);
tcpsvr = hio_dev_sck_make(hio, HIO_SIZEOF(tcp_xtn_t), &tcp_make);
if (!tcpsvr)
{
printf ("Cannot make a tcp server\n");
@ -244,14 +244,14 @@ int main (int argc, char* argv[])
ts->tally = 0;
if (mio_dev_sck_connect(tcpsvr, &tcp_conn) <= -1)
if (hio_dev_sck_connect(tcpsvr, &tcp_conn) <= -1)
{
}
mio_loop (mio);
hio_loop (hio);
oops:
if (mio) mio_close (mio);
if (hio) hio_close (hio);
return 0;
return 0;

View File

@ -1,148 +1,148 @@
#include <mio.h>
#include <mio-json.h>
#include <hio.h>
#include <hio-json.h>
#include <stdio.h>
#include <string.h>
#define DEBUG
static int on_json_inst (mio_json_t* json, mio_json_inst_t inst, mio_oow_t level, mio_oow_t index, mio_json_state_t container_state, const mio_oocs_t* str, void* ctx)
static int on_json_inst (hio_json_t* json, hio_json_inst_t inst, hio_oow_t level, hio_oow_t index, hio_json_state_t container_state, const hio_oocs_t* str, void* ctx)
{
mio_t* mio = mio_json_getmio(json);
mio_oow_t i;
hio_t* hio = hio_json_gethio(json);
hio_oow_t i;
switch (inst)
{
case MIO_JSON_INST_START_ARRAY:
case HIO_JSON_INST_START_ARRAY:
if (level > 0)
{
if (index > 0) mio_logbfmt (mio, MIO_LOG_STDOUT, ",\n");
for (i = 0; i < level; i++) mio_logbfmt (mio, MIO_LOG_STDOUT, "\t");
if (index > 0) hio_logbfmt (hio, HIO_LOG_STDOUT, ",\n");
for (i = 0; i < level; i++) hio_logbfmt (hio, HIO_LOG_STDOUT, "\t");
}
#if defined(DEBUG)
mio_logbfmt (mio, MIO_LOG_STDOUT, "<%lu>[\n", (unsigned long)index);
hio_logbfmt (hio, HIO_LOG_STDOUT, "<%lu>[\n", (unsigned long)index);
#else
mio_logbfmt (mio, MIO_LOG_STDOUT, "[\n");
hio_logbfmt (hio, HIO_LOG_STDOUT, "[\n");
#endif
break;
case MIO_JSON_INST_END_ARRAY:
mio_logbfmt (mio, MIO_LOG_STDOUT, "\n");
for (i = 0; i < level; i++) mio_logbfmt (mio, MIO_LOG_STDOUT, "\t");
case HIO_JSON_INST_END_ARRAY:
hio_logbfmt (hio, HIO_LOG_STDOUT, "\n");
for (i = 0; i < level; i++) hio_logbfmt (hio, HIO_LOG_STDOUT, "\t");
#if defined(DEBUG)
mio_logbfmt (mio, MIO_LOG_STDOUT, "<%lu>]", (unsigned long)index);
hio_logbfmt (hio, HIO_LOG_STDOUT, "<%lu>]", (unsigned long)index);
#else
mio_logbfmt (mio, MIO_LOG_STDOUT, "]");
hio_logbfmt (hio, HIO_LOG_STDOUT, "]");
#endif
break;
case MIO_JSON_INST_START_OBJECT:
case HIO_JSON_INST_START_OBJECT:
if (level > 0)
{
if (index > 0) mio_logbfmt (mio, MIO_LOG_STDOUT, ",\n");
for (i = 0; i < level; i++) mio_logbfmt (mio, MIO_LOG_STDOUT, "\t");
if (index > 0) hio_logbfmt (hio, HIO_LOG_STDOUT, ",\n");
for (i = 0; i < level; i++) hio_logbfmt (hio, HIO_LOG_STDOUT, "\t");
}
#if defined(DEBUG)
mio_logbfmt (mio, MIO_LOG_STDOUT, "<%lu>{\n", (unsigned long)index);
hio_logbfmt (hio, HIO_LOG_STDOUT, "<%lu>{\n", (unsigned long)index);
#else
mio_logbfmt (mio, MIO_LOG_STDOUT, "{\n");
hio_logbfmt (hio, HIO_LOG_STDOUT, "{\n");
#endif
break;
case MIO_JSON_INST_END_OBJECT:
mio_logbfmt (mio, MIO_LOG_STDOUT, "\n");
for (i = 0; i < level; i++) mio_logbfmt (mio, MIO_LOG_STDOUT, "\t");
case HIO_JSON_INST_END_OBJECT:
hio_logbfmt (hio, HIO_LOG_STDOUT, "\n");
for (i = 0; i < level; i++) hio_logbfmt (hio, HIO_LOG_STDOUT, "\t");
#if defined(DEBUG)
mio_logbfmt (mio, MIO_LOG_STDOUT, "<%lu>}", (unsigned long)index);
hio_logbfmt (hio, HIO_LOG_STDOUT, "<%lu>}", (unsigned long)index);
#else
mio_logbfmt (mio, MIO_LOG_STDOUT, "}");
hio_logbfmt (hio, HIO_LOG_STDOUT, "}");
#endif
break;
case MIO_JSON_INST_KEY:
if (index > 0) mio_logbfmt (mio, MIO_LOG_STDOUT, ",\n");
for (i = 0; i < level; i++) mio_logbfmt (mio, MIO_LOG_STDOUT, "\t");
case HIO_JSON_INST_KEY:
if (index > 0) hio_logbfmt (hio, HIO_LOG_STDOUT, ",\n");
for (i = 0; i < level; i++) hio_logbfmt (hio, HIO_LOG_STDOUT, "\t");
#if defined(DEBUG)
mio_logbfmt (mio, MIO_LOG_STDOUT, "<%lu>%.*js: ", (unsigned long)index, str->len, str->ptr);
hio_logbfmt (hio, HIO_LOG_STDOUT, "<%lu>%.*js: ", (unsigned long)index, str->len, str->ptr);
#else
mio_logbfmt (mio, MIO_LOG_STDOUT, "%.*js: ", str->len, str->ptr);
hio_logbfmt (hio, HIO_LOG_STDOUT, "%.*js: ", str->len, str->ptr);
#endif
break;
case MIO_JSON_INST_NIL:
case HIO_JSON_INST_NIL:
if (level > 0)
{
if (index > 0) mio_logbfmt (mio, MIO_LOG_STDOUT, ",\n");
for (i = 0; i < level; i++) mio_logbfmt (mio, MIO_LOG_STDOUT, "\t");
if (index > 0) hio_logbfmt (hio, HIO_LOG_STDOUT, ",\n");
for (i = 0; i < level; i++) hio_logbfmt (hio, HIO_LOG_STDOUT, "\t");
}
#if defined(DEBUG)
mio_logbfmt (mio, MIO_LOG_STDOUT, "<%lu>null", (unsigned long)index);
hio_logbfmt (hio, HIO_LOG_STDOUT, "<%lu>null", (unsigned long)index);
#else
mio_logbfmt (mio, MIO_LOG_STDOUT, "null");
hio_logbfmt (hio, HIO_LOG_STDOUT, "null");
#endif
break;
case MIO_JSON_INST_TRUE:
case HIO_JSON_INST_TRUE:
if (level > 0)
{
if (index > 0) mio_logbfmt (mio, MIO_LOG_STDOUT, ",\n");
for (i = 0; i < level; i++) mio_logbfmt (mio, MIO_LOG_STDOUT, "\t");
if (index > 0) hio_logbfmt (hio, HIO_LOG_STDOUT, ",\n");
for (i = 0; i < level; i++) hio_logbfmt (hio, HIO_LOG_STDOUT, "\t");
}
#if defined(DEBUG)
mio_logbfmt (mio, MIO_LOG_STDOUT, "<%lu>true", (unsigned long)index);
hio_logbfmt (hio, HIO_LOG_STDOUT, "<%lu>true", (unsigned long)index);
#else
mio_logbfmt (mio, MIO_LOG_STDOUT, "true");
hio_logbfmt (hio, HIO_LOG_STDOUT, "true");
#endif
break;
case MIO_JSON_INST_FALSE:
case HIO_JSON_INST_FALSE:
if (level > 0)
{
if (index > 0) mio_logbfmt (mio, MIO_LOG_STDOUT, ",\n");
for (i = 0; i < level; i++) mio_logbfmt (mio, MIO_LOG_STDOUT, "\t");
if (index > 0) hio_logbfmt (hio, HIO_LOG_STDOUT, ",\n");
for (i = 0; i < level; i++) hio_logbfmt (hio, HIO_LOG_STDOUT, "\t");
}
#if defined(DEBUG)
mio_logbfmt (mio, MIO_LOG_STDOUT, "<%lu>false", (unsigned long)index);
hio_logbfmt (hio, HIO_LOG_STDOUT, "<%lu>false", (unsigned long)index);
#else
mio_logbfmt (mio, MIO_LOG_STDOUT, "false");
hio_logbfmt (hio, HIO_LOG_STDOUT, "false");
#endif
break;
case MIO_JSON_INST_NUMBER:
case HIO_JSON_INST_NUMBER:
if (level > 0)
{
if (index > 0) mio_logbfmt (mio, MIO_LOG_STDOUT, ",\n");
for (i = 0; i < level; i++) mio_logbfmt (mio, MIO_LOG_STDOUT, "\t");
if (index > 0) hio_logbfmt (hio, HIO_LOG_STDOUT, ",\n");
for (i = 0; i < level; i++) hio_logbfmt (hio, HIO_LOG_STDOUT, "\t");
}
#if defined(DEBUG)
mio_logbfmt (mio, MIO_LOG_STDOUT, "<%lu>%.*js", (unsigned long)index, str->len, str->ptr);
hio_logbfmt (hio, HIO_LOG_STDOUT, "<%lu>%.*js", (unsigned long)index, str->len, str->ptr);
#else
mio_logbfmt (mio, MIO_LOG_STDOUT, "%.*js", str->len, str->ptr);
hio_logbfmt (hio, HIO_LOG_STDOUT, "%.*js", str->len, str->ptr);
#endif
break;
case MIO_JSON_INST_STRING:
case HIO_JSON_INST_STRING:
if (level > 0)
{
if (index > 0) mio_logbfmt (mio, MIO_LOG_STDOUT, ",\n");
for (i = 0; i < level; i++) mio_logbfmt (mio, MIO_LOG_STDOUT, "\t");
if (index > 0) hio_logbfmt (hio, HIO_LOG_STDOUT, ",\n");
for (i = 0; i < level; i++) hio_logbfmt (hio, HIO_LOG_STDOUT, "\t");
}
#if defined(DEBUG)
mio_logbfmt (mio, MIO_LOG_STDOUT, "<%lu>\"%.*js\"", (unsigned long)index, str->len, str->ptr); /* TODO: escaping */
hio_logbfmt (hio, HIO_LOG_STDOUT, "<%lu>\"%.*js\"", (unsigned long)index, str->len, str->ptr); /* TODO: escaping */
#else
mio_logbfmt (mio, MIO_LOG_STDOUT, "\"%.*js\"", str->len, str->ptr); /* TODO: escaping */
hio_logbfmt (hio, HIO_LOG_STDOUT, "\"%.*js\"", str->len, str->ptr); /* TODO: escaping */
#endif
break;
default:
mio_logbfmt (mio, MIO_LOG_STDOUT, "*****UNKNOWN*****\n", str->len, str->ptr);
hio_logbfmt (hio, HIO_LOG_STDOUT, "*****UNKNOWN*****\n", str->len, str->ptr);
return -1;
}
return 0;
}
static int write_json_element (mio_jsonwr_t* jsonwr, const mio_bch_t* dptr, mio_oow_t dlen, void* ctx)
static int write_json_element (hio_jsonwr_t* jsonwr, const hio_bch_t* dptr, hio_oow_t dlen, void* ctx)
{
fwrite (dptr, 1, dlen, stdout);
return 0;
@ -150,34 +150,34 @@ static int write_json_element (mio_jsonwr_t* jsonwr, const mio_bch_t* dptr, mio_
int main (int argc, char* argv[])
{
mio_t* mio = MIO_NULL;
mio_bitmask_t o = 0;
hio_t* hio = HIO_NULL;
hio_bitmask_t o = 0;
int i;
for (i = 1; i < argc; i++)
{
if (strcmp(argv[i], "--permit-word-key") == 0) o |= MIO_JSON_PERMIT_WORD_KEY;
if (strcmp(argv[i], "--optional-comma") == 0) o |= MIO_JSON_OPTIONAL_COMMA;
if (strcmp(argv[i], "--line-comment") == 0) o |= MIO_JSON_LINE_COMMENT;
if (strcmp(argv[i], "--permit-word-key") == 0) o |= HIO_JSON_PERMIT_WORD_KEY;
if (strcmp(argv[i], "--optional-comma") == 0) o |= HIO_JSON_OPTIONAL_COMMA;
if (strcmp(argv[i], "--line-comment") == 0) o |= HIO_JSON_LINE_COMMENT;
}
mio = mio_open(MIO_NULL, 0, MIO_NULL, MIO_FEATURE_ALL, 512, MIO_NULL);
if (!mio)
hio = hio_open(HIO_NULL, 0, HIO_NULL, HIO_FEATURE_ALL, 512, HIO_NULL);
if (!hio)
{
printf ("Cannot open mio\n");
printf ("Cannot open hio\n");
return -1;
}
{
mio_json_t* json = MIO_NULL;
hio_json_t* json = HIO_NULL;
char buf[128];
mio_oow_t rem;
hio_oow_t rem;
size_t size;
json = mio_json_open(mio, 0);
json = hio_json_open(hio, 0);
mio_json_setoption (json, o);
mio_json_setinstcb (json, on_json_inst, MIO_NULL);
hio_json_setoption (json, o);
hio_json_setinstcb (json, on_json_inst, HIO_NULL);
rem = 0;
while (!feof(stdin) || rem > 0)
@ -195,9 +195,9 @@ int main (int argc, char* argv[])
rem = 0;
}
if ((x = mio_json_feed(json, buf, size + rem, &rem, 1)) <= -1)
if ((x = hio_json_feed(json, buf, size + rem, &rem, 1)) <= -1)
{
mio_logbfmt (mio, MIO_LOG_STDOUT, "**** ERROR - %js ****\n", mio_geterrmsg(mio));
hio_logbfmt (hio, HIO_LOG_STDOUT, "**** ERROR - %js ****\n", hio_geterrmsg(hio));
goto done;
}
@ -205,59 +205,59 @@ int main (int argc, char* argv[])
{
/* document completed.
* if only whitespaces are given, x is still greater 0. */
mio_logbfmt (mio, MIO_LOG_STDOUT, "\n-----------------------------------\n");
hio_logbfmt (hio, HIO_LOG_STDOUT, "\n-----------------------------------\n");
}
/*printf ("--> x %d input %d left-over %d => [%.*s]\n", (int)x, (int)size, (int)rem, (int)rem, &buf[size - rem]);*/
if (rem > 0) memcpy (buf, &buf[size - rem], rem);
}
mio_logbfmt (mio, MIO_LOG_STDOUT, "\n");
if (json->state_stack != &json->state_top) mio_logbfmt (mio, MIO_LOG_STDOUT, "**** ERROR - incomplete ****\n");
hio_logbfmt (hio, HIO_LOG_STDOUT, "\n");
if (json->state_stack != &json->state_top) hio_logbfmt (hio, HIO_LOG_STDOUT, "**** ERROR - incomplete ****\n");
done:
mio_json_close (json);
hio_json_close (json);
}
mio_logbfmt (mio, MIO_LOG_STDOUT, "\n===================================\n");
hio_logbfmt (hio, HIO_LOG_STDOUT, "\n===================================\n");
{
mio_jsonwr_t* jsonwr = MIO_NULL;
mio_uch_t ddd[4] = { 'D', '\0', 'R', 'Q' };
mio_uch_t ddv[5] = { L'', L'', L'', L'', L'' };
hio_jsonwr_t* jsonwr = HIO_NULL;
hio_uch_t ddd[4] = { 'D', '\0', 'R', 'Q' };
hio_uch_t ddv[5] = { L'', L'', L'', L'', L'' };
jsonwr = mio_jsonwr_open (mio, 0, MIO_JSONWR_FLAG_PRETTY);
jsonwr = hio_jsonwr_open (hio, 0, HIO_JSONWR_FLAG_PRETTY);
mio_jsonwr_setwritecb (jsonwr, write_json_element, MIO_NULL);
hio_jsonwr_setwritecb (jsonwr, write_json_element, HIO_NULL);
mio_jsonwr_startarray (jsonwr);
hio_jsonwr_startarray (jsonwr);
mio_jsonwr_writestringwithbchars (jsonwr, "hello", 5);
mio_jsonwr_writestringwithbchars (jsonwr, "world", 5);
hio_jsonwr_writestringwithbchars (jsonwr, "hello", 5);
hio_jsonwr_writestringwithbchars (jsonwr, "world", 5);
mio_jsonwr_startobject (jsonwr);
mio_jsonwr_writekeywithbchars (jsonwr, "abc", 3);
mio_jsonwr_writestringwithbchars (jsonwr, "computer", 8);
mio_jsonwr_writekeywithbchars (jsonwr, "k", 1);
mio_jsonwr_writestringwithbchars (jsonwr, "play nice", 9);
mio_jsonwr_writekeywithuchars (jsonwr, ddd, 4);
mio_jsonwr_writestringwithuchars (jsonwr, ddv, 5);
mio_jsonwr_endobject (jsonwr);
hio_jsonwr_startobject (jsonwr);
hio_jsonwr_writekeywithbchars (jsonwr, "abc", 3);
hio_jsonwr_writestringwithbchars (jsonwr, "computer", 8);
hio_jsonwr_writekeywithbchars (jsonwr, "k", 1);
hio_jsonwr_writestringwithbchars (jsonwr, "play nice", 9);
hio_jsonwr_writekeywithuchars (jsonwr, ddd, 4);
hio_jsonwr_writestringwithuchars (jsonwr, ddv, 5);
hio_jsonwr_endobject (jsonwr);
mio_jsonwr_writestringwithbchars (jsonwr, "tyler", 5);
hio_jsonwr_writestringwithbchars (jsonwr, "tyler", 5);
mio_jsonwr_startarray (jsonwr);
mio_jsonwr_writestringwithbchars (jsonwr, "airplain", 8);
mio_jsonwr_writestringwithbchars (jsonwr, "gro\0wn\nup", 9);
mio_jsonwr_writetrue (jsonwr);
mio_jsonwr_endarray (jsonwr);
hio_jsonwr_startarray (jsonwr);
hio_jsonwr_writestringwithbchars (jsonwr, "airplain", 8);
hio_jsonwr_writestringwithbchars (jsonwr, "gro\0wn\nup", 9);
hio_jsonwr_writetrue (jsonwr);
hio_jsonwr_endarray (jsonwr);
mio_jsonwr_endarray (jsonwr);
hio_jsonwr_endarray (jsonwr);
mio_jsonwr_close (jsonwr);
hio_jsonwr_close (jsonwr);
}
mio_close (mio);
hio_close (hio);
return 0;

View File

@ -1,7 +1,7 @@
#if defined(MIO_ENABLE_MARIADB)
#if defined(HIO_ENABLE_MARIADB)
#include <mio.h>
#include <mio-mar.h>
#include <hio.h>
#include <hio-mar.h>
#include <stdio.h>
#include <string.h>
#include <signal.h>
@ -9,20 +9,20 @@
#include <mariadb/mysql.h>
#if 0
static void mar_on_disconnect (mio_dev_mar_t* dev)
static void mar_on_disconnect (hio_dev_mar_t* dev)
{
}
static void mar_on_connect (mio_dev_mar_t* dev)
static void mar_on_connect (hio_dev_mar_t* dev)
{
printf ("CONNECTED...\n");
if (mio_dev_mar_querywithbchars(dev, "SHOW STATUS", 11) <= -1)
if (hio_dev_mar_querywithbchars(dev, "SHOW STATUS", 11) <= -1)
{
mio_dev_mar_halt (dev);
hio_dev_mar_halt (dev);
}
}
static void mar_on_query_started (mio_dev_mar_t* dev, int mar_ret, const mio_bch_t* mar_errmsg)
static void mar_on_query_started (hio_dev_mar_t* dev, int mar_ret, const hio_bch_t* mar_errmsg)
{
if (mar_ret != 0)
{
@ -31,22 +31,22 @@ printf ("QUERY NOT SENT PROPERLY..%s\n", mysql_error(dev->hnd));
else
{
printf ("QUERY SENT..\n");
if (mio_dev_mar_fetchrows(dev) <= -1)
if (hio_dev_mar_fetchrows(dev) <= -1)
{
printf ("FETCH ROW FAILURE - %s\n", errmsg);
mio_dev_mar_halt (dev);
hio_dev_mar_halt (dev);
}
}
}
static void mar_on_row_fetched (mio_dev_mar_t* dev, void* data)
static void mar_on_row_fetched (hio_dev_mar_t* dev, void* data)
{
MYSQL_ROW row = (MYSQL_ROW)data;
static int x = 0;
if (!row)
{
printf ("NO MORE ROW..\n");
if (x == 0 && mio_dev_mar_querywithbchars(dev, "SELECT * FROM pdns.records", 26) <= -1) mio_dev_mar_halt (dev);
if (x == 0 && hio_dev_mar_querywithbchars(dev, "SELECT * FROM pdns.records", 26) <= -1) hio_dev_mar_halt (dev);
x++;
}
else
@ -62,10 +62,10 @@ static void mar_on_row_fetched (mio_dev_mar_t* dev, void* data)
int main (int argc, char* argv[])
{
mio_t* mio = MIO_NULL;
mio_dev_mar_t* mar;
mio_dev_mar_make_t mi;
mio_dev_mar_connect_t ci;
hio_t* hio = HIO_NULL;
hio_dev_mar_t* mar;
hio_dev_mar_make_t mi;
hio_dev_mar_connect_t ci;
if (argc != 6)
{
@ -73,21 +73,21 @@ int main (int argc, char* argv[])
return -1;
}
mio = mio_open(MIO_NULL, 0, MIO_NULL, MIO_FEATURE_ALL, 512, MIO_NULL);
if (!mio)
hio = hio_open(HIO_NULL, 0, HIO_NULL, HIO_FEATURE_ALL, 512, HIO_NULL);
if (!hio)
{
printf ("Cannot open mio\n");
printf ("Cannot open hio\n");
goto oops;
}
memset (&ci, 0, MIO_SIZEOF(ci));
memset (&ci, 0, HIO_SIZEOF(ci));
ci.host = argv[1];
ci.port = 3306; /* TODO: argv[2]; */
ci.username = argv[3];
ci.password = argv[4];
ci.dbname = argv[5];
memset (&mi, 0, MIO_SIZEOF(mi));
memset (&mi, 0, HIO_SIZEOF(mi));
/*mi.on_write = mar_on_write;
mi.on_read = mar_on_read;*/
mi.on_connect = mar_on_connect;
@ -95,33 +95,33 @@ int main (int argc, char* argv[])
mi.on_query_started = mar_on_query_started;
mi.on_row_fetched = mar_on_row_fetched;
mar = mio_dev_mar_make(mio, 0, &mi);
mar = hio_dev_mar_make(hio, 0, &mi);
if (!mar)
{
printf ("Cannot make a mar db client device\n");
goto oops;
}
if (mio_dev_mar_connect(mar, &ci) <= -1)
if (hio_dev_mar_connect(mar, &ci) <= -1)
{
printf ("Cannot connect to mar db server\n");
goto oops;
}
mio_loop (mio);
hio_loop (hio);
oops:
if (mio) mio_close (mio);
if (hio) hio_close (hio);
return 0;
}
#endif
static void on_result (mio_svc_marc_t* svc, mio_oow_t sid, mio_svc_marc_rcode_t rcode, void* data, void* qctx)
static void on_result (hio_svc_marc_t* svc, hio_oow_t sid, hio_svc_marc_rcode_t rcode, void* data, void* qctx)
{
static int x = 0;
switch (rcode)
{
case MIO_SVC_MARC_RCODE_ROW:
case HIO_SVC_MARC_RCODE_ROW:
{
MYSQL_ROW row = (MYSQL_ROW)data;
// if (x == 0)
@ -141,70 +141,70 @@ system ("/sbin/iptables -I INPUT -p tcp --sport 3306 -j REJECT");
break;
}
case MIO_SVC_MARC_RCODE_DONE:
case HIO_SVC_MARC_RCODE_DONE:
printf ("[%lu] NO DATA..\n", sid);
break;
case MIO_SVC_MARC_RCODE_ERROR:
case HIO_SVC_MARC_RCODE_ERROR:
{
mio_svc_marc_dev_error_t* err = (mio_svc_marc_dev_error_t*)data;
hio_svc_marc_dev_error_t* err = (hio_svc_marc_dev_error_t*)data;
printf ("QUERY ERROR - [%d] %s\n", err->mar_errcode, err->mar_errmsg);
break;
}
}
}
static mio_t* g_mio = MIO_NULL;
static hio_t* g_hio = HIO_NULL;
static void handle_signal (int sig)
{
mio_stop (g_mio, MIO_STOPREQ_TERMINATION);
hio_stop (g_hio, HIO_STOPREQ_TERMINATION);
}
static void send_test_query (mio_t* mio, const mio_ntime_t* now, mio_tmrjob_t* job)
static void send_test_query (hio_t* hio, const hio_ntime_t* now, hio_tmrjob_t* job)
{
mio_svc_marc_t* marc = (mio_svc_marc_t*)job->ctx;
mio_bch_t buf[256];
mio_bch_t tmp[256];
hio_svc_marc_t* marc = (hio_svc_marc_t*)job->ctx;
hio_bch_t buf[256];
hio_bch_t tmp[256];
int len;
if (mio_svc_marc_querywithbchars(marc, 0, MIO_SVC_MARC_QTYPE_SELECT, "SHOW STATUS", 11, on_result, MIO_NULL) <= -1)
if (hio_svc_marc_querywithbchars(marc, 0, HIO_SVC_MARC_QTYPE_SELECT, "SHOW STATUS", 11, on_result, HIO_NULL) <= -1)
{
MIO_INFO1 (mio, "FAILED TO SEND QUERY - %js\n", mio_geterrmsg(mio));
HIO_INFO1 (hio, "FAILED TO SEND QUERY - %js\n", hio_geterrmsg(hio));
}
mio_svc_marc_escapebchars (marc, "wild", 4, tmp);
len = snprintf(buf, MIO_COUNTOF(buf), "SELECT name, content FROM records WHERE name like '%%%s%%'", tmp);
if (mio_svc_marc_querywithbchars(marc, 1, MIO_SVC_MARC_QTYPE_SELECT, buf, len, on_result, MIO_NULL) <= -1)
hio_svc_marc_escapebchars (marc, "wild", 4, tmp);
len = snprintf(buf, HIO_COUNTOF(buf), "SELECT name, content FROM records WHERE name like '%%%s%%'", tmp);
if (hio_svc_marc_querywithbchars(marc, 1, HIO_SVC_MARC_QTYPE_SELECT, buf, len, on_result, HIO_NULL) <= -1)
{
MIO_INFO1 (mio, "FAILED TO SEND QUERY - %js\n", mio_geterrmsg(mio));
HIO_INFO1 (hio, "FAILED TO SEND QUERY - %js\n", hio_geterrmsg(hio));
}
}
static int schedule_timer_job_after (mio_t* mio, const mio_ntime_t* fire_after, mio_tmrjob_handler_t handler, void* ctx)
static int schedule_timer_job_after (hio_t* hio, const hio_ntime_t* fire_after, hio_tmrjob_handler_t handler, void* ctx)
{
mio_tmrjob_t tmrjob;
hio_tmrjob_t tmrjob;
memset (&tmrjob, 0, MIO_SIZEOF(tmrjob));
memset (&tmrjob, 0, HIO_SIZEOF(tmrjob));
tmrjob.ctx = ctx;
mio_gettime (mio, &tmrjob.when);
MIO_ADD_NTIME (&tmrjob.when, &tmrjob.when, fire_after);
hio_gettime (hio, &tmrjob.when);
HIO_ADD_NTIME (&tmrjob.when, &tmrjob.when, fire_after);
tmrjob.handler = handler;
tmrjob.idxptr = MIO_NULL;
tmrjob.idxptr = HIO_NULL;
return mio_instmrjob(mio, &tmrjob);
return hio_instmrjob(hio, &tmrjob);
}
int main (int argc, char* argv[])
{
mio_t* mio = MIO_NULL;
mio_svc_marc_t* marc;
mio_svc_marc_connect_t ci;
/* mio_svc_marc_tmout_t tmout;*/
hio_t* hio = HIO_NULL;
hio_svc_marc_t* marc;
hio_svc_marc_connect_t ci;
/* hio_svc_marc_tmout_t tmout;*/
if (argc != 6)
{
@ -212,14 +212,14 @@ int main (int argc, char* argv[])
return -1;
}
mio = mio_open(MIO_NULL, 0, MIO_NULL, 512, MIO_NULL);
if (!mio)
hio = hio_open(HIO_NULL, 0, HIO_NULL, 512, HIO_NULL);
if (!hio)
{
printf ("Cannot open mio\n");
printf ("Cannot open hio\n");
goto oops;
}
memset (&ci, 0, MIO_SIZEOF(ci));
memset (&ci, 0, HIO_SIZEOF(ci));
ci.host = argv[1];
ci.port = 3306; /* TODO: argv[2]; */
ci.username = argv[3];
@ -227,25 +227,25 @@ int main (int argc, char* argv[])
ci.dbname = argv[5];
/* timeout not implemented yet in the mardiab device and services
MIO_INIT_NTIME (&tmout.c, 2, 0);
MIO_INIT_NTIME (&tmout.r, -1, 0);
MIO_INIT_NTIME (&tmout.w, -1, 0);
HIO_INIT_NTIME (&tmout.c, 2, 0);
HIO_INIT_NTIME (&tmout.r, -1, 0);
HIO_INIT_NTIME (&tmout.w, -1, 0);
*/
marc = mio_svc_marc_start(mio, &ci, MIO_NULL);
marc = hio_svc_marc_start(hio, &ci, HIO_NULL);
if (!marc)
{
printf ("Cannot start a mariadb client service\n");
goto oops;
}
mio_svc_marc_querywithbchars (marc, 0, MIO_SVC_MARC_QTYPE_SELECT, "SHOW STATUS", 11, on_result, MIO_NULL);
mio_svc_marc_querywithbchars (marc, 0, MIO_SVC_MARC_QTYPE_ACTION, "DELETE FROM", 11, on_result, MIO_NULL);
// mio_svc_marc_querywithbchars (marc, 0, MIO_SVC_MARC_QTYPE_SELECT, "SHOW STATUS", 11, on_result, MIO_NULL);
mio_svc_marc_querywithbchars (marc, 0, MIO_SVC_MARC_QTYPE_ACTION, "DELETE FROM XXX", 14, on_result, MIO_NULL);
hio_svc_marc_querywithbchars (marc, 0, HIO_SVC_MARC_QTYPE_SELECT, "SHOW STATUS", 11, on_result, HIO_NULL);
hio_svc_marc_querywithbchars (marc, 0, HIO_SVC_MARC_QTYPE_ACTION, "DELETE FROM", 11, on_result, HIO_NULL);
// hio_svc_marc_querywithbchars (marc, 0, HIO_SVC_MARC_QTYPE_SELECT, "SHOW STATUS", 11, on_result, HIO_NULL);
hio_svc_marc_querywithbchars (marc, 0, HIO_SVC_MARC_QTYPE_ACTION, "DELETE FROM XXX", 14, on_result, HIO_NULL);
#if 0
memset (&mi, 0, MIO_SIZEOF(mi));
memset (&mi, 0, HIO_SIZEOF(mi));
/*mi.on_write = mar_on_write;
mi.on_read = mar_on_read;*/
mi.on_connect = mar_on_connect;
@ -253,38 +253,38 @@ int main (int argc, char* argv[])
mi.on_query_started = mar_on_query_started;
mi.on_row_fetched = mar_on_row_fetched;
mar = mio_dev_mar_make(mio, 0, &mi);
mar = hio_dev_mar_make(hio, 0, &mi);
if (!mar)
{
printf ("Cannot make a mar db client device\n");
goto oops;
}
if (mio_dev_mar_connect(mar, &ci) <= -1)
if (hio_dev_mar_connect(mar, &ci) <= -1)
{
printf ("Cannot connect to mar db server\n");
goto oops;
}
#endif
g_mio = mio;
g_hio = hio;
signal (SIGINT, handle_signal);
/* ---------------------------------------- */
{
mio_ntime_t x;
MIO_INIT_NTIME (&x, 32, 0);
schedule_timer_job_after (mio, &x, send_test_query, marc);
mio_loop (mio);
hio_ntime_t x;
HIO_INIT_NTIME (&x, 32, 0);
schedule_timer_job_after (hio, &x, send_test_query, marc);
hio_loop (hio);
}
/* ---------------------------------------- */
signal (SIGINT, SIG_IGN);
g_mio = MIO_NULL;
g_hio = HIO_NULL;
oops:
printf ("about to close mio...\n");
if (mio) mio_close (mio);
printf ("about to close hio...\n");
if (hio) hio_close (hio);
return 0;
}

View File

@ -1,4 +1,4 @@
#include <mio-utl.h>
#include <hio-utl.h>
#include <string.h>
#include <stdio.h>
@ -185,7 +185,7 @@ int siphash(const uint8_t *in, const size_t inlen, const uint8_t *k,
...
in = 00 01 02 ... 3e (63 bytes)
*/
mio_uint8_t vectors[64][8] =
hio_uint8_t vectors[64][8] =
{
{ 0x31, 0x0e, 0x0e, 0xdd, 0x47, 0xdb, 0x6f, 0x72, },
{ 0xfd, 0x67, 0xdc, 0x93, 0xc5, 0x39, 0xf8, 0x74, },
@ -258,7 +258,7 @@ int test_vectors()
{
#define MAXLEN 64
mio_uint8_t in[MAXLEN], out[8], k[16];
hio_uint8_t in[MAXLEN], out[8], k[16];
int i;
int ok = 1;
@ -267,7 +267,7 @@ int test_vectors()
for( i = 0; i < MAXLEN; ++i )
{
in[i] = i;
mio_sip_hash_24(k, in, i, out);
hio_sip_hash_24(k, in, i, out);
// siphash(in, i, k, out, 8);
if ( memcmp( out, vectors[i], 8 ) )

View File

@ -1,6 +1,6 @@
#include <mio-sck.h>
#include <mio-http.h>
#include <mio-utl.h>
#include <hio-sck.h>
#include <hio-http.h>
#include <hio-utl.h>
#include <stdio.h>
#include <string.h>
#include <pthread.h>
@ -13,24 +13,24 @@
#define MAX_NUM_THRS 256
static int g_reuse_port = 0;
static int g_num_thrs = 2;
static mio_svc_htts_t* g_htts[MAX_NUM_THRS];
static hio_svc_htts_t* g_htts[MAX_NUM_THRS];
static int g_htts_no = 0;
static pthread_mutex_t g_htts_mutex = PTHREAD_MUTEX_INITIALIZER;
static int print_qparam (mio_bcs_t* key, mio_bcs_t* val, void* ctx)
static int print_qparam (hio_bcs_t* key, hio_bcs_t* val, void* ctx)
{
key->len = mio_perdec_http_bcs(key, key->ptr, MIO_NULL);
val->len = mio_perdec_http_bcs(val, val->ptr, MIO_NULL);
key->len = hio_perdec_http_bcs(key, key->ptr, HIO_NULL);
val->len = hio_perdec_http_bcs(val, val->ptr, HIO_NULL);
fprintf ((FILE*)ctx, "\t[%.*s] = [%.*s]\n", (int)key->len, key->ptr, (int)val->len, val->ptr);
return 0;
}
static void on_htts_thr_request (mio_t* mio, mio_dev_thr_iopair_t* iop, mio_svc_htts_thr_func_info_t* tfi, void* ctx)
static void on_htts_thr_request (hio_t* hio, hio_dev_thr_iopair_t* iop, hio_svc_htts_thr_func_info_t* tfi, void* ctx)
{
FILE* fp;
int i;
if (tfi->req_method != MIO_HTTP_GET)
if (tfi->req_method != HIO_HTTP_GET)
{
write (iop->wfd, "Status: 405\r\n\r\n", 15); /* method not allowed */
return;
@ -50,21 +50,21 @@ static void on_htts_thr_request (mio_t* mio, mio_dev_thr_iopair_t* iop, mio_svc_
if (tfi->req_param)
{
fprintf (fp, "request params:\n");
mio_scan_http_qparam (tfi->req_param, print_qparam, fp);
hio_scan_http_qparam (tfi->req_param, print_qparam, fp);
}
for (i = 0; i < 100; i++) fprintf (fp, "%d * %d => %d\n", i, i, i * i);
/* invalid iop->wfd to mark that this function closed this file descriptor.
* no invalidation will lead to double closes on the same file descriptor. */
iop->wfd = MIO_SYSHND_INVALID;
iop->wfd = HIO_SYSHND_INVALID;
fclose (fp);
}
static void on_htts_thr2_request (mio_t* mio, mio_dev_thr_iopair_t* iop, mio_svc_htts_thr_func_info_t* tfi, void* ctx)
static void on_htts_thr2_request (hio_t* hio, hio_dev_thr_iopair_t* iop, hio_svc_htts_thr_func_info_t* tfi, void* ctx)
{
FILE* fp, * sf;
if (tfi->req_method != MIO_HTTP_GET)
if (tfi->req_method != HIO_HTTP_GET)
{
write (iop->wfd, "Status: 405\r\n\r\n", 15); /* method not allowed */
return;
@ -101,16 +101,16 @@ static void on_htts_thr2_request (mio_t* mio, mio_dev_thr_iopair_t* iop, mio_svc
/* invalid iop->wfd to mark that this function closed this file descriptor.
* no invalidation will lead to double closes on the same file descriptor. */
iop->wfd = MIO_SYSHND_INVALID;
iop->wfd = HIO_SYSHND_INVALID;
fclose (fp);
}
/* ========================================================================= */
int process_http_request (mio_svc_htts_t* htts, mio_dev_sck_t* csck, mio_htre_t* req)
int process_http_request (hio_svc_htts_t* htts, hio_dev_sck_t* csck, hio_htre_t* req)
{
mio_t* mio = mio_svc_htts_getmio(htts);
// mio_svc_htts_cli_t* cli = mio_dev_sck_getxtn(csck);
mio_http_method_t mth;
hio_t* hio = hio_svc_htts_gethio(htts);
// hio_svc_htts_cli_t* cli = hio_dev_sck_getxtn(csck);
hio_http_method_t mth;
/* percent-decode the query path to the original buffer
* since i'm not going to need it in the original form
@ -118,127 +118,127 @@ int process_http_request (mio_svc_htts_t* htts, mio_dev_sck_t* csck, mio_htre_t*
* the decoded query path is made available in the
* non-peek mode as well */
MIO_DEBUG2 (mio, "[RAW-REQ] %s %s\n", mio_htre_getqmethodname(req), mio_htre_getqpath(req));
HIO_DEBUG2 (hio, "[RAW-REQ] %s %s\n", hio_htre_getqmethodname(req), hio_htre_getqpath(req));
mio_htre_perdecqpath(req);
hio_htre_perdecqpath(req);
/* TODO: proper request logging */
MIO_DEBUG2 (mio, "[REQ] %s %s\n", mio_htre_getqmethodname(req), mio_htre_getqpath(req));
HIO_DEBUG2 (hio, "[REQ] %s %s\n", hio_htre_getqmethodname(req), hio_htre_getqpath(req));
#if 0
mio_printf (MIO_T("================================\n"));
mio_printf (MIO_T("[%lu] %hs REQUEST ==> [%hs] version[%d.%d %hs] method[%hs]\n"),
hio_printf (HIO_T("================================\n"));
hio_printf (HIO_T("[%lu] %hs REQUEST ==> [%hs] version[%d.%d %hs] method[%hs]\n"),
(unsigned long)time(NULL),
(peek? MIO_MT("PEEK"): MIO_MT("HANDLE")),
mio_htre_getqpath(req),
mio_htre_getmajorversion(req),
mio_htre_getminorversion(req),
mio_htre_getverstr(req),
mio_htre_getqmethodname(req)
(peek? HIO_MT("PEEK"): HIO_MT("HANDLE")),
hio_htre_getqpath(req),
hio_htre_getmajorversion(req),
hio_htre_getminorversion(req),
hio_htre_getverstr(req),
hio_htre_getqmethodname(req)
);
if (mio_htre_getqparam(req))
mio_printf (MIO_T("PARAMS ==> [%hs]\n"), mio_htre_getqparam(req));
if (hio_htre_getqparam(req))
hio_printf (HIO_T("PARAMS ==> [%hs]\n"), hio_htre_getqparam(req));
mio_htb_walk (&req->hdrtab, walk, MIO_NULL);
if (mio_htre_getcontentlen(req) > 0)
hio_htb_walk (&req->hdrtab, walk, HIO_NULL);
if (hio_htre_getcontentlen(req) > 0)
{
mio_printf (MIO_T("CONTENT [%.*S]\n"), (int)mio_htre_getcontentlen(req), mio_htre_getcontentptr(req));
hio_printf (HIO_T("CONTENT [%.*S]\n"), (int)hio_htre_getcontentlen(req), hio_htre_getcontentptr(req));
}
#endif
mth = mio_htre_getqmethodtype(req);
mth = hio_htre_getqmethodtype(req);
/* determine what to do once the header fields are all received.
* i don't want to delay this until the contents are received.
* if you don't like this behavior, you must implement your own
* callback function for request handling. */
#if 0
/* TODO support X-HTTP-Method-Override */
if (data.method == MIO_HTTP_POST)
if (data.method == HIO_HTTP_POST)
{
tmp = mio_htre_getheaderval(req, MIO_MT("X-HTTP-Method-Override"));
tmp = hio_htre_getheaderval(req, HIO_MT("X-HTTP-Method-Override"));
if (tmp)
{
/*while (tmp->next) tmp = tmp->next;*/ /* get the last value */
data.method = mio_mbstohttpmethod (tmp->ptr);
data.method = hio_mbstohttpmethod (tmp->ptr);
}
}
#endif
#if 0
if (mth == MIO_HTTP_CONNECT)
if (mth == HIO_HTTP_CONNECT)
{
/* CONNECT method must not have content set.
* however, arrange to discard it if so.
*
* NOTE: CONNECT is implemented to ignore many headers like
* 'Expect: 100-continue' and 'Connection: keep-alive'. */
mio_htre_discardcontent (req);
hio_htre_discardcontent (req);
}
else
{
/* this part can be checked in actual mio_svc_htts_doXXX() functions.
/* this part can be checked in actual hio_svc_htts_doXXX() functions.
* some doXXX handlers may not require length for POST.
* it may be able to simply accept till EOF? or treat as if CONTENT_LENGTH is 0*/
if (mth == MIO_HTTP_POST && !(req->flags & (MIO_HTRE_ATTR_LENGTH | MIO_HTRE_ATTR_CHUNKED)))
if (mth == HIO_HTTP_POST && !(req->flags & (HIO_HTRE_ATTR_LENGTH | HIO_HTRE_ATTR_CHUNKED)))
{
/* POST without Content-Length nor not chunked */
mio_htre_discardcontent (req);
hio_htre_discardcontent (req);
/* 411 Length Required - can't keep alive. Force disconnect */
req->flags &= ~MIO_HTRE_ATTR_KEEPALIVE; /* to cause sendstatus() to close */
if (mio_svc_htts_sendstatus(htts, csck, req, 411, MIO_NULL) <= -1) goto oops;
req->flags &= ~HIO_HTRE_ATTR_KEEPALIVE; /* to cause sendstatus() to close */
if (hio_svc_htts_sendstatus(htts, csck, req, 411, HIO_NULL) <= -1) goto oops;
}
else
{
#endif
const mio_bch_t* qpath = mio_htre_getqpath(req);
const hio_bch_t* qpath = hio_htre_getqpath(req);
int x;
if (mio_comp_bcstr_limited(qpath, "/thr/", 5, 1) == 0)
x = mio_svc_htts_dothr(htts, csck, req, on_htts_thr_request, MIO_NULL);
else if (mio_comp_bcstr_limited(qpath, "/thr2/", 6, 1) == 0)
x = mio_svc_htts_dothr(htts, csck, req, on_htts_thr2_request, MIO_NULL);
else if (mio_comp_bcstr_limited(qpath, "/txt/", 5, 1) == 0)
x = mio_svc_htts_dotxt(htts, csck, req, 200, "text/plain", qpath);
else if (mio_comp_bcstr_limited(qpath, "/cgi/", 5, 1) == 0)
x = mio_svc_htts_docgi(htts, csck, req, "", mio_htre_getqpath(req));
if (hio_comp_bcstr_limited(qpath, "/thr/", 5, 1) == 0)
x = hio_svc_htts_dothr(htts, csck, req, on_htts_thr_request, HIO_NULL);
else if (hio_comp_bcstr_limited(qpath, "/thr2/", 6, 1) == 0)
x = hio_svc_htts_dothr(htts, csck, req, on_htts_thr2_request, HIO_NULL);
else if (hio_comp_bcstr_limited(qpath, "/txt/", 5, 1) == 0)
x = hio_svc_htts_dotxt(htts, csck, req, 200, "text/plain", qpath);
else if (hio_comp_bcstr_limited(qpath, "/cgi/", 5, 1) == 0)
x = hio_svc_htts_docgi(htts, csck, req, "", hio_htre_getqpath(req));
else
x = mio_svc_htts_dofile(htts, csck, req, "", mio_htre_getqpath(req), "text/plain");
x = hio_svc_htts_dofile(htts, csck, req, "", hio_htre_getqpath(req), "text/plain");
if (x <= -1) goto oops;
return 0;
oops:
mio_dev_sck_halt (csck);
hio_dev_sck_halt (csck);
return -1;
}
void* thr_func (void* arg)
{
mio_t* mio = MIO_NULL;
mio_svc_htts_t* htts = MIO_NULL;
mio_dev_sck_bind_t htts_bind_info;
hio_t* hio = HIO_NULL;
hio_svc_htts_t* htts = HIO_NULL;
hio_dev_sck_bind_t htts_bind_info;
int htts_no = -1;
mio = mio_open(MIO_NULL, 0, MIO_NULL, MIO_FEATURE_ALL, 512, MIO_NULL);
if (!mio)
hio = hio_open(HIO_NULL, 0, HIO_NULL, HIO_FEATURE_ALL, 512, HIO_NULL);
if (!hio)
{
printf ("Cannot open mio\n");
printf ("Cannot open hio\n");
goto oops;
}
mio_setoption (mio, MIO_LOG_TARGET_BCSTR, "/dev/stderr");
hio_setoption (hio, HIO_LOG_TARGET_BCSTR, "/dev/stderr");
memset (&htts_bind_info, 0, MIO_SIZEOF(htts_bind_info));
memset (&htts_bind_info, 0, HIO_SIZEOF(htts_bind_info));
if (g_reuse_port)
{
mio_bcstrtoskad (mio, "0.0.0.0:9987", &htts_bind_info.localaddr);
htts_bind_info.options = MIO_DEV_SCK_BIND_REUSEADDR | MIO_DEV_SCK_BIND_REUSEPORT | MIO_DEV_SCK_BIND_IGNERR;
//htts_bind_info.options |= MIO_DEV_SCK_BIND_SSL;
hio_bcstrtoskad (hio, "0.0.0.0:9987", &htts_bind_info.localaddr);
htts_bind_info.options = HIO_DEV_SCK_BIND_REUSEADDR | HIO_DEV_SCK_BIND_REUSEPORT | HIO_DEV_SCK_BIND_IGNERR;
//htts_bind_info.options |= HIO_DEV_SCK_BIND_SSL;
htts_bind_info.ssl_certfile = "localhost.crt";
htts_bind_info.ssl_keyfile = "localhost.key";
}
htts = mio_svc_htts_start(mio, &htts_bind_info, process_http_request);
htts = hio_svc_htts_start(hio, &htts_bind_info, process_http_request);
if (!htts)
{
printf ("Unable to start htts\n");
@ -252,72 +252,72 @@ void* thr_func (void* arg)
pthread_mutex_unlock (&g_htts_mutex);
printf ("entering the loop for %d\n", htts_no);
mio_loop (mio);
hio_loop (hio);
printf ("exiting the loop for %d\n", htts_no);
oops:
pthread_mutex_lock (&g_htts_mutex);
if (htts)
{
mio_svc_htts_stop (htts);
g_htts[htts_no] = MIO_NULL;
hio_svc_htts_stop (htts);
g_htts[htts_no] = HIO_NULL;
}
pthread_mutex_unlock (&g_htts_mutex);
if (mio) mio_close (mio);
if (hio) hio_close (hio);
pthread_exit (MIO_NULL);
return MIO_NULL;
pthread_exit (HIO_NULL);
return HIO_NULL;
}
/* ========================================================================= */
static void tcp_sck_on_disconnect (mio_dev_sck_t* tcp)
static void tcp_sck_on_disconnect (hio_dev_sck_t* tcp)
{
switch (MIO_DEV_SCK_GET_PROGRESS(tcp))
switch (HIO_DEV_SCK_GET_PROGRESS(tcp))
{
case MIO_DEV_SCK_CONNECTING:
MIO_INFO1 (tcp->mio, "OUTGOING SESSION DISCONNECTED - FAILED TO CONNECT (%d) TO REMOTE SERVER\n", (int)tcp->hnd);
case HIO_DEV_SCK_CONNECTING:
HIO_INFO1 (tcp->hio, "OUTGOING SESSION DISCONNECTED - FAILED TO CONNECT (%d) TO REMOTE SERVER\n", (int)tcp->hnd);
break;
case MIO_DEV_SCK_CONNECTING_SSL:
MIO_INFO1 (tcp->mio, "OUTGOING SESSION DISCONNECTED - FAILED TO SSL-CONNECT (%d) TO REMOTE SERVER\n", (int)tcp->hnd);
case HIO_DEV_SCK_CONNECTING_SSL:
HIO_INFO1 (tcp->hio, "OUTGOING SESSION DISCONNECTED - FAILED TO SSL-CONNECT (%d) TO REMOTE SERVER\n", (int)tcp->hnd);
break;
case MIO_DEV_SCK_LISTENING:
MIO_INFO1 (tcp->mio, "SHUTTING DOWN THE SERVER SOCKET(%d)...\n", (int)tcp->hnd);
case HIO_DEV_SCK_LISTENING:
HIO_INFO1 (tcp->hio, "SHUTTING DOWN THE SERVER SOCKET(%d)...\n", (int)tcp->hnd);
break;
case MIO_DEV_SCK_CONNECTED:
MIO_INFO1 (tcp->mio, "OUTGOING CLIENT CONNECTION GOT TORN DOWN(%d).......\n", (int)tcp->hnd);
case HIO_DEV_SCK_CONNECTED:
HIO_INFO1 (tcp->hio, "OUTGOING CLIENT CONNECTION GOT TORN DOWN(%d).......\n", (int)tcp->hnd);
break;
case MIO_DEV_SCK_ACCEPTING_SSL:
MIO_INFO1 (tcp->mio, "INCOMING SSL-ACCEPT GOT DISCONNECTED(%d) ....\n", (int)tcp->hnd);
case HIO_DEV_SCK_ACCEPTING_SSL:
HIO_INFO1 (tcp->hio, "INCOMING SSL-ACCEPT GOT DISCONNECTED(%d) ....\n", (int)tcp->hnd);
break;
case MIO_DEV_SCK_ACCEPTED:
MIO_INFO1 (tcp->mio, "INCOMING CLIENT BEING SERVED GOT DISCONNECTED(%d).......\n", (int)tcp->hnd);
case HIO_DEV_SCK_ACCEPTED:
HIO_INFO1 (tcp->hio, "INCOMING CLIENT BEING SERVED GOT DISCONNECTED(%d).......\n", (int)tcp->hnd);
break;
default:
MIO_INFO2 (tcp->mio, "SOCKET DEVICE DISCONNECTED (%d - %x)\n", (int)tcp->hnd, (unsigned int)tcp->state);
HIO_INFO2 (tcp->hio, "SOCKET DEVICE DISCONNECTED (%d - %x)\n", (int)tcp->hnd, (unsigned int)tcp->state);
break;
}
}
static void tcp_sck_on_connect (mio_dev_sck_t* tcp)
static void tcp_sck_on_connect (hio_dev_sck_t* tcp)
{
mio_bch_t buf1[128], buf2[128];
hio_bch_t buf1[128], buf2[128];
mio_skadtobcstr (tcp->mio, &tcp->localaddr, buf1, MIO_COUNTOF(buf1), MIO_SKAD_TO_BCSTR_ADDR | MIO_SKAD_TO_BCSTR_PORT);
mio_skadtobcstr (tcp->mio, &tcp->remoteaddr, buf2, MIO_COUNTOF(buf2), MIO_SKAD_TO_BCSTR_ADDR | MIO_SKAD_TO_BCSTR_PORT);
hio_skadtobcstr (tcp->hio, &tcp->localaddr, buf1, HIO_COUNTOF(buf1), HIO_SKAD_TO_BCSTR_ADDR | HIO_SKAD_TO_BCSTR_PORT);
hio_skadtobcstr (tcp->hio, &tcp->remoteaddr, buf2, HIO_COUNTOF(buf2), HIO_SKAD_TO_BCSTR_ADDR | HIO_SKAD_TO_BCSTR_PORT);
if (tcp->state & MIO_DEV_SCK_CONNECTED)
if (tcp->state & HIO_DEV_SCK_CONNECTED)
{
MIO_INFO3 (tcp->mio, "DEVICE connected to a remote server... LOCAL %hs REMOTE %hs SCK: %d\n", buf1, buf2, tcp->hnd);
HIO_INFO3 (tcp->hio, "DEVICE connected to a remote server... LOCAL %hs REMOTE %hs SCK: %d\n", buf1, buf2, tcp->hnd);
}
else if (tcp->state & MIO_DEV_SCK_ACCEPTED)
else if (tcp->state & HIO_DEV_SCK_ACCEPTED)
{
/* TODO: pass it to distributor??? */
/* THIS PART WON"T BE CALLED FOR tcp_sck_on_raw_accept.. */
@ -325,8 +325,8 @@ static void tcp_sck_on_connect (mio_dev_sck_t* tcp)
}
static mio_tmridx_t xx_tmridx;
static int try_to_accept (mio_dev_sck_t* sck, mio_dev_sck_qxmsg_t* qxmsg, int in_mq);
static hio_tmridx_t xx_tmridx;
static int try_to_accept (hio_dev_sck_t* sck, hio_dev_sck_qxmsg_t* qxmsg, int in_mq);
typedef struct xx_mq_t xx_mq_t;
@ -335,7 +335,7 @@ struct xx_mq_t
xx_mq_t* q_next;
xx_mq_t* q_prev;
mio_dev_sck_qxmsg_t msg;
hio_dev_sck_qxmsg_t msg;
};
#define XX_MQ_INIT(mq) ((mq)->q_next = (mq)->q_prev = (mq))
@ -347,17 +347,17 @@ struct xx_mq_t
#define XX_MQ_IS_TAIL(mq,x) (XX_MQ_TAIL(mq) == (x))
#define XX_MQ_NEXT(x) ((x)->q_next)
#define XX_MQ_PREV(x) ((x)->q_prev)
#define XX_MQ_LINK(p,x,n) MIO_Q_LINK((mio_q_t*)p,(mio_q_t*)x,(mio_q_t*)n)
#define XX_MQ_UNLINK(x) MIO_Q_UNLINK((mio_q_t*)x)
#define XX_MQ_REPL(o,n) MIO_Q_REPL(o,n);
#define XX_MQ_ENQ(mq,x) XX_MQ_LINK(XX_MQ_TAIL(mq), (mio_q_t*)x, mq)
#define XX_MQ_LINK(p,x,n) HIO_Q_LINK((hio_q_t*)p,(hio_q_t*)x,(hio_q_t*)n)
#define XX_MQ_UNLINK(x) HIO_Q_UNLINK((hio_q_t*)x)
#define XX_MQ_REPL(o,n) HIO_Q_REPL(o,n);
#define XX_MQ_ENQ(mq,x) XX_MQ_LINK(XX_MQ_TAIL(mq), (hio_q_t*)x, mq)
#define XX_MQ_DEQ(mq) XX_MQ_UNLINK(XX_MQ_HEAD(mq))
static xx_mq_t xx_mq;
static void enable_accept (mio_t* mio, const mio_ntime_t* now, mio_tmrjob_t* job)
static void enable_accept (hio_t* hio, const hio_ntime_t* now, hio_tmrjob_t* job)
{
mio_dev_sck_t* rdev = (mio_dev_sck_t*)job->ctx;
hio_dev_sck_t* rdev = (hio_dev_sck_t*)job->ctx;
while (!XX_MQ_IS_EMPTY(&xx_mq))
{
@ -367,47 +367,47 @@ static void enable_accept (mio_t* mio, const mio_ntime_t* now, mio_tmrjob_t* job
if (try_to_accept(rdev, &mq->msg, 1) == 0) return; /* EAGAIN situation */
XX_MQ_UNLINK (mq);
mio_freemem (mio, mq);
hio_freemem (hio, mq);
}
assert (XX_MQ_IS_EMPTY(&xx_mq));
if (mio_dev_sck_read(rdev, 1) <= -1) // it's a disaster if this fails. the acceptor will get stalled if it happens
if (hio_dev_sck_read(rdev, 1) <= -1) // it's a disaster if this fails. the acceptor will get stalled if it happens
{
printf ("DISASTER.... UNABLE TO ENABLE READ ON ACCEPTOR\n");
}
}
static int try_to_accept (mio_dev_sck_t* sck, mio_dev_sck_qxmsg_t* qxmsg, int in_mq)
static int try_to_accept (hio_dev_sck_t* sck, hio_dev_sck_qxmsg_t* qxmsg, int in_mq)
{
mio_t* mio = sck->mio;
mio_svc_htts_t* htts;
hio_t* hio = sck->hio;
hio_svc_htts_t* htts;
pthread_mutex_lock (&g_htts_mutex);
htts = g_htts[g_htts_no];
g_htts_no = (g_htts_no + 1) % g_num_thrs;
pthread_mutex_unlock (&g_htts_mutex);
if (mio_svc_htts_writetosidechan(htts, qxmsg, MIO_SIZEOF(*qxmsg)) <= -1)
if (hio_svc_htts_writetosidechan(htts, qxmsg, HIO_SIZEOF(*qxmsg)) <= -1)
{
mio_bch_t buf[128];
hio_bch_t buf[128];
if (errno == EAGAIN)
{
//printf ("sidechannel retrying %s\n", strerror(errno));
if (mio_dev_sck_read(sck, 0) <= -1) goto sidechan_write_error;
if (hio_dev_sck_read(sck, 0) <= -1) goto sidechan_write_error;
if (!in_mq)
{
xx_mq_t* mq;
mq = mio_allocmem(mio, MIO_SIZEOF(*mq));
if (MIO_UNLIKELY(!mq)) goto sidechan_write_error;
mq = hio_allocmem(hio, HIO_SIZEOF(*mq));
if (HIO_UNLIKELY(!mq)) goto sidechan_write_error;
mq->msg = *qxmsg;
XX_MQ_ENQ (&xx_mq, mq);
}
if (xx_tmridx == MIO_TMRIDX_INVALID)
mio_schedtmrjobat (mio, MIO_NULL, enable_accept, &xx_tmridx, sck);
if (xx_tmridx == HIO_TMRIDX_INVALID)
hio_schedtmrjobat (hio, HIO_NULL, enable_accept, &xx_tmridx, sck);
return 0; /* enqueued for later writing */
}
@ -415,8 +415,8 @@ static int try_to_accept (mio_dev_sck_t* sck, mio_dev_sck_qxmsg_t* qxmsg, int in
{
sidechan_write_error:
printf ("sidechannel write error %s\n", strerror(errno));
mio_skadtobcstr (mio, &qxmsg->remoteaddr, buf, MIO_COUNTOF(buf), MIO_SKAD_TO_BCSTR_ADDR | MIO_SKAD_TO_BCSTR_PORT);
MIO_INFO2 (mio, "unable to handle the accepted connection %ld from %hs\n", (long int)qxmsg->syshnd, buf);
hio_skadtobcstr (hio, &qxmsg->remoteaddr, buf, HIO_COUNTOF(buf), HIO_SKAD_TO_BCSTR_ADDR | HIO_SKAD_TO_BCSTR_PORT);
HIO_INFO2 (hio, "unable to handle the accepted connection %ld from %hs\n", (long int)qxmsg->syshnd, buf);
const char* msg = "HTTP/1.0 503 Service unavailable\r\nConnection: close\r\nContent-Length: 0\r\n\r\n";
write (qxmsg->syshnd, msg, strlen(msg));
@ -437,14 +437,14 @@ printf ("sc => %d\n", sc++);
return 1; /* full success */
}
static void tcp_sck_on_raw_accept (mio_dev_sck_t* sck, mio_syshnd_t syshnd, mio_skad_t* remoteaddr)
static void tcp_sck_on_raw_accept (hio_dev_sck_t* sck, hio_syshnd_t syshnd, hio_skad_t* remoteaddr)
{
/*mio_t* mio = sck->mio;*/
/*hio_t* hio = sck->hio;*/
/* inform the worker of this accepted syshnd */
mio_dev_sck_qxmsg_t qxmsg;
memset (&qxmsg, 0, MIO_SIZEOF(qxmsg));
qxmsg.cmd = MIO_DEV_SCK_QXMSG_NEWCONN;
hio_dev_sck_qxmsg_t qxmsg;
memset (&qxmsg, 0, HIO_SIZEOF(qxmsg));
qxmsg.cmd = HIO_DEV_SCK_QXMSG_NEWCONN;
qxmsg.scktype = sck->type;
qxmsg.syshnd = syshnd;
qxmsg.remoteaddr = *remoteaddr;
@ -452,69 +452,69 @@ static void tcp_sck_on_raw_accept (mio_dev_sck_t* sck, mio_syshnd_t syshnd, mio_
try_to_accept (sck, &qxmsg, 0);
}
static int tcp_sck_on_write (mio_dev_sck_t* tcp, mio_iolen_t wrlen, void* wrctx, const mio_skad_t* dstaddr)
static int tcp_sck_on_write (hio_dev_sck_t* tcp, hio_iolen_t wrlen, void* wrctx, const hio_skad_t* dstaddr)
{
/* won't be invoked */
return 0;
}
static int tcp_sck_on_read (mio_dev_sck_t* tcp, const void* buf, mio_iolen_t len, const mio_skad_t* srcaddr)
static int tcp_sck_on_read (hio_dev_sck_t* tcp, const void* buf, hio_iolen_t len, const hio_skad_t* srcaddr)
{
/* won't be invoked */
return 0;
}
static int add_listener (mio_t* mio, mio_bch_t* addrstr)
static int add_listener (hio_t* hio, hio_bch_t* addrstr)
{
mio_dev_sck_make_t mi;
mio_dev_sck_t* tcp;
mio_dev_sck_bind_t bi;
mio_dev_sck_listen_t li;
hio_dev_sck_make_t mi;
hio_dev_sck_t* tcp;
hio_dev_sck_bind_t bi;
hio_dev_sck_listen_t li;
memset (&bi, 0, MIO_SIZEOF(bi));
if (mio_bcstrtoskad(mio, addrstr, &bi.localaddr) <= -1)
memset (&bi, 0, HIO_SIZEOF(bi));
if (hio_bcstrtoskad(hio, addrstr, &bi.localaddr) <= -1)
{
MIO_INFO1 (mio, "invalid listening address - %hs\n", addrstr);
HIO_INFO1 (hio, "invalid listening address - %hs\n", addrstr);
return -1;
}
bi.options = MIO_DEV_SCK_BIND_REUSEADDR /*| MIO_DEV_SCK_BIND_REUSEPORT |*/;
bi.options = HIO_DEV_SCK_BIND_REUSEADDR /*| HIO_DEV_SCK_BIND_REUSEPORT |*/;
#if defined(USE_SSL)
bi.options |= MIO_DEV_SCK_BIND_SSL;
bi.options |= HIO_DEV_SCK_BIND_SSL;
bi.ssl_certfile = "localhost.crt";
bi.ssl_keyfile = "localhost.key";
#endif
memset (&mi, 0, MIO_SIZEOF(mi));
mi.type = (mio_skad_family(&bi.localaddr) == MIO_AF_INET? MIO_DEV_SCK_TCP4: MIO_DEV_SCK_TCP6);
mi.options = MIO_DEV_SCK_MAKE_LENIENT;
memset (&mi, 0, HIO_SIZEOF(mi));
mi.type = (hio_skad_family(&bi.localaddr) == HIO_AF_INET? HIO_DEV_SCK_TCP4: HIO_DEV_SCK_TCP6);
mi.options = HIO_DEV_SCK_MAKE_LENIENT;
mi.on_write = tcp_sck_on_write;
mi.on_read = tcp_sck_on_read;
mi.on_connect = tcp_sck_on_connect; /* this is invoked on a client accept as well */
mi.on_disconnect = tcp_sck_on_disconnect;
mi.on_raw_accept = tcp_sck_on_raw_accept;
tcp = mio_dev_sck_make(mio, 0, &mi);
tcp = hio_dev_sck_make(hio, 0, &mi);
if (!tcp)
{
MIO_INFO1 (mio, "Cannot make tcp - %js\n", mio_geterrmsg(mio));
HIO_INFO1 (hio, "Cannot make tcp - %js\n", hio_geterrmsg(hio));
return -1;
}
if (!g_reuse_port)
{
if (mio_dev_sck_bind(tcp, &bi) <= -1)
if (hio_dev_sck_bind(tcp, &bi) <= -1)
{
MIO_INFO1 (mio, "tcp mio_dev_sck_bind() failed - %js\n", mio_geterrmsg(mio));
HIO_INFO1 (hio, "tcp hio_dev_sck_bind() failed - %js\n", hio_geterrmsg(hio));
return -1;
}
}
memset (&li, 0, MIO_SIZEOF(li));
memset (&li, 0, HIO_SIZEOF(li));
li.backlogs = 4096;
MIO_INIT_NTIME (&li.accept_tmout, 5, 1);
if (mio_dev_sck_listen(tcp, &li) <= -1)
HIO_INIT_NTIME (&li.accept_tmout, 5, 1);
if (hio_dev_sck_listen(tcp, &li) <= -1)
{
MIO_INFO1 (mio, "tcp[2] mio_dev_sck_listen() failed - %js\n", mio_geterrmsg(mio));
HIO_INFO1 (hio, "tcp[2] hio_dev_sck_listen() failed - %js\n", hio_geterrmsg(hio));
return -1;
}
@ -522,18 +522,18 @@ static int add_listener (mio_t* mio, mio_bch_t* addrstr)
}
static mio_t* g_mio = MIO_NULL;
static hio_t* g_hio = HIO_NULL;
static void handle_sigint (int sig)
{
if (g_mio) mio_stop (g_mio, MIO_STOPREQ_TERMINATION);
if (g_hio) hio_stop (g_hio, HIO_STOPREQ_TERMINATION);
}
int main (int argc, char* argv[])
{
mio_t* mio = MIO_NULL;
hio_t* hio = HIO_NULL;
pthread_t t[MAX_NUM_THRS];
mio_oow_t i;
hio_oow_t i;
struct sigaction sigact;
int xret = -1;
@ -570,64 +570,64 @@ int main (int argc, char* argv[])
}
}
memset (&sigact, 0, MIO_SIZEOF(sigact));
memset (&sigact, 0, HIO_SIZEOF(sigact));
sigact.sa_handler = SIG_IGN;
sigaction (SIGPIPE, &sigact, MIO_NULL);
sigaction (SIGPIPE, &sigact, HIO_NULL);
memset (&sigact, 0, MIO_SIZEOF(sigact));
memset (&sigact, 0, HIO_SIZEOF(sigact));
sigact.sa_handler = handle_sigint;
sigaction (SIGINT, &sigact, MIO_NULL);
sigaction (SIGINT, &sigact, HIO_NULL);
XX_MQ_INIT (&xx_mq);
xx_tmridx = MIO_TMRIDX_INVALID;
xx_tmridx = HIO_TMRIDX_INVALID;
mio = mio_open(MIO_NULL, 0, MIO_NULL, MIO_FEATURE_ALL, 512, MIO_NULL);
if (!mio)
hio = hio_open(HIO_NULL, 0, HIO_NULL, HIO_FEATURE_ALL, 512, HIO_NULL);
if (!hio)
{
printf ("Cannot open mio\n");
printf ("Cannot open hio\n");
goto oops;
}
mio_setoption (mio, MIO_LOG_TARGET_BCSTR, "/dev/stderr");
hio_setoption (hio, HIO_LOG_TARGET_BCSTR, "/dev/stderr");
g_mio = mio;
g_hio = hio;
for (i = 0; i < g_num_thrs; i++)
pthread_create (&t[i], MIO_NULL, thr_func, mio);
pthread_create (&t[i], HIO_NULL, thr_func, hio);
sleep (1); /* TODO: use pthread_cond_wait()/pthread_cond_signal() or a varialble to see if all threads are up */
/* TODO: wait until all threads are ready to serve... */
if (add_listener(mio, "[::]:9987") <= -1 ||
add_listener(mio, "0.0.0.0:9987") <= -1) goto oops;
if (add_listener(hio, "[::]:9987") <= -1 ||
add_listener(hio, "0.0.0.0:9987") <= -1) goto oops;
printf ("entering the main loop\n");
mio_loop (mio);
hio_loop (hio);
printf ("exiting the main loop\n");
xret = 0;
oops:
memset (&sigact, 0, MIO_SIZEOF(sigact));
memset (&sigact, 0, HIO_SIZEOF(sigact));
sigact.sa_handler = SIG_IGN;
sigaction (SIGINT, &sigact, MIO_NULL);
sigaction (SIGINT, &sigact, HIO_NULL);
pthread_mutex_lock (&g_htts_mutex);
for (i = 0; i < g_num_thrs; i++)
{
if (g_htts[i]) mio_stop (mio_svc_htts_getmio(g_htts[i]), MIO_STOPREQ_TERMINATION);
if (g_htts[i]) hio_stop (hio_svc_htts_gethio(g_htts[i]), HIO_STOPREQ_TERMINATION);
}
pthread_mutex_unlock (&g_htts_mutex);
for (i = 0; i < g_num_thrs; i++)
{
pthread_join (t[i], MIO_NULL);
pthread_join (t[i], HIO_NULL);
}
if (mio) mio_close (mio);
if (hio) hio_close (hio);
return xret;
}