docs: ws
[awesomized/libmemcached] / docs / source / libmemcached / memcached_fetch.rst
1 =================
2 memcached_fetch
3 =================
4
5 .. index:: object: memcached_st
6
7 --------
8 SYNOPSIS
9 --------
10
11 #include <libmemcached/memcached.h>
12
13 .. function:: char *memcached_fetch(memcached_st *ptr, char *key, size_t *key_length, size_t *value_length, uint32_t *flags, memcached_return_t *error)
14
15 .. deprecated:: 0.50
16 Use :func:`memcached_fetch_result` instead.
17
18 Compile and link with -lmemcached
19
20 -----------
21 DESCRIPTION
22 -----------
23
24 :func:`memcached_fetch` is used to fetch an individual value from the server. :func:`memcached_mget` must always be called before using this method.
25 You must pass in a key and its length to fetch the object. You must supply
26 three pointer variables which will give you the state of the returned
27 object. A :type:`uint32_t` pointer to contain whatever flags you stored with the value, a :type:`size_t` pointer which will be filled with size of of the
28 object, and a :type:`memcached_return_t` pointer to hold any error. The
29 object will be returned upon success and NULL will be returned on failure. `MEMCACHED_END` is returned by the \*error value when all objects that have been found are returned. The final value upon `MEMCACHED_END` is null.
30
31 Values returned by :func:`memcached_fetch` must be freed by the caller.
32
33 All of the above functions are not tested when the
34 `MEMCACHED_BEHAVIOR_USE_UDP` has been set. Executing any of these
35 functions with this behavior on will result in `MEMCACHED_NOT_SUPPORTED` being returned, or for those functions which do not return a :type:`memcached_return_t`, the error function parameter will be set to `MEMCACHED_NOT_SUPPORTED`.
36
37 ------
38 RETURN
39 ------
40
41 :func:`memcached_fetch` sets error to
42 to `MEMCACHED_END` upon successful conclusion.
43 `MEMCACHED_NOTFOUND` will be return if no keys at all were found.
44
45 `MEMCACHED_KEY_TOO_BIG` is set to error whenever :func:`memcached_fetch` was used
46 and the key was set larger then `MEMCACHED_MAX_KEY`, which was the largest
47 key allowed for the original memcached ascii server.
48
49 --------
50 SEE ALSO
51 --------
52
53 .. only:: man
54
55 :manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)` :manpage:`memcached_fetch_result(3)`
56