X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fcommon.h;h=30fc4e12a9fbfb6203075b55b948dcd4af523b3d;hb=f6c04131cc9952372e3f63de2db4edc9f8181fb2;hp=7942b27a34011bf96d18887779754a6f78c47866;hpb=17e0b84e30fe82f6a2a995484a502179c73906ea;p=m6w6%2Flibmemcached diff --git a/libmemcached/common.h b/libmemcached/common.h index 7942b27a..30fc4e12 100644 --- a/libmemcached/common.h +++ b/libmemcached/common.h @@ -48,6 +48,7 @@ #include "libmemcached/memcached_internal.h" #include "libmemcached/libmemcached_probes.h" #include "libmemcached/memcached/protocol_binary.h" +#include "libmemcached/byteorder.h" /* string value */ struct memcached_continuum_item_st { @@ -135,28 +136,22 @@ LIBMEMCACHED_LOCAL void server_list_free(memcached_st *ptr, memcached_server_st *servers); LIBMEMCACHED_LOCAL -memcached_return memcached_key_test(const char **keys, size_t *key_length, - unsigned int number_of_keys); +memcached_return memcached_key_test(const char * const *keys, + const size_t *key_length, + size_t number_of_keys); LIBMEMCACHED_LOCAL uint32_t generate_hash(memcached_st *ptr, const char *key, size_t key_length); -#ifndef HAVE_HTONLL -LIBMEMCACHED_LOCAL -extern uint64_t ntohll(uint64_t); -LIBMEMCACHED_LOCAL -extern uint64_t htonll(uint64_t); -#endif - LIBMEMCACHED_LOCAL memcached_return memcached_purge(memcached_server_st *ptr); -static inline memcached_return memcached_validate_key_length(size_t key_length, +static inline memcached_return memcached_validate_key_length(size_t key_length, bool binary) { unlikely (key_length == 0) return MEMCACHED_BAD_KEY_PROVIDED; - + if (binary) { unlikely (key_length > 0xffff) @@ -164,7 +159,7 @@ static inline memcached_return memcached_validate_key_length(size_t key_length, } else { - unlikely (key_length >= MEMCACHED_MAX_KEY) + unlikely (key_length >= MEMCACHED_MAX_KEY) return MEMCACHED_BAD_KEY_PROVIDED; }