Merge pull request #140 from hussainnaqvee/patch-1
[awesomized/libmemcached] / libmemcached / memcached_dump.rst
1 Dumping data from a server
2 ==========================
3
4 SYNOPSIS
5 --------
6
7 #include <libmemcached/memcached.h>
8 Compile and link with -lmemcached
9
10 .. type:: memcached_return_t (*memcached_dump_fn)(memcached_st *ptr, const char *key, size_t key_length, void *context)
11
12 :param ptr: pointer to `memcached_st` object
13 :param key: key string being dumped
14 :param key_length: length of the key without any terminating zero
15 :param context: pointer to the user supplied context
16 :returns: `memcached_return_t` indicating success
17
18 .. function:: memcached_return_t memcached_dump (memcached_st *ptr, memcached_dump_fn *function, void *context, uint32_t number_of_callbacks)
19
20 :param ptr: pointer to initialized `memcached_st` struct
21 :param function: pointer to `number_of_callbacks` `memcached_dump_fn` callbacks
22 :param context: pointer to a user managed context
23 :param number_of_callbacks: number of callbacks in the `function` array
24 :returns: `memcached_return_t` indicating success
25
26
27 DESCRIPTION
28 -----------
29
30 :func:`memcached_dump` is used to get a list of keys found in :manpage:`memcached(1)`
31 servers. Because memcached does not guarantee to dump all keys you can not
32 assume you have fetched all keys from the server. The function takes an array
33 of callbacks that it will use to execute on keys as they are found.
34
35 Currently the binary protocol is not tested.
36
37 RETURN VALUE
38 ------------
39
40 A value of type :type:`memcached_return_t` is returned.
41 On success that value will be `MEMCACHED_SUCCESS`.
42 Use :func:`memcached_strerror` to translate this value to a printable
43 string.
44
45 SEE ALSO
46 --------
47
48 .. only:: man
49
50 :manpage:`memcached(1)`
51 :manpage:`libmemcached(3)`
52 :manpage:`memcached_strerror(3)`
53
54 .. only:: html
55
56 * :doc:`../libmemcached`
57 * :doc:`memcached_strerror`