LIBMEMCACHED_API
void memcached_server_free(memcached_server_st *ptr);
-LIBMEMCACHED_LOCAL
-memcached_server_st *memcached_server_clone(memcached_server_st *destination,
- memcached_server_st *source);
-
LIBMEMCACHED_API
memcached_server_instance_st memcached_server_get_last_disconnect(const memcached_st *ptr);
memcached_return_t memcached_server_add(memcached_st *ptr,
const char *hostname, in_port_t port);
-LIBMEMCACHED_LOCAL
- memcached_return_t memcached_server_add_parsed(memcached_st *ptr,
- const char *hostname,
- size_t hostname_length,
- in_port_t port,
- uint32_t weight);
-
LIBMEMCACHED_API
memcached_return_t memcached_server_add_udp_with_weight(memcached_st *ptr,
const char *hostname,
LIBMEMCACHED_API
const char *memcached_server_type(const memcached_server_instance_st ptr);
-
-LIBMEMCACHED_LOCAL
-void __server_free(memcached_server_st *);
-
#ifdef __cplusplus
} // extern "C"
#endif
#include <libmemcached/io.hpp>
#include <libmemcached/do.hpp>
#include <libmemcached/close_socket.hpp>
+#include <libmemcached/connect.hpp>
#endif
#include <libmemcached/internal.h>
#include <libmemcached/array.h>
return memcached_set_errno(*server, get_socket_errno(), MEMCACHED_AT);
}
-static memcached_return_t set_hostinfo(memcached_server_st *server)
+memcached_return_t set_hostinfo(memcached_server_st *server)
{
if (server->address_info)
{
--- /dev/null
+/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ *
+ * Libmemcached library
+ *
+ * Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * The names of its contributors may not be used to endorse or
+ * promote products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+
+#pragma once
+
+memcached_return_t set_hostinfo(memcached_server_st *server);
{
memcached_return_t unused;
if (error == NULL)
+ {
error= &unused;
+ }
- unlikely (ptr->flags.use_udp)
+ if (ptr->flags.use_udp)
{
if (value_length)
+ {
*value_length= 0;
+ }
*error= memcached_set_error(*ptr, MEMCACHED_NOT_SUPPORTED, MEMCACHED_AT);
return NULL;
libmemcached/assert.hpp \
libmemcached/backtrace.hpp \
libmemcached/byteorder.h \
+ libmemcached/close_socket.hpp \
libmemcached/common.h \
+ libmemcached/connect.hpp \
libmemcached/continuum.hpp \
- libmemcached/close_socket.hpp \
libmemcached/do.hpp \
libmemcached/error.hpp \
libmemcached/initialize_query.h \
return memcached_set_error(*self, MEMCACHED_NO_SERVERS, MEMCACHED_AT);
}
+ memcached_error_free(*self);
+
return MEMCACHED_SUCCESS;
}
memcached_return_t initialize_const_query(const memcached_st *self)
{
- if (not self)
+ if (self == NULL)
{
return MEMCACHED_INVALID_ARGUMENTS;
}
memcached_io_init_udp_header(self, 0);
}
+ if (memc)
+ {
+ set_hostinfo(self);
+ }
+
return self;
}
hostname,
source->port, source->weight,
source->type);
- if (destination)
- {
- if (source->error_messages)
- {
- destination->error_messages= memcached_error_copy(*source);
- }
- }
-
return destination;
}
#include <cassert>
+memcached_server_st *__server_create_with(memcached_st *memc,
+ memcached_server_write_instance_st host,
+ const memcached_string_t& hostname,
+ const in_port_t port,
+ uint32_t weight,
+ const memcached_connection_t type);
+
+memcached_server_st *memcached_server_clone(memcached_server_st *destination,
+ memcached_server_st *source);
+
+memcached_return_t memcached_server_add_parsed(memcached_st *ptr,
+ const char *hostname,
+ size_t hostname_length,
+ in_port_t port,
+ uint32_t weight);
+
+void __server_free(memcached_server_st *);
+
static inline bool memcached_is_valid_servername(const memcached_string_t& arg)
{
return arg.size > 0 or arg.size < NI_MAXHOST;
set_last_disconnected_host(server);
}
}
-
-LIBMEMCACHED_LOCAL
- memcached_server_st *__server_create_with(memcached_st *memc,
- memcached_server_write_instance_st host,
- const memcached_string_t& hostname,
- const in_port_t port,
- uint32_t weight,
- const memcached_connection_t type);
set environment LIBTEST_IN_GDB=1
run
+quit