X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fserver.h;h=10fa811cf87d626947c640805fdc007e6ed664b2;hb=85062bec3fe9000e4da8e0a08cea88ebbccc20b2;hp=66a23a56f28371adae5407d4b5f934ef866447be;hpb=95fd67da4903671adb5731b710798843938e8536;p=m6w6%2Flibmemcached diff --git a/libmemcached/server.h b/libmemcached/server.h index 66a23a56..10fa811c 100644 --- a/libmemcached/server.h +++ b/libmemcached/server.h @@ -1,5 +1,5 @@ /* LibMemcached - * Copyright (C) 2006-2009 Brian Aker + * Copyright (C) 2006-2009 Brian Aker * All rights reserved. * * Use and distribution licensed under the BSD license. See @@ -19,9 +19,9 @@ extern "C" { struct memcached_server_st { struct { bool is_allocated:1; + bool sockaddr_inited:1; } options; - bool sockaddr_inited; - uint16_t count; + uint32_t number_of_hosts; uint32_t cursor_active; in_port_t port; int cached_errno; @@ -47,6 +47,20 @@ struct memcached_server_st { char hostname[MEMCACHED_MAX_HOST_LENGTH]; }; +// Local Only Inline +static inline uint32_t memcached_servers_count(memcached_server_st *servers) +{ + return servers->number_of_hosts; +} + +// Local Only Inline +static inline uint32_t memcached_servers_set_count(memcached_server_st *servers, uint32_t count) +{ + return servers->number_of_hosts= count; +} + + + #define memcached_server_count(A) (A)->number_of_hosts #define memcached_server_name(A,B) (B).hostname #define memcached_server_port(A,B) (B).port @@ -74,10 +88,10 @@ void memcached_server_error_reset(memcached_server_st *ptr); /* These should not currently be used by end users */ /* TODO: Is the above comment valid? If so, how can we unit test these if they * aren't exported. If not, we should remove the comment */ -LIBMEMCACHED_API +LIBMEMCACHED_LOCAL memcached_server_st *memcached_server_create(memcached_st *memc, memcached_server_st *ptr); -LIBMEMCACHED_API +LIBMEMCACHED_LOCAL memcached_server_st *memcached_server_create_with(memcached_st *memc, memcached_server_st *host, const char *hostname, @@ -88,7 +102,7 @@ memcached_server_st *memcached_server_create_with(memcached_st *memc, LIBMEMCACHED_API void memcached_server_free(memcached_server_st *ptr); -LIBMEMCACHED_API +LIBMEMCACHED_LOCAL memcached_server_st *memcached_server_clone(memcached_server_st *clone, memcached_server_st *ptr);