check_type("struct msghdr" sys/socket.h)
check_cxx_symbol(abi::__cxa_demangle cxxabi.h)
+check_symbol(ERESTART errno.h)
check_symbol(fcntl fcntl.h)
check_symbol(gettimeofday sys/time.h)
check_symbol(htonll arpa/inet.h)
<check-unused-templates>false</check-unused-templates>
<max-ctu-depth>10</max-ctu-depth>
<includedir>
- <dir name="."/>
+ <dir name="include"/>
+ <dir name="src"/>
</includedir>
<undefines>
<undefine>HARD_MALLOC_TEST</undefine>
</undefines>
<paths>
- <dir name="."/>
+ <dir name="include"/>
+ <dir name="src"/>
</paths>
- <exclude>
- <path name=".git"/>
- <path name=".idea"/>
- <path name=".settings"/>
- <path name="docs"/>
- <path name="libmemcached/csl/parser.cc"/>
- <path name="libmemcached/csl/scanner.cc"/>
- <path name="libmemcached/memcached"/>
- <path name="libtest"/>
- <path name="tests"/>
- </exclude>
</project>
if ((number_of = poll(fds, 1, server->root->connect_timeout)) == SOCKET_ERROR) {
int local_errno = get_socket_errno(); // We cache in case closesocket() modifies errno
switch (local_errno) {
-#ifdef __linux__
+#ifdef HAVE_ERESTART
case ERESTART:
#endif
case EINTR:
return memcached_get_by_key(ptr, NULL, 0, key, key_length, value_length, flags, error);
}
-static memcached_return_t __mget_by_key_real(memcached_st *ptr, const char *group_key,
+static memcached_return_t mget_by_key_real(memcached_st *ptr, const char *group_key,
size_t group_key_length, const char *const *keys,
const size_t *key_length, size_t number_of_keys,
const bool mget_mode);
}
/* Request the key */
- *error = __mget_by_key_real(ptr, group_key, group_key_length, (const char *const *) &key,
- &key_length, 1, false);
+ *error = mget_by_key_real(ptr, group_key, group_key_length, (const char *const *) &key,
+ &key_length, 1, false);
if (ptr) {
assert_msg(ptr->query_id == query_id + 1,
"Programmer error, the query_id was not incremented.");
const size_t *key_length, const size_t number_of_keys,
const bool mget_mode);
-static memcached_return_t __mget_by_key_real(memcached_st *ptr, const char *group_key,
- const size_t group_key_length, const char *const *keys,
+static memcached_return_t mget_by_key_real(memcached_st *ptr, const char *group_key,
+ size_t group_key_length, const char *const *keys,
const size_t *key_length, size_t number_of_keys,
const bool mget_mode) {
bool failures_occured_in_sending = false;
size_t group_key_length, const char *const *keys,
const size_t *key_length, size_t number_of_keys) {
Memcached *ptr = memcached2Memcached(shell);
- return __mget_by_key_real(ptr, group_key, group_key_length, keys, key_length, number_of_keys,
- true);
+ return mget_by_key_real(ptr, group_key, group_key_length, keys, key_length, number_of_keys, true);
}
memcached_return_t memcached_mget_execute(memcached_st *ptr, const char *const *keys,
memcached_instance_st *instance =
memcached_instance_fetch(memc, memcached_server_count(memc) - 1);
- if (__instance_create_with(memc, instance, hostname, port, weight, type) == NULL) {
+ if (instance_create_with(memc, instance, hostname, port, weight, type) == NULL) {
return memcached_set_error(*memc, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT);
}
WATCHPOINT_ASSERT(instance);
memcached_string_t hostname = {memcached_string_make_from_cstr(list[x].hostname)};
- if (__instance_create_with(ptr, instance, hostname, list[x].port, list[x].weight,
- list[x].type)
+ if (instance_create_with(ptr, instance, hostname, list[x].port, list[x].weight, list[x].type)
== NULL)
{
ptr->state.is_parsing = false;
WATCHPOINT_ASSERT(instance);
memcached_string_t hostname = {memcached_string_make_from_cstr(list[x]._hostname)};
- if (__instance_create_with(ptr, instance, hostname, list[x].port(), list[x].weight,
- list[x].type)
+ if (instance_create_with(ptr, instance, hostname, list[x].port(), list[x].weight, list[x].type)
== NULL)
{
ptr->state.is_parsing = false;
_events &= short(~arg);
}
-memcached_instance_st *__instance_create_with(memcached_st *memc, memcached_instance_st *self,
- const memcached_string_t &hostname,
+memcached_instance_st *instance_create_with(memcached_st *memc, memcached_instance_st *self,
+ const memcached_string_t &_hostname,
const in_port_t port, uint32_t weight,
const memcached_connection_t type) {
- if (memcached_is_valid_servername(hostname) == false) {
+ if (memcached_is_valid_servername(_hostname) == false) {
memcached_set_error(*memc, MEMCACHED_INVALID_ARGUMENTS, MEMCACHED_AT,
memcached_literal_param("Invalid hostname provided"));
return NULL;
return NULL;
}
- _server_init(self, const_cast<memcached_st *>(memc), hostname, port, weight, type);
+ _server_init(self, const_cast<memcached_st *>(memc), _hostname, port, weight, type);
if (memc and memcached_is_udp(memc)) {
self->write_buffer_offset = UDP_DATAGRAM_HEADER_LENGTH;
return self;
}
-void __instance_free(memcached_instance_st *self) {
+void instance_free(memcached_instance_st *self) {
memcached_quit_server(self, false);
self->clear_addrinfo();
void memcached_instance_free(memcached_instance_st *self) {
if (self) {
- __instance_free(self);
+ instance_free(self);
}
}
}
memcached_string_t hostname_ = {memcached_string_make_from_cstr(source->hostname())};
- return __instance_create_with(source->root, NULL, hostname_, source->port(), source->weight,
- source->type);
+ return instance_create_with(source->root, NULL, hostname_, source->port(), source->weight,
+ source->type);
}
void set_last_disconnected_host(memcached_instance_st *self) {
}
};
-memcached_instance_st *__instance_create_with(memcached_st *memc, memcached_instance_st *self,
+memcached_instance_st *instance_create_with(memcached_st *memc, memcached_instance_st *self,
const memcached_string_t &_hostname,
const in_port_t port, uint32_t weight,
const memcached_connection_t type);
memcached_return_t memcached_instance_push(memcached_st *ptr, const memcached_instance_st *,
uint32_t);
-void __instance_free(memcached_instance_st *);
+void instance_free(memcached_instance_st *);
case EWOULDBLOCK:
#endif
case EAGAIN:
-#ifdef __linux
+#ifdef HAVE_ERESTART
case ERESTART:
#endif
break; // No IO is fine, we can just move on
int local_errno = get_socket_errno(); // We cache in case memcached_quit_server() modifies errno
assert_msg(active_fd == -1, "poll() returned an unexpected value");
switch (local_errno) {
-#ifdef __linux
+#ifdef ERESTART
case ERESTART:
#endif
case EINTR:
case EWOULDBLOCK:
#endif
case EAGAIN:
-#ifdef __linux
+#ifdef HAVE_ERESTART
case ERESTART:
#endif
{
case EWOULDBLOCK:
#endif
case EAGAIN:
-#ifdef __linux
+#ifdef ERESTART
case ERESTART:
#endif
if (memcached_success(io_wait(instance, POLLIN))) {
return true;
}
-static void __memcached_free(Memcached *ptr, bool release_st) {
+static void memcached_free_ex(Memcached *ptr, bool release_st) {
/* If we have anything open, lets close it now */
send_quit(ptr);
memcached_instance_list_free(memcached_instance_list(ptr), memcached_instance_list_count(ptr));
bool stored_is_allocated = memcached_is_allocated(ptr);
uint64_t query_id = ptr->query_id;
- __memcached_free(ptr, false);
+ memcached_free_ex(ptr, false);
memcached_create(ptr);
memcached_set_allocated(ptr, stored_is_allocated);
ptr->query_id = query_id;
void memcached_free(memcached_st *ptr) {
if (ptr) {
- __memcached_free(ptr, true);
+ memcached_free_ex(ptr, true);
}
}
#include "libmemcached/common.h"
-#define memcached_set_purging(__object, __value) ((__object)->state.is_purging = (__value))
+#define memcached_set_purging(object_, value_) ((object_)->state.is_purging = (value_))
class Purge {
public:
return self;
}
-memcached_server_st *__server_create_with(Memcached *memc, memcached_server_st *allocated_instance,
+memcached_server_st *server_create_with(Memcached *memc, memcached_server_st *self,
const memcached_string_t &hostname, const in_port_t port,
uint32_t weight, const memcached_connection_t type) {
if (memcached_is_valid_servername(hostname) == false) {
return NULL;
}
- allocated_instance = _server_create(allocated_instance, memc);
+ self = _server_create(self, memc);
- if (allocated_instance == NULL) {
+ if (self == NULL) {
return NULL;
}
- _server_init(allocated_instance, const_cast<Memcached *>(memc), hostname, port, weight, type);
+ _server_init(self, const_cast<Memcached *>(memc), hostname, port, weight, type);
- return allocated_instance;
+ return self;
}
-void __server_free(memcached_server_st *self) {
+void server_free(memcached_server_st *self) {
memcached_error_free(*self);
if (memcached_is_allocated(self)) {
return;
}
- __server_free(self);
+ server_free(self);
}
void memcached_server_error_reset(memcached_server_st *self) {
#include <cassert>
-memcached_server_st *__server_create_with(memcached_st *memc, memcached_server_st *self,
+memcached_server_st *server_create_with(memcached_st *memc, memcached_server_st *self,
const memcached_string_t &hostname, const in_port_t port,
uint32_t weight, const memcached_connection_t type);
size_t hostname_length, in_port_t port,
uint32_t weight);
-void __server_free(memcached_server_st *);
+void server_free(memcached_server_st *);
static inline bool memcached_is_valid_servername(const memcached_string_t &arg) {
return (arg.c_str != NULL or arg.size == 0) and arg.size < MEMCACHED_NI_MAXHOST;
memcached_string_t _hostname = {memcached_string_make_from_cstr(hostname)};
/* @todo Check return type */
- if (__server_create_with(NULL, &new_host_list[count - 1], _hostname, port, weight,
- port ? MEMCACHED_CONNECTION_TCP : MEMCACHED_CONNECTION_UNIX_SOCKET)
+ if (server_create_with(NULL, &new_host_list[count - 1], _hostname, port, weight,
+ port ? MEMCACHED_CONNECTION_TCP : MEMCACHED_CONNECTION_UNIX_SOCKET)
== NULL)
{
#if 0
}
#if 0
- // Handset allocated since
+ // Handset allocated since
new_host_list->options.is_allocated= true;
#endif
assert_msg(not memcached_is_allocated(&self[x]),
"You have called memcached_server_list_free(), but you did not pass it a valid "
"memcached_server_list_st");
- __server_free(&self[x]);
+ server_free(&self[x]);
}
libmemcached_free(self->root, self);
assert_msg(memcached_is_allocated(&self[x]) == false,
"You have called memcached_server_list_free(), but you did not pass it a valid "
"memcached_server_list_st");
- __instance_free(&self[x]);
+ instance_free(&self[x]);
}
libmemcached_free(self->root, self);
#define INORDER (int)1
#ifndef __CYGWIN__
-#define __progname __argv[0]
+#define progname __argv[0]
#else
extern char __declspec(dllimport) *__progname;
#endif
static void
_vwarnx(const char *fmt,va_list ap)
{
- (void)fprintf(stderr,"%s: ",__progname);
+ (void)fprintf(stderr,"%s: ", progname);
if (fmt != NULL)
(void)vfprintf(stderr,fmt,ap);
(void)fprintf(stderr,"\n");