1MEMCACHED_FETCH(3) libmemcached-awesome MEMCACHED_FETCH(3)
2
3
4
6 memcached_fetch - Retrieving data from the server
7
9 #include <libmemcached/memcached.h>
10 Compile and link with -lmemcached
11
12 char *memcached_fetch(memcached_st *ptr, char *key, size_t *key_length,
13 size_t *value_length, uint32_t *flags, memcached_return_t *error)
14 Deprecated since version 0.50: Use memcached_fetch_result() in‐
15 stead.
16
17
19 memcached_fetch() is used to fetch an individual value from the server.
20 memcached_mget() must always be called before using this method. You
21 must pass in a key and its length to fetch the object.
22
23 You must supply three pointer variables which will give you the state
24 of the returned object:
25
26 • A uint32_t pointer to contain whatever flags you stored with the
27 value,
28
29 • a size_t pointer which will be filled with size of of the object,
30 and
31
32 • a memcached_return_t pointer to hold any error.
33
34 The object will be returned upon success and NULL will be returned on
35 failure.
36
37 MEMCACHED_END is returned by the error value when all objects that have
38 been found are returned. The final value upon MEMCACHED_END is a NULL
39 pointer.
40
41 Values returned by memcached_fetch() must be freed by the caller.
42
43 All of the above functions are not tested when the
44 MEMCACHED_BEHAVIOR_USE_UDP has been set. Executing any of these func‐
45 tions with this behavior on will result in MEMCACHED_NOT_SUPPORTED be‐
46 ing returned, or for those functions which do not return a
47 memcached_return_t, the error function parameter will be set to
48 MEMCACHED_NOT_SUPPORTED.
49
51 memcached_fetch() sets error to to MEMCACHED_END upon successful con‐
52 clusion.
53
54 MEMCACHED_NOTFOUND will be return if no keys at all were found.
55
56 MEMCACHED_KEY_TOO_BIG is set to error whenever memcached_fetch() was
57 used and the key was set larger then MEMCACHED_MAX_KEY, which was the
58 largest key allowed for the original memcached ascii server.
59
61 memcached(1) libmemcached(3) memcached_strerror(3) memcached_fetch_re‐
62 sult(3)
63
64
65
66
671.1 Jul 20, 2023 MEMCACHED_FETCH(3)