{
for (uint32_t x= 0; x < memcached_server_count(ptr); x++)
{
- const memcached_server_instance_st *instance=
+ memcached_server_instance_st *instance=
memcached_server_instance_by_position(ptr, x);
for (uint32_t y= 0; y < number_of_callbacks; y++)
return MEMCACHED_SUCCESS;
}
-const memcached_server_st *memcached_server_by_key(const memcached_st *ptr,
- const char *key,
- size_t key_length,
- memcached_return_t *error)
+memcached_server_instance_st *memcached_server_by_key(const memcached_st *ptr,
+ const char *key,
+ size_t key_length,
+ memcached_return_t *error)
{
uint32_t server_key;
- const memcached_server_instance_st *instance;
+ memcached_server_instance_st *instance;
*error= memcached_validate_key_length(key_length,
ptr->flags.binary_protocol);
}
-const char *memcached_server_error(const memcached_server_st *ptr)
-{
- return ptr
- ? ptr->cached_server_error
- : NULL;
-}
-
void memcached_server_error_reset(memcached_server_st *ptr)
{
ptr->cached_server_error[0]= 0;
}
-memcached_server_st *memcached_server_get_last_disconnect(memcached_st *ptr)
+memcached_server_instance_st *memcached_server_get_last_disconnect(const memcached_st *ptr)
{
return ptr->last_disconnected_server;
}
return self->number_of_hosts;
}
-inline const char *memcached_server_name(const memcached_server_st *self)
+inline const char *memcached_server_name(memcached_server_instance_st *self)
{
return self->hostname;
}
-inline in_port_t memcached_server_port(const memcached_server_st *self)
+inline in_port_t memcached_server_port(memcached_server_instance_st *self)
{
return self->port;
}
self->servers= list;
}
-inline uint32_t memcached_server_response_count(const memcached_server_st *self)
+inline uint32_t memcached_server_response_count(memcached_server_instance_st *self)
{
return self->cursor_active;
}
+
+const char *memcached_server_error(memcached_server_instance_st *ptr)
+{
+ return ptr
+ ? ptr->cached_server_error
+ : NULL;
+}
+
uint32_t number_of_callbacks);
LIBMEMCACHED_API
- const memcached_server_st *memcached_server_by_key(const memcached_st *ptr,
- const char *key,
- size_t key_length,
- memcached_return_t *error);
-
-LIBMEMCACHED_API
-const char *memcached_server_error(const memcached_server_st *ptr);
+ memcached_server_instance_st *memcached_server_by_key(const memcached_st *ptr,
+ const char *key,
+ size_t key_length,
+ memcached_return_t *error);
LIBMEMCACHED_API
void memcached_server_error_reset(memcached_server_st *ptr);
memcached_return_t memcached_server_remove(memcached_server_st *st_ptr);
LIBMEMCACHED_API
-memcached_server_st *memcached_server_get_last_disconnect(memcached_st *ptr);
+memcached_server_instance_st *memcached_server_get_last_disconnect(const memcached_st *ptr);
LIBMEMCACHED_API
LIBMEMCACHED_LOCAL
void memcached_server_list_set(memcached_st *self, memcached_server_st *list);
+/**
+ Operations on Single Servers.
+*/
LIBMEMCACHED_API
-uint32_t memcached_server_response_count(const memcached_server_st *self);
+uint32_t memcached_server_response_count(memcached_server_instance_st *self);
LIBMEMCACHED_API
-const char *memcached_server_name(const memcached_server_st *self);
+const char *memcached_server_name(memcached_server_instance_st *self);
LIBMEMCACHED_API
-in_port_t memcached_server_port(const memcached_server_st *self);
+in_port_t memcached_server_port(memcached_server_instance_st *self);
+
+LIBMEMCACHED_API
+const char *memcached_server_error(memcached_server_instance_st *ptr);
+
#ifdef __cplusplus
typedef memcached_return_t (*memcached_execute_fn)(const memcached_st *ptr, memcached_result_st *result, void *context);
-typedef memcached_return_t (*memcached_server_fn)(const memcached_st *ptr, const memcached_server_st *server, void *context);
+typedef memcached_return_t (*memcached_server_fn)(const memcached_st *ptr, memcached_server_instance_st *server, void *context);
/**
Trigger functions.
static test_return_t test_get_last_disconnect(memcached_st *memc)
{
memcached_return_t rc;
- memcached_server_st *disconnected_server;
+ memcached_server_instance_st *disconnected_server;
/* With the working set of server */
const char *key= "marmotte";
disconnected_server = memcached_server_get_last_disconnect(mine);
test_true(disconnected_server != NULL);
- test_true(disconnected_server->port == 9);
- test_true(strncmp(disconnected_server->hostname,"localhost",9) == 0);
+ test_true(memcached_server_port(disconnected_server)== 9);
+ test_true(strncmp(memcached_server_name(disconnected_server),"localhost",9) == 0);
memcached_quit(mine);
memcached_free(mine);