Hard to believe I documented the entire thing... this is a first.
[awesomized/libmemcached] / docs / memcached_set.pod
1 =head1 NAME
2
3 memcached_set, memcached_add, memcached_replace
4
5 =head1 LIBRARY
6
7 C Client Library for memcached (libmemcached, -lmemcached)
8
9 =head1 SYNOPSIS
10
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,
14 time_t expiration,
15 uint16_t flags);
16 memcached_return memcached_add(memcached_st *ptr, char *key, size_t key_length,
17 char *value, size_t value_length,
18 time_t expiration,
19 uint16_t flags);
20 memcached_return memcached_replace(memcached_st *ptr, char *key, size_t key_length,
21 char *value, size_t value_length,
22 time_t expiration,
23 uint16_t flags);
24
25 =head1 DESCRIPTION
26
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).
33
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.
38
39 memcached_replace() replaces an object on the server. If the object is not
40 found on the server an error occurs.
41
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.
44
45 memcached_set() with non-blocking IO is the fastest way to store data on the
46 server.
47
48 =head1 RETURN
49
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.
54
55 =head1 HOME
56
57 To find out more information please check: http://tangent.org/552/libmemcached.html
58
59 =head1 AUTHOR
60
61 Brian Aker, brian@tangent.org
62
63 =head1 SEE ALSO
64
65 memcached(1) libmemached(3) memcached_strerror(3)
66
67 =cut
68