projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Fix issues that Trond found.
[m6w6/libmemcached]
/
libmemcached
/
common.h
diff --git
a/libmemcached/common.h
b/libmemcached/common.h
index b8deac8e558474a621624b33307cfba1f0472334..f45eaffd4474894390f8d1142eb2796cdcefb61d 100644
(file)
--- a/
libmemcached/common.h
+++ b/
libmemcached/common.h
@@
-63,16
+63,28
@@
#include <sys/types.h>
#include <unistd.h>
#include <sys/types.h>
#include <unistd.h>
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+
#include <libmemcached/memcached.h>
#include <libmemcached/watchpoint.h>
#include <libmemcached/is.h>
#include <libmemcached/memcached.h>
#include <libmemcached/watchpoint.h>
#include <libmemcached/is.h>
+#include <libmemcached/namespace.h>
+
+#include <libmemcached/server_instance.h>
+
+#ifdef HAVE_POLL_H
+#include <poll.h>
+#else
+#include "poll/poll.h"
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
extern "C" {
#endif
-typedef struct memcached_server_st * memcached_server_write_instance_st;
-
typedef memcached_return_t (*memcached_server_execute_fn)(memcached_st *ptr, memcached_server_write_instance_st server, void *context);
LIBMEMCACHED_LOCAL
typedef memcached_return_t (*memcached_server_execute_fn)(memcached_st *ptr, memcached_server_write_instance_st server, void *context);
LIBMEMCACHED_LOCAL
@@
-91,7
+103,11
@@
memcached_return_t memcached_server_execute(memcached_st *ptr,
#include <libmemcached/error.hpp>
#include <libmemcached/memory.h>
#include <libmemcached/io.h>
#include <libmemcached/error.hpp>
#include <libmemcached/memory.h>
#include <libmemcached/io.h>
-#include <libmemcached/do.h>
+#ifdef __cplusplus
+#include <libmemcached/string.hpp>
+#include <libmemcached/io.hpp>
+#include <libmemcached/do.hpp>
+#endif
#include <libmemcached/internal.h>
#include <libmemcached/array.h>
#include <libmemcached/libmemcached_probes.h>
#include <libmemcached/internal.h>
#include <libmemcached/array.h>
#include <libmemcached/libmemcached_probes.h>
@@
-99,14
+115,15
@@
memcached_return_t memcached_server_execute(memcached_st *ptr,
#include <libmemcached/byteorder.h>
#include <libmemcached/initialize_query.h>
#include <libmemcached/response.h>
#include <libmemcached/byteorder.h>
#include <libmemcached/initialize_query.h>
#include <libmemcached/response.h>
-#include <libmemcached/
prefix_key
.h>
+#include <libmemcached/
namespace
.h>
-/* string value */
-struct memcached_continuum_item_st
-{
- uint32_t index;
- uint32_t value;
-};
+#ifdef __cplusplus
+#include <libmemcached/backtrace.hpp>
+#include <libmemcached/assert.hpp>
+#include <libmemcached/server.hpp>
+#endif
+
+#include <libmemcached/continuum.hpp>
#if !defined(__GNUC__) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
#if !defined(__GNUC__) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
@@
-141,37
+158,38
@@
memcached_return_t run_distribution(memcached_st *ptr);
LIBMEMCACHED_LOCAL
void set_last_disconnected_host(memcached_server_write_instance_st ptr);
LIBMEMCACHED_LOCAL
void set_last_disconnected_host(memcached_server_write_instance_st ptr);
+#ifdef __cplusplus
LIBMEMCACHED_LOCAL
LIBMEMCACHED_LOCAL
-memcached_return_t memcached_key_test(const char * const *keys,
+memcached_return_t memcached_key_test(const memcached_st& memc,
+ const char * const *keys,
const size_t *key_length,
size_t number_of_keys);
const size_t *key_length,
size_t number_of_keys);
+#endif
LIBMEMCACHED_LOCAL
memcached_return_t memcached_purge(memcached_server_write_instance_st ptr);
LIBMEMCACHED_LOCAL
memcached_return_t memcached_purge(memcached_server_write_instance_st ptr);
-LIBMEMCACHED_LOCAL
-memcached_server_st *memcached_server_create_with(const memcached_st *memc,
- memcached_server_write_instance_st host,
- const char *hostname,
- in_port_t port,
- uint32_t weight,
- memcached_connection_t type);
-
static inline memcached_return_t memcached_validate_key_length(size_t key_length, bool binary)
{
static inline memcached_return_t memcached_validate_key_length(size_t key_length, bool binary)
{
- unlikely (key_length == 0)
+ if (key_length == 0)
+ {
return MEMCACHED_BAD_KEY_PROVIDED;
return MEMCACHED_BAD_KEY_PROVIDED;
+ }
if (binary)
{
if (binary)
{
- unlikely (key_length > 0xffff)
+ if (key_length > 0xffff)
+ {
return MEMCACHED_BAD_KEY_PROVIDED;
return MEMCACHED_BAD_KEY_PROVIDED;
+ }
}
else
{
}
else
{
- unlikely (key_length >= MEMCACHED_MAX_KEY)
+ if (key_length >= MEMCACHED_MAX_KEY)
+ {
return MEMCACHED_BAD_KEY_PROVIDED;
return MEMCACHED_BAD_KEY_PROVIDED;
+ }
}
return MEMCACHED_SUCCESS;
}
return MEMCACHED_SUCCESS;