Merge pull request #140 from hussainnaqvee/patch-1
[awesomized/libmemcached] / libmemcached / memcached_user_data.rst
1 Storing custom information in the client
2 ========================================
3
4 SYNOPSIS
5 --------
6
7 #include <libmemcached/memcached.h>
8 Compile and link with -lmemcached
9
10 .. function:: void *memcached_get_user_data (memcached_st *ptr)
11
12 :param ptr: pointer to initialized `memcached_st` struct
13 :returns: opaque pointer to the user supplied data
14
15 .. function:: void *memcached_set_user_data (memcached_st *ptr, void *data)
16
17 :param ptr: pointer to initialized `memcached_st` struct
18 :param data: opaque pointer to user supplied data
19 :returns: opaque pointer to the previously set `data`
20
21 DESCRIPTION
22 -----------
23
24 `libmemcached` allows you to store a pointer to a user specific data inside
25 the memcached_st structure.
26
27 :func:`memcached_set_user_data` is used to set the user specific data in the
28 :type:`memcached_st` structure.
29
30 :func:`memcached_get_user_data` is used to retrieve the user specific data in
31 the :type:`memcached_st` structure.
32
33 RETURN VALUE
34 ------------
35
36 :func:`memcached_set_user_data` returns the previous value of the user specific data.
37
38 :func:`memcached_get_user_data` returns the current value of the user specific data.
39
40 SEE ALSO
41 --------
42
43 .. only:: man
44
45 :manpage:`memcached(1)`
46 :manpage:`libmemcached(3)`
47
48 .. only:: html
49
50 * :manpage:`memcached(1)`
51 * :doc:`../libmemcached`