docs/memstat.1
docs/memcached_set_memory_allocators.3
docs/memcached_get_memory_allocators.3
+docs/memcached_set_user_data.3
+docs/memcached_get_user_data.3
libmemcached/.deps
libmemcached/.libs
libmemcached/Makefile
memcached_flush_buffers.pod\
memcached_analyze.pod\
memcached_generate_hash_value.pod\
- memcached_memory_allocators.pod
+ memcached_memory_allocators.pod\
+ memory_user_data.pod
man_MANS = libmemcached.3\
libmemcached_examples.3\
memcached_dump.3\
memcached_generate_hash_value.3\
memcached_set_memory_allocators.3\
- memcached_get_memory_allocators.3
+ memcached_get_memory_allocators.3\
+ memcached_set_user_data.3\
+ memcached_get_user_data.3
if BUILD_LIBMEMCACHEDUTIL
man_MANS+= libmemcachedutil.3 \
memcached_set_memory_allocators.3: memcached_memory_allocators.pod
@POD2MAN@ -c "libmemcached" -r "" -s 3 ${top_srcdir}/docs/memcached_memory_allocators.pod > memcached_set_memory_allocators.3
+memcached_get_user_data.3: memcached_user_data.pod
+ @POD2MAN@ -c "libmemcached" -r "" -s 3 ${top_srcdir}/docs/memcached_user_data.pod > memcached_get_user_data.3
+
+memcached_set_user_data.3: memcached_user_data.pod
+ @POD2MAN@ -c "libmemcached" -r "" -s 3 ${top_srcdir}/docs/memcached_user_data.pod > memcached_set_user_data.3
+
memcached_pool_create.3: memcached_pool.pod
@POD2MAN@ -c "libmemcachedutil" -r "" -s 3 ${top_srcdir}/docs/memcached_pool.pod > memcached_pool_create.3
podchecker $(top_srcdir)/docs/memcached_flush_buffers.pod
podchecker $(top_srcdir)/docs/memcached_pool.pod
podchecker $(top_srcdir)/docs/memcached_memory_allocators.pod
+ podchecker $(top_srcdir)/docs/memcached_user_data.pod
html-local:
pod2htmltree "/libmemcached" .
=head1 SEE ALSO
-memcached(1) libmemcached_examples(3) libmemcached(1) memcat(1) memcp(1) memflush(1) memrm(1) memslap(1) memstat(1) memcached_fetch(3) memcached_replace(3) memcached_server_list_free(3) libmemcached_examples(3) memcached_clone(3) memcached_free(3) memcached_server_add(3) memcached_server_push(3) memcached_add(3) memcached_get(3) memcached_server_count(3) memcached_servers_parse(3) memcached_create(3) memcached_increment(3) memcached_server_list(3) memcached_set(3) memcached_decrement(3) memcached_mget(3) memcached_server_list_append(3) memcached_strerror(3) memcached_delete(3) memcached_quit(3) memcached_server_list_count(3) memcached_verbosity(3) memcached_server_add_unix_socket(3) memcached_result_create(3) memcached_result_free(3) memcached_result_key_value(3) memcached_result_key_length(3) memcached_result_value(3) memcached_result_length(3) memcached_result_flags(3) memcached_result_cas(3) memcached_result_st(3) memcached_append(3) memcached_prepend(3) memcached_fetch_result(3) memerror(1) memcached_get_by_key(3) memcached_mget_by_key(3) memcached_delete_by_key(3) memcached_fetch_execute(3) memcached_callback_get(3) memcached_callback_set(3) memcached_version(3) memcached_lib_version(3) memcached_result_set_value(3) memcached_dump(3) memdump(1) memcached_set_memory_allocators(3) memcached_get_memory_allocators(3)
+memcached(1) libmemcached_examples(3) libmemcached(1) memcat(1) memcp(1) memflush(1) memrm(1) memslap(1) memstat(1) memcached_fetch(3) memcached_replace(3) memcached_server_list_free(3) libmemcached_examples(3) memcached_clone(3) memcached_free(3) memcached_server_add(3) memcached_server_push(3) memcached_add(3) memcached_get(3) memcached_server_count(3) memcached_servers_parse(3) memcached_create(3) memcached_increment(3) memcached_server_list(3) memcached_set(3) memcached_decrement(3) memcached_mget(3) memcached_server_list_append(3) memcached_strerror(3) memcached_delete(3) memcached_quit(3) memcached_server_list_count(3) memcached_verbosity(3) memcached_server_add_unix_socket(3) memcached_result_create(3) memcached_result_free(3) memcached_result_key_value(3) memcached_result_key_length(3) memcached_result_value(3) memcached_result_length(3) memcached_result_flags(3) memcached_result_cas(3) memcached_result_st(3) memcached_append(3) memcached_prepend(3) memcached_fetch_result(3) memerror(1) memcached_get_by_key(3) memcached_mget_by_key(3) memcached_delete_by_key(3) memcached_fetch_execute(3) memcached_callback_get(3) memcached_callback_set(3) memcached_version(3) memcached_lib_version(3) memcached_result_set_value(3) memcached_dump(3) memdump(1) memcached_set_memory_allocators(3) memcached_get_memory_allocators(3) memcached_get_user_data(3) memcached_set_user_data(3)
=cut
memcached_get_memory_allocators() is used to get the currently used memory
allocators by a mamcached handle.
+The first argument to the memory allocator functions is a pointer to a
+memcached structure, and you may use the memcached_set_user_data() and
+memcached_get_user_data() to store a user-specific value to each memcached
+structure.
+
=head1 RETURN
memcached_set_memory_allocators() return MEMCACHED_SUCCESS upon success,
=head1 SEE ALSO
-memcached(1) libmemcached(3)
+memcached(1) libmemcached(3) memcached_get_user_data(3) memcached_set_user_data(3)
=cut
--- /dev/null
+=head1 NAME
+
+memcached_set_user_data, memcached_get_user_data
+
+=head1 LIBRARY
+
+C Client Library for memcached (libmemcached, -lmemcached)
+
+=head1 SYNOPSIS
+
+ #include <memcached.h>
+
+ void *memcached_get_user_data(memcached_st *ptr);
+ void *memcached_set_user_data(memcached_st *ptr, void *data);
+
+=head1 DESCRIPTION
+
+libmemcached(3) allows you to store a pointer to a user specific data inside
+the memcached_st structure.
+
+memcached_set_user_data() is used to set the user specific data in the
+memcached_st structure.
+
+memcached_get_user_data() is used to retrieve the user specific data in
+the memcached_st structure.
+
+=head1 RETURN
+
+memcached_set_user_data() returns the previous value of the user specific
+data.
+
+memcached_get_user_data() returns the current value uf the user specific
+data.
+
+=head1 HOME
+
+To find out more information please check:
+L<http://tangent.org/552/libmemcached.html>
+
+=head1 AUTHOR
+
+Trond Norbye, E<lt>trond.norbye@sun.comE<gt>
+
+=head1 SEE ALSO
+
+memcached(1) libmemcached(3)
+
+=cut
+
return new_clone;
}
+void *memcached_get_user_data(memcached_st *ptr)
+{
+ return ptr->user_data;
+}
+
+void *memcached_set_user_data(memcached_st *ptr, void *data)
+{
+ void *ret= ptr->user_data;
+ ptr->user_data= data;
+ return ret;
+}
memcached_realloc_function *mem_realloc,
memcached_calloc_function *mem_calloc);
+void *memcached_get_user_data(memcached_st *ptr);
+void *memcached_set_user_data(memcached_st *ptr, void *data);
+
#ifdef __cplusplus
}
#endif
return 0;
}
+static test_return userdata_test(memcached_st *memc)
+{
+ void* foo;
+ assert(memcached_set_user_data(memc, foo) == NULL);
+ assert(memcached_get_user_data(memc) == foo);
+ assert(memcached_set_user_data(memc, NULL) == foo);
+
+ return TEST_SUCCESS;
+}
+
static test_return connection_test(memcached_st *memc)
{
memcached_return rc;
{"connection_test", 0, connection_test},
{"callback_test", 0, callback_test},
{"behavior_test", 0, behavior_test},
+ {"userdata_test", 0, userdata_test},
{"error", 0, error_test },
{"set", 0, set_test },
{"set2", 0, set_test2 },