--- /dev/null
+/* LibMemcached
+ * Copyright (C) 2010 Brian Aker
+ * All rights reserved.
+ *
+ * Use and distribution licensed under the BSD license. See
+ * the COPYING file in the parent directory for full text.
+ *
+ * Summary: work with user defined memory allocators
+ *
+ */
+
+#ifndef __MEMCACHED_ALLOCATORS_H__
+#define __MEMCACHED_ALLOCATORS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+LIBMEMCACHED_API
+memcached_return_t memcached_set_memory_allocators(memcached_st *ptr,
+ memcached_malloc_fn mem_malloc,
+ memcached_free_fn mem_free,
+ memcached_realloc_fn mem_realloc,
+ memcached_calloc_fn mem_calloc);
+
+LIBMEMCACHED_API
+void memcached_get_memory_allocators(memcached_st *ptr,
+ memcached_malloc_fn *mem_malloc,
+ memcached_free_fn *mem_free,
+ memcached_realloc_fn *mem_realloc,
+ memcached_calloc_fn *mem_calloc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MEMCACHED_ALLOCATORS_H__ */
LIBMEMCACHED_LOCAL
void memcached_quit_server(memcached_server_instance_st *ptr, uint8_t io_death);
+LIBMEMCACHED_LOCAL
+memcached_return_t run_distribution(memcached_st *ptr);
+
#define memcached_server_response_increment(A) (A)->cursor_active++
#define memcached_server_response_decrement(A) (A)->cursor_active--
#define memcached_server_response_reset(A) (A)->cursor_active=0
+// These are private
+#define memcached_is_allocated(__object) ((__object)->options.is_allocated)
+#define memcached_is_initialized(__object) ((__object)->options.is_initialized)
+#define memcached_is_purging(__object) ((__object)->flags.is_purging)
+#define memcached_is_processing_input(__object) ((__object)->flags.is_processing_input)
+#define memcached_set_purging(__object, __value) ((__object)->flags.is_purging= (__value))
+#define memcached_set_processing_input(__object, __value) ((__object)->flags.is_processing_input= (__value))
+#define memcached_set_initialized(__object, __value) ((__object)->options.is_initialized(= (__value))
+#define memcached_set_allocated(__object, __value) ((__object)->options.is_allocated(= (__value))
+
+
LIBMEMCACHED_LOCAL
memcached_return_t memcached_do(memcached_server_instance_st *ptr, const void *commmand,
size_t command_length, uint8_t with_flush);
--- /dev/null
+/* LibMemcached
+ * Copyright (C) 2010 Brian Aker
+ * All rights reserved.
+ *
+ * Use and distribution licensed under the BSD license. See
+ * the COPYING file in the parent directory for full text.
+ *
+ * Summary: Delete a key from the server.
+ *
+ */
+
+#ifndef __MEMCACHED_DELETE_H__
+#define __MEMCACHED_DELETE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+LIBMEMCACHED_API
+memcached_return_t memcached_delete(memcached_st *ptr, const char *key, size_t key_length,
+ time_t expiration);
+
+LIBMEMCACHED_API
+memcached_return_t memcached_delete_by_key(memcached_st *ptr,
+ const char *master_key, size_t master_key_length,
+ const char *key, size_t key_length,
+ time_t expiration);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MEMCACHED_DELETE_H__ */
--- /dev/null
+/* LibMemcached
+ * Copyright (C) 2010 Brian Aker
+ * All rights reserved.
+ *
+ * Use and distribution licensed under the BSD license. See
+ * the COPYING file in the parent directory for full text.
+ *
+ * Summary: Work with fetching results
+ *
+ */
+
+#ifndef __MEMCACHED_FETCH_H__
+#define __MEMCACHED_FETCH_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+LIBMEMCACHED_API
+memcached_return_t memcached_fetch_execute(memcached_st *ptr,
+ memcached_execute_fn *callback,
+ void *context,
+ uint32_t number_of_callbacks);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MEMCACHED_FETCH_H__ */
--- /dev/null
+/* LibMemcached
+ * Copyright (C) 2010 Brian Aker
+ * All rights reserved.
+ *
+ * Use and distribution licensed under the BSD license. See
+ * the COPYING file in the parent directory for full text.
+ *
+ * Summary: Flush connections.
+ *
+ */
+
+#ifndef __MEMCACHED_FLUSH_H__
+#define __MEMCACHED_FLUSH_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+LIBMEMCACHED_API
+memcached_return_t memcached_flush(memcached_st *ptr, time_t expiration);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MEMCACHED_FLUSH_H__ */
--- /dev/null
+/* LibMemcached
+ * Copyright (C) 2010 Brian Aker
+ * All rights reserved.
+ *
+ * Use and distribution licensed under the BSD license. See
+ * the COPYING file in the parent directory for full text.
+ *
+ * Summary: Work with fetching results
+ *
+ */
+
+#ifndef __MEMCACHED_FLUSH_BUFFERS_H__
+#define __MEMCACHED_FLUSH_BUFFERS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+LIBMEMCACHED_API
+memcached_return_t memcached_flush_buffers(memcached_st *mem);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MEMCACHED_FLUSH_BUFFERS_H__ */
--- /dev/null
+/* LibMemcached
+ * Copyright (C) 2010 Brian Aker
+ * All rights reserved.
+ *
+ * Use and distribution licensed under the BSD license. See
+ * the COPYING file in the parent directory for full text.
+ *
+ * Summary: hash interface code
+ *
+ */
+
+#ifndef __MEMCACHED_HASH_H__
+#define __MEMCACHED_HASH_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* The two public hash bits */
+LIBMEMCACHED_API
+uint32_t memcached_generate_hash_value(const char *key, size_t key_length, memcached_hash_t hash_algorithm);
+
+LIBMEMCACHED_API
+uint32_t memcached_generate_hash(memcached_st *ptr, const char *key, size_t key_length);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MEMCACHED_HASH_H__ */
libmemcached/response.h
nobase_include_HEADERS+= \
+ libmemcached/allocators.h \
libmemcached/analyze.h \
libmemcached/auto.h \
libmemcached/behavior.h \
libmemcached/callback.h \
libmemcached/configure.h \
libmemcached/constants.h \
+ libmemcached/delete.h \
libmemcached/dump.h \
libmemcached/exception.hpp \
+ libmemcached/fetch.h \
+ libmemcached/flush.h \
+ libmemcached/flush_buffers.h \
libmemcached/get.h \
+ libmemcached/hash.h \
libmemcached/memcached.h \
libmemcached/memcached.hpp \
libmemcached/memcached/protocol_binary.h \
+ libmemcached/parse.h \
libmemcached/protocol/cache.h \
libmemcached/protocol/callback.h \
libmemcached/protocol_handler.h \
+ libmemcached/quit.h \
libmemcached/result.h \
libmemcached/server.h \
libmemcached/stats.h \
libmemcached/storage.h \
+ libmemcached/strerror.h \
libmemcached/string.h \
libmemcached/types.h \
+ libmemcached/verbosity.h \
+ libmemcached/version.h \
libmemcached/visibility.h \
libmemcached/watchpoint.h
return new_clone;
}
-void *memcached_get_user_data(memcached_st *ptr)
+void *memcached_get_user_data(const memcached_st *ptr)
{
return ptr->user_data;
}
#include <libmemcached/string.h>
#include <libmemcached/stats.h>
// Everything above this line must be in the order specified.
+#include <libmemcached/allocators.h>
#include <libmemcached/analyze.h>
#include <libmemcached/auto.h>
#include <libmemcached/behavior.h>
#include <libmemcached/callback.h>
+#include <libmemcached/delete.h>
#include <libmemcached/dump.h>
+#include <libmemcached/fetch.h>
+#include <libmemcached/flush.h>
+#include <libmemcached/flush_buffers.h>
#include <libmemcached/get.h>
+#include <libmemcached/hash.h>
+#include <libmemcached/parse.h>
+#include <libmemcached/quit.h>
#include <libmemcached/result.h>
#include <libmemcached/server.h>
#include <libmemcached/storage.h>
+#include <libmemcached/strerror.h>
+#include <libmemcached/verbosity.h>
+#include <libmemcached/version.h>
#ifdef __cplusplus
extern "C" {
} options;
};
-LIBMEMCACHED_API
-memcached_return_t memcached_version(memcached_st *ptr);
-
LIBMEMCACHED_API
void memcached_servers_reset(memcached_st *ptr);
-// Local Only Inline
-static inline memcached_server_st *memcached_server_instance_fetch(memcached_st *ptr, uint32_t server_key)
-{
- return &ptr->servers[server_key];
-}
-
/* Public API */
-LIBMEMCACHED_API
-const char * memcached_lib_version(void);
-
LIBMEMCACHED_API
memcached_st *memcached_create(memcached_st *ptr);
-LIBMEMCACHED_API
-void memcached_free(memcached_st *ptr);
-LIBMEMCACHED_API
-memcached_st *memcached_clone(memcached_st *clone, memcached_st *ptr);
-
-LIBMEMCACHED_API
-memcached_return_t memcached_delete(memcached_st *ptr, const char *key, size_t key_length,
- time_t expiration);
-
-LIBMEMCACHED_API
-memcached_return_t memcached_flush(memcached_st *ptr, time_t expiration);
-
-LIBMEMCACHED_API
-memcached_return_t memcached_verbosity(memcached_st *ptr, unsigned int verbosity);
-
-LIBMEMCACHED_API
-void memcached_quit(memcached_st *ptr);
-
-LIBMEMCACHED_API
-const char *memcached_strerror(memcached_st *ptr, memcached_return_t rc);
-
-/* The two public hash bits */
-LIBMEMCACHED_API
-uint32_t memcached_generate_hash_value(const char *key, size_t key_length, memcached_hash_t hash_algorithm);
-
-LIBMEMCACHED_API
-uint32_t memcached_generate_hash(memcached_st *ptr, const char *key, size_t key_length);
-
-LIBMEMCACHED_API
-memcached_return_t memcached_flush_buffers(memcached_st *mem);
-
-/* Server Public functions */
LIBMEMCACHED_API
-memcached_return_t memcached_server_add_udp(memcached_st *ptr,
- const char *hostname,
- in_port_t port);
-LIBMEMCACHED_API
-memcached_return_t memcached_server_add_unix_socket(memcached_st *ptr,
- const char *filename);
-LIBMEMCACHED_API
-memcached_return_t memcached_server_add(memcached_st *ptr,
- const char *hostname, in_port_t port);
-
-LIBMEMCACHED_API
-memcached_return_t memcached_server_add_udp_with_weight(memcached_st *ptr,
- const char *hostname,
- in_port_t port,
- uint32_t weight);
-LIBMEMCACHED_API
-memcached_return_t memcached_server_add_unix_socket_with_weight(memcached_st *ptr,
- const char *filename,
- uint32_t weight);
-LIBMEMCACHED_API
-memcached_return_t memcached_server_add_with_weight(memcached_st *ptr, const char *hostname,
- in_port_t port,
- uint32_t weight);
-LIBMEMCACHED_API
-void memcached_server_list_free(memcached_server_st *ptr);
-
-LIBMEMCACHED_API
-memcached_return_t memcached_server_push(memcached_st *ptr, memcached_server_st *list);
-
-LIBMEMCACHED_API
-memcached_server_st *memcached_server_list_append(memcached_server_st *ptr,
- const char *hostname,
- in_port_t port,
- memcached_return_t *error);
-LIBMEMCACHED_API
-memcached_server_st *memcached_server_list_append_with_weight(memcached_server_st *ptr,
- const char *hostname,
- in_port_t port,
- uint32_t weight,
- memcached_return_t *error);
-LIBMEMCACHED_API
-unsigned int memcached_server_list_count(memcached_server_st *ptr);
-
-LIBMEMCACHED_API
-memcached_server_st *memcached_servers_parse(const char *server_strings);
-
-LIBMEMCACHED_API
-char *memcached_stat_get_value(memcached_st *ptr, memcached_stat_st *memc_stat,
- const char *key, memcached_return_t *error);
-LIBMEMCACHED_API
-char ** memcached_stat_get_keys(memcached_st *ptr, memcached_stat_st *memc_stat,
- memcached_return_t *error);
-
-LIBMEMCACHED_API
-memcached_return_t memcached_delete_by_key(memcached_st *ptr,
- const char *master_key, size_t master_key_length,
- const char *key, size_t key_length,
- time_t expiration);
-
-LIBMEMCACHED_API
-memcached_return_t memcached_fetch_execute(memcached_st *ptr,
- memcached_execute_fn *callback,
- void *context,
- unsigned int number_of_callbacks);
+void memcached_free(memcached_st *ptr);
LIBMEMCACHED_API
-memcached_return_t memcached_set_memory_allocators(memcached_st *ptr,
- memcached_malloc_fn mem_malloc,
- memcached_free_fn mem_free,
- memcached_realloc_fn mem_realloc,
- memcached_calloc_fn mem_calloc);
+memcached_st *memcached_clone(memcached_st *clone, memcached_st *ptr);
LIBMEMCACHED_API
-void memcached_get_memory_allocators(memcached_st *ptr,
- memcached_malloc_fn *mem_malloc,
- memcached_free_fn *mem_free,
- memcached_realloc_fn *mem_realloc,
- memcached_calloc_fn *mem_calloc);
+void *memcached_get_user_data(const memcached_st *ptr);
-LIBMEMCACHED_API
-void *memcached_get_user_data(memcached_st *ptr);
LIBMEMCACHED_API
void *memcached_set_user_data(memcached_st *ptr, void *data);
-LIBMEMCACHED_LOCAL
-memcached_return_t run_distribution(memcached_st *ptr);
+// Local Only Inline
+static inline memcached_server_st *memcached_server_instance_fetch(memcached_st *ptr, uint32_t server_key)
+{
+ return &ptr->servers[server_key];
+}
-// These are private
-#define memcached_is_allocated(__object) ((__object)->options.is_allocated)
-#define memcached_is_initialized(__object) ((__object)->options.is_initialized)
-#define memcached_is_purging(__object) ((__object)->flags.is_purging)
-#define memcached_is_processing_input(__object) ((__object)->flags.is_processing_input)
-#define memcached_set_purging(__object, __value) ((__object)->flags.is_purging= (__value))
-#define memcached_set_processing_input(__object, __value) ((__object)->flags.is_processing_input= (__value))
-#define memcached_set_initialized(__object, __value) ((__object)->options.is_initialized(= (__value))
-#define memcached_set_allocated(__object, __value) ((__object)->options.is_allocated(= (__value))
#ifdef __cplusplus
}
--- /dev/null
+/* LibMemcached
+ * Copyright (C) 2010 Brian Aker
+ * All rights reserved.
+ *
+ * Use and distribution licensed under the BSD license. See
+ * the COPYING file in the parent directory for full text.
+ *
+ * Summary: Work with fetching results
+ *
+ */
+
+#ifndef __MEMCACHED_PARSE_H__
+#define __MEMCACHED_PARSE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+LIBMEMCACHED_API
+memcached_server_st *memcached_servers_parse(const char *server_strings);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MEMCACHED_PARSE_H__ */
--- /dev/null
+/* LibMemcached
+ * Copyright (C) 2010 Brian Aker
+ * All rights reserved.
+ *
+ * Use and distribution licensed under the BSD license. See
+ * the COPYING file in the parent directory for full text.
+ *
+ * Summary: returns a human readable string for the error message
+ *
+ */
+
+#ifndef __MEMCACHED_QUIT_H__
+#define __MEMCACHED_QUIT_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+LIBMEMCACHED_API
+void memcached_quit(memcached_st *ptr);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MEMCACHED_QUIT_H__ */
LIBMEMCACHED_API
memcached_server_st *memcached_server_get_last_disconnect(memcached_st *ptr);
+
+LIBMEMCACHED_API
+memcached_return_t memcached_server_add_udp(memcached_st *ptr,
+ const char *hostname,
+ in_port_t port);
+LIBMEMCACHED_API
+memcached_return_t memcached_server_add_unix_socket(memcached_st *ptr,
+ const char *filename);
+LIBMEMCACHED_API
+memcached_return_t memcached_server_add(memcached_st *ptr,
+ const char *hostname, in_port_t port);
+
+LIBMEMCACHED_API
+memcached_return_t memcached_server_add_udp_with_weight(memcached_st *ptr,
+ const char *hostname,
+ in_port_t port,
+ uint32_t weight);
+LIBMEMCACHED_API
+memcached_return_t memcached_server_add_unix_socket_with_weight(memcached_st *ptr,
+ const char *filename,
+ uint32_t weight);
+LIBMEMCACHED_API
+memcached_return_t memcached_server_add_with_weight(memcached_st *ptr, const char *hostname,
+ in_port_t port,
+ uint32_t weight);
+/* Server List Public functions */
+
+LIBMEMCACHED_API
+void memcached_server_list_free(memcached_server_st *ptr);
+
+
+LIBMEMCACHED_API
+memcached_return_t memcached_server_push(memcached_st *ptr, memcached_server_st *list);
+
+LIBMEMCACHED_API
+memcached_server_st *memcached_server_list_append(memcached_server_st *ptr,
+ const char *hostname,
+ in_port_t port,
+ memcached_return_t *error);
+LIBMEMCACHED_API
+memcached_server_st *memcached_server_list_append_with_weight(memcached_server_st *ptr,
+ const char *hostname,
+ in_port_t port,
+ uint32_t weight,
+ memcached_return_t *error);
+LIBMEMCACHED_API
+unsigned int memcached_server_list_count(memcached_server_st *ptr);
+
+
#ifdef __cplusplus
}
#endif
memcached_return_t memcached_stat_servername(memcached_stat_st *memc_stat, char *args,
const char *hostname, in_port_t port);
+LIBMEMCACHED_API
+char *memcached_stat_get_value(memcached_st *ptr, memcached_stat_st *memc_stat,
+ const char *key, memcached_return_t *error);
+
+LIBMEMCACHED_API
+char ** memcached_stat_get_keys(memcached_st *ptr, memcached_stat_st *memc_stat,
+ memcached_return_t *error);
+
#ifdef __cplusplus
}
#endif
--- /dev/null
+/* LibMemcached
+ * Copyright (C) 2010 Brian Aker
+ * All rights reserved.
+ *
+ * Use and distribution licensed under the BSD license. See
+ * the COPYING file in the parent directory for full text.
+ *
+ * Summary: returns a human readable string for the error message
+ *
+ */
+
+#ifndef __MEMCACHED_STRERROR_H__
+#define __MEMCACHED_STRERROR_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+LIBMEMCACHED_API
+const char *memcached_strerror(memcached_st *ptr, memcached_return_t rc);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MEMCACHED_STRERROR_H__ */
#include "common.h"
-memcached_return_t memcached_verbosity(memcached_st *ptr, unsigned int verbosity)
+memcached_return_t memcached_verbosity(memcached_st *ptr, uint32_t verbosity)
{
uint32_t x;
size_t send_length;
--- /dev/null
+/* LibMemcached
+ * Copyright (C) 2010 Brian Aker
+ * All rights reserved.
+ *
+ * Use and distribution licensed under the BSD license. See
+ * the COPYING file in the parent directory for full text.
+ *
+ * Summary: Change the verbository level of the memcached server
+ *
+ */
+
+#ifndef __MEMCACHED_VERBOSITY_H__
+#define __MEMCACHED_VERBOSITY_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+LIBMEMCACHED_API
+memcached_return_t memcached_verbosity(memcached_st *ptr, uint32_t verbosity);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MEMCACHED_VERBOSITY_H__ */
--- /dev/null
+/* LibMemcached
+ * Copyright (C) 2010 Brian Aker
+ * All rights reserved.
+ *
+ * Use and distribution licensed under the BSD license. See
+ * the COPYING file in the parent directory for full text.
+ *
+ * Summary: Find version information
+ *
+ */
+
+#ifndef __MEMCACHED_VERSION_H__
+#define __MEMCACHED_VERSION_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+LIBMEMCACHED_API
+memcached_return_t memcached_version(memcached_st *ptr);
+
+LIBMEMCACHED_API
+const char * memcached_lib_version(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MEMCACHED_VERSION_H__ */
%files devel
%defattr (-,root,root,-)
%doc examples
+%{_includedir}/libmemcached/allocators.h
+%{_includedir}/libmemcached/delete.h
+%{_includedir}/libmemcached/fetch.h
+%{_includedir}/libmemcached/flush.h
+%{_includedir}/libmemcached/flush_buffers.h
+%{_includedir}/libmemcached/hash.h
+%{_includedir}/libmemcached/parse.h
+%{_includedir}/libmemcached/quit.h
+%{_includedir}/libmemcached/strerror.h
+%{_includedir}/libmemcached/verbosity.h
+%{_includedir}/libmemcached/version.h
%{_includedir}/libhashkit/algorithm.h
%{_includedir}/libhashkit/behavior.h
%{_includedir}/libhashkit/hashkit.h