X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fcommon.h;h=f7559376910fc52897b30654bc665f65a266c6fe;hb=09b4ff9a9b7c62b4511ab10c9305eba757fea34b;hp=d4b2c7df3446660f26307541ec29a3560068767d;hpb=3e4c141a6b0ec12b668143a26ecf01da5c151931;p=m6w6%2Flibmemcached diff --git a/libmemcached/common.h b/libmemcached/common.h index d4b2c7df..f7559376 100644 --- a/libmemcached/common.h +++ b/libmemcached/common.h @@ -49,31 +49,43 @@ #include #include #include -#include +#include +#include +#include #else #include #include #include #include +#include +#include #endif -#include #include -#include #include #include -#include +#ifdef HAVE_STRINGS_H +#include +#endif + +#include #include #include -#include + +#include + +#ifdef HAVE_POLL_H +#include +#else +#include "poll/poll.h" +#endif + #ifdef __cplusplus extern "C" { #endif -typedef struct memcached_server_st * memcached_server_write_instance_st; - typedef memcached_return_t (*memcached_server_execute_fn)(memcached_st *ptr, memcached_server_write_instance_st server, void *context); LIBMEMCACHED_LOCAL @@ -92,27 +104,43 @@ memcached_return_t memcached_server_execute(memcached_st *ptr, #include #include #include +#ifdef __cplusplus +#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 #endif -/* string value */ -struct memcached_continuum_item_st -{ - uint32_t index; - uint32_t value; -}; +#include #if !defined(__GNUC__) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96) @@ -134,9 +162,6 @@ struct memcached_continuum_item_st 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); @@ -144,54 +169,9 @@ memcached_return_t run_distribution(memcached_st *ptr); #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); - -#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; -} - #ifdef __cplusplus } #endif