3 memcached_get, memcached_mget, memcached_fetch
7 C Client Library for memcached (libmemcached, -lmemcached)
11 #include <memcached.h>
12 char *memcached_get(memcached_st *ptr, char *key, size_t key_length,
15 memcached_return *error);
16 memcached_return memcached_mget(memcached_st *ptr,
17 char **keys, size_t *key_length,
18 unsigned int number_of_keys);
19 char *memcached_fetch(memcached_st *ptr, char *key, size_t *key_length,
20 size_t *value_length, uint16_t *flags,
21 memcached_return *error);
26 memcached_get() is used to fetch an individual value from the server. You
27 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 uint16_t pointer to contain whatever flags you stored with the value,
30 a size_t pointer which will be filled with size of of the object, and a
31 memcached_return pointer to hold any error. The object will be returned
32 upon success and NULL will be returned on failure.
34 memcached_mget() is used to select multiple keys at once. For multiple key
35 operations it is always faster to use this function. This function always
36 works asyncronously. memcached_fetch() is then used to retrieve any keys
37 found. No error is given on keys that are not found.
39 memcached_fetch() is used to fetch an individual value from the server.
40 memcached_mget() must always be called before using this method. You
41 must pass in a key and its length to fetch the object. You must supply
42 three pointer variables which will give you the state of the returned
43 object. A uint16_t pointer to contain whatever flags you stored with the value,
44 a size_t pointer which will be filled with size of of the object, and a
45 memcached_return pointer to hold any error. The object will be returned
46 upon success and NULL will be returned on failure.
50 All objects returned must be freed by the calling application.
51 memcached_get() and memcached_fetch() will return NULL on error. You must
52 look at the value of error() to determine what the actual error was.
56 To find out more information please check: http://tangent.org/552/libmemcached.html
60 Brian Aker, brian@tangent.org
64 memcached(1) libmemcached(3) memcached_strerror(3)