From e9b9df0356d7e5cde3cdfb6ebeec093f16c0bd38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D0=BB=D0=B5=D0=B3=20=D0=91=D0=BE=D1=80=D0=BE=D0=B4?= =?UTF-8?q?=D0=B8=D0=BD?= Date: Tue, 5 Sep 2023 11:30:10 +0200 Subject: [PATCH] at work --- Makefile | 134 ++++++++-------- Makefile.am | 2 +- Makefile.in | 46 +++--- aclocal.m4 | 63 ++++---- clib/Makefile.am | 2 +- clib/Makefile.in | 7 +- clib/cfparser.c | 9 +- clib/cstring.c | 15 +- clib/defines.h | 185 --------------------- clib/jblock.c | 6 + config.h | 6 +- config.status | 407 ++++++++++++++++++++++++----------------------- cworker.c | 67 ++++---- defines.h | 24 ++- defines.h.in | 12 +- 15 files changed, 423 insertions(+), 562 deletions(-) delete mode 100644 clib/defines.h diff --git a/Makefile b/Makefile index 68c90ed..0c7c2cb 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.3 from Makefile.am. # Makefile. Generated from Makefile.in by configure. -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -86,8 +86,8 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = amd64-unknown-freebsd12.4 -host_triplet = amd64-unknown-freebsd12.4 +build_triplet = x86_64-pc-linux-gnu +host_triplet = x86_64-pc-linux-gnu sbin_PROGRAMS = cworker$(EXEEXT) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -170,8 +170,8 @@ am__recursive_targets = \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ - $(LISP)defines.h.in +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ + defines.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. @@ -233,29 +233,32 @@ am__relativize = \ DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print -ACLOCAL = ${SHELL} /home/ziggi/Projects/cworker/missing aclocal +ACLOCAL = ${SHELL} '/dat2/home/ziggi/projects/cworker/missing' aclocal-1.16 AMTAR = $${TAR-tar} AM_DEFAULT_VERBOSITY = 1 -APP_CACHEDIR = /home/ziggi/Projects/cworker/cache -APP_CONFIGDIR = /home/ziggi/Projects/cworker/ -APP_DATABASEDIR = /home/ziggi/Projects/cworker/data -APP_LIBDIR = /home/ziggi/Projects/cworker/lib -APP_LOGDIR = /home/ziggi/Projects/cworker/log -APP_RUNDIR = /home/ziggi/Projects/cworker/run +APP_CACHEDIR = /dat2/home/ziggi/projects/cworker/cache +APP_CONFIGDIR = /dat2/home/ziggi/projects/cworker/ +APP_DATABASEDIR = /dat2/home/ziggi/projects/cworker/data +APP_LIBDIR = /dat2/home/ziggi/projects/cworker/lib +APP_LOGDIR = /dat2/home/ziggi/projects/cworker/log +APP_RUNDIR = /dat2/home/ziggi/projects/cworker/run APP_USER = ziggi AR = ar -AUTOCONF = ${SHELL} /home/ziggi/Projects/cworker/missing autoconf -AUTOHEADER = ${SHELL} /home/ziggi/Projects/cworker/missing autoheader -AUTOMAKE = ${SHELL} /home/ziggi/Projects/cworker/missing automake +AUTOCONF = ${SHELL} '/dat2/home/ziggi/projects/cworker/missing' autoconf +AUTOHEADER = ${SHELL} '/dat2/home/ziggi/projects/cworker/missing' autoheader +AUTOMAKE = ${SHELL} '/dat2/home/ziggi/projects/cworker/missing' automake-1.16 AWK = gawk CC = clang CCDEPMODE = depmode=none CFLAGS = -g -O2 -CP = /usr/local/bin/gcp +CP = +CPP = clang -E CPPFLAGS = CYGPATH_W = echo DEFS = -DHAVE_CONFIG_H @@ -266,30 +269,30 @@ DUMPBIN = ECHO_C = ECHO_N = -n ECHO_T = -EGREP = /usr/bin/grep -E +EGREP = /bin/grep -E EXEEXT = -FGREP = /usr/bin/grep -F -GREP = /usr/bin/grep +FGREP = /bin/grep -F +GREP = /bin/grep HAVE_CP = true -INSTALL = /usr/bin/install -c +INSTALL = /bin/install -c INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = $(install_sh) -c -s -LD = /usr/bin/ld +LD = /bin/ld -m elf_x86_64 LDFLAGS = LIBOBJS = LIBS = LIBTOOL = $(SHELL) $(top_builddir)/libtool -LIBTOOL_DEPS = .//ltmain.sh +LIBTOOL_DEPS = ./ltmain.sh LIPO = LN_S = ln -s LTLIBOBJS = LT_SYS_LIBRARY_PATH = -MAKEINFO = ${SHELL} /home/ziggi/Projects/cworker/missing makeinfo +MAKEINFO = ${SHELL} '/dat2/home/ziggi/projects/cworker/missing' makeinfo MANIFEST_TOOL = : -MKDIR_P = /usr/local/bin/gmkdir -p -NM = /usr/bin/nm +MKDIR_P = /bin/mkdir -p +NM = /bin/nm -B NMEDIT = OBJDUMP = objdump OBJEXT = o @@ -304,16 +307,16 @@ PACKAGE_URL = PACKAGE_VERSION = 0.0.1 PATH_SEPARATOR = : RANLIB = ranlib -SED = /usr/local/bin/gsed +SED = /bin/sed SET_MAKE = -SHELL = /bin/sh +SHELL = /bin/bash STRIP = strip -VALGRIND = /usr/local/bin/valgrind +VALGRIND = /bin/valgrind VERSION = 0.0.1 -abs_builddir = /home/ziggi/Projects/cworker -abs_srcdir = /home/ziggi/Projects/cworker -abs_top_builddir = /home/ziggi/Projects/cworker -abs_top_srcdir = /home/ziggi/Projects/cworker +abs_builddir = /dat2/home/ziggi/projects/cworker +abs_srcdir = /dat2/home/ziggi/projects/cworker +abs_top_builddir = /dat2/home/ziggi/projects/cworker +abs_top_srcdir = /dat2/home/ziggi/projects/cworker ac_ct_AR = ar ac_ct_CC = clang ac_ct_DUMPBIN = @@ -322,35 +325,35 @@ am__leading_dot = . am__quote = am__tar = $${TAR-tar} chof - "$$tardir" am__untar = $${TAR-tar} xf - -app_cachedir = /home/ziggi/Projects/cworker/cache -app_configdir = /home/ziggi/Projects/cworker/ -app_databasedir = /home/ziggi/Projects/cworker/data -app_libdir = /home/ziggi/Projects/cworker/lib -app_logdir = /home/ziggi/Projects/cworker/log +app_cachedir = /dat2/home/ziggi/projects/cworker/cache +app_configdir = /dat2/home/ziggi/projects/cworker/ +app_databasedir = /dat2/home/ziggi/projects/cworker/data +app_libdir = /dat2/home/ziggi/projects/cworker/lib +app_logdir = /dat2/home/ziggi/projects/cworker/log app_name = cworker -app_rundir = /home/ziggi/Projects/cworker/run +app_rundir = /dat2/home/ziggi/projects/cworker/run app_user = ziggi bindir = ${exec_prefix}/bin -build = amd64-unknown-freebsd12.4 +build = x86_64-pc-linux-gnu build_alias = -build_cpu = amd64 -build_os = freebsd12.4 -build_vendor = unknown +build_cpu = x86_64 +build_os = linux-gnu +build_vendor = pc builddir = . datadir = ${datarootdir} datarootdir = ${prefix}/share docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} dvidir = ${docdir} exec_prefix = ${prefix} -host = amd64-unknown-freebsd12.4 +host = x86_64-pc-linux-gnu host_alias = -host_cpu = amd64 -host_os = freebsd12.4 -host_vendor = unknown +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = pc htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info -install_sh = ${SHELL} /home/ziggi/Projects/cworker/install-sh +install_sh = ${SHELL} /dat2/home/ziggi/projects/cworker/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale @@ -374,7 +377,7 @@ top_srcdir = . AUTOMAKE_OPTIONS = foreign no-dependencies no-installinfo subdir-objects SUBDIRS = clib SUFFIXES = .c .o -AM_CFLAGS = -Wall -I./clib +AM_CFLAGS = -Wall -I./clib -std=gnu99 AM_LDFLAGS = -pthread cworker_SOURCES = main.c cworker.c cworker.h cworker_LDADD = clib/libcworker.la @@ -697,6 +700,10 @@ dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) +dist-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(am__post_remove_distdir) + dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @@ -739,6 +746,8 @@ distcheck: dist eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) @@ -754,7 +763,7 @@ distcheck: dist $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ @@ -922,18 +931,19 @@ uninstall-am: uninstall-sbinPROGRAMS clean-libtool clean-local clean-sbinPROGRAMS cscope \ cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ - distcheck distclean distclean-compile distclean-generic \ - distclean-hdr distclean-libtool distclean-tags distcleancheck \ - distdir distuninstallcheck dvi dvi-am html html-am info \ - info-am install install-am install-data install-data-am \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-sbinPROGRAMS install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am uninstall-sbinPROGRAMS + dist-zstd distcheck distclean distclean-compile \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-sbinPROGRAMS .PRECIOUS: Makefile diff --git a/Makefile.am b/Makefile.am index a1a1377..b36bed3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,7 +4,7 @@ AUTOMAKE_OPTIONS = foreign no-dependencies no-installinfo subdir-objects SUBDIRS = clib SUFFIXES = .c .o -AM_CFLAGS = -Wall -I./clib +AM_CFLAGS = -Wall -I./clib -std=gnu99 AM_LDFLAGS = -pthread .c.o: diff --git a/Makefile.in b/Makefile.in index 143a453..3b432f4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -170,8 +170,8 @@ am__recursive_targets = \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ - $(LISP)defines.h.in +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ + defines.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. @@ -233,6 +233,8 @@ am__relativize = \ DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' @@ -256,6 +258,7 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ @@ -374,7 +377,7 @@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign no-dependencies no-installinfo subdir-objects SUBDIRS = clib SUFFIXES = .c .o -AM_CFLAGS = -Wall -I./clib +AM_CFLAGS = -Wall -I./clib -std=gnu99 AM_LDFLAGS = -pthread cworker_SOURCES = main.c cworker.c cworker.h cworker_LDADD = clib/libcworker.la @@ -697,6 +700,10 @@ dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) +dist-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(am__post_remove_distdir) + dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @@ -739,6 +746,8 @@ distcheck: dist eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) @@ -754,7 +763,7 @@ distcheck: dist $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ @@ -922,18 +931,19 @@ uninstall-am: uninstall-sbinPROGRAMS clean-libtool clean-local clean-sbinPROGRAMS cscope \ cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ - distcheck distclean distclean-compile distclean-generic \ - distclean-hdr distclean-libtool distclean-tags distcleancheck \ - distdir distuninstallcheck dvi dvi-am html html-am info \ - info-am install install-am install-data install-data-am \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-sbinPROGRAMS install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am uninstall-sbinPROGRAMS + dist-zstd distcheck distclean distclean-compile \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-sbinPROGRAMS .PRECIOUS: Makefile diff --git a/aclocal.m4 b/aclocal.m4 index ec216f3..1039151 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.1 -*- Autoconf -*- +# generated automatically by aclocal 1.16.3 -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,13 +14,13 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, -[m4_warning([this file was generated for autoconf 2.71. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2018 Free Software Foundation, Inc. +# Copyright (C) 2002-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.1], [], +m4_if([$1], [1.16.3], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.1])dnl +[AM_AUTOMAKE_VERSION([1.16.3])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -332,7 +332,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -371,7 +371,9 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE="gmake" (or whatever is + necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi @@ -398,7 +400,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -475,9 +477,9 @@ _AM_IF_OPTION([no-define],, # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG([ACLOCAL], [aclocal]) +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) -AM_MISSING_PROG([AUTOMAKE], [automake]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl @@ -595,7 +597,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -616,7 +618,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2018 Free Software Foundation, Inc. +# Copyright (C) 2003-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -637,7 +639,7 @@ AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -680,7 +682,7 @@ AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -701,12 +703,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then @@ -719,7 +716,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -748,7 +745,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -795,7 +792,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -814,7 +811,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -895,7 +892,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2018 Free Software Foundation, Inc. +# Copyright (C) 2009-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -955,7 +952,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -983,7 +980,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2018 Free Software Foundation, Inc. +# Copyright (C) 2006-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1002,7 +999,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2018 Free Software Foundation, Inc. +# Copyright (C) 2004-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/clib/Makefile.am b/clib/Makefile.am index c1395ce..9c6277a 100644 --- a/clib/Makefile.am +++ b/clib/Makefile.am @@ -38,7 +38,7 @@ include_HEADERS = \ cstring.h if HAVE_VALGRIND -VALGRIND_OPT = --tool=memcheck +VALGRIND_OPT = --tool=memcheck -s endif test: valgrind diff --git a/clib/Makefile.in b/clib/Makefile.in index a0d93fa..e220911 100644 --- a/clib/Makefile.in +++ b/clib/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -274,6 +274,7 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CP = @CP@ +CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ @@ -422,7 +423,7 @@ include_HEADERS = \ cdynarr.h \ cstring.h -@HAVE_VALGRIND_TRUE@VALGRIND_OPT = --tool=memcheck +@HAVE_VALGRIND_TRUE@VALGRIND_OPT = --tool=memcheck -s bin_TESTS = \ cstring_test diff --git a/clib/cfparser.c b/clib/cfparser.c index e44e7ec..b3059c5 100644 --- a/clib/cfparser.c +++ b/clib/cfparser.c @@ -174,5 +174,12 @@ int cfparser_parse(cfparser_t * parser) { void cfparser_destroy(cfparser_t * parser) { - free(parser->kvalarr); + if (parser == NULL) return; + if (parser->kvalarr != NULL) { + for (int i = 0; i < parser->kvalsize; i++) { + free(parser->kvalarr[i].key); + free(parser->kvalarr[i].val); + } + free(parser->kvalarr); + } } diff --git a/clib/cstring.c b/clib/cstring.c index e88f2d5..521dda7 100644 --- a/clib/cstring.c +++ b/clib/cstring.c @@ -10,15 +10,17 @@ #include -#define INIT_CAPA 1 +#define INIT_CAPA 128 /* String container */ void* cstring_init(cstring_t* str) { - str->data = malloc((INIT_CAPA + 1)*sizeof(char)); + size_t memsize = (INIT_CAPA + 1)*sizeof(char); + str->data = malloc(memsize); if (str->data == NULL) return NULL; - memset(str->data, '\0', INIT_CAPA + 1); + //memset(str->data, '\0', memsize); str->capa = INIT_CAPA; str->size = 0; + str->data[str->size] = '\0'; return str->data; } @@ -27,14 +29,14 @@ void* cstring_append(cstring_t* str, char* add) { size_t addsize = strlen(add); size_t newsize = str->size + addsize; if (newsize > str->capa) { - size_t newcapa = str->capa + addsize; + size_t newcapa = (str->capa*24)/18 + addsize*3; char* newstr = realloc(str->data, (newcapa + 1)*sizeof(char)); if (newstr == NULL) return NULL; str->data = newstr; str->capa = newcapa; } - strcpy(&(str->data[str->size]), add); - str->data[newsize + 1] = '\0'; + memcpy(&(str->data[str->size]), add, addsize); + str->data[newsize] = '\0'; str->size = newsize; return str->data; } @@ -43,7 +45,6 @@ char* cstring_getref(cstring_t* str) { return str->data; } - void cstring_destroy(cstring_t* str) { if (str == NULL) return; free(str->data); diff --git a/clib/defines.h b/clib/defines.h deleted file mode 100644 index 93ab960..0000000 --- a/clib/defines.h +++ /dev/null @@ -1,185 +0,0 @@ -/* defines.h. Generated from defines.h.in by configure. */ -/* defines.h.in. Generated from configure.ac by autoheader. */ - -/* location of cache dir */ -#define APP_CACHEDIR "/home/ziggi/Projects/cworker/cache" - -/* location of configuration files for ${PACKAGE} */ -#define APP_CONFIGDIR "/home/ziggi/Projects/cworker/" - -/* location of database dir */ -#define APP_DATABASEDIR "/home/ziggi/Projects/cworker/data" - -/* location of libs */ -#define APP_LIBDIR "/home/ziggi/Projects/cworker/lib" - -/* location of ${PACKAGE} logdir */ -#define APP_LOGDIR "/home/ziggi/Projects/cworker/log" - -/* location of pid file */ -#define APP_RUNDIR "/home/ziggi/Projects/cworker/run" - -/* effective user */ -#define APP_USER "ziggi" - -/* Define to 1 if you have the header file. */ -#define HAVE_ARPA_INET_H 1 - -/* Define to 1 if you have the `clock_gettime' function. */ -#define HAVE_CLOCK_GETTIME 1 - -/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. - */ -/* #undef HAVE_DECL_TZNAME */ - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if you have the `dup2' function. */ -#define HAVE_DUP2 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_FCNTL_H 1 - -/* Define to 1 if you have the `fork' function. */ -#define HAVE_FORK 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LOCALE_H 1 - -/* Define to 1 if your system has a GNU libc compatible `malloc' function, and - to 0 otherwise. */ -#define HAVE_MALLOC 1 - -/* Define to 1 if you have the `memset' function. */ -#define HAVE_MEMSET 1 - -/* Define to 1 if you have the `mkdir' function. */ -#define HAVE_MKDIR 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_NETINET_IN_H 1 - -/* Define to 1 if you have the `setlocale' function. */ -#define HAVE_SETLOCALE 1 - -/* Define to 1 if you have the `socket' function. */ -#define HAVE_SOCKET 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDIO_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if `tm_zone' is a member of `struct tm'. */ -#define HAVE_STRUCT_TM_TM_ZONE 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SOCKET_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use - `HAVE_STRUCT_TM_TM_ZONE' instead. */ -#define HAVE_TM_ZONE 1 - -/* Define to 1 if you don't have `tm_zone' but do have the external array - `tzname'. */ -/* #undef HAVE_TZNAME */ - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define to 1 if you have the `vfork' function. */ -#define HAVE_VFORK 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_VFORK_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_WCHAR_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_WCTYPE_H 1 - -/* Define to 1 if `fork' works. */ -#define HAVE_WORKING_FORK 1 - -/* Define to 1 if `vfork' works. */ -#define HAVE_WORKING_VFORK 1 - -/* Define to 1 if the system has the type `_Bool'. */ -#define HAVE__BOOL 1 - -/* Define to the sub-directory where libtool stores uninstalled libraries. */ -#define LT_OBJDIR ".libs/" - -/* Name of package */ -#define PACKAGE "cworker" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "cworker" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "cworker 0.0.1" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "cworker" - -/* Define to the home page for this package. */ -#define PACKAGE_URL "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "0.0.1" - -/* Define to 1 if all of the C90 standard headers exist (not just the ones - required in a freestanding environment). This macro is provided for - backward compatibility; new code need not use it. */ -#define STDC_HEADERS 1 - -/* Define to 1 if your declares `struct tm'. */ -/* #undef TM_IN_SYS_TIME */ - -/* Version number of package */ -#define VERSION "0.0.1" - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Define to rpl_malloc if the replacement function should be used. */ -/* #undef malloc */ - -/* Define to `int' if does not define. */ -/* #undef mode_t */ - -/* Define as a signed integer type capable of holding a process identifier. */ -/* #undef pid_t */ - -/* Define to `int' if does not define. */ -/* #undef ssize_t */ - -/* Define as `fork' if `vfork' does not work. */ -/* #undef vfork */ diff --git a/clib/jblock.c b/clib/jblock.c index 950a3d1..33cb6a4 100644 --- a/clib/jblock.c +++ b/clib/jblock.c @@ -5,6 +5,10 @@ */ +#ifdef __linux__ +#define _GNU_SOURCE +#endif + #include #include #include @@ -195,8 +199,10 @@ void jblock_destroy(jblock_t* jb) { } free(jb->kvarr[i].key); } + jb->kvsize = 0; jb->kvcapa = 0; + free(jb->kvarr); jb->kvarr = NULL; } diff --git a/config.h b/config.h index 135d01d..fc5837a 100644 --- a/config.h +++ b/config.h @@ -2,8 +2,8 @@ #ifndef CONFIG_H_QWER #define CONFIG_H_QWER -static const char *srv_runpath = "/home/ziggi/Projects/cworker/run/cworker.pid"; -static const char *srv_logpath = "/home/ziggi/Projects/cworker/log/cworker.log"; -static const char *srv_configpath = "/home/ziggi/Projects/cworker//cworker.conf"; +static const char *srv_runpath = "/dat2/home/ziggi/projects/cworker/run/cworker.pid"; +static const char *srv_logpath = "/dat2/home/ziggi/projects/cworker/log/cworker.log"; +static const char *srv_configpath = "/dat2/home/ziggi/projects/cworker//cworker.conf"; #endif diff --git a/config.status b/config.status index 5a04bb9..4341f2b 100755 --- a/config.status +++ b/config.status @@ -1,4 +1,4 @@ -#! /bin/sh +#! /bin/bash # Generated by configure. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging @@ -8,7 +8,7 @@ debug=false ac_cs_recheck=false ac_cs_silent=false -SHELL=${CONFIG_SHELL-/bin/sh} +SHELL=${CONFIG_SHELL-/bin/bash} export SHELL ## -------------------- ## ## M4sh Initialization. ## @@ -16,16 +16,14 @@ export SHELL # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: -if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 -then : +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop +else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -35,46 +33,46 @@ esac fi - -# Reset variables that may have inherited troublesome values from -# the environment. - -# IFS needs to be set, to space, tab, and newline, in precisely that order. -# (If _AS_PATH_WALK were called with IFS unset, it would have the -# side effect of setting IFS to empty, thus disabling word splitting.) -# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -IFS=" "" $as_nl" - -PS1='$ ' -PS2='> ' -PS4='+ ' - -# Ensure predictable behavior from utilities with locale-dependent output. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# We cannot yet rely on "unset" to work, but we need these variables -# to be unset--not just set to an empty or harmless value--now, to -# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct -# also avoids known problems related to "unset" and subshell syntax -# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). -for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH -do eval test \${$as_var+y} \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done - -# Ensure that fds 0, 1, and 2 are open. -if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi -if (exec 3>&2) ; then :; else exec 2>/dev/null; fi +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi # The user is always right. -if ${PATH_SEPARATOR+false} :; then +if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -83,6 +81,13 @@ if ${PATH_SEPARATOR+false} :; then fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -91,12 +96,8 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - test -r "$as_dir$0" && as_myself=$as_dir$0 && break + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS @@ -108,10 +109,30 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -124,14 +145,13 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - printf "%s\n" "$as_me: error: $2" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error - # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -158,20 +178,18 @@ as_fn_unset () { eval $1=; unset $1;} } as_unset=as_fn_unset - # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null -then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' -else $as_nop +else as_fn_append () { eval $1=\$$1\$2 @@ -183,13 +201,12 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null -then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else $as_nop +else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -220,7 +237,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -242,10 +259,6 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits - -# Determine whether it's possible to make 'echo' print without a newline. -# These variables are no longer used directly by Autoconf, but are AC_SUBSTed -# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -259,12 +272,6 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac -# For backward compatibility with old third-party macros, we provide -# the shell variables $as_echo and $as_echo_n. New code should use -# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. -as_echo='printf %s\n' -as_echo_n='printf %s' - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -306,7 +313,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -315,7 +322,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$as_dir" | +$as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -374,7 +381,7 @@ exec 6>&1 # values after options handling. ac_log=" This file was extended by cworker $as_me 0.0.1, which was -generated by GNU Autoconf 2.71. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -420,20 +427,20 @@ $config_commands Report bugs to the package provider." -ac_cs_config='--enable-devel-mode' +ac_cs_config="'--enable-devel-mode'" ac_cs_version="\ cworker config.status 0.0.1 -configured by ./configure, generated by GNU Autoconf 2.71, +configured by ./configure, generated by GNU Autoconf 2.69, with options \"$ac_cs_config\" -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -ac_pwd='/home/ziggi/Projects/cworker' +ac_pwd='/dat2/home/ziggi/projects/cworker' srcdir='.' -INSTALL='/usr/bin/install -c' -MKDIR_P='/usr/local/bin/gmkdir -p' +INSTALL='/bin/install -c' +MKDIR_P='/bin/mkdir -p' AWK='gawk' test -n "$AWK" || AWK=awk # The default lists apply if the user does not specify any file. @@ -463,15 +470,15 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - printf "%s\n" "$ac_cs_version"; exit ;; + $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - printf "%s\n" "$ac_cs_config"; exit ;; + $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" @@ -479,7 +486,7 @@ do --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; @@ -488,7 +495,7 @@ do as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) - printf "%s\n" "$ac_cs_usage"; exit ;; + $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -512,10 +519,10 @@ if $ac_cs_silent; then fi if $ac_cs_recheck; then - set X /bin/sh './configure' '--enable-devel-mode' $ac_configure_extra_args --no-create --no-recursion + set X /bin/bash './configure' '--enable-devel-mode' $ac_configure_extra_args --no-create --no-recursion shift - \printf "%s\n" "running CONFIG_SHELL=/bin/sh $*" >&6 - CONFIG_SHELL='/bin/sh' + $as_echo "running CONFIG_SHELL=/bin/bash $*" >&6 + CONFIG_SHELL='/bin/bash' export CONFIG_SHELL exec "$@" fi @@ -526,7 +533,7 @@ exec 5>>config.log sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - printf "%s\n" "$ac_log" + $as_echo "$ac_log" } >&5 # @@ -549,24 +556,24 @@ enable_static='yes' pic_mode='default' enable_fast_install='needless' shared_archive_member_spec='' -SHELL='/bin/sh' +SHELL='/bin/bash' ECHO='printf %s\n' PATH_SEPARATOR=':' host_alias='' -host='amd64-unknown-freebsd12.4' -host_os='freebsd12.4' +host='x86_64-pc-linux-gnu' +host_os='linux-gnu' build_alias='' -build='amd64-unknown-freebsd12.4' -build_os='freebsd12.4' -SED='/usr/local/bin/gsed' -Xsed='/usr/local/bin/gsed -e 1s/^X//' -GREP='/usr/bin/grep' -EGREP='/usr/bin/grep -E' -FGREP='/usr/bin/grep -F' -LD='/usr/bin/ld' -NM='/usr/bin/nm' +build='x86_64-pc-linux-gnu' +build_os='linux-gnu' +SED='/bin/sed' +Xsed='/bin/sed -e 1s/^X//' +GREP='/bin/grep' +EGREP='/bin/grep -E' +FGREP='/bin/grep -F' +LD='/bin/ld -m elf_x86_64' +NM='/bin/nm -B' LN_S='ln -s' -max_cmd_len='393216' +max_cmd_len='1572864' ac_objext='o' exeext='' lt_unset='unset' @@ -585,7 +592,7 @@ DLLTOOL='false' sharedlib_from_linklib_cmd='printf %s\n' AR='ar' AR_FLAGS='cru' -archiver_list_spec='' +archiver_list_spec='@' STRIP='strip' RANLIB='ranlib' old_postinstall_cmds='chmod 644 $oldlib~$RANLIB $tool_oldlib' @@ -596,13 +603,13 @@ CC='clang' CFLAGS='-g -O2' compiler='clang' GCC='yes' -lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([BCDEGRST][BCDEGRST]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p'\'' | sed '\''/ __gnu_lto/d'\''' -lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[BCDEGRST][BCDEGRST]* .* \(.*\)$/extern char \1;/p'\''' +lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p'\'' | sed '\''/ __gnu_lto/d'\''' +lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/extern char \1;/p'\''' lt_cv_sys_global_symbol_to_import='' -lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \(.*\) .*$/ {"\1", (void *) 0},/p'\'' -e '\''s/^[BCDEGRST][BCDEGRST]* .* \(.*\)$/ {"\1", (void *) \&\1},/p'\''' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='sed -n -e '\''s/^: \(.*\) .*$/ {"\1", (void *) 0},/p'\'' -e '\''s/^[BCDEGRST][BCDEGRST]* .* \(lib.*\)$/ {"\1", (void *) \&\1},/p'\'' -e '\''s/^[BCDEGRST][BCDEGRST]* .* \(.*\)$/ {"lib\1", (void *) \&\1},/p'\''' +lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \(.*\) .*$/ {"\1", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/ {"\1", (void *) \&\1},/p'\''' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='sed -n -e '\''s/^: \(.*\) .*$/ {"\1", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(lib.*\)$/ {"\1", (void *) \&\1},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/ {"lib\1", (void *) \&\1},/p'\''' lt_cv_nm_interface='BSD nm' -nm_file_list_spec='' +nm_file_list_spec='@' lt_sysroot='' lt_cv_truncate_bin='/bin/dd bs=4096 count=1' objdir='.libs' @@ -630,7 +637,10 @@ compiler_needs_object='no' old_archive_from_new_cmds='' old_archive_from_expsyms_cmds='' archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' -archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' +archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' module_cmds='' module_expsym_cmds='' with_gnu_ld='yes' @@ -655,7 +665,7 @@ file_list_spec='' variables_saved_for_relink='PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH' need_lib_prefix='no' need_version='no' -version_type='freebsd-elf' +version_type='linux' runpath_var='LD_RUN_PATH' shlibpath_var='LD_LIBRARY_PATH' shlibpath_overrides_runpath='yes' @@ -665,18 +675,18 @@ soname_spec='$libname$release$shared_ext$major' install_override_mode='' postinstall_cmds='' postuninstall_cmds='' -finish_cmds='' +finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' finish_eval='' hardcode_into_libs='yes' -sys_lib_search_path_spec='/usr/lib/clang/13.0.0 /usr/lib ' -configure_time_dlsearch_path='/lib /usr/lib' +sys_lib_search_path_spec='/usr/lib/llvm-11/lib/clang/11.0.1 /lib/gcc/x86_64-linux-gnu/10 /lib/x86_64-linux-gnu /lib64 /usr/lib/x86_64-linux-gnu /usr/lib64 /lib /usr/lib/llvm-11/lib /usr/lib ' +configure_time_dlsearch_path='/lib /usr/lib /usr/lib/x86_64-linux-gnu/libfakeroot /usr/local/lib/i386-linux-gnu /lib/i386-linux-gnu /usr/lib/i386-linux-gnu /usr/local/lib/i686-linux-gnu /lib/i686-linux-gnu /usr/lib/i686-linux-gnu /usr/local/lib /usr/local/lib/x86_64-linux-gnu /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /lib32 /usr/lib32 /libx32 /usr/libx32 ' configure_time_lt_sys_library_path='' hardcode_action='immediate' enable_dlopen='unknown' enable_dlopen_self='unknown' enable_dlopen_self_static='unknown' -old_striplib='' -striplib='' +old_striplib='strip --strip-debug' +striplib='strip --strip-unneeded' LTCC='clang' LTCFLAGS='-g -O2' @@ -714,7 +724,7 @@ for var in reload_cmds old_postinstall_cmds old_postuninstall_cmds old_archive_c esac done -ac_aux_dir='./' +ac_aux_dir='.' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. @@ -753,9 +763,9 @@ done # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then - test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files - test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers - test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree @@ -811,30 +821,30 @@ S["am__EXEEXT_FALSE"]="" S["am__EXEEXT_TRUE"]="#" S["LTLIBOBJS"]="" S["app_name"]="cworker" -S["app_cachedir"]="/home/ziggi/Projects/cworker/cache" -S["APP_CACHEDIR"]="/home/ziggi/Projects/cworker/cache" -S["app_databasedir"]="/home/ziggi/Projects/cworker/data" -S["APP_DATABASEDIR"]="/home/ziggi/Projects/cworker/data" +S["app_cachedir"]="/dat2/home/ziggi/projects/cworker/cache" +S["APP_CACHEDIR"]="/dat2/home/ziggi/projects/cworker/cache" +S["app_databasedir"]="/dat2/home/ziggi/projects/cworker/data" +S["APP_DATABASEDIR"]="/dat2/home/ziggi/projects/cworker/data" S["app_user"]="ziggi" S["APP_USER"]="ziggi" -S["app_libdir"]="/home/ziggi/Projects/cworker/lib" -S["APP_LIBDIR"]="/home/ziggi/Projects/cworker/lib" -S["app_rundir"]="/home/ziggi/Projects/cworker/run" -S["APP_RUNDIR"]="/home/ziggi/Projects/cworker/run" -S["app_logdir"]="/home/ziggi/Projects/cworker/log" -S["APP_LOGDIR"]="/home/ziggi/Projects/cworker/log" -S["app_configdir"]="/home/ziggi/Projects/cworker/" -S["APP_CONFIGDIR"]="/home/ziggi/Projects/cworker/" -S["SYSTEMD_FALSE"]="" -S["SYSTEMD_TRUE"]="#" -S["LINUX_OS_FALSE"]="" -S["LINUX_OS_TRUE"]="#" -S["FREEBSD_OS_FALSE"]="#" -S["FREEBSD_OS_TRUE"]="" -S["CP"]="/usr/local/bin/gcp" +S["app_libdir"]="/dat2/home/ziggi/projects/cworker/lib" +S["APP_LIBDIR"]="/dat2/home/ziggi/projects/cworker/lib" +S["app_rundir"]="/dat2/home/ziggi/projects/cworker/run" +S["APP_RUNDIR"]="/dat2/home/ziggi/projects/cworker/run" +S["app_logdir"]="/dat2/home/ziggi/projects/cworker/log" +S["APP_LOGDIR"]="/dat2/home/ziggi/projects/cworker/log" +S["app_configdir"]="/dat2/home/ziggi/projects/cworker/" +S["APP_CONFIGDIR"]="/dat2/home/ziggi/projects/cworker/" +S["SYSTEMD_FALSE"]="#" +S["SYSTEMD_TRUE"]="" +S["LINUX_OS_FALSE"]="#" +S["LINUX_OS_TRUE"]="" +S["FREEBSD_OS_FALSE"]="" +S["FREEBSD_OS_TRUE"]="#" +S["CP"]="" S["HAVE_CP"]="true" S["LIBOBJS"]="" -S["LIBTOOL_DEPS"]=".//ltmain.sh" +S["LIBTOOL_DEPS"]="./ltmain.sh" S["LT_SYS_LIBRARY_PATH"]="" S["OTOOL64"]="" S["OTOOL"]="" @@ -848,26 +858,27 @@ S["AR"]="ar" S["DLLTOOL"]="false" S["OBJDUMP"]="objdump" S["LN_S"]="ln -s" -S["NM"]="/usr/bin/nm" +S["NM"]="/bin/nm -B" S["ac_ct_DUMPBIN"]="" S["DUMPBIN"]="" -S["LD"]="/usr/bin/ld" -S["FGREP"]="/usr/bin/grep -F" -S["EGREP"]="/usr/bin/grep -E" -S["GREP"]="/usr/bin/grep" -S["SED"]="/usr/local/bin/gsed" -S["host_os"]="freebsd12.4" -S["host_vendor"]="unknown" -S["host_cpu"]="amd64" -S["host"]="amd64-unknown-freebsd12.4" -S["build_os"]="freebsd12.4" -S["build_vendor"]="unknown" -S["build_cpu"]="amd64" -S["build"]="amd64-unknown-freebsd12.4" +S["LD"]="/bin/ld -m elf_x86_64" +S["FGREP"]="/bin/grep -F" +S["SED"]="/bin/sed" +S["host_os"]="linux-gnu" +S["host_vendor"]="pc" +S["host_cpu"]="x86_64" +S["host"]="x86_64-pc-linux-gnu" +S["build_os"]="linux-gnu" +S["build_vendor"]="pc" +S["build_cpu"]="x86_64" +S["build"]="x86_64-pc-linux-gnu" S["LIBTOOL"]="$(SHELL) $(top_builddir)/libtool" S["HAVE_VALGRIND_FALSE"]="" S["HAVE_VALGRIND_TRUE"]="#" -S["VALGRIND"]="/usr/local/bin/valgrind" +S["VALGRIND"]="/bin/valgrind" +S["EGREP"]="/bin/grep -E" +S["GREP"]="/bin/grep" +S["CPP"]="clang -E" S["am__fastdepCC_FALSE"]="" S["am__fastdepCC_TRUE"]="#" S["CCDEPMODE"]="depmode=none" @@ -895,15 +906,15 @@ S["am__leading_dot"]="." S["SET_MAKE"]="" S["AWK"]="gawk" S["mkdir_p"]="$(MKDIR_P)" -S["MKDIR_P"]="/usr/local/bin/gmkdir -p" +S["MKDIR_P"]="/bin/mkdir -p" S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s" S["STRIP"]="strip" -S["install_sh"]="${SHELL} /home/ziggi/Projects/cworker/install-sh" -S["MAKEINFO"]="${SHELL} /home/ziggi/Projects/cworker/missing makeinfo" -S["AUTOHEADER"]="${SHELL} /home/ziggi/Projects/cworker/missing autoheader" -S["AUTOMAKE"]="${SHELL} /home/ziggi/Projects/cworker/missing automake" -S["AUTOCONF"]="${SHELL} /home/ziggi/Projects/cworker/missing autoconf" -S["ACLOCAL"]="${SHELL} /home/ziggi/Projects/cworker/missing aclocal" +S["install_sh"]="${SHELL} /dat2/home/ziggi/projects/cworker/install-sh" +S["MAKEINFO"]="${SHELL} '/dat2/home/ziggi/projects/cworker/missing' makeinfo" +S["AUTOHEADER"]="${SHELL} '/dat2/home/ziggi/projects/cworker/missing' autoheader" +S["AUTOMAKE"]="${SHELL} '/dat2/home/ziggi/projects/cworker/missing' automake-1.16" +S["AUTOCONF"]="${SHELL} '/dat2/home/ziggi/projects/cworker/missing' autoconf" +S["ACLOCAL"]="${SHELL} '/dat2/home/ziggi/projects/cworker/missing' aclocal-1.16" S["VERSION"]="0.0.1" S["PACKAGE"]="cworker" S["CYGPATH_W"]="echo" @@ -949,7 +960,7 @@ S["PACKAGE_VERSION"]="0.0.1" S["PACKAGE_TARNAME"]="cworker" S["PACKAGE_NAME"]="cworker" S["PATH_SEPARATOR"]=":" -S["SHELL"]="/bin/sh" +S["SHELL"]="/bin/bash" S["am__quote"]="" _ACAWK cat >>"$ac_tmp/subs1.awk" <<_ACAWK && @@ -1000,16 +1011,16 @@ D["PACKAGE_BUGREPORT"]=" \"\"" D["PACKAGE_URL"]=" \"\"" D["PACKAGE"]=" \"cworker\"" D["VERSION"]=" \"0.0.1\"" -D["HAVE_STDIO_H"]=" 1" +D["STDC_HEADERS"]=" 1" +D["HAVE_SYS_TYPES_H"]=" 1" +D["HAVE_SYS_STAT_H"]=" 1" D["HAVE_STDLIB_H"]=" 1" D["HAVE_STRING_H"]=" 1" +D["HAVE_MEMORY_H"]=" 1" +D["HAVE_STRINGS_H"]=" 1" D["HAVE_INTTYPES_H"]=" 1" D["HAVE_STDINT_H"]=" 1" -D["HAVE_STRINGS_H"]=" 1" -D["HAVE_SYS_STAT_H"]=" 1" -D["HAVE_SYS_TYPES_H"]=" 1" D["HAVE_UNISTD_H"]=" 1" -D["STDC_HEADERS"]=" 1" D["HAVE_ARPA_INET_H"]=" 1" D["HAVE_FCNTL_H"]=" 1" D["HAVE_LIMITS_H"]=" 1" @@ -1030,6 +1041,7 @@ D["HAVE_FORK"]=" 1" D["HAVE_VFORK"]=" 1" D["HAVE_WORKING_VFORK"]=" 1" D["HAVE_WORKING_FORK"]=" 1" +D["HAVE_STDLIB_H"]=" 1" D["HAVE_MALLOC"]=" 1" D["HAVE_CLOCK_GETTIME"]=" 1" D["HAVE_DUP2"]=" 1" @@ -1037,13 +1049,13 @@ D["HAVE_MEMSET"]=" 1" D["HAVE_MKDIR"]=" 1" D["HAVE_SETLOCALE"]=" 1" D["HAVE_SOCKET"]=" 1" -D["APP_CONFIGDIR"]=" \"/home/ziggi/Projects/cworker/\"" -D["APP_LOGDIR"]=" \"/home/ziggi/Projects/cworker/log\"" -D["APP_RUNDIR"]=" \"/home/ziggi/Projects/cworker/run\"" -D["APP_LIBDIR"]=" \"/home/ziggi/Projects/cworker/lib\"" +D["APP_CONFIGDIR"]=" \"/dat2/home/ziggi/projects/cworker/\"" +D["APP_LOGDIR"]=" \"/dat2/home/ziggi/projects/cworker/log\"" +D["APP_RUNDIR"]=" \"/dat2/home/ziggi/projects/cworker/run\"" +D["APP_LIBDIR"]=" \"/dat2/home/ziggi/projects/cworker/lib\"" D["APP_USER"]=" \"ziggi\"" -D["APP_DATABASEDIR"]=" \"/home/ziggi/Projects/cworker/data\"" -D["APP_CACHEDIR"]=" \"/home/ziggi/Projects/cworker/cache\"" +D["APP_DATABASEDIR"]=" \"/dat2/home/ziggi/projects/cworker/data\"" +D["APP_CACHEDIR"]=" \"/dat2/home/ziggi/projects/cworker/cache\"" for (key in D) D_is_set[key] = 1 FS = "" } @@ -1119,7 +1131,7 @@ do esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done @@ -1127,17 +1139,17 @@ do # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -printf "%s\n" "$as_me: creating $ac_file" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`printf "%s\n" "$configure_input" | + ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -1154,7 +1166,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$ac_file" | +$as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1178,9 +1190,9 @@ printf "%s\n" X"$ac_file" | case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1239,8 +1251,8 @@ ac_sed_dataroot=' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} ac_datarootdir_hack=' s&@datadir@&${datarootdir}&g s&@docdir@&${datarootdir}/doc/${PACKAGE_TARNAME}&g @@ -1289,9 +1301,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -1307,20 +1319,20 @@ which seems to be undefined. Please make sure it is defined" >&2;} # if test x"$ac_file" != x-; then { - printf "%s\n" "/* $configure_input */" >&1 \ + $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else - printf "%s\n" "/* $configure_input */" >&1 \ + $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi @@ -1340,7 +1352,7 @@ $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$_am_arg" | +$as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1360,8 +1372,8 @@ printf "%s\n" X"$_am_arg" | s/.*/./; q'`/stamp-h$_am_stamp_count ;; - :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -printf "%s\n" "$as_me: executing $ac_file commands" >&6;} + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac @@ -1387,7 +1399,7 @@ esac for am_mf do # Strip MF so we end up with the name of the file. - am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` + am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line @@ -1399,7 +1411,7 @@ $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$am_mf" | +$as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1421,7 +1433,7 @@ printf "%s\n" X"$am_mf" | $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X/"$am_mf" | +$as_echo X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -1446,10 +1458,12 @@ printf "%s\n" X/"$am_mf" | (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=\"gmake\" (or whatever is + necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } @@ -1989,7 +2003,6 @@ _LT_EOF esac - ltmain=$ac_aux_dir/ltmain.sh diff --git a/cworker.c b/cworker.c index c83b23c..8085094 100644 --- a/cworker.c +++ b/cworker.c @@ -5,15 +5,20 @@ */ +#ifdef __linux__ +#define _GNU_SOURCE +#endif + #include #include #include #include -#include +//#include #include #include #include + #include #include #include @@ -211,9 +216,8 @@ int cworker_build(cworker_t* worker) { paddr->sin_family = AF_INET; paddr->sin_addr.s_addr = INADDR_ANY; paddr->sin_port = htons(worker->port); - paddr->sin_len = sizeof(struct sockaddr_in); - if (bind(worker->socket, (struct sockaddr*)paddr, paddr->sin_len) < 0) { + if (bind(worker->socket, (struct sockaddr*)paddr, sizeof(struct sockaddr_in)) < 0) { log_debug("Socket binding error %d: %s ", errno, strerror(errno)); return -1; } @@ -240,7 +244,7 @@ int cworker_run(const cworker_t* worker) { continue; } if (childpid == 0) { - // child + /* Child */ log_debug("Service %d forked", getpid()); signal(SIGHUP, SIG_IGN); signal(SIGTERM, SIG_IGN); @@ -250,12 +254,12 @@ int cworker_run(const cworker_t* worker) { log_debug("Socket option setting error %d: %s ", errno, strerror(errno)); return -1; } - cworker_handler(worker, newsocket); - log_debug("Handler %d done", getpid()); + int res = cworker_handler(worker, newsocket); + log_debug("Handler %d done with res code %d", getpid(), res); close(newsocket); return 0; } else { - // parent + /* Parent */ close(newsocket); } } @@ -269,13 +273,13 @@ int cworker_run(const cworker_t* worker) { int cworker_handler(const cworker_t* worker, int socket) { int err = 0; - //rcache_t cache; - //jlexer_t lexer; - //jparser_t parser; + rcache_t cache; + jlexer_t lexer; + jparser_t parser; - //rcache_init(&cache, socket); - //jlexer_init(&lexer, &cache); - //jparser_init(&parser, &lexer); + rcache_init(&cache, socket); + jlexer_init(&lexer, &cache); + jparser_init(&parser, &lexer); //if (jparser_parse(&parser) < 0) { //log_error("Cannot parse json"); @@ -283,8 +287,8 @@ int cworker_handler(const cworker_t* worker, int socket) { //goto exit; //} - //int64_t id = 0; - //char* name = "none"; + int64_t id = 0; + char* name = "none"; //if (jparser_bind(&parser, JVALTYPE_NUM, "id", (void *)&id) < 0) { //log_error("Cannot bind id"); @@ -294,29 +298,30 @@ int cworker_handler(const cworker_t* worker, int socket) { //} - //char* msg = NULL; - //asprintf(&msg, "hello, %s!", name); + char* msg = NULL; + asprintf(&msg, "hello, %s!", name); + + jblock_t jb; + jblock_init(&jb); + jblock_addstr(&jb, "message", msg); + jblock_addbool(&jb, "error", false); + jblock_addint(&jb, "id", 12); - //jblock_t jb; - //jblock_init(&jb); - //jblock_addstr(&jb, "message", msg); - //jblock_addbool(&jb, "error", false); - //char* jsonstr = NULL; - //jblock_outjson(&jb, &jsonstr); - //jblock_destroy(&jb); + char* jsonstr = NULL; + jblock_outjson(&jb, &jsonstr); + jblock_destroy(&jb); - //write(socket, jsonstr, strlen(jsonstr)); - //free(jsonstr); + write(socket, jsonstr, strlen(jsonstr)); + free(jsonstr); //free(name); - //free(msg); + free(msg); //exit: - //jparser_destroy(&parser); - //jlexer_destroy(&lexer); - //rcache_destroy(&cache); + jparser_destroy(&parser); + jlexer_destroy(&lexer); + rcache_destroy(&cache); - close(socket); return err; } diff --git a/defines.h b/defines.h index 93ab960..6c9f1c2 100644 --- a/defines.h +++ b/defines.h @@ -2,22 +2,22 @@ /* defines.h.in. Generated from configure.ac by autoheader. */ /* location of cache dir */ -#define APP_CACHEDIR "/home/ziggi/Projects/cworker/cache" +#define APP_CACHEDIR "/dat2/home/ziggi/projects/cworker/cache" /* location of configuration files for ${PACKAGE} */ -#define APP_CONFIGDIR "/home/ziggi/Projects/cworker/" +#define APP_CONFIGDIR "/dat2/home/ziggi/projects/cworker/" /* location of database dir */ -#define APP_DATABASEDIR "/home/ziggi/Projects/cworker/data" +#define APP_DATABASEDIR "/dat2/home/ziggi/projects/cworker/data" /* location of libs */ -#define APP_LIBDIR "/home/ziggi/Projects/cworker/lib" +#define APP_LIBDIR "/dat2/home/ziggi/projects/cworker/lib" /* location of ${PACKAGE} logdir */ -#define APP_LOGDIR "/home/ziggi/Projects/cworker/log" +#define APP_LOGDIR "/dat2/home/ziggi/projects/cworker/log" /* location of pid file */ -#define APP_RUNDIR "/home/ziggi/Projects/cworker/run" +#define APP_RUNDIR "/dat2/home/ziggi/projects/cworker/run" /* effective user */ #define APP_USER "ziggi" @@ -57,6 +57,9 @@ to 0 otherwise. */ #define HAVE_MALLOC 1 +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + /* Define to 1 if you have the `memset' function. */ #define HAVE_MEMSET 1 @@ -75,9 +78,6 @@ /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_STDIO_H 1 - /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 @@ -155,9 +155,7 @@ /* Define to the version of this package. */ #define PACKAGE_VERSION "0.0.1" -/* Define to 1 if all of the C90 standard headers exist (not just the ones - required in a freestanding environment). This macro is provided for - backward compatibility; new code need not use it. */ +/* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define to 1 if your declares `struct tm'. */ @@ -175,7 +173,7 @@ /* Define to `int' if does not define. */ /* #undef mode_t */ -/* Define as a signed integer type capable of holding a process identifier. */ +/* Define to `int' if does not define. */ /* #undef pid_t */ /* Define to `int' if does not define. */ diff --git a/defines.h.in b/defines.h.in index c31d4f3..c842977 100644 --- a/defines.h.in +++ b/defines.h.in @@ -56,6 +56,9 @@ to 0 otherwise. */ #undef HAVE_MALLOC +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET @@ -74,9 +77,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H -/* Define to 1 if you have the header file. */ -#undef HAVE_STDIO_H - /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H @@ -154,9 +154,7 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define to 1 if all of the C90 standard headers exist (not just the ones - required in a freestanding environment). This macro is provided for - backward compatibility; new code need not use it. */ +/* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if your declares `struct tm'. */ @@ -174,7 +172,7 @@ /* Define to `int' if does not define. */ #undef mode_t -/* Define as a signed integer type capable of holding a process identifier. */ +/* Define to `int' if does not define. */ #undef pid_t /* Define to `int' if does not define. */