diff --git a/.gitignore b/.gitignore index b2bc271..1a46dbb 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,5 @@ nbproject config.guess.dh-orig config.sub.dh-orig lib/libsntl.pc +examples/sntlc +examples/sntld diff --git a/Makefile.am b/Makefile.am index 258d2c6..cb971a2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,12 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS = po include lib +if BUILD_EXAMPLES +EXAMPLES = examples +else +EXAMPLES = +endif + +SUBDIRS = po include lib $(EXAMPLES) libsntldocdir = ${prefix}/doc/libsexpr libsntldoc_DATA = \ diff --git a/configure.ac b/configure.ac index 3f8ee3a..c97ae3b 100644 --- a/configure.ac +++ b/configure.ac @@ -39,9 +39,12 @@ AS_IF([test "x$enable_build_examples" = "xyes"], [ AC_DEFINE([BUILD_EXAMPLES], 1, [build of examples enabled]) ]) +AM_CONDITIONAL(BUILD_EXAMPLES, test "x$enable_build_examples" = "xyes") + AC_OUTPUT([ Makefile lib/libsntl.pc lib/Makefile include/Makefile +examples/Makefile po/Makefile.in]) diff --git a/examples/Makefile.am b/examples/Makefile.am new file mode 100644 index 0000000..a1269e5 --- /dev/null +++ b/examples/Makefile.am @@ -0,0 +1,27 @@ +## AUTOMAKE_OPTIONS = foreign + +AM_CPPFLAGS = \ + -DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \ + -DPACKAGE_SRC_DIR=\""$(srcdir)"\" \ + -DPACKAGE_DATA_DIR=\""$(pkgdatadir)"\" \ + -DCNFPATH=\""$(prefix)/etc"\" \ + -I../include + +AM_CFLAGS = -Wall -g + +#LIBS += $(ZOFFICE_LIBS) + +libsntl = ../lib/.libs/libsntl.la + +bin_PROGRAMS = sntld sntlc + +sntld_SOURCES = sntld.c +sntld_LDADD = $(LIBTDATA_LIBS) $(LIBSEXPR_LIBS) $(OPENSSL_LIBS) \ + $(LIBUUID_LIBS) $(libsntl) +sntlc_SOURCES = sntlc.c +sntlc_LDADD = $(LIBTDATA_LIBS) $(LIBSEXPR_LIBS) $(OPENSSL_LIBS) \ + $(LIBUUID_LIBS) $(libsntl) + +#zsyncd_LDFLAGS = \ +# -Wl,--export-dynamic +#zsyncd_LDADD = $(GMODULE_LIBS) $(GLIB_LIBS) $(GIO_LIBS) ../libs/libdata/.libs/libtdata.a ../libs/libsexpr/.libs/libsexpr.a diff --git a/examples/sntlc.c b/examples/sntlc.c new file mode 100644 index 0000000..ddf5a3a --- /dev/null +++ b/examples/sntlc.c @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) +{ +return 0; +} diff --git a/examples/sntld.c b/examples/sntld.c new file mode 100644 index 0000000..ddf5a3a --- /dev/null +++ b/examples/sntld.c @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) +{ +return 0; +} diff --git a/lib/connection.c b/lib/connection.c index b32d2a8..a4f0b5a 100644 --- a/lib/connection.c +++ b/lib/connection.c @@ -1536,7 +1536,7 @@ int channel_open(conn_t *co, chnl_t **ch, int type) "(ch-open ((:id %ld)(:uuid %s)(:type %d)))", nch->cid, nch->uuid, type); nch->sysmsg = sms; /* assign system message to the channel */ /* put it */ - if((r = zst_queue_add(conn_sys->ioqueue, (void *)sms, SYS_MSG))) { + if((r = pth_queue_add(conn_sys->ioqueue, (void *)sms, SYS_MSG))) { __fail_chan_r: /* remove it from the search tree */ pthread_rwlock_wrlock(&(co->chnl_lock));