LIBMEMCACHED_API
void *memcached_get_memory_allocators_context(const memcached_st *ptr);
-LIBMEMCACHED_LOCAL
-void _libmemcached_free(const memcached_st *ptr, void *mem, void *context);
-
-LIBMEMCACHED_LOCAL
-void *_libmemcached_malloc(const memcached_st *ptr, const size_t size, void *context);
-
-LIBMEMCACHED_LOCAL
-void *_libmemcached_realloc(const memcached_st *ptr, void *mem, const size_t size, void *context);
-
-LIBMEMCACHED_LOCAL
-void *_libmemcached_calloc(const memcached_st *ptr, size_t nelem, size_t size, void *context);
-
-LIBMEMCACHED_LOCAL
-struct memcached_allocator_t memcached_allocators_return_default(void);
-
#ifdef __cplusplus
}
#endif
LIBMEMCACHED_API
memcached_hash_t memcached_behavior_get_distribution_hash(memcached_st *ptr);
-LIBMEMCACHED_LOCAL
-bool _is_auto_eject_host(const memcached_st *ptr);
-
LIBMEMCACHED_API
const char *libmemcached_string_behavior(const memcached_behavior_t flag);
LIBMEMCACHED_API
uint32_t memcached_generate_hash(const memcached_st *ptr, const char *key, size_t key_length);
-LIBMEMCACHED_LOCAL
-uint32_t memcached_generate_hash_with_redistribution(memcached_st *ptr, const char *key, size_t key_length);
-
LIBMEMCACHED_API
void memcached_autoeject(memcached_st *ptr);
LIBMEMCACHED_API
void memcached_quit(memcached_st *ptr);
-LIBMEMCACHED_LOCAL
-void memcached_quit_server(memcached_server_st *ptr, bool io_death);
-
-LIBMEMCACHED_LOCAL
-void send_quit(memcached_st *ptr);
-
#ifdef __cplusplus
}
#endif
LIBMEMCACHED_API
sasl_callback_t *memcached_get_sasl_callbacks(memcached_st *ptr);
-LIBMEMCACHED_LOCAL
-memcached_return_t memcached_clone_sasl(memcached_st *clone, const memcached_st *source);
-
-LIBMEMCACHED_LOCAL
-memcached_return_t memcached_sasl_authenticate_connection(memcached_server_st *server);
-
#ifdef __cplusplus
}
#endif
LIBMEMCACHED_API
uint32_t memcached_server_list_count(const memcached_server_list_st ptr);
-LIBMEMCACHED_LOCAL
- uint32_t memcached_servers_set_count(memcached_server_list_st servers, uint32_t count);
-
-LIBMEMCACHED_LOCAL
- memcached_server_st *memcached_server_list(const memcached_st *);
-
-LIBMEMCACHED_LOCAL
- void memcached_server_list_set(memcached_st *self, memcached_server_list_st list);
-
#ifdef __cplusplus
} // extern "C"
#endif
bool is_initialized:1;
} options;
};
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-LIBMEMCACHED_LOCAL
-memcached_string_st *memcached_string_create(memcached_st *ptr,
- memcached_string_st *string,
- size_t initial_size);
-LIBMEMCACHED_LOCAL
-memcached_return_t memcached_string_check(memcached_string_st *string, size_t need);
-
-LIBMEMCACHED_LOCAL
-char *memcached_string_c_copy(memcached_string_st *string);
-
-LIBMEMCACHED_LOCAL
-memcached_return_t memcached_string_append_character(memcached_string_st *string,
- char character);
-LIBMEMCACHED_LOCAL
-memcached_return_t memcached_string_append(memcached_string_st *string,
- const char *value, size_t length);
-LIBMEMCACHED_LOCAL
-memcached_return_t memcached_string_reset(memcached_string_st *string);
-
-LIBMEMCACHED_LOCAL
-void memcached_string_free(memcached_string_st *string);
-
-LIBMEMCACHED_LOCAL
-size_t memcached_string_length(const memcached_string_st *self);
-
-LIBMEMCACHED_LOCAL
-size_t memcached_string_size(const memcached_string_st *self);
-
-LIBMEMCACHED_LOCAL
-const char *memcached_string_value(const memcached_string_st *self);
-
-LIBMEMCACHED_LOCAL
-char *memcached_string_take_value(memcached_string_st *self);
-
-LIBMEMCACHED_LOCAL
-char *memcached_string_value_mutable(const memcached_string_st *self);
-
-LIBMEMCACHED_LOCAL
-void memcached_string_set_length(memcached_string_st *self, size_t length);
-
-#ifdef __cplusplus
-}
-#endif
--- /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
+
+void _libmemcached_free(const memcached_st *ptr, void *mem, void *context);
+
+void *_libmemcached_malloc(const memcached_st *ptr, const size_t size, void *context);
+
+void *_libmemcached_realloc(const memcached_st *ptr, void *mem, const size_t size, void *context);
+
+void *_libmemcached_calloc(const memcached_st *ptr, size_t nelem, size_t size, void *context);
+
+struct memcached_allocator_t memcached_allocators_return_default(void);
--- /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
+
+bool _is_auto_eject_host(const memcached_st *ptr);
#include <libmemcached/do.hpp>
#include <libmemcached/close_socket.hpp>
#include <libmemcached/connect.hpp>
+#include <libmemcached/allocators.hpp>
+#include <libmemcached/hash.hpp>
+#include <libmemcached/quit.hpp>
+#include <libmemcached/server.hpp>
+#include <libmemcached/behavior.hpp>
+#include <libmemcached/sasl.hpp>
+#include <libmemcached/server_list.hpp>
#endif
#include <libmemcached/internal.h>
#include <libmemcached/array.h>
--- /dev/null
+/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ *
+ * Libmemcached library
+ *
+ * Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ * Copyright (C) 2006-2009 Brian Aker All rights reserved.
+ *
+ * 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
+
+uint32_t memcached_generate_hash_with_redistribution(memcached_st *ptr, const char *key, size_t key_length);
libmemcached_libmemcached_la_SOURCES+= \
${libhashkit_libhashkit_la_SOURCES} \
libmemcached/allocators.cc \
+ libmemcached/allocators.hpp \
libmemcached/analyze.cc \
libmemcached/array.c \
libmemcached/auto.cc \
libmemcached/backtrace.cc \
libmemcached/behavior.cc \
+ libmemcached/behavior.hpp \
libmemcached/byteorder.cc \
libmemcached/callback.cc \
libmemcached/connect.cc \
libmemcached/flush.cc \
libmemcached/flush_buffers.cc \
libmemcached/get.cc \
- libmemcached/touch.cc \
libmemcached/hash.cc \
+ libmemcached/hash.hpp \
libmemcached/hosts.cc \
libmemcached/initialize_query.cc \
libmemcached/io.cc \
libmemcached/key.cc \
libmemcached/memcached.cc \
+ libmemcached/namespace.cc \
libmemcached/options.cc \
libmemcached/parse.cc \
- libmemcached/namespace.cc \
libmemcached/purge.cc \
libmemcached/quit.cc \
+ libmemcached/quit.hpp \
libmemcached/response.cc \
libmemcached/result.cc \
+ libmemcached/sasl.hpp \
libmemcached/server.cc \
libmemcached/server_list.cc \
+ libmemcached/server_list.hpp \
libmemcached/stats.cc \
libmemcached/storage.cc \
libmemcached/strerror.cc \
libmemcached/string.cc \
+ libmemcached/touch.cc \
libmemcached/verbosity.cc \
libmemcached/version.cc \
libmemcached/virtual_bucket.c
--- /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
+
+void memcached_quit_server(memcached_server_st *ptr, bool io_death);
+
+void send_quit(memcached_st *ptr);
--- /dev/null
+/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ *
+ * Libmemcached library
+ *
+ * Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ * Copyright (C) 2006-2009 Brian Aker All rights reserved.
+ *
+ * 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 memcached_clone_sasl(memcached_st *clone, const memcached_st *source);
+
+memcached_return_t memcached_sasl_authenticate_connection(memcached_server_st *server);
--- /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
+
+
+uint32_t memcached_servers_set_count(memcached_server_list_st servers, uint32_t count);
+
+memcached_server_st *memcached_server_list(const memcached_st *);
+
+void memcached_server_list_set(memcached_st *self, memcached_server_list_st list);
#define memcached_string_make_from_cstr util_string_make_from_cstr
#define memcached_array_length util_array_length
+/**
+ Strings are always under our control so we make some assumptions
+ about them.
+ 1) is_initialized is always valid.
+ 2) A string once intialized will always be, until free where we
+ unset this flag.
+ 3) A string always has a root.
+*/
+
+memcached_string_st *memcached_string_create(memcached_st *ptr,
+ memcached_string_st *string,
+ size_t initial_size);
+
+memcached_return_t memcached_string_check(memcached_string_st *string, size_t need);
+
+char *memcached_string_c_copy(memcached_string_st *string);
+
+memcached_return_t memcached_string_append_character(memcached_string_st *string,
+ char character);
+
+memcached_return_t memcached_string_append(memcached_string_st *string,
+ const char *value, size_t length);
+
+memcached_return_t memcached_string_reset(memcached_string_st *string);
+
+void memcached_string_free(memcached_string_st *string);
+
+size_t memcached_string_length(const memcached_string_st *self);
+
+size_t memcached_string_size(const memcached_string_st *self);
+
+const char *memcached_string_value(const memcached_string_st *self);
+
+char *memcached_string_take_value(memcached_string_st *self);
+
+char *memcached_string_value_mutable(const memcached_string_st *self);
+
+void memcached_string_set_length(memcached_string_st *self, size_t length);
#include <config.h>
#include <libmemcached/memcached.h>
+#include <libmemcached/string.hpp>
#include <libmemcached/is.h>
#include <libtest/test.hpp>