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