diff --git a/Makefile b/Makefile index cc3341c..b606a42 100644 --- a/Makefile +++ b/Makefile @@ -237,20 +237,20 @@ 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} /dat2/Projects/cworker/missing aclocal +ACLOCAL = ${SHELL} /dat2/home/ziggi/Projects/cworker/missing aclocal AMTAR = $${TAR-tar} AM_DEFAULT_VERBOSITY = 1 -APP_CACHEDIR = /dat2/Projects/cworker/cache -APP_CONFIGDIR = /dat2/Projects/cworker/ -APP_DATABASEDIR = /dat2/Projects/cworker/data -APP_LIBDIR = /dat2/Projects/cworker/lib -APP_LOGDIR = /dat2/Projects/cworker/log -APP_RUNDIR = /dat2/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} /dat2/Projects/cworker/missing autoconf -AUTOHEADER = ${SHELL} /dat2/Projects/cworker/missing autoheader -AUTOMAKE = ${SHELL} /dat2/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 AWK = gawk CC = clang CCDEPMODE = depmode=none @@ -281,12 +281,12 @@ 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} /dat2/Projects/cworker/missing makeinfo +MAKEINFO = ${SHELL} /dat2/home/ziggi/Projects/cworker/missing makeinfo MANIFEST_TOOL = : MKDIR_P = /bin/mkdir -p NM = /bin/nm -B @@ -310,10 +310,10 @@ SHELL = /bin/bash STRIP = strip VALGRIND = /bin/valgrind VERSION = 0.0.1 -abs_builddir = /dat2/Projects/cworker -abs_srcdir = /dat2/Projects/cworker -abs_top_builddir = /dat2/Projects/cworker -abs_top_srcdir = /dat2/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,13 +322,13 @@ am__leading_dot = . am__quote = am__tar = $${TAR-tar} chof - "$$tardir" am__untar = $${TAR-tar} xf - -app_cachedir = /dat2/Projects/cworker/cache -app_configdir = /dat2/Projects/cworker/ -app_databasedir = /dat2/Projects/cworker/data -app_libdir = /dat2/Projects/cworker/lib -app_logdir = /dat2/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 = /dat2/Projects/cworker/run +app_rundir = /dat2/home/ziggi/Projects/cworker/run app_user = ziggi bindir = ${exec_prefix}/bin build = x86_64-pc-linux-gnu @@ -350,7 +350,7 @@ host_vendor = pc htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info -install_sh = ${SHELL} /dat2/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 diff --git a/clib/jblock.c b/clib/jblock.c index 326ba00..6bc154c 100644 --- a/clib/jblock.c +++ b/clib/jblock.c @@ -56,6 +56,31 @@ static bool jblock_keyexists(jblock_t* jb, char* key) { return false; } +static bool jblock_arrexists(jblock_t* jb, char* key, int type) { + for (int i = 0; i < jb->kvsize; i++) { + if (strcmp(key, jb->kvarr[i].key) == 0 && jb->kvarr[i].type == type) { + return true; + } + } + return false; +} + + +int jblock_addarrint(jblock_t* jb, char* key, int64_t val) { + if (jblock_keyexists(jb, key)) { + } + + + + if (jblock_checkalloc(jb) == NULL) { + return -1; + } + jb->kvarr[jb->kvsize].key = strcopy(key); + jb->kvarr[jb->kvsize].num = val; + jb->kvarr[jb->kvsize].type = JKVTYPE_INTARR; + return ++jb->kvsize; +} + int jblock_addint(jblock_t* jb, char* key, int64_t val) { if (jblock_keyexists(jb, key)) { diff --git a/clib/jparser.c b/clib/jparser.c index b8da387..4feb0b1 100644 --- a/clib/jparser.c +++ b/clib/jparser.c @@ -41,7 +41,7 @@ int jparser_parse(jparser_t * parser) { char* key = ""; while ((type = jlexer_gettoken(lex, token)) != JLEXTOK_END) { - printf("pos %d tok 0x%02x: %s\n", pos, type, token); + //printf("pos %d tok 0x%02x: %s\n", pos, type, token); switch (pos) { // POS 0 case 0:{ @@ -111,7 +111,8 @@ int jparser_parse(jparser_t * parser) { jkval_t* kv = &(parser->kvalarr[parser->kvalsize]); - kv->key = key; + kv->key = strcopy(key); + log_debug("parser added key %s", kv->key); if (type == JLEXTOK_NUMB) { kv->type = JVALTYPE_NUM; char* eptr = NULL; @@ -161,6 +162,7 @@ int jparser_bind(jparser_t* parser, int type, char* key, void* ref) { for (int i = 0; i < parser->kvalsize; i++) { jkval_t* kv = &(parser->kvalarr[i]); + log_debug("find equal keys: kv->key = %s, key = %s", kv->key, key); if (strcmp(kv->key, key) == 0) { if (kv->type == JVALTYPE_STR) { *(char**)(ref) = strcopy(kv->str); diff --git a/config.h b/config.h index ffdf1a0..fef786a 100644 --- a/config.h +++ b/config.h @@ -2,8 +2,8 @@ #ifndef CONFIG_H_QWER #define CONFIG_H_QWER -static const char *srv_runpath = "/dat2/Projects/cworker/run/cworker.pid"; -static const char *srv_logpath = "/dat2/Projects/cworker/log/cworker.log"; -static const char *srv_configpath = "/dat2/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 84205c4..3bb3bb9 100755 --- a/config.status +++ b/config.status @@ -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,17 +427,17 @@ $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='/dat2/Projects/cworker' +ac_pwd='/dat2/home/ziggi/Projects/cworker' srcdir='.' INSTALL='/bin/install -c' MKDIR_P='/bin/mkdir -p' @@ -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=: ;; @@ -514,7 +521,7 @@ fi if $ac_cs_recheck; then set X /bin/bash './configure' '--enable-devel-mode' $ac_configure_extra_args --no-create --no-recursion shift - \printf "%s\n" "running CONFIG_SHELL=/bin/bash $*" >&6 + $as_echo "running CONFIG_SHELL=/bin/bash $*" >&6 CONFIG_SHELL='/bin/bash' export CONFIG_SHELL exec "$@" @@ -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 # @@ -717,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. @@ -756,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 @@ -814,20 +821,20 @@ S["am__EXEEXT_FALSE"]="" S["am__EXEEXT_TRUE"]="#" S["LTLIBOBJS"]="" S["app_name"]="cworker" -S["app_cachedir"]="/dat2/Projects/cworker/cache" -S["APP_CACHEDIR"]="/dat2/Projects/cworker/cache" -S["app_databasedir"]="/dat2/Projects/cworker/data" -S["APP_DATABASEDIR"]="/dat2/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"]="/dat2/Projects/cworker/lib" -S["APP_LIBDIR"]="/dat2/Projects/cworker/lib" -S["app_rundir"]="/dat2/Projects/cworker/run" -S["APP_RUNDIR"]="/dat2/Projects/cworker/run" -S["app_logdir"]="/dat2/Projects/cworker/log" -S["APP_LOGDIR"]="/dat2/Projects/cworker/log" -S["app_configdir"]="/dat2/Projects/cworker/" -S["APP_CONFIGDIR"]="/dat2/Projects/cworker/" +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"]="#" @@ -837,7 +844,7 @@ 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"]="" @@ -856,8 +863,6 @@ S["ac_ct_DUMPBIN"]="" S["DUMPBIN"]="" S["LD"]="/bin/ld -m elf_x86_64" S["FGREP"]="/bin/grep -F" -S["EGREP"]="/bin/grep -E" -S["GREP"]="/bin/grep" S["SED"]="/bin/sed" S["host_os"]="linux-gnu" S["host_vendor"]="pc" @@ -871,6 +876,9 @@ S["LIBTOOL"]="$(SHELL) $(top_builddir)/libtool" S["HAVE_VALGRIND_FALSE"]="" S["HAVE_VALGRIND_TRUE"]="#" 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" @@ -901,12 +909,12 @@ S["mkdir_p"]="$(MKDIR_P)" S["MKDIR_P"]="/bin/mkdir -p" S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s" S["STRIP"]="strip" -S["install_sh"]="${SHELL} /dat2/Projects/cworker/install-sh" -S["MAKEINFO"]="${SHELL} /dat2/Projects/cworker/missing makeinfo" -S["AUTOHEADER"]="${SHELL} /dat2/Projects/cworker/missing autoheader" -S["AUTOMAKE"]="${SHELL} /dat2/Projects/cworker/missing automake" -S["AUTOCONF"]="${SHELL} /dat2/Projects/cworker/missing autoconf" -S["ACLOCAL"]="${SHELL} /dat2/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" +S["AUTOCONF"]="${SHELL} /dat2/home/ziggi/Projects/cworker/missing autoconf" +S["ACLOCAL"]="${SHELL} /dat2/home/ziggi/Projects/cworker/missing aclocal" S["VERSION"]="0.0.1" S["PACKAGE"]="cworker" S["CYGPATH_W"]="echo" @@ -1003,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" @@ -1033,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" @@ -1040,13 +1049,13 @@ D["HAVE_MEMSET"]=" 1" D["HAVE_MKDIR"]=" 1" D["HAVE_SETLOCALE"]=" 1" D["HAVE_SOCKET"]=" 1" -D["APP_CONFIGDIR"]=" \"/dat2/Projects/cworker/\"" -D["APP_LOGDIR"]=" \"/dat2/Projects/cworker/log\"" -D["APP_RUNDIR"]=" \"/dat2/Projects/cworker/run\"" -D["APP_LIBDIR"]=" \"/dat2/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"]=" \"/dat2/Projects/cworker/data\"" -D["APP_CACHEDIR"]=" \"/dat2/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 = "" } @@ -1122,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 @@ -1130,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 @@ -1157,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 @@ -1181,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/ ;; @@ -1242,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 @@ -1292,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" @@ -1310,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 @@ -1343,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 @@ -1363,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 @@ -1390,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 @@ -1402,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 @@ -1424,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 @@ -1449,8 +1458,8 @@ 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 '--disable-dependency-tracking' option to at least be able to build @@ -1992,7 +2001,6 @@ _LT_EOF esac - ltmain=$ac_aux_dir/ltmain.sh diff --git a/cworker.c b/cworker.c index 8085094..8146698 100644 --- a/cworker.c +++ b/cworker.c @@ -281,21 +281,21 @@ int cworker_handler(const cworker_t* worker, int socket) { jlexer_init(&lexer, &cache); jparser_init(&parser, &lexer); - //if (jparser_parse(&parser) < 0) { - //log_error("Cannot parse json"); - //err = -1; - //goto exit; - //} + if (jparser_parse(&parser) < 0) { + log_error("Cannot parse json"); + err = -1; + goto exit; + } int64_t id = 0; char* name = "none"; - //if (jparser_bind(&parser, JVALTYPE_NUM, "id", (void *)&id) < 0) { - //log_error("Cannot bind id"); - //} - //if (jparser_bind(&parser, JVALTYPE_STR, "name", (void *)&name) < 0) { - //log_error("Cannot bind name"); - //} + if (jparser_bind(&parser, JVALTYPE_NUM, "id", (void *)&id) < 0) { + log_error("Cannot bind id"); + } + if (jparser_bind(&parser, JVALTYPE_STR, "name", (void *)&name) < 0) { + log_error("Cannot bind name"); + } char* msg = NULL; @@ -305,7 +305,7 @@ int cworker_handler(const cworker_t* worker, int socket) { jblock_init(&jb); jblock_addstr(&jb, "message", msg); jblock_addbool(&jb, "error", false); - jblock_addint(&jb, "id", 12); + jblock_addint(&jb, "id", id); char* jsonstr = NULL; @@ -317,7 +317,7 @@ int cworker_handler(const cworker_t* worker, int socket) { //free(name); free(msg); - //exit: + exit: jparser_destroy(&parser); jlexer_destroy(&lexer); rcache_destroy(&cache); diff --git a/defines.h b/defines.h index f376dd4..600a662 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 "/dat2/Projects/cworker/cache" +#define APP_CACHEDIR "/dat2/home/ziggi/Projects/cworker/cache" /* location of configuration files for ${PACKAGE} */ -#define APP_CONFIGDIR "/dat2/Projects/cworker/" +#define APP_CONFIGDIR "/dat2/home/ziggi/Projects/cworker/" /* location of database dir */ -#define APP_DATABASEDIR "/dat2/Projects/cworker/data" +#define APP_DATABASEDIR "/dat2/home/ziggi/Projects/cworker/data" /* location of libs */ -#define APP_LIBDIR "/dat2/Projects/cworker/lib" +#define APP_LIBDIR "/dat2/home/ziggi/Projects/cworker/lib" /* location of ${PACKAGE} logdir */ -#define APP_LOGDIR "/dat2/Projects/cworker/log" +#define APP_LOGDIR "/dat2/home/ziggi/Projects/cworker/log" /* location of pid file */ -#define APP_RUNDIR "/dat2/Projects/cworker/run" +#define APP_RUNDIR "/dat2/home/ziggi/Projects/cworker/run" /* effective user */ #define APP_USER "ziggi" @@ -76,7 +76,7 @@ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ -#define HAVE_STDIO_H 1 +/* #undef HAVE_STDIO_H */ /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1