X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fcommon.h;h=897b0969028ec9184980b2d3217f6570edb8c879;hb=f00605dce4a482c8b19ef17c0e79c31238498522;hp=a3e4ea90310b73ae02808babd0142d6886949912;hpb=cc47230b8dfe0bcd31d4f45ca84d2dd35ae360f0;p=awesomized%2Flibmemcached diff --git a/libmemcached/common.h b/libmemcached/common.h index a3e4ea90..897b0969 100644 --- a/libmemcached/common.h +++ b/libmemcached/common.h @@ -42,108 +42,138 @@ #pragma once -#include +#include #ifdef __cplusplus -#include -#include -#include -#include -#include -#include -#include +# include +# include +# include +# include +# include +# include +# include +# include #else -#include -#include -#include -#include -#include -#include +# ifdef HAVE_STDDEF_H +# include +# endif +# ifdef HAVE_STDLIB_H +# include +# endif +# ifdef HAVE_STDLIB_H +# include +# endif +# include +# ifdef HAVE_TIME_H +# include +# endif +# ifdef HAVE_ERRNO_H +# include +# endif +# ifdef HAVE_LIMITS_H +# include +# endif #endif -#include -#include -#include +#ifdef HAVE_SYS_UN_H +# include +#endif -#ifdef HAVE_STRINGS_H -#include +#ifdef HAVE_SYS_TIME_H +# include #endif -#include -#include -#include +#ifdef HAVE_FCNTL_H +# include +#endif -#include -#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif -#ifdef HAVE_POLL_H -#include -#else -#include "poll/poll.h" +#ifdef HAVE_UNISTD_H +# include #endif -#ifdef __cplusplus -extern "C" { +#ifdef HAVE_SYS_SOCKET_H +# include #endif -typedef memcached_return_t (*memcached_server_execute_fn)(memcached_st *ptr, memcached_server_write_instance_st server, void *context); +#ifdef HAVE_STRINGS_H +# include +#endif -#ifdef __cplusplus -} // extern "C" +#ifdef HAVE_DLFCN_H +# include #endif +#if defined(_WIN32) +# include "libmemcached/windows.hpp" +#endif + +#include +#include "libmemcached/watchpoint.h" +#include "libmemcached/is.h" +typedef struct memcached_st Memcached; + +#ifdef HAVE_POLL_H +# include +#else +# include "libmemcached/poll.h" +#endif #ifdef __cplusplus -org::libmemcached::Instance* memcached_instance_fetch(memcached_st *ptr, uint32_t server_key); +memcached_instance_st* memcached_instance_fetch(memcached_st *ptr, uint32_t server_key); #endif -memcached_return_t memcached_server_execute(memcached_st *ptr, - memcached_server_execute_fn callback, - void *context); /* These are private not to be installed headers */ -#include -#include -#include +#include "libmemcached/error.hpp" +#include "libmemcached/memory.h" +#include "libmemcached/io.h" #ifdef __cplusplus -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif -#include -#include -#include -#include -#include +# include "libmemcached/string.hpp" +# include "libmemcached/memcached/protocol_binary.h" +# include "libmemcached/io.hpp" +# include "libmemcached/udp.hpp" +# include "libmemcached/do.hpp" +# include "libmemcached/socket.hpp" +# include "libmemcached/connect.hpp" +# include "libmemcached/allocators.hpp" +# include "libmemcached/hash.hpp" +# include "libmemcached/quit.hpp" +# include "libmemcached/instance.hpp" +# include "libmemcached/server_instance.h" +# include "libmemcached/server.hpp" +# include "libmemcached/flag.hpp" +# include "libmemcached/behavior.hpp" +# include "libmemcached/sasl.hpp" +# include "libmemcached/server_list.hpp" +#endif + +#include "libmemcached/internal.h" +#include "libmemcached/array.h" +#include "libmemcached/libmemcached_probes.h" +#include "libmemcached/byteorder.h" +#include "libmemcached/initialize_query.h" + #ifdef __cplusplus -#include +# include "libmemcached/response.h" +# include "libmemcached/namespace.h" +#else +# include "libmemcached/virtual_bucket.h" #endif -#include -#include #ifdef __cplusplus -#include -#include -#include -#include -#include -#include -#include +# include "libmemcached/backtrace.hpp" +# include "libmemcached/assert.hpp" +# include "libmemcached/server.hpp" +# include "libmemcached/key.hpp" +# include "libmemcached/encoding_key.h" +# include "libmemcached/result.h" +# include "libmemcached/version.hpp" #endif -#include +#include "libmemcached/continuum.hpp" #if !defined(__GNUC__) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96) @@ -167,7 +197,14 @@ extern "C" { memcached_return_t run_distribution(memcached_st *ptr); -#define memcached_server_response_increment(A) (A)->cursor_active_++ +#ifdef __cplusplus +static inline void memcached_server_response_increment(memcached_instance_st* instance) +{ + instance->events(POLLIN); + instance->cursor_active_++; +} +#endif + #define memcached_server_response_decrement(A) (A)->cursor_active_-- #define memcached_server_response_reset(A) (A)->cursor_active_=0 @@ -180,6 +217,6 @@ memcached_return_t run_distribution(memcached_st *ptr); #endif #ifdef __cplusplus -bool memcached_purge(org::libmemcached::Instance*); -org::libmemcached::Instance* memcached_instance_by_position(const memcached_st *ptr, uint32_t server_key); +bool memcached_purge(memcached_instance_st*); +memcached_instance_st* memcached_instance_by_position(const memcached_st *ptr, uint32_t server_key); #endif