3 memcached_get, memcached_mget, memcached_fetch
7 C Client Library for memcached (libmemcached, -lmemcached)
11 #include <memcached.h>
13 char *memcached_get (memcached_st *ptr,
14 char *key, size_t key_length,
17 memcached_return *error);
20 memcached_mget (memcached_st *ptr,
21 char **keys, size_t *key_length,
22 unsigned int number_of_keys);
24 char *memcached_fetch (memcached_st *ptr,
25 char *key, size_t *key_length,
28 memcached_return *error);
32 memcached_get() is used to fetch an individual value from the server. You
33 must pass in a key and its length to fetch the object. You must supply
34 three pointer variables which will give you the state of the returned
35 object. A uint16_t pointer to contain whatever flags you stored with the value,
36 a size_t pointer which will be filled with size of of the object, and a
37 memcached_return pointer to hold any error. The object will be returned
38 upon success and NULL will be returned on failure.
40 memcached_mget() is used to select multiple keys at once. For multiple key
41 operations it is always faster to use this function. This function always
42 works asynchronously. memcached_fetch() is then used to retrieve any keys
43 found. No error is given on keys that are not found.
45 memcached_fetch() is used to fetch an individual value from the server.
46 memcached_mget() must always be called before using this method. You
47 must pass in a key and its length to fetch the object. You must supply
48 three pointer variables which will give you the state of the returned
49 object. A uint16_t pointer to contain whatever flags you stored with the value,
50 a size_t pointer which will be filled with size of of the object, and a
51 memcached_return pointer to hold any error. The object will be returned
52 upon success and NULL will be returned on failure.
56 All objects returned must be freed by the calling application.
57 memcached_get() and memcached_fetch() will return NULL on error. You must
58 look at the value of error to determine what the actual error was.
62 To find out more information please check:
63 L<http://tangent.org/552/libmemcached.html>
67 Brian Aker, E<lt>brian@tangent.orgE<gt>
71 memcached(1) libmemcached(3) memcached_strerror(3)