From f531d06a9d64d627034c2220769c1af63fb72297 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 9 Jun 2019 14:18:01 +0200 Subject: [PATCH] fix gnunet-bugreport output issues --- contrib/scripts/gnunet-bugreport | 221 +++++++++++++++++---------- src/gns/Makefile.am | 11 +- src/gns/gnunet-gns-proxy-setup-ca.in | 2 +- src/include/gnunet_pq_lib.h | 142 ++++++++--------- 4 files changed, 222 insertions(+), 154 deletions(-) diff --git a/contrib/scripts/gnunet-bugreport b/contrib/scripts/gnunet-bugreport index 0e268bba7..a62ee107f 100755 --- a/contrib/scripts/gnunet-bugreport +++ b/contrib/scripts/gnunet-bugreport @@ -59,7 +59,7 @@ awk_check() gcc_check() { - TEST=`$WHICH gcc 2>/dev/null` + TEST=`$WHICH gcc | grep -v "not found" 2>/dev/null` if test -n "$TEST"; then VERS=`gcc --version 2>/dev/null | head -n 1` infomsg "gcc : $VERS" @@ -74,7 +74,7 @@ gcc_check() cc_check() { - TEST=`$WHICH cc 2>/dev/null` + TEST=`$WHICH cc | grep -v "not found" 2>/dev/null` if test -n "$TEST"; then VERS=`cc --version 2>/dev/null | head -n 1` infomsg "cc : $VERS" @@ -85,7 +85,7 @@ cc_check() cplusplus_check() { - TEST=`$WHICH c++ 2>/dev/null` + TEST=`$WHICH c++ | grep -v "not found" 2>/dev/null` if test -n "$TEST"; then VERS=`c++ --version 2>/dev/null | head -n 1` infomsg "c++ : $VERS" @@ -96,18 +96,19 @@ cplusplus_check() gmake_check() { - TEST=`$WHICH gmake 2>/dev/null` + TEST=`$WHICH gmake | grep -v "not found" 2>/dev/null` if test -n "$TEST" ; then - gmake --version 2>/dev/null |\ + VER=`gmake --version 2>/dev/null |\ awk -F, '{print $1}' |\ - awk '/GNU Make/{print "GNU gmake :",$NF}' + awk '/GNU Make/{,$NF}'` + infomsg "gmake : $VER" else - # FIX this test. TEST=`make --version 2>/dev/null` if test -n "$TEST"; then - make --version 2>/dev/null |\ + VER=`make --version 2>/dev/null |\ awk -F, '{print $1}' |\ - awk '/GNU Make/{print "gmake :",$NF}' + awk '/GNU Make/{print $NF}'` + infomsg "gmake : $VER" else warningmsg "gmake : Not Found" fi @@ -126,15 +127,15 @@ make_check() autoconf_check() { - TEST=`$WHICH autoconf 2>/dev/null` + TEST=`$WHICH autoconf | grep -v "not found" 2>/dev/null` if test -n "$TEST"; then autoconf --version |\ head -n 1 |\ awk '{\ if (length($4) == 0) {\ - print "autoconf : "$3\ + print " INFO: autoconf : "$3\ } else {\ - print "autoconf : "$4\ + print " INFO: autoconf : "$4\ }}' else warningmsg "autoconf : Not Found" @@ -143,11 +144,10 @@ autoconf_check() automake_check() { - TEST=`$WHICH automake 2>/dev/null` + TEST=`$WHICH automake | grep -v "not found" 2>/dev/null` if test -n "$TEST"; then - automake --version 2>/dev/null |\ - head -n 1 |\ - awk '{print "automake : "$4}' + VER=`automake --version 2>/dev/null | head -n 1 | awk '{print $4}'` + infomsg "automake : $VER" else warningmsg "automake : Not Found" fi @@ -156,11 +156,10 @@ automake_check() # TODO: More libtool variants. libtool_check() { - TEST=`$WHICH libtool 2>/dev/null` + TEST=`$WHICH libtoolize | grep -v "not found" 2>/dev/null` if test -n "$TEST"; then - libtool --version 2>/dev/null |\ - head -n 1 |\ - awk '{print "libtool : "$4}' + VER=`libtoolize --version 2>/dev/null | head -n 1 | awk '{print $4}'` + infomsg "libtool : $VER" else warningmsg "libtool : Not Found" fi @@ -168,11 +167,10 @@ libtool_check() libextractor_check() { - TEST=`$WHICH extract 2>/dev/null` + TEST=`$WHICH extract | grep -v "not found" 2>/dev/null` if test -n "$TEST"; then - extract -v 2>/dev/null |\ - head -n 1 |\ - awk '{print "libextractor : "$2}' + VER=`extract -v 2>/dev/null | head -n 1 | awk '{print $2}'` + infomsg "libextractor : $VER" else warningmsg "libextractor : Not Found" fi @@ -181,8 +179,8 @@ libextractor_check() gnunet08_check() { if test -x gnunetd; then - gnunetd -v | sed -e "s/v//" 2>/dev/null |\ - awk '{print "GNUnet 0.8 : "$2 (may conflict!)}' + VER=`gnunetd -v | sed -e "s/v//" 2>/dev/null` + warningmsg "GNUnet 0.8 : $VER (may conflict!)" else infomsg "GNUnet 0.8 : Not Found (good)" fi @@ -190,21 +188,42 @@ gnunet08_check() gnunet09x_check() { - TEST=`$WHICH gnunet-arm 2>/dev/null` + TEST=`$WHICH gnunet-arm | grep -v "not found" 2>/dev/null` if test -n "$TEST"; then - gnunet-arm -v | sed -e "s/v//" 2>/dev/null |\ - awk '{print "GNUnet 0.9 : "$2}' + VER=`gnunet-arm -v | sed -e "s/v//" 2>/dev/null | awk '{print $2}'` + VER9=`echo $VER | grep ^0\.9\.` + if test -n "$VER9"; then + warningmsg "GNUnet 0.9 : $VER" + else + infomsg "GNUnet 0.9 : Not Found (good)" + fi else infomsg "GNUnet 0.9 : Not Found (good)" fi } +gnunet010x_check() +{ + TEST=`$WHICH gnunet-arm | grep -v "not found" 2>/dev/null` + if test -n "$TEST"; then + VER=`gnunet-arm -v | sed -e "s/v//" 2>/dev/null | awk '{print $2}'` + VER9=`echo $VER | grep ^0\.10\.` + if test -n "$VER10"; then + warningmsg "GNUnet 0.10 : $VER" + else + infomsg "GNUnet 0.10 : Not Found (good)" + fi + else + infomsg "GNUnet 0.10 : Not Found (good)" + fi +} + gnunet011x_check() { - TEST=`$WHICH gnunet-arm 2>/dev/null` + TEST=`$WHICH gnunet-arm | grep -v "not found" 2>/dev/null` if test -n "$TEST"; then - gnunet-arm -v | sed -e "s/v//" 2>/dev/null |\ - awk '{print "GNUnet 0.11.x : "$2}' + VER=`gnunet-arm -v | sed -e "s/v//" 2>/dev/null | awk '{print $2}'` + infomsg "GNUnet 0.11 : $VER" else warningmsg "GNUnet 0.11.x : Not Found" fi @@ -212,10 +231,10 @@ gnunet011x_check() gcrypt_check() { - TEST=`$WHICH libgcrypt-config 2> /dev/null` + TEST=`$WHICH libgcrypt-config | grep -v "not found" 2> /dev/null` if test -n "$TEST"; then - libgcrypt-config --version 2> /dev/null | \ - awk '{print "libgcrypt : "$1}' + VER=`libgcrypt-config --version 2> /dev/null` + infomsg "libgcrypt : $VER" else warningmsg "libgcrypt : Not Found" fi @@ -223,10 +242,10 @@ gcrypt_check() mysql_check() { - TEST=`$WHICH mysql_config 2> /dev/null` + TEST=`$WHICH mysql_config | grep -v "not found" 2> /dev/null` if test -n "$TEST"; then - mysql_config --version 2> /dev/null | \ - awk '{print "mysql : "$1}' + VER=`mysql_config --version 2> /dev/null` + infomsg "mysql : $VER" else infomsg "mysql : Not Found" fi @@ -234,20 +253,20 @@ mysql_check() pkgconf_check() { - TEST=`$WHICH pkgconf 2> /dev/null` + TEST=`$WHICH pkgconf | grep -v "not found" 2> /dev/null` if test -n "$TEST"; then pkgconf --version 2> /dev/null | awk '{print "pkgconf : "$1}' else - infomsg "pkgconf : Not Found" + infomsg "pkgconf : Not Found" fi } - + pkgconfig_check() { - TEST=`$WHICH pkg-config 2> /dev/null` + TEST=`$WHICH pkg-config | grep -v "not found" 2> /dev/null` if test -n "$TEST"; then - pkg-config --version 2> /dev/null | \ - awk '{print "pkg-config : "$1}' + VER=`pkg-config --version 2> /dev/null | awk '{print $1}'` + infomsg "pkg-config : $VER" else infomsg "pkg-config : Not Found" fi @@ -255,10 +274,10 @@ pkgconfig_check() glib2_check() { - TEST=`$WHICH pkg-config 2> /dev/null` + TEST=`$WHICH pkg-config | grep -v "not found" 2> /dev/null` if test -n "$TEST"; then - pkg-config --modversion glib-2.0 2> /dev/null | \ - awk '{print "glib2 : "$1}' + VER=`pkg-config --modversion glib-2.0 2> /dev/null | awk '{print $1}'` + infomsg "glib2 : $VER" else infomsg "glib2 : Not Found" fi @@ -266,18 +285,52 @@ glib2_check() gtk2_check() { - TEST=`$WHICH pkg-config 2> /dev/null` + TEST=`$WHICH pkg-config | grep -v "not found" 2> /dev/null` if test -n "$TEST"; then - pkg-config --modversion gtk+-2.0 2> /dev/null | \ - awk '{print "gtk2+ : "$1}' + VER=`pkg-config --modversion gtk+-2.0 2> /dev/null | awk '{print $1}'` + if test -n "$VER"; then + infomsg "gtk2+ : $VER" + else + infomsg "gtk2+ : Not found" + fi else infomsg "gtk2+ : Not Found" fi } +gtk3_check() +{ + TEST=`$WHICH pkg-config | grep -v "not found" 2> /dev/null` + if test -n "$TEST"; then + VER=`pkg-config --modversion gtk+-3.0 2> /dev/null | awk '{print $1}'` + if test -n "$VER"; then + infomsg "gtk3+ : $VER" + else + infomsg "gtk3+ : Not found" + fi + else + infomsg "gtk3+ : Not Found" + fi +} + +gtk4_check() +{ + TEST=`$WHICH pkg-config | grep -v "not found" 2> /dev/null` + if test -n "$TEST"; then + VER=`pkg-config --modversion gtk+-4.0 2> /dev/null | awk '{print $1}'` + if test -n "$VER"; then + infomsg "gtk4+ : $VER" + else + infomsg "gtk4+ : Not found" + fi + else + infomsg "gtk4+ : Not Found" + fi +} + gmp_check() { - TEST=`$WHICH dpkg 2> /dev/null` + TEST=`$WHICH dpkg | grep -v "not found" 2> /dev/null` if test -n "$TEST"; then LINES=`dpkg -s libgmp-dev | grep Version | wc -l 2> /dev/null` if test "$LINES" = "1" @@ -287,19 +340,20 @@ gmp_check() else errormsg "GMP : dpkg: libgmp-dev not installed" fi - fi - TEST=`$WHICH rpm 2> /dev/null` - if test -n "$TEST"; then - rpm -q gmp | sed -e "s/gmp-//" 2> /dev/null | \ - awk '{print "GMP : "$1.rpm}' else - warningmsg "GMP : Test not available" + TEST=`$WHICH rpm | grep -v "not found" 2> /dev/null` + if test -n "$TEST"; then + rpm -q gmp | sed -e "s/gmp-//" 2> /dev/null | \ + infomsg "GMP : $1.rpm" + else + warningmsg "GMP : Test not available" + fi fi } libunistring_check() { - TEST=`$WHICH dpkg 2> /dev/null` + TEST=`$WHICH dpkg | grep -v "not found" 2> /dev/null` if test -n "$TEST"; then LINES=`dpkg -s libunistring-dev | grep Version | wc -l` if test "$LINES" = "1" @@ -310,7 +364,7 @@ libunistring_check() errormsg "libunistring : dpkg: libunistring3-dev not installed" fi else - TEST=`$WHICH rpm 2> /dev/null` + TEST=`$WHICH rpm | grep -v "not found" 2> /dev/null` if test -n "$TEST"; then rpm -q unistring | sed -e "s/unistring-//" 2> /dev/null | \ awk '{print "libunistring : "$1.rpm}' @@ -322,7 +376,7 @@ libunistring_check() pkgadd_check() { - TEST=`$WHICH pkg_add 2> /dev/null` + TEST=`$WHICH pkg_add | grep -v "not found" 2> /dev/null` if test -n "$TEST"; then VERSION_UNISTRING=`pkg_info -Nb libunistring` VERSION_GMP=`pkg_info -Nb gmp` @@ -335,10 +389,10 @@ pkgadd_check() gettext_check() { - TEST=`$WHICH gettext 2> /dev/null` + TEST=`$WHICH gettext | grep -v "not found" 2> /dev/null` if test -n "$TEST"; then - gettext --version | head -n1 2> /dev/null | \ - awk '{print "GNU gettext : "$4}' + VER=`gettext --version | head -n1 2> /dev/null | awk '{print $4}'` + infomsg "GNU gettext : $VER" else errormsg "GNU gettext : Not found" fi @@ -348,10 +402,10 @@ gettext_check() # found (yes those systems exist) curl_check() { - TEST=`$WHICH curl-config 2> /dev/null` + TEST=`$WHICH curl-config | grep -v "not found" 2> /dev/null` if test -n "$TEST"; then - curl-config --version | head -n1 2> /dev/null | \ - awk '{print "libcurl : "$2}' + VER=`curl-config --version | head -n1 2> /dev/null | awk '{print $2}'` + infomsg "libcurl : $VER" else infomsg "libcurl : Not found" fi @@ -359,10 +413,10 @@ curl_check() gnurl_check() { - TEST=`$WHICH gnurl-config 2> /dev/null` + TEST=`$WHICH gnurl-config | grep -v "not found" 2> /dev/null` if test -n "$TEST"; then - gnurl-config --version | head -n1 2> /dev/null | \ - awk '{print "libgnurl : "$2}' + VER=`gnurl-config --version | head -n1 2> /dev/null | awk '{print "$2}'` + infomsg "libgnurl : $VER" else infomsg "libgnurl : Not found" fi @@ -370,7 +424,6 @@ gnurl_check() libmicrohttpd_check() { - echo -n "libmicrohttpd : " TMPFILE=`mktemp /tmp/mhd-version-testXXXXXX` cat - >$TMPFILE.c < @@ -381,15 +434,15 @@ int main() return 0; } EOF - - gcc -o $TMPFILE $TMPFILE.c 2> /dev/null && $TMPFILE || echo "Not found" - cc -o $TMPFILE $TMPFILE.c 2> /dev/null && $TMPFILE || echo "Not found" + VER="Not found" + gcc -o $TMPFILE $TMPFILE.c 2> /dev/null && VER=`$TMPFILE` + cc -o $TMPFILE $TMPFILE.c 2> /dev/null && VER=`$TMPFILE` rm -f $TMPFILE $TMPFILE.bin + infomsg "libmicrohttpd : $VER" } glpk_check() { - echo -n "GNU GLPK : " TMPFILE=`mktemp /tmp/glpk-version-testXXXXXX` cat - >$TMPFILE.c < @@ -400,15 +453,15 @@ int main() return 0; } EOF - - gcc -o $TMPFILE $TMPFILE.c 2> /dev/null && $TMPFILE || echo "Not found" - cc -o $TMPFILE $TMPFILE.c 2> /dev/null && $TMPFILE || echo "Not found" + VER="Not found" + gcc -o $TMPFILE $TMPFILE.c 2> /dev/null && VER=`$TMPFILE` + cc -o $TMPFILE $TMPFILE.c 2> /dev/null && VER=`$TMPFILE` rm -f $TMPFILE $TMPFILE.bin + infomsg "GNU GLPK : $VER" } gnutls_check() { - echo -n "GnuTLS : " TMPFILE=`mktemp /tmp/gnutls-version-testXXXXXX` cat - >$TMPFILE.c < @@ -419,16 +472,17 @@ int main() return 0; } EOF - - gcc -o $TMPFILE $TMPFILE.c 2> /dev/null && $TMPFILE || echo "Not found" - cc -o $TMPFILE $TMPFILE.c 2> /dev/null && $TMPFILE || echo "Not found" + VER="Not found" + gcc -o $TMPFILE $TMPFILE.c 2> /dev/null && VER=`$TMPFILE` + cc -o $TMPFILE $TMPFILE.c 2> /dev/null && VER=`$TMPFILE` rm -f $TMPFILE $TMPFILE.bin + infomsg "GnuTLS : $VER" } main() { infomsg "${progname} 0.11.0" - infomsg + infomsg infomsg "Please submit the following" infomsg "information with your bug report:" linemsg @@ -445,6 +499,7 @@ main() libextractor_check gnunet08_check gnunet09x_check + gnunet010x_check gnunet011x_check gcrypt_check mysql_check @@ -452,6 +507,8 @@ main() pkgconfig_check glib2_check gtk2_check + gtk3_check + gtk4_check gmp_check libunistring_check pkgadd_check diff --git a/src/gns/Makefile.am b/src/gns/Makefile.am index bd8311d70..0a68e7cba 100644 --- a/src/gns/Makefile.am +++ b/src/gns/Makefile.am @@ -297,8 +297,17 @@ check_SCRIPTS = \ test_gns_rel_expiration.sh\ test_gns_soa_lookup.sh\ test_gns_revocation.sh\ - test_gns_cname_lookup.sh \ + test_gns_cname_lookup.sh + +if HAVE_MHD +if HAVE_GNUTLS +if HAVE_LIBGNURL +check_SCRIPTS += \ test_proxy.sh +endif +endif +endif + if ENABLE_TEST_RUN if HAVE_SQLITE diff --git a/src/gns/gnunet-gns-proxy-setup-ca.in b/src/gns/gnunet-gns-proxy-setup-ca.in index 184da4853..cd5d8c70f 100644 --- a/src/gns/gnunet-gns-proxy-setup-ca.in +++ b/src/gns/gnunet-gns-proxy-setup-ca.in @@ -61,7 +61,7 @@ statusmsg() infomsg() { - if [ $verbosity = 1 ]; then + if [ x$verbosity = x1 ]; then statusmsg "INFO: $@" fi } diff --git a/src/include/gnunet_pq_lib.h b/src/include/gnunet_pq_lib.h index 492491e94..1734fb94d 100644 --- a/src/include/gnunet_pq_lib.h +++ b/src/include/gnunet_pq_lib.h @@ -11,7 +11,7 @@ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . @@ -46,16 +46,15 @@ * @param scratch_length number of entries left in @a scratch * @return -1 on error, number of offsets used in @a scratch otherwise */ -typedef int -(*GNUNET_PQ_QueryConverter)(void *cls, - const void *data, - size_t data_len, - void *param_values[], - int param_lengths[], - int param_formats[], - unsigned int param_length, - void *scratch[], - unsigned int scratch_length); +typedef int (*GNUNET_PQ_QueryConverter) (void *cls, + const void *data, + size_t data_len, + void *param_values[], + int param_lengths[], + int param_formats[], + unsigned int param_length, + void *scratch[], + unsigned int scratch_length); /** @@ -94,7 +93,10 @@ struct GNUNET_PQ_QueryParam /** * End of query parameter specification. */ -#define GNUNET_PQ_query_param_end { NULL, NULL, NULL, 0, 0 } +#define GNUNET_PQ_query_param_end \ + { \ + NULL, NULL, NULL, 0, 0 \ + } /** @@ -105,9 +107,7 @@ struct GNUNET_PQ_QueryParam * @oaran ptr_size number of bytes in @a ptr */ struct GNUNET_PQ_QueryParam -GNUNET_PQ_query_param_fixed_size (const void *ptr, - size_t ptr_size); - +GNUNET_PQ_query_param_fixed_size (const void *ptr, size_t ptr_size); /** @@ -125,7 +125,8 @@ GNUNET_PQ_query_param_string (const char *ptr); * * @param x pointer to the query parameter to pass. */ -#define GNUNET_PQ_query_param_auto_from_type(x) GNUNET_PQ_query_param_fixed_size ((x), sizeof (*(x))) +#define GNUNET_PQ_query_param_auto_from_type(x) \ + GNUNET_PQ_query_param_fixed_size ((x), sizeof (*(x))) /** @@ -135,7 +136,8 @@ GNUNET_PQ_query_param_string (const char *ptr); * @param x the query parameter to pass. */ struct GNUNET_PQ_QueryParam -GNUNET_PQ_query_param_rsa_public_key (const struct GNUNET_CRYPTO_RsaPublicKey *x); +GNUNET_PQ_query_param_rsa_public_key ( + const struct GNUNET_CRYPTO_RsaPublicKey *x); /** @@ -145,7 +147,8 @@ GNUNET_PQ_query_param_rsa_public_key (const struct GNUNET_CRYPTO_RsaPublicKey *x * @param x the query parameter to pass */ struct GNUNET_PQ_QueryParam -GNUNET_PQ_query_param_rsa_signature (const struct GNUNET_CRYPTO_RsaSignature *x); +GNUNET_PQ_query_param_rsa_signature ( + const struct GNUNET_CRYPTO_RsaSignature *x); /** @@ -165,7 +168,8 @@ GNUNET_PQ_query_param_absolute_time (const struct GNUNET_TIME_Absolute *x); * @param x pointer to the query parameter to pass */ struct GNUNET_PQ_QueryParam -GNUNET_PQ_query_param_absolute_time_nbo (const struct GNUNET_TIME_AbsoluteNBO *x); +GNUNET_PQ_query_param_absolute_time_nbo ( + const struct GNUNET_TIME_AbsoluteNBO *x); /** @@ -211,13 +215,12 @@ GNUNET_PQ_query_param_uint64 (const uint64_t *x); * #GNUNET_YES if all results could be extracted * #GNUNET_SYSERR if a result was invalid (non-existing field or NULL) */ -typedef int -(*GNUNET_PQ_ResultConverter)(void *cls, - PGresult *result, - int row, - const char *fname, - size_t *dst_size, - void *dst); +typedef int (*GNUNET_PQ_ResultConverter) (void *cls, + PGresult *result, + int row, + const char *fname, + size_t *dst_size, + void *dst); /** @@ -227,9 +230,7 @@ typedef int * @param cls closure * @param rd result data to clean up */ -typedef void -(*GNUNET_PQ_ResultCleanup)(void *cls, - void *rd); +typedef void (*GNUNET_PQ_ResultCleanup) (void *cls, void *rd); /** @@ -275,7 +276,6 @@ struct GNUNET_PQ_ResultSpec * Where to store actual size of the result. */ size_t *result_size; - }; @@ -284,7 +284,10 @@ struct GNUNET_PQ_ResultSpec * * @return array last entry for the result specification to use */ -#define GNUNET_PQ_result_spec_end { NULL, NULL, NULL, NULL, 0, NULL, NULL } +#define GNUNET_PQ_result_spec_end \ + { \ + NULL, NULL, NULL, NULL, 0, NULL, NULL \ + } /** @@ -297,8 +300,8 @@ struct GNUNET_PQ_ResultSpec */ struct GNUNET_PQ_ResultSpec GNUNET_PQ_result_spec_variable_size (const char *name, - void **dst, - size_t *sptr); + void **dst, + size_t *sptr); /** @@ -310,10 +313,7 @@ GNUNET_PQ_result_spec_variable_size (const char *name, * @return array entry for the result specification to use */ struct GNUNET_PQ_ResultSpec -GNUNET_PQ_result_spec_fixed_size (const char *name, - void *dst, - size_t dst_size); - +GNUNET_PQ_result_spec_fixed_size (const char *name, void *dst, size_t dst_size); /** @@ -323,7 +323,8 @@ GNUNET_PQ_result_spec_fixed_size (const char *name, * @param dst point to where to store the result, type fits expected result size * @return array entry for the result specification to use */ -#define GNUNET_PQ_result_spec_auto_from_type(name, dst) GNUNET_PQ_result_spec_fixed_size (name, (dst), sizeof (*(dst))) +#define GNUNET_PQ_result_spec_auto_from_type(name, dst) \ + GNUNET_PQ_result_spec_fixed_size (name, (dst), sizeof (*(dst))) /** @@ -334,8 +335,7 @@ GNUNET_PQ_result_spec_fixed_size (const char *name, * @return array entry for the result specification to use */ struct GNUNET_PQ_ResultSpec -GNUNET_PQ_result_spec_string (const char *name, - char **dst); +GNUNET_PQ_result_spec_string (const char *name, char **dst); /** @@ -347,7 +347,7 @@ GNUNET_PQ_result_spec_string (const char *name, */ struct GNUNET_PQ_ResultSpec GNUNET_PQ_result_spec_rsa_public_key (const char *name, - struct GNUNET_CRYPTO_RsaPublicKey **rsa); + struct GNUNET_CRYPTO_RsaPublicKey **rsa); /** @@ -359,7 +359,7 @@ GNUNET_PQ_result_spec_rsa_public_key (const char *name, */ struct GNUNET_PQ_ResultSpec GNUNET_PQ_result_spec_rsa_signature (const char *name, - struct GNUNET_CRYPTO_RsaSignature **sig); + struct GNUNET_CRYPTO_RsaSignature **sig); /** @@ -371,7 +371,7 @@ GNUNET_PQ_result_spec_rsa_signature (const char *name, */ struct GNUNET_PQ_ResultSpec GNUNET_PQ_result_spec_absolute_time (const char *name, - struct GNUNET_TIME_Absolute *at); + struct GNUNET_TIME_Absolute *at); /** @@ -383,7 +383,7 @@ GNUNET_PQ_result_spec_absolute_time (const char *name, */ struct GNUNET_PQ_ResultSpec GNUNET_PQ_result_spec_absolute_time_nbo (const char *name, - struct GNUNET_TIME_AbsoluteNBO *at); + struct GNUNET_TIME_AbsoluteNBO *at); /** @@ -394,8 +394,7 @@ GNUNET_PQ_result_spec_absolute_time_nbo (const char *name, * @return array entry for the result specification to use */ struct GNUNET_PQ_ResultSpec -GNUNET_PQ_result_spec_uint16 (const char *name, - uint16_t *u16); +GNUNET_PQ_result_spec_uint16 (const char *name, uint16_t *u16); /** @@ -406,8 +405,7 @@ GNUNET_PQ_result_spec_uint16 (const char *name, * @return array entry for the result specification to use */ struct GNUNET_PQ_ResultSpec -GNUNET_PQ_result_spec_uint32 (const char *name, - uint32_t *u32); +GNUNET_PQ_result_spec_uint32 (const char *name, uint32_t *u32); /** @@ -418,8 +416,7 @@ GNUNET_PQ_result_spec_uint32 (const char *name, * @return array entry for the result specification to use */ struct GNUNET_PQ_ResultSpec -GNUNET_PQ_result_spec_uint64 (const char *name, - uint64_t *u64); +GNUNET_PQ_result_spec_uint64 (const char *name, uint64_t *u64); /* ************************* pq.c functions ************************ */ @@ -435,8 +432,8 @@ GNUNET_PQ_result_spec_uint64 (const char *name, */ PGresult * GNUNET_PQ_exec_prepared (PGconn *db_conn, - const char *name, - const struct GNUNET_PQ_QueryParam *params); + const char *name, + const struct GNUNET_PQ_QueryParam *params); /** @@ -452,8 +449,8 @@ GNUNET_PQ_exec_prepared (PGconn *db_conn, */ int GNUNET_PQ_extract_result (PGresult *result, - struct GNUNET_PQ_ResultSpec *rs, - int row); + struct GNUNET_PQ_ResultSpec *rs, + int row); /** @@ -518,10 +515,9 @@ GNUNET_PQ_eval_prepared_non_select (PGconn *connection, * @param result the postgres result * @param num_result the number of results in @a result */ -typedef void -(*GNUNET_PQ_PostgresResultHandler)(void *cls, - PGresult *result, - unsigned int num_results); +typedef void (*GNUNET_PQ_PostgresResultHandler) (void *cls, + PGresult *result, + unsigned int num_results); /** @@ -563,10 +559,11 @@ GNUNET_PQ_eval_prepared_multi_select (PGconn *connection, * codes to `enum GNUNET_DB_QueryStatus`. */ enum GNUNET_DB_QueryStatus -GNUNET_PQ_eval_prepared_singleton_select (PGconn *connection, - const char *statement_name, - const struct GNUNET_PQ_QueryParam *params, - struct GNUNET_PQ_ResultSpec *rs); +GNUNET_PQ_eval_prepared_singleton_select ( + PGconn *connection, + const char *statement_name, + const struct GNUNET_PQ_QueryParam *params, + struct GNUNET_PQ_ResultSpec *rs); /* ******************** pq_prepare.c functions ************** */ @@ -576,7 +573,8 @@ GNUNET_PQ_eval_prepared_singleton_select (PGconn *connection, * Information needed to prepare a list of SQL statements using * #GNUNET_PQ_prepare_statements(). */ -struct GNUNET_PQ_PreparedStatement { +struct GNUNET_PQ_PreparedStatement +{ /** * Name of the statement. @@ -592,14 +590,16 @@ struct GNUNET_PQ_PreparedStatement { * Number of arguments included in @e sql. */ unsigned int num_arguments; - }; /** * Terminator for prepared statement list. */ -#define GNUNET_PQ_PREPARED_STATEMENT_END { NULL, NULL, 0 } +#define GNUNET_PQ_PREPARED_STATEMENT_END \ + { \ + NULL, NULL, 0 \ + } /** @@ -637,7 +637,8 @@ GNUNET_PQ_prepare_statements (PGconn *connection, * Information needed to run a list of SQL statements using * #GNUNET_PQ_exec_statements(). */ -struct GNUNET_PQ_ExecuteStatement { +struct GNUNET_PQ_ExecuteStatement +{ /** * Actual SQL statement. @@ -648,14 +649,16 @@ struct GNUNET_PQ_ExecuteStatement { * Should we ignore errors? */ int ignore_errors; - }; /** * Terminator for executable statement list. */ -#define GNUNET_PQ_EXECUTE_STATEMENT_END { NULL, GNUNET_SYSERR } +#define GNUNET_PQ_EXECUTE_STATEMENT_END \ + { \ + NULL, GNUNET_SYSERR \ + } /** @@ -721,7 +724,6 @@ GNUNET_PQ_connect_with_cfg (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section); - -#endif /* GNUNET_PQ_LIB_H_ */ +#endif /* GNUNET_PQ_LIB_H_ */ /* end of include/gnunet_pq_lib.h */ -- 2.25.1