Many fixes to the POD documentation
[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
13 memcached_return
14 memcached_set (memcached_st *ptr,
15 char *key, size_t key_length,
16 char *value, size_t value_length,
17 time_t expiration,
18 uint16_t flags);
19
20 memcached_return
21 memcached_add (memcached_st *ptr,
22 char *key, size_t key_length,
23 char *value, size_t value_length,
24 time_t expiration,
25 uint16_t flags);
26
27 memcached_return
28 memcached_replace (memcached_st *ptr,
29 char *key, size_t key_length,
30 char *value, size_t value_length,
31 time_t expiration,
32 uint16_t flags);
33
34 =head1 DESCRIPTION
35
36 memcached_set(), memcached_add(), and memcached_replace() are all used to
37 store information on the server. All methods take a key, and its length to
38 store the object. Keys are currently limited to 250 characters by the
39 memcached(1) server. You must also supply a value and a length. Optionally you
40 may support an expiration time for the object and a 16 byte value (it is
41 meant to be used as a bitmap).
42
43 memcached_set() will write an object to the server. If an object already
44 exists it will overwrite what is in the server. If the object does not exist
45 it will be written. If you are using the non-blocking mode this function
46 will always return true unless a network error occurs.
47
48 memcached_replace() replaces an object on the server. If the object is not
49 found on the server an error occurs.
50
51 memcached_add() adds an object to the server. If the object is found on the
52 server an error occurs, otherwise the value is stored.
53
54 memcached_set() with non-blocking IO is the fastest way to store data on the
55 server.
56
57 =head1 RETURN
58
59 All methods return a value of type C<memcached_return>.
60 On success the value will be C<MEMCACHED_SUCCESS>.
61 Use memcached_strerror() to translate this value to a printable string.
62
63 For memcached_replace() and memcached_add(), C<MEMCACHED_NOTSTORED> is a
64 legitmate error in the case of a collision.
65
66 =head1 HOME
67
68 To find out more information please check:
69 L<http://tangent.org/552/libmemcached.html>
70
71 =head1 AUTHOR
72
73 Brian Aker, E<lt>brian@tangent.orgE<gt>
74
75 =head1 SEE ALSO
76
77 memcached(1) libmemached(3) memcached_strerror(3)
78
79 =cut
80