From: Brian Aker Date: Sun, 14 Feb 2010 02:37:23 +0000 (-0800) Subject: File shuffling X-Git-Tag: 0.40~42 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=77fe608489d91a0271efe8170ba97c44d51e346b;p=m6w6%2Flibmemcached File shuffling --- diff --git a/libmemcached/include.am b/libmemcached/include.am index 6dc3d705..737c5e12 100644 --- a/libmemcached/include.am +++ b/libmemcached/include.am @@ -45,6 +45,7 @@ nobase_include_HEADERS+= \ libmemcached/quit.h \ libmemcached/result.h \ libmemcached/server.h \ + libmemcached/server_list.h \ libmemcached/stats.h \ libmemcached/storage.h \ libmemcached/strerror.h \ diff --git a/libmemcached/memcached.h b/libmemcached/memcached.h index a934c5a2..1c9d12c2 100644 --- a/libmemcached/memcached.h +++ b/libmemcached/memcached.h @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -155,6 +156,11 @@ memcached_return_t memcached_push(memcached_st *destination, const memcached_st LIBMEMCACHED_API memcached_server_instance_st memcached_server_instance_by_position(const memcached_st *ptr, uint32_t server_key); +LIBMEMCACHED_API +uint32_t memcached_server_count(const memcached_st *); + + + LIBMEMCACHED_LOCAL void server_list_free(memcached_st *ptr, memcached_server_st *servers); diff --git a/libmemcached/server.h b/libmemcached/server.h index 2fc25f69..c3e3672b 100644 --- a/libmemcached/server.h +++ b/libmemcached/server.h @@ -107,41 +107,6 @@ LIBMEMCACHED_API memcached_return_t memcached_server_add_with_weight(memcached_st *ptr, const char *hostname, in_port_t port, uint32_t weight); -/* Server List Public functions */ - -LIBMEMCACHED_API -void memcached_server_list_free(memcached_server_st *ptr); - - -LIBMEMCACHED_API -memcached_return_t memcached_server_push(memcached_st *ptr, const memcached_server_st *list); - -LIBMEMCACHED_API -memcached_server_st *memcached_server_list_append(memcached_server_st *ptr, - const char *hostname, - in_port_t port, - memcached_return_t *error); -LIBMEMCACHED_API -memcached_server_st *memcached_server_list_append_with_weight(memcached_server_st *ptr, - const char *hostname, - in_port_t port, - uint32_t weight, - memcached_return_t *error); -LIBMEMCACHED_API -uint32_t memcached_server_list_count(const memcached_server_st *ptr); - -LIBMEMCACHED_API -uint32_t memcached_server_count(const memcached_st *); - - -LIBMEMCACHED_LOCAL -uint32_t memcached_servers_set_count(memcached_server_st *servers, uint32_t count); - -LIBMEMCACHED_API -memcached_server_st *memcached_server_list(memcached_st *); - -LIBMEMCACHED_LOCAL -void memcached_server_list_set(memcached_st *self, memcached_server_st *list); /** Operations on Single Servers. diff --git a/libmemcached/server_list.h b/libmemcached/server_list.h new file mode 100644 index 00000000..a4b90b9f --- /dev/null +++ b/libmemcached/server_list.h @@ -0,0 +1,53 @@ +/* LibMemcached + * Copyright (C) 2006-2009 Brian Aker + * All rights reserved. + * + * Use and distribution licensed under the BSD license. See + * the COPYING file in the parent directory for full text. + * + * Summary: Types for libmemcached + * + */ + +#ifndef __LIBMEMCACHED_SERVER_LIST_H__ +#define __LIBMEMCACHED_SERVER_LIST_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Server List Public functions */ +LIBMEMCACHED_API +void memcached_server_list_free(memcached_server_st *ptr); + +LIBMEMCACHED_API +memcached_return_t memcached_server_push(memcached_st *ptr, const memcached_server_st *list); + +LIBMEMCACHED_API +memcached_server_st *memcached_server_list_append(memcached_server_st *ptr, + const char *hostname, + in_port_t port, + memcached_return_t *error); +LIBMEMCACHED_API +memcached_server_st *memcached_server_list_append_with_weight(memcached_server_st *ptr, + const char *hostname, + in_port_t port, + uint32_t weight, + memcached_return_t *error); +LIBMEMCACHED_API +uint32_t memcached_server_list_count(const memcached_server_st *ptr); + +LIBMEMCACHED_LOCAL +uint32_t memcached_servers_set_count(memcached_server_st *servers, uint32_t count); + +LIBMEMCACHED_API +memcached_server_st *memcached_server_list(memcached_st *); + +LIBMEMCACHED_LOCAL +void memcached_server_list_set(memcached_st *self, memcached_server_st *list); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif /* __LIBMEMCACHED_SERVER_LIST_H__ */