/** \file */
/*
* ***** BEGIN LICENSE BLOCK *****
* Version: MIT
*
* Portions created by Alan Antonuk are Copyright (c) 2012-2014
* Alan Antonuk. All Rights Reserved.
*
* Portions created by VMware are Copyright (c) 2007-2012 VMware, Inc.
* All Rights Reserved.
*
* Portions created by Tony Garnock-Jones are Copyright (c) 2009-2010
* VMware, Inc. and Tony Garnock-Jones. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* 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.
* ***** END LICENSE BLOCK *****
*/
#ifndef AMQP_H
#define AMQP_H
/** \cond HIDE_FROM_DOXYGEN */
#ifdef __cplusplus
#define AMQP_BEGIN_DECLS extern "C" {
#define AMQP_END_DECLS }
#else
#define AMQP_BEGIN_DECLS
#define AMQP_END_DECLS
#endif
/*
* \internal
* Important API decorators:
* AMQP_PUBLIC_FUNCTION - a public API function
* AMQP_PUBLIC_VARIABLE - a public API external variable
* AMQP_CALL - calling convension (used on Win32)
*/
#if defined(_WIN32) && defined(_MSC_VER)
#if defined(AMQP_BUILD) && !defined(AMQP_STATIC)
#define AMQP_PUBLIC_FUNCTION __declspec(dllexport)
#define AMQP_PUBLIC_VARIABLE __declspec(dllexport) extern
#else
#define AMQP_PUBLIC_FUNCTION
#if !defined(AMQP_STATIC)
#define AMQP_PUBLIC_VARIABLE __declspec(dllimport) extern
#else
#define AMQP_PUBLIC_VARIABLE extern
#endif
#endif
#define AMQP_CALL __cdecl
#elif defined(_WIN32) && defined(__BORLANDC__)
#if defined(AMQP_BUILD) && !defined(AMQP_STATIC)
#define AMQP_PUBLIC_FUNCTION __declspec(dllexport)
#define AMQP_PUBLIC_VARIABLE __declspec(dllexport) extern
#else
#define AMQP_PUBLIC_FUNCTION
#if !defined(AMQP_STATIC)
#define AMQP_PUBLIC_VARIABLE __declspec(dllimport) extern
#else
#define AMQP_PUBLIC_VARIABLE extern
#endif
#endif
#define AMQP_CALL __cdecl
#elif defined(_WIN32) && defined(__MINGW32__)
#if defined(AMQP_BUILD) && !defined(AMQP_STATIC)
#define AMQP_PUBLIC_FUNCTION __declspec(dllexport)
#define AMQP_PUBLIC_VARIABLE __declspec(dllexport) extern
#else
#define AMQP_PUBLIC_FUNCTION
#if !defined(AMQP_STATIC)
#define AMQP_PUBLIC_VARIABLE __declspec(dllimport) extern
#else
#define AMQP_PUBLIC_VARIABLE extern
#endif
#endif
#define AMQP_CALL __cdecl
#elif defined(_WIN32) && defined(__CYGWIN__)
#if defined(AMQP_BUILD) && !defined(AMQP_STATIC)
#define AMQP_PUBLIC_FUNCTION __declspec(dllexport)
#define AMQP_PUBLIC_VARIABLE __declspec(dllexport)
#else
#define AMQP_PUBLIC_FUNCTION
#if !defined(AMQP_STATIC)
#define AMQP_PUBLIC_VARIABLE __declspec(dllimport) extern
#else
#define AMQP_PUBLIC_VARIABLE extern
#endif
#endif
#define AMQP_CALL __cdecl
#elif defined(__GNUC__) && __GNUC__ >= 4
#define AMQP_PUBLIC_FUNCTION __attribute__((visibility("default")))
#define AMQP_PUBLIC_VARIABLE __attribute__((visibility("default"))) extern
#define AMQP_CALL
#else
#define AMQP_PUBLIC_FUNCTION
#define AMQP_PUBLIC_VARIABLE extern
#define AMQP_CALL
#endif
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
#define AMQP_DEPRECATED(function) function __attribute__((__deprecated__))
#elif defined(_MSC_VER)
#define AMQP_DEPRECATED(function) __declspec(deprecated) function
#else
#define AMQP_DEPRECATED(function)
#endif
/* Define ssize_t on Win32/64 platforms
See: http://lists.cs.uiuc.edu/pipermail/llvmdev/2010-April/030649.html for
details
*/
#if !defined(_W64)
#if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
#define _W64 __w64
#else
#define _W64
#endif
#endif
#ifdef _MSC_VER
#ifdef _WIN64
typedef __int64 ssize_t;
#else
typedef _W64 int ssize_t;
#endif
#endif
#if defined(_WIN32) && defined(__MINGW32__)
#include <sys/types.h>
#endif
/** \endcond */
#include <stddef.h>
#include <stdint.h>
struct timeval;
AMQP_BEGIN_DECLS
/**
* \def AMQP_VERSION_MAJOR
*
* Major library version number compile-time constant
*
* The major version is incremented when backwards incompatible API changes
* are made.
*
* \sa AMQP_VERSION, AMQP_VERSION_STRING
*
* \since v0.4.0
*/
/**
* \def AMQP_VERSION_MINOR
*
* Minor library version number compile-time constant
*
* The minor version is incremented when new APIs are added. Existing APIs
* are left alone.
*
* \sa AMQP_VERSION, AMQP_VERSION_STRING
*
* \since v0.4.0
*/
/**
* \def AMQP_VERSION_PATCH
*
* Patch library version number compile-time constant
*
* The patch version is incremented when library code changes, but the API
* is not changed.
*
* \sa AMQP_VERSION, AMQP_VERSION_STRING
*
* \since v0.4.0
*/
/**
* \def AMQP_VERSION_IS_RELEASE
*
* Version constant set to 1 for tagged release, 0 otherwise
*
* NOTE: versions that are not tagged releases are not guaranteed to be API/ABI
* compatible with older releases, and may change commit-to-commit.
*
* \sa AMQP_VERSION, AMQP_VERSION_STRING
*
* \since v0.4.0
*/
/*
* Developer note: when changing these, be sure to update SOVERSION constants
* in CMakeLists.txt and configure.ac
*/
#define AMQP_VERSION_MAJOR 0
#define AMQP_VERSION_MINOR 10
#define AMQP_VERSION_PATCH 0
#define AMQP_VERSION_IS_RELEASE 1
/**
* \def AMQP_VERSION_CODE
*
* Helper macro to geneate a packed version code suitable for
* comparison with AMQP_VERSION.
*
* \sa amqp_version_number() AMQP_VERSION_MAJOR, AMQP_VERSION_MINOR,
* AMQP_VERSION_PATCH, AMQP_VERSION_IS_RELEASE, AMQP_VERSION
*
* \since v0.6.1
*/
#define AMQP_VERSION_CODE(major, minor, patch, release) \
((major << 24) | (minor << 16) | (patch << 8) | (release))
/**
* \def AMQP_VERSION
*
* Packed version number
*
* AMQP_VERSION is a 4-byte unsigned integer with the most significant byte
* set to AMQP_VERSION_MAJOR, the second most significant byte set to
* AMQP_VERSION_MINOR, third most significant byte set to AMQP_VERSION_PATCH,
* and the lowest byte set to AMQP_VERSION_IS_RELEASE.
*
* For example version 2.3.4 which is released version would be encoded as
* 0x02030401
*
* \sa amqp_version_number() AMQP_VERSION_MAJOR, AMQP_VERSION_MINOR,
* AMQP_VERSION_PATCH, AMQP_VERSION_IS_RELEASE, AMQP_VERSION_CODE
*
* \since v0.4.0
*/
#define AMQP_VERSION \
AMQP_VERSION_CODE(AMQP_VERSION_MAJOR, AMQP_VERSION_MINOR, \
AMQP_VERSION_PATCH, AMQP_VERSION_IS_RELEASE)
/** \cond HIDE_FROM_DOXYGEN */
#define AMQ_STRINGIFY(s) AMQ_STRINGIFY_HELPER(s)
#define AMQ_STRINGIFY_HELPER(s) #s
#define AMQ_VERSION_STRING \
AMQ_STRINGIFY(AMQP_VERSION_MAJOR) \
"." AMQ_STRINGIFY(AMQP_VERSION_MINOR) "." AMQ_STRINGIFY(AMQP_VERSION_PATCH)
/** \endcond */
/**
* \def AMQP_VERSION_STRING
*
* Version string compile-time constant
*
* Non-released versions of the library will have "-pre" appended to the
* version string
*
* \sa amqp_version()
*
* \since v0.4.0
*/
#if AMQP_VERSION_IS_RELEASE
#define AMQP_VERSION_STRING AMQ_VERSION_STRING
#else
#define AMQP_VERSION_STRING AMQ_VERSION_STRING "-pre"
#endif
/**
* Returns the rabbitmq-c version as a packed integer.
*
* See \ref AMQP_VERSION
*
* \return packed 32-bit integer representing version of library at