diff --git a/.tarball-version b/.tarball-version index e867cc2..ac4a796 100644 --- a/.tarball-version +++ b/.tarball-version @@ -1 +1 @@ -0.14.2 +0.14.3 diff --git a/.version b/.version index e867cc2..ac4a796 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -0.14.2 +0.14.3 diff --git a/ChangeLog b/ChangeLog index 81968d9..7a4df81 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,38 @@ +2012-10-29 The Quarterback Library Release Team + + Bump the library version. + +2012-10-23 Andrew Beekhof + + IPC: Pass the timeout to poll() if the recv function returns EAGAIN + +2012-10-23 Angus Salkeld + + LOG: make the format comparison safe and sane + + LOG: don't break on empty callsites, just ignore them + else we might miss some callsites. + + LOG: use the array callback to register new callsites + + array: add a mechanism to get a callback when a bin is allocated + +2012-10-22 Angus Salkeld + + Solaris based operating systems don't define MSG_NOSIGNAL and SO_NOSIGPIPE. + They return SIGPIPE when send is used with a closed socket. A SIGPIPE handler + must be used or SIGPIPE should be set ignored with SIG_IGN. In this case send + returns -1 instead of a SIGPIPE. The setting to ignore SIGPIPE is global and + should be used only where it is absolutely necessary. + +2012-09-12 Angus Salkeld + + Fix a crash in ptrie if you iterate over the map in the deleted notifier. + +2012-09-11 Angus Salkeld + + Make sure atomic's are initialized (for non-gcc atomic). + 2012-09-10 The Quarterback Library Release Team Fix "make distcheck" diff --git a/Makefile.in b/Makefile.in index 9aa0421..24f48a5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -37,6 +37,23 @@ # along with libqb. If not, see . VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -90,6 +107,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -375,8 +397,11 @@ distclean-libtool: -rm -f libtool config.lt install-dist_docDATA: $(dist_doc_DATA) @$(NORMAL_INSTALL) - test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)" @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -561,13 +586,10 @@ distdir: $(DISTFILES) done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -656,7 +678,7 @@ distcheck: dist *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod a+w $(distdir) + chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) diff --git a/aclocal.m4 b/aclocal.m4 index a3af22d..c950fff 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.11.3 -*- Autoconf -*- +# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, @@ -196,7 +196,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' 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.11.3], [], +m4_if([$1], [1.11.6], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -212,7 +212,7 @@ 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.11.3])dnl +[AM_AUTOMAKE_VERSION([1.11.6])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) diff --git a/build-aux/compile b/build-aux/compile index b1f4749..862a14e 100755 --- a/build-aux/compile +++ b/build-aux/compile @@ -1,7 +1,7 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-01-04.17; # UTC +scriptversion=2012-03-05.13; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free # Software Foundation, Inc. @@ -79,6 +79,48 @@ func_file_conv () esac } +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () @@ -109,43 +151,34 @@ func_cl_wrapper () ;; esac ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; - -l*) - lib=${1#-l} - found=no - save_IFS=$IFS - IFS=';' - for dir in $lib_path $LIB - do - IFS=$save_IFS - if $shared && test -f "$dir/$lib.dll.lib"; then - found=yes - set x "$@" "$dir/$lib.dll.lib" - break - fi - if test -f "$dir/$lib.lib"; then - found=yes - set x "$@" "$dir/$lib.lib" - break - fi - done - IFS=$save_IFS - - test "$found" != yes && set x "$@" "$lib.lib" + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" shift ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; -L*) - func_file_conv "${1#-L}" - if test -z "$lib_path"; then - lib_path=$file - else - lib_path="$lib_path;$file" - fi - linker_opts="$linker_opts -LIBPATH:$file" + func_cl_dashL "${1#-L}" ;; -static) shared=false diff --git a/build-aux/config.guess b/build-aux/config.guess index 49ba16f..d622a44 100755 --- a/build-aux/config.guess +++ b/build-aux/config.guess @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. -timestamp='2012-01-01' +timestamp='2012-02-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -17,9 +17,7 @@ timestamp='2012-01-01' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -863,6 +861,13 @@ EOF i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -1320,6 +1325,9 @@ EOF i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff --git a/build-aux/config.sub b/build-aux/config.sub index d6b6b3c..c894da4 100755 --- a/build-aux/config.sub +++ b/build-aux/config.sub @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. -timestamp='2012-01-01' +timestamp='2012-02-10' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,9 +21,7 @@ timestamp='2012-01-01' # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -132,6 +130,10 @@ case $maybe_os in os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] @@ -247,6 +249,7 @@ case $basic_machine in # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ + | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ @@ -319,7 +322,7 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | picochip) + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -332,7 +335,10 @@ case $basic_machine in strongarm | thumb | xscale) basic_machine=arm-unknown ;; - + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; xscaleeb) basic_machine=armeb-unknown ;; @@ -355,6 +361,7 @@ case $basic_machine in # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ + | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ diff --git a/build-aux/depcomp b/build-aux/depcomp index bd0ac08..25a39e6 100755 --- a/build-aux/depcomp +++ b/build-aux/depcomp @@ -1,10 +1,10 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2011-12-04.11; # UTC +scriptversion=2012-03-27.16; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# 2011, 2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ scriptversion=2011-12-04.11; # UTC case $1 in '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) @@ -40,8 +40,8 @@ as side-effects. Environment variables: depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. @@ -57,6 +57,12 @@ EOF ;; esac +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' + if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 @@ -102,6 +108,12 @@ if test "$depmode" = msvc7msys; then depmode=msvc7 fi +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what @@ -156,15 +168,14 @@ gcc) ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. +## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory + tr ' ' "$nl" < "$tmpdepfile" | +## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. @@ -203,18 +214,15 @@ sgi) # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the + # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ + tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> "$depfile" + tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ + tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else @@ -226,10 +234,17 @@ sgi) rm -f "$tmpdepfile" ;; +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the + # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` @@ -259,12 +274,11 @@ aix) test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then - # Each line is of the form `foo.o: dependent.h'. + # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. + # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile @@ -275,23 +289,26 @@ aix) ;; icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. + # However on + # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h - # which is wrong. We want: + # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : + # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... - + # tcc 0.9.26 (FIXME still under development at the moment of writing) + # will emit a similar output, but also prepend the continuation lines + # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : @@ -300,15 +317,21 @@ icc) exit $stat fi rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Each line is of the form 'foo.o: dependent.h', + # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" + # '$object: dependent.h' and one to simply 'dependent.h:'. + sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ + < "$tmpdepfile" > "$depfile" + sed ' + s/[ '"$tab"'][ '"$tab"']*/ /g + s/^ *// + s/ *\\*$// + s/^[^:]*: *// + /^$/d + /:$/d + s/$/ :/ + ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; @@ -344,7 +367,7 @@ hp2) done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" - # Add `dependent.h:' lines. + # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// @@ -359,9 +382,9 @@ hp2) tru64) # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. + # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= @@ -407,8 +430,7 @@ tru64) done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi @@ -443,11 +465,11 @@ msvc7) p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g -s/\(.*\)/ \1 \\/p +s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { - s/.*/ / + s/.*/'"$tab"'/ G p }' >> "$depfile" @@ -478,7 +500,7 @@ dashmstdout) shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -498,15 +520,14 @@ dashmstdout) done test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' + # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ + tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" @@ -562,8 +583,7 @@ makedepend) # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ + sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" @@ -583,7 +603,7 @@ cpp) shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -652,8 +672,8 @@ msvisualcpp) sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; diff --git a/configure b/configure index e429674..c61c055 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for libqb 0.14.2. +# Generated by GNU Autoconf 2.68 for libqb 0.14.3. # # Report bugs to . # @@ -570,8 +570,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libqb' PACKAGE_TARNAME='libqb' -PACKAGE_VERSION='0.14.2' -PACKAGE_STRING='libqb 0.14.2' +PACKAGE_VERSION='0.14.3' +PACKAGE_STRING='libqb 0.14.3' PACKAGE_BUGREPORT='quarterback-devel@fedorahosted.org' PACKAGE_URL='' @@ -1353,7 +1353,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libqb 0.14.2 to adapt to many kinds of systems. +\`configure' configures libqb 0.14.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1423,7 +1423,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libqb 0.14.2:";; + short | recursive ) echo "Configuration of libqb 0.14.3:";; esac cat <<\_ACEOF @@ -1545,7 +1545,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libqb configure 0.14.2 +libqb configure 0.14.3 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2319,7 +2319,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libqb $as_me 0.14.2, which was +It was created by libqb $as_me 0.14.3, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -4453,7 +4453,7 @@ fi # Define the identity of the package. PACKAGE='libqb' - VERSION='0.14.2' + VERSION='0.14.3' cat >>confdefs.h <<_ACEOF @@ -19308,7 +19308,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libqb $as_me 0.14.2, which was +This file was extended by libqb $as_me 0.14.3, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -19374,7 +19374,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libqb config.status 0.14.2 +libqb config.status 0.14.3 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/docs/Makefile.in b/docs/Makefile.in index 93b4b8e..fa9b76c 100644 --- a/docs/Makefile.in +++ b/docs/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -35,6 +35,23 @@ # along with libqb. If not, see . VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -77,6 +94,11 @@ am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -300,11 +322,18 @@ clean-libtool: -rm -rf .libs _libs install-man3: $(dist_man_MANS) @$(NORMAL_INSTALL) - test -z "$(man3dir)" || $(MKDIR_P) "$(DESTDIR)$(man3dir)" - @list=''; test -n "$(man3dir)" || exit 0; \ - { for i in $$list; do echo "$$i"; done; \ - l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.3[a-z]*$$/p'; \ + @list1=''; \ + list2='$(dist_man_MANS)'; \ + test -n "$(man3dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.3[a-z]*$$/p'; \ + fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ @@ -336,11 +365,18 @@ uninstall-man3: dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) install-man8: $(dist_man_MANS) @$(NORMAL_INSTALL) - test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)" - @list=''; test -n "$(man8dir)" || exit 0; \ - { for i in $$list; do echo "$$i"; done; \ - l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.8[a-z]*$$/p'; \ + @list1=''; \ + list2='$(dist_man_MANS)'; \ + test -n "$(man8dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.8[a-z]*$$/p'; \ + fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ diff --git a/docs/html.dox b/docs/html.dox index fe29a4a..fc9493c 100644 --- a/docs/html.dox +++ b/docs/html.dox @@ -1,6 +1,6 @@ DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = libqb -PROJECT_NUMBER = 0.14.2 +PROJECT_NUMBER = 0.14.3 OUTPUT_DIRECTORY = . CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English diff --git a/docs/man.dox b/docs/man.dox index cdd001b..8c9a313 100644 --- a/docs/man.dox +++ b/docs/man.dox @@ -1,6 +1,6 @@ DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = libqb -PROJECT_NUMBER = 0.14.2 +PROJECT_NUMBER = 0.14.3 OUTPUT_DIRECTORY = . CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English diff --git a/docs/man3/qbarray.h.3 b/docs/man3/qbarray.h.3 index faa09f4..e5b6aea 100644 --- a/docs/man3/qbarray.h.3 +++ b/docs/man3/qbarray.h.3 @@ -1,4 +1,4 @@ -.TH "qbarray.h" 3 "Mon Sep 10 2012" "Version 0.14.2" "libqb" \" -*- nroff -*- +.TH "qbarray.h" 3 "Mon Oct 29 2012" "Version 0.14.3" "libqb" \" -*- nroff -*- .ad l .nh .SH NAME @@ -23,6 +23,9 @@ This is a dynamic array (it can grow, but without moving memory)\&. .RI "typedef struct qb_array \fBqb_array_t\fP" .br .RI "\fIThis is an opaque data type representing an instance of an array\&. \fP" +.ti -1c +.RI "typedef void(* \fBqb_array_new_bin_cb_fn\fP )(\fBqb_array_t\fP *a, uint32_t bin)" +.br .in -1c .SS "Functions" @@ -52,6 +55,10 @@ This is a dynamic array (it can grow, but without moving memory)\&. .br .RI "\fIGet the number of elements per bin\&. \fP" .ti -1c +.RI "int32_t \fBqb_array_new_bin_cb_set\fP (\fBqb_array_t\fP *a, \fBqb_array_new_bin_cb_fn\fP fn)" +.br +.RI "\fIGet a callback when a new bin is allocated\&. \fP" +.ti -1c .RI "void \fBqb_array_free\fP (\fBqb_array_t\fP *a)" .br .RI "\fIFree all the memory used by the array\&. \fP" @@ -74,6 +81,8 @@ This is a dynamic array (it can grow, but without moving memory)\&. .SH "Typedef Documentation" .PP +.SS "typedef void(* qb_array_new_bin_cb_fn)(\fBqb_array_t\fP *a, uint32_t bin)" + .SS "typedef struct qb_array \fBqb_array_t\fP" .PP @@ -161,6 +170,10 @@ Get an element at a particular index\&. \fBParameters:\fP .RE .PP +.SS "int32_t qb_array_new_bin_cb_set (\fBqb_array_t\fP *a, \fBqb_array_new_bin_cb_fn\fPfn)" + +.PP +Get a callback when a new bin is allocated\&. .SS "size_t qb_array_num_bins_get (\fBqb_array_t\fP *a)" .PP diff --git a/docs/man3/qbatomic.h.3 b/docs/man3/qbatomic.h.3 index 162605c..01b2294 100644 --- a/docs/man3/qbatomic.h.3 +++ b/docs/man3/qbatomic.h.3 @@ -1,4 +1,4 @@ -.TH "qbatomic.h" 3 "Mon Sep 10 2012" "Version 0.14.2" "libqb" \" -*- nroff -*- +.TH "qbatomic.h" 3 "Mon Oct 29 2012" "Version 0.14.3" "libqb" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man3/qbhdb.h.3 b/docs/man3/qbhdb.h.3 index a5a8024..9467513 100644 --- a/docs/man3/qbhdb.h.3 +++ b/docs/man3/qbhdb.h.3 @@ -1,4 +1,4 @@ -.TH "qbhdb.h" 3 "Mon Sep 10 2012" "Version 0.14.2" "libqb" \" -*- nroff -*- +.TH "qbhdb.h" 3 "Mon Oct 29 2012" "Version 0.14.3" "libqb" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man3/qbipc_common.h.3 b/docs/man3/qbipc_common.h.3 index f116b88..e64ed5b 100644 --- a/docs/man3/qbipc_common.h.3 +++ b/docs/man3/qbipc_common.h.3 @@ -1,4 +1,4 @@ -.TH "qbipc_common.h" 3 "Mon Sep 10 2012" "Version 0.14.2" "libqb" \" -*- nroff -*- +.TH "qbipc_common.h" 3 "Mon Oct 29 2012" "Version 0.14.3" "libqb" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man3/qbipcc.h.3 b/docs/man3/qbipcc.h.3 index 92a34d0..b306028 100644 --- a/docs/man3/qbipcc.h.3 +++ b/docs/man3/qbipcc.h.3 @@ -1,4 +1,4 @@ -.TH "qbipcc.h" 3 "Mon Sep 10 2012" "Version 0.14.2" "libqb" \" -*- nroff -*- +.TH "qbipcc.h" 3 "Mon Oct 29 2012" "Version 0.14.3" "libqb" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man3/qbipcs.h.3 b/docs/man3/qbipcs.h.3 index a5f8c59..9114af1 100644 --- a/docs/man3/qbipcs.h.3 +++ b/docs/man3/qbipcs.h.3 @@ -1,4 +1,4 @@ -.TH "qbipcs.h" 3 "Mon Sep 10 2012" "Version 0.14.2" "libqb" \" -*- nroff -*- +.TH "qbipcs.h" 3 "Mon Oct 29 2012" "Version 0.14.3" "libqb" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man3/qblist.h.3 b/docs/man3/qblist.h.3 index a19ae6c..cdeb150 100644 --- a/docs/man3/qblist.h.3 +++ b/docs/man3/qblist.h.3 @@ -1,4 +1,4 @@ -.TH "qblist.h" 3 "Mon Sep 10 2012" "Version 0.14.2" "libqb" \" -*- nroff -*- +.TH "qblist.h" 3 "Mon Oct 29 2012" "Version 0.14.3" "libqb" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man3/qblog.h.3 b/docs/man3/qblog.h.3 index c945f8d..40477af 100644 --- a/docs/man3/qblog.h.3 +++ b/docs/man3/qblog.h.3 @@ -1,4 +1,4 @@ -.TH "qblog.h" 3 "Mon Sep 10 2012" "Version 0.14.2" "libqb" \" -*- nroff -*- +.TH "qblog.h" 3 "Mon Oct 29 2012" "Version 0.14.3" "libqb" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man3/qbloop.h.3 b/docs/man3/qbloop.h.3 index 7935efb..f413e7a 100644 --- a/docs/man3/qbloop.h.3 +++ b/docs/man3/qbloop.h.3 @@ -1,4 +1,4 @@ -.TH "qbloop.h" 3 "Mon Sep 10 2012" "Version 0.14.2" "libqb" \" -*- nroff -*- +.TH "qbloop.h" 3 "Mon Oct 29 2012" "Version 0.14.3" "libqb" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man3/qbmap.h.3 b/docs/man3/qbmap.h.3 index 28806b3..0c58d84 100644 --- a/docs/man3/qbmap.h.3 +++ b/docs/man3/qbmap.h.3 @@ -1,4 +1,4 @@ -.TH "qbmap.h" 3 "Mon Sep 10 2012" "Version 0.14.2" "libqb" \" -*- nroff -*- +.TH "qbmap.h" 3 "Mon Oct 29 2012" "Version 0.14.3" "libqb" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/man3/qbutil.h.3 b/docs/man3/qbutil.h.3 index 1fd5b25..2a5df7c 100644 --- a/docs/man3/qbutil.h.3 +++ b/docs/man3/qbutil.h.3 @@ -1,4 +1,4 @@ -.TH "qbutil.h" 3 "Mon Sep 10 2012" "Version 0.14.2" "libqb" \" -*- nroff -*- +.TH "qbutil.h" 3 "Mon Oct 29 2012" "Version 0.14.3" "libqb" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/examples/Makefile.in b/examples/Makefile.in index 37184ed..b254b96 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -16,6 +16,23 @@ @SET_MAKE@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -107,6 +124,11 @@ SOURCES = $(ipcclient_SOURCES) $(ipcserver_SOURCES) \ DIST_SOURCES = $(ipcclient_SOURCES) $(ipcserver_SOURCES) \ $(mapnotify_SOURCES) $(simplelog_SOURCES) $(tcpclient_SOURCES) \ $(tcpserver_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) diff --git a/include/Makefile.in b/include/Makefile.in index 74926cd..a7a5b76 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -36,6 +36,23 @@ # VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -83,6 +100,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive @@ -477,13 +499,10 @@ distdir: $(DISTFILES) done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ diff --git a/include/qb/Makefile.in b/include/qb/Makefile.in index fe5acbd..94ff5c2 100644 --- a/include/qb/Makefile.in +++ b/include/qb/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -36,6 +36,23 @@ # VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -76,6 +93,11 @@ am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -304,8 +326,11 @@ clean-libtool: -rm -rf .libs _libs install-instHEADERS: $(inst_HEADERS) @$(NORMAL_INSTALL) - test -z "$(instdir)" || $(MKDIR_P) "$(DESTDIR)$(instdir)" @list='$(inst_HEADERS)'; test -n "$(instdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(instdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(instdir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ diff --git a/include/qb/qbarray.h b/include/qb/qbarray.h index b969fd3..d86407e 100644 --- a/include/qb/qbarray.h +++ b/include/qb/qbarray.h @@ -105,6 +105,14 @@ size_t qb_array_num_bins_get(qb_array_t* a); */ size_t qb_array_elems_per_bin_get(qb_array_t* a); + +typedef void (*qb_array_new_bin_cb_fn)(qb_array_t * a, uint32_t bin); + +/** + * Get a callback when a new bin is allocated. + */ +int32_t qb_array_new_bin_cb_set(qb_array_t * a, qb_array_new_bin_cb_fn fn); + /** * Free all the memory used by the array. * @param a array instance. diff --git a/lib/Makefile.am b/lib/Makefile.am index 6d1ba43..f049d30 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -59,7 +59,7 @@ lib_LTLIBRARIES = libqb.la # it as -version-info 2:0:0. This release has a new, but backwards # incompatible interface. # -libqb_la_LDFLAGS = -version-info 14:2:14 +libqb_la_LDFLAGS = -version-info 14:3:14 source_to_lint = util.c hdb.c ringbuffer.c ringbuffer_helper.c \ array.c loop.c loop_poll.c loop_job.c \ diff --git a/lib/Makefile.in b/lib/Makefile.in index e292f6f..6087d40 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -38,6 +38,23 @@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -161,6 +178,11 @@ am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(libqb_la_SOURCES) DIST_SOURCES = $(am__libqb_la_SOURCES_DIST) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac DATA = $(pkgconfig_DATA) HEADERS = $(noinst_HEADERS) ETAGS = etags @@ -338,7 +360,7 @@ lib_LTLIBRARIES = libqb.la # it as -version-info 2:0:0. This release has a new, but backwards # incompatible interface. # -libqb_la_LDFLAGS = -version-info 14:2:14 +libqb_la_LDFLAGS = -version-info 14:3:14 source_to_lint = util.c hdb.c ringbuffer.c ringbuffer_helper.c \ array.c loop.c loop_poll.c loop_job.c \ loop_timerlist.c ipcc.c ipcs.c ipc_shm.c ipc_us.c \ @@ -398,7 +420,6 @@ libqb.pc: $(top_builddir)/config.status $(srcdir)/libqb.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ @@ -406,6 +427,8 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) else :; fi; \ done; \ test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } @@ -497,8 +520,11 @@ clean-libtool: -rm -rf .libs _libs install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) - test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ diff --git a/lib/array.c b/lib/array.c index d091f17..09c2ed5 100644 --- a/lib/array.c +++ b/lib/array.c @@ -36,6 +36,7 @@ struct qb_array { size_t num_bins; size_t autogrow_elements; qb_thread_lock_t *grow_lock; + qb_array_new_bin_cb_fn new_bin_cb; }; qb_array_t * @@ -125,6 +126,7 @@ qb_array_index(struct qb_array * a, int32_t idx, void **element_out) assert(b < MAX_BINS); if (b >= a->num_bins || a->bin[b] == NULL) { + int32_t bin_alloced = QB_FALSE; (void)qb_thread_lock(a->grow_lock); @@ -139,9 +141,13 @@ qb_array_index(struct qb_array * a, int32_t idx, void **element_out) if (a->bin[b] == NULL) { goto unlock_error; } + bin_alloced = QB_TRUE; } (void)qb_thread_unlock(a->grow_lock); + if (bin_alloced && a->new_bin_cb) { + a->new_bin_cb(a, b); + } } elem = ELEM_NUM_GET(idx); @@ -158,6 +164,16 @@ unlock_error: return rc; } +int32_t +qb_array_new_bin_cb_set(struct qb_array * a, qb_array_new_bin_cb_fn fn) +{ + if (a == NULL) { + return -EINVAL; + } + a->new_bin_cb = fn; + return 0; +} + size_t qb_array_num_bins_get(struct qb_array * a) { diff --git a/lib/ipc_us.c b/lib/ipc_us.c index 8690de2..6e840a8 100644 --- a/lib/ipc_us.c +++ b/lib/ipc_us.c @@ -74,14 +74,36 @@ struct ipc_auth_ugp { static int32_t qb_ipcs_us_connection_acceptor(int fd, int revent, void *data); static int32_t qb_ipc_us_fc_get(struct qb_ipc_one_way *one_way); -#ifdef SO_NOSIGPIPE static void socket_nosigpipe(int32_t s) { +#ifdef SO_NOSIGPIPE int32_t on = 1; setsockopt(s, SOL_SOCKET, SO_NOSIGPIPE, (void *)&on, sizeof(on)); +#endif /* SO_NOSIGPIPE */ +} + + +enum qb_sigpipe_ctl { + QB_SIGPIPE_IGNORE, + QB_SIGPIPE_DEFAULT, +}; + +static void sigpipe_ctl(enum qb_sigpipe_ctl ctl) +{ +#if !defined(MSG_NOSIGNAL) && !defined(SO_NOSIGPIPE) + struct sigaction act; + struct sigaction oact; + + act.sa_handler = SIG_IGN; + + if (ctl == QB_SIGPIPE_IGNORE) { + sigaction(SIGPIPE, &act, &oact); + } else { + sigaction(SIGPIPE, &oact, NULL); + } +#endif /* !MSG_NOSIGNAL && !defined(SO_NOSIGPIPE) */ } -#endif #ifndef MSG_NOSIGNAL #define MSG_NOSIGNAL 0 @@ -94,6 +116,8 @@ qb_ipc_us_send(struct qb_ipc_one_way *one_way, const void *msg, size_t len) int32_t processed = 0; char *rbuf = (char *)msg; + sigpipe_ctl(QB_SIGPIPE_IGNORE); + retry_send: result = send(one_way->u.us.sock, &rbuf[processed], @@ -104,6 +128,7 @@ retry_send: if (errno == EAGAIN && processed > 0) { goto retry_send; } else { + sigpipe_ctl(QB_SIGPIPE_DEFAULT); return -errno; } } @@ -112,6 +137,9 @@ retry_send: if (processed != len) { goto retry_send; } + + sigpipe_ctl(QB_SIGPIPE_DEFAULT); + if (one_way->type == QB_IPC_SOCKET) { struct ipc_us_control *ctl = NULL; ctl = (struct ipc_us_control *)one_way->u.us.shared_data; @@ -132,6 +160,8 @@ qb_ipc_us_sendv(struct qb_ipc_one_way *one_way, const struct iovec *iov, int32_t iov_p = 0; char *rbuf = (char *)iov[iov_p].iov_base; + sigpipe_ctl(QB_SIGPIPE_IGNORE); + retry_send: result = send(one_way->u.us.sock, &rbuf[processed], @@ -143,6 +173,7 @@ retry_send: (processed > 0 || iov_p > 0)) { goto retry_send; } else { + sigpipe_ctl(QB_SIGPIPE_DEFAULT); return -errno; } } @@ -159,6 +190,9 @@ retry_send: } else { goto retry_send; } + + sigpipe_ctl(QB_SIGPIPE_DEFAULT); + if (one_way->type == QB_IPC_SOCKET) { struct ipc_us_control *ctl; ctl = (struct ipc_us_control *)one_way->u.us.shared_data; @@ -175,6 +209,8 @@ qb_ipc_us_recv_msghdr(int32_t s, struct msghdr *hdr, char *msg, size_t len) int32_t result; int32_t processed = 0; + sigpipe_ctl(QB_SIGPIPE_IGNORE); + retry_recv: hdr->msg_iov->iov_base = &msg[processed]; hdr->msg_iov->iov_len = len - processed; @@ -184,9 +220,11 @@ retry_recv: goto retry_recv; } if (result == -1) { + sigpipe_ctl(QB_SIGPIPE_DEFAULT); return -errno; } if (result == 0) { + sigpipe_ctl(QB_SIGPIPE_DEFAULT); qb_util_log(LOG_DEBUG, "recv(fd %d) got 0 bytes assuming ENOTCONN", s); return -ENOTCONN; @@ -196,6 +234,7 @@ retry_recv: if (processed != len) { goto retry_recv; } + sigpipe_ctl(QB_SIGPIPE_DEFAULT); assert(processed == len); return processed; @@ -257,6 +296,8 @@ qb_ipc_us_recv(struct qb_ipc_one_way * one_way, int32_t to_recv = len; char *data = msg; + sigpipe_ctl(QB_SIGPIPE_IGNORE); + retry_recv: result = recv(one_way->u.us.sock, &data[processed], to_recv, MSG_NOSIGNAL | MSG_WAITALL); @@ -266,16 +307,19 @@ retry_recv: (processed > 0 || timeout == -1)) { goto retry_recv; } else if (errno == ECONNRESET || errno == EPIPE) { + sigpipe_ctl(QB_SIGPIPE_DEFAULT); qb_util_perror(LOG_DEBUG, "recv(fd %d) converting to ENOTCONN", one_way->u.us.sock); return -ENOTCONN; } else { + sigpipe_ctl(QB_SIGPIPE_DEFAULT); return -errno; } } if (result == 0) { + sigpipe_ctl(QB_SIGPIPE_DEFAULT); qb_util_log(LOG_DEBUG, "recv(fd %d) got 0 bytes assuming ENOTCONN", one_way->u.us.sock); @@ -286,6 +330,7 @@ retry_recv: if (processed != len) { goto retry_recv; } + sigpipe_ctl(QB_SIGPIPE_DEFAULT); if (one_way->type == QB_IPC_SOCKET) { struct ipc_us_control *ctl = NULL; ctl = (struct ipc_us_control *)one_way->u.us.shared_data; @@ -310,6 +355,8 @@ qb_ipc_us_recv_at_most(struct qb_ipc_one_way * one_way, struct ipc_us_control *ctl = NULL; struct qb_ipc_request_header *hdr = NULL; + sigpipe_ctl(QB_SIGPIPE_IGNORE); + retry_recv: result = recv(one_way->u.us.sock, &data[processed], to_recv, MSG_NOSIGNAL | MSG_WAITALL); @@ -318,9 +365,11 @@ retry_recv: (processed > 0 || timeout == -1)) { goto retry_recv; } else { + sigpipe_ctl(QB_SIGPIPE_DEFAULT); return -errno; } } else if (result == 0) { + sigpipe_ctl(QB_SIGPIPE_DEFAULT); qb_util_log(LOG_DEBUG, "recv(fd %d) got 0 bytes assuming ENOTCONN", one_way->u.us.sock); @@ -339,6 +388,7 @@ retry_recv: if (to_recv > 0) { goto retry_recv; } + sigpipe_ctl(QB_SIGPIPE_DEFAULT); ctl = (struct ipc_us_control *)one_way->u.us.shared_data; if (ctl) { (void)qb_atomic_int_dec_and_test(&ctl->sent); @@ -358,9 +408,9 @@ qb_ipcc_us_sock_connect(const char *socket_name, int32_t * sock_pt) if (request_fd == -1) { return -errno; } -#ifdef SO_NOSIGPIPE + socket_nosigpipe(request_fd); -#endif /* SO_NOSIGPIPE */ + res = qb_sys_fd_nonblock_cloexec_set(request_fd); if (res < 0) { goto error_connect; @@ -467,6 +517,8 @@ qb_ipcc_us_connect(struct qb_ipcc_connection *c, int32_t fd_hdr; char * shm_ptr; + qb_atomic_init(); + c->needs_sock_for_poll = QB_FALSE; c->funcs.send = qb_ipc_us_send; c->funcs.sendv = qb_ipc_us_sendv; @@ -1110,4 +1162,6 @@ qb_ipcs_us_init(struct qb_ipcs_service *s) s->funcs.q_len_get = qb_ipc_us_q_len_get; s->needs_sock_for_poll = QB_FALSE; + + qb_atomic_init(); } diff --git a/lib/ipcc.c b/lib/ipcc.c index 0abb0e7..703a11a 100644 --- a/lib/ipcc.c +++ b/lib/ipcc.c @@ -225,6 +225,7 @@ qb_ipcc_recv(struct qb_ipcc_connection * c, void *msg_ptr, { int32_t res = 0; int32_t res2 = 0; + int32_t poll_ms = 0; if (c == NULL) { return -EINVAL; } @@ -234,8 +235,9 @@ qb_ipcc_recv(struct qb_ipcc_connection * c, void *msg_ptr, struct qb_ipc_one_way *ow = _response_sock_one_way_get(c); if (ow == NULL) return res; + if (res == -EAGAIN) poll_ms = ms_timeout; - res2 = qb_ipc_us_ready(ow, 0, POLLIN); + res2 = qb_ipc_us_ready(ow, poll_ms, POLLIN); if (res2 < 0) { res = res2; } diff --git a/lib/log.c b/lib/log.c index 128779f..22b1982 100644 --- a/lib/log.c +++ b/lib/log.c @@ -391,21 +391,35 @@ qb_log_callsites_register(struct qb_log_callsite *_start, pthread_rwlock_unlock(&_listlock); if (_custom_filter_fn) { for (cs = sect->start; cs < sect->stop; cs++) { - if (cs->lineno == 0) { - break; + if (cs->lineno > 0) { + _custom_filter_fn(cs); } - _custom_filter_fn(cs); } } + /* qb_log_callsites_dump_sect(sect); */ return 0; } +static void +qb_log_callsites_dump_sect(struct callsite_section *sect) +{ + struct qb_log_callsite *cs; + + printf(" start %p - stop %p\n", sect->start, sect->stop); + printf("filename lineno targets tags\n"); + for (cs = sect->start; cs < sect->stop; cs++) { + if (cs->lineno > 0) { + printf("%12s %6d %16d %16d\n", cs->filename, cs->lineno, + cs->targets, cs->tags); + } + } +} + void qb_log_callsites_dump(void) { struct callsite_section *sect; - struct qb_log_callsite *cs; int32_t l; pthread_rwlock_rdlock(&_listlock); @@ -413,15 +427,7 @@ qb_log_callsites_dump(void) printf("Callsite Database [%d]\n", l); printf("---------------------\n"); qb_list_for_each_entry(sect, &callsite_sections, list) { - printf(" start %p - stop %p\n", sect->start, sect->stop); - printf("filename lineno targets tags\n"); - for (cs = sect->start; cs < sect->stop; cs++) { - if (cs->lineno == 0) { - break; - } - printf("%12s %6d %16d %16d\n", cs->filename, cs->lineno, - cs->targets, cs->tags); - } + qb_log_callsites_dump_sect(sect); } pthread_rwlock_unlock(&_listlock); } @@ -536,11 +542,10 @@ _log_filter_apply(struct callsite_section *sect, struct qb_log_callsite *cs; for (cs = sect->start; cs < sect->stop; cs++) { - if (cs->lineno == 0) { - break; + if (cs->lineno > 0) { + _log_filter_apply_to_cs(cs, t, c, type, text, + high_priority, low_priority); } - _log_filter_apply_to_cs(cs, t, c, type, text, - high_priority, low_priority); } } @@ -646,10 +651,9 @@ qb_log_filter_fn_set(qb_log_filter_fn fn) qb_list_for_each_entry(sect, &callsite_sections, list) { for (cs = sect->start; cs < sect->stop; cs++) { - if (cs->lineno == 0) { - break; + if (cs->lineno > 0) { + _custom_filter_fn(cs); } - _custom_filter_fn(cs); } } return 0; diff --git a/lib/log_dcs.c b/lib/log_dcs.c index e59f57f..6cd6c13 100644 --- a/lib/log_dcs.c +++ b/lib/log_dcs.c @@ -34,7 +34,6 @@ static qb_array_t *lookup_arr = NULL; static qb_array_t *callsite_arr = NULL; static uint32_t callsite_arr_next = 0; -static uint32_t callsite_num_bins = 0; static uint32_t callsite_elems_per_bin = 0; static qb_thread_lock_t *arr_next_lock = NULL; @@ -44,26 +43,17 @@ struct callsite_list { }; static void -_log_register_callsites(void) +_log_register_callsites(qb_array_t * a, uint32_t bin) { struct qb_log_callsite *start; struct qb_log_callsite *stop; - int32_t b; - int32_t rc; - uint32_t num_bins = qb_array_num_bins_get(callsite_arr); - - for (b = callsite_num_bins; b < num_bins; b++) { - /* get the first element in the bin */ - rc = qb_array_index(callsite_arr, - b * callsite_elems_per_bin, + int32_t rc = qb_array_index(callsite_arr, + bin * callsite_elems_per_bin, (void **)&start); - if (rc == 0) { - stop = &start[callsite_elems_per_bin]; - if (qb_log_callsites_register(start, stop) != 0) { - break; - } - } - callsite_num_bins++; + if (rc == 0) { + stop = &start[callsite_elems_per_bin]; + rc = qb_log_callsites_register(start, stop); + assert(rc == 0); } } @@ -74,20 +64,11 @@ _log_dcs_new_cs(const char *function, uint8_t priority, uint32_t lineno, uint32_t tags) { struct qb_log_callsite *cs; - int32_t rc; - int32_t call_register = QB_FALSE; - - if (qb_array_index(callsite_arr, callsite_arr_next, (void **)&cs) < 0) { - rc = qb_array_grow(callsite_arr, - callsite_arr_next + callsite_elems_per_bin / 2); - assert(rc == 0); - rc = qb_array_index(callsite_arr, callsite_arr_next, + int32_t rc = qb_array_index(callsite_arr, + callsite_arr_next++, (void **)&cs); - assert(rc == 0); - assert(cs != NULL); - call_register = QB_TRUE; - } - callsite_arr_next++; + assert(rc == 0); + assert(cs != NULL); cs->function = function; cs->filename = filename; @@ -96,10 +77,6 @@ _log_dcs_new_cs(const char *function, cs->lineno = lineno; cs->tags = tags; - if (call_register) { - _log_register_callsites(); - } - return cs; } @@ -117,6 +94,7 @@ qb_log_dcs_get(int32_t * newly_created, struct callsite_list *csl; const char *safe_filename = filename; const char *safe_function = function; + const char *safe_format = format; if (filename == NULL) { safe_filename = ""; @@ -124,15 +102,18 @@ qb_log_dcs_get(int32_t * newly_created, if (function == NULL) { safe_function = ""; } + if (format == NULL) { + safe_format = ""; + } /* * try the fastest access first (no locking needed) */ rc = qb_array_index(lookup_arr, lineno, (void **)&csl_head); assert(rc == 0); if (csl_head->cs && - format == csl_head->cs->format && priority == csl_head->cs->priority && - strcmp(safe_filename, csl_head->cs->filename) == 0) { + strcmp(safe_filename, csl_head->cs->filename) == 0 && + strcmp(safe_format, csl_head->cs->format) == 0) { return csl_head->cs; } /* @@ -140,7 +121,7 @@ qb_log_dcs_get(int32_t * newly_created, */ (void)qb_thread_lock(arr_next_lock); if (csl_head->cs == NULL) { - csl_head->cs = _log_dcs_new_cs(safe_function, safe_filename, format, + csl_head->cs = _log_dcs_new_cs(safe_function, safe_filename, safe_format, priority, lineno, tags); cs = csl_head->cs; csl_head->next = NULL; @@ -148,8 +129,8 @@ qb_log_dcs_get(int32_t * newly_created, } else { for (csl = csl_head; csl; csl = csl->next) { assert(csl->cs->lineno == lineno); - if (format == csl->cs->format && - priority == csl->cs->priority && + if (priority == csl->cs->priority && + strcmp(safe_format, csl_head->cs->format) == 0 && strcmp(safe_filename, csl->cs->filename) == 0) { cs = csl->cs; break; @@ -162,7 +143,7 @@ qb_log_dcs_get(int32_t * newly_created, if (csl == NULL) { goto cleanup; } - csl->cs = _log_dcs_new_cs(safe_function, safe_filename, format, + csl->cs = _log_dcs_new_cs(safe_function, safe_filename, safe_format, priority, lineno, tags); csl->next = NULL; csl_last->next = csl; @@ -179,18 +160,16 @@ cleanup: void qb_log_dcs_init(void) { - lookup_arr = qb_array_create_2(16, sizeof(struct callsite_list), 1); + int32_t rc; - /* - * this needs to be a non-auto-growing array, as we want to know when - * a new bin gets created so we can call qb_log_callsites_register(). - */ - callsite_arr = qb_array_create(16, sizeof(struct qb_log_callsite)); + lookup_arr = qb_array_create_2(16, sizeof(struct callsite_list), 1); + callsite_arr = qb_array_create_2(16, sizeof(struct qb_log_callsite), 1); arr_next_lock = qb_thread_lock_create(QB_THREAD_LOCK_SHORT); callsite_elems_per_bin = qb_array_elems_per_bin_get(callsite_arr); - _log_register_callsites(); + rc = qb_array_new_bin_cb_set(callsite_arr, _log_register_callsites); + assert(rc == 0); } void diff --git a/lib/ringbuffer.c b/lib/ringbuffer.c index af45174..6a1ac86 100644 --- a/lib/ringbuffer.c +++ b/lib/ringbuffer.c @@ -164,6 +164,7 @@ qb_rb_open(const char *name, size_t size, uint32_t flags, qb_util_log(LOG_ERR, "couldn't create mmap for header"); goto cleanup_hdr; } + qb_atomic_init(); rb->flags = flags; diff --git a/lib/trie.c b/lib/trie.c index 7a05c68..4dda823 100644 --- a/lib/trie.c +++ b/lib/trie.c @@ -66,6 +66,17 @@ static struct trie_node *trie_new_node(struct trie *t, struct trie_node *parent) #define TRIE_CHAR2INDEX(ch) (126 - ch) #define TRIE_INDEX2CHAR(idx) (126 - idx) + +static int32_t +trie_node_alive(struct trie_node *node) +{ + if (node->value == NULL || + node->refcount <= 0) { + return QB_FALSE; + } + return QB_TRUE; +} + static struct trie_node * trie_node_next(struct trie_node *node, struct trie_node *root, int all) { @@ -86,7 +97,7 @@ keep_going: } } if (n) { - if (all || n->value) { + if (all || trie_node_alive(n)) { return n; } else { c = n; @@ -112,7 +123,7 @@ keep_going: } while (n == NULL && p != root); if (n) { - if (all || n->value) { + if (all || trie_node_alive(n)) { return n; } if (n == root) { @@ -421,7 +432,7 @@ trie_node_ref(struct trie *t, struct trie_node *node) static void trie_node_deref(struct trie *t, struct trie_node *node) { - if (node->value == NULL) { + if (!trie_node_alive(node)) { return; } node->refcount--; diff --git a/tests/Makefile.in b/tests/Makefile.in index e48bd09..3f60d6f 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -16,6 +16,23 @@ @SET_MAKE@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -272,6 +289,11 @@ DIST_SOURCES = $(am__array_test_SOURCES_DIST) \ $(am__loop_test_SOURCES_DIST) $(am__map_test_SOURCES_DIST) \ $(am__rb_test_SOURCES_DIST) $(rbreader_SOURCES) \ $(rbwriter_SOURCES) $(am__util_test_SOURCES_DIST) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac ETAGS = etags CTAGS = ctags am__tty_colors = \ diff --git a/tests/check_map.c b/tests/check_map.c index df3008f..0f064ac 100644 --- a/tests/check_map.c +++ b/tests/check_map.c @@ -45,6 +45,51 @@ static void *notified_new_value = NULL; static void *notified_user_data = NULL; static int32_t notified_event = 0; static int32_t notified_event_prev = 0; +static int32_t notified_events = 0; + +static void +my_map_notification_iter(uint32_t event, + char* key, void* old_value, + void* value, void* user_data) +{ + const char *p; + void *data; + qb_map_t *m = (qb_map_t *)user_data; + qb_map_iter_t *it = qb_map_iter_create(m); + + notified_events++; + + for (p = qb_map_iter_next(it, &data); p; p = qb_map_iter_next(it, &data)) { + printf("%s > %s\n", p, (char*) data); + } + qb_map_iter_free(it); +} + +/* + * create some entries + * add a notifier + * delete an entry + * in the notifier iterate over the map. + */ +static void +test_map_notifications_iter(qb_map_t *m) +{ + int i; + + qb_map_put(m, "k1", "one"); + qb_map_put(m, "k12", "two"); + qb_map_put(m, "k34", "three"); + ck_assert_int_eq(qb_map_count_get(m), 3); + + notified_events = 0; + i = qb_map_notify_add(m, NULL, my_map_notification_iter, + (QB_MAP_NOTIFY_DELETED | + QB_MAP_NOTIFY_RECURSIVE), m); + ck_assert_int_eq(i, 0); + qb_map_rm(m, "k12"); + ck_assert_int_eq(notified_events, 1); + ck_assert_int_eq(qb_map_count_get(m), 2); +} static void test_map_simple(qb_map_t *m, const char *name) @@ -729,6 +774,8 @@ START_TEST(test_trie_notifications) test_map_notifications_prefix(m); m = qb_trie_create(); test_map_notifications_free(m); + m = qb_trie_create(); + test_map_notifications_iter(m); } END_TEST diff --git a/tools/Makefile.in b/tools/Makefile.in index e055e7b..d6aeed8 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -16,6 +16,23 @@ @SET_MAKE@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -85,6 +102,11 @@ am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(qb_blackbox_SOURCES) DIST_SOURCES = $(qb_blackbox_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -282,8 +304,11 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ + fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \