Skip to content
Commits on Source (2)
Apache ZooKeeper
Copyright 2009-2017 The Apache Software Foundation
Copyright 2009-2018 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
......
......@@ -46,4 +46,7 @@ if not exist "%JAVA_HOME%"\bin\java.exe (
goto :eof
)
REM strip off trailing \ from JAVA_HOME or java does not start
if "%JAVA_HOME:~-1%" EQU "\" set "JAVA_HOME=%JAVA_HOME:~0,-1%"
set JAVA="%JAVA_HOME%"\bin\java
......@@ -31,7 +31,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
<property environment="env"/>
<property name="version" value="3.4.10" />
<property name="version" value="3.4.12" />
<property name="final.name" value="${name}-${version}"/>
<property name="revision.dir" value="${basedir}/.revision" />
<property name="revision.properties" value="revision.properties" />
......@@ -116,6 +116,8 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
<property name="ivy.package.lib" value="${build.dir}/package/lib"/>
<property name="ivy.test.lib" value="${build.dir}/test/lib"/>
<property name="ivy.jdiff.lib" value="${build.dir}/jdiff/lib"/>
<property name="ivy.releaseaudit.lib" value="${build.dir}/releaseaudit/lib"/>
<property name="ivy.owasp.lib" value="${build.dir}/owasp/lib"/>
<property name="ivysettings.xml" value="${basedir}/ivysettings.xml"/>
<property name="mvnrepo" value="https://repo1.maven.org/maven2"/>
......@@ -202,6 +204,39 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
<property name="sources-jar" value="${dist.maven.dir}/${final.name}-sources.jar"/>
<property name="javadoc-jar" value="${dist.maven.dir}/${final.name}-javadoc.jar"/>
<!-- ====================================================== -->
<!-- Dependency versions -->
<!-- ====================================================== -->
<property name="slf4j.version" value="1.7.25"/>
<property name="wagon-http.version" value="2.4"/>
<property name="maven-ant-tasks.version" value="2.1.3"/>
<property name="log4j.version" value="1.2.17"/>
<property name="jline.version" value="0.9.94"/>
<property name="jdeb.version" value="0.8"/>
<property name="audience-annotations.version" value="0.5.0" />
<property name="netty.version" value="3.10.6.Final"/>
<property name="junit.version" value="4.8.1"/>
<property name="mockito.version" value="1.8.5"/>
<property name="checkstyle.version" value="6.1.1"/>
<property name="commons-collections.version" value="3.2.2"/>
<property name="commons-io.version" value="2.4"/>
<property name="apache-directory-server.version" value="2.0.0-M15"/>
<property name="apache-directory-api.version" value="1.0.0-M20"/>
<property name="jdiff.version" value="1.0.9"/>
<property name="xerces.version" value="1.4.4"/>
<property name="apache-rat-tasks.version" value="0.6"/>
<property name="commons-lang.version" value="2.4"/>
<property name="dependency-check-ant.version" value="2.1.0"/>
<!-- ====================================================== -->
<!-- Macro definitions -->
<!-- ====================================================== -->
......@@ -216,8 +251,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
</sequential>
</macrodef>
<!-- the normal classpath -->
<path id="java.classpath">
<path id="base.classpath">
<pathelement location="${build.classes}"/>
<!-- allow the user to override (e.g. if there are local versions) -->
<fileset dir="${additional.lib.dir}">
......@@ -231,18 +265,23 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
<fileset dir="${ant.home}/lib">
<include name="ant.jar" />
</fileset>
<pathelement path="${clover.jar}" />
</path>
<!-- the normal classpath -->
<path id="java.classpath">
<path refid="base.classpath"/>
<fileset dir="${ivy.lib}">
<include name="**/*.jar" />
</fileset>
<pathelement path="${clover.jar}" />
</path>
<path id="test.java.classpath">
<path refid="base.classpath"/>
<pathelement location="${test.java.classes}" />
<fileset dir="${ivy.test.lib}">
<include name="**/*.jar" />
</fileset>
<path refid="java.classpath"/>
</path>
<path id="package.classpath">
......@@ -273,7 +312,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
<target name="jute" depends="init">
<javac srcdir="${java.src.dir}" destdir="${build.classes}" includeantruntime="false"
target="${javac.target}" source="${javac.source}"
includes="org/apache/jute/**" debug="on" />
includes="org/apache/jute/**" debug="on" classpath="${ivy.lib}/audience-annotations-${audience-annotations.version}.jar" />
</target>
<target name="compile_jute_uptodate">
......@@ -340,9 +379,9 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
</java>
</target>
<target name="build-generated" depends="compile_jute,version-info" >
<target name="build-generated" depends="compile_jute,version-info,ivy-retrieve" >
<javac srcdir="${src_generated.dir}" destdir="${build.classes}" includeantruntime="false"
target="${javac.target}" source="${javac.source}" debug="on" />
target="${javac.target}" source="${javac.source}" debug="on" classpath="${ivy.lib}/audience-annotations-${audience-annotations.version}.jar" />
</target>
<target name="ivy-download" unless="ivy.jar.exists" depends="init">
......@@ -386,15 +425,27 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
<target name="ivy-retrieve-releaseaudit" depends="init,ivy-init">
<ivy:retrieve settingsRef="${ant.project.name}" conf="releaseaudit"
pattern="${ivy.lib}/[artifact]-[revision].[ext]"/>
pattern="${ivy.releaseaudit.lib}/[artifact]-[revision].[ext]"/>
<ivy:cachepath pathid="releaseaudit-classpath" conf="releaseaudit"/>
</target>
<target name="ivy-retrieve-owasp" depends="init,ivy-init">
<ivy:retrieve settingsRef="${ant.project.name}" conf="owasp"
pattern="${ivy.owasp.lib}/[artifact]-[revision].[ext]"/>
<ivy:cachepath pathid="owasp-classpath" conf="owasp"/>
</target>
<target name="ivy-retrieve-mvn-ant-task" depends="init,ivy-init">
<ivy:retrieve settingsRef="${ant.project.name}" conf="mvn-ant-task"
pattern="${ivy.lib}/[artifact]-[revision].[ext]"/>
<ivy:cachepath pathid="mvn-ant-task-classpath" conf="mvn-ant-task"/>
</target>
<target name="dependency-report" depends="init,ivy-init">
<ivy:resolve conf="*"/>
<ivy:report conf="*" todir="${build.dir}/dependency-report"/>
</target>
<target name="compile" depends="ivy-retrieve,clover,build-generated">
<javac srcdir="${java.src.dir}" destdir="${build.classes}" includeantruntime="false"
target="${javac.target}" source="${javac.source}" debug="on">
......@@ -498,23 +549,24 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
windowtitle="${Name} ${version} API"
doctitle="${Name} ${version} API"
bottom="Copyright &amp;copy; ${year} The Apache Software Foundation"
doclet="org.apache.yetus.audience.tools.IncludePublicAnnotationsStandardDoclet"
docletpath="${ivy.lib}/audience-annotations-${audience-annotations.version}.jar"
>
<fileset dir="${java.src.dir}">
<include name="org/apache/**/*Main.java"/>
<include name="org/apache/zookeeper/AsyncCallback.java"/>
<include name="org/apache/zookeeper/CreateMode.java"/>
<include name="org/apache/zookeeper/KeeperException.java"/>
<include name="org/apache/zookeeper/ServerAdminClient.java"/>
<include name="org/apache/zookeeper/Watcher.java"/>
<include name="org/apache/zookeeper/WatchedEvent.java"/>
<include name="org/apache/zookeeper/ZooDefs.java"/>
<include name="org/apache/zookeeper/ZooKeeper.java"/>
<include name="org/apache/zookeeper/server/quorum/QuorumPeerMain.java"/>
<include name="org/apache/zookeeper/server/ZooKeeperServerMain.java"/>
<include name="org/apache/zookeeper/server/LogFormatter.java"/>
<include name="org/apache/zookeeper/server/SnapshotFormatter.java"/>
<include name="org/apache/zookeeper/server/PurgeTxnLog.java"/>
<exclude name="org/apache/zookeeper/server/quorum/QuorumPacket"/>
<include name="org/apache/zookeeper/server/SnapshotFormatter.java"/>
<include name="org/apache/zookeeper/server/upgrade/UpgradeMain.java"/>
</fileset>
<packageset dir="${java.src.dir}">
<include name="org/apache/**"/>
<exclude name="org/apache/zookeeper/server/**"/>
</packageset>
<packageset dir="${src_generated.dir}">
<include name="org/apache/**"/>
<exclude name="org/apache/zookeeper/proto"/>
<exclude name="org/apache/zookeeper/txn"/>
<exclude name="org/apache/zookeeper/version"/>
......@@ -549,7 +601,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
<fileset dir="${java.src.dir}"/>
<fileset dir="${src_generated.dir}" excludes="**/.generated"/>
<manifest>
<attribute name="Main-Class" value="org.apache.zookeeper.server.quorum.QuorumPeer" />
<attribute name="Main-Class" value="org.apache.zookeeper.server.quorum.QuorumPeerMain" />
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Built-At" value="${build.time}"/>
<attribute name="Built-On" value="${host.name}" />
......@@ -590,7 +642,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
<fileset file="LICENSE.txt" />
<fileset dir="${build.classes}" excludes="**/.generated"/>
<manifest>
<attribute name="Main-Class" value="org.apache.zookeeper.server.quorum.QuorumPeer" />
<attribute name="Main-Class" value="org.apache.zookeeper.server.quorum.QuorumPeerMain" />
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Built-At" value="${build.time}"/>
<attribute name="Built-On" value="${host.name}" />
......@@ -755,7 +807,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
<copy todir="${dist.dir}">
<fileset file="CHANGES.txt"/>
<fileset file="README.txt"/>
<fileset file="README.md"/>
<fileset file="README_packaging.txt"/>
<fileset file="build.xml"/>
<fileset file="ivy.xml"/>
......@@ -874,7 +926,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
<copy todir="${dist.dir}">
<fileset file="CHANGES.txt"/>
<fileset file="README.txt"/>
<fileset file="README.md"/>
<fileset file="README_packaging.txt"/>
<fileset file="build.xml"/>
<fileset file="ivy.xml"/>
......@@ -1611,6 +1663,29 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
classpathref="releaseaudit-classpath"/>
</target>
<target name="owasp-taskdef" depends="ivy-retrieve-owasp">
<typedef format="properties" resource="dependency-check-taskdefs.properties" uri="antlib:org.owasp.dependencycheck.anttasks" classpathref="owasp-classpath"/>
</target>
<target name="owasp" depends="owasp-taskdef,ivy-retrieve" description="OWASP dependency check">
<property name="owasp.out.dir" value="${test.java.build.dir}/owasp" />
<owasp:dependency-check xmlns:owasp="antlib:org.owasp.dependencycheck.anttasks"
projectname="ZooKeeper"
reportoutputdirectory="${owasp.out.dir}"
reportformat="ALL"
failBuildOnCVSS="0">
<fileset dir="${ivy.lib}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</owasp:dependency-check>
</target>
<target name="releaseaudit" depends="package,rats-taskdef" description="Release Audit activities">
<rat:report xmlns:rat="antlib:org.apache.rat.anttasks">
<fileset dir="${dist.dir}">
......@@ -1787,7 +1862,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle">
</condition>
<target name="ant-eclipse-download" unless="ant-eclipse.jar.exists">
<get src="http://downloads.sourceforge.net/project/ant-eclipse/ant-eclipse/1.0/ant-eclipse-1.0.bin.tar.bz2"
<get src="https://downloads.sourceforge.net/project/ant-eclipse/ant-eclipse/1.0/ant-eclipse-1.0.bin.tar.bz2"
dest="${src.dir}/java/ant-eclipse-1.0.bin.tar.bz2" usetimestamp="false" />
<bunzip2 src="${src.dir}/java/ant-eclipse-1.0.bin.tar.bz2"/>
......
......@@ -28,11 +28,12 @@
<configurations defaultconfmapping="default">
<conf name="master"/>
<conf name="default"/>
<conf name="test"/>
<conf name="test" extends="default"/>
<conf name="mvn-ant-task" visibility="private"/>
<conf name="package" extends="master"/>
<conf name="jdiff" visibility="private"/>
<conf name="releaseaudit" visibility="private" description="Artifacts required for releaseaudit target"/>
<conf name="owasp" visibility="private" description="Artifacts required for owasp target"/>
</configurations>
<publications>
......@@ -40,76 +41,110 @@
</publications>
<dependencies>
<dependency org="org.slf4j" name="slf4j-api" rev="1.6.1"/>
<dependency org="org.slf4j" name="slf4j-log4j12" rev="1.6.1" transitive="false"/>
<dependency org="org.apache.maven.wagon" name="wagon-http" rev="2.4" conf="mvn-ant-task->default"/>
<dependency org="org.apache.maven" name="maven-ant-tasks" rev="2.1.3" conf="mvn-ant-task->default"/>
<dependency org="org.slf4j" name="slf4j-api" rev="${slf4j.version}"/>
<dependency org="org.slf4j" name="slf4j-log4j12" rev="${slf4j.version}" transitive="false"/>
<dependency org="org.apache.maven.wagon" name="wagon-http" rev="${wagon-http.version}"
conf="mvn-ant-task->default"/>
<dependency org="org.apache.maven" name="maven-ant-tasks" rev="${maven-ant-tasks.version}"
conf="mvn-ant-task->default">
<exclude org="org.codehaus.plexus" module="plexus-utils"/>
<exclude org="org.apache.maven.wagon" module="wagon-provider-api" />
</dependency>
<!-- transitive false turns off dependency checking, log4j deps seem borked -->
<dependency org="log4j" name="log4j" rev="1.2.16" transitive="false" conf="default"/>
<dependency org="jline" name="jline" rev="0.9.94" transitive="false" conf="default"/>
<dependency org="log4j" name="log4j" rev="${log4j.version}" transitive="false" conf="default"/>
<dependency org="jline" name="jline" rev="${jline.version}" transitive="false" conf="default"/>
<dependency org="org.apache.yetus" name="audience-annotations" rev="${audience-annotations.version}"/>
<dependency org="io.netty" name="netty" conf="default" rev="3.10.5.Final">
<dependency org="io.netty" name="netty" conf="default" rev="${netty.version}">
<artifact name="netty" type="jar" conf="default"/>
</dependency>
<dependency org="org.vafer" name="jdeb" rev="0.8" conf="package->master"/>
<dependency org="org.vafer" name="jdeb" rev="${jdeb.version}" conf="package->master"/>
<dependency org="junit" name="junit" rev="4.8.1" conf="test->default"/>
<dependency org="org.mockito" name="mockito-all" rev="1.8.2"
<dependency org="junit" name="junit" rev="${junit.version}" conf="test->default"/>
<dependency org="org.mockito" name="mockito-all" rev="${mockito.version}"
conf="test->default"/>
<dependency org="com.puppycrawl.tools" name="checkstyle" rev="6.1.1"
<dependency org="com.puppycrawl.tools" name="checkstyle" rev="${checkstyle.version}"
conf="test->default"/>
<dependency org="commons-collections" name="commons-collections"
rev="3.2.2" conf="test->default"/>
rev="${commons-collections.version}" conf="test->default"/>
<dependency org="jdiff" name="jdiff" rev="1.0.9"
<dependency org="jdiff" name="jdiff" rev="${jdiff.version}"
conf="jdiff->default"/>
<dependency org="xerces" name="xerces" rev="1.4.4"
<dependency org="xerces" name="xerces" rev="${xerces.version}"
conf="jdiff->default"/>
<dependency org="org.apache.rat" name="apache-rat-tasks"
rev="0.6" conf="releaseaudit->default"/>
rev="${apache-rat-tasks.version}" conf="releaseaudit->default">
<exclude org="commons-collections" module="commons-collections"/>
<exclude org="commons-lang" module="commons-lang"/>
</dependency>
<dependency org="commons-lang" name="commons-lang"
rev="2.4" conf="releaseaudit->default"/>
rev="${commons-lang.version}" conf="releaseaudit->default"/>
<dependency org="commons-collections" name="commons-collections"
rev="3.2.2" conf="releaseaudit->default"/>
rev="${commons-collections.version}" conf="releaseaudit->default"/>
<dependency org="org.owasp" name="dependency-check-ant"
rev="${dependency-check-ant.version}" conf="owasp->default"/>
<dependency org="commons-io" name="commons-io" rev="2.4"
<dependency org="commons-io" name="commons-io" rev="${commons-io.version}"
conf="test->default"/>
<!-- Apache directory server project, org.apache.directory.* packages for miniKdc tests -->
<dependency org="org.apache.directory.server" name="apacheds-core-api" rev="2.0.0-M15" conf="test->default">
<exclude org="org.apache.directory.api" name="api-ldap-schema-data"/>
<dependency org="org.apache.directory.server" name="apacheds-core-api" rev="${apache-directory-server.version}" conf="test->default">
<exclude org="org.apache.directory.api" module="api-ldap-schema-data"/>
<exclude org="org.slf4j" module="slf4j-api"/>
<exclude org="commons-collections" module="commons-collections"/>
</dependency>
<dependency org="org.apache.directory.server" name="apacheds-interceptor-kerberos" rev="2.0.0-M15" conf="test->default">
<exclude org="org.apache.directory.api" name="api-ldap-schema-data"/>
<dependency org="org.apache.directory.server" name="apacheds-interceptor-kerberos" rev="${apache-directory-server.version}" conf="test->default">
<exclude org="org.apache.directory.api" module="api-ldap-schema-data"/>
<exclude org="commons-collections" module="commons-collections"/>
<exclude org="org.slf4j" module="slf4j-api"/>
</dependency>
<dependency org="org.apache.directory.server" name="apacheds-protocol-shared" rev="2.0.0-M15" conf="test->default">
<exclude org="org.apache.directory.api" name="api-ldap-schema-data"/>
<dependency org="org.apache.directory.server" name="apacheds-protocol-shared" rev="${apache-directory-server.version}" conf="test->default">
<exclude org="org.apache.directory.api" module="api-ldap-schema-data"/>
<exclude org="commons-collections" module="commons-collections"/>
<exclude org="org.slf4j" module="slf4j-api"/>
</dependency>
<dependency org="org.apache.directory.server" name="apacheds-protocol-kerberos" rev="2.0.0-M15" conf="test->default">
<exclude org="org.apache.directory.api" name="api-ldap-schema-data"/>
<dependency org="org.apache.directory.server" name="apacheds-protocol-kerberos" rev="${apache-directory-server.version}" conf="test->default">
<exclude org="org.apache.directory.api" module="api-ldap-schema-data"/>
<exclude org="commons-collections" module="commons-collections"/>
<exclude org="org.slf4j" module="slf4j-api"/>
</dependency>
<dependency org="org.apache.directory.server" name="apacheds-ldif-partition" rev="2.0.0-M15" conf="test->default">
<exclude org="org.apache.directory.api" name="api-ldap-schema-data"/>
<dependency org="org.apache.directory.server" name="apacheds-ldif-partition" rev="${apache-directory-server.version}" conf="test->default">
<exclude org="org.apache.directory.api" module="api-ldap-schema-data"/>
<exclude org="commons-collections" module="commons-collections"/>
<exclude org="org.slf4j" module="slf4j-api"/>
</dependency>
<dependency org="org.apache.directory.server" name="apacheds-mavibot-partition" rev="2.0.0-M15" conf="test->default">
<exclude org="org.apache.directory.api" name="api-ldap-schema-data"/>
<dependency org="org.apache.directory.server" name="apacheds-mavibot-partition" rev="${apache-directory-server.version}" conf="test->default">
<exclude org="org.apache.directory.api" module="api-ldap-schema-data"/>
<exclude org="commons-collections" module="commons-collections"/>
<exclude org="org.slf4j" module="slf4j-log4j12"/>
<exclude org="log4j" module="log4j"/>
<exclude org="org.slf4j" module="slf4j-api"/>
</dependency>
<dependency org="org.apache.directory.api" name="api-all" rev="1.0.0-M20" conf="test->default">
<exclude org="xml-apis" name="xml-apis"/>
<exclude org="xpp3" name="xpp3"/>
<exclude org="dom4j" name="dom4j"/>
<dependency org="org.apache.directory.api" name="api-all" rev="${apache-directory-api.version}" conf="test->default">
<exclude org="xml-apis" module="xml-apis"/>
<exclude org="xpp3" module="xpp3"/>
<exclude org="dom4j" module="dom4j"/>
<exclude org="commons-collections" module="commons-collections"/>
<exclude org="org.slf4j" module="slf4j-api"/>
</dependency>
<dependency org="org.apache.directory.server" name="apacheds-jdbm-partition" rev="2.0.0-M15" conf="test->default">
<exclude org="org.apache.directory.api" name="api-ldap-schema-data"/>
<dependency org="org.apache.directory.server" name="apacheds-jdbm-partition" rev="${apache-directory-server.version}" conf="test->default">
<exclude org="org.apache.directory.api" module="api-ldap-schema-data"/>
<exclude org="commons-collections" module="commons-collections"/>
<exclude org="org.slf4j" module="slf4j-api"/>
</dependency>
<dependency org="org.apache.directory.server" name="apacheds-protocol-ldap" rev="2.0.0-M15" conf="test->default">
<exclude org="org.apache.directory.api" name="api-ldap-schema-data"/>
<dependency org="org.apache.directory.server" name="apacheds-protocol-ldap" rev="${apache-directory-server.version}" conf="test->default">
<exclude org="org.apache.directory.api" module="api-ldap-schema-data"/>
<exclude org="commons-collections" module="commons-collections"/>
<exclude org="org.slf4j" module="slf4j-api"/>
</dependency>
<conflict manager="strict"/>
</dependencies>
</ivy-module>
Copyright (c) 2004-2008 QOS.ch
Copyright (c) 2004-2017 QOS.ch
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining
......@@ -19,3 +19,6 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Apache ZooKeeper
Copyright 2009-2017 The Apache Software Foundation
Copyright 2009-2018 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
......
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
cmake_minimum_required(VERSION 3.6)
project(zookeeper VERSION 3.4.12)
set(email user@zookeeper.apache.org)
set(description "zookeeper C client")
# general options
include_directories(include tests generated ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
if(UNIX)
add_compile_options(-Wall -fPIC)
elseif(WIN32)
add_compile_options(/W3)
endif()
add_definitions(-DUSE_STATIC_LIB)
# TODO: Enable /WX and /W4 on Windows. Currently there are ~1000 warnings.
# TODO: Add Solaris support.
# TODO: Add a shared library option.
# TODO: Specify symbols to export.
# TODO: Generate doxygen documentation.
# Sync API option
option(WANT_SYNCAPI "Enables Sync API support" ON)
if(WANT_SYNCAPI)
add_definitions(-DTHREADED)
if(WIN32)
# Note that the generator expression ensures that `/MTd` is used when Debug
# configurations are built.
add_compile_options(/MT$<$<CONFIG:Debug>:d>)
endif()
endif()
# CppUnit option
if(WIN32 OR APPLE)
# The tests do not yet compile on Windows or macOS,
# so we set this to off by default.
#
# Note that CMake does not have expressions except in conditionals,
# so we're left with this if/else/endif pattern.
set(DEFAULT_WANT_CPPUNIT OFF)
else()
set(DEFAULT_WANT_CPPUNIT ON)
endif()
option(WANT_CPPUNIT "Enables CppUnit and tests" ${DEFAULT_WANT_CPPUNIT})
# The function `to_have(in out)` converts a header name like `arpa/inet.h`
# into an Autotools style preprocessor definition `HAVE_ARPA_INET_H`.
# This is then set or unset in `configure_file()` step.
#
# Note that CMake functions do not have return values; instead an "out"
# variable must be passed, and explicitly set with parent scope.
function(to_have in out)
string(TOUPPER ${in} str)
string(REGEX REPLACE "/|\\." "_" str ${str})
set(${out} "HAVE_${str}" PARENT_SCOPE)
endfunction()
# include file checks
foreach(f generated/zookeeper.jute.h generated/zookeeper.jute.c)
if(EXISTS "${CMAKE_SOURCE_DIR}/${f}")
to_have(${f} name)
set(${name} 1)
else()
message(FATAL_ERROR
"jute files are missing!\n"
"Please run 'ant compile_jute' while in the ZooKeeper top level directory.")
endif()
endforeach()
# header checks
include(CheckIncludeFile)
set(check_headers
arpa/inet.h
dlfcn.h
fcntl.h
inttypes.h
memory.h
netdb.h
netinet/in.h
stdint.h
stdlib.h
string.h
strings.h
sys/socket.h
sys/stat.h
sys/time.h
sys/types.h
unistd.h
sys/utsname.h)
foreach(f ${check_headers})
to_have(${f} name)
check_include_file(${f} ${name})
endforeach()
# function checks
include(CheckFunctionExists)
set(check_functions
getcwd
gethostbyname
gethostname
getlogin
getpwuid_r
gettimeofday
getuid
memmove
memset
poll
socket
strchr
strdup
strerror
strtol)
foreach(fn ${check_functions})
to_have(${fn} name)
check_function_exists(${fn} ${name})
endforeach()
# library checks
set(check_libraries rt m pthread)
foreach(lib ${check_libraries})
to_have("lib${lib}" name)
find_library(${name} ${lib})
endforeach()
# IPv6 check
include(CheckStructHasMember)
check_struct_has_member("struct sockaddr_in6" sin6_addr "netinet/in.h" ZOO_IPV6_ENABLED)
# configure
configure_file(cmake_config.h.in ${CMAKE_SOURCE_DIR}/include/config.h)
# hashtable library
set(hashtable_sources src/hashtable/hashtable_itr.c src/hashtable/hashtable.c)
add_library(hashtable STATIC ${hashtable_sources})
target_link_libraries(hashtable PUBLIC $<$<PLATFORM_ID:Linux>:m>)
# zookeeper library
set(zookeeper_sources
src/zookeeper.c
src/recordio.c
generated/zookeeper.jute.c
src/zk_log.c
src/zk_hashtable.c)
if(WANT_SYNCAPI)
list(APPEND zookeeper_sources src/mt_adaptor.c)
else()
list(APPEND zookeeper_sources src/st_adaptor.c)
endif()
if(WIN32)
list(APPEND zookeeper_sources src/winport.c)
endif()
add_library(zookeeper STATIC ${zookeeper_sources})
target_link_libraries(zookeeper PUBLIC
hashtable
$<$<PLATFORM_ID:Linux>:rt> # clock_gettime
$<$<PLATFORM_ID:Windows>:ws2_32>) # Winsock 2.0
if(WANT_SYNCAPI AND NOT WIN32)
find_package(Threads REQUIRED)
target_link_libraries(zookeeper PUBLIC Threads::Threads)
endif()
# cli executable
add_executable(cli src/cli.c)
target_link_libraries(cli zookeeper)
# load_gen executable
if(WANT_SYNCAPI AND NOT WIN32)
add_executable(load_gen src/load_gen.c)
target_link_libraries(load_gen zookeeper)
endif()
# tests
set(test_sources
tests/TestDriver.cc
tests/LibCMocks.cc
tests/LibCSymTable.cc
tests/MocksBase.cc
tests/ZKMocks.cc
tests/Util.cc
tests/ThreadingUtil.cc
tests/TestZookeeperInit.cc
tests/TestZookeeperClose.cc
tests/TestClientRetry.cc
tests/TestOperations.cc
tests/TestMulti.cc
tests/TestWatchers.cc
tests/TestClient.cc)
if(WANT_SYNCAPI)
list(APPEND test_sources tests/PthreadMocks.cc)
endif()
if(WANT_CPPUNIT)
add_executable(zktest ${test_sources})
target_compile_definitions(zktest
PRIVATE -DZKSERVER_CMD="${CMAKE_SOURCE_DIR}/tests/zkServer.sh")
# TODO: Use `find_library()` for `cppunit`.
target_link_libraries(zktest zookeeper cppunit dl)
# This reads the link flags from the file `tests/wrappers.opt` into
# the variable `symbol_wrappers` for use in `target_link_libraries`.
# It is a holdover from the original build system.
file(STRINGS tests/wrappers.opt symbol_wrappers)
if(WANT_SYNCAPI)
file(STRINGS tests/wrappers-mt.opt symbol_wrappers_mt)
endif()
target_link_libraries(zktest ${symbol_wrappers} ${symbol_wrappers_mt})
enable_testing()
add_test(NAME zktest_runner COMMAND zktest)
set_property(TEST zktest_runner PROPERTY ENVIRONMENT
"ZKROOT=${CMAKE_SOURCE_DIR}/../.."
"CLASSPATH=$CLASSPATH:$CLOVER_HOME/lib/clover.jar")
endif()
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="Cli"
ProjectGUID="{050228F9-070F-4806-A2B5-E6B95D8EC4AF}"
RootNamespace="Cli"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="$(ZOOKEEPER_HOME)\src\c\src;$(ZOOKEEPER_HOME)\src\c\include;$(ZOOKEEPER_HOME)\src\c;$(ZOOKEEPER_HOME)\src\c\generated"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;THREADED"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="Ws2_32.lib zookeeper_d.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
LinkIncremental="2"
AdditionalLibraryDirectories="$(ZOOKEEPER_HOME)\src\c\Debug"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="$(ZOOKEEPER_HOME)\src\c\src;$(ZOOKEEPER_HOME)\src\c\include;$(ZOOKEEPER_HOME)\src\c;$(ZOOKEEPER_HOME)\src\c\generated"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;THREADED"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
CompileAs="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="Ws2_32.lib zookeeper.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="$(ZOOKEEPER_HOME)\src\c\Release"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\src\cli.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="$(ZOOKEEPER_HOME)\src\c\include;$(ZOOKEEPER_HOME)\src\c;$(ZOOKEEPER_HOME)\src\c\src"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
Apache ZooKeeper
Copyright 2009-2017 The Apache Software Foundation
Copyright 2009-2018 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
......
......@@ -71,6 +71,28 @@ tar downloaded from Apache please skip to step 2.
default only HTML documentation is generated. For information on
other document formats please use "./configure --help"
Alternatively you can use the CMake build system. On Windows, this is required.
Follow steps 1 and 2 above, and then continue here.
1) do a "cmake [OPTIONS]" to generate the makefile or msbuild files (the correct
build system will be generated based on your platform). Some options from above
are supported:
-DCMAKE_BUILD_TYPE Debug by default, Release enables optimzation etc.
-DWANT_SYNCAPI ON by default, OFF disables the Sync API support
-DWANT_CPPUNIT ON except on Windows, OFF disables the tests
-DBUILD_SHARED_LIBS not yet supported, only static libraries are built
other CMake options see "cmake --help" for generic options, such as generator
2) do a "cmake --build ." to build the default targets. Alternatively you can
invoke "make" or "msbuild" manually. If the tests were enabled, use "ctest -V"
to run them.
Current limitations of the CMake build system include lack of Solaris support,
no shared library option, no explicitly exported symbols (all are exported by
default), no versions on the libraries, and no documentation generation.
Features of CMake include a single, easily consumed cross-platform build system
to generate the ZooKeeper C Client libraries for any project, with little to no
configuration.
EXAMPLE/SAMPLE C CLIENT SHELL
......
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef CONFIG_H_
#define CONFIG_H_
/* Define to 1 if you have the <arpa/inet.h> header file. */
#cmakedefine HAVE_ARPA_INET_H 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#cmakedefine HAVE_DLFCN_H 1
/* Define to 1 if you have the <fcntl.h> header file. */
#cmakedefine HAVE_FCNTL_H 1
/* Define to 1 if you have the file `generated/zookeeper.jute.c'. */
#cmakedefine HAVE_GENERATED_ZOOKEEPER_JUTE_C 1
/* Define to 1 if you have the file `generated/zookeeper.jute.h'. */
#cmakedefine HAVE_GENERATED_ZOOKEEPER_JUTE_H 1
/* Define to 1 if you have the `getcwd' function. */
#cmakedefine HAVE_GETCWD 1
/* Define to 1 if you have the `gethostbyname' function. */
#cmakedefine HAVE_GETHOSTBYNAME 1
/* Define to 1 if you have the `gethostname' function. */
#cmakedefine HAVE_GETHOSTNAME 1
/* Define to 1 if you have the `getlogin' function. */
#cmakedefine HAVE_GETLOGIN 1
/* Define to 1 if you have the `getpwuid_r' function. */
#cmakedefine HAVE_GETPWUID_R 1
/* Define to 1 if you have the `gettimeofday' function. */
#cmakedefine HAVE_GETTIMEOFDAY 1
/* Define to 1 if you have the `getuid' function. */
#cmakedefine HAVE_GETUID 1
/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine HAVE_INTTYPES_H 1
/* Define to 1 if you have the `rt' library (-lrt). */
#cmakedefine HAVE_LIBRT 1
/* Define to 1 if you have the `memmove' function. */
#cmakedefine HAVE_MEMMOVE 1
/* Define to 1 if you have the <memory.h> header file. */
#cmakedefine HAVE_MEMORY_H 1
/* Define to 1 if you have the `memset' function. */
#cmakedefine HAVE_MEMSET 1
/* Define to 1 if you have the <netdb.h> header file. */
#cmakedefine HAVE_NETDB_H 1
/* Define to 1 if you have the <netinet/in.h> header file. */
#cmakedefine HAVE_NETINET_IN_H 1
/* Define to 1 if you have the `poll' function. */
#cmakedefine HAVE_POLL 1
/* Define to 1 if you have the `socket' function. */
#cmakedefine HAVE_SOCKET 1
/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#cmakedefine HAVE_STDLIB_H 1
/* Define to 1 if you have the `strchr' function. */
#cmakedefine HAVE_STRCHR 1
/* Define to 1 if you have the `strdup' function. */
#cmakedefine HAVE_STRDUP 1
/* Define to 1 if you have the `strerror' function. */
#cmakedefine HAVE_STRERROR 1
/* Define to 1 if you have the <strings.h> header file. */
#cmakedefine HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#cmakedefine HAVE_STRING_H 1
/* Define to 1 if you have the `strtol' function. */
#cmakedefine HAVE_STRTOL 1
/* Define to 1 if you have the <sys/socket.h> header file. */
#cmakedefine HAVE_SYS_SOCKET_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#cmakedefine HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#cmakedefine HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#cmakedefine HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <sys/utsname.h> header file. */
#cmakedefine HAVE_SYS_UTSNAME_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine HAVE_UNISTD_H 1
/* Define to 1 if IPv6 support is available. */
#cmakedefine ZOO_IPV6_ENABLED 1
/* poll() second argument type */
#define POLL_NFDS_TYPE nfds_t
/* Name of package */
#define PACKAGE "${PROJECT_NAME}"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "${email}"
/* Define to the full name of this package. */
#define PACKAGE_NAME "${description}"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "${description} ${PROJECT_VERSION}"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "${PROJECT_NAME}"
/* Define to the version of this package. */
#define PACKAGE_VERSION "${PROJECT_VERSION}"
/* Version number of package */
#define VERSION "${PROJECT_VERSION}"
#endif
......@@ -102,8 +102,7 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#undef LT_OBJDIR
/* Name of package */
......
......@@ -3,7 +3,7 @@
AC_PREREQ(2.59)
AC_INIT([zookeeper C client],3.4.10,[user@zookeeper.apache.org],[zookeeper])
AC_INIT([zookeeper C client],3.4.12,[user@zookeeper.apache.org],[zookeeper])
AC_CONFIG_SRCDIR([src/zookeeper.c])
# Save initial CFLAGS and CXXFLAGS values before AC_PROG_CC and AC_PROG_CXX
......
......@@ -3,7 +3,7 @@
scriptversion=2013-05-30.07; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......
......@@ -19,11 +19,12 @@
#define __RECORDIO_H__
#include <sys/types.h>
#ifndef WIN32
#define STRUCT_INITIALIZER(l,r) .l = r
#else
#define STRUCT_INITIALIZER(l,r) r
#include <stdint.h> /* for int64_t */
#ifdef WIN32
#include "winconfig.h"
#define STRUCT_INITIALIZER(l,r) r
#else
#define STRUCT_INITIALIZER(l,r) .l = r
#endif
#ifdef __cplusplus
......
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the file `generated/zookeeper.jute.c'. */
#define HAVE_GENERATED_ZOOKEEPER_JUTE_C 1
/* Define to 1 if you have the file `generated/zookeeper.jute.h'. */
#define HAVE_GENERATED_ZOOKEEPER_JUTE_H 1
/* Define to 1 if you have the `getcwd' function. */
#undef HAVE_GETCWD
/* Define to 1 if you have the `gethostbyname' function. */
#undef HAVE_GETHOSTBYNAME
/* Define to 1 if you have the `gethostname' function. */
#define HAVE_GETHOSTNAME 1
/* Define to 1 if you have the `getlogin' function. */
#undef HAVE_GETLOGIN
/* Define to 1 if you have the `getpwuid_r' function. */
#undef HAVE_GETPWUID_R
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* Define to 1 if you have the `getuid' function. */
#undef HAVE_GETUID
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `memmove' function. */
#undef HAVE_MEMMOVE
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
/* Define to 1 if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
/* Define to 1 if you have the `poll' function. */
#undef HAVE_POLL
/* Define to 1 if you have the `socket' function. */
#undef HAVE_SOCKET
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strchr' function. */
#define HAVE_STRCHR 1
/* Define to 1 if you have the `strdup' function. */
#define HAVE_STRDUP 1
/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strtol' function. */
#undef HAVE_STRTOL
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <sys/utsname.h> header file. */
#undef HAVE_SYS_UTSNAME_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#define LT_OBJDIR
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */
/* Name of package */
#define PACKAGE "c-client-src"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "user@zookeeper.apache.org"
/* Define to the full name of this package. */
#define PACKAGE_NAME "zookeeper C client"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "zookeeper C client 3.4.10 win32"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "c-client-src"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "3.4.10"
/* poll() second argument type */
#define POLL_NFDS_TYPE
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME
/* Version number of package */
#define VERSION "3.4.10"
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
#ifndef WINCONFIG_H_
#define WINCONFIG_H_
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#define inline __inline
#endif
#ifdef WIN32
#define __attribute__(x)
#define __func__ __FUNCTION__
#ifndef _WIN32_WINNT_NT4
#define _WIN32_WINNT_NT4 0x0400
#endif
#define NTDDI_VERSION _WIN32_WINNT_NT4
#define _WIN32_WINNT _WIN32_WINNT_NT4
#define _CRT_SECURE_NO_WARNINGS
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <Winsock2.h>
#include <winstdint.h>
#include <process.h>
#include <ws2tcpip.h>
#undef AF_INET6
#undef min
#undef max
#include <errno.h>
#define strtok_r strtok_s
#define localtime_r(a,b) localtime_s(b,a)
#define get_errno() errno=GetLastError()
#define random rand
#define snprintf _snprintf
#define ACL ZKACL // Conflict with windows API
#define EAI_ADDRFAMILY WSAEINVAL
#define EHOSTDOWN EPIPE
#define ESTALE ENODEV
#ifndef EWOULDBLOCK
#define EWOULDBLOCK WSAEWOULDBLOCK
#endif
#ifndef EINPROGRESS
#define EINPROGRESS WSAEINPROGRESS
#endif
#define ACL ZKACL /* Conflict with windows API */
typedef int pid_t;
#endif
// ISO C9x compliant stdint.h for Microsoft Visual Studio
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
//
// Copyright (c) 2006-2008 Alexander Chemeris
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. The name of the author may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef _MSC_VER // [
#error "Use this header only with Microsoft Visual C++ compilers!"
#endif // _MSC_VER ]
#ifndef _MSC_STDINT_H_ // [
#define _MSC_STDINT_H_
#if _MSC_VER > 1000
#pragma once
#endif
#include <limits.h>
// For Visual Studio 6 in C++ mode and for many Visual Studio versions when
// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
// or compiler give many errors like this:
// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
#ifdef __cplusplus
extern "C" {
#endif
# include <wchar.h>
#ifdef __cplusplus
}
#endif
// Define _W64 macros to mark types changing their size, like intptr_t.
#ifndef _W64
# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
# define _W64 __w64
# else
# define _W64
# endif
#endif
// 7.18.1 Integer types
// 7.18.1.1 Exact-width integer types
// Visual Studio 6 and Embedded Visual C++ 4 doesn't
// realize that, e.g. char has the same size as __int8
// so we give up on __intX for them.
#if (_MSC_VER < 1300)
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
#else
typedef signed __int8 int8_t;
typedef signed __int16 int16_t;
typedef signed __int32 int32_t;
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
#endif
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
// 7.18.1.2 Minimum-width integer types
typedef int8_t int_least8_t;
typedef int16_t int_least16_t;
typedef int32_t int_least32_t;
typedef int64_t int_least64_t;
typedef uint8_t uint_least8_t;
typedef uint16_t uint_least16_t;
typedef uint32_t uint_least32_t;
typedef uint64_t uint_least64_t;
// 7.18.1.3 Fastest minimum-width integer types
typedef int8_t int_fast8_t;
typedef int16_t int_fast16_t;
typedef int32_t int_fast32_t;
typedef int64_t int_fast64_t;
typedef uint8_t uint_fast8_t;
typedef uint16_t uint_fast16_t;
typedef uint32_t uint_fast32_t;
typedef uint64_t uint_fast64_t;
// 7.18.1.4 Integer types capable of holding object pointers
#ifdef _WIN64 // [
typedef signed __int64 intptr_t;
typedef unsigned __int64 uintptr_t;
#else // _WIN64 ][
typedef _W64 signed int intptr_t;
typedef _W64 unsigned int uintptr_t;
#endif // _WIN64 ]
// 7.18.1.5 Greatest-width integer types
typedef int64_t intmax_t;
typedef uint64_t uintmax_t;
// 7.18.2 Limits of specified-width integer types
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
// 7.18.2.1 Limits of exact-width integer types
#define INT8_MIN ((int8_t)_I8_MIN)
#define INT8_MAX _I8_MAX
#define INT16_MIN ((int16_t)_I16_MIN)
#define INT16_MAX _I16_MAX
#define INT32_MIN ((int32_t)_I32_MIN)
#define INT32_MAX _I32_MAX
#define INT64_MIN ((int64_t)_I64_MIN)
#define INT64_MAX _I64_MAX
#define UINT8_MAX _UI8_MAX
#define UINT16_MAX _UI16_MAX
#define UINT32_MAX _UI32_MAX
#define UINT64_MAX _UI64_MAX
// 7.18.2.2 Limits of minimum-width integer types
#define INT_LEAST8_MIN INT8_MIN
#define INT_LEAST8_MAX INT8_MAX
#define INT_LEAST16_MIN INT16_MIN
#define INT_LEAST16_MAX INT16_MAX
#define INT_LEAST32_MIN INT32_MIN
#define INT_LEAST32_MAX INT32_MAX
#define INT_LEAST64_MIN INT64_MIN
#define INT_LEAST64_MAX INT64_MAX
#define UINT_LEAST8_MAX UINT8_MAX
#define UINT_LEAST16_MAX UINT16_MAX
#define UINT_LEAST32_MAX UINT32_MAX
#define UINT_LEAST64_MAX UINT64_MAX
// 7.18.2.3 Limits of fastest minimum-width integer types
#define INT_FAST8_MIN INT8_MIN
#define INT_FAST8_MAX INT8_MAX
#define INT_FAST16_MIN INT16_MIN
#define INT_FAST16_MAX INT16_MAX
#define INT_FAST32_MIN INT32_MIN
#define INT_FAST32_MAX INT32_MAX
#define INT_FAST64_MIN INT64_MIN
#define INT_FAST64_MAX INT64_MAX
#define UINT_FAST8_MAX UINT8_MAX
#define UINT_FAST16_MAX UINT16_MAX
#define UINT_FAST32_MAX UINT32_MAX
#define UINT_FAST64_MAX UINT64_MAX
// 7.18.2.4 Limits of integer types capable of holding object pointers
#ifdef _WIN64 // [
# define INTPTR_MIN INT64_MIN
# define INTPTR_MAX INT64_MAX
# define UINTPTR_MAX UINT64_MAX
#else // _WIN64 ][
# define INTPTR_MIN INT32_MIN
# define INTPTR_MAX INT32_MAX
# define UINTPTR_MAX UINT32_MAX
#endif // _WIN64 ]
// 7.18.2.5 Limits of greatest-width integer types
#define INTMAX_MIN INT64_MIN
#define INTMAX_MAX INT64_MAX
#define UINTMAX_MAX UINT64_MAX
// 7.18.3 Limits of other integer types
#ifdef _WIN64 // [
# define PTRDIFF_MIN _I64_MIN
# define PTRDIFF_MAX _I64_MAX
#else // _WIN64 ][
# define PTRDIFF_MIN _I32_MIN
# define PTRDIFF_MAX _I32_MAX
#endif // _WIN64 ]
#define SIG_ATOMIC_MIN INT_MIN
#define SIG_ATOMIC_MAX INT_MAX
#ifndef SIZE_MAX // [
# ifdef _WIN64 // [
# define SIZE_MAX _UI64_MAX
# else // _WIN64 ][
# define SIZE_MAX _UI32_MAX
# endif // _WIN64 ]
#endif // SIZE_MAX ]
// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
#ifndef WCHAR_MIN // [
# define WCHAR_MIN 0
#endif // WCHAR_MIN ]
#ifndef WCHAR_MAX // [
# define WCHAR_MAX _UI16_MAX
#endif // WCHAR_MAX ]
#define WINT_MIN 0
#define WINT_MAX _UI16_MAX
#endif // __STDC_LIMIT_MACROS ]
// 7.18.4 Limits of other integer types
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
// 7.18.4.1 Macros for minimum-width integer constants
#define INT8_C(val) val##i8
#define INT16_C(val) val##i16
#define INT32_C(val) val##i32
#define INT64_C(val) val##i64
#define UINT8_C(val) val##ui8
#define UINT16_C(val) val##ui16
#define UINT32_C(val) val##ui32
#define UINT64_C(val) val##ui64
// 7.18.4.2 Macros for greatest-width integer constants
#define INTMAX_C INT64_C
#define UINTMAX_C UINT64_C
#endif // __STDC_CONSTANT_MACROS ]
#endif // _MSC_STDINT_H_ ]