3 memcached_set, memcached_add, memcached_replace
7 C Client Library for memcached (libmemcached, -lmemcached)
11 #include <memcached.h>
12 memcached_return memcached_set(memcached_st *ptr, char *key, size_t key_length,
13 char *value, size_t value_length,
16 memcached_return memcached_add(memcached_st *ptr, char *key, size_t key_length,
17 char *value, size_t value_length,
20 memcached_return memcached_replace(memcached_st *ptr, char *key, size_t key_length,
21 char *value, size_t value_length,
27 memcached_set() , memcached_add(), and memcached_replace() are all used to
28 store information on the server. All methods take a key, and its length to
29 store the object. Keys are currently limited to 250 charcterss by the
30 memcached server. You must also supply a value and a length. Optionally you
31 may support an expiration time for the object and a 16 byte value (it is
32 meant to be used as a bitmap).
34 memcached_set() will write an object to the server. If an object already
35 exists it will overwrite what is in the server. If the object does not exist
36 it will be written. If you are using the non-blocking mode this function
37 will always return true unless a network error occurs.
39 memcached_replace() replaces an object on the server. If the object is not
40 found on the server an error occurs.
42 memcached_add() adds an object to the server. If the object is found on the
43 server an error occurs, otherwise the value is stored.
45 memcached_set() with non-blocking IO is the fastest way to store data on the
50 All methods return a memcached_return value. On success the value will be
51 MEMCACHED_SUCCESS (see memcached_strerror() for more information on this).
52 For memcached_replace() and memcached_add() MEMCACHED_NOTSTORED is a
53 legitmate error in the case of a collision.
57 To find out more information please check: http://tangent.org/552/libmemcached.html
61 Brian Aker, brian@tangent.org
65 memcached(1) libmemached(3) memcached_strerror(3)