X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fcommon.h;h=5c86eb16e01967360ccf3bef583e7a35cf66fb84;hb=8e04e2a97ba16fce9ebf7d47a944de2dc40ba453;hp=62a2b1c67411928c8a517d73aec5e2ba675a538c;hpb=7dcb622a0e97c227db598b8b50767bf9e0eaa6bd;p=m6w6%2Flibmemcached diff --git a/libmemcached/common.h b/libmemcached/common.h index 62a2b1c6..5c86eb16 100644 --- a/libmemcached/common.h +++ b/libmemcached/common.h @@ -45,77 +45,122 @@ #include #ifdef __cplusplus -#include -#include -#include -#include -#include +# include +# include +# include +# include +# include +# include +# include #else -#include -#include -#include -#include +# ifdef HAVE_STDLIB_H +# include +# endif +# ifdef HAVE_STDLIB_H +# include +# endif +# include +# include +# ifdef HAVE_ERRNO_H +# include +# endif +# ifdef HAVE_LIMITS_H +# include +# endif #endif -#include -#include -#include -#include -#include +#ifdef HAVE_FCNTL_H +# include +#endif + +#ifdef HAVE_SYS_TYPES_H +# include +#endif + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef HAVE_STRINGS_H +# include +#endif -#include +#ifdef HAVE_DLFCN_H +# include +#endif + +#include #include #include -#include +#include #include #ifdef HAVE_POLL_H -#include +# include #else -#include "poll/poll.h" +# include "poll/poll.h" #endif - #ifdef __cplusplus extern "C" { #endif typedef memcached_return_t (*memcached_server_execute_fn)(memcached_st *ptr, memcached_server_write_instance_st server, void *context); -LIBMEMCACHED_LOCAL -memcached_server_write_instance_st memcached_server_instance_fetch(memcached_st *ptr, uint32_t server_key); - -LIBMEMCACHED_LOCAL -memcached_return_t memcached_server_execute(memcached_st *ptr, - memcached_server_execute_fn callback, - void *context); #ifdef __cplusplus } // extern "C" #endif +#ifdef __cplusplus +org::libmemcached::Instance* 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 #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 +#ifdef __cplusplus #include +#endif #include +#include #ifdef __cplusplus #include #include +#include +#include +#include +#include +#include #endif #include @@ -140,64 +185,21 @@ memcached_return_t memcached_server_execute(memcached_st *ptr, extern "C" { #endif -LIBMEMCACHED_LOCAL -memcached_return_t memcached_connect(memcached_server_write_instance_st ptr); - -LIBMEMCACHED_LOCAL memcached_return_t run_distribution(memcached_st *ptr); -#define memcached_server_response_increment(A) (A)->cursor_active++ -#define memcached_server_response_decrement(A) (A)->cursor_active-- -#define memcached_server_response_reset(A) (A)->cursor_active=0 +#define memcached_server_response_increment(A) (A)->cursor_active_++ +#define memcached_server_response_decrement(A) (A)->cursor_active_-- +#define memcached_server_response_reset(A) (A)->cursor_active_=0 -LIBMEMCACHED_LOCAL -void set_last_disconnected_host(memcached_server_write_instance_st ptr); +#define memcached_instance_response_increment(A) (A)->cursor_active_++ +#define memcached_instance_response_decrement(A) (A)->cursor_active_-- +#define memcached_instance_response_reset(A) (A)->cursor_active_=0 #ifdef __cplusplus -LIBMEMCACHED_LOCAL -memcached_return_t memcached_key_test(const memcached_st& memc, - const char * const *keys, - const size_t *key_length, - size_t number_of_keys); -#endif - -LIBMEMCACHED_LOCAL -memcached_return_t memcached_purge(memcached_server_write_instance_st ptr); - -LIBMEMCACHED_LOCAL - memcached_server_st *__server_create_with(const memcached_st *memc, - memcached_server_write_instance_st host, - const char *hostname, - in_port_t port, - uint32_t weight, - memcached_connection_t type); - - -static inline memcached_return_t memcached_validate_key_length(size_t key_length, bool binary) -{ - if (key_length == 0) - { - return MEMCACHED_BAD_KEY_PROVIDED; - } - - if (binary) - { - if (key_length > 0xffff) - { - return MEMCACHED_BAD_KEY_PROVIDED; - } - } - else - { - if (key_length >= MEMCACHED_MAX_KEY) - { - return MEMCACHED_BAD_KEY_PROVIDED; - } - } - - return MEMCACHED_SUCCESS; } +#endif #ifdef __cplusplus -} +bool memcached_purge(org::libmemcached::Instance*); +org::libmemcached::Instance* memcached_instance_by_position(const memcached_st *ptr, uint32_t server_key); #endif