<NME> configure.ac
<BEF> ################################################################################
#  THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY  #
#  Read the zproject/README.md for information about making permanent changes. #
################################################################################
# Note: if your project needs a customized configure script (compared to
# the code below 100% generated by zproject), please check first if your
# use-case can be handled by acinclude.m4 support in zproject_autotools.gsl
# (to AC_DEFUN an AX_PROJECT_LOCAL_HOOK, AX_PROJECT_LOCAL_HOOK_CONFIGVARS
# and/or AX_PROJECT_LOCAL_HOOK_FINAL) so you can avoid changing this file
# which would complicate re-generation of your project in the future.

#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
#
AC_INIT([czmq],[4.2.2],[zeromq-dev@lists.zeromq.org])

AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(config)
AC_CONFIG_HEADERS([src/platform.h])
AM_INIT_AUTOMAKE([subdir-objects tar-ustar dist-zip foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

# This defines PACKAGE_VERSION_... in src/platform.h
PV_MAJOR=`echo $PACKAGE_VERSION | cut -d . -f 1`
PV_MINOR=`echo $PACKAGE_VERSION | cut -d . -f 2`
PV_PATCH=`echo $PACKAGE_VERSION | cut -d . -f 3`
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],[$PV_MAJOR],
    [CZMQ major version])
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],[$PV_MINOR],
    [CZMQ minor version])
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCH],[$PV_PATCH],
    [CZMQ patchlevel])
# This lets us use PACKAGE_VERSION in Makefiles
AC_SUBST(PACKAGE_VERSION)

#
# Libtool -version-info (ABI version)
#
# Currently 6:2:2 ("stable"). Don't change this unless you
# know exactly what you're doing and have read and understand
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
#
# libczmq -version-info
LTVER="6:2:2"
AC_SUBST(LTVER)

# building in a subdirectory?
AM_CONDITIONAL([USING_VPATH], [test "x${srcdir}" != "x."])

# Capture c flags
CZMQ_ORIG_CFLAGS="${CFLAGS:-none}"

# Checks for programs
AC_PROG_CC
AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AC_PROG_SED
AC_PROG_AWK
PKG_PROG_PKG_CONFIG

# Check endianess of the system
AC_C_BIGENDIAN

# Optional project-local hook (acinclude.m4, add AC_DEFUN([AX_PROJECT_LOCAL_HOOK], [whatever]) )
ifdef([AX_PROJECT_LOCAL_HOOK],
    [AX_PROJECT_LOCAL_HOOK])

# See if cppcheck is in PATH; this variable unblocks the "cppcheck" recipe
# (note that "make cppcheck.xml" can be used - and perhaps fail - regardless)
AC_CHECK_PROG([WITH_CPPCHECK], [cppcheck], [true], [false])
AM_CONDITIONAL(WITH_CPPCHECK, $WITH_CPPCHECK)

# Code coverage
AC_MSG_CHECKING([whether to enable GCov])
AC_ARG_WITH(gcov, [AS_HELP_STRING([--with-gcov=yes/no],
                  [With GCC Code Coverage reporting])],
                  [CZMQ_GCOV="$withval"])

if test "x${CZMQ_GCOV}" == "xyes"; then
    CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"

    if test "x${CZMQ_ORIG_CFLAGS}" != "xnone"; then
        CFLAGS="${CFLAGS} ${CZMQ_ORIG_CFLAGS}"
    fi
    AM_CONDITIONAL(WITH_GCOV, true)
    AC_MSG_RESULT([yes])
else
    AM_CONDITIONAL(WITH_GCOV, false)
    AC_MSG_RESULT([no])
fi

# Memory mis-use detection
AC_MSG_CHECKING([whether to enable ASan])
AC_ARG_ENABLE(address-sanitizer, [AS_HELP_STRING([--enable-address-sanitizer=yes/no],
                  [Build with GCC Address Sanitizer instrumentation])],
                  [CZMQ_ASAN="$enableval"])

if test "x${CZMQ_ASAN}" == "xyes"; then
    CFLAGS="${CFLAGS} -fsanitize=address"
    CXXFLAGS="${CXXFLAGS} -fsanitize=address"

    AM_CONDITIONAL(ENABLE_ASAN, true)
    AC_MSG_RESULT([yes])
else
    AM_CONDITIONAL(ENABLE_ASAN, false)
    AC_MSG_RESULT([no])
fi

# Install Python Bindings
AC_MSG_CHECKING([whether to install Python bindings])

AC_ARG_ENABLE([bindings-python],
    AS_HELP_STRING([--enable-bindings-python=yes/no],
        [Install Python Bindings [default=no]]),
    [ZPROJECT_BINDINGS_PYTHON=$enableval],
    [ZPROJECT_BINDINGS_PYTHON=no])

if test "x$ZPROJECT_BINDINGS_PYTHON" == "xyes"; then
    AM_CONDITIONAL(ENABLE_BINDINGS_PYTHON, true)
    AC_MSG_RESULT([yes])
else
    AM_CONDITIONAL(ENABLE_BINDINGS_PYTHON, false)
    AC_MSG_RESULT([no])
fi

# See if clang-format is in PATH; the result unblocks the relevant recipes
WITH_CLANG_FORMAT=""
AS_IF([test x"$CLANG_FORMAT" = x],
    [AC_PATH_PROG([CLANG_FORMAT], [clang-format], [])],
    [AC_CHECK_PROG([WITH_CLANG_FORMAT], [$CLANG_FORMAT], [true], [fail])])
AS_IF([test x"$CLANG_FORMAT" != x && test x"$WITH_CLANG_FORMAT" = x],
    [AS_IF([test -x "$CLANG_FORMAT"],
        [WITH_CLANG_FORMAT=true],
        [AC_CHECK_PROG([WITH_CLANG_FORMAT], [$CLANG_FORMAT], [true], [false])])])
AS_IF([test "$WITH_CLANG_FORMAT" = fail],
    [AC_MSG_ERROR([Caller explicitly referenced CLANG_FORMAT=$CLANG_FORMAT which was not found])])
AM_CONDITIONAL([WITH_CLANG_FORMAT], [$WITH_CLANG_FORMAT])

# Set pkgconfigdir
AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
    [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),
    [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
AC_SUBST([pkgconfigdir])

# Use the provided pkgconfigdir not only to write our pkg-config data,
# but also as an additional location to look for other packages metadata.
AS_IF([test -n "${pkgconfigdir}" -a -d "${pkgconfigdir}"],
    [AS_IF([test -z "${PKG_CONFIG_PATH}"],
        [PKG_CONFIG_PATH="${pkgconfigdir}"],
        [PKG_CONFIG_PATH="${pkgconfigdir}:${PKG_CONFIG_PATH}"])
     export PKG_CONFIG_PATH
    ])

# Will be used to add flags to pkg-config useful when apps want to statically link
PKGCFG_LIBS_PRIVATE=""
PKGCFG_NAMES_PRIVATE=""

# Archive user supplied flags
PREVIOUS_CFLAGS="${CFLAGS}"
PREVIOUS_LIBS="${LIBS}"


was_libzmq_check_lib_detected=no

search_libzmq="yes"

AC_ARG_WITH([libzmq],
    [
        AS_HELP_STRING([--with-libzmq],
        [yes or no. Optionally specify libzmq prefix (directory where its include/ and lib/ are located), but that is only used if pkgconfig metadata is not found first])
    ],
    [
        search_libzmq="yes"
    ],
    [
        search_libzmq="yes"
    ])
AS_CASE([x"${with_libzmq}"],
    [xyes], [search_libzmq="yes"],
    [xno],  [search_libzmq="no"])

dnl We do not abort right now, because the maintainer/developer may have
dnl something particular in mind, e.g. to build just parts of a project.
AS_IF([test x"${search_libzmq}" = xno],
    [AC_MSG_WARN([Required dependency on libzmq was explicitly disabled during configuration by '--with-libzmq=no'; subsequent full build of czmq may fail])])

AS_IF([test x"${search_libzmq}" = xyes], [
    # Archive previously detected and supplied flags
    PRE_SEARCH_CFLAGS="${CFLAGS}"
    PRE_SEARCH_LIBS="${LIBS}"

    found_pkgconfig=""
    PKG_CHECK_MODULES([libzmq], [libzmq >= 0.0.0],
    [
        was_libzmq_check_lib_detected=pkgcfg
        found_pkgconfig="libzmq"
    ],
    [
        AC_MSG_NOTICE([Package libzmq not found; falling back to defined compilability tests])

        libzmq_synthetic_cflags=""
        libzmq_synthetic_libs="-lzmq"

        if test -n "${with_libzmq}" && test x"${with_libzmq}" != xyes && test x"${with_libzmq}" != xno; then
            if test -r "${with_libzmq}/include/zmq.h"; then
                libzmq_synthetic_cflags="-I${with_libzmq}/include"
                libzmq_synthetic_libs="-L${with_libzmq}/lib -lzmq"
            else
            AC_MSG_ERROR([Header file ${with_libzmq}/include/zmq.h was not found. Please check libzmq prefix])
            fi
        else
            AC_CHECK_HEADER([zmq.h], [],
            AC_MSG_ERROR([Header file zmq.h was not found in default search paths])
                )
        fi

        AC_CHECK_LIB([zmq], [zmq_init],
            [
                was_libzmq_check_lib_detected=yes
                PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE -lzmq"
            ],
            [AC_MSG_ERROR([cannot link with -lzmq, install libzmq])])
    ])

dnl END of PKG_CHECK_MODULES and/or direct tests for libzmq
    AS_CASE(["x${was_libzmq_check_lib_detected}"],
        [xpkgcfg], [
                PKGCFG_NAMES_PRIVATE="$PKGCFG_NAMES_PRIVATE ${found_pkgconfig}"
                CFLAGS="${libzmq_CFLAGS} ${CFLAGS}"
                LIBS="${libzmq_LIBS} ${LIBS}"
            ],
        [xyes], [
                CFLAGS="${libzmq_synthetic_cflags} ${CFLAGS}"
                LDFLAGS="${libzmq_synthetic_libs} ${LDFLAGS}"
                LIBS="${libzmq_synthetic_libs} ${LIBS}"

                AC_SUBST([libzmq_CFLAGS],[${libzmq_synthetic_cflags}])
                AC_SUBST([libzmq_LIBS],[${libzmq_synthetic_libs}])
            ],
        [xno], [
            AC_MSG_ERROR([Cannot find pkg-config metadata for libzmq 0.0.0 or higher])
    ])
])
dnl END of enabled attempts to search for libzmq


was_uuid_check_lib_detected=no

search_uuid="no"

AC_ARG_WITH([uuid],
    [
        AS_HELP_STRING([--with-uuid],
        [yes or no. Optionally specify uuid prefix (directory where its include/ and lib/ are located), but that is only used if pkgconfig metadata is not found first])
    ],
    [
        search_uuid="yes"
    ],
    [
        search_uuid="yes"
    ])
AS_CASE([x"${with_uuid}"],
    [xyes], [search_uuid="yes"],
    [xno],  [search_uuid="no"])


AS_IF([test x"${search_uuid}" = xyes], [
    # Archive previously detected and supplied flags
    PRE_SEARCH_CFLAGS="${CFLAGS}"
    PRE_SEARCH_LIBS="${LIBS}"

    found_pkgconfig=""
    PKG_CHECK_MODULES([uuid], [uuid >= 0.0.0],
    [
        AC_DEFINE(HAVE_UUID, 1, [The optional uuid library is to be used])
        was_uuid_check_lib_detected=pkgcfg
        found_pkgconfig="uuid"
    ],
    [
        AC_MSG_NOTICE([Package uuid not found; falling back to defined compilability tests])

        uuid_synthetic_cflags=""
        uuid_synthetic_libs="-luuid"

        if test -n "${with_uuid}" && test x"${with_uuid}" != xyes && test x"${with_uuid}" != xno; then
            if test -r "${with_uuid}/include/uuid/uuid.h"; then
                uuid_synthetic_cflags="-I${with_uuid}/include"
                uuid_synthetic_libs="-L${with_uuid}/lib -luuid"
            else
            AC_MSG_WARN([Header file ${with_uuid}/include/uuid/uuid.h was not found. Please check uuid prefix])
            fi
        else
            AC_CHECK_HEADER([uuid/uuid.h], [],
            AC_MSG_WARN([Header file uuid/uuid.h was not found in default search paths])
                )
        fi

        AC_CHECK_LIB([uuid], [uuid_generate],
            [
                was_uuid_check_lib_detected=yes
                PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE -luuid"
                AC_DEFINE(HAVE_UUID, 1, [The optional uuid library is to be used (as -luuid)])
            ],
            [])
    ])

dnl END of PKG_CHECK_MODULES and/or direct tests for uuid
    AS_CASE(["x${was_uuid_check_lib_detected}"],
        [xpkgcfg], [
                PKGCFG_NAMES_PRIVATE="$PKGCFG_NAMES_PRIVATE ${found_pkgconfig}"
                CFLAGS="${uuid_CFLAGS} ${CFLAGS}"
                LIBS="${uuid_LIBS} ${LIBS}"
            ],
        [xyes], [
                CFLAGS="${uuid_synthetic_cflags} ${CFLAGS}"
                LDFLAGS="${uuid_synthetic_libs} ${LDFLAGS}"
                LIBS="${uuid_synthetic_libs} ${LIBS}"

                AC_SUBST([uuid_CFLAGS],[${uuid_synthetic_cflags}])
                AC_SUBST([uuid_LIBS],[${uuid_synthetic_libs}])
            ],
        [xno], [
            AC_MSG_WARN([Cannot find pkg-config metadata for uuid 0.0.0 or higher])
    ])
])
dnl END of enabled attempts to search for uuid


was_systemd_check_lib_detected=no

search_libsystemd="no"

AC_ARG_WITH([libsystemd],
    [
        AS_HELP_STRING([--with-libsystemd],
        [yes or no. Optionally specify libsystemd prefix (directory where its include/ and lib/ are located), but that is only used if pkgconfig metadata is not found first])
    ],
    [
        search_libsystemd="yes"
    ],
    [
        search_libsystemd="yes"
    ])
AS_CASE([x"${with_libsystemd}"],
    [xyes], [search_libsystemd="yes"],
    [xno],  [search_libsystemd="no"])


AS_IF([test x"${search_libsystemd}" = xyes], [
    # Archive previously detected and supplied flags
    PRE_SEARCH_CFLAGS="${CFLAGS}"
    PRE_SEARCH_LIBS="${LIBS}"

    found_pkgconfig=""
    PKG_CHECK_MODULES([systemd], [libsystemd >= 200.0.0],
    [
        AC_DEFINE(HAVE_LIBSYSTEMD, 1, [The optional libsystemd library is to be used])
        was_systemd_check_lib_detected=pkgcfg
        found_pkgconfig="libsystemd"
    ],
    [
        AC_MSG_NOTICE([Package libsystemd not found with needed constraints; falling back to defined compilability tests])

        systemd_synthetic_cflags=""
AM_CONDITIONAL(INSTALL_MAN, test "x$czmq_install_man" = "xyes")
AM_CONDITIONAL(BUILD_DOC, test "x$czmq_build_doc" = "xyes")

# Check for zmakecert intent
AC_ARG_ENABLE([zmakecert],
    AS_HELP_STRING([--enable-zmakecert],
                AC_DEFINE(HAVE_LIBSYSTEMD, 1, [The optional libsystemd library is to be used (as -lsystemd)])
            ],
            [])
    ])

dnl END of PKG_CHECK_MODULES and/or direct tests for libsystemd
    AS_CASE(["x${was_systemd_check_lib_detected}"],
        [xpkgcfg], [
                PKGCFG_NAMES_PRIVATE="$PKGCFG_NAMES_PRIVATE ${found_pkgconfig} >= 200.0.0"
                CFLAGS="${systemd_CFLAGS} ${CFLAGS}"
                LIBS="${systemd_LIBS} ${LIBS}"
            ],
        [xyes], [
                CFLAGS="${systemd_synthetic_cflags} ${CFLAGS}"
                LDFLAGS="${systemd_synthetic_libs} ${LDFLAGS}"
                LIBS="${systemd_synthetic_libs} ${LIBS}"

                AC_SUBST([systemd_CFLAGS],[${systemd_synthetic_cflags}])
                AC_SUBST([systemd_LIBS],[${systemd_synthetic_libs}])
            ],
        [xno], [
            AC_MSG_WARN([Cannot find pkg-config metadata for libsystemd 200.0.0 or higher])
    ])
])
dnl END of enabled attempts to search for libsystemd


was_lz4_check_lib_detected=no

search_liblz4="no"

AC_ARG_WITH([liblz4],
    [
        AS_HELP_STRING([--with-liblz4],
        [yes or no. Optionally specify liblz4 prefix (directory where its include/ and lib/ are located), but that is only used if pkgconfig metadata is not found first])
    ],
    [
        search_liblz4="yes"
    ],
    [
        search_liblz4="yes"
    ])
AS_CASE([x"${with_liblz4}"],
    [xyes], [search_liblz4="yes"],
    [xno],  [search_liblz4="no"])


AS_IF([test x"${search_liblz4}" = xyes], [
    # Archive previously detected and supplied flags
    PRE_SEARCH_CFLAGS="${CFLAGS}"
    PRE_SEARCH_LIBS="${LIBS}"

    AC_SUBST(pkg_config_defines, "")
fi

# Specify output files
AC_CONFIG_FILES([Makefile
                 doc/Makefile
    ])

dnl END of PKG_CHECK_MODULES and/or direct tests for liblz4
    AS_CASE(["x${was_lz4_check_lib_detected}"],
        [xpkgcfg], [
                PKGCFG_NAMES_PRIVATE="$PKGCFG_NAMES_PRIVATE ${found_pkgconfig}"
                CFLAGS="${lz4_CFLAGS} ${CFLAGS}"
                LIBS="${lz4_LIBS} ${LIBS}"
            ],
        [xyes], [
                CFLAGS="${lz4_synthetic_cflags} ${CFLAGS}"
                LDFLAGS="${lz4_synthetic_libs} ${LDFLAGS}"
                LIBS="${lz4_synthetic_libs} ${LIBS}"

                AC_SUBST([lz4_CFLAGS],[${lz4_synthetic_cflags}])
                AC_SUBST([lz4_LIBS],[${lz4_synthetic_libs}])
            ],
        [xno], [
            AC_MSG_WARN([Cannot find pkg-config metadata for liblz4 0.0.0 or higher])
    ])
])
dnl END of enabled attempts to search for liblz4


was_libcurl_check_lib_detected=no

search_libcurl="no"

AC_ARG_WITH([libcurl],
    [
        AS_HELP_STRING([--with-libcurl],
        [yes or no. Optionally specify libcurl prefix (directory where its include/ and lib/ are located), but that is only used if pkgconfig metadata is not found first])
    ],
    [
echo
echo C compiler.................... : $CC
echo C compiler flags.............. : $CFLAGS
echo Configure date................ : $BUILD_DATE
echo Build architecture............ : $BUILD_ARCH
echo Build docs.................... : $czmq_build_doc


AS_IF([test x"${search_libcurl}" = xyes], [
    # Archive previously detected and supplied flags
    PRE_SEARCH_CFLAGS="${CFLAGS}"
    PRE_SEARCH_LIBS="${LIBS}"

    found_pkgconfig=""
    PKG_CHECK_MODULES([libcurl], [libcurl >= 7.28.0],
    [
        AC_DEFINE(HAVE_LIBCURL, 1, [The optional libcurl library is to be used])
        was_libcurl_check_lib_detected=pkgcfg
        found_pkgconfig="libcurl"
    ],
    [
echo '##########################################################################'

echo
echo Configure complete! Now procced with:
echo "    - 'make'               compile the project"
echo "    - 'make check'         run the project's selftest"
echo "    - 'make install'       install the project to $prefix"
                libcurl_synthetic_cflags="-I${with_libcurl}/include"
                libcurl_synthetic_libs="-L${with_libcurl}/lib -lcurl"
            else
            AC_MSG_WARN([Header file ${with_libcurl}/include/curl/curl.h was not found. Please check libcurl prefix])
            fi
        else
            AC_CHECK_HEADER([curl/curl.h], [],
            AC_MSG_WARN([Header file curl/curl.h was not found in default search paths])
                )
        fi

        AC_CHECK_LIB([curl], [curl_easy_init],
            [
                was_libcurl_check_lib_detected=yes
                PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE -lcurl"
                AC_DEFINE(HAVE_LIBCURL, 1, [The optional libcurl library is to be used (as -lcurl)])
            ],
            [])
    ])

dnl END of PKG_CHECK_MODULES and/or direct tests for libcurl
    AS_CASE(["x${was_libcurl_check_lib_detected}"],
        [xpkgcfg], [
                PKGCFG_NAMES_PRIVATE="$PKGCFG_NAMES_PRIVATE ${found_pkgconfig} >= 7.28.0"
                CFLAGS="${libcurl_CFLAGS} ${CFLAGS}"
                LIBS="${libcurl_LIBS} ${LIBS}"
            ],
        [xyes], [
                CFLAGS="${libcurl_synthetic_cflags} ${CFLAGS}"
                LDFLAGS="${libcurl_synthetic_libs} ${LDFLAGS}"
                LIBS="${libcurl_synthetic_libs} ${LIBS}"

                AC_SUBST([libcurl_CFLAGS],[${libcurl_synthetic_cflags}])
                AC_SUBST([libcurl_LIBS],[${libcurl_synthetic_libs}])
            ],
        [xno], [
            AC_MSG_WARN([Cannot find pkg-config metadata for libcurl 7.28.0 or higher])
    ])
])
dnl END of enabled attempts to search for libcurl


was_nss_check_lib_detected=no

search_nss="no"

AC_ARG_WITH([nss],
    [
        AS_HELP_STRING([--with-nss],
        [yes or no. Optionally specify nss prefix (directory where its include/ and lib/ are located), but that is only used if pkgconfig metadata is not found first])
    ],
    [
        search_nss="yes"
    ],
    [
        search_nss="yes"
    ])
AS_CASE([x"${with_nss}"],
    [xyes], [search_nss="yes"],
    [xno],  [search_nss="no"])


AS_IF([test x"${search_nss}" = xyes], [
    # Archive previously detected and supplied flags
    PRE_SEARCH_CFLAGS="${CFLAGS}"
    PRE_SEARCH_LIBS="${LIBS}"

    found_pkgconfig=""
    PKG_CHECK_MODULES([nss], [nss >= 0.0.0],
    [
        AC_DEFINE(HAVE_NSS, 1, [The optional nss library is to be used])
        was_nss_check_lib_detected=pkgcfg
        found_pkgconfig="nss"
    ],
    [
        AC_MSG_NOTICE([Package nss not found; falling back to defined compilability tests])

        nss_synthetic_cflags=""
        nss_synthetic_libs="-lnss"

        if test -n "${with_nss}" && test x"${with_nss}" != xyes && test x"${with_nss}" != xno; then
            if test -r "${with_nss}/include/sechash.h"; then
                nss_synthetic_cflags="-I${with_nss}/include"
                nss_synthetic_libs="-L${with_nss}/lib -lnss"
            else
            AC_MSG_WARN([Header file ${with_nss}/include/sechash.h was not found. Please check nss prefix])
            fi
        else
            AC_CHECK_HEADER([sechash.h], [],
            AC_MSG_WARN([Header file sechash.h was not found in default search paths])
                )
        fi

        AC_CHECK_LIB([nss], [HASH_Create],
            [
                was_nss_check_lib_detected=yes
                PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE -lnss"
                AC_DEFINE(HAVE_NSS, 1, [The optional nss library is to be used (as -lnss)])
            ],
            [])
    ])

dnl END of PKG_CHECK_MODULES and/or direct tests for nss
    AS_CASE(["x${was_nss_check_lib_detected}"],
        [xpkgcfg], [
                PKGCFG_NAMES_PRIVATE="$PKGCFG_NAMES_PRIVATE ${found_pkgconfig}"
                CFLAGS="${nss_CFLAGS} ${CFLAGS}"
                LIBS="${nss_LIBS} ${LIBS}"
            ],
        [xyes], [
                CFLAGS="${nss_synthetic_cflags} ${CFLAGS}"
                LDFLAGS="${nss_synthetic_libs} ${LDFLAGS}"
                LIBS="${nss_synthetic_libs} ${LIBS}"

                AC_SUBST([nss_CFLAGS],[${nss_synthetic_cflags}])
                AC_SUBST([nss_LIBS],[${nss_synthetic_libs}])
            ],
        [xno], [
            AC_MSG_WARN([Cannot find pkg-config metadata for nss 0.0.0 or higher])
    ])
])
dnl END of enabled attempts to search for nss


was_libmicrohttpd_check_lib_detected=no

search_libmicrohttpd="no"

AC_ARG_WITH([libmicrohttpd],
    [
        AS_HELP_STRING([--with-libmicrohttpd],
        [yes or no. Optionally specify libmicrohttpd prefix (directory where its include/ and lib/ are located), but that is only used if pkgconfig metadata is not found first])
    ],
    [
        search_libmicrohttpd="yes"
    ],
    [
        search_libmicrohttpd="yes"
    ])
AS_CASE([x"${with_libmicrohttpd}"],
    [xyes], [search_libmicrohttpd="yes"],
    [xno],  [search_libmicrohttpd="no"])


AS_IF([test x"${search_libmicrohttpd}" = xyes], [
    # Archive previously detected and supplied flags
    PRE_SEARCH_CFLAGS="${CFLAGS}"
    PRE_SEARCH_LIBS="${LIBS}"

    found_pkgconfig=""
    PKG_CHECK_MODULES([libmicrohttpd], [libmicrohttpd >= 0.0.0],
    [
        AC_DEFINE(HAVE_LIBMICROHTTPD, 1, [The optional libmicrohttpd library is to be used])
        was_libmicrohttpd_check_lib_detected=pkgcfg
        found_pkgconfig="libmicrohttpd"
    ],
    [
        AC_MSG_NOTICE([Package libmicrohttpd not found; falling back to defined compilability tests])

        libmicrohttpd_synthetic_cflags=""
        libmicrohttpd_synthetic_libs="-lmicrohttpd"

        if test -n "${with_libmicrohttpd}" && test x"${with_libmicrohttpd}" != xyes && test x"${with_libmicrohttpd}" != xno; then
            if test -r "${with_libmicrohttpd}/include/microhttpd.h"; then
                libmicrohttpd_synthetic_cflags="-I${with_libmicrohttpd}/include"
                libmicrohttpd_synthetic_libs="-L${with_libmicrohttpd}/lib -lmicrohttpd"
            else
            AC_MSG_WARN([Header file ${with_libmicrohttpd}/include/microhttpd.h was not found. Please check libmicrohttpd prefix])
            fi
        else
            AC_CHECK_HEADER([microhttpd.h], [],
            AC_MSG_WARN([Header file microhttpd.h was not found in default search paths])
                )
        fi

        AC_CHECK_LIB([microhttpd], [MHD_start_daemon],
            [
                was_libmicrohttpd_check_lib_detected=yes
                PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE -lmicrohttpd"
                AC_DEFINE(HAVE_LIBMICROHTTPD, 1, [The optional libmicrohttpd library is to be used (as -lmicrohttpd)])
            ],
            [])
    ])

dnl END of PKG_CHECK_MODULES and/or direct tests for libmicrohttpd
    AS_CASE(["x${was_libmicrohttpd_check_lib_detected}"],
        [xpkgcfg], [
                PKGCFG_NAMES_PRIVATE="$PKGCFG_NAMES_PRIVATE ${found_pkgconfig}"
                CFLAGS="${libmicrohttpd_CFLAGS} ${CFLAGS}"
                LIBS="${libmicrohttpd_LIBS} ${LIBS}"
            ],
        [xyes], [
                CFLAGS="${libmicrohttpd_synthetic_cflags} ${CFLAGS}"
                LDFLAGS="${libmicrohttpd_synthetic_libs} ${LDFLAGS}"
                LIBS="${libmicrohttpd_synthetic_libs} ${LIBS}"

                AC_SUBST([libmicrohttpd_CFLAGS],[${libmicrohttpd_synthetic_cflags}])
                AC_SUBST([libmicrohttpd_LIBS],[${libmicrohttpd_synthetic_libs}])
            ],
        [xno], [
            AC_MSG_WARN([Cannot find pkg-config metadata for libmicrohttpd 0.0.0 or higher])
    ])
])
dnl END of enabled attempts to search for libmicrohttpd


CFLAGS="${PREVIOUS_CFLAGS}"
LIBS="${PREVIOUS_LIBS}"

AC_SUBST(pkg_config_libs_private, $PKGCFG_LIBS_PRIVATE)
AC_SUBST(pkg_config_names_private, $PKGCFG_NAMES_PRIVATE)

# Platform specific checks
czmq_on_mingw32="no"
czmq_on_cygwin="no"
czmq_on_android="no"
czmq_on_linux="no"
czmq_on_gnu="no"

# Host specific checks
AC_CANONICAL_HOST

# Man pages are built/installed if asciidoc and xmlto are present
#   --with-docs=no overrides this
AC_ARG_WITH([docs],
    AS_HELP_STRING([--with-docs],
        [Build and install man pages [default=yes]]),
    [with_docs=$withval])

if test "x$with_docs" = "xno"; then
    czmq_build_doc="no"
    czmq_install_man="no"
else
    # Determine whether or not documentation should be built and installed.
    czmq_build_doc="yes"
    czmq_install_man="yes"

    # Check for asciidoc and xmlto and don't build the docs if these are not installed.
    AC_CHECK_PROG(czmq_have_asciidoc, asciidoc, yes, no)
    AC_CHECK_PROG(czmq_have_xmlto, xmlto, yes, no)
    if test "x$czmq_have_asciidoc" = "xno" -o "x$czmq_have_xmlto" = "xno"; then
        if test "x$with_docs" = "xyes" ; then
            AC_MSG_ERROR([Build with docs was explicitly requested, but tools are not available])
        fi
        czmq_build_doc="no"
        # Tarballs built with 'make dist' ship with prebuilt documentation.
        if ! test -f doc/czmq.7; then
            czmq_install_man="no"
            AC_MSG_WARN([You are building an unreleased version of CZMQ and asciidoc or xmlto are not installed.])
            AC_MSG_WARN([Documentation will not be built and manual pages will not be installed.])
        fi
    fi
fi
AC_MSG_CHECKING([whether to build documentation])
AC_MSG_RESULT([$czmq_build_doc])
AC_MSG_CHECKING([whether to install manpages])
AC_MSG_RESULT([$czmq_install_man])

# Set some default features required by libczmq code.
CPPFLAGS="-DCZMQ_INTERNAL_BUILD -D_REENTRANT -D_THREAD_SAFE $CPPFLAGS"

# OS-specific tests
case "${host_os}" in
    *linux*)
        # Define on Linux to enable all library features
        CPPFLAGS="-D_GNU_SOURCE -DLINUX $CPPFLAGS"
        AC_DEFINE(CZMQ_HAVE_LINUX, 1, [Have Linux OS])
        czmq_on_linux="yes"

        case "${host_os}" in
            *android*)
                AC_DEFINE(CZMQ_HAVE_ANDROID, 1, [Have Android OS])
                czmq_on_android="yes"
            ;;
        esac
        ;;
    *solaris*)
        # Define on Solaris to enable all library features
        CPPFLAGS="-D_PTHREADS $CPPFLAGS"
        # Allow definitions of common OS-provided functions that are not in old standards
        CPPFLAGS="-D__EXTENSIONS__ $CPPFLAGS"
        AC_DEFINE(CZMQ_HAVE_SOLARIS, 1, [Have Solaris OS])
        CFLAGS="${CFLAGS} -lsocket -lssp"
        ;;
    *freebsd*)
        # Define on FreeBSD to enable all library features
        CPPFLAGS="-D__BSD_VISIBLE $CPPFLAGS"
        AC_DEFINE(CZMQ_HAVE_FREEBSD, 1, [Have FreeBSD OS])
        ;;
    *darwin*)
        # Define on Darwin to enable all library features
        CPPFLAGS="-D_DARWIN_C_SOURCE $CPPFLAGS"
        AC_DEFINE(CZMQ_HAVE_OSX, 1, [Have DarwinOSX OS])
        ;;
    *netbsd*)
        # Define on NetBSD to enable all library features
        CPPFLAGS="-D_NETBSD_SOURCE $CPPFLAGS"
        AC_DEFINE(CZMQ_HAVE_NETBSD, 1, [Have NetBSD OS])
        ;;
    *openbsd*)
        # Define on OpenBSD to enable all library features
        CPPFLAGS="-D_BSD_SOURCE $CPPFLAGS"
        AC_DEFINE(CZMQ_HAVE_OPENBSD, 1, [Have OpenBSD OS])
        ;;
    *nto-qnx*)
        AC_DEFINE(CZMQ_HAVE_QNXNTO, 1, [Have QNX Neutrino OS])
        ;;
    *aix*)
        AC_DEFINE(CZMQ_HAVE_AIX, 1, [Have AIX OS])
        ;;
    *hpux*)
        # Define on HP-UX to enable all library features
        CPPFLAGS="-D_POSIX_C_SOURCE=200112L"
        AC_DEFINE(CZMQ_HAVE_HPUX, 1, [Have HPUX OS])
        ;;
    *mingw32*)
        # Disable format error due to incomplete ANSI C
        CFLAGS="-Wno-error=format -Wno-unused-function -Wno-unused-variable -D_XOPEN_SOURCE $CFLAGS"
        CPPFLAGS="-Wno-error=format -Wno-unused-function -Wno-unused-variable -D_XOPEN_SOURCE $CPPFLAGS"
        AC_DEFINE(CZMQ_HAVE_WINDOWS, 1, [Have Windows OS])
        AC_DEFINE(CZMQ_HAVE_MINGW32, 1, [Have MinGW32])
        AC_CHECK_HEADERS(windows.h)
        czmq_on_mingw32="yes"
        czmq_install_man="no"
        ;;
    *mingw64*)
        # Define on MINGW64 to enable all libeary features
        # Disable format error due to incomplete ANSI C
        CFLAGS="-Wno-error=format -Wno-unused-function -Wno-unused-variable -D_XOPEN_SOURCE $CFLAGS"
        CPPFLAGS="-Wno-error=format -Wno-unused-function -Wno-unused-variable -D_XOPEN_SOURCE $CPPFLAGS"
        AC_DEFINE(CZMQ_HAVE_WINDOWS, 1, [Have Windows OS])
        AC_DEFINE(CZMQ_HAVE_MINGW32, 1, [Have MinGW32])
        AC_CHECK_HEADERS(windows.h)
        czmq_on_mingw32="yes"
        czmq_install_man="no"
        ;;
    *cygwin*)
        # Define on Cygwin to enable all library features
        CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
        AC_DEFINE(CZMQ_HAVE_CYGWIN, 1, [Have Cygwin])
        czmq_on_cygwin="yes"
        ;;
    gnu*)
        # Define on GNU/Hurd to enable all library features
        if test "x$GXX" = "xyes"; then
            CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"
        fi
        AC_DEFINE(CZMQ_HAVE_GNU, 1, [Have GNU/Hurd OS])
        czmq_on_gnu="yes"
        ;;
    *)
        AC_MSG_ERROR([unsupported system: ${host_os}])
        ;;
esac

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(errno.h arpa/inet.h netinet/tcp.h netinet/in.h stddef.h \
                 stdlib.h string.h sys/socket.h sys/time.h unistd.h \
                 limits.h ifaddrs.h)
AC_CHECK_HEADERS([net/if.h net/if_media.h linux/wireless.h], [], [],
[
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
#include <stdint.h>
])

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_HEADER_TIME
AC_TYPE_UINT32_T
AC_C_VOLATILE
AC_C_BIGENDIAN

# Check for symbols (function, variable, or macro)
AC_CHECK_DECLS([AI_V4MAPPED], [], [], [[#include <czmq.h>]])

AM_CONDITIONAL(ENABLE_SHARED, test "x$enable_shared" = "xyes")
AM_CONDITIONAL(ON_MINGW, test "x$czmq_on_mingw32" = "xyes")
AM_CONDITIONAL(ON_CYGWIN, test "x$czmq_on_cygwin" = "xyes")
AM_CONDITIONAL(ON_ANDROID, test "x$czmq_on_android" = "xyes")
AM_CONDITIONAL(ON_LINUX, test "x$czmq_on_linux" = "xyes")
AM_CONDITIONAL(ON_GNU, test "x$czmq_on_gnu" = "xyes")
AM_CONDITIONAL(INSTALL_MAN, test "x$czmq_install_man" = "xyes")
AM_CONDITIONAL(BUILD_DOC, test "x$czmq_build_doc" = "xyes")

AC_ARG_ENABLE([dist_cmakefiles],
    AS_HELP_STRING([--enable-dist_cmakefiles],
        [Distribute CMakeLists.txt and related files [default depends: on if present and not cross compiling]]),
    [enable_dist_cmakefiles=$enableval],
    [AC_MSG_CHECKING([for presence of CMake recipes])
if test "x$cross_compiling" = "xyes"; then
     enable_dist_cmakefiles=no
else
     AC_CHECK_FILE($srcdir/CMakeLists.txt, [enable_dist_cmakefiles=yes], [enable_dist_cmakefiles=no])
fi
     AC_MSG_RESULT([$enable_dist_cmakefiles])])
AM_CONDITIONAL(ENABLE_DIST_CMAKEFILES, test "x$enable_dist_cmakefiles" = "xyes")

# Check for zmakecert intent
AC_ARG_ENABLE([zmakecert],
    AS_HELP_STRING([--enable-zmakecert],
        [Compile and install 'zmakecert' [default=yes]]),
    [enable_zmakecert=$enableval],
    [enable_zmakecert=yes])

AM_CONDITIONAL([ENABLE_ZMAKECERT], [test x$enable_zmakecert != xno])
AM_COND_IF([ENABLE_ZMAKECERT], [AC_MSG_NOTICE([ENABLE_ZMAKECERT defined])])

# Check for zsp intent
AC_ARG_ENABLE([zsp],
    AS_HELP_STRING([--enable-zsp],
        [Compile 'zsp' in src [default=yes]]),
    [enable_zsp=$enableval],
    [enable_zsp=yes])

AM_CONDITIONAL([ENABLE_ZSP], [test x$enable_zsp != xno])
AM_COND_IF([ENABLE_ZSP], [AC_MSG_NOTICE([ENABLE_ZSP defined])])

# Check for test_randof intent
AC_ARG_ENABLE([test_randof],
    AS_HELP_STRING([--enable-test_randof],
        [Compile 'test_randof' in src [default=yes]]),
    [enable_test_randof=$enableval],
    [enable_test_randof=yes])

AM_CONDITIONAL([ENABLE_TEST_RANDOF], [test x$enable_test_randof != xno])
AM_COND_IF([ENABLE_TEST_RANDOF], [AC_MSG_NOTICE([ENABLE_TEST_RANDOF defined])])

# Check for czmq_selftest intent
AC_ARG_ENABLE([czmq_selftest],
    AS_HELP_STRING([--enable-czmq_selftest],
        [Compile 'czmq_selftest' in src [default=yes]]),
    [enable_czmq_selftest=$enableval],
    [enable_czmq_selftest=yes])

AM_CONDITIONAL([ENABLE_CZMQ_SELFTEST], [test x$enable_czmq_selftest != xno])
AM_COND_IF([ENABLE_CZMQ_SELFTEST], [AC_MSG_NOTICE([ENABLE_CZMQ_SELFTEST defined])])

# Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(perror gettimeofday memset getifaddrs)


# enable specific system integration features
if test "x$cross_compiling" = "xyes"; then
    #   Enable draft by default when cross-compiling
    defaultval=yes
else
    # enable draft API by default if we're in a git repository
    # else disable it by default; then allow --enable-drafts=yes/no override
    AC_CHECK_FILE($srcdir/.git, [defaultval=yes],
        [AC_MSG_CHECKING([running under a git repository workspace])
         AS_IF([git rev-parse --show-toplevel 2>/dev/null],
            [defaultval=yes],
            [defaultval=no])
         AC_MSG_RESULT($defaultval)
        ])
fi

AC_ARG_ENABLE([drafts],
    AS_HELP_STRING([--enable-drafts],
        [Build and install draft classes and methods [default=yes]]),
    [enable_drafts=$enableval],
    [enable_drafts=$defaultval])

AM_CONDITIONAL([ENABLE_DRAFTS], [test x$enable_drafts != xno])

if test "x$enable_drafts" = "xyes"; then
    AC_MSG_NOTICE([Building stable and legacy API + draft API])
    AC_DEFINE(CZMQ_BUILD_DRAFT_API, 1, [Provide draft classes and methods])
    AC_SUBST(pkg_config_defines, "-DCZMQ_BUILD_DRAFT_API=1")
else
    AC_MSG_NOTICE([Building stable and legacy API (no draft API)])
    AC_SUBST(pkg_config_defines, "")
fi

AC_ARG_ENABLE([Werror],
    AS_HELP_STRING([--enable-Werror],
        [Add -Wall -Werror to GCC/GXX arguments [default=no; default=auto if nothing specified as the specific argument value]]),
    [AS_IF([test -n "$enableval"], [enable_Werror=$enableval], [enable_Werror=auto])],
    [enable_Werror=no])

# These options are GNU compiler specific.
AS_IF([test "x$enable_Werror" = "xyes" || test "x$enable_Werror" = "xauto"],
    [AS_IF([test -n "$CC"],[AS_IF([$CC --version 2>&1 | grep 'Free Software Foundation' > /dev/null && test "x$GCC" = "xyes"],
        [AC_MSG_NOTICE([Enabling pedantic errors for GNU C])
         CFLAGS="$CFLAGS -pedantic -Wall -Werror -Werror=format-security"],
        [AS_IF([$CC --version 2>&1 | grep 'clang version' > /dev/null],
            [AC_MSG_NOTICE([Enabling pedantic errors for clang C])
             CFLAGS="$CFLAGS -pedantic -Wall -Werror -Werror=format-security"],
            [AC_MSG_NOTICE([Not enabling pedantic errors: compiler not supported by this recipe (not GNU or clang C)])
             AS_IF([test "x$enable_Werror" = "xyes"], [AC_MSG_ERROR([--enable-Werror=yes was requested and can not be satisfied for C: $CC])])
        ])])])
     AS_IF([test -n "$CXX"],[AS_IF([$CXX --version 2>&1 | grep 'Free Software Foundation' > /dev/null && test "x$GCC" = "xyes"],
        [AC_MSG_NOTICE([Enabling pedantic errors for GNU C++])
         CXXFLAGS="$CXXFLAGS -pedantic -Wall -Werror -Werror=format-security"],
        [AS_IF([$CXX --version 2>&1 | grep 'clang version' > /dev/null],
            [AC_MSG_NOTICE([Enabling pedantic errors for clang C++])
             CXXFLAGS="$CXXFLAGS -pedantic -Wall -Werror -Werror=format-security"],
            [AC_MSG_NOTICE([Not enabling pedantic errors: compiler not supported by this recipe (not GNU or clang C++)])
             AS_IF([test "x$enable_Werror" = "xyes"], [AC_MSG_ERROR([--enable-Werror=yes was requested and can not be satisfied for C++: $CXX])])
        ])])])
     AS_IF([test -n "$CPP"],[AS_IF([$CPP --version 2>&1 | grep 'Free Software Foundation' > /dev/null && test "x$GCC" = "xyes"],
        [AC_MSG_NOTICE([Enabling pedantic errors for GNU CPP preprocessor])
         CPPFLAGS="$CPPFLAGS -pedantic -Werror -Wall -Wc++-compat"
        ],
        [AS_IF([$CXX --version 2>&1 | grep 'clang version' > /dev/null],
            [AC_MSG_NOTICE([Enabling pedantic errors for clang CPP preprocessor])
             CPPFLAGS="$CPPFLAGS -pedantic -Werror -Wall -Wc++-compat"
            ],
            [AC_MSG_NOTICE([Not enabling pedantic errors: preprocessor not supported by this recipe (not GNU or clang CPP)])
             AS_IF([test "x$enable_Werror" = "xyes"], [AC_MSG_ERROR([--enable-Werror=yes was requested and can not be satisfied for CPP: $CPP])])
        ])])])
])

# Optional project-local hook to (re-)define some variables that can be used
# in your project files generated from .in templates - in your acinclude.m4,
# add AC_DEFUN([AX_PROJECT_LOCAL_HOOK_CONFIGVARS], [whatever])
ifdef([AX_PROJECT_LOCAL_HOOK_CONFIGVARS],
    [AX_PROJECT_LOCAL_HOOK_CONFIGVARS])

# Specify output files
AC_CONFIG_FILES([Makefile
                 doc/Makefile
                 include/Makefile
                 src/libczmq.pc
                ])


# Optional project-local hook to put some finishing touches in your configure
# script, override something compared to zproject-generated code, etc. - in
# your acinclude.m4, add AC_DEFUN([AX_PROJECT_LOCAL_HOOK_FINAL], [whatever])
ifdef([AX_PROJECT_LOCAL_HOOK_FINAL],
    [AX_PROJECT_LOCAL_HOOK_FINAL])

AC_OUTPUT

# Print configure summary and list make options
AC_DEFUN([AX_SUMMARIZE_ENV],
[
BUILD_USER=${USER}
BUILD_ARCH=${host}
BUILD_HOST=${ac_hostname}
BUILD_DATE=$(date +'%F %H:%M')

AC_DEFINE_UNQUOTED([BUILD_USER],     "${BUILD_USER}",     [The fine user who built the package])
AC_DEFINE_UNQUOTED([BUILD_ARCH],     "${BUILD_ARCH}",     [Architecture of the build host])
AC_DEFINE_UNQUOTED([BUILD_HOST],     "${BUILD_HOST}",     [Build host name])
AC_DEFINE_UNQUOTED([BUILD_DATE],     "${BUILD_DATE}",     [Build date])

AC_SUBST(BUILD_USER)
AC_SUBST(BUILD_ARCH)
AC_SUBST(BUILD_HOST)
AC_SUBST(BUILD_DATE)
AC_SUBST(BUILD_VERSION)
])

AC_DEFUN([AX_SUMMARIZE_CONFIG],
[
echo
echo '##########################################################################'
echo '#                                SUMMARY                                 #'
echo '##########################################################################'
echo
echo Package version............... : $PACKAGE-$VERSION
echo
echo C compiler.................... : $CC
echo C compiler flags.............. : $CFLAGS
echo C++ compiler.................. : $CXX
echo C++ compiler flags............ : $CXXFLAGS
echo Configure date................ : $BUILD_DATE
echo Build architecture............ : $BUILD_ARCH
echo Build docs.................... : $czmq_build_doc
echo Build host.................... : $BUILD_HOST
echo Build user.................... : $USER
echo Draft API..................... : $enable_drafts
echo Python Bindings............... : $ZPROJECT_BINDINGS_PYTHON
echo Install dir................... : $prefix
echo Install man pages............. : $czmq_install_man

echo
echo Help:
echo Use the Draft API \(default = yes\):
echo --enable-drafts=\(yes\|no\)
echo
echo Build the docs and install the man pages \(default = yes\):
echo --with-docs=\(yes\|no\)       *requires asciidoc and xmlto

echo
echo '##########################################################################'

echo
echo Configure complete! Now proceed with:
echo "    - 'make'               compile the project"
echo "    - 'make check'         run the project's selftest"
echo "    - 'make check-<test-name>'    run the project's selftest"
echo "    - 'make install'       install the project to $prefix"
echo "    - 'make bindings       install enabled language bindings (Python, etc)"
echo
echo Further options are:
echo "    - 'make callcheck'     run the project's selftest with valgrind to"
echo "                           check for performance leaks"
echo "    - 'make check-verbose' run the project's selftest in verbose mode"
echo "    - 'make code'          generate code from models in src directory"
echo "                           (requires zproject and zproto)"
echo "    - 'make debug'         run the project's selftest under gdb"
echo "    - 'make memcheck'      run the project's selftest with valgrind to"
echo "                           check for memory leaks"
echo "    - 'make coverage'      generate project's selftest coverage report"
echo "                           expects --with-gcov option for configure"
echo "    - 'make clang-format-check'   check if project sources conform"
echo "                           to style requirements"
echo "    - 'make clang-format'  modify project sources to conform"
echo "                           to style requirements"
echo "    - 'make clang-format-diff'    modify as above and print 'git diff'"
echo
])

AX_SUMMARIZE_ENV
AX_SUMMARIZE_CONFIG
################################################################################
#  THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY  #
#  Read the zproject/README.md for information about making permanent changes. #
################################################################################

<MSG> Problem: out of date with zproject

Solution: regenerate

<DFF> @@ -368,6 +368,19 @@ AM_CONDITIONAL(ON_GNU, test "x$czmq_on_gnu" = "xyes")
 AM_CONDITIONAL(INSTALL_MAN, test "x$czmq_install_man" = "xyes")
 AM_CONDITIONAL(BUILD_DOC, test "x$czmq_build_doc" = "xyes")
 
+AC_ARG_ENABLE([dist_cmakefiles],
+    AS_HELP_STRING([--enable-dist_cmakefiles],
+        [Distribute CMakeLists.txt and related files [default depends: on if present and not cross compiling]]),
+    [enable_dist_cmakefiles=$enableval],
+    [AC_MSG_CHECKING([for presence of CMake recipes])
+if test "x$cross_compiling" = "xyes"; then
+     enable_dist_cmakefiles=no
+else
+     AC_CHECK_FILE($srcdir/CMakeLists.txt, [enable_dist_cmakefiles=yes], [enable_dist_cmakefiles=no])
+fi
+     AC_MSG_RESULT([$enable_dist_cmakefiles])])
+AM_CONDITIONAL(ENABLE_DIST_CMAKEFILES, test "x$enable_dist_cmakefiles" = "xyes")
+
 # Check for zmakecert intent
 AC_ARG_ENABLE([zmakecert],
     AS_HELP_STRING([--enable-zmakecert],
@@ -426,6 +439,33 @@ else
     AC_SUBST(pkg_config_defines, "")
 fi
 
+AC_ARG_ENABLE([Werror],
+    AS_HELP_STRING([--enable-Werror],
+        [Add -Wall -Werror to GCC/GXX arguments [default=no; default=auto if nothing specified]]),
+    [AS_IF([test -n "$enableval"], [enable_Werror=$enableval], [enable_Werror=auto])],
+    [enable_Werror=no])
+
+AS_IF([test "x$enable_Werror" = "xyes" || test "x$enable_Werror" = "xauto"],
+    [AS_IF([test -n "$CC"],[AS_IF([$CC --version 2>&1 | grep 'Free Software Foundation' > /dev/null],
+        [AC_MSG_NOTICE([Enabling pedantic errors for GNU C])
+         CFLAGS="$CFLAGS -Wall -Werror"],
+        [AC_MSG_NOTICE([Not enabling pedantic errors: compiler not supported by this recipe (not GNU C)])
+         AS_IF([test "x$enable_Werror" = "xyes"], [AC_MSG_ERROR([--enable-Werror=yes was requested and can not be satisfied for C: $CC])])
+        ])])
+     AS_IF([test -n "$CXX"],[AS_IF([$CXX --version 2>&1 | grep 'Free Software Foundation' > /dev/null],
+        [AC_MSG_NOTICE([Enabling pedantic errors for GNU C++])
+         CXXFLAGS="$CXXFLAGS -Wall -Werror"],
+        [AC_MSG_NOTICE([Not enabling pedantic errors: compiler not supported by this recipe (not GNU C++)])
+         AS_IF([test "x$enable_Werror" = "xyes"], [AC_MSG_ERROR([--enable-Werror=yes was requested and can not be satisfied for C++: $CXX])])
+        ])])
+     AS_IF([test -n "$CPP"],[AS_IF([$CPP --version 2>&1 | grep 'Free Software Foundation' > /dev/null],
+        [AC_MSG_NOTICE([Enabling pedantic errors for GNU CPP preprocessor])
+         CPPFLAGS="$CPPFLAGS -Wall -Werror"],
+        [AC_MSG_NOTICE([Not enabling pedantic errors: preprocessor not supported by this recipe (not GNU CPP)])
+         AS_IF([test "x$enable_Werror" = "xyes"], [AC_MSG_ERROR([--enable-Werror=yes was requested and can not be satisfied for CPP: $CPP])])
+        ])])
+])
+
 # Specify output files
 AC_CONFIG_FILES([Makefile
                  doc/Makefile
@@ -466,6 +506,8 @@ echo Package version............... : $PACKAGE-$VERSION
 echo
 echo C compiler.................... : $CC
 echo C compiler flags.............. : $CFLAGS
+echo C++ compiler.................. : $CXX
+echo C++ compiler flags............ : $CXXFLAGS
 echo Configure date................ : $BUILD_DATE
 echo Build architecture............ : $BUILD_ARCH
 echo Build docs.................... : $czmq_build_doc
@@ -487,7 +529,7 @@ echo
 echo '##########################################################################'
 
 echo
-echo Configure complete! Now procced with:
+echo Configure complete! Now proceed with:
 echo "    - 'make'               compile the project"
 echo "    - 'make check'         run the project's selftest"
 echo "    - 'make install'       install the project to $prefix"

{'commit': 'diff --git a/Makefile.am b/Makefile.am\nindex 0d08120d..7fc2aa01 100644\n--- a/Makefile.am\n+++ b/Makefile.am\n@@ -25,13 +25,18 @@ noinst_PROGRAMS =\n check_PROGRAMS =\n noinst_LTLIBRARIES =\n TESTS =\n+EXTRA_DIST =\n \n-EXTRA_DIST = \\\n-    CMakeLists.txt \\\n+if ENABLE_DIST_CMAKEFILES\n+EXTRA_DIST += \\\n     Findlibzmq.cmake \\\n     Finduuid.cmake \\\n     Findsystemd.cmake \\\n     src/CMakeLists-local.txt \\\n+    CMakeLists.txt\n+endif\n+\n+EXTRA_DIST += \\\n     src/zsock_option.inc \\\n     src/zgossip_engine.inc \\\n     src/zhash_primes.inc \\\ndiff --git a/bindings/jni/ci_build.sh b/bindings/jni/ci_build.sh\nindex f5f5483a..24168269 100755\n--- a/bindings/jni/ci_build.sh\n+++ b/bindings/jni/ci_build.sh\n@@ -31,6 +31,14 @@ fi\n if [ -e buildconf ]; then\n     ./buildconf 2> /dev/null\n fi\n+if [ ! -e autogen.sh ] && [ ! -e buildconf ] && [ ! -e ./configure ] && [ -s ./configure.ac ]; then\n+    libtoolize --copy --force && \\\n+    aclocal -I . && \\\n+    autoheader && \\\n+    automake --add-missing --copy && \\\n+    autoconf || \\\n+    autoreconf -fiv\n+fi\n ./configure "${CONFIG_OPTS[@]}"\n make -j4\n make install\ndiff --git a/bindings/lua_ffi/czmq_ffi.lua b/bindings/lua_ffi/czmq_ffi.lua\nnew file mode 100644\nindex 00000000..5fb9da73\n--- /dev/null\n+++ b/bindings/lua_ffi/czmq_ffi.lua\n@@ -0,0 +1,3414 @@\n+--------------------------------------------------------------------------------\n+--  THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY  -\n+--  Read the zproject/README.md for information about making permanent changes. -\n+--------------------------------------------------------------------------------\n+\n+czmq_ffi = {}\n+czmq_ffi.ffi = require ("ffi")\n+\n+-- typedefs simulating C standard library\n+-- see https://github.com/eliben/pycparser/blob/master/utils/fake_libc_include/_fake_defines.h\n+czmq_ffi.ffi.cdef [[\n+typedef struct __FILE FILE;\n+typedef int time_t;\n+typedef int off_t;\n+]]\n+\n+-- czmq_prelude.h\n+czmq_ffi.ffi.cdef [[\n+typedef unsigned char byte;\n+typedef int SOCKET;\n+]]\n+czmq_ffi.ffi.cdef [[\n+typedef struct _zactor_t zactor_t;\n+typedef struct _zsock_t zsock_t;\n+typedef struct _zmsg_t zmsg_t;\n+typedef struct _zarmour_t zarmour_t;\n+typedef struct _zchunk_t zchunk_t;\n+typedef struct _char_t char_t;\n+typedef struct _zcert_t zcert_t;\n+typedef struct _zlist_t zlist_t;\n+typedef struct _zcertstore_t zcertstore_t;\n+typedef struct _zframe_t zframe_t;\n+typedef struct _zclock_t zclock_t;\n+typedef struct _msecs_t msecs_t;\n+typedef struct _zconfig_t zconfig_t;\n+typedef struct _zdigest_t zdigest_t;\n+typedef struct _zdir_t zdir_t;\n+typedef struct _zhash_t zhash_t;\n+typedef struct _zdir_patch_t zdir_patch_t;\n+typedef struct _zfile_t zfile_t;\n+typedef struct _zhashx_t zhashx_t;\n+typedef struct _zlistx_t zlistx_t;\n+typedef struct _ziflist_t ziflist_t;\n+typedef struct _zloop_t zloop_t;\n+typedef struct _zmq_pollitem_t zmq_pollitem_t;\n+typedef struct _zpoller_t zpoller_t;\n+typedef struct _zproc_t zproc_t;\n+typedef struct _va_list_t va_list_t;\n+typedef struct _socket_t socket_t;\n+typedef struct _zstr_t zstr_t;\n+typedef struct _ztimerset_t ztimerset_t;\n+typedef struct _ztrie_t ztrie_t;\n+typedef struct _zuuid_t zuuid_t;\n+// Actors get a pipe and arguments from caller\n+typedef void (zactor_fn) (\n+    zsock_t *pipe, void *args);\n+\n+// Loaders retrieve certificates from an arbitrary source.\n+typedef void (zcertstore_loader) (\n+    zcertstore_t *self);\n+\n+// Destructor for loader state.\n+typedef void (zcertstore_destructor) (\n+    void **self_p);\n+\n+// \n+typedef int (zconfig_fct) (\n+    zconfig_t *self, void *arg, int level);\n+\n+// Callback function for zhash_freefn method\n+typedef void (zhash_free_fn) (\n+    void *data);\n+\n+// Destroy an item\n+typedef void (zhashx_destructor_fn) (\n+    void **item);\n+\n+// Duplicate an item\n+typedef void * (zhashx_duplicator_fn) (\n+    const void *item);\n+\n+// Compare two items, for sorting\n+typedef int (zhashx_comparator_fn) (\n+    const void *item1, const void *item2);\n+\n+// compare two items, for sorting\n+typedef void (zhashx_free_fn) (\n+    void *data);\n+\n+// compare two items, for sorting\n+typedef size_t (zhashx_hash_fn) (\n+    const void *key);\n+\n+// Serializes an item to a longstr.                       \n+// The caller takes ownership of the newly created object.\n+typedef char * (zhashx_serializer_fn) (\n+    const void *item);\n+\n+// Deserializes a longstr into an item.                   \n+// The caller takes ownership of the newly created object.\n+typedef void * (zhashx_deserializer_fn) (\n+    const char *item_str);\n+\n+// Comparison function e.g. for sorting and removing.\n+typedef int (zlist_compare_fn) (\n+    void *item1, void *item2);\n+\n+// Callback function for zlist_freefn method\n+typedef void (zlist_free_fn) (\n+    void *data);\n+\n+// Destroy an item\n+typedef void (zlistx_destructor_fn) (\n+    void **item);\n+\n+// Duplicate an item\n+typedef void * (zlistx_duplicator_fn) (\n+    const void *item);\n+\n+// Compare two items, for sorting\n+typedef int (zlistx_comparator_fn) (\n+    const void *item1, const void *item2);\n+\n+// Callback function for reactor socket activity\n+typedef int (zloop_reader_fn) (\n+    zloop_t *loop, zsock_t *reader, void *arg);\n+\n+// Callback function for reactor events (low-level)\n+typedef int (zloop_fn) (\n+    zloop_t *loop, zmq_pollitem_t *item, void *arg);\n+\n+// Callback for reactor timer events\n+typedef int (zloop_timer_fn) (\n+    zloop_t *loop, int timer_id, void *arg);\n+\n+// Callback function for timer event.\n+typedef void (ztimerset_fn) (\n+    int timer_id, void *arg);\n+\n+// Callback function for ztrie_node to destroy node data.\n+typedef void (ztrie_destroy_data_fn) (\n+    void **data);\n+\n+// CLASS: zactor\n+// Create a new actor passing arbitrary arguments reference.\n+zactor_t *\n+    zactor_new (zactor_fn task, void *args);\n+\n+// Destroy an actor.\n+void\n+    zactor_destroy (zactor_t **self_p);\n+\n+// Send a zmsg message to the actor, take ownership of the message\n+// and destroy when it has been sent.                             \n+int\n+    zactor_send (zactor_t *self, zmsg_t **msg_p);\n+\n+// Receive a zmsg message from the actor. Returns NULL if the actor \n+// was interrupted before the message could be received, or if there\n+// was a timeout on the actor.                                      \n+zmsg_t *\n+    zactor_recv (zactor_t *self);\n+\n+// Probe the supplied object, and report if it looks like a zactor_t.\n+bool\n+    zactor_is (void *self);\n+\n+// Probe the supplied reference. If it looks like a zactor_t instance,\n+// return the underlying libzmq actor handle; else if it looks like   \n+// a libzmq actor handle, return the supplied value.                  \n+void *\n+    zactor_resolve (void *self);\n+\n+// Return the actor\'s zsock handle. Use this when you absolutely need\n+// to work with the zsock instance rather than the actor.            \n+zsock_t *\n+    zactor_sock (zactor_t *self);\n+\n+// Self test of this class.\n+void\n+    zactor_test (bool verbose);\n+\n+// CLASS: zarmour\n+// Create a new zarmour\n+zarmour_t *\n+    zarmour_new (void);\n+\n+// Destroy the zarmour\n+void\n+    zarmour_destroy (zarmour_t **self_p);\n+\n+// Encode a stream of bytes into an armoured string. Returns the armoured\n+// string, or NULL if there was insufficient memory available to allocate\n+// a new string.                                                         \n+char *\n+    zarmour_encode (zarmour_t *self, const byte *data, size_t size);\n+\n+// Decode an armoured string into a chunk. The decoded output is    \n+// null-terminated, so it may be treated as a string, if that\'s what\n+// it was prior to encoding.                                        \n+zchunk_t *\n+    zarmour_decode (zarmour_t *self, const char *data);\n+\n+// Get the mode property.\n+int\n+    zarmour_mode (zarmour_t *self);\n+\n+// Get printable string for mode.\n+const char *\n+    zarmour_mode_str (zarmour_t *self);\n+\n+// Set the mode property.\n+void\n+    zarmour_set_mode (zarmour_t *self, int mode);\n+\n+// Return true if padding is turned on.\n+bool\n+    zarmour_pad (zarmour_t *self);\n+\n+// Turn padding on or off. Default is on.\n+void\n+    zarmour_set_pad (zarmour_t *self, bool pad);\n+\n+// Get the padding character.\n+char\n+    zarmour_pad_char (zarmour_t *self);\n+\n+// Set the padding character.\n+void\n+    zarmour_set_pad_char (zarmour_t *self, char pad_char);\n+\n+// Return if splitting output into lines is turned on. Default is off.\n+bool\n+    zarmour_line_breaks (zarmour_t *self);\n+\n+// Turn splitting output into lines on or off.\n+void\n+    zarmour_set_line_breaks (zarmour_t *self, bool line_breaks);\n+\n+// Get the line length used for splitting lines.\n+size_t\n+    zarmour_line_length (zarmour_t *self);\n+\n+// Set the line length used for splitting lines.\n+void\n+    zarmour_set_line_length (zarmour_t *self, size_t line_length);\n+\n+// Print properties of object\n+void\n+    zarmour_print (zarmour_t *self);\n+\n+// Self test of this class.\n+void\n+    zarmour_test (bool verbose);\n+\n+// CLASS: zcert\n+// Create and initialize a new certificate in memory\n+zcert_t *\n+    zcert_new (void);\n+\n+// Accepts public/secret key pair from caller\n+zcert_t *\n+    zcert_new_from (const byte *public_key, const byte *secret_key);\n+\n+// Load certificate from file\n+zcert_t *\n+    zcert_load (const char *filename);\n+\n+// Destroy a certificate in memory\n+void\n+    zcert_destroy (zcert_t **self_p);\n+\n+// Return public part of key pair as 32-byte binary string\n+const byte *\n+    zcert_public_key (zcert_t *self);\n+\n+// Return secret part of key pair as 32-byte binary string\n+const byte *\n+    zcert_secret_key (zcert_t *self);\n+\n+// Return public part of key pair as Z85 armored string\n+const char *\n+    zcert_public_txt (zcert_t *self);\n+\n+// Return secret part of key pair as Z85 armored string\n+const char *\n+    zcert_secret_txt (zcert_t *self);\n+\n+// Set certificate metadata from formatted string.\n+void\n+    zcert_set_meta (zcert_t *self, const char *name, const char *format, ...);\n+\n+// Unset certificate metadata.\n+void\n+    zcert_unset_meta (zcert_t *self, const char *name);\n+\n+// Get metadata value from certificate; if the metadata value doesn\'t\n+// exist, returns NULL.                                              \n+const char *\n+    zcert_meta (zcert_t *self, const char *name);\n+\n+// Get list of metadata fields from certificate. Caller is responsible for\n+// destroying list. Caller should not modify the values of list items.    \n+zlist_t *\n+    zcert_meta_keys (zcert_t *self);\n+\n+// Save full certificate (public + secret) to file for persistent storage  \n+// This creates one public file and one secret file (filename + "_secret").\n+int\n+    zcert_save (zcert_t *self, const char *filename);\n+\n+// Save public certificate only to file for persistent storage\n+int\n+    zcert_save_public (zcert_t *self, const char *filename);\n+\n+// Save secret certificate only to file for persistent storage\n+int\n+    zcert_save_secret (zcert_t *self, const char *filename);\n+\n+// Apply certificate to socket, i.e. use for CURVE security on socket.\n+// If certificate was loaded from public file, the secret key will be \n+// undefined, and this certificate will not work successfully.        \n+void\n+    zcert_apply (zcert_t *self, void *socket);\n+\n+// Return copy of certificate; if certificate is NULL or we exhausted\n+// heap memory, returns NULL.                                        \n+zcert_t *\n+    zcert_dup (zcert_t *self);\n+\n+// Return true if two certificates have the same keys\n+bool\n+    zcert_eq (zcert_t *self, zcert_t *compare);\n+\n+// Print certificate contents to stdout\n+void\n+    zcert_print (zcert_t *self);\n+\n+// Self test of this class\n+void\n+    zcert_test (bool verbose);\n+\n+// CLASS: zcertstore\n+// Create a new certificate store from a disk directory, loading and        \n+// indexing all certificates in that location. The directory itself may be  \n+// absent, and created later, or modified at any time. The certificate store\n+// is automatically refreshed on any zcertstore_lookup() call. If the       \n+// location is specified as NULL, creates a pure-memory store, which you    \n+// can work with by inserting certificates at runtime.                      \n+zcertstore_t *\n+    zcertstore_new (const char *location);\n+\n+// Destroy a certificate store object in memory. Does not affect anything\n+// stored on disk.                                                       \n+void\n+    zcertstore_destroy (zcertstore_t **self_p);\n+\n+// Override the default disk loader with a custom loader fn.\n+void\n+    zcertstore_set_loader (zcertstore_t *self, zcertstore_loader loader, zcertstore_destructor destructor, void *state);\n+\n+// Look up certificate by public key, returns zcert_t object if found,\n+// else returns NULL. The public key is provided in Z85 text format.  \n+zcert_t *\n+    zcertstore_lookup (zcertstore_t *self, const char *public_key);\n+\n+// Insert certificate into certificate store in memory. Note that this\n+// does not save the certificate to disk. To do that, use zcert_save()\n+// directly on the certificate. Takes ownership of zcert_t object.    \n+void\n+    zcertstore_insert (zcertstore_t *self, zcert_t **cert_p);\n+\n+// Empty certificate hashtable. This wrapper exists to be friendly to bindings,\n+// which don\'t usually have access to struct internals.                        \n+void\n+    zcertstore_empty (zcertstore_t *self);\n+\n+// Print list of certificates in store to logging facility\n+void\n+    zcertstore_print (zcertstore_t *self);\n+\n+// Self test of this class\n+void\n+    zcertstore_test (bool verbose);\n+\n+// CLASS: zchunk\n+// Create a new chunk of the specified size. If you specify the data, it   \n+// is copied into the chunk. If you do not specify the data, the chunk is  \n+// allocated and left empty, and you can then add data using zchunk_append.\n+zchunk_t *\n+    zchunk_new (const void *data, size_t size);\n+\n+// Destroy a chunk\n+void\n+    zchunk_destroy (zchunk_t **self_p);\n+\n+// Resizes chunk max_size as requested; chunk_cur size is set to zero\n+void\n+    zchunk_resize (zchunk_t *self, size_t size);\n+\n+// Return chunk cur size\n+size_t\n+    zchunk_size (zchunk_t *self);\n+\n+// Return chunk max size\n+size_t\n+    zchunk_max_size (zchunk_t *self);\n+\n+// Return chunk data\n+byte *\n+    zchunk_data (zchunk_t *self);\n+\n+// Set chunk data from user-supplied data; truncate if too large. Data may\n+// be null. Returns actual size of chunk                                  \n+size_t\n+    zchunk_set (zchunk_t *self, const void *data, size_t size);\n+\n+// Fill chunk data from user-supplied octet\n+size_t\n+    zchunk_fill (zchunk_t *self, byte filler, size_t size);\n+\n+// Append user-supplied data to chunk, return resulting chunk size. If the \n+// data would exceeded the available space, it is truncated. If you want to\n+// grow the chunk to accommodate new data, use the zchunk_extend method.   \n+size_t\n+    zchunk_append (zchunk_t *self, const void *data, size_t size);\n+\n+// Append user-supplied data to chunk, return resulting chunk size. If the\n+// data would exceeded the available space, the chunk grows in size.      \n+size_t\n+    zchunk_extend (zchunk_t *self, const void *data, size_t size);\n+\n+// Copy as much data from \'source\' into the chunk as possible; returns the  \n+// new size of chunk. If all data from \'source\' is used, returns exhausted  \n+// on the source chunk. Source can be consumed as many times as needed until\n+// it is exhausted. If source was already exhausted, does not change chunk. \n+size_t\n+    zchunk_consume (zchunk_t *self, zchunk_t *source);\n+\n+// Returns true if the chunk was exhausted by consume methods, or if the\n+// chunk has a size of zero.                                            \n+bool\n+    zchunk_exhausted (zchunk_t *self);\n+\n+// Read chunk from an open file descriptor\n+zchunk_t *\n+    zchunk_read (FILE *handle, size_t bytes);\n+\n+// Write chunk to an open file descriptor\n+int\n+    zchunk_write (zchunk_t *self, FILE *handle);\n+\n+// Try to slurp an entire file into a chunk. Will read up to maxsize of  \n+// the file. If maxsize is 0, will attempt to read the entire file and   \n+// fail with an assertion if that cannot fit into memory. Returns a new  \n+// chunk containing the file data, or NULL if the file could not be read.\n+zchunk_t *\n+    zchunk_slurp (const char *filename, size_t maxsize);\n+\n+// Create copy of chunk, as new chunk object. Returns a fresh zchunk_t   \n+// object, or null if there was not enough heap memory. If chunk is null,\n+// returns null.                                                         \n+zchunk_t *\n+    zchunk_dup (zchunk_t *self);\n+\n+// Return chunk data encoded as printable hex string. Caller must free\n+// string when finished with it.                                      \n+char *\n+    zchunk_strhex (zchunk_t *self);\n+\n+// Return chunk data copied into freshly allocated string\n+// Caller must free string when finished with it.        \n+char *\n+    zchunk_strdup (zchunk_t *self);\n+\n+// Return TRUE if chunk body is equal to string, excluding terminator\n+bool\n+    zchunk_streq (zchunk_t *self, const char *string);\n+\n+// Transform zchunk into a zframe that can be sent in a message.\n+zframe_t *\n+    zchunk_pack (zchunk_t *self);\n+\n+// Transform a zframe into a zchunk.\n+zchunk_t *\n+    zchunk_unpack (zframe_t *frame);\n+\n+// Calculate SHA1 digest for chunk, using zdigest class.\n+const char *\n+    zchunk_digest (zchunk_t *self);\n+\n+// Dump chunk to FILE stream, for debugging and tracing.\n+void\n+    zchunk_fprint (zchunk_t *self, FILE *file);\n+\n+// Dump message to stderr, for debugging and tracing.\n+// See zchunk_fprint for details                     \n+void\n+    zchunk_print (zchunk_t *self);\n+\n+// Probe the supplied object, and report if it looks like a zchunk_t.\n+bool\n+    zchunk_is (void *self);\n+\n+// Self test of this class.\n+void\n+    zchunk_test (bool verbose);\n+\n+// CLASS: zclock\n+// Sleep for a number of milliseconds\n+void\n+    zclock_sleep (int msecs);\n+\n+// Return current system clock as milliseconds. Note that this clock can  \n+// jump backwards (if the system clock is changed) so is unsafe to use for\n+// timers and time offsets. Use zclock_mono for that instead.             \n+int64_t\n+    zclock_time (void);\n+\n+// Return current monotonic clock in milliseconds. Use this when you compute\n+// time offsets. The monotonic clock is not affected by system changes and  \n+// so will never be reset backwards, unlike a system clock.                 \n+int64_t\n+    zclock_mono (void);\n+\n+// Return current monotonic clock in microseconds. Use this when you compute\n+// time offsets. The monotonic clock is not affected by system changes and  \n+// so will never be reset backwards, unlike a system clock.                 \n+int64_t\n+    zclock_usecs (void);\n+\n+// Return formatted date/time as fresh string. Free using zstr_free().\n+char *\n+    zclock_timestr (void);\n+\n+// Self test of this class.\n+void\n+    zclock_test (bool verbose);\n+\n+// CLASS: zconfig\n+// Create new config item\n+zconfig_t *\n+    zconfig_new (const char *name, zconfig_t *parent);\n+\n+// Destroy a config item and all its children\n+void\n+    zconfig_destroy (zconfig_t **self_p);\n+\n+// Load a config tree from a specified ZPL text file; returns a zconfig_t  \n+// reference for the root, if the file exists and is readable. Returns NULL\n+// if the file does not exist.                                             \n+zconfig_t *\n+    zconfig_load (const char *filename);\n+\n+// Equivalent to zconfig_load, taking a format string instead of a fixed\n+// filename.                                                            \n+zconfig_t *\n+    zconfig_loadf (const char *format, ...);\n+\n+// Return name of config item\n+char *\n+    zconfig_name (zconfig_t *self);\n+\n+// Return value of config item\n+char *\n+    zconfig_value (zconfig_t *self);\n+\n+// Insert or update configuration key with value\n+void\n+    zconfig_put (zconfig_t *self, const char *path, const char *value);\n+\n+// Equivalent to zconfig_put, accepting a format specifier and variable\n+// argument list, instead of a single string value.                    \n+void\n+    zconfig_putf (zconfig_t *self, const char *path, const char *format, ...);\n+\n+// Get value for config item into a string value; leading slash is optional\n+// and ignored.                                                            \n+char *\n+    zconfig_get (zconfig_t *self, const char *path, const char *default_value);\n+\n+// Set config item name, name may be NULL\n+void\n+    zconfig_set_name (zconfig_t *self, const char *name);\n+\n+// Set new value for config item. The new value may be a string, a printf  \n+// format, or NULL. Note that if string may possibly contain \'%\', or if it \n+// comes from an insecure source, you must use \'%s\' as the format, followed\n+// by the string.                                                          \n+void\n+    zconfig_set_value (zconfig_t *self, const char *format, ...);\n+\n+// Find our first child, if any\n+zconfig_t *\n+    zconfig_child (zconfig_t *self);\n+\n+// Find our first sibling, if any\n+zconfig_t *\n+    zconfig_next (zconfig_t *self);\n+\n+// Find a config item along a path; leading slash is optional and ignored.\n+zconfig_t *\n+    zconfig_locate (zconfig_t *self, const char *path);\n+\n+// Locate the last config item at a specified depth\n+zconfig_t *\n+    zconfig_at_depth (zconfig_t *self, int level);\n+\n+// Execute a callback for each config item in the tree; returns zero if\n+// successful, else -1.                                                \n+int\n+    zconfig_execute (zconfig_t *self, zconfig_fct handler, void *arg);\n+\n+// Add comment to config item before saving to disk. You can add as many\n+// comment lines as you like. If you use a null format, all comments are\n+// deleted.                                                             \n+void\n+    zconfig_set_comment (zconfig_t *self, const char *format, ...);\n+\n+// Return comments of config item, as zlist.\n+zlist_t *\n+    zconfig_comments (zconfig_t *self);\n+\n+// Save a config tree to a specified ZPL text file, where a filename\n+// "-" means dump to standard output.                               \n+int\n+    zconfig_save (zconfig_t *self, const char *filename);\n+\n+// Equivalent to zconfig_save, taking a format string instead of a fixed\n+// filename.                                                            \n+int\n+    zconfig_savef (zconfig_t *self, const char *format, ...);\n+\n+// Report filename used during zconfig_load, or NULL if none\n+const char *\n+    zconfig_filename (zconfig_t *self);\n+\n+// Reload config tree from same file that it was previously loaded from.\n+// Returns 0 if OK, -1 if there was an error (and then does not change  \n+// existing data).                                                      \n+int\n+    zconfig_reload (zconfig_t **self_p);\n+\n+// Load a config tree from a memory chunk\n+zconfig_t *\n+    zconfig_chunk_load (zchunk_t *chunk);\n+\n+// Save a config tree to a new memory chunk\n+zchunk_t *\n+    zconfig_chunk_save (zconfig_t *self);\n+\n+// Load a config tree from a null-terminated string\n+zconfig_t *\n+    zconfig_str_load (const char *string);\n+\n+// Save a config tree to a new null terminated string\n+char *\n+    zconfig_str_save (zconfig_t *self);\n+\n+// Return true if a configuration tree was loaded from a file and that\n+// file has changed in since the tree was loaded.                     \n+bool\n+    zconfig_has_changed (zconfig_t *self);\n+\n+// Print the config file to open stream\n+void\n+    zconfig_fprint (zconfig_t *self, FILE *file);\n+\n+// Print properties of object\n+void\n+    zconfig_print (zconfig_t *self);\n+\n+// Self test of this class\n+void\n+    zconfig_test (bool verbose);\n+\n+// CLASS: zdigest\n+// Constructor - creates new digest object, which you use to build up a\n+// digest by repeatedly calling zdigest_update() on chunks of data.    \n+zdigest_t *\n+    zdigest_new (void);\n+\n+// Destroy a digest object\n+void\n+    zdigest_destroy (zdigest_t **self_p);\n+\n+// Add buffer into digest calculation\n+void\n+    zdigest_update (zdigest_t *self, const byte *buffer, size_t length);\n+\n+// Return final digest hash data. If built without crypto support,\n+// returns NULL.                                                  \n+const byte *\n+    zdigest_data (zdigest_t *self);\n+\n+// Return final digest hash size\n+size_t\n+    zdigest_size (zdigest_t *self);\n+\n+// Return digest as printable hex string; caller should not modify nor   \n+// free this string. After calling this, you may not use zdigest_update()\n+// on the same digest. If built without crypto support, returns NULL.    \n+char *\n+    zdigest_string (zdigest_t *self);\n+\n+// Self test of this class.\n+void\n+    zdigest_test (bool verbose);\n+\n+// CLASS: zdir\n+// Create a new directory item that loads in the full tree of the specified\n+// path, optionally located under some parent path. If parent is "-", then \n+// loads only the top-level directory, and does not use parent as a path.  \n+zdir_t *\n+    zdir_new (const char *path, const char *parent);\n+\n+// Destroy a directory tree and all children it contains.\n+void\n+    zdir_destroy (zdir_t **self_p);\n+\n+// Return directory path\n+const char *\n+    zdir_path (zdir_t *self);\n+\n+// Return last modification time for directory.\n+time_t\n+    zdir_modified (zdir_t *self);\n+\n+// Return total hierarchy size, in bytes of data contained in all files\n+// in the directory tree.                                              \n+off_t\n+    zdir_cursize (zdir_t *self);\n+\n+// Return directory count\n+size_t\n+    zdir_count (zdir_t *self);\n+\n+// Returns a sorted list of zfile objects; Each entry in the list is a pointer\n+// to a zfile_t item already allocated in the zdir tree. Do not destroy the   \n+// original zdir tree until you are done with this list.                      \n+zlist_t *\n+    zdir_list (zdir_t *self);\n+\n+// Remove directory, optionally including all files that it contains, at  \n+// all levels. If force is false, will only remove the directory if empty.\n+// If force is true, will remove all files and all subdirectories.        \n+void\n+    zdir_remove (zdir_t *self, bool force);\n+\n+// Calculate differences between two versions of a directory tree.    \n+// Returns a list of zdir_patch_t patches. Either older or newer may  \n+// be null, indicating the directory is empty/absent. If alias is set,\n+// generates virtual filename (minus path, plus alias).               \n+zlist_t *\n+    zdir_diff (zdir_t *older, zdir_t *newer, const char *alias);\n+\n+// Return full contents of directory as a zdir_patch list.\n+zlist_t *\n+    zdir_resync (zdir_t *self, const char *alias);\n+\n+// Load directory cache; returns a hash table containing the SHA-1 digests\n+// of every file in the tree. The cache is saved between runs in .cache.  \n+zhash_t *\n+    zdir_cache (zdir_t *self);\n+\n+// Print contents of directory to open stream\n+void\n+    zdir_fprint (zdir_t *self, FILE *file, int indent);\n+\n+// Print contents of directory to stdout\n+void\n+    zdir_print (zdir_t *self, int indent);\n+\n+// Create a new zdir_watch actor instance:                       \n+//                                                               \n+//     zactor_t *watch = zactor_new (zdir_watch, NULL);          \n+//                                                               \n+// Destroy zdir_watch instance:                                  \n+//                                                               \n+//     zactor_destroy (&watch);                                  \n+//                                                               \n+// Enable verbose logging of commands and activity:              \n+//                                                               \n+//     zstr_send (watch, "VERBOSE");                             \n+//                                                               \n+// Subscribe to changes to a directory path:                     \n+//                                                               \n+//     zsock_send (watch, "ss", "SUBSCRIBE", "directory_path");  \n+//                                                               \n+// Unsubscribe from changes to a directory path:                 \n+//                                                               \n+//     zsock_send (watch, "ss", "UNSUBSCRIBE", "directory_path");\n+//                                                               \n+// Receive directory changes:                                    \n+//     zsock_recv (watch, "sp", &path, &patches);                \n+//                                                               \n+//     // Delete the received data.                              \n+//     free (path);                                              \n+//     zlist_destroy (&patches);                                 \n+void\n+    zdir_watch (zsock_t *pipe, void *unused);\n+\n+// Self test of this class.\n+void\n+    zdir_test (bool verbose);\n+\n+// CLASS: zdir_patch\n+// Create new patch\n+zdir_patch_t *\n+    zdir_patch_new (const char *path, zfile_t *file, int op, const char *alias);\n+\n+// Destroy a patch\n+void\n+    zdir_patch_destroy (zdir_patch_t **self_p);\n+\n+// Create copy of a patch. If the patch is null, or memory was exhausted,\n+// returns null.                                                         \n+zdir_patch_t *\n+    zdir_patch_dup (zdir_patch_t *self);\n+\n+// Return patch file directory path\n+const char *\n+    zdir_patch_path (zdir_patch_t *self);\n+\n+// Return patch file item\n+zfile_t *\n+    zdir_patch_file (zdir_patch_t *self);\n+\n+// Return operation\n+int\n+    zdir_patch_op (zdir_patch_t *self);\n+\n+// Return patch virtual file path\n+const char *\n+    zdir_patch_vpath (zdir_patch_t *self);\n+\n+// Calculate hash digest for file (create only)\n+void\n+    zdir_patch_digest_set (zdir_patch_t *self);\n+\n+// Return hash digest for patch file\n+const char *\n+    zdir_patch_digest (zdir_patch_t *self);\n+\n+// Self test of this class.\n+void\n+    zdir_patch_test (bool verbose);\n+\n+// CLASS: zfile\n+// If file exists, populates properties. CZMQ supports portable symbolic\n+// links, which are files with the extension ".ln". A symbolic link is a\n+// text file containing one line, the filename of a target file. Reading\n+// data from the symbolic link actually reads from the target file. Path\n+// may be NULL, in which case it is not used.                           \n+zfile_t *\n+    zfile_new (const char *path, const char *name);\n+\n+// Destroy a file item\n+void\n+    zfile_destroy (zfile_t **self_p);\n+\n+// Duplicate a file item, returns a newly constructed item. If the file\n+// is null, or memory was exhausted, returns null.                     \n+zfile_t *\n+    zfile_dup (zfile_t *self);\n+\n+// Return file name, remove path if provided\n+const char *\n+    zfile_filename (zfile_t *self, const char *path);\n+\n+// Refresh file properties from disk; this is not done automatically   \n+// on access methods, otherwise it is not possible to compare directory\n+// snapshots.                                                          \n+void\n+    zfile_restat (zfile_t *self);\n+\n+// Return when the file was last modified. If you want this to reflect the\n+// current situation, call zfile_restat before checking this property.    \n+time_t\n+    zfile_modified (zfile_t *self);\n+\n+// Return the last-known size of the file. If you want this to reflect the\n+// current situation, call zfile_restat before checking this property.    \n+off_t\n+    zfile_cursize (zfile_t *self);\n+\n+// Return true if the file is a directory. If you want this to reflect   \n+// any external changes, call zfile_restat before checking this property.\n+bool\n+    zfile_is_directory (zfile_t *self);\n+\n+// Return true if the file is a regular file. If you want this to reflect\n+// any external changes, call zfile_restat before checking this property.\n+bool\n+    zfile_is_regular (zfile_t *self);\n+\n+// Return true if the file is readable by this process. If you want this to\n+// reflect any external changes, call zfile_restat before checking this    \n+// property.                                                               \n+bool\n+    zfile_is_readable (zfile_t *self);\n+\n+// Return true if the file is writeable by this process. If you want this \n+// to reflect any external changes, call zfile_restat before checking this\n+// property.                                                              \n+bool\n+    zfile_is_writeable (zfile_t *self);\n+\n+// Check if file has stopped changing and can be safely processed.\n+// Updates the file statistics from disk at every call.           \n+bool\n+    zfile_is_stable (zfile_t *self);\n+\n+// Return true if the file was changed on disk since the zfile_t object\n+// was created, or the last zfile_restat() call made on it.            \n+bool\n+    zfile_has_changed (zfile_t *self);\n+\n+// Remove the file from disk\n+void\n+    zfile_remove (zfile_t *self);\n+\n+// Open file for reading                             \n+// Returns 0 if OK, -1 if not found or not accessible\n+int\n+    zfile_input (zfile_t *self);\n+\n+// Open file for writing, creating directory if needed               \n+// File is created if necessary; chunks can be written to file at any\n+// location. Returns 0 if OK, -1 if error.                           \n+int\n+    zfile_output (zfile_t *self);\n+\n+// Read chunk from file at specified position. If this was the last chunk,\n+// sets the eof property. Returns a null chunk in case of error.          \n+zchunk_t *\n+    zfile_read (zfile_t *self, size_t bytes, off_t offset);\n+\n+// Returns true if zfile_read() just read the last chunk in the file.\n+bool\n+    zfile_eof (zfile_t *self);\n+\n+// Write chunk to file at specified position\n+// Return 0 if OK, else -1                  \n+int\n+    zfile_write (zfile_t *self, zchunk_t *chunk, off_t offset);\n+\n+// Read next line of text from file. Returns a pointer to the text line,\n+// or NULL if there was nothing more to read from the file.             \n+const char *\n+    zfile_readln (zfile_t *self);\n+\n+// Close file, if open\n+void\n+    zfile_close (zfile_t *self);\n+\n+// Return file handle, if opened\n+FILE *\n+    zfile_handle (zfile_t *self);\n+\n+// Calculate SHA1 digest for file, using zdigest class.\n+const char *\n+    zfile_digest (zfile_t *self);\n+\n+// Self test of this class.\n+void\n+    zfile_test (bool verbose);\n+\n+// CLASS: zframe\n+// Create a new frame. If size is not null, allocates the frame data\n+// to the specified size. If additionally, data is not null, copies \n+// size octets from the specified data into the frame body.         \n+zframe_t *\n+    zframe_new (const void *data, size_t size);\n+\n+// Destroy a frame\n+void\n+    zframe_destroy (zframe_t **self_p);\n+\n+// Create an empty (zero-sized) frame\n+zframe_t *\n+    zframe_new_empty (void);\n+\n+// Create a frame with a specified string content.\n+zframe_t *\n+    zframe_from (const char *string);\n+\n+// Receive frame from socket, returns zframe_t object or NULL if the recv  \n+// was interrupted. Does a blocking recv, if you want to not block then use\n+// zpoller or zloop.                                                       \n+zframe_t *\n+    zframe_recv (void *source);\n+\n+// Send a frame to a socket, destroy frame after sending.\n+// Return -1 on error, 0 on success.                     \n+int\n+    zframe_send (zframe_t **self_p, void *dest, int flags);\n+\n+// Return number of bytes in frame data\n+size_t\n+    zframe_size (zframe_t *self);\n+\n+// Return address of frame data\n+byte *\n+    zframe_data (zframe_t *self);\n+\n+// Return meta data property for frame           \n+// Caller must free string when finished with it.\n+const char *\n+    zframe_meta (zframe_t *self, const char *property);\n+\n+// Create a new frame that duplicates an existing frame. If frame is null,\n+// or memory was exhausted, returns null.                                 \n+zframe_t *\n+    zframe_dup (zframe_t *self);\n+\n+// Return frame data encoded as printable hex string, useful for 0MQ UUIDs.\n+// Caller must free string when finished with it.                          \n+char *\n+    zframe_strhex (zframe_t *self);\n+\n+// Return frame data copied into freshly allocated string\n+// Caller must free string when finished with it.        \n+char *\n+    zframe_strdup (zframe_t *self);\n+\n+// Return TRUE if frame body is equal to string, excluding terminator\n+bool\n+    zframe_streq (zframe_t *self, const char *string);\n+\n+// Return frame MORE indicator (1 or 0), set when reading frame from socket\n+// or by the zframe_set_more() method                                      \n+int\n+    zframe_more (zframe_t *self);\n+\n+// Set frame MORE indicator (1 or 0). Note this is NOT used when sending\n+// frame to socket, you have to specify flag explicitly.                \n+void\n+    zframe_set_more (zframe_t *self, int more);\n+\n+// Return frame routing ID, if the frame came from a ZMQ_SERVER socket.\n+// Else returns zero.                                                  \n+uint32_t\n+    zframe_routing_id (zframe_t *self);\n+\n+// Set routing ID on frame. This is used if/when the frame is sent to a\n+// ZMQ_SERVER socket.                                                  \n+void\n+    zframe_set_routing_id (zframe_t *self, uint32_t routing_id);\n+\n+// Return frame group of radio-dish pattern.\n+const char *\n+    zframe_group (zframe_t *self);\n+\n+// Set group on frame. This is used if/when the frame is sent to a\n+// ZMQ_RADIO socket.                                              \n+// Return -1 on error, 0 on success.                              \n+int\n+    zframe_set_group (zframe_t *self, const char *group);\n+\n+// Return TRUE if two frames have identical size and data\n+// If either frame is NULL, equality is always false.    \n+bool\n+    zframe_eq (zframe_t *self, zframe_t *other);\n+\n+// Set new contents for frame\n+void\n+    zframe_reset (zframe_t *self, const void *data, size_t size);\n+\n+// Send message to zsys log sink (may be stdout, or system facility as       \n+// configured by zsys_set_logstream). Prefix shows before frame, if not null.\n+void\n+    zframe_print (zframe_t *self, const char *prefix);\n+\n+// Probe the supplied object, and report if it looks like a zframe_t.\n+bool\n+    zframe_is (void *self);\n+\n+// Self test of this class.\n+void\n+    zframe_test (bool verbose);\n+\n+// CLASS: zhash\n+// Create a new, empty hash container\n+zhash_t *\n+    zhash_new (void);\n+\n+// Destroy a hash container and all items in it\n+void\n+    zhash_destroy (zhash_t **self_p);\n+\n+// Unpack binary frame into a new hash table. Packed data must follow format\n+// defined by zhash_pack. Hash table is set to autofree. An empty frame     \n+// unpacks to an empty hash table.                                          \n+zhash_t *\n+    zhash_unpack (zframe_t *frame);\n+\n+// Insert item into hash table with specified key and item.               \n+// If key is already present returns -1 and leaves existing item unchanged\n+// Returns 0 on success.                                                  \n+int\n+    zhash_insert (zhash_t *self, const char *key, void *item);\n+\n+// Update item into hash table with specified key and item.            \n+// If key is already present, destroys old item and inserts new one.   \n+// Use free_fn method to ensure deallocator is properly called on item.\n+void\n+    zhash_update (zhash_t *self, const char *key, void *item);\n+\n+// Remove an item specified by key from the hash table. If there was no such\n+// item, this function does nothing.                                        \n+void\n+    zhash_delete (zhash_t *self, const char *key);\n+\n+// Return the item at the specified key, or null\n+void *\n+    zhash_lookup (zhash_t *self, const char *key);\n+\n+// Reindexes an item from an old key to a new key. If there was no such\n+// item, does nothing. Returns 0 if successful, else -1.               \n+int\n+    zhash_rename (zhash_t *self, const char *old_key, const char *new_key);\n+\n+// Set a free function for the specified hash table item. When the item is\n+// destroyed, the free function, if any, is called on that item.          \n+// Use this when hash items are dynamically allocated, to ensure that     \n+// you don\'t have memory leaks. You can pass \'free\' or NULL as a free_fn. \n+// Returns the item, or NULL if there is no such item.                    \n+void *\n+    zhash_freefn (zhash_t *self, const char *key, zhash_free_fn free_fn);\n+\n+// Return the number of keys/items in the hash table\n+size_t\n+    zhash_size (zhash_t *self);\n+\n+// Make copy of hash table; if supplied table is null, returns null.    \n+// Does not copy items themselves. Rebuilds new table so may be slow on \n+// very large tables. NOTE: only works with item values that are strings\n+// since there\'s no other way to know how to duplicate the item value.  \n+zhash_t *\n+    zhash_dup (zhash_t *self);\n+\n+// Return keys for items in table\n+zlist_t *\n+    zhash_keys (zhash_t *self);\n+\n+// Simple iterator; returns first item in hash table, in no given order, \n+// or NULL if the table is empty. This method is simpler to use than the \n+// foreach() method, which is deprecated. To access the key for this item\n+// use zhash_cursor(). NOTE: do NOT modify the table while iterating.    \n+void *\n+    zhash_first (zhash_t *self);\n+\n+// Simple iterator; returns next item in hash table, in no given order, \n+// or NULL if the last item was already returned. Use this together with\n+// zhash_first() to process all items in a hash table. If you need the  \n+// items in sorted order, use zhash_keys() and then zlist_sort(). To    \n+// access the key for this item use zhash_cursor(). NOTE: do NOT modify \n+// the table while iterating.                                           \n+void *\n+    zhash_next (zhash_t *self);\n+\n+// After a successful first/next method, returns the key for the item that\n+// was returned. This is a constant string that you may not modify or     \n+// deallocate, and which lasts as long as the item in the hash. After an  \n+// unsuccessful first/next, returns NULL.                                 \n+const char *\n+    zhash_cursor (zhash_t *self);\n+\n+// Add a comment to hash table before saving to disk. You can add as many   \n+// comment lines as you like. These comment lines are discarded when loading\n+// the file. If you use a null format, all comments are deleted.            \n+void\n+    zhash_comment (zhash_t *self, const char *format, ...);\n+\n+// Serialize hash table to a binary frame that can be sent in a message.\n+// The packed format is compatible with the \'dictionary\' type defined in\n+// http://rfc.zeromq.org/spec:35/FILEMQ, and implemented by zproto:     \n+//                                                                      \n+//    ; A list of name/value pairs                                      \n+//    dictionary      = dict-count *( dict-name dict-value )            \n+//    dict-count      = number-4                                        \n+//    dict-value      = longstr                                         \n+//    dict-name       = string                                          \n+//                                                                      \n+//    ; Strings are always length + text contents                       \n+//    longstr         = number-4 *VCHAR                                 \n+//    string          = number-1 *VCHAR                                 \n+//                                                                      \n+//    ; Numbers are unsigned integers in network byte order             \n+//    number-1        = 1OCTET                                          \n+//    number-4        = 4OCTET                                          \n+//                                                                      \n+// Comments are not included in the packed data. Item values MUST be    \n+// strings.                                                             \n+zframe_t *\n+    zhash_pack (zhash_t *self);\n+\n+// Save hash table to a text file in name=value format. Hash values must be\n+// printable strings; keys may not contain \'=\' character. Returns 0 if OK, \n+// else -1 if a file error occurred.                                       \n+int\n+    zhash_save (zhash_t *self, const char *filename);\n+\n+// Load hash table from a text file in name=value format; hash table must \n+// already exist. Hash values must printable strings; keys may not contain\n+// \'=\' character. Returns 0 if OK, else -1 if a file was not readable.    \n+int\n+    zhash_load (zhash_t *self, const char *filename);\n+\n+// When a hash table was loaded from a file by zhash_load, this method will\n+// reload the file if it has been modified since, and is "stable", i.e. not\n+// still changing. Returns 0 if OK, -1 if there was an error reloading the \n+// file.                                                                   \n+int\n+    zhash_refresh (zhash_t *self);\n+\n+// Set hash for automatic value destruction\n+void\n+    zhash_autofree (zhash_t *self);\n+\n+// Self test of this class.\n+void\n+    zhash_test (bool verbose);\n+\n+// CLASS: zhashx\n+// Create a new, empty hash container\n+zhashx_t *\n+    zhashx_new (void);\n+\n+// Destroy a hash container and all items in it\n+void\n+    zhashx_destroy (zhashx_t **self_p);\n+\n+// Unpack binary frame into a new hash table. Packed data must follow format\n+// defined by zhashx_pack. Hash table is set to autofree. An empty frame    \n+// unpacks to an empty hash table.                                          \n+zhashx_t *\n+    zhashx_unpack (zframe_t *frame);\n+\n+// Same as unpack but uses a user-defined deserializer function to convert\n+// a longstr back into item format.                                       \n+zhashx_t *\n+    zhashx_unpack_own (zframe_t *frame, zhashx_deserializer_fn deserializer);\n+\n+// Insert item into hash table with specified key and item.               \n+// If key is already present returns -1 and leaves existing item unchanged\n+// Returns 0 on success.                                                  \n+int\n+    zhashx_insert (zhashx_t *self, const void *key, void *item);\n+\n+// Update or insert item into hash table with specified key and item. If the\n+// key is already present, destroys old item and inserts new one. If you set\n+// a container item destructor, this is called on the old value. If the key \n+// was not already present, inserts a new item. Sets the hash cursor to the \n+// new item.                                                                \n+void\n+    zhashx_update (zhashx_t *self, const void *key, void *item);\n+\n+// Remove an item specified by key from the hash table. If there was no such\n+// item, this function does nothing.                                        \n+void\n+    zhashx_delete (zhashx_t *self, const void *key);\n+\n+// Delete all items from the hash table. If the key destructor is  \n+// set, calls it on every key. If the item destructor is set, calls\n+// it on every item.                                               \n+void\n+    zhashx_purge (zhashx_t *self);\n+\n+// Return the item at the specified key, or null\n+void *\n+    zhashx_lookup (zhashx_t *self, const void *key);\n+\n+// Reindexes an item from an old key to a new key. If there was no such\n+// item, does nothing. Returns 0 if successful, else -1.               \n+int\n+    zhashx_rename (zhashx_t *self, const void *old_key, const void *new_key);\n+\n+// Set a free function for the specified hash table item. When the item is\n+// destroyed, the free function, if any, is called on that item.          \n+// Use this when hash items are dynamically allocated, to ensure that     \n+// you don\'t have memory leaks. You can pass \'free\' or NULL as a free_fn. \n+// Returns the item, or NULL if there is no such item.                    \n+void *\n+    zhashx_freefn (zhashx_t *self, const void *key, zhashx_free_fn free_fn);\n+\n+// Return the number of keys/items in the hash table\n+size_t\n+    zhashx_size (zhashx_t *self);\n+\n+// Return a zlistx_t containing the keys for the items in the       \n+// table. Uses the key_duplicator to duplicate all keys and sets the\n+// key_destructor as destructor for the list.                       \n+zlistx_t *\n+    zhashx_keys (zhashx_t *self);\n+\n+// Return a zlistx_t containing the values for the items in the  \n+// table. Uses the duplicator to duplicate all items and sets the\n+// destructor as destructor for the list.                        \n+zlistx_t *\n+    zhashx_values (zhashx_t *self);\n+\n+// Simple iterator; returns first item in hash table, in no given order, \n+// or NULL if the table is empty. This method is simpler to use than the \n+// foreach() method, which is deprecated. To access the key for this item\n+// use zhashx_cursor(). NOTE: do NOT modify the table while iterating.   \n+void *\n+    zhashx_first (zhashx_t *self);\n+\n+// Simple iterator; returns next item in hash table, in no given order, \n+// or NULL if the last item was already returned. Use this together with\n+// zhashx_first() to process all items in a hash table. If you need the \n+// items in sorted order, use zhashx_keys() and then zlistx_sort(). To  \n+// access the key for this item use zhashx_cursor(). NOTE: do NOT modify\n+// the table while iterating.                                           \n+void *\n+    zhashx_next (zhashx_t *self);\n+\n+// After a successful first/next method, returns the key for the item that\n+// was returned. This is a constant string that you may not modify or     \n+// deallocate, and which lasts as long as the item in the hash. After an  \n+// unsuccessful first/next, returns NULL.                                 \n+const void *\n+    zhashx_cursor (zhashx_t *self);\n+\n+// Add a comment to hash table before saving to disk. You can add as many   \n+// comment lines as you like. These comment lines are discarded when loading\n+// the file. If you use a null format, all comments are deleted.            \n+void\n+    zhashx_comment (zhashx_t *self, const char *format, ...);\n+\n+// Save hash table to a text file in name=value format. Hash values must be\n+// printable strings; keys may not contain \'=\' character. Returns 0 if OK, \n+// else -1 if a file error occurred.                                       \n+int\n+    zhashx_save (zhashx_t *self, const char *filename);\n+\n+// Load hash table from a text file in name=value format; hash table must \n+// already exist. Hash values must printable strings; keys may not contain\n+// \'=\' character. Returns 0 if OK, else -1 if a file was not readable.    \n+int\n+    zhashx_load (zhashx_t *self, const char *filename);\n+\n+// When a hash table was loaded from a file by zhashx_load, this method will\n+// reload the file if it has been modified since, and is "stable", i.e. not \n+// still changing. Returns 0 if OK, -1 if there was an error reloading the  \n+// file.                                                                    \n+int\n+    zhashx_refresh (zhashx_t *self);\n+\n+// Serialize hash table to a binary frame that can be sent in a message.\n+// The packed format is compatible with the \'dictionary\' type defined in\n+// http://rfc.zeromq.org/spec:35/FILEMQ, and implemented by zproto:     \n+//                                                                      \n+//    ; A list of name/value pairs                                      \n+//    dictionary      = dict-count *( dict-name dict-value )            \n+//    dict-count      = number-4                                        \n+//    dict-value      = longstr                                         \n+//    dict-name       = string                                          \n+//                                                                      \n+//    ; Strings are always length + text contents                       \n+//    longstr         = number-4 *VCHAR                                 \n+//    string          = number-1 *VCHAR                                 \n+//                                                                      \n+//    ; Numbers are unsigned integers in network byte order             \n+//    number-1        = 1OCTET                                          \n+//    number-4        = 4OCTET                                          \n+//                                                                      \n+// Comments are not included in the packed data. Item values MUST be    \n+// strings.                                                             \n+zframe_t *\n+    zhashx_pack (zhashx_t *self);\n+\n+// Same as pack but uses a user-defined serializer function to convert items\n+// into longstr.                                                            \n+zframe_t *\n+    zhashx_pack_own (zhashx_t *self, zhashx_serializer_fn serializer);\n+\n+// Make a copy of the list; items are duplicated if you set a duplicator \n+// for the list, otherwise not. Copying a null reference returns a null  \n+// reference. Note that this method\'s behavior changed slightly for CZMQ \n+// v3.x, as it does not set nor respect autofree. It does however let you\n+// duplicate any hash table safely. The old behavior is in zhashx_dup_v2.\n+zhashx_t *\n+    zhashx_dup (zhashx_t *self);\n+\n+// Set a user-defined deallocator for hash items; by default items are not\n+// freed when the hash is destroyed.                                      \n+void\n+    zhashx_set_destructor (zhashx_t *self, zhashx_destructor_fn destructor);\n+\n+// Set a user-defined duplicator for hash items; by default items are not\n+// copied when the hash is duplicated.                                   \n+void\n+    zhashx_set_duplicator (zhashx_t *self, zhashx_duplicator_fn duplicator);\n+\n+// Set a user-defined deallocator for keys; by default keys are freed\n+// when the hash is destroyed using free().                          \n+void\n+    zhashx_set_key_destructor (zhashx_t *self, zhashx_destructor_fn destructor);\n+\n+// Set a user-defined duplicator for keys; by default keys are duplicated\n+// using strdup.                                                         \n+void\n+    zhashx_set_key_duplicator (zhashx_t *self, zhashx_duplicator_fn duplicator);\n+\n+// Set a user-defined comparator for keys; by default keys are\n+// compared using strcmp.                                     \n+void\n+    zhashx_set_key_comparator (zhashx_t *self, zhashx_comparator_fn comparator);\n+\n+// Set a user-defined comparator for keys; by default keys are\n+// compared using strcmp.                                     \n+void\n+    zhashx_set_key_hasher (zhashx_t *self, zhashx_hash_fn hasher);\n+\n+// Make copy of hash table; if supplied table is null, returns null.    \n+// Does not copy items themselves. Rebuilds new table so may be slow on \n+// very large tables. NOTE: only works with item values that are strings\n+// since there\'s no other way to know how to duplicate the item value.  \n+zhashx_t *\n+    zhashx_dup_v2 (zhashx_t *self);\n+\n+// Self test of this class.\n+void\n+    zhashx_test (bool verbose);\n+\n+// CLASS: ziflist\n+// Get a list of network interfaces currently defined on the system\n+ziflist_t *\n+    ziflist_new (void);\n+\n+// Destroy a ziflist instance\n+void\n+    ziflist_destroy (ziflist_t **self_p);\n+\n+// Reload network interfaces from system\n+void\n+    ziflist_reload (ziflist_t *self);\n+\n+// Return the number of network interfaces on system\n+size_t\n+    ziflist_size (ziflist_t *self);\n+\n+// Get first network interface, return NULL if there are none\n+const char *\n+    ziflist_first (ziflist_t *self);\n+\n+// Get next network interface, return NULL if we hit the last one\n+const char *\n+    ziflist_next (ziflist_t *self);\n+\n+// Return the current interface IP address as a printable string\n+const char *\n+    ziflist_address (ziflist_t *self);\n+\n+// Return the current interface broadcast address as a printable string\n+const char *\n+    ziflist_broadcast (ziflist_t *self);\n+\n+// Return the current interface network mask as a printable string\n+const char *\n+    ziflist_netmask (ziflist_t *self);\n+\n+// Return the list of interfaces.\n+void\n+    ziflist_print (ziflist_t *self);\n+\n+// Self test of this class.\n+void\n+    ziflist_test (bool verbose);\n+\n+// CLASS: zlist\n+// Create a new list container\n+zlist_t *\n+    zlist_new (void);\n+\n+// Destroy a list container\n+void\n+    zlist_destroy (zlist_t **self_p);\n+\n+// Return the item at the head of list. If the list is empty, returns NULL.\n+// Leaves cursor pointing at the head item, or NULL if the list is empty.  \n+void *\n+    zlist_first (zlist_t *self);\n+\n+// Return the next item. If the list is empty, returns NULL. To move to\n+// the start of the list call zlist_first (). Advances the cursor.     \n+void *\n+    zlist_next (zlist_t *self);\n+\n+// Return the item at the tail of list. If the list is empty, returns NULL.\n+// Leaves cursor pointing at the tail item, or NULL if the list is empty.  \n+void *\n+    zlist_last (zlist_t *self);\n+\n+// Return first item in the list, or null, leaves the cursor\n+void *\n+    zlist_head (zlist_t *self);\n+\n+// Return last item in the list, or null, leaves the cursor\n+void *\n+    zlist_tail (zlist_t *self);\n+\n+// Return the current item of list. If the list is empty, returns NULL.     \n+// Leaves cursor pointing at the current item, or NULL if the list is empty.\n+void *\n+    zlist_item (zlist_t *self);\n+\n+// Append an item to the end of the list, return 0 if OK or -1 if this  \n+// failed for some reason (out of memory). Note that if a duplicator has\n+// been set, this method will also duplicate the item.                  \n+int\n+    zlist_append (zlist_t *self, void *item);\n+\n+// Push an item to the start of the list, return 0 if OK or -1 if this  \n+// failed for some reason (out of memory). Note that if a duplicator has\n+// been set, this method will also duplicate the item.                  \n+int\n+    zlist_push (zlist_t *self, void *item);\n+\n+// Pop the item off the start of the list, if any\n+void *\n+    zlist_pop (zlist_t *self);\n+\n+// Checks if an item already is present. Uses compare method to determine if \n+// items are equal. If the compare method is NULL the check will only compare\n+// pointers. Returns true if item is present else false.                     \n+bool\n+    zlist_exists (zlist_t *self, void *item);\n+\n+// Remove the specified item from the list if present\n+void\n+    zlist_remove (zlist_t *self, void *item);\n+\n+// Make a copy of list. If the list has autofree set, the copied list will  \n+// duplicate all items, which must be strings. Otherwise, the list will hold\n+// pointers back to the items in the original list. If list is null, returns\n+// NULL.                                                                    \n+zlist_t *\n+    zlist_dup (zlist_t *self);\n+\n+// Purge all items from list\n+void\n+    zlist_purge (zlist_t *self);\n+\n+// Return number of items in the list\n+size_t\n+    zlist_size (zlist_t *self);\n+\n+// Sort the list. If the compare function is null, sorts the list by     \n+// ascending key value using a straight ASCII comparison. If you specify \n+// a compare function, this decides how items are sorted. The sort is not\n+// stable, so may reorder items with the same keys. The algorithm used is\n+// combsort, a compromise between performance and simplicity.            \n+void\n+    zlist_sort (zlist_t *self, zlist_compare_fn compare);\n+\n+// Set list for automatic item destruction; item values MUST be strings. \n+// By default a list item refers to a value held elsewhere. When you set \n+// this, each time you append or push a list item, zlist will take a copy\n+// of the string value. Then, when you destroy the list, it will free all\n+// item values automatically. If you use any other technique to allocate \n+// list values, you must free them explicitly before destroying the list.\n+// The usual technique is to pop list items and destroy them, until the  \n+// list is empty.                                                        \n+void\n+    zlist_autofree (zlist_t *self);\n+\n+// Sets a compare function for this list. The function compares two items.\n+// It returns an integer less than, equal to, or greater than zero if the \n+// first item is found, respectively, to be less than, to match, or be    \n+// greater than the second item.                                          \n+// This function is used for sorting, removal and exists checking.        \n+void\n+    zlist_comparefn (zlist_t *self, zlist_compare_fn fn);\n+\n+// Set a free function for the specified list item. When the item is     \n+// destroyed, the free function, if any, is called on that item.         \n+// Use this when list items are dynamically allocated, to ensure that    \n+// you don\'t have memory leaks. You can pass \'free\' or NULL as a free_fn.\n+// Returns the item, or NULL if there is no such item.                   \n+void *\n+    zlist_freefn (zlist_t *self, void *item, zlist_free_fn fn, bool at_tail);\n+\n+// Self test of this class.\n+void\n+    zlist_test (bool verbose);\n+\n+// CLASS: zlistx\n+// Create a new, empty list.\n+zlistx_t *\n+    zlistx_new (void);\n+\n+// Destroy a list. If an item destructor was specified, all items in the\n+// list are automatically destroyed as well.                            \n+void\n+    zlistx_destroy (zlistx_t **self_p);\n+\n+// Add an item to the head of the list. Calls the item duplicator, if any,\n+// on the item. Resets cursor to list head. Returns an item handle on     \n+// success, NULL if memory was exhausted.                                 \n+void *\n+    zlistx_add_start (zlistx_t *self, void *item);\n+\n+// Add an item to the tail of the list. Calls the item duplicator, if any,\n+// on the item. Resets cursor to list head. Returns an item handle on     \n+// success, NULL if memory was exhausted.                                 \n+void *\n+    zlistx_add_end (zlistx_t *self, void *item);\n+\n+// Return the number of items in the list\n+size_t\n+    zlistx_size (zlistx_t *self);\n+\n+// Return first item in the list, or null, leaves the cursor\n+void *\n+    zlistx_head (zlistx_t *self);\n+\n+// Return last item in the list, or null, leaves the cursor\n+void *\n+    zlistx_tail (zlistx_t *self);\n+\n+// Return the item at the head of list. If the list is empty, returns NULL.\n+// Leaves cursor pointing at the head item, or NULL if the list is empty.  \n+void *\n+    zlistx_first (zlistx_t *self);\n+\n+// Return the next item. At the end of the list (or in an empty list),     \n+// returns NULL. Use repeated zlistx_next () calls to work through the list\n+// from zlistx_first (). First time, acts as zlistx_first().               \n+void *\n+    zlistx_next (zlistx_t *self);\n+\n+// Return the previous item. At the start of the list (or in an empty list),\n+// returns NULL. Use repeated zlistx_prev () calls to work through the list \n+// backwards from zlistx_last (). First time, acts as zlistx_last().        \n+void *\n+    zlistx_prev (zlistx_t *self);\n+\n+// Return the item at the tail of list. If the list is empty, returns NULL.\n+// Leaves cursor pointing at the tail item, or NULL if the list is empty.  \n+void *\n+    zlistx_last (zlistx_t *self);\n+\n+// Returns the value of the item at the cursor, or NULL if the cursor is\n+// not pointing to an item.                                             \n+void *\n+    zlistx_item (zlistx_t *self);\n+\n+// Returns the handle of the item at the cursor, or NULL if the cursor is\n+// not pointing to an item.                                              \n+void *\n+    zlistx_cursor (zlistx_t *self);\n+\n+// Returns the item associated with the given list handle, or NULL if passed     \n+// in handle is NULL. Asserts that the passed in handle points to a list element.\n+void *\n+    zlistx_handle_item (void *handle);\n+\n+// Find an item in the list, searching from the start. Uses the item     \n+// comparator, if any, else compares item values directly. Returns the   \n+// item handle found, or NULL. Sets the cursor to the found item, if any.\n+void *\n+    zlistx_find (zlistx_t *self, void *item);\n+\n+// Detach an item from the list, using its handle. The item is not modified, \n+// and the caller is responsible for destroying it if necessary. If handle is\n+// null, detaches the first item on the list. Returns item that was detached,\n+// or null if none was. If cursor was at item, moves cursor to previous item,\n+// so you can detach items while iterating forwards through a list.          \n+void *\n+    zlistx_detach (zlistx_t *self, void *handle);\n+\n+// Detach item at the cursor, if any, from the list. The item is not modified,\n+// and the caller is responsible for destroying it as necessary. Returns item \n+// that was detached, or null if none was. Moves cursor to previous item, so  \n+// you can detach items while iterating forwards through a list.              \n+void *\n+    zlistx_detach_cur (zlistx_t *self);\n+\n+// Delete an item, using its handle. Calls the item destructor is any is \n+// set. If handle is null, deletes the first item on the list. Returns 0 \n+// if an item was deleted, -1 if not. If cursor was at item, moves cursor\n+// to previous item, so you can delete items while iterating forwards    \n+// through a list.                                                       \n+int\n+    zlistx_delete (zlistx_t *self, void *handle);\n+\n+// Move an item to the start of the list, via its handle.\n+void\n+    zlistx_move_start (zlistx_t *self, void *handle);\n+\n+// Move an item to the end of the list, via its handle.\n+void\n+    zlistx_move_end (zlistx_t *self, void *handle);\n+\n+// Remove all items from the list, and destroy them if the item destructor\n+// is set.                                                                \n+void\n+    zlistx_purge (zlistx_t *self);\n+\n+// Sort the list. If an item comparator was set, calls that to compare    \n+// items, otherwise compares on item value. The sort is not stable, so may\n+// reorder equal items.                                                   \n+void\n+    zlistx_sort (zlistx_t *self);\n+\n+// Create a new node and insert it into a sorted list. Calls the item        \n+// duplicator, if any, on the item. If low_value is true, starts searching   \n+// from the start of the list, otherwise searches from the end. Use the item \n+// comparator, if any, to find where to place the new node. Returns a handle \n+// to the new node, or NULL if memory was exhausted. Resets the cursor to the\n+// list head.                                                                \n+void *\n+    zlistx_insert (zlistx_t *self, void *item, bool low_value);\n+\n+// Move an item, specified by handle, into position in a sorted list. Uses \n+// the item comparator, if any, to determine the new location. If low_value\n+// is true, starts searching from the start of the list, otherwise searches\n+// from the end.                                                           \n+void\n+    zlistx_reorder (zlistx_t *self, void *handle, bool low_value);\n+\n+// Make a copy of the list; items are duplicated if you set a duplicator\n+// for the list, otherwise not. Copying a null reference returns a null \n+// reference.                                                           \n+zlistx_t *\n+    zlistx_dup (zlistx_t *self);\n+\n+// Set a user-defined deallocator for list items; by default items are not\n+// freed when the list is destroyed.                                      \n+void\n+    zlistx_set_destructor (zlistx_t *self, zlistx_destructor_fn destructor);\n+\n+// Set a user-defined duplicator for list items; by default items are not\n+// copied when the list is duplicated.                                   \n+void\n+    zlistx_set_duplicator (zlistx_t *self, zlistx_duplicator_fn duplicator);\n+\n+// Set a user-defined comparator for zlistx_find and zlistx_sort; the method \n+// must return -1, 0, or 1 depending on whether item1 is less than, equal to,\n+// or greater than, item2.                                                   \n+void\n+    zlistx_set_comparator (zlistx_t *self, zlistx_comparator_fn comparator);\n+\n+// Self test of this class.\n+void\n+    zlistx_test (bool verbose);\n+\n+// CLASS: zloop\n+// Create a new zloop reactor\n+zloop_t *\n+    zloop_new (void);\n+\n+// Destroy a reactor\n+void\n+    zloop_destroy (zloop_t **self_p);\n+\n+// Register socket reader with the reactor. When the reader has messages, \n+// the reactor will call the handler, passing the arg. Returns 0 if OK, -1\n+// if there was an error. If you register the same socket more than once, \n+// each instance will invoke its corresponding handler.                   \n+int\n+    zloop_reader (zloop_t *self, zsock_t *sock, zloop_reader_fn handler, void *arg);\n+\n+// Cancel a socket reader from the reactor. If multiple readers exist for\n+// same socket, cancels ALL of them.                                     \n+void\n+    zloop_reader_end (zloop_t *self, zsock_t *sock);\n+\n+// Configure a registered reader to ignore errors. If you do not set this,\n+// then readers that have errors are removed from the reactor silently.   \n+void\n+    zloop_reader_set_tolerant (zloop_t *self, zsock_t *sock);\n+\n+// Register low-level libzmq pollitem with the reactor. When the pollitem  \n+// is ready, will call the handler, passing the arg. Returns 0 if OK, -1   \n+// if there was an error. If you register the pollitem more than once, each\n+// instance will invoke its corresponding handler. A pollitem with         \n+// socket=NULL and fd=0 means \'poll on FD zero\'.                           \n+int\n+    zloop_poller (zloop_t *self, zmq_pollitem_t *item, zloop_fn handler, void *arg);\n+\n+// Cancel a pollitem from the reactor, specified by socket or FD. If both\n+// are specified, uses only socket. If multiple poll items exist for same\n+// socket/FD, cancels ALL of them.                                       \n+void\n+    zloop_poller_end (zloop_t *self, zmq_pollitem_t *item);\n+\n+// Configure a registered poller to ignore errors. If you do not set this,\n+// then poller that have errors are removed from the reactor silently.    \n+void\n+    zloop_poller_set_tolerant (zloop_t *self, zmq_pollitem_t *item);\n+\n+// Register a timer that expires after some delay and repeats some number of\n+// times. At each expiry, will call the handler, passing the arg. To run a  \n+// timer forever, use 0 times. Returns a timer_id that is used to cancel the\n+// timer in the future. Returns -1 if there was an error.                   \n+int\n+    zloop_timer (zloop_t *self, size_t delay, size_t times, zloop_timer_fn handler, void *arg);\n+\n+// Cancel a specific timer identified by a specific timer_id (as returned by\n+// zloop_timer).                                                            \n+int\n+    zloop_timer_end (zloop_t *self, int timer_id);\n+\n+// Register a ticket timer. Ticket timers are very fast in the case where   \n+// you use a lot of timers (thousands), and frequently remove and add them. \n+// The main use case is expiry timers for servers that handle many clients, \n+// and which reset the expiry timer for each message received from a client.\n+// Whereas normal timers perform poorly as the number of clients grows, the \n+// cost of ticket timers is constant, no matter the number of clients. You  \n+// must set the ticket delay using zloop_set_ticket_delay before creating a \n+// ticket. Returns a handle to the timer that you should use in             \n+// zloop_ticket_reset and zloop_ticket_delete.                              \n+void *\n+    zloop_ticket (zloop_t *self, zloop_timer_fn handler, void *arg);\n+\n+// Reset a ticket timer, which moves it to the end of the ticket list and\n+// resets its execution time. This is a very fast operation.             \n+void\n+    zloop_ticket_reset (zloop_t *self, void *handle);\n+\n+// Delete a ticket timer. We do not actually delete the ticket here, as    \n+// other code may still refer to the ticket. We mark as deleted, and remove\n+// later and safely.                                                       \n+void\n+    zloop_ticket_delete (zloop_t *self, void *handle);\n+\n+// Set the ticket delay, which applies to all tickets. If you lower the   \n+// delay and there are already tickets created, the results are undefined.\n+void\n+    zloop_set_ticket_delay (zloop_t *self, size_t ticket_delay);\n+\n+// Set hard limit on number of timers allowed. Setting more than a small  \n+// number of timers (10-100) can have a dramatic impact on the performance\n+// of the reactor. For high-volume cases, use ticket timers. If the hard  \n+// limit is reached, the reactor stops creating new timers and logs an    \n+// error.                                                                 \n+void\n+    zloop_set_max_timers (zloop_t *self, size_t max_timers);\n+\n+// Set verbose tracing of reactor on/off. The default verbose setting is\n+// off (false).                                                         \n+void\n+    zloop_set_verbose (zloop_t *self, bool verbose);\n+\n+// By default the reactor stops if the process receives a SIGINT or SIGTERM \n+// signal. This makes it impossible to shut-down message based architectures\n+// like zactors. This method lets you switch off break handling. The default\n+// nonstop setting is off (false).                                          \n+void\n+    zloop_set_nonstop (zloop_t *self, bool nonstop);\n+\n+// Start the reactor. Takes control of the thread and returns when the 0MQ  \n+// context is terminated or the process is interrupted, or any event handler\n+// returns -1. Event handlers may register new sockets and timers, and      \n+// cancel sockets. Returns 0 if interrupted, -1 if canceled by a handler.   \n+int\n+    zloop_start (zloop_t *self);\n+\n+// Self test of this class.\n+void\n+    zloop_test (bool verbose);\n+\n+// CLASS: zmsg\n+// Create a new empty message object\n+zmsg_t *\n+    zmsg_new (void);\n+\n+// Destroy a message object and all frames it contains\n+void\n+    zmsg_destroy (zmsg_t **self_p);\n+\n+// Receive message from socket, returns zmsg_t object or NULL if the recv   \n+// was interrupted. Does a blocking recv. If you want to not block then use \n+// the zloop class or zmsg_recv_nowait or zmq_poll to check for socket input\n+// before receiving.                                                        \n+zmsg_t *\n+    zmsg_recv (void *source);\n+\n+// Load/append an open file into new message, return the message.\n+// Returns NULL if the message could not be loaded.              \n+zmsg_t *\n+    zmsg_load (FILE *file);\n+\n+// Decodes a serialized message frame created by zmsg_encode () and returns\n+// a new zmsg_t object. Returns NULL if the frame was badly formatted or   \n+// there was insufficient memory to work.                                  \n+zmsg_t *\n+    zmsg_decode (zframe_t *frame);\n+\n+// Generate a signal message encoding the given status. A signal is a short\n+// message carrying a 1-byte success/failure code (by convention, 0 means  \n+// OK). Signals are encoded to be distinguishable from "normal" messages.  \n+zmsg_t *\n+    zmsg_new_signal (byte status);\n+\n+// Send message to destination socket, and destroy the message after sending\n+// it successfully. If the message has no frames, sends nothing but destroys\n+// the message anyhow. Nullifies the caller\'s reference to the message (as  \n+// it is a destructor).                                                     \n+int\n+    zmsg_send (zmsg_t **self_p, void *dest);\n+\n+// Send message to destination socket as part of a multipart sequence, and \n+// destroy the message after sending it successfully. Note that after a    \n+// zmsg_sendm, you must call zmsg_send or another method that sends a final\n+// message part. If the message has no frames, sends nothing but destroys  \n+// the message anyhow. Nullifies the caller\'s reference to the message (as \n+// it is a destructor).                                                    \n+int\n+    zmsg_sendm (zmsg_t **self_p, void *dest);\n+\n+// Return size of message, i.e. number of frames (0 or more).\n+size_t\n+    zmsg_size (zmsg_t *self);\n+\n+// Return total size of all frames in message.\n+size_t\n+    zmsg_content_size (zmsg_t *self);\n+\n+// Return message routing ID, if the message came from a ZMQ_SERVER socket.\n+// Else returns zero.                                                      \n+uint32_t\n+    zmsg_routing_id (zmsg_t *self);\n+\n+// Set routing ID on message. This is used if/when the message is sent to a\n+// ZMQ_SERVER socket.                                                      \n+void\n+    zmsg_set_routing_id (zmsg_t *self, uint32_t routing_id);\n+\n+// Push frame to the front of the message, i.e. before all other frames.  \n+// Message takes ownership of frame, will destroy it when message is sent.\n+// Returns 0 on success, -1 on error. Deprecates zmsg_push, which did not \n+// nullify the caller\'s frame reference.                                  \n+int\n+    zmsg_prepend (zmsg_t *self, zframe_t **frame_p);\n+\n+// Add frame to the end of the message, i.e. after all other frames.      \n+// Message takes ownership of frame, will destroy it when message is sent.\n+// Returns 0 on success. Deprecates zmsg_add, which did not nullify the   \n+// caller\'s frame reference.                                              \n+int\n+    zmsg_append (zmsg_t *self, zframe_t **frame_p);\n+\n+// Remove first frame from message, if any. Returns frame, or NULL.\n+zframe_t *\n+    zmsg_pop (zmsg_t *self);\n+\n+// Push block of memory to front of message, as a new frame.\n+// Returns 0 on success, -1 on error.                       \n+int\n+    zmsg_pushmem (zmsg_t *self, const void *data, size_t size);\n+\n+// Add block of memory to the end of the message, as a new frame.\n+// Returns 0 on success, -1 on error.                            \n+int\n+    zmsg_addmem (zmsg_t *self, const void *data, size_t size);\n+\n+// Push string as new frame to front of message.\n+// Returns 0 on success, -1 on error.           \n+int\n+    zmsg_pushstr (zmsg_t *self, const char *string);\n+\n+// Push string as new frame to end of message.\n+// Returns 0 on success, -1 on error.         \n+int\n+    zmsg_addstr (zmsg_t *self, const char *string);\n+\n+// Push formatted string as new frame to front of message.\n+// Returns 0 on success, -1 on error.                     \n+int\n+    zmsg_pushstrf (zmsg_t *self, const char *format, ...);\n+\n+// Push formatted string as new frame to end of message.\n+// Returns 0 on success, -1 on error.                   \n+int\n+    zmsg_addstrf (zmsg_t *self, const char *format, ...);\n+\n+// Pop frame off front of message, return as fresh string. If there were\n+// no more frames in the message, returns NULL.                         \n+char *\n+    zmsg_popstr (zmsg_t *self);\n+\n+// Push encoded message as a new frame. Message takes ownership of    \n+// submessage, so the original is destroyed in this call. Returns 0 on\n+// success, -1 on error.                                              \n+int\n+    zmsg_addmsg (zmsg_t *self, zmsg_t **msg_p);\n+\n+// Remove first submessage from message, if any. Returns zmsg_t, or NULL if\n+// decoding was not successful.                                            \n+zmsg_t *\n+    zmsg_popmsg (zmsg_t *self);\n+\n+// Remove specified frame from list, if present. Does not destroy frame.\n+void\n+    zmsg_remove (zmsg_t *self, zframe_t *frame);\n+\n+// Set cursor to first frame in message. Returns frame, or NULL, if the\n+// message is empty. Use this to navigate the frames as a list.        \n+zframe_t *\n+    zmsg_first (zmsg_t *self);\n+\n+// Return the next frame. If there are no more frames, returns NULL. To move\n+// to the first frame call zmsg_first(). Advances the cursor.               \n+zframe_t *\n+    zmsg_next (zmsg_t *self);\n+\n+// Return the last frame. If there are no frames, returns NULL.\n+zframe_t *\n+    zmsg_last (zmsg_t *self);\n+\n+// Save message to an open file, return 0 if OK, else -1. The message is  \n+// saved as a series of frames, each with length and data. Note that the  \n+// file is NOT guaranteed to be portable between operating systems, not   \n+// versions of CZMQ. The file format is at present undocumented and liable\n+// to arbitrary change.                                                   \n+int\n+    zmsg_save (zmsg_t *self, FILE *file);\n+\n+// Serialize multipart message to a single message frame. Use this method\n+// to send structured messages across transports that do not support     \n+// multipart data. Allocates and returns a new frame containing the      \n+// serialized message. To decode a serialized message frame, use         \n+// zmsg_decode ().                                                       \n+zframe_t *\n+    zmsg_encode (zmsg_t *self);\n+\n+// Create copy of message, as new message object. Returns a fresh zmsg_t\n+// object. If message is null, or memory was exhausted, returns null.   \n+zmsg_t *\n+    zmsg_dup (zmsg_t *self);\n+\n+// Send message to zsys log sink (may be stdout, or system facility as\n+// configured by zsys_set_logstream).                                 \n+void\n+    zmsg_print (zmsg_t *self);\n+\n+// Return true if the two messages have the same number of frames and each  \n+// frame in the first message is identical to the corresponding frame in the\n+// other message. As with zframe_eq, return false if either message is NULL.\n+bool\n+    zmsg_eq (zmsg_t *self, zmsg_t *other);\n+\n+// Return signal value, 0 or greater, if message is a signal, -1 if not.\n+int\n+    zmsg_signal (zmsg_t *self);\n+\n+// Probe the supplied object, and report if it looks like a zmsg_t.\n+bool\n+    zmsg_is (void *self);\n+\n+// Self test of this class.\n+void\n+    zmsg_test (bool verbose);\n+\n+// CLASS: zpoller\n+// Create new poller, specifying zero or more readers. The list of \n+// readers ends in a NULL. Each reader can be a zsock_t instance, a\n+// zactor_t instance, a libzmq socket (void *), or a file handle.  \n+zpoller_t *\n+    zpoller_new (void *reader, ...);\n+\n+// Destroy a poller\n+void\n+    zpoller_destroy (zpoller_t **self_p);\n+\n+// Add a reader to be polled. Returns 0 if OK, -1 on failure. The reader may\n+// be a libzmq void * socket, a zsock_t instance, or a zactor_t instance.   \n+int\n+    zpoller_add (zpoller_t *self, void *reader);\n+\n+// Remove a reader from the poller; returns 0 if OK, -1 on failure. The reader\n+// must have been passed during construction, or in an zpoller_add () call.   \n+int\n+    zpoller_remove (zpoller_t *self, void *reader);\n+\n+// By default the poller stops if the process receives a SIGINT or SIGTERM  \n+// signal. This makes it impossible to shut-down message based architectures\n+// like zactors. This method lets you switch off break handling. The default\n+// nonstop setting is off (false).                                          \n+void\n+    zpoller_set_nonstop (zpoller_t *self, bool nonstop);\n+\n+// Poll the registered readers for I/O, return first reader that has input.  \n+// The reader will be a libzmq void * socket, or a zsock_t or zactor_t       \n+// instance as specified in zpoller_new/zpoller_add. The timeout should be   \n+// zero or greater, or -1 to wait indefinitely. Socket priority is defined   \n+// by their order in the poll list. If you need a balanced poll, use the low \n+// level zmq_poll method directly. If the poll call was interrupted (SIGINT),\n+// or the ZMQ context was destroyed, or the timeout expired, returns NULL.   \n+// You can test the actual exit condition by calling zpoller_expired () and  \n+// zpoller_terminated (). The timeout is in msec.                            \n+void *\n+    zpoller_wait (zpoller_t *self, int timeout);\n+\n+// Return true if the last zpoller_wait () call ended because the timeout\n+// expired, without any error.                                           \n+bool\n+    zpoller_expired (zpoller_t *self);\n+\n+// Return true if the last zpoller_wait () call ended because the process\n+// was interrupted, or the parent context was destroyed.                 \n+bool\n+    zpoller_terminated (zpoller_t *self);\n+\n+// Self test of this class.\n+void\n+    zpoller_test (bool verbose);\n+\n+// CLASS: zproc\n+// Returns CZMQ version as a single 6-digit integer encoding the major\n+// version (x 10000), the minor version (x 100) and the patch.        \n+int\n+    zproc_czmq_version (void);\n+\n+// Returns true if the process received a SIGINT or SIGTERM signal.\n+// It is good practice to use this method to exit any infinite loop\n+// processing messages.                                            \n+bool\n+    zproc_interrupted (void);\n+\n+// Returns true if the underlying libzmq supports CURVE security.\n+bool\n+    zproc_has_curve (void);\n+\n+// Return current host name, for use in public tcp:// endpoints.\n+// If the host name is not resolvable, returns NULL.            \n+char *\n+    zproc_hostname (void);\n+\n+// Move the current process into the background. The precise effect     \n+// depends on the operating system. On POSIX boxes, moves to a specified\n+// working directory (if specified), closes all file handles, reopens   \n+// stdin, stdout, and stderr to the null device, and sets the process to\n+// ignore SIGHUP. On Windows, does nothing. Returns 0 if OK, -1 if there\n+// was an error.                                                        \n+void\n+    zproc_daemonize (const char *workdir);\n+\n+// Drop the process ID into the lockfile, with exclusive lock, and   \n+// switch the process to the specified group and/or user. Any of the \n+// arguments may be null, indicating a no-op. Returns 0 on success,  \n+// -1 on failure. Note if you combine this with zsys_daemonize, run  \n+// after, not before that method, or the lockfile will hold the wrong\n+// process ID.                                                       \n+void\n+    zproc_run_as (const char *lockfile, const char *group, const char *user);\n+\n+// Configure the number of I/O threads that ZeroMQ will use. A good  \n+// rule of thumb is one thread per gigabit of traffic in or out. The \n+// default is 1, sufficient for most applications. If the environment\n+// variable ZSYS_IO_THREADS is defined, that provides the default.   \n+// Note that this method is valid only before any socket is created. \n+void\n+    zproc_set_io_threads (size_t io_threads);\n+\n+// Configure the number of sockets that ZeroMQ will allow. The default  \n+// is 1024. The actual limit depends on the system, and you can query it\n+// by using zsys_socket_limit (). A value of zero means "maximum".      \n+// Note that this method is valid only before any socket is created.    \n+void\n+    zproc_set_max_sockets (size_t max_sockets);\n+\n+// Set network interface name to use for broadcasts, particularly zbeacon.    \n+// This lets the interface be configured for test environments where required.\n+// For example, on Mac OS X, zbeacon cannot bind to 255.255.255.255 which is  \n+// the default when there is no specified interface. If the environment       \n+// variable ZSYS_INTERFACE is set, use that as the default interface name.    \n+// Setting the interface to "*" means "use all available interfaces".         \n+void\n+    zproc_set_biface (const char *value);\n+\n+// Return network interface to use for broadcasts, or "" if none was set.\n+const char *\n+    zproc_biface (void);\n+\n+// Set log identity, which is a string that prefixes all log messages sent\n+// by this process. The log identity defaults to the environment variable \n+// ZSYS_LOGIDENT, if that is set.                                         \n+void\n+    zproc_set_log_ident (const char *value);\n+\n+// Sends log output to a PUB socket bound to the specified endpoint. To   \n+// collect such log output, create a SUB socket, subscribe to the traffic \n+// you care about, and connect to the endpoint. Log traffic is sent as a  \n+// single string frame, in the same format as when sent to stdout. The    \n+// log system supports a single sender; multiple calls to this method will\n+// bind the same sender to multiple endpoints. To disable the sender, call\n+// this method with a null argument.                                      \n+void\n+    zproc_set_log_sender (const char *endpoint);\n+\n+// Enable or disable logging to the system facility (syslog on POSIX boxes,\n+// event log on Windows). By default this is disabled.                     \n+void\n+    zproc_set_log_system (bool logsystem);\n+\n+// Log error condition - highest priority\n+void\n+    zproc_log_error (const char *format, ...);\n+\n+// Log warning condition - high priority\n+void\n+    zproc_log_warning (const char *format, ...);\n+\n+// Log normal, but significant, condition - normal priority\n+void\n+    zproc_log_notice (const char *format, ...);\n+\n+// Log informational message - low priority\n+void\n+    zproc_log_info (const char *format, ...);\n+\n+// Log debug-level message - lowest priority\n+void\n+    zproc_log_debug (const char *format, ...);\n+\n+// Self test of this class.\n+void\n+    zproc_test (bool verbose);\n+\n+// CLASS: zsock\n+// Create a new socket. Returns the new socket, or NULL if the new socket\n+// could not be created. Note that the symbol zsock_new (and other       \n+// constructors/destructors for zsock) are redirected to the *_checked   \n+// variant, enabling intelligent socket leak detection. This can have    \n+// performance implications if you use a LOT of sockets. To turn off this\n+// redirection behaviour, define ZSOCK_NOCHECK.                          \n+zsock_t *\n+    zsock_new (int type);\n+\n+// Destroy the socket. You must use this for any socket created via the\n+// zsock_new method.                                                   \n+void\n+    zsock_destroy (zsock_t **self_p);\n+\n+// Create a PUB socket. Default action is bind.\n+zsock_t *\n+    zsock_new_pub (const char *endpoint);\n+\n+// Create a SUB socket, and optionally subscribe to some prefix string. Default\n+// action is connect.                                                          \n+zsock_t *\n+    zsock_new_sub (const char *endpoint, const char *subscribe);\n+\n+// Create a REQ socket. Default action is connect.\n+zsock_t *\n+    zsock_new_req (const char *endpoint);\n+\n+// Create a REP socket. Default action is bind.\n+zsock_t *\n+    zsock_new_rep (const char *endpoint);\n+\n+// Create a DEALER socket. Default action is connect.\n+zsock_t *\n+    zsock_new_dealer (const char *endpoint);\n+\n+// Create a ROUTER socket. Default action is bind.\n+zsock_t *\n+    zsock_new_router (const char *endpoint);\n+\n+// Create a PUSH socket. Default action is connect.\n+zsock_t *\n+    zsock_new_push (const char *endpoint);\n+\n+// Create a PULL socket. Default action is bind.\n+zsock_t *\n+    zsock_new_pull (const char *endpoint);\n+\n+// Create an XPUB socket. Default action is bind.\n+zsock_t *\n+    zsock_new_xpub (const char *endpoint);\n+\n+// Create an XSUB socket. Default action is connect.\n+zsock_t *\n+    zsock_new_xsub (const char *endpoint);\n+\n+// Create a PAIR socket. Default action is connect.\n+zsock_t *\n+    zsock_new_pair (const char *endpoint);\n+\n+// Create a STREAM socket. Default action is connect.\n+zsock_t *\n+    zsock_new_stream (const char *endpoint);\n+\n+// Create a SERVER socket. Default action is bind.\n+zsock_t *\n+    zsock_new_server (const char *endpoint);\n+\n+// Create a CLIENT socket. Default action is connect.\n+zsock_t *\n+    zsock_new_client (const char *endpoint);\n+\n+// Create a RADIO socket. Default action is bind.\n+zsock_t *\n+    zsock_new_radio (const char *endpoint);\n+\n+// Create a DISH socket. Default action is connect.\n+zsock_t *\n+    zsock_new_dish (const char *endpoint);\n+\n+// Create a GATHER socket. Default action is bind.\n+zsock_t *\n+    zsock_new_gather (const char *endpoint);\n+\n+// Create a SCATTER socket. Default action is connect.\n+zsock_t *\n+    zsock_new_scatter (const char *endpoint);\n+\n+// Bind a socket to a formatted endpoint. For tcp:// endpoints, supports   \n+// ephemeral ports, if you specify the port number as "*". By default      \n+// zsock uses the IANA designated range from C000 (49152) to FFFF (65535). \n+// To override this range, follow the "*" with "[first-last]". Either or   \n+// both first and last may be empty. To bind to a random port within the   \n+// range, use "!" in place of "*".                                         \n+//                                                                         \n+// Examples:                                                               \n+//     tcp://127.0.0.1:*           bind to first free port from C000 up    \n+//     tcp://127.0.0.1:!           bind to random port from C000 to FFFF   \n+//     tcp://127.0.0.1:*[60000-]   bind to first free port from 60000 up   \n+//     tcp://127.0.0.1:![-60000]   bind to random port from C000 to 60000  \n+//     tcp://127.0.0.1:![55000-55999]                                      \n+//                                 bind to random port from 55000 to 55999 \n+//                                                                         \n+// On success, returns the actual port number used, for tcp:// endpoints,  \n+// and 0 for other transports. On failure, returns -1. Note that when using\n+// ephemeral ports, a port may be reused by different services without     \n+// clients being aware. Protocols that run on ephemeral ports should take  \n+// this into account.                                                      \n+int\n+    zsock_bind (zsock_t *self, const char *format, ...);\n+\n+// Returns last bound endpoint, if any.\n+const char *\n+    zsock_endpoint (zsock_t *self);\n+\n+// Unbind a socket from a formatted endpoint.                     \n+// Returns 0 if OK, -1 if the endpoint was invalid or the function\n+// isn\'t supported.                                               \n+int\n+    zsock_unbind (zsock_t *self, const char *format, ...);\n+\n+// Connect a socket to a formatted endpoint        \n+// Returns 0 if OK, -1 if the endpoint was invalid.\n+int\n+    zsock_connect (zsock_t *self, const char *format, ...);\n+\n+// Disconnect a socket from a formatted endpoint                  \n+// Returns 0 if OK, -1 if the endpoint was invalid or the function\n+// isn\'t supported.                                               \n+int\n+    zsock_disconnect (zsock_t *self, const char *format, ...);\n+\n+// Attach a socket to zero or more endpoints. If endpoints is not null,     \n+// parses as list of ZeroMQ endpoints, separated by commas, and prefixed by \n+// \'@\' (to bind the socket) or \'>\' (to connect the socket). Returns 0 if all\n+// endpoints were valid, or -1 if there was a syntax error. If the endpoint \n+// does not start with \'@\' or \'>\', the serverish argument defines whether   \n+// it is used to bind (serverish = true) or connect (serverish = false).    \n+int\n+    zsock_attach (zsock_t *self, const char *endpoints, bool serverish);\n+\n+// Returns socket type as printable constant string.\n+const char *\n+    zsock_type_str (zsock_t *self);\n+\n+// Send a \'picture\' message to the socket (or actor). The picture is a   \n+// string that defines the type of each frame. This makes it easy to send\n+// a complex multiframe message in one call. The picture can contain any \n+// of these characters, each corresponding to one or two arguments:      \n+//                                                                       \n+//     i = int (signed)                                                  \n+//     1 = uint8_t                                                       \n+//     2 = uint16_t                                                      \n+//     4 = uint32_t                                                      \n+//     8 = uint64_t                                                      \n+//     s = char *                                                        \n+//     b = byte *, size_t (2 arguments)                                  \n+//     c = zchunk_t *                                                    \n+//     f = zframe_t *                                                    \n+//     h = zhashx_t *                                                    \n+//     U = zuuid_t *                                                     \n+//     p = void * (sends the pointer value, only meaningful over inproc) \n+//     m = zmsg_t * (sends all frames in the zmsg)                       \n+//     z = sends zero-sized frame (0 arguments)                          \n+//     u = uint (deprecated)                                             \n+//                                                                       \n+// Note that s, b, c, and f are encoded the same way and the choice is   \n+// offered as a convenience to the sender, which may or may not already  \n+// have data in a zchunk or zframe. Does not change or take ownership of \n+// any arguments. Returns 0 if successful, -1 if sending failed for any  \n+// reason.                                                               \n+int\n+    zsock_send (void *self, const char *picture, ...);\n+\n+// Send a \'picture\' message to the socket (or actor). This is a va_list \n+// version of zsock_send (), so please consult its documentation for the\n+// details.                                                             \n+int\n+    zsock_vsend (void *self, const char *picture, va_list argptr);\n+\n+// Receive a \'picture\' message to the socket (or actor). See zsock_send for\n+// the format and meaning of the picture. Returns the picture elements into\n+// a series of pointers as provided by the caller:                         \n+//                                                                         \n+//     i = int * (stores signed integer)                                   \n+//     4 = uint32_t * (stores 32-bit unsigned integer)                     \n+//     8 = uint64_t * (stores 64-bit unsigned integer)                     \n+//     s = char ** (allocates new string)                                  \n+//     b = byte **, size_t * (2 arguments) (allocates memory)              \n+//     c = zchunk_t ** (creates zchunk)                                    \n+//     f = zframe_t ** (creates zframe)                                    \n+//     U = zuuid_t * (creates a zuuid with the data)                       \n+//     h = zhashx_t ** (creates zhashx)                                    \n+//     p = void ** (stores pointer)                                        \n+//     m = zmsg_t ** (creates a zmsg with the remaing frames)              \n+//     z = null, asserts empty frame (0 arguments)                         \n+//     u = uint * (stores unsigned integer, deprecated)                    \n+//                                                                         \n+// Note that zsock_recv creates the returned objects, and the caller must  \n+// destroy them when finished with them. The supplied pointers do not need \n+// to be initialized. Returns 0 if successful, or -1 if it failed to recv  \n+// a message, in which case the pointers are not modified. When message    \n+// frames are truncated (a short message), sets return values to zero/null.\n+// If an argument pointer is NULL, does not store any value (skips it).    \n+// An \'n\' picture matches an empty frame; if the message does not match,   \n+// the method will return -1.                                              \n+int\n+    zsock_recv (void *self, const char *picture, ...);\n+\n+// Receive a \'picture\' message from the socket (or actor). This is a    \n+// va_list version of zsock_recv (), so please consult its documentation\n+// for the details.                                                     \n+int\n+    zsock_vrecv (void *self, const char *picture, va_list argptr);\n+\n+// Send a binary encoded \'picture\' message to the socket (or actor). This \n+// method is similar to zsock_send, except the arguments are encoded in a \n+// binary format that is compatible with zproto, and is designed to reduce\n+// memory allocations. The pattern argument is a string that defines the  \n+// type of each argument. Supports these argument types:                  \n+//                                                                        \n+//  pattern    C type                  zproto type:                       \n+//     1       uint8_t                 type = "number" size = "1"         \n+//     2       uint16_t                type = "number" size = "2"         \n+//     4       uint32_t                type = "number" size = "3"         \n+//     8       uint64_t                type = "number" size = "4"         \n+//     s       char *, 0-255 chars     type = "string"                    \n+//     S       char *, 0-2^32-1 chars  type = "longstr"                   \n+//     c       zchunk_t *              type = "chunk"                     \n+//     f       zframe_t *              type = "frame"                     \n+//     u       zuuid_t *               type = "uuid"                      \n+//     m       zmsg_t *                type = "msg"                       \n+//     p       void *, sends pointer value, only over inproc              \n+//                                                                        \n+// Does not change or take ownership of any arguments. Returns 0 if       \n+// successful, -1 if sending failed for any reason.                       \n+int\n+    zsock_bsend (void *self, const char *picture, ...);\n+\n+// Receive a binary encoded \'picture\' message from the socket (or actor).  \n+// This method is similar to zsock_recv, except the arguments are encoded  \n+// in a binary format that is compatible with zproto, and is designed to   \n+// reduce memory allocations. The pattern argument is a string that defines\n+// the type of each argument. See zsock_bsend for the supported argument   \n+// types. All arguments must be pointers; this call sets them to point to  \n+// values held on a per-socket basis.                                      \n+// Note that zsock_brecv creates the returned objects, and the caller must \n+// destroy them when finished with them. The supplied pointers do not need \n+// to be initialized. Returns 0 if successful, or -1 if it failed to read  \n+// a message.                                                              \n+int\n+    zsock_brecv (void *self, const char *picture, ...);\n+\n+// Return socket routing ID if any. This returns 0 if the socket is not\n+// of type ZMQ_SERVER or if no request was already received on it.     \n+uint32_t\n+    zsock_routing_id (zsock_t *self);\n+\n+// Set routing ID on socket. The socket MUST be of type ZMQ_SERVER.        \n+// This will be used when sending messages on the socket via the zsock API.\n+void\n+    zsock_set_routing_id (zsock_t *self, uint32_t routing_id);\n+\n+// Set socket to use unbounded pipes (HWM=0); use this in cases when you are\n+// totally certain the message volume can fit in memory. This method works  \n+// across all versions of ZeroMQ. Takes a polymorphic socket reference.     \n+void\n+    zsock_set_unbounded (void *self);\n+\n+// Send a signal over a socket. A signal is a short message carrying a   \n+// success/failure code (by convention, 0 means OK). Signals are encoded \n+// to be distinguishable from "normal" messages. Accepts a zsock_t or a  \n+// zactor_t argument, and returns 0 if successful, -1 if the signal could\n+// not be sent. Takes a polymorphic socket reference.                    \n+int\n+    zsock_signal (void *self, byte status);\n+\n+// Wait on a signal. Use this to coordinate between threads, over pipe  \n+// pairs. Blocks until the signal is received. Returns -1 on error, 0 or\n+// greater on success. Accepts a zsock_t or a zactor_t as argument.     \n+// Takes a polymorphic socket reference.                                \n+int\n+    zsock_wait (void *self);\n+\n+// If there is a partial message still waiting on the socket, remove and    \n+// discard it. This is useful when reading partial messages, to get specific\n+// message types.                                                           \n+void\n+    zsock_flush (void *self);\n+\n+// Join a group for the RADIO-DISH pattern. Call only on ZMQ_DISH.\n+// Returns 0 if OK, -1 if failed.                                 \n+int\n+    zsock_join (void *self, const char *group);\n+\n+// Leave a group for the RADIO-DISH pattern. Call only on ZMQ_DISH.\n+// Returns 0 if OK, -1 if failed.                                  \n+int\n+    zsock_leave (void *self, const char *group);\n+\n+// Probe the supplied object, and report if it looks like a zsock_t.\n+// Takes a polymorphic socket reference.                            \n+bool\n+    zsock_is (void *self);\n+\n+// Probe the supplied reference. If it looks like a zsock_t instance, return\n+// the underlying libzmq socket handle; else if it looks like a file        \n+// descriptor, return NULL; else if it looks like a libzmq socket handle,   \n+// return the supplied value. Takes a polymorphic socket reference.         \n+void *\n+    zsock_resolve (void *self);\n+\n+// Get socket option `heartbeat_ivl`.\n+// Available from libzmq 4.2.0.      \n+int\n+    zsock_heartbeat_ivl (void *self);\n+\n+// Set socket option `heartbeat_ivl`.\n+// Available from libzmq 4.2.0.      \n+void\n+    zsock_set_heartbeat_ivl (void *self, int heartbeat_ivl);\n+\n+// Get socket option `heartbeat_ttl`.\n+// Available from libzmq 4.2.0.      \n+int\n+    zsock_heartbeat_ttl (void *self);\n+\n+// Set socket option `heartbeat_ttl`.\n+// Available from libzmq 4.2.0.      \n+void\n+    zsock_set_heartbeat_ttl (void *self, int heartbeat_ttl);\n+\n+// Get socket option `heartbeat_timeout`.\n+// Available from libzmq 4.2.0.          \n+int\n+    zsock_heartbeat_timeout (void *self);\n+\n+// Set socket option `heartbeat_timeout`.\n+// Available from libzmq 4.2.0.          \n+void\n+    zsock_set_heartbeat_timeout (void *self, int heartbeat_timeout);\n+\n+// Get socket option `use_fd`. \n+// Available from libzmq 4.2.0.\n+int\n+    zsock_use_fd (void *self);\n+\n+// Set socket option `use_fd`. \n+// Available from libzmq 4.2.0.\n+void\n+    zsock_set_use_fd (void *self, int use_fd);\n+\n+// Set socket option `xpub_manual`.\n+// Available from libzmq 4.2.0.    \n+void\n+    zsock_set_xpub_manual (void *self, int xpub_manual);\n+\n+// Set socket option `xpub_welcome_msg`.\n+// Available from libzmq 4.2.0.         \n+void\n+    zsock_set_xpub_welcome_msg (void *self, const char *xpub_welcome_msg);\n+\n+// Set socket option `stream_notify`.\n+// Available from libzmq 4.2.0.      \n+void\n+    zsock_set_stream_notify (void *self, int stream_notify);\n+\n+// Get socket option `invert_matching`.\n+// Available from libzmq 4.2.0.        \n+int\n+    zsock_invert_matching (void *self);\n+\n+// Set socket option `invert_matching`.\n+// Available from libzmq 4.2.0.        \n+void\n+    zsock_set_invert_matching (void *self, int invert_matching);\n+\n+// Set socket option `xpub_verboser`.\n+// Available from libzmq 4.2.0.      \n+void\n+    zsock_set_xpub_verboser (void *self, int xpub_verboser);\n+\n+// Get socket option `connect_timeout`.\n+// Available from libzmq 4.2.0.        \n+int\n+    zsock_connect_timeout (void *self);\n+\n+// Set socket option `connect_timeout`.\n+// Available from libzmq 4.2.0.        \n+void\n+    zsock_set_connect_timeout (void *self, int connect_timeout);\n+\n+// Get socket option `tcp_maxrt`.\n+// Available from libzmq 4.2.0.  \n+int\n+    zsock_tcp_maxrt (void *self);\n+\n+// Set socket option `tcp_maxrt`.\n+// Available from libzmq 4.2.0.  \n+void\n+    zsock_set_tcp_maxrt (void *self, int tcp_maxrt);\n+\n+// Get socket option `thread_safe`.\n+// Available from libzmq 4.2.0.    \n+int\n+    zsock_thread_safe (void *self);\n+\n+// Get socket option `multicast_maxtpdu`.\n+// Available from libzmq 4.2.0.          \n+int\n+    zsock_multicast_maxtpdu (void *self);\n+\n+// Set socket option `multicast_maxtpdu`.\n+// Available from libzmq 4.2.0.          \n+void\n+    zsock_set_multicast_maxtpdu (void *self, int multicast_maxtpdu);\n+\n+// Get socket option `vmci_buffer_size`.\n+// Available from libzmq 4.2.0.         \n+int\n+    zsock_vmci_buffer_size (void *self);\n+\n+// Set socket option `vmci_buffer_size`.\n+// Available from libzmq 4.2.0.         \n+void\n+    zsock_set_vmci_buffer_size (void *self, int vmci_buffer_size);\n+\n+// Get socket option `vmci_buffer_min_size`.\n+// Available from libzmq 4.2.0.             \n+int\n+    zsock_vmci_buffer_min_size (void *self);\n+\n+// Set socket option `vmci_buffer_min_size`.\n+// Available from libzmq 4.2.0.             \n+void\n+    zsock_set_vmci_buffer_min_size (void *self, int vmci_buffer_min_size);\n+\n+// Get socket option `vmci_buffer_max_size`.\n+// Available from libzmq 4.2.0.             \n+int\n+    zsock_vmci_buffer_max_size (void *self);\n+\n+// Set socket option `vmci_buffer_max_size`.\n+// Available from libzmq 4.2.0.             \n+void\n+    zsock_set_vmci_buffer_max_size (void *self, int vmci_buffer_max_size);\n+\n+// Get socket option `vmci_connect_timeout`.\n+// Available from libzmq 4.2.0.             \n+int\n+    zsock_vmci_connect_timeout (void *self);\n+\n+// Set socket option `vmci_connect_timeout`.\n+// Available from libzmq 4.2.0.             \n+void\n+    zsock_set_vmci_connect_timeout (void *self, int vmci_connect_timeout);\n+\n+// Get socket option `tos`.    \n+// Available from libzmq 4.1.0.\n+int\n+    zsock_tos (void *self);\n+\n+// Set socket option `tos`.    \n+// Available from libzmq 4.1.0.\n+void\n+    zsock_set_tos (void *self, int tos);\n+\n+// Set socket option `router_handover`.\n+// Available from libzmq 4.1.0.        \n+void\n+    zsock_set_router_handover (void *self, int router_handover);\n+\n+// Set socket option `connect_rid`.\n+// Available from libzmq 4.1.0.    \n+void\n+    zsock_set_connect_rid (void *self, const char *connect_rid);\n+\n+// Set socket option `connect_rid` from 32-octet binary\n+// Available from libzmq 4.1.0.                        \n+void\n+    zsock_set_connect_rid_bin (void *self, const byte *connect_rid);\n+\n+// Get socket option `handshake_ivl`.\n+// Available from libzmq 4.1.0.      \n+int\n+    zsock_handshake_ivl (void *self);\n+\n+// Set socket option `handshake_ivl`.\n+// Available from libzmq 4.1.0.      \n+void\n+    zsock_set_handshake_ivl (void *self, int handshake_ivl);\n+\n+// Get socket option `socks_proxy`.\n+// Available from libzmq 4.1.0.    \n+char *\n+    zsock_socks_proxy (void *self);\n+\n+// Set socket option `socks_proxy`.\n+// Available from libzmq 4.1.0.    \n+void\n+    zsock_set_socks_proxy (void *self, const char *socks_proxy);\n+\n+// Set socket option `xpub_nodrop`.\n+// Available from libzmq 4.1.0.    \n+void\n+    zsock_set_xpub_nodrop (void *self, int xpub_nodrop);\n+\n+// Set socket option `router_mandatory`.\n+// Available from libzmq 4.0.0.         \n+void\n+    zsock_set_router_mandatory (void *self, int router_mandatory);\n+\n+// Set socket option `probe_router`.\n+// Available from libzmq 4.0.0.     \n+void\n+    zsock_set_probe_router (void *self, int probe_router);\n+\n+// Set socket option `req_relaxed`.\n+// Available from libzmq 4.0.0.    \n+void\n+    zsock_set_req_relaxed (void *self, int req_relaxed);\n+\n+// Set socket option `req_correlate`.\n+// Available from libzmq 4.0.0.      \n+void\n+    zsock_set_req_correlate (void *self, int req_correlate);\n+\n+// Set socket option `conflate`.\n+// Available from libzmq 4.0.0. \n+void\n+    zsock_set_conflate (void *self, int conflate);\n+\n+// Get socket option `zap_domain`.\n+// Available from libzmq 4.0.0.   \n+char *\n+    zsock_zap_domain (void *self);\n+\n+// Set socket option `zap_domain`.\n+// Available from libzmq 4.0.0.   \n+void\n+    zsock_set_zap_domain (void *self, const char *zap_domain);\n+\n+// Get socket option `mechanism`.\n+// Available from libzmq 4.0.0.  \n+int\n+    zsock_mechanism (void *self);\n+\n+// Get socket option `plain_server`.\n+// Available from libzmq 4.0.0.     \n+int\n+    zsock_plain_server (void *self);\n+\n+// Set socket option `plain_server`.\n+// Available from libzmq 4.0.0.     \n+void\n+    zsock_set_plain_server (void *self, int plain_server);\n+\n+// Get socket option `plain_username`.\n+// Available from libzmq 4.0.0.       \n+char *\n+    zsock_plain_username (void *self);\n+\n+// Set socket option `plain_username`.\n+// Available from libzmq 4.0.0.       \n+void\n+    zsock_set_plain_username (void *self, const char *plain_username);\n+\n+// Get socket option `plain_password`.\n+// Available from libzmq 4.0.0.       \n+char *\n+    zsock_plain_password (void *self);\n+\n+// Set socket option `plain_password`.\n+// Available from libzmq 4.0.0.       \n+void\n+    zsock_set_plain_password (void *self, const char *plain_password);\n+\n+// Get socket option `curve_server`.\n+// Available from libzmq 4.0.0.     \n+int\n+    zsock_curve_server (void *self);\n+\n+// Set socket option `curve_server`.\n+// Available from libzmq 4.0.0.     \n+void\n+    zsock_set_curve_server (void *self, int curve_server);\n+\n+// Get socket option `curve_publickey`.\n+// Available from libzmq 4.0.0.        \n+char *\n+    zsock_curve_publickey (void *self);\n+\n+// Set socket option `curve_publickey`.\n+// Available from libzmq 4.0.0.        \n+void\n+    zsock_set_curve_publickey (void *self, const char *curve_publickey);\n+\n+// Set socket option `curve_publickey` from 32-octet binary\n+// Available from libzmq 4.0.0.                            \n+void\n+    zsock_set_curve_publickey_bin (void *self, const byte *curve_publickey);\n+\n+// Get socket option `curve_secretkey`.\n+// Available from libzmq 4.0.0.        \n+char *\n+    zsock_curve_secretkey (void *self);\n+\n+// Set socket option `curve_secretkey`.\n+// Available from libzmq 4.0.0.        \n+void\n+    zsock_set_curve_secretkey (void *self, const char *curve_secretkey);\n+\n+// Set socket option `curve_secretkey` from 32-octet binary\n+// Available from libzmq 4.0.0.                            \n+void\n+    zsock_set_curve_secretkey_bin (void *self, const byte *curve_secretkey);\n+\n+// Get socket option `curve_serverkey`.\n+// Available from libzmq 4.0.0.        \n+char *\n+    zsock_curve_serverkey (void *self);\n+\n+// Set socket option `curve_serverkey`.\n+// Available from libzmq 4.0.0.        \n+void\n+    zsock_set_curve_serverkey (void *self, const char *curve_serverkey);\n+\n+// Set socket option `curve_serverkey` from 32-octet binary\n+// Available from libzmq 4.0.0.                            \n+void\n+    zsock_set_curve_serverkey_bin (void *self, const byte *curve_serverkey);\n+\n+// Get socket option `gssapi_server`.\n+// Available from libzmq 4.0.0.      \n+int\n+    zsock_gssapi_server (void *self);\n+\n+// Set socket option `gssapi_server`.\n+// Available from libzmq 4.0.0.      \n+void\n+    zsock_set_gssapi_server (void *self, int gssapi_server);\n+\n+// Get socket option `gssapi_plaintext`.\n+// Available from libzmq 4.0.0.         \n+int\n+    zsock_gssapi_plaintext (void *self);\n+\n+// Set socket option `gssapi_plaintext`.\n+// Available from libzmq 4.0.0.         \n+void\n+    zsock_set_gssapi_plaintext (void *self, int gssapi_plaintext);\n+\n+// Get socket option `gssapi_principal`.\n+// Available from libzmq 4.0.0.         \n+char *\n+    zsock_gssapi_principal (void *self);\n+\n+// Set socket option `gssapi_principal`.\n+// Available from libzmq 4.0.0.         \n+void\n+    zsock_set_gssapi_principal (void *self, const char *gssapi_principal);\n+\n+// Get socket option `gssapi_service_principal`.\n+// Available from libzmq 4.0.0.                 \n+char *\n+    zsock_gssapi_service_principal (void *self);\n+\n+// Set socket option `gssapi_service_principal`.\n+// Available from libzmq 4.0.0.                 \n+void\n+    zsock_set_gssapi_service_principal (void *self, const char *gssapi_service_principal);\n+\n+// Get socket option `ipv6`.   \n+// Available from libzmq 4.0.0.\n+int\n+    zsock_ipv6 (void *self);\n+\n+// Set socket option `ipv6`.   \n+// Available from libzmq 4.0.0.\n+void\n+    zsock_set_ipv6 (void *self, int ipv6);\n+\n+// Get socket option `immediate`.\n+// Available from libzmq 4.0.0.  \n+int\n+    zsock_immediate (void *self);\n+\n+// Set socket option `immediate`.\n+// Available from libzmq 4.0.0.  \n+void\n+    zsock_set_immediate (void *self, int immediate);\n+\n+// Get socket option `type`.   \n+// Available from libzmq 3.0.0.\n+int\n+    zsock_type (void *self);\n+\n+// Get socket option `sndhwm`. \n+// Available from libzmq 3.0.0.\n+int\n+    zsock_sndhwm (void *self);\n+\n+// Set socket option `sndhwm`. \n+// Available from libzmq 3.0.0.\n+void\n+    zsock_set_sndhwm (void *self, int sndhwm);\n+\n+// Get socket option `rcvhwm`. \n+// Available from libzmq 3.0.0.\n+int\n+    zsock_rcvhwm (void *self);\n+\n+// Set socket option `rcvhwm`. \n+// Available from libzmq 3.0.0.\n+void\n+    zsock_set_rcvhwm (void *self, int rcvhwm);\n+\n+// Get socket option `affinity`.\n+// Available from libzmq 3.0.0. \n+int\n+    zsock_affinity (void *self);\n+\n+// Set socket option `affinity`.\n+// Available from libzmq 3.0.0. \n+void\n+    zsock_set_affinity (void *self, int affinity);\n+\n+// Set socket option `subscribe`.\n+// Available from libzmq 3.0.0.  \n+void\n+    zsock_set_subscribe (void *self, const char *subscribe);\n+\n+// Set socket option `unsubscribe`.\n+// Available from libzmq 3.0.0.    \n+void\n+    zsock_set_unsubscribe (void *self, const char *unsubscribe);\n+\n+// Get socket option `identity`.\n+// Available from libzmq 3.0.0. \n+char *\n+    zsock_identity (void *self);\n+\n+// Set socket option `identity`.\n+// Available from libzmq 3.0.0. \n+void\n+    zsock_set_identity (void *self, const char *identity);\n+\n+// Get socket option `rate`.   \n+// Available from libzmq 3.0.0.\n+int\n+    zsock_rate (void *self);\n+\n+// Set socket option `rate`.   \n+// Available from libzmq 3.0.0.\n+void\n+    zsock_set_rate (void *self, int rate);\n+\n+// Get socket option `recovery_ivl`.\n+// Available from libzmq 3.0.0.     \n+int\n+    zsock_recovery_ivl (void *self);\n+\n+// Set socket option `recovery_ivl`.\n+// Available from libzmq 3.0.0.     \n+void\n+    zsock_set_recovery_ivl (void *self, int recovery_ivl);\n+\n+// Get socket option `sndbuf`. \n+// Available from libzmq 3.0.0.\n+int\n+    zsock_sndbuf (void *self);\n+\n+// Set socket option `sndbuf`. \n+// Available from libzmq 3.0.0.\n+void\n+    zsock_set_sndbuf (void *self, int sndbuf);\n+\n+// Get socket option `rcvbuf`. \n+// Available from libzmq 3.0.0.\n+int\n+    zsock_rcvbuf (void *self);\n+\n+// Set socket option `rcvbuf`. \n+// Available from libzmq 3.0.0.\n+void\n+    zsock_set_rcvbuf (void *self, int rcvbuf);\n+\n+// Get socket option `linger`. \n+// Available from libzmq 3.0.0.\n+int\n+    zsock_linger (void *self);\n+\n+// Set socket option `linger`. \n+// Available from libzmq 3.0.0.\n+void\n+    zsock_set_linger (void *self, int linger);\n+\n+// Get socket option `reconnect_ivl`.\n+// Available from libzmq 3.0.0.      \n+int\n+    zsock_reconnect_ivl (void *self);\n+\n+// Set socket option `reconnect_ivl`.\n+// Available from libzmq 3.0.0.      \n+void\n+    zsock_set_reconnect_ivl (void *self, int reconnect_ivl);\n+\n+// Get socket option `reconnect_ivl_max`.\n+// Available from libzmq 3.0.0.          \n+int\n+    zsock_reconnect_ivl_max (void *self);\n+\n+// Set socket option `reconnect_ivl_max`.\n+// Available from libzmq 3.0.0.          \n+void\n+    zsock_set_reconnect_ivl_max (void *self, int reconnect_ivl_max);\n+\n+// Get socket option `backlog`.\n+// Available from libzmq 3.0.0.\n+int\n+    zsock_backlog (void *self);\n+\n+// Set socket option `backlog`.\n+// Available from libzmq 3.0.0.\n+void\n+    zsock_set_backlog (void *self, int backlog);\n+\n+// Get socket option `maxmsgsize`.\n+// Available from libzmq 3.0.0.   \n+int\n+    zsock_maxmsgsize (void *self);\n+\n+// Set socket option `maxmsgsize`.\n+// Available from libzmq 3.0.0.   \n+void\n+    zsock_set_maxmsgsize (void *self, int maxmsgsize);\n+\n+// Get socket option `multicast_hops`.\n+// Available from libzmq 3.0.0.       \n+int\n+    zsock_multicast_hops (void *self);\n+\n+// Set socket option `multicast_hops`.\n+// Available from libzmq 3.0.0.       \n+void\n+    zsock_set_multicast_hops (void *self, int multicast_hops);\n+\n+// Get socket option `rcvtimeo`.\n+// Available from libzmq 3.0.0. \n+int\n+    zsock_rcvtimeo (void *self);\n+\n+// Set socket option `rcvtimeo`.\n+// Available from libzmq 3.0.0. \n+void\n+    zsock_set_rcvtimeo (void *self, int rcvtimeo);\n+\n+// Get socket option `sndtimeo`.\n+// Available from libzmq 3.0.0. \n+int\n+    zsock_sndtimeo (void *self);\n+\n+// Set socket option `sndtimeo`.\n+// Available from libzmq 3.0.0. \n+void\n+    zsock_set_sndtimeo (void *self, int sndtimeo);\n+\n+// Set socket option `xpub_verbose`.\n+// Available from libzmq 3.0.0.     \n+void\n+    zsock_set_xpub_verbose (void *self, int xpub_verbose);\n+\n+// Get socket option `tcp_keepalive`.\n+// Available from libzmq 3.0.0.      \n+int\n+    zsock_tcp_keepalive (void *self);\n+\n+// Set socket option `tcp_keepalive`.\n+// Available from libzmq 3.0.0.      \n+void\n+    zsock_set_tcp_keepalive (void *self, int tcp_keepalive);\n+\n+// Get socket option `tcp_keepalive_idle`.\n+// Available from libzmq 3.0.0.           \n+int\n+    zsock_tcp_keepalive_idle (void *self);\n+\n+// Set socket option `tcp_keepalive_idle`.\n+// Available from libzmq 3.0.0.           \n+void\n+    zsock_set_tcp_keepalive_idle (void *self, int tcp_keepalive_idle);\n+\n+// Get socket option `tcp_keepalive_cnt`.\n+// Available from libzmq 3.0.0.          \n+int\n+    zsock_tcp_keepalive_cnt (void *self);\n+\n+// Set socket option `tcp_keepalive_cnt`.\n+// Available from libzmq 3.0.0.          \n+void\n+    zsock_set_tcp_keepalive_cnt (void *self, int tcp_keepalive_cnt);\n+\n+// Get socket option `tcp_keepalive_intvl`.\n+// Available from libzmq 3.0.0.            \n+int\n+    zsock_tcp_keepalive_intvl (void *self);\n+\n+// Set socket option `tcp_keepalive_intvl`.\n+// Available from libzmq 3.0.0.            \n+void\n+    zsock_set_tcp_keepalive_intvl (void *self, int tcp_keepalive_intvl);\n+\n+// Get socket option `tcp_accept_filter`.\n+// Available from libzmq 3.0.0.          \n+char *\n+    zsock_tcp_accept_filter (void *self);\n+\n+// Set socket option `tcp_accept_filter`.\n+// Available from libzmq 3.0.0.          \n+void\n+    zsock_set_tcp_accept_filter (void *self, const char *tcp_accept_filter);\n+\n+// Get socket option `rcvmore`.\n+// Available from libzmq 3.0.0.\n+int\n+    zsock_rcvmore (void *self);\n+\n+// Get socket option `fd`.     \n+// Available from libzmq 3.0.0.\n+SOCKET\n+    zsock_fd (void *self);\n+\n+// Get socket option `events`. \n+// Available from libzmq 3.0.0.\n+int\n+    zsock_events (void *self);\n+\n+// Get socket option `last_endpoint`.\n+// Available from libzmq 3.0.0.      \n+char *\n+    zsock_last_endpoint (void *self);\n+\n+// Set socket option `router_raw`.\n+// Available from libzmq 3.0.0.   \n+void\n+    zsock_set_router_raw (void *self, int router_raw);\n+\n+// Get socket option `ipv4only`.\n+// Available from libzmq 3.0.0. \n+int\n+    zsock_ipv4only (void *self);\n+\n+// Set socket option `ipv4only`.\n+// Available from libzmq 3.0.0. \n+void\n+    zsock_set_ipv4only (void *self, int ipv4only);\n+\n+// Set socket option `delay_attach_on_connect`.\n+// Available from libzmq 3.0.0.                \n+void\n+    zsock_set_delay_attach_on_connect (void *self, int delay_attach_on_connect);\n+\n+// Self test of this class.\n+void\n+    zsock_test (bool verbose);\n+\n+// CLASS: zstr\n+// Receive C string from socket. Caller must free returned string using\n+// zstr_free(). Returns NULL if the context is being terminated or the \n+// process was interrupted.                                            \n+char *\n+    zstr_recv (void *source);\n+\n+// Receive a series of strings (until NULL) from multipart data.    \n+// Each string is allocated and filled with string data; if there   \n+// are not enough frames, unallocated strings are set to NULL.      \n+// Returns -1 if the message could not be read, else returns the    \n+// number of strings filled, zero or more. Free each returned string\n+// using zstr_free(). If not enough strings are provided, remaining \n+// multipart frames in the message are dropped.                     \n+int\n+    zstr_recvx (void *source, char **string_p, ...);\n+\n+// Send a C string to a socket, as a frame. The string is sent without \n+// trailing null byte; to read this you can use zstr_recv, or a similar\n+// method that adds a null terminator on the received string. String   \n+// may be NULL, which is sent as "".                                   \n+int\n+    zstr_send (void *dest, const char *string);\n+\n+// Send a C string to a socket, as zstr_send(), with a MORE flag, so that\n+// you can send further strings in the same multi-part message.          \n+int\n+    zstr_sendm (void *dest, const char *string);\n+\n+// Send a formatted string to a socket. Note that you should NOT use\n+// user-supplied strings in the format (they may contain \'%\' which  \n+// will create security holes).                                     \n+int\n+    zstr_sendf (void *dest, const char *format, ...);\n+\n+// Send a formatted string to a socket, as for zstr_sendf(), with a      \n+// MORE flag, so that you can send further strings in the same multi-part\n+// message.                                                              \n+int\n+    zstr_sendfm (void *dest, const char *format, ...);\n+\n+// Send a series of strings (until NULL) as multipart data   \n+// Returns 0 if the strings could be sent OK, or -1 on error.\n+int\n+    zstr_sendx (void *dest, const char *string, ...);\n+\n+// Accepts a void pointer and returns a fresh character string. If source\n+// is null, returns an empty string.                                     \n+char *\n+    zstr_str (void *source);\n+\n+// Free a provided string, and nullify the parent pointer. Safe to call on\n+// a null pointer.                                                        \n+void\n+    zstr_free (char **string_p);\n+\n+// Self test of this class.\n+void\n+    zstr_test (bool verbose);\n+\n+// CLASS: ztimerset\n+// Create new timer set.\n+ztimerset_t *\n+    ztimerset_new (void);\n+\n+// Destroy a timer set\n+void\n+    ztimerset_destroy (ztimerset_t **self_p);\n+\n+// Add a timer to the set. Returns timer id if OK, -1 on failure.\n+int\n+    ztimerset_add (ztimerset_t *self, size_t interval, ztimerset_fn handler, void *arg);\n+\n+// Cancel a timer. Returns 0 if OK, -1 on failure.\n+int\n+    ztimerset_cancel (ztimerset_t *self, int timer_id);\n+\n+// Set timer interval. Returns 0 if OK, -1 on failure.                                    \n+// This method is slow, canceling the timer and adding a new one yield better performance.\n+int\n+    ztimerset_set_interval (ztimerset_t *self, int timer_id, size_t interval);\n+\n+// Reset timer to start interval counting from current time. Returns 0 if OK, -1 on failure.\n+// This method is slow, canceling the timer and adding a new one yield better performance.  \n+int\n+    ztimerset_reset (ztimerset_t *self, int timer_id);\n+\n+// Return the time until the next interval.                        \n+// Should be used as timeout parameter for the zpoller wait method.\n+// The timeout is in msec.                                         \n+int\n+    ztimerset_timeout (ztimerset_t *self);\n+\n+// Invoke callback function of all timers which their interval has elapsed.\n+// Should be call after zpoller wait method.                               \n+// Returns 0 if OK, -1 on failure.                                         \n+int\n+    ztimerset_execute (ztimerset_t *self);\n+\n+// Self test of this class.\n+void\n+    ztimerset_test (bool verbose);\n+\n+// CLASS: ztrie\n+// Creates a new ztrie.\n+ztrie_t *\n+    ztrie_new (char delimiter);\n+\n+// Destroy the ztrie.\n+void\n+    ztrie_destroy (ztrie_t **self_p);\n+\n+// Inserts a new route into the tree and attaches the data. Returns -1     \n+// if the route already exists, otherwise 0. This method takes ownership of\n+// the provided data if a destroy_data_fn is provided.                     \n+int\n+    ztrie_insert_route (ztrie_t *self, const char *path, void *data, ztrie_destroy_data_fn destroy_data_fn);\n+\n+// Removes a route from the trie and destroys its data. Returns -1 if the\n+// route does not exists, otherwise 0.                                   \n+// the start of the list call zlist_first (). Advances the cursor.       \n+int\n+    ztrie_remove_route (ztrie_t *self, const char *path);\n+\n+// Returns true if the path matches a route in the tree, otherwise false.\n+bool\n+    ztrie_matches (ztrie_t *self, const char *path);\n+\n+// Returns the data of a matched route from last ztrie_matches. If the path\n+// did not match, returns NULL. Do not delete the data as it\'s owned by    \n+// ztrie.                                                                  \n+void *\n+    ztrie_hit_data (ztrie_t *self);\n+\n+// Returns the count of parameters that a matched route has.\n+size_t\n+    ztrie_hit_parameter_count (ztrie_t *self);\n+\n+// Returns the parameters of a matched route with named regexes from last   \n+// ztrie_matches. If the path did not match or the route did not contain any\n+// named regexes, returns NULL.                                             \n+zhashx_t *\n+    ztrie_hit_parameters (ztrie_t *self);\n+\n+// Returns the asterisk matched part of a route, if there has been no match\n+// or no asterisk match, returns NULL.                                     \n+const char *\n+    ztrie_hit_asterisk_match (ztrie_t *self);\n+\n+// Print the trie\n+void\n+    ztrie_print (ztrie_t *self);\n+\n+// Self test of this class.\n+void\n+    ztrie_test (bool verbose);\n+\n+// CLASS: zuuid\n+// Create a new UUID object.\n+zuuid_t *\n+    zuuid_new (void);\n+\n+// Destroy a specified UUID object.\n+void\n+    zuuid_destroy (zuuid_t **self_p);\n+\n+// Create UUID object from supplied ZUUID_LEN-octet value.\n+zuuid_t *\n+    zuuid_new_from (const byte *source);\n+\n+// Set UUID to new supplied ZUUID_LEN-octet value.\n+void\n+    zuuid_set (zuuid_t *self, const byte *source);\n+\n+// Set UUID to new supplied string value skipping \'-\' and \'{\' \'}\'\n+// optional delimiters. Return 0 if OK, else returns -1.         \n+int\n+    zuuid_set_str (zuuid_t *self, const char *source);\n+\n+// Return UUID binary data.\n+const byte *\n+    zuuid_data (zuuid_t *self);\n+\n+// Return UUID binary size\n+size_t\n+    zuuid_size (zuuid_t *self);\n+\n+// Returns UUID as string\n+const char *\n+    zuuid_str (zuuid_t *self);\n+\n+// Return UUID in the canonical string format: 8-4-4-4-12, in lower\n+// case. Caller does not modify or free returned value. See        \n+// http://en.wikipedia.org/wiki/Universally_unique_identifier      \n+const char *\n+    zuuid_str_canonical (zuuid_t *self);\n+\n+// Store UUID blob in target array\n+void\n+    zuuid_export (zuuid_t *self, byte *target);\n+\n+// Check if UUID is same as supplied value\n+bool\n+    zuuid_eq (zuuid_t *self, const byte *compare);\n+\n+// Check if UUID is different from supplied value\n+bool\n+    zuuid_neq (zuuid_t *self, const byte *compare);\n+\n+// Make copy of UUID object; if uuid is null, or memory was exhausted,\n+// returns null.                                                      \n+zuuid_t *\n+    zuuid_dup (zuuid_t *self);\n+\n+// Self test of this class.\n+void\n+    zuuid_test (bool verbose);\n+\n+]]\n+\n+czmq_ffi.czmq = czmq_ffi.ffi.load ("libczmq")\n+return czmq_ffi\ndiff --git a/builds/cmake/ci_build.sh b/builds/cmake/ci_build.sh\nindex 4da33a0a..30074986 100755\n--- a/builds/cmake/ci_build.sh\n+++ b/builds/cmake/ci_build.sh\n@@ -30,6 +30,14 @@ fi\n if [ -e buildconf ]; then\n     ./buildconf 2> /dev/null\n fi\n+if [ ! -e autogen.sh ] && [ ! -e buildconf ] && [ ! -e ./configure ] && [ -s ./configure.ac ]; then\n+    libtoolize --copy --force && \\\n+    aclocal -I . && \\\n+    autoheader && \\\n+    automake --add-missing --copy && \\\n+    autoconf || \\\n+    autoreconf -fiv\n+fi\n ./configure "${CONFIG_OPTS[@]}"\n make -j4\n make install\ndiff --git a/builds/rpi/build.sh b/builds/rpi/build.sh\nindex f0fc0844..549fef03 100755\n--- a/builds/rpi/build.sh\n+++ b/builds/rpi/build.sh\n@@ -91,6 +91,14 @@ if [ ! $INCREMENTAL ]; then\n         if [ -e buildconf ]; then\n             ./buildconf 2> /dev/null\n         fi\n+        if [ ! -e autogen.sh ] && [ ! -e buildconf ] && [ ! -e ./configure ] && [ -s ./configure.ac ]; then\n+            libtoolize --copy --force && \\\n+            aclocal -I . && \\\n+            autoheader && \\\n+            automake --add-missing --copy && \\\n+            autoconf || \\\n+            autoreconf -fiv\n+        fi\n         ./configure "${CONFIG_OPTS[@]}"\n         make -j4\n         make install\ndiff --git a/ci_build.sh b/ci_build.sh\nindex 62f7dac4..f4e56188 100755\n--- a/ci_build.sh\n+++ b/ci_build.sh\n@@ -8,64 +8,152 @@\n set -x\n set -e\n \n-if [ "$BUILD_TYPE" == "default" ] || [ "$BUILD_TYPE" == "default-Werror" ] ; then\n+if [ "$BUILD_TYPE" == "default" ] || [ "$BUILD_TYPE" == "default-Werror" ] || [ "$BUILD_TYPE" == "valgrind" ]; then\n+    LANG=C\n+    LC_ALL=C\n+    export LANG LC_ALL\n+\n     if [ -d "./tmp" ]; then\n         rm -rf ./tmp\n     fi\n     mkdir -p tmp\n     BUILD_PREFIX=$PWD/tmp\n \n+    PATH="`echo "$PATH" | sed -e \'s,^/usr/lib/ccache/?:,,\' -e \'s,:/usr/lib/ccache/?:,,\' -e \'s,:/usr/lib/ccache/?$,,\' -e \'s,^/usr/lib/ccache/?$,,\'2`"\n+    CCACHE_PATH="$PATH"\n+    CCACHE_DIR="${HOME}/.ccache"\n+    export CCACHE_PATH CCACHE_DIR PATH\n+    HAVE_CCACHE=no\n+    if which ccache && ls -la /usr/lib/ccache ; then\n+        HAVE_CCACHE=yes\n+    fi\n+\n+    if [ "$HAVE_CCACHE" = yes ] && [ -d "$CCACHE_DIR" ]; then\n+        echo "CCache stats before build:"\n+        ccache -s || true\n+    fi\n+    mkdir -p "${HOME}/.ccache"\n+\n     CONFIG_OPTS=()\n     COMMON_CFLAGS=""\n     EXTRA_CFLAGS=""\n     EXTRA_CPPFLAGS=""\n     EXTRA_CXXFLAGS=""\n-    if [ "$BUILD_TYPE" == "default-Werror" ] ; then\n-        COMPILER_FAMILY=""\n-        if [ -n "$CC" -a -n "$CXX" ]; then\n-            if "$CC" --version 2>&1 | grep GCC > /dev/null && \\\n-               "$CXX" --version 2>&1 | grep GCC > /dev/null \\\n-            ; then\n-                COMPILER_FAMILY="GCC"\n-            fi\n-        else\n-            if "gcc" --version 2>&1 | grep GCC > /dev/null && \\\n-               "g++" --version 2>&1 | grep GCC > /dev/null \\\n-            ; then\n-                # Autoconf would pick this by default\n-                COMPILER_FAMILY="GCC"\n-            elif "cc" --version 2>&1 | grep GCC > /dev/null && \\\n-               "c++" --version 2>&1 | grep GCC > /dev/null \\\n-            ; then\n-                COMPILER_FAMILY="GCC"\n-            fi\n+\n+    is_gnucc() {\n+        if [ -n "$1" ] && "$1" --version 2>&1 | grep \'Free Software Foundation\' > /dev/null ; then true ; else false ; fi\n+    }\n+\n+    COMPILER_FAMILY=""\n+    if [ -n "$CC" -a -n "$CXX" ]; then\n+        if is_gnucc "$CC" && is_gnucc "$CXX" ; then\n+            COMPILER_FAMILY="GCC"\n+            export CC CXX\n         fi\n+    else\n+        if is_gnucc "gcc" && is_gnucc "g++" ; then\n+            # Autoconf would pick this by default\n+            COMPILER_FAMILY="GCC"\n+            [ -n "$CC" ] || CC=gcc\n+            [ -n "$CXX" ] || CXX=g++\n+            export CC CXX\n+        elif is_gnucc "cc" && is_gnucc "c++" ; then\n+            COMPILER_FAMILY="GCC"\n+            [ -n "$CC" ] || CC=cc\n+            [ -n "$CXX" ] || CXX=c++\n+            export CC CXX\n+        fi\n+    fi\n \n+    if [ -n "$CPP" ] ; then\n+        [ -x "$CPP" ] && export CPP\n+    else\n+        if is_gnucc "cpp" ; then\n+            CPP=cpp && export CPP\n+        fi\n+    fi\n+\n+    CONFIG_OPT_WERROR="--enable-Werror=no"\n+    if [ "$BUILD_TYPE" == "default-Werror" ] ; then\n         case "${COMPILER_FAMILY}" in\n             GCC)\n                 echo "NOTE: Enabling ${COMPILER_FAMILY} compiler pedantic error-checking flags for BUILD_TYPE=\'$BUILD_TYPE\'" >&2\n-                COMMON_CFLAGS="-Wall -Werror"\n-                EXTRA_CFLAGS="-std=c99"\n-                EXTRA_CPPFLAGS=""\n-                EXTRA_CXXFLAGS="-std=c++99"\n+                CONFIG_OPT_WERROR="--enable-Werror=yes"\n+                CONFIG_OPTS+=("--enable-Werror=yes")\n                 ;;\n             *)\n-                echo "WARNING: Current compiler is not GCC, not enabling pedantic error-checking flags for BUILD_TYPE=\'$BUILD_TYPE\'" >&2\n+                echo "WARNING: Current compiler is not GCC, might not enable pedantic error-checking flags for BUILD_TYPE=\'$BUILD_TYPE\'" >&2\n+                CONFIG_OPT_WERROR="--enable-Werror=auto"\n                 ;;\n         esac\n     fi\n-    CONFIG_OPTS+=("CFLAGS=-I${BUILD_PREFIX}/include ${COMMON_CFLAGS} ${EXTRA_CFLAGS}")\n-    CONFIG_OPTS+=("CPPFLAGS=-I${BUILD_PREFIX}/include ${COMMON_CFLAGS} ${EXTRA_CPPFLAGS}")\n-    CONFIG_OPTS+=("CXXFLAGS=-I${BUILD_PREFIX}/include ${COMMON_CFLAGS} ${EXTRA_CXXFLAGS}")\n+\n+    CONFIG_OPTS+=("CFLAGS=-I${BUILD_PREFIX}/include")\n+    CONFIG_OPTS+=("CPPFLAGS=-I${BUILD_PREFIX}/include")\n+    CONFIG_OPTS+=("CXXFLAGS=-I${BUILD_PREFIX}/include")\n     CONFIG_OPTS+=("LDFLAGS=-L${BUILD_PREFIX}/lib")\n     CONFIG_OPTS+=("PKG_CONFIG_PATH=${BUILD_PREFIX}/lib/pkgconfig")\n     CONFIG_OPTS+=("--prefix=${BUILD_PREFIX}")\n     CONFIG_OPTS+=("--with-docs=no")\n     CONFIG_OPTS+=("--quiet")\n \n+    if [ "$HAVE_CCACHE" = yes ] && [ "${COMPILER_FAMILY}" = GCC ]; then\n+        PATH="/usr/lib/ccache:$PATH"\n+        export PATH\n+        if [ -n "$CC" ] && [ -x "/usr/lib/ccache/`basename "$CC"`" ]; then\n+            case "$CC" in\n+                *ccache*) ;;\n+                */*) DIR_CC="`dirname "$CC"`" && [ -n "$DIR_CC" ] && DIR_CC="`cd "$DIR_CC" && pwd `" && [ -n "$DIR_CC" ] && [ -d "$DIR_CC" ] || DIR_CC=""\n+                    [ -z "$CCACHE_PATH" ] && CCACHE_PATH="$DIR_CC" || \\\n+                    if echo "$CCACHE_PATH" | egrep \'(^\'"$DIR_CC"\':.*|^\'"$DIR_CC"\'$|:\'"$DIR_CC"\':|:\'"$DIR_CC"\'$)\' ; then\n+                        CCACHE_PATH="$DIR_CC:$CCACHE_PATH"\n+                    fi\n+                    ;;\n+            esac\n+            CC="/usr/lib/ccache/`basename "$CC"`"\n+        else\n+            : # CC="ccache $CC"\n+        fi\n+        if [ -n "$CXX" ] && [ -x "/usr/lib/ccache/`basename "$CXX"`" ]; then\n+            case "$CXX" in\n+                *ccache*) ;;\n+                */*) DIR_CXX="`dirname "$CXX"`" && [ -n "$DIR_CXX" ] && DIR_CXX="`cd "$DIR_CXX" && pwd `" && [ -n "$DIR_CXX" ] && [ -d "$DIR_CXX" ] || DIR_CXX=""\n+                    [ -z "$CCACHE_PATH" ] && CCACHE_PATH="$DIR_CXX" || \\\n+                    if echo "$CCACHE_PATH" | egrep \'(^\'"$DIR_CXX"\':.*|^\'"$DIR_CXX"\'$|:\'"$DIR_CXX"\':|:\'"$DIR_CXX"\'$)\' ; then\n+                        CCACHE_PATH="$DIR_CXX:$CCACHE_PATH"\n+                    fi\n+                    ;;\n+            esac\n+            CXX="/usr/lib/ccache/`basename "$CXX"`"\n+        else\n+            : # CXX="ccache $CXX"\n+        fi\n+        if [ -n "$CPP" ] && [ -x "/usr/lib/ccache/`basename "$CPP"`" ]; then\n+            case "$CPP" in\n+                *ccache*) ;;\n+                */*) DIR_CPP="`dirname "$CPP"`" && [ -n "$DIR_CPP" ] && DIR_CPP="`cd "$DIR_CPP" && pwd `" && [ -n "$DIR_CPP" ] && [ -d "$DIR_CPP" ] || DIR_CPP=""\n+                    [ -z "$CCACHE_PATH" ] && CCACHE_PATH="$DIR_CPP" || \\\n+                    if echo "$CCACHE_PATH" | egrep \'(^\'"$DIR_CPP"\':.*|^\'"$DIR_CPP"\'$|:\'"$DIR_CPP"\':|:\'"$DIR_CPP"\'$)\' ; then\n+                        CCACHE_PATH="$DIR_CPP:$CCACHE_PATH"\n+                    fi\n+                    ;;\n+            esac\n+            CPP="/usr/lib/ccache/`basename "$CPP"`"\n+        else\n+            : # CPP="ccache $CPP"\n+        fi\n+\n+        CONFIG_OPTS+=("CC=${CC}")\n+        CONFIG_OPTS+=("CXX=${CXX}")\n+        CONFIG_OPTS+=("CPP=${CPP}")\n+    fi\n+\n     # Clone and build dependencies\n     git clone --quiet --depth 1 https://github.com/zeromq/libzmq.git libzmq.git\n+    BASE_PWD=${PWD}\n     cd libzmq.git\n+    CCACHE_BASEDIR=${PWD}\n+    export CCACHE_BASEDIR\n     git --no-pager log --oneline -n1\n     if [ -e autogen.sh ]; then\n         ./autogen.sh 2> /dev/null\n@@ -73,30 +161,46 @@ if [ "$BUILD_TYPE" == "default" ] || [ "$BUILD_TYPE" == "default-Werror" ] ; the\n     if [ -e buildconf ]; then\n         ./buildconf 2> /dev/null\n     fi\n+    if [ ! -e autogen.sh ] && [ ! -e buildconf ] && [ ! -e ./configure ] && [ -s ./configure.ac ]; then\n+        libtoolize --copy --force && \\\n+        aclocal -I . && \\\n+        autoheader && \\\n+        automake --add-missing --copy && \\\n+        autoconf || \\\n+        autoreconf -fiv\n+    fi\n     ./configure "${CONFIG_OPTS[@]}"\n     make -j4\n     make install\n-    cd ..\n+    cd "${BASE_PWD}"\n \n-    # Build and check this project\n+    # Build and check this project; note that zprojects always have an autogen.sh\n+    CCACHE_BASEDIR=${PWD}\n+    export CCACHE_BASEDIR\n+    # Only use --enable-Werror on projects that are expected to have it\n+    # (and it is not our duty to check prerequisite projects anyway)\n+    CONFIG_OPTS+=("${CONFIG_OPT_WERROR}")\n     ./autogen.sh 2> /dev/null\n     ./configure --enable-drafts=yes "${CONFIG_OPTS[@]}"\n+    if [ "$BUILD_TYPE" == "valgrind" ] ; then\n+        # Build and check this project\n+        make VERBOSE=1 memcheck\n+        exit $?\n+    fi\n     make VERBOSE=1 all\n \n     echo "=== Are GitIgnores good after \'make all\' with drafts? (should have no output below)"\n     git status -s || true\n     echo "==="\n \n-    if [ "$BUILD_TYPE" == "default-Werror" ] ; then\n-        echo "NOTE: Skipping distcheck for BUILD_TYPE=\'$BUILD_TYPE\'" >&2\n-    else\n+    (\n         export DISTCHECK_CONFIGURE_FLAGS="--enable-drafts=yes ${CONFIG_OPTS[@]}"\n         make VERBOSE=1 DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS" distcheck\n \n         echo "=== Are GitIgnores good after \'make distcheck\' with drafts? (should have no output below)"\n         git status -s || true\n         echo "==="\n-    fi\n+    )\n \n     # Build and check this project without DRAFT APIs\n     make distclean\n@@ -107,18 +211,21 @@ if [ "$BUILD_TYPE" == "default" ] || [ "$BUILD_TYPE" == "default-Werror" ] ; the\n         ./autogen.sh 2> /dev/null\n         ./configure --enable-drafts=no "${CONFIG_OPTS[@]}" --with-docs=yes\n         make VERBOSE=1 all || exit $?\n-        if [ "$BUILD_TYPE" == "default-Werror" ] ; then\n-            echo "NOTE: Skipping distcheck for BUILD_TYPE=\'$BUILD_TYPE\'" >&2\n-        else\n+        (\n             export DISTCHECK_CONFIGURE_FLAGS="--enable-drafts=no ${CONFIG_OPTS[@]} --with-docs=yes" && \\\n             make VERBOSE=1 DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS" distcheck || exit $?\n-        fi\n+        )\n     ) || exit 1\n \n     echo "=== Are GitIgnores good after \'make distcheck\' without drafts? (should have no output below)"\n     git status -s || true\n     echo "==="\n \n+    if [ "$HAVE_CCACHE" = yes ]; then\n+        echo "CCache stats after build:"\n+        ccache -s\n+    fi\n+\n elif [ "$BUILD_TYPE" == "bindings" ]; then\n     pushd "./bindings/${BINDING}" && ./ci_build.sh\n else\ndiff --git a/configure.ac b/configure.ac\nindex 385193a8..8845f60f 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -368,6 +368,19 @@ AM_CONDITIONAL(ON_GNU, test "x$czmq_on_gnu" = "xyes")\n AM_CONDITIONAL(INSTALL_MAN, test "x$czmq_install_man" = "xyes")\n AM_CONDITIONAL(BUILD_DOC, test "x$czmq_build_doc" = "xyes")\n \n+AC_ARG_ENABLE([dist_cmakefiles],\n+    AS_HELP_STRING([--enable-dist_cmakefiles],\n+        [Distribute CMakeLists.txt and related files [default depends: on if present and not cross compiling]]),\n+    [enable_dist_cmakefiles=$enableval],\n+    [AC_MSG_CHECKING([for presence of CMake recipes])\n+if test "x$cross_compiling" = "xyes"; then\n+     enable_dist_cmakefiles=no\n+else\n+     AC_CHECK_FILE($srcdir/CMakeLists.txt, [enable_dist_cmakefiles=yes], [enable_dist_cmakefiles=no])\n+fi\n+     AC_MSG_RESULT([$enable_dist_cmakefiles])])\n+AM_CONDITIONAL(ENABLE_DIST_CMAKEFILES, test "x$enable_dist_cmakefiles" = "xyes")\n+\n # Check for zmakecert intent\n AC_ARG_ENABLE([zmakecert],\n     AS_HELP_STRING([--enable-zmakecert],\n@@ -426,6 +439,33 @@ else\n     AC_SUBST(pkg_config_defines, "")\n fi\n \n+AC_ARG_ENABLE([Werror],\n+    AS_HELP_STRING([--enable-Werror],\n+        [Add -Wall -Werror to GCC/GXX arguments [default=no; default=auto if nothing specified]]),\n+    [AS_IF([test -n "$enableval"], [enable_Werror=$enableval], [enable_Werror=auto])],\n+    [enable_Werror=no])\n+\n+AS_IF([test "x$enable_Werror" = "xyes" || test "x$enable_Werror" = "xauto"],\n+    [AS_IF([test -n "$CC"],[AS_IF([$CC --version 2>&1 | grep \'Free Software Foundation\' > /dev/null],\n+        [AC_MSG_NOTICE([Enabling pedantic errors for GNU C])\n+         CFLAGS="$CFLAGS -Wall -Werror"],\n+        [AC_MSG_NOTICE([Not enabling pedantic errors: compiler not supported by this recipe (not GNU C)])\n+         AS_IF([test "x$enable_Werror" = "xyes"], [AC_MSG_ERROR([--enable-Werror=yes was requested and can not be satisfied for C: $CC])])\n+        ])])\n+     AS_IF([test -n "$CXX"],[AS_IF([$CXX --version 2>&1 | grep \'Free Software Foundation\' > /dev/null],\n+        [AC_MSG_NOTICE([Enabling pedantic errors for GNU C++])\n+         CXXFLAGS="$CXXFLAGS -Wall -Werror"],\n+        [AC_MSG_NOTICE([Not enabling pedantic errors: compiler not supported by this recipe (not GNU C++)])\n+         AS_IF([test "x$enable_Werror" = "xyes"], [AC_MSG_ERROR([--enable-Werror=yes was requested and can not be satisfied for C++: $CXX])])\n+        ])])\n+     AS_IF([test -n "$CPP"],[AS_IF([$CPP --version 2>&1 | grep \'Free Software Foundation\' > /dev/null],\n+        [AC_MSG_NOTICE([Enabling pedantic errors for GNU CPP preprocessor])\n+         CPPFLAGS="$CPPFLAGS -Wall -Werror"],\n+        [AC_MSG_NOTICE([Not enabling pedantic errors: preprocessor not supported by this recipe (not GNU CPP)])\n+         AS_IF([test "x$enable_Werror" = "xyes"], [AC_MSG_ERROR([--enable-Werror=yes was requested and can not be satisfied for CPP: $CPP])])\n+        ])])\n+])\n+\n # Specify output files\n AC_CONFIG_FILES([Makefile\n                  doc/Makefile\n@@ -466,6 +506,8 @@ echo Package version............... : $PACKAGE-$VERSION\n echo\n echo C compiler.................... : $CC\n echo C compiler flags.............. : $CFLAGS\n+echo C++ compiler.................. : $CXX\n+echo C++ compiler flags............ : $CXXFLAGS\n echo Configure date................ : $BUILD_DATE\n echo Build architecture............ : $BUILD_ARCH\n echo Build docs.................... : $czmq_build_doc\n@@ -487,7 +529,7 @@ echo\n echo \'##########################################################################\'\n \n echo\n-echo Configure complete! Now procced with:\n+echo Configure complete! Now proceed with:\n echo "    - \'make\'               compile the project"\n echo "    - \'make check\'         run the project\'s selftest"\n echo "    - \'make install\'       install the project to $prefix"\n', 'commit_subject': 'Problem: out of date with zproject', 'repo_name': 'zeromq/czmq', 'committer': {'name': 'Luca Boccassi', 'email': '678b97863301219a7659ccb717573825b33ce6a7@gmail.com', 'time_sec': '1482795872', 'tz_offset': '60', 'date': {'seconds': '1482795872'}}, 'commit_tree': '87bfe821b5e0cac3388fac227b8ba9804d41f92c', 'commit_message': 'Problem: out of date with zproject\n\nSolution: regenerate\n', 'language_name': 'Python', 'license': 'mpl-2.0', 'hunks': '@@ -368,6 +368,19 @@ AM_CONDITIONAL(ON_GNU, test "x$czmq_on_gnu" = "xyes")\n AM_CONDITIONAL(INSTALL_MAN, test "x$czmq_install_man" = "xyes")\n AM_CONDITIONAL(BUILD_DOC, test "x$czmq_build_doc" = "xyes")\n \n+AC_ARG_ENABLE([dist_cmakefiles],\n+    AS_HELP_STRING([--enable-dist_cmakefiles],\n+        [Distribute CMakeLists.txt and related files [default depends: on if present and not cross compiling]]),\n+    [enable_dist_cmakefiles=$enableval],\n+    [AC_MSG_CHECKING([for presence of CMake recipes])\n+if test "x$cross_compiling" = "xyes"; then\n+     enable_dist_cmakefiles=no\n+else\n+     AC_CHECK_FILE($srcdir/CMakeLists.txt, [enable_dist_cmakefiles=yes], [enable_dist_cmakefiles=no])\n+fi\n+     AC_MSG_RESULT([$enable_dist_cmakefiles])])\n+AM_CONDITIONAL(ENABLE_DIST_CMAKEFILES, test "x$enable_dist_cmakefiles" = "xyes")\n+\n # Check for zmakecert intent\n AC_ARG_ENABLE([zmakecert],\n     AS_HELP_STRING([--enable-zmakecert],\n@@ -426,6 +439,33 @@ else\n     AC_SUBST(pkg_config_defines, "")\n fi\n \n+AC_ARG_ENABLE([Werror],\n+    AS_HELP_STRING([--enable-Werror],\n+        [Add -Wall -Werror to GCC/GXX arguments [default=no; default=auto if nothing specified]]),\n+    [AS_IF([test -n "$enableval"], [enable_Werror=$enableval], [enable_Werror=auto])],\n+    [enable_Werror=no])\n+\n+AS_IF([test "x$enable_Werror" = "xyes" || test "x$enable_Werror" = "xauto"],\n+    [AS_IF([test -n "$CC"],[AS_IF([$CC --version 2>&1 | grep \'Free Software Foundation\' > /dev/null],\n+        [AC_MSG_NOTICE([Enabling pedantic errors for GNU C])\n+         CFLAGS="$CFLAGS -Wall -Werror"],\n+        [AC_MSG_NOTICE([Not enabling pedantic errors: compiler not supported by this recipe (not GNU C)])\n+         AS_IF([test "x$enable_Werror" = "xyes"], [AC_MSG_ERROR([--enable-Werror=yes was requested and can not be satisfied for C: $CC])])\n+        ])])\n+     AS_IF([test -n "$CXX"],[AS_IF([$CXX --version 2>&1 | grep \'Free Software Foundation\' > /dev/null],\n+        [AC_MSG_NOTICE([Enabling pedantic errors for GNU C++])\n+         CXXFLAGS="$CXXFLAGS -Wall -Werror"],\n+        [AC_MSG_NOTICE([Not enabling pedantic errors: compiler not supported by this recipe (not GNU C++)])\n+         AS_IF([test "x$enable_Werror" = "xyes"], [AC_MSG_ERROR([--enable-Werror=yes was requested and can not be satisfied for C++: $CXX])])\n+        ])])\n+     AS_IF([test -n "$CPP"],[AS_IF([$CPP --version 2>&1 | grep \'Free Software Foundation\' > /dev/null],\n+        [AC_MSG_NOTICE([Enabling pedantic errors for GNU CPP preprocessor])\n+         CPPFLAGS="$CPPFLAGS -Wall -Werror"],\n+        [AC_MSG_NOTICE([Not enabling pedantic errors: preprocessor not supported by this recipe (not GNU CPP)])\n+         AS_IF([test "x$enable_Werror" = "xyes"], [AC_MSG_ERROR([--enable-Werror=yes was requested and can not be satisfied for CPP: $CPP])])\n+        ])])\n+])\n+\n # Specify output files\n AC_CONFIG_FILES([Makefile\n                  doc/Makefile\n@@ -466,6 +506,8 @@ echo Package version............... : $PACKAGE-$VERSION\n echo\n echo C compiler.................... : $CC\n echo C compiler flags.............. : $CFLAGS\n+echo C++ compiler.................. : $CXX\n+echo C++ compiler flags............ : $CXXFLAGS\n echo Configure date................ : $BUILD_DATE\n echo Build architecture............ : $BUILD_ARCH\n echo Build docs.................... : $czmq_build_doc\n@@ -487,7 +529,7 @@ echo\n echo \'##########################################################################\'\n \n echo\n-echo Configure complete! Now procced with:\n+echo Configure complete! Now proceed with:\n echo "    - \'make\'               compile the project"\n echo "    - \'make check\'         run the project\'s selftest"\n echo "    - \'make install\'       install the project to $prefix"\n', 'addition_count': 43, 'deletion_count': 1, 'src_file': 'a/configure.ac', 'tgt_file': 'b/configure.ac', 'file_extension': '.ac', 'before_file': '################################################################################\n#  THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY  #\n#  Read the zproject/README.md for information about making permanent changes. #\n################################################################################\n# Note: if your project needs a customized configure script (compared to\n# the code below 100% generated by zproject), please check first if your\n# use-case can be handled by acinclude.m4 support in zproject_autotools.gsl\n# (to AC_DEFUN an AX_PROJECT_LOCAL_HOOK, AX_PROJECT_LOCAL_HOOK_CONFIGVARS\n# and/or AX_PROJECT_LOCAL_HOOK_FINAL) so you can avoid changing this file\n# which would complicate re-generation of your project in the future.\n\n#                                               -*- Autoconf -*-\n# Process this file with autoconf to produce a configure script.\nAC_PREREQ(2.61)\n#\nAC_INIT([czmq],[4.2.2],[zeromq-dev@lists.zeromq.org])\n\nAC_CONFIG_AUX_DIR(config)\nAC_CONFIG_MACRO_DIR(config)\nAC_CONFIG_HEADERS([src/platform.h])\nAM_INIT_AUTOMAKE([subdir-objects tar-ustar dist-zip foreign])\nm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])\n\n# This defines PACKAGE_VERSION_... in src/platform.h\nPV_MAJOR=`echo $PACKAGE_VERSION | cut -d . -f 1`\nPV_MINOR=`echo $PACKAGE_VERSION | cut -d . -f 2`\nPV_PATCH=`echo $PACKAGE_VERSION | cut -d . -f 3`\nAC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],[$PV_MAJOR],\n    [CZMQ major version])\nAC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],[$PV_MINOR],\n    [CZMQ minor version])\nAC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCH],[$PV_PATCH],\n    [CZMQ patchlevel])\n# This lets us use PACKAGE_VERSION in Makefiles\nAC_SUBST(PACKAGE_VERSION)\n\n#\n# Libtool -version-info (ABI version)\n#\n# Currently 6:2:2 ("stable"). Don\'t change this unless you\n# know exactly what you\'re doing and have read and understand\n# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html\n#\n# libczmq -version-info\nLTVER="6:2:2"\nAC_SUBST(LTVER)\n\n# building in a subdirectory?\nAM_CONDITIONAL([USING_VPATH], [test "x${srcdir}" != "x."])\n\n# Capture c flags\nCZMQ_ORIG_CFLAGS="${CFLAGS:-none}"\n\n# Checks for programs\nAC_PROG_CC\nAC_PROG_CC_C99\nAM_PROG_CC_C_O\nAC_LIBTOOL_WIN32_DLL\nAC_PROG_LIBTOOL\nAC_PROG_SED\nAC_PROG_AWK\nPKG_PROG_PKG_CONFIG\n\n# Check endianess of the system\nAC_C_BIGENDIAN\n\n# Optional project-local hook (acinclude.m4, add AC_DEFUN([AX_PROJECT_LOCAL_HOOK], [whatever]) )\nifdef([AX_PROJECT_LOCAL_HOOK],\n    [AX_PROJECT_LOCAL_HOOK])\n\n# See if cppcheck is in PATH; this variable unblocks the "cppcheck" recipe\n# (note that "make cppcheck.xml" can be used - and perhaps fail - regardless)\nAC_CHECK_PROG([WITH_CPPCHECK], [cppcheck], [true], [false])\nAM_CONDITIONAL(WITH_CPPCHECK, $WITH_CPPCHECK)\n\n# Code coverage\nAC_MSG_CHECKING([whether to enable GCov])\nAC_ARG_WITH(gcov, [AS_HELP_STRING([--with-gcov=yes/no],\n                  [With GCC Code Coverage reporting])],\n                  [CZMQ_GCOV="$withval"])\n\nif test "x${CZMQ_GCOV}" == "xyes"; then\n    CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"\n\n    if test "x${CZMQ_ORIG_CFLAGS}" != "xnone"; then\n        CFLAGS="${CFLAGS} ${CZMQ_ORIG_CFLAGS}"\n    fi\n    AM_CONDITIONAL(WITH_GCOV, true)\n    AC_MSG_RESULT([yes])\nelse\n    AM_CONDITIONAL(WITH_GCOV, false)\n    AC_MSG_RESULT([no])\nfi\n\n# Memory mis-use detection\nAC_MSG_CHECKING([whether to enable ASan])\nAC_ARG_ENABLE(address-sanitizer, [AS_HELP_STRING([--enable-address-sanitizer=yes/no],\n                  [Build with GCC Address Sanitizer instrumentation])],\n                  [CZMQ_ASAN="$enableval"])\n\nif test "x${CZMQ_ASAN}" == "xyes"; then\n    CFLAGS="${CFLAGS} -fsanitize=address"\n    CXXFLAGS="${CXXFLAGS} -fsanitize=address"\n\n    AM_CONDITIONAL(ENABLE_ASAN, true)\n    AC_MSG_RESULT([yes])\nelse\n    AM_CONDITIONAL(ENABLE_ASAN, false)\n    AC_MSG_RESULT([no])\nfi\n\n# Install Python Bindings\nAC_MSG_CHECKING([whether to install Python bindings])\n\nAC_ARG_ENABLE([bindings-python],\n    AS_HELP_STRING([--enable-bindings-python=yes/no],\n        [Install Python Bindings [default=no]]),\n    [ZPROJECT_BINDINGS_PYTHON=$enableval],\n    [ZPROJECT_BINDINGS_PYTHON=no])\n\nif test "x$ZPROJECT_BINDINGS_PYTHON" == "xyes"; then\n    AM_CONDITIONAL(ENABLE_BINDINGS_PYTHON, true)\n    AC_MSG_RESULT([yes])\nelse\n    AM_CONDITIONAL(ENABLE_BINDINGS_PYTHON, false)\n    AC_MSG_RESULT([no])\nfi\n\n# See if clang-format is in PATH; the result unblocks the relevant recipes\nWITH_CLANG_FORMAT=""\nAS_IF([test x"$CLANG_FORMAT" = x],\n    [AC_PATH_PROG([CLANG_FORMAT], [clang-format], [])],\n    [AC_CHECK_PROG([WITH_CLANG_FORMAT], [$CLANG_FORMAT], [true], [fail])])\nAS_IF([test x"$CLANG_FORMAT" != x && test x"$WITH_CLANG_FORMAT" = x],\n    [AS_IF([test -x "$CLANG_FORMAT"],\n        [WITH_CLANG_FORMAT=true],\n        [AC_CHECK_PROG([WITH_CLANG_FORMAT], [$CLANG_FORMAT], [true], [false])])])\nAS_IF([test "$WITH_CLANG_FORMAT" = fail],\n    [AC_MSG_ERROR([Caller explicitly referenced CLANG_FORMAT=$CLANG_FORMAT which was not found])])\nAM_CONDITIONAL([WITH_CLANG_FORMAT], [$WITH_CLANG_FORMAT])\n\n# Set pkgconfigdir\nAC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],\n    [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),\n    [pkgconfigdir="$withval"], [pkgconfigdir=\'${libdir}/pkgconfig\'])\nAC_SUBST([pkgconfigdir])\n\n# Use the provided pkgconfigdir not only to write our pkg-config data,\n# but also as an additional location to look for other packages metadata.\nAS_IF([test -n "${pkgconfigdir}" -a -d "${pkgconfigdir}"],\n    [AS_IF([test -z "${PKG_CONFIG_PATH}"],\n        [PKG_CONFIG_PATH="${pkgconfigdir}"],\n        [PKG_CONFIG_PATH="${pkgconfigdir}:${PKG_CONFIG_PATH}"])\n     export PKG_CONFIG_PATH\n    ])\n\n# Will be used to add flags to pkg-config useful when apps want to statically link\nPKGCFG_LIBS_PRIVATE=""\nPKGCFG_NAMES_PRIVATE=""\n\n# Archive user supplied flags\nPREVIOUS_CFLAGS="${CFLAGS}"\nPREVIOUS_LIBS="${LIBS}"\n\n\nwas_libzmq_check_lib_detected=no\n\nsearch_libzmq="yes"\n\nAC_ARG_WITH([libzmq],\n    [\n        AS_HELP_STRING([--with-libzmq],\n        [yes or no. Optionally specify libzmq prefix (directory where its include/ and lib/ are located), but that is only used if pkgconfig metadata is not found first])\n    ],\n    [\n        search_libzmq="yes"\n    ],\n    [\n        search_libzmq="yes"\n    ])\nAS_CASE([x"${with_libzmq}"],\n    [xyes], [search_libzmq="yes"],\n    [xno],  [search_libzmq="no"])\n\ndnl We do not abort right now, because the maintainer/developer may have\ndnl something particular in mind, e.g. to build just parts of a project.\nAS_IF([test x"${search_libzmq}" = xno],\n    [AC_MSG_WARN([Required dependency on libzmq was explicitly disabled during configuration by \'--with-libzmq=no\'; subsequent full build of czmq may fail])])\n\nAS_IF([test x"${search_libzmq}" = xyes], [\n    # Archive previously detected and supplied flags\n    PRE_SEARCH_CFLAGS="${CFLAGS}"\n    PRE_SEARCH_LIBS="${LIBS}"\n\n    found_pkgconfig=""\n    PKG_CHECK_MODULES([libzmq], [libzmq >= 0.0.0],\n    [\n        was_libzmq_check_lib_detected=pkgcfg\n        found_pkgconfig="libzmq"\n    ],\n    [\n        AC_MSG_NOTICE([Package libzmq not found; falling back to defined compilability tests])\n\n        libzmq_synthetic_cflags=""\n        libzmq_synthetic_libs="-lzmq"\n\n        if test -n "${with_libzmq}" && test x"${with_libzmq}" != xyes && test x"${with_libzmq}" != xno; then\n            if test -r "${with_libzmq}/include/zmq.h"; then\n                libzmq_synthetic_cflags="-I${with_libzmq}/include"\n                libzmq_synthetic_libs="-L${with_libzmq}/lib -lzmq"\n            else\n            AC_MSG_ERROR([Header file ${with_libzmq}/include/zmq.h was not found. Please check libzmq prefix])\n            fi\n        else\n            AC_CHECK_HEADER([zmq.h], [],\n            AC_MSG_ERROR([Header file zmq.h was not found in default search paths])\n                )\n        fi\n\n        AC_CHECK_LIB([zmq], [zmq_init],\n            [\n                was_libzmq_check_lib_detected=yes\n                PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE -lzmq"\n            ],\n            [AC_MSG_ERROR([cannot link with -lzmq, install libzmq])])\n    ])\n\ndnl END of PKG_CHECK_MODULES and/or direct tests for libzmq\n    AS_CASE(["x${was_libzmq_check_lib_detected}"],\n        [xpkgcfg], [\n                PKGCFG_NAMES_PRIVATE="$PKGCFG_NAMES_PRIVATE ${found_pkgconfig}"\n                CFLAGS="${libzmq_CFLAGS} ${CFLAGS}"\n                LIBS="${libzmq_LIBS} ${LIBS}"\n            ],\n        [xyes], [\n                CFLAGS="${libzmq_synthetic_cflags} ${CFLAGS}"\n                LDFLAGS="${libzmq_synthetic_libs} ${LDFLAGS}"\n                LIBS="${libzmq_synthetic_libs} ${LIBS}"\n\n                AC_SUBST([libzmq_CFLAGS],[${libzmq_synthetic_cflags}])\n                AC_SUBST([libzmq_LIBS],[${libzmq_synthetic_libs}])\n            ],\n        [xno], [\n            AC_MSG_ERROR([Cannot find pkg-config metadata for libzmq 0.0.0 or higher])\n    ])\n])\ndnl END of enabled attempts to search for libzmq\n\n\nwas_uuid_check_lib_detected=no\n\nsearch_uuid="no"\n\nAC_ARG_WITH([uuid],\n    [\n        AS_HELP_STRING([--with-uuid],\n        [yes or no. Optionally specify uuid prefix (directory where its include/ and lib/ are located), but that is only used if pkgconfig metadata is not found first])\n    ],\n    [\n        search_uuid="yes"\n    ],\n    [\n        search_uuid="yes"\n    ])\nAS_CASE([x"${with_uuid}"],\n    [xyes], [search_uuid="yes"],\n    [xno],  [search_uuid="no"])\n\n\nAS_IF([test x"${search_uuid}" = xyes], [\n    # Archive previously detected and supplied flags\n    PRE_SEARCH_CFLAGS="${CFLAGS}"\n    PRE_SEARCH_LIBS="${LIBS}"\n\n    found_pkgconfig=""\n    PKG_CHECK_MODULES([uuid], [uuid >= 0.0.0],\n    [\n        AC_DEFINE(HAVE_UUID, 1, [The optional uuid library is to be used])\n        was_uuid_check_lib_detected=pkgcfg\n        found_pkgconfig="uuid"\n    ],\n    [\n        AC_MSG_NOTICE([Package uuid not found; falling back to defined compilability tests])\n\n        uuid_synthetic_cflags=""\n        uuid_synthetic_libs="-luuid"\n\n        if test -n "${with_uuid}" && test x"${with_uuid}" != xyes && test x"${with_uuid}" != xno; then\n            if test -r "${with_uuid}/include/uuid/uuid.h"; then\n                uuid_synthetic_cflags="-I${with_uuid}/include"\n                uuid_synthetic_libs="-L${with_uuid}/lib -luuid"\n            else\n            AC_MSG_WARN([Header file ${with_uuid}/include/uuid/uuid.h was not found. Please check uuid prefix])\n            fi\n        else\n            AC_CHECK_HEADER([uuid/uuid.h], [],\n            AC_MSG_WARN([Header file uuid/uuid.h was not found in default search paths])\n                )\n        fi\n\n        AC_CHECK_LIB([uuid], [uuid_generate],\n            [\n                was_uuid_check_lib_detected=yes\n                PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE -luuid"\n                AC_DEFINE(HAVE_UUID, 1, [The optional uuid library is to be used (as -luuid)])\n            ],\n            [])\n    ])\n\ndnl END of PKG_CHECK_MODULES and/or direct tests for uuid\n    AS_CASE(["x${was_uuid_check_lib_detected}"],\n        [xpkgcfg], [\n                PKGCFG_NAMES_PRIVATE="$PKGCFG_NAMES_PRIVATE ${found_pkgconfig}"\n                CFLAGS="${uuid_CFLAGS} ${CFLAGS}"\n                LIBS="${uuid_LIBS} ${LIBS}"\n            ],\n        [xyes], [\n                CFLAGS="${uuid_synthetic_cflags} ${CFLAGS}"\n                LDFLAGS="${uuid_synthetic_libs} ${LDFLAGS}"\n                LIBS="${uuid_synthetic_libs} ${LIBS}"\n\n                AC_SUBST([uuid_CFLAGS],[${uuid_synthetic_cflags}])\n                AC_SUBST([uuid_LIBS],[${uuid_synthetic_libs}])\n            ],\n        [xno], [\n            AC_MSG_WARN([Cannot find pkg-config metadata for uuid 0.0.0 or higher])\n    ])\n])\ndnl END of enabled attempts to search for uuid\n\n\nwas_systemd_check_lib_detected=no\n\nsearch_libsystemd="no"\n\nAC_ARG_WITH([libsystemd],\n    [\n        AS_HELP_STRING([--with-libsystemd],\n        [yes or no. Optionally specify libsystemd prefix (directory where its include/ and lib/ are located), but that is only used if pkgconfig metadata is not found first])\n    ],\n    [\n        search_libsystemd="yes"\n    ],\n    [\n        search_libsystemd="yes"\n    ])\nAS_CASE([x"${with_libsystemd}"],\n    [xyes], [search_libsystemd="yes"],\n    [xno],  [search_libsystemd="no"])\n\n\nAS_IF([test x"${search_libsystemd}" = xyes], [\n    # Archive previously detected and supplied flags\n    PRE_SEARCH_CFLAGS="${CFLAGS}"\n    PRE_SEARCH_LIBS="${LIBS}"\n\n    found_pkgconfig=""\n    PKG_CHECK_MODULES([systemd], [libsystemd >= 200.0.0],\n    [\n        AC_DEFINE(HAVE_LIBSYSTEMD, 1, [The optional libsystemd library is to be used])\n        was_systemd_check_lib_detected=pkgcfg\n        found_pkgconfig="libsystemd"\n    ],\n    [\n        AC_MSG_NOTICE([Package libsystemd not found with needed constraints; falling back to defined compilability tests])\n\n        systemd_synthetic_cflags=""\nAM_CONDITIONAL(INSTALL_MAN, test "x$czmq_install_man" = "xyes")\nAM_CONDITIONAL(BUILD_DOC, test "x$czmq_build_doc" = "xyes")\n\n# Check for zmakecert intent\nAC_ARG_ENABLE([zmakecert],\n    AS_HELP_STRING([--enable-zmakecert],\n                AC_DEFINE(HAVE_LIBSYSTEMD, 1, [The optional libsystemd library is to be used (as -lsystemd)])\n            ],\n            [])\n    ])\n\ndnl END of PKG_CHECK_MODULES and/or direct tests for libsystemd\n    AS_CASE(["x${was_systemd_check_lib_detected}"],\n        [xpkgcfg], [\n                PKGCFG_NAMES_PRIVATE="$PKGCFG_NAMES_PRIVATE ${found_pkgconfig} >= 200.0.0"\n                CFLAGS="${systemd_CFLAGS} ${CFLAGS}"\n                LIBS="${systemd_LIBS} ${LIBS}"\n            ],\n        [xyes], [\n                CFLAGS="${systemd_synthetic_cflags} ${CFLAGS}"\n                LDFLAGS="${systemd_synthetic_libs} ${LDFLAGS}"\n                LIBS="${systemd_synthetic_libs} ${LIBS}"\n\n                AC_SUBST([systemd_CFLAGS],[${systemd_synthetic_cflags}])\n                AC_SUBST([systemd_LIBS],[${systemd_synthetic_libs}])\n            ],\n        [xno], [\n            AC_MSG_WARN([Cannot find pkg-config metadata for libsystemd 200.0.0 or higher])\n    ])\n])\ndnl END of enabled attempts to search for libsystemd\n\n\nwas_lz4_check_lib_detected=no\n\nsearch_liblz4="no"\n\nAC_ARG_WITH([liblz4],\n    [\n        AS_HELP_STRING([--with-liblz4],\n        [yes or no. Optionally specify liblz4 prefix (directory where its include/ and lib/ are located), but that is only used if pkgconfig metadata is not found first])\n    ],\n    [\n        search_liblz4="yes"\n    ],\n    [\n        search_liblz4="yes"\n    ])\nAS_CASE([x"${with_liblz4}"],\n    [xyes], [search_liblz4="yes"],\n    [xno],  [search_liblz4="no"])\n\n\nAS_IF([test x"${search_liblz4}" = xyes], [\n    # Archive previously detected and supplied flags\n    PRE_SEARCH_CFLAGS="${CFLAGS}"\n    PRE_SEARCH_LIBS="${LIBS}"\n\n    AC_SUBST(pkg_config_defines, "")\nfi\n\n# Specify output files\nAC_CONFIG_FILES([Makefile\n                 doc/Makefile\n    ])\n\ndnl END of PKG_CHECK_MODULES and/or direct tests for liblz4\n    AS_CASE(["x${was_lz4_check_lib_detected}"],\n        [xpkgcfg], [\n                PKGCFG_NAMES_PRIVATE="$PKGCFG_NAMES_PRIVATE ${found_pkgconfig}"\n                CFLAGS="${lz4_CFLAGS} ${CFLAGS}"\n                LIBS="${lz4_LIBS} ${LIBS}"\n            ],\n        [xyes], [\n                CFLAGS="${lz4_synthetic_cflags} ${CFLAGS}"\n                LDFLAGS="${lz4_synthetic_libs} ${LDFLAGS}"\n                LIBS="${lz4_synthetic_libs} ${LIBS}"\n\n                AC_SUBST([lz4_CFLAGS],[${lz4_synthetic_cflags}])\n                AC_SUBST([lz4_LIBS],[${lz4_synthetic_libs}])\n            ],\n        [xno], [\n            AC_MSG_WARN([Cannot find pkg-config metadata for liblz4 0.0.0 or higher])\n    ])\n])\ndnl END of enabled attempts to search for liblz4\n\n\nwas_libcurl_check_lib_detected=no\n\nsearch_libcurl="no"\n\nAC_ARG_WITH([libcurl],\n    [\n        AS_HELP_STRING([--with-libcurl],\n        [yes or no. Optionally specify libcurl prefix (directory where its include/ and lib/ are located), but that is only used if pkgconfig metadata is not found first])\n    ],\n    [\necho\necho C compiler.................... : $CC\necho C compiler flags.............. : $CFLAGS\necho Configure date................ : $BUILD_DATE\necho Build architecture............ : $BUILD_ARCH\necho Build docs.................... : $czmq_build_doc\n\n\nAS_IF([test x"${search_libcurl}" = xyes], [\n    # Archive previously detected and supplied flags\n    PRE_SEARCH_CFLAGS="${CFLAGS}"\n    PRE_SEARCH_LIBS="${LIBS}"\n\n    found_pkgconfig=""\n    PKG_CHECK_MODULES([libcurl], [libcurl >= 7.28.0],\n    [\n        AC_DEFINE(HAVE_LIBCURL, 1, [The optional libcurl library is to be used])\n        was_libcurl_check_lib_detected=pkgcfg\n        found_pkgconfig="libcurl"\n    ],\n    [\necho \'##########################################################################\'\n\necho\necho Configure complete! Now procced with:\necho "    - \'make\'               compile the project"\necho "    - \'make check\'         run the project\'s selftest"\necho "    - \'make install\'       install the project to $prefix"\n                libcurl_synthetic_cflags="-I${with_libcurl}/include"\n                libcurl_synthetic_libs="-L${with_libcurl}/lib -lcurl"\n            else\n            AC_MSG_WARN([Header file ${with_libcurl}/include/curl/curl.h was not found. Please check libcurl prefix])\n            fi\n        else\n            AC_CHECK_HEADER([curl/curl.h], [],\n            AC_MSG_WARN([Header file curl/curl.h was not found in default search paths])\n                )\n        fi\n\n        AC_CHECK_LIB([curl], [curl_easy_init],\n            [\n                was_libcurl_check_lib_detected=yes\n                PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE -lcurl"\n                AC_DEFINE(HAVE_LIBCURL, 1, [The optional libcurl library is to be used (as -lcurl)])\n            ],\n            [])\n    ])\n\ndnl END of PKG_CHECK_MODULES and/or direct tests for libcurl\n    AS_CASE(["x${was_libcurl_check_lib_detected}"],\n        [xpkgcfg], [\n                PKGCFG_NAMES_PRIVATE="$PKGCFG_NAMES_PRIVATE ${found_pkgconfig} >= 7.28.0"\n                CFLAGS="${libcurl_CFLAGS} ${CFLAGS}"\n                LIBS="${libcurl_LIBS} ${LIBS}"\n            ],\n        [xyes], [\n                CFLAGS="${libcurl_synthetic_cflags} ${CFLAGS}"\n                LDFLAGS="${libcurl_synthetic_libs} ${LDFLAGS}"\n                LIBS="${libcurl_synthetic_libs} ${LIBS}"\n\n                AC_SUBST([libcurl_CFLAGS],[${libcurl_synthetic_cflags}])\n                AC_SUBST([libcurl_LIBS],[${libcurl_synthetic_libs}])\n            ],\n        [xno], [\n            AC_MSG_WARN([Cannot find pkg-config metadata for libcurl 7.28.0 or higher])\n    ])\n])\ndnl END of enabled attempts to search for libcurl\n\n\nwas_nss_check_lib_detected=no\n\nsearch_nss="no"\n\nAC_ARG_WITH([nss],\n    [\n        AS_HELP_STRING([--with-nss],\n        [yes or no. Optionally specify nss prefix (directory where its include/ and lib/ are located), but that is only used if pkgconfig metadata is not found first])\n    ],\n    [\n        search_nss="yes"\n    ],\n    [\n        search_nss="yes"\n    ])\nAS_CASE([x"${with_nss}"],\n    [xyes], [search_nss="yes"],\n    [xno],  [search_nss="no"])\n\n\nAS_IF([test x"${search_nss}" = xyes], [\n    # Archive previously detected and supplied flags\n    PRE_SEARCH_CFLAGS="${CFLAGS}"\n    PRE_SEARCH_LIBS="${LIBS}"\n\n    found_pkgconfig=""\n    PKG_CHECK_MODULES([nss], [nss >= 0.0.0],\n    [\n        AC_DEFINE(HAVE_NSS, 1, [The optional nss library is to be used])\n        was_nss_check_lib_detected=pkgcfg\n        found_pkgconfig="nss"\n    ],\n    [\n        AC_MSG_NOTICE([Package nss not found; falling back to defined compilability tests])\n\n        nss_synthetic_cflags=""\n        nss_synthetic_libs="-lnss"\n\n        if test -n "${with_nss}" && test x"${with_nss}" != xyes && test x"${with_nss}" != xno; then\n            if test -r "${with_nss}/include/sechash.h"; then\n                nss_synthetic_cflags="-I${with_nss}/include"\n                nss_synthetic_libs="-L${with_nss}/lib -lnss"\n            else\n            AC_MSG_WARN([Header file ${with_nss}/include/sechash.h was not found. Please check nss prefix])\n            fi\n        else\n            AC_CHECK_HEADER([sechash.h], [],\n            AC_MSG_WARN([Header file sechash.h was not found in default search paths])\n                )\n        fi\n\n        AC_CHECK_LIB([nss], [HASH_Create],\n            [\n                was_nss_check_lib_detected=yes\n                PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE -lnss"\n                AC_DEFINE(HAVE_NSS, 1, [The optional nss library is to be used (as -lnss)])\n            ],\n            [])\n    ])\n\ndnl END of PKG_CHECK_MODULES and/or direct tests for nss\n    AS_CASE(["x${was_nss_check_lib_detected}"],\n        [xpkgcfg], [\n                PKGCFG_NAMES_PRIVATE="$PKGCFG_NAMES_PRIVATE ${found_pkgconfig}"\n                CFLAGS="${nss_CFLAGS} ${CFLAGS}"\n                LIBS="${nss_LIBS} ${LIBS}"\n            ],\n        [xyes], [\n                CFLAGS="${nss_synthetic_cflags} ${CFLAGS}"\n                LDFLAGS="${nss_synthetic_libs} ${LDFLAGS}"\n                LIBS="${nss_synthetic_libs} ${LIBS}"\n\n                AC_SUBST([nss_CFLAGS],[${nss_synthetic_cflags}])\n                AC_SUBST([nss_LIBS],[${nss_synthetic_libs}])\n            ],\n        [xno], [\n            AC_MSG_WARN([Cannot find pkg-config metadata for nss 0.0.0 or higher])\n    ])\n])\ndnl END of enabled attempts to search for nss\n\n\nwas_libmicrohttpd_check_lib_detected=no\n\nsearch_libmicrohttpd="no"\n\nAC_ARG_WITH([libmicrohttpd],\n    [\n        AS_HELP_STRING([--with-libmicrohttpd],\n        [yes or no. Optionally specify libmicrohttpd prefix (directory where its include/ and lib/ are located), but that is only used if pkgconfig metadata is not found first])\n    ],\n    [\n        search_libmicrohttpd="yes"\n    ],\n    [\n        search_libmicrohttpd="yes"\n    ])\nAS_CASE([x"${with_libmicrohttpd}"],\n    [xyes], [search_libmicrohttpd="yes"],\n    [xno],  [search_libmicrohttpd="no"])\n\n\nAS_IF([test x"${search_libmicrohttpd}" = xyes], [\n    # Archive previously detected and supplied flags\n    PRE_SEARCH_CFLAGS="${CFLAGS}"\n    PRE_SEARCH_LIBS="${LIBS}"\n\n    found_pkgconfig=""\n    PKG_CHECK_MODULES([libmicrohttpd], [libmicrohttpd >= 0.0.0],\n    [\n        AC_DEFINE(HAVE_LIBMICROHTTPD, 1, [The optional libmicrohttpd library is to be used])\n        was_libmicrohttpd_check_lib_detected=pkgcfg\n        found_pkgconfig="libmicrohttpd"\n    ],\n    [\n        AC_MSG_NOTICE([Package libmicrohttpd not found; falling back to defined compilability tests])\n\n        libmicrohttpd_synthetic_cflags=""\n        libmicrohttpd_synthetic_libs="-lmicrohttpd"\n\n        if test -n "${with_libmicrohttpd}" && test x"${with_libmicrohttpd}" != xyes && test x"${with_libmicrohttpd}" != xno; then\n            if test -r "${with_libmicrohttpd}/include/microhttpd.h"; then\n                libmicrohttpd_synthetic_cflags="-I${with_libmicrohttpd}/include"\n                libmicrohttpd_synthetic_libs="-L${with_libmicrohttpd}/lib -lmicrohttpd"\n            else\n            AC_MSG_WARN([Header file ${with_libmicrohttpd}/include/microhttpd.h was not found. Please check libmicrohttpd prefix])\n            fi\n        else\n            AC_CHECK_HEADER([microhttpd.h], [],\n            AC_MSG_WARN([Header file microhttpd.h was not found in default search paths])\n                )\n        fi\n\n        AC_CHECK_LIB([microhttpd], [MHD_start_daemon],\n            [\n                was_libmicrohttpd_check_lib_detected=yes\n                PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE -lmicrohttpd"\n                AC_DEFINE(HAVE_LIBMICROHTTPD, 1, [The optional libmicrohttpd library is to be used (as -lmicrohttpd)])\n            ],\n            [])\n    ])\n\ndnl END of PKG_CHECK_MODULES and/or direct tests for libmicrohttpd\n    AS_CASE(["x${was_libmicrohttpd_check_lib_detected}"],\n        [xpkgcfg], [\n                PKGCFG_NAMES_PRIVATE="$PKGCFG_NAMES_PRIVATE ${found_pkgconfig}"\n                CFLAGS="${libmicrohttpd_CFLAGS} ${CFLAGS}"\n                LIBS="${libmicrohttpd_LIBS} ${LIBS}"\n            ],\n        [xyes], [\n                CFLAGS="${libmicrohttpd_synthetic_cflags} ${CFLAGS}"\n                LDFLAGS="${libmicrohttpd_synthetic_libs} ${LDFLAGS}"\n                LIBS="${libmicrohttpd_synthetic_libs} ${LIBS}"\n\n                AC_SUBST([libmicrohttpd_CFLAGS],[${libmicrohttpd_synthetic_cflags}])\n                AC_SUBST([libmicrohttpd_LIBS],[${libmicrohttpd_synthetic_libs}])\n            ],\n        [xno], [\n            AC_MSG_WARN([Cannot find pkg-config metadata for libmicrohttpd 0.0.0 or higher])\n    ])\n])\ndnl END of enabled attempts to search for libmicrohttpd\n\n\nCFLAGS="${PREVIOUS_CFLAGS}"\nLIBS="${PREVIOUS_LIBS}"\n\nAC_SUBST(pkg_config_libs_private, $PKGCFG_LIBS_PRIVATE)\nAC_SUBST(pkg_config_names_private, $PKGCFG_NAMES_PRIVATE)\n\n# Platform specific checks\nczmq_on_mingw32="no"\nczmq_on_cygwin="no"\nczmq_on_android="no"\nczmq_on_linux="no"\nczmq_on_gnu="no"\n\n# Host specific checks\nAC_CANONICAL_HOST\n\n# Man pages are built/installed if asciidoc and xmlto are present\n#   --with-docs=no overrides this\nAC_ARG_WITH([docs],\n    AS_HELP_STRING([--with-docs],\n        [Build and install man pages [default=yes]]),\n    [with_docs=$withval])\n\nif test "x$with_docs" = "xno"; then\n    czmq_build_doc="no"\n    czmq_install_man="no"\nelse\n    # Determine whether or not documentation should be built and installed.\n    czmq_build_doc="yes"\n    czmq_install_man="yes"\n\n    # Check for asciidoc and xmlto and don\'t build the docs if these are not installed.\n    AC_CHECK_PROG(czmq_have_asciidoc, asciidoc, yes, no)\n    AC_CHECK_PROG(czmq_have_xmlto, xmlto, yes, no)\n    if test "x$czmq_have_asciidoc" = "xno" -o "x$czmq_have_xmlto" = "xno"; then\n        if test "x$with_docs" = "xyes" ; then\n            AC_MSG_ERROR([Build with docs was explicitly requested, but tools are not available])\n        fi\n        czmq_build_doc="no"\n        # Tarballs built with \'make dist\' ship with prebuilt documentation.\n        if ! test -f doc/czmq.7; then\n            czmq_install_man="no"\n            AC_MSG_WARN([You are building an unreleased version of CZMQ and asciidoc or xmlto are not installed.])\n            AC_MSG_WARN([Documentation will not be built and manual pages will not be installed.])\n        fi\n    fi\nfi\nAC_MSG_CHECKING([whether to build documentation])\nAC_MSG_RESULT([$czmq_build_doc])\nAC_MSG_CHECKING([whether to install manpages])\nAC_MSG_RESULT([$czmq_install_man])\n\n# Set some default features required by libczmq code.\nCPPFLAGS="-DCZMQ_INTERNAL_BUILD -D_REENTRANT -D_THREAD_SAFE $CPPFLAGS"\n\n# OS-specific tests\ncase "${host_os}" in\n    *linux*)\n        # Define on Linux to enable all library features\n        CPPFLAGS="-D_GNU_SOURCE -DLINUX $CPPFLAGS"\n        AC_DEFINE(CZMQ_HAVE_LINUX, 1, [Have Linux OS])\n        czmq_on_linux="yes"\n\n        case "${host_os}" in\n            *android*)\n                AC_DEFINE(CZMQ_HAVE_ANDROID, 1, [Have Android OS])\n                czmq_on_android="yes"\n            ;;\n        esac\n        ;;\n    *solaris*)\n        # Define on Solaris to enable all library features\n        CPPFLAGS="-D_PTHREADS $CPPFLAGS"\n        # Allow definitions of common OS-provided functions that are not in old standards\n        CPPFLAGS="-D__EXTENSIONS__ $CPPFLAGS"\n        AC_DEFINE(CZMQ_HAVE_SOLARIS, 1, [Have Solaris OS])\n        CFLAGS="${CFLAGS} -lsocket -lssp"\n        ;;\n    *freebsd*)\n        # Define on FreeBSD to enable all library features\n        CPPFLAGS="-D__BSD_VISIBLE $CPPFLAGS"\n        AC_DEFINE(CZMQ_HAVE_FREEBSD, 1, [Have FreeBSD OS])\n        ;;\n    *darwin*)\n        # Define on Darwin to enable all library features\n        CPPFLAGS="-D_DARWIN_C_SOURCE $CPPFLAGS"\n        AC_DEFINE(CZMQ_HAVE_OSX, 1, [Have DarwinOSX OS])\n        ;;\n    *netbsd*)\n        # Define on NetBSD to enable all library features\n        CPPFLAGS="-D_NETBSD_SOURCE $CPPFLAGS"\n        AC_DEFINE(CZMQ_HAVE_NETBSD, 1, [Have NetBSD OS])\n        ;;\n    *openbsd*)\n        # Define on OpenBSD to enable all library features\n        CPPFLAGS="-D_BSD_SOURCE $CPPFLAGS"\n        AC_DEFINE(CZMQ_HAVE_OPENBSD, 1, [Have OpenBSD OS])\n        ;;\n    *nto-qnx*)\n        AC_DEFINE(CZMQ_HAVE_QNXNTO, 1, [Have QNX Neutrino OS])\n        ;;\n    *aix*)\n        AC_DEFINE(CZMQ_HAVE_AIX, 1, [Have AIX OS])\n        ;;\n    *hpux*)\n        # Define on HP-UX to enable all library features\n        CPPFLAGS="-D_POSIX_C_SOURCE=200112L"\n        AC_DEFINE(CZMQ_HAVE_HPUX, 1, [Have HPUX OS])\n        ;;\n    *mingw32*)\n        # Disable format error due to incomplete ANSI C\n        CFLAGS="-Wno-error=format -Wno-unused-function -Wno-unused-variable -D_XOPEN_SOURCE $CFLAGS"\n        CPPFLAGS="-Wno-error=format -Wno-unused-function -Wno-unused-variable -D_XOPEN_SOURCE $CPPFLAGS"\n        AC_DEFINE(CZMQ_HAVE_WINDOWS, 1, [Have Windows OS])\n        AC_DEFINE(CZMQ_HAVE_MINGW32, 1, [Have MinGW32])\n        AC_CHECK_HEADERS(windows.h)\n        czmq_on_mingw32="yes"\n        czmq_install_man="no"\n        ;;\n    *mingw64*)\n        # Define on MINGW64 to enable all libeary features\n        # Disable format error due to incomplete ANSI C\n        CFLAGS="-Wno-error=format -Wno-unused-function -Wno-unused-variable -D_XOPEN_SOURCE $CFLAGS"\n        CPPFLAGS="-Wno-error=format -Wno-unused-function -Wno-unused-variable -D_XOPEN_SOURCE $CPPFLAGS"\n        AC_DEFINE(CZMQ_HAVE_WINDOWS, 1, [Have Windows OS])\n        AC_DEFINE(CZMQ_HAVE_MINGW32, 1, [Have MinGW32])\n        AC_CHECK_HEADERS(windows.h)\n        czmq_on_mingw32="yes"\n        czmq_install_man="no"\n        ;;\n    *cygwin*)\n        # Define on Cygwin to enable all library features\n        CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"\n        AC_DEFINE(CZMQ_HAVE_CYGWIN, 1, [Have Cygwin])\n        czmq_on_cygwin="yes"\n        ;;\n    gnu*)\n        # Define on GNU/Hurd to enable all library features\n        if test "x$GXX" = "xyes"; then\n            CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS"\n        fi\n        AC_DEFINE(CZMQ_HAVE_GNU, 1, [Have GNU/Hurd OS])\n        czmq_on_gnu="yes"\n        ;;\n    *)\n        AC_MSG_ERROR([unsupported system: ${host_os}])\n        ;;\nesac\n\n# Checks for header files.\nAC_HEADER_STDC\nAC_CHECK_HEADERS(errno.h arpa/inet.h netinet/tcp.h netinet/in.h stddef.h \\\n                 stdlib.h string.h sys/socket.h sys/time.h unistd.h \\\n                 limits.h ifaddrs.h)\nAC_CHECK_HEADERS([net/if.h net/if_media.h linux/wireless.h], [], [],\n[\n#ifdef HAVE_SYS_SOCKET_H\n# include <sys/socket.h>\n#endif\n#include <stdint.h>\n])\n\n# Checks for typedefs, structures, and compiler characteristics.\nAC_HEADER_STDBOOL\nAC_C_CONST\nAC_C_INLINE\nAC_TYPE_SIZE_T\nAC_TYPE_SSIZE_T\nAC_HEADER_TIME\nAC_TYPE_UINT32_T\nAC_C_VOLATILE\nAC_C_BIGENDIAN\n\n# Check for symbols (function, variable, or macro)\nAC_CHECK_DECLS([AI_V4MAPPED], [], [], [[#include <czmq.h>]])\n\nAM_CONDITIONAL(ENABLE_SHARED, test "x$enable_shared" = "xyes")\nAM_CONDITIONAL(ON_MINGW, test "x$czmq_on_mingw32" = "xyes")\nAM_CONDITIONAL(ON_CYGWIN, test "x$czmq_on_cygwin" = "xyes")\nAM_CONDITIONAL(ON_ANDROID, test "x$czmq_on_android" = "xyes")\nAM_CONDITIONAL(ON_LINUX, test "x$czmq_on_linux" = "xyes")\nAM_CONDITIONAL(ON_GNU, test "x$czmq_on_gnu" = "xyes")\nAM_CONDITIONAL(INSTALL_MAN, test "x$czmq_install_man" = "xyes")\nAM_CONDITIONAL(BUILD_DOC, test "x$czmq_build_doc" = "xyes")\n\nAC_ARG_ENABLE([dist_cmakefiles],\n    AS_HELP_STRING([--enable-dist_cmakefiles],\n        [Distribute CMakeLists.txt and related files [default depends: on if present and not cross compiling]]),\n    [enable_dist_cmakefiles=$enableval],\n    [AC_MSG_CHECKING([for presence of CMake recipes])\nif test "x$cross_compiling" = "xyes"; then\n     enable_dist_cmakefiles=no\nelse\n     AC_CHECK_FILE($srcdir/CMakeLists.txt, [enable_dist_cmakefiles=yes], [enable_dist_cmakefiles=no])\nfi\n     AC_MSG_RESULT([$enable_dist_cmakefiles])])\nAM_CONDITIONAL(ENABLE_DIST_CMAKEFILES, test "x$enable_dist_cmakefiles" = "xyes")\n\n# Check for zmakecert intent\nAC_ARG_ENABLE([zmakecert],\n    AS_HELP_STRING([--enable-zmakecert],\n        [Compile and install \'zmakecert\' [default=yes]]),\n    [enable_zmakecert=$enableval],\n    [enable_zmakecert=yes])\n\nAM_CONDITIONAL([ENABLE_ZMAKECERT], [test x$enable_zmakecert != xno])\nAM_COND_IF([ENABLE_ZMAKECERT], [AC_MSG_NOTICE([ENABLE_ZMAKECERT defined])])\n\n# Check for zsp intent\nAC_ARG_ENABLE([zsp],\n    AS_HELP_STRING([--enable-zsp],\n        [Compile \'zsp\' in src [default=yes]]),\n    [enable_zsp=$enableval],\n    [enable_zsp=yes])\n\nAM_CONDITIONAL([ENABLE_ZSP], [test x$enable_zsp != xno])\nAM_COND_IF([ENABLE_ZSP], [AC_MSG_NOTICE([ENABLE_ZSP defined])])\n\n# Check for test_randof intent\nAC_ARG_ENABLE([test_randof],\n    AS_HELP_STRING([--enable-test_randof],\n        [Compile \'test_randof\' in src [default=yes]]),\n    [enable_test_randof=$enableval],\n    [enable_test_randof=yes])\n\nAM_CONDITIONAL([ENABLE_TEST_RANDOF], [test x$enable_test_randof != xno])\nAM_COND_IF([ENABLE_TEST_RANDOF], [AC_MSG_NOTICE([ENABLE_TEST_RANDOF defined])])\n\n# Check for czmq_selftest intent\nAC_ARG_ENABLE([czmq_selftest],\n    AS_HELP_STRING([--enable-czmq_selftest],\n        [Compile \'czmq_selftest\' in src [default=yes]]),\n    [enable_czmq_selftest=$enableval],\n    [enable_czmq_selftest=yes])\n\nAM_CONDITIONAL([ENABLE_CZMQ_SELFTEST], [test x$enable_czmq_selftest != xno])\nAM_COND_IF([ENABLE_CZMQ_SELFTEST], [AC_MSG_NOTICE([ENABLE_CZMQ_SELFTEST defined])])\n\n# Checks for library functions.\nAC_TYPE_SIGNAL\nAC_CHECK_FUNCS(perror gettimeofday memset getifaddrs)\n\n\n# enable specific system integration features\nif test "x$cross_compiling" = "xyes"; then\n    #   Enable draft by default when cross-compiling\n    defaultval=yes\nelse\n    # enable draft API by default if we\'re in a git repository\n    # else disable it by default; then allow --enable-drafts=yes/no override\n    AC_CHECK_FILE($srcdir/.git, [defaultval=yes],\n        [AC_MSG_CHECKING([running under a git repository workspace])\n         AS_IF([git rev-parse --show-toplevel 2>/dev/null],\n            [defaultval=yes],\n            [defaultval=no])\n         AC_MSG_RESULT($defaultval)\n        ])\nfi\n\nAC_ARG_ENABLE([drafts],\n    AS_HELP_STRING([--enable-drafts],\n        [Build and install draft classes and methods [default=yes]]),\n    [enable_drafts=$enableval],\n    [enable_drafts=$defaultval])\n\nAM_CONDITIONAL([ENABLE_DRAFTS], [test x$enable_drafts != xno])\n\nif test "x$enable_drafts" = "xyes"; then\n    AC_MSG_NOTICE([Building stable and legacy API + draft API])\n    AC_DEFINE(CZMQ_BUILD_DRAFT_API, 1, [Provide draft classes and methods])\n    AC_SUBST(pkg_config_defines, "-DCZMQ_BUILD_DRAFT_API=1")\nelse\n    AC_MSG_NOTICE([Building stable and legacy API (no draft API)])\n    AC_SUBST(pkg_config_defines, "")\nfi\n\nAC_ARG_ENABLE([Werror],\n    AS_HELP_STRING([--enable-Werror],\n        [Add -Wall -Werror to GCC/GXX arguments [default=no; default=auto if nothing specified as the specific argument value]]),\n    [AS_IF([test -n "$enableval"], [enable_Werror=$enableval], [enable_Werror=auto])],\n    [enable_Werror=no])\n\n# These options are GNU compiler specific.\nAS_IF([test "x$enable_Werror" = "xyes" || test "x$enable_Werror" = "xauto"],\n    [AS_IF([test -n "$CC"],[AS_IF([$CC --version 2>&1 | grep \'Free Software Foundation\' > /dev/null && test "x$GCC" = "xyes"],\n        [AC_MSG_NOTICE([Enabling pedantic errors for GNU C])\n         CFLAGS="$CFLAGS -pedantic -Wall -Werror -Werror=format-security"],\n        [AS_IF([$CC --version 2>&1 | grep \'clang version\' > /dev/null],\n            [AC_MSG_NOTICE([Enabling pedantic errors for clang C])\n             CFLAGS="$CFLAGS -pedantic -Wall -Werror -Werror=format-security"],\n            [AC_MSG_NOTICE([Not enabling pedantic errors: compiler not supported by this recipe (not GNU or clang C)])\n             AS_IF([test "x$enable_Werror" = "xyes"], [AC_MSG_ERROR([--enable-Werror=yes was requested and can not be satisfied for C: $CC])])\n        ])])])\n     AS_IF([test -n "$CXX"],[AS_IF([$CXX --version 2>&1 | grep \'Free Software Foundation\' > /dev/null && test "x$GCC" = "xyes"],\n        [AC_MSG_NOTICE([Enabling pedantic errors for GNU C++])\n         CXXFLAGS="$CXXFLAGS -pedantic -Wall -Werror -Werror=format-security"],\n        [AS_IF([$CXX --version 2>&1 | grep \'clang version\' > /dev/null],\n            [AC_MSG_NOTICE([Enabling pedantic errors for clang C++])\n             CXXFLAGS="$CXXFLAGS -pedantic -Wall -Werror -Werror=format-security"],\n            [AC_MSG_NOTICE([Not enabling pedantic errors: compiler not supported by this recipe (not GNU or clang C++)])\n             AS_IF([test "x$enable_Werror" = "xyes"], [AC_MSG_ERROR([--enable-Werror=yes was requested and can not be satisfied for C++: $CXX])])\n        ])])])\n     AS_IF([test -n "$CPP"],[AS_IF([$CPP --version 2>&1 | grep \'Free Software Foundation\' > /dev/null && test "x$GCC" = "xyes"],\n        [AC_MSG_NOTICE([Enabling pedantic errors for GNU CPP preprocessor])\n         CPPFLAGS="$CPPFLAGS -pedantic -Werror -Wall -Wc++-compat"\n        ],\n        [AS_IF([$CXX --version 2>&1 | grep \'clang version\' > /dev/null],\n            [AC_MSG_NOTICE([Enabling pedantic errors for clang CPP preprocessor])\n             CPPFLAGS="$CPPFLAGS -pedantic -Werror -Wall -Wc++-compat"\n            ],\n            [AC_MSG_NOTICE([Not enabling pedantic errors: preprocessor not supported by this recipe (not GNU or clang CPP)])\n             AS_IF([test "x$enable_Werror" = "xyes"], [AC_MSG_ERROR([--enable-Werror=yes was requested and can not be satisfied for CPP: $CPP])])\n        ])])])\n])\n\n# Optional project-local hook to (re-)define some variables that can be used\n# in your project files generated from .in templates - in your acinclude.m4,\n# add AC_DEFUN([AX_PROJECT_LOCAL_HOOK_CONFIGVARS], [whatever])\nifdef([AX_PROJECT_LOCAL_HOOK_CONFIGVARS],\n    [AX_PROJECT_LOCAL_HOOK_CONFIGVARS])\n\n# Specify output files\nAC_CONFIG_FILES([Makefile\n                 doc/Makefile\n                 include/Makefile\n                 src/libczmq.pc\n                ])\n\n\n# Optional project-local hook to put some finishing touches in your configure\n# script, override something compared to zproject-generated code, etc. - in\n# your acinclude.m4, add AC_DEFUN([AX_PROJECT_LOCAL_HOOK_FINAL], [whatever])\nifdef([AX_PROJECT_LOCAL_HOOK_FINAL],\n    [AX_PROJECT_LOCAL_HOOK_FINAL])\n\nAC_OUTPUT\n\n# Print configure summary and list make options\nAC_DEFUN([AX_SUMMARIZE_ENV],\n[\nBUILD_USER=${USER}\nBUILD_ARCH=${host}\nBUILD_HOST=${ac_hostname}\nBUILD_DATE=$(date +\'%F %H:%M\')\n\nAC_DEFINE_UNQUOTED([BUILD_USER],     "${BUILD_USER}",     [The fine user who built the package])\nAC_DEFINE_UNQUOTED([BUILD_ARCH],     "${BUILD_ARCH}",     [Architecture of the build host])\nAC_DEFINE_UNQUOTED([BUILD_HOST],     "${BUILD_HOST}",     [Build host name])\nAC_DEFINE_UNQUOTED([BUILD_DATE],     "${BUILD_DATE}",     [Build date])\n\nAC_SUBST(BUILD_USER)\nAC_SUBST(BUILD_ARCH)\nAC_SUBST(BUILD_HOST)\nAC_SUBST(BUILD_DATE)\nAC_SUBST(BUILD_VERSION)\n])\n\nAC_DEFUN([AX_SUMMARIZE_CONFIG],\n[\necho\necho \'##########################################################################\'\necho \'#                                SUMMARY                                 #\'\necho \'##########################################################################\'\necho\necho Package version............... : $PACKAGE-$VERSION\necho\necho C compiler.................... : $CC\necho C compiler flags.............. : $CFLAGS\necho C++ compiler.................. : $CXX\necho C++ compiler flags............ : $CXXFLAGS\necho Configure date................ : $BUILD_DATE\necho Build architecture............ : $BUILD_ARCH\necho Build docs.................... : $czmq_build_doc\necho Build host.................... : $BUILD_HOST\necho Build user.................... : $USER\necho Draft API..................... : $enable_drafts\necho Python Bindings............... : $ZPROJECT_BINDINGS_PYTHON\necho Install dir................... : $prefix\necho Install man pages............. : $czmq_install_man\n\necho\necho Help:\necho Use the Draft API \\(default = yes\\):\necho --enable-drafts=\\(yes\\|no\\)\necho\necho Build the docs and install the man pages \\(default = yes\\):\necho --with-docs=\\(yes\\|no\\)       *requires asciidoc and xmlto\n\necho\necho \'##########################################################################\'\n\necho\necho Configure complete! Now proceed with:\necho "    - \'make\'               compile the project"\necho "    - \'make check\'         run the project\'s selftest"\necho "    - \'make check-<test-name>\'    run the project\'s selftest"\necho "    - \'make install\'       install the project to $prefix"\necho "    - \'make bindings       install enabled language bindings (Python, etc)"\necho\necho Further options are:\necho "    - \'make callcheck\'     run the project\'s selftest with valgrind to"\necho "                           check for performance leaks"\necho "    - \'make check-verbose\' run the project\'s selftest in verbose mode"\necho "    - \'make code\'          generate code from models in src directory"\necho "                           (requires zproject and zproto)"\necho "    - \'make debug\'         run the project\'s selftest under gdb"\necho "    - \'make memcheck\'      run the project\'s selftest with valgrind to"\necho "                           check for memory leaks"\necho "    - \'make coverage\'      generate project\'s selftest coverage report"\necho "                           expects --with-gcov option for configure"\necho "    - \'make clang-format-check\'   check if project sources conform"\necho "                           to style requirements"\necho "    - \'make clang-format\'  modify project sources to conform"\necho "                           to style requirements"\necho "    - \'make clang-format-diff\'    modify as above and print \'git diff\'"\necho\n])\n\nAX_SUMMARIZE_ENV\nAX_SUMMARIZE_CONFIG\n################################################################################\n#  THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY  #\n#  Read the zproject/README.md for information about making permanent changes. #\n################################################################################\n', 'message': 'Problem: out of date with zproject\n\nSolution: regenerate\n', 'author_name': 'Luca Boccassi', 'lang': 'ac'}