Rollup merge.
[awesomized/libmemcached] / docs / memcached_auto.pod
1 =head1 NAME
2
3 memcached_increment, memcached_decrement,
4 memcached_increment_with_initial, memcached_decrement_with_initial - Manipulate
5 counters
6
7 =head1 LIBRARY
8
9 C Client Library for memcached (libmemcached, -lmemcached)
10
11 =head1 SYNOPSIS
12
13 #include <memcached.h>
14
15 memcached_return_t
16 memcached_increment (memcached_st *ptr,
17 const char *key, size_t key_length,
18 unsigned int offset,
19 uint64_t *value);
20
21 memcached_return_t
22 memcached_decrement (memcached_st *ptr,
23 const char *key, size_t key_length,
24 unsigned int offset,
25 uint64_t *value);
26
27 memcached_return_t
28 memcached_increment_with_initial (memcached_st *ptr,
29 const char *key,
30 size_t key_length,
31 uint64_t offset,
32 uint64_t initial,
33 time_t expiration,
34 uint64_t *value);
35
36 memcached_return_t
37 memcached_decrement_with_initial (memcached_st *ptr,
38 const char *key,
39 size_t key_length,
40 uint64_t offset,
41 uint64_t initial,
42 time_t expiration,
43 uint64_t *value);
44
45 memcached_return_t
46 memcached_increment_by_key (memcached_st *ptr,
47 const char *master_key, size_t master_key_length,
48 const char *key, size_t key_length,
49 unsigned int offset,
50 uint64_t *value);
51
52 memcached_return_t
53 memcached_decrement_by_key (memcached_st *ptr,
54 const char *master_key, size_t master_key_length,
55 const char *key, size_t key_length,
56 unsigned int offset,
57 uint64_t *value);
58
59 memcached_return_t
60 memcached_increment_with_initial_by_key (memcached_st *ptr,
61 const char *master_key,
62 size_t master_key_length,
63 const char *key,
64 size_t key_length,
65 uint64_t offset,
66 uint64_t initial,
67 time_t expiration,
68 uint64_t *value);
69
70 memcached_return_t
71 memcached_decrement_with_initial_by_key (memcached_st *ptr,
72 const char *master_key,
73 size_t master_key_length,
74 const char *key,
75 size_t key_length,
76 uint64_t offset,
77 uint64_t initial,
78 time_t expiration,
79 uint64_t *value);
80
81 =head1 DESCRIPTION
82
83 memcached(1) servers have the ability to increment and decrement keys
84 (overflow and underflow are not detected). This gives you the ability to use
85 memcached to generate shared sequences of values.
86
87 memcached_increment() takes a key and keylength and increments the value by
88 the offset passed to it. The value is then returned via the unsigned int
89 value pointer you pass to it.
90
91 memcached_decrement() takes a key and keylength and decrements the value by
92 the offset passed to it. The value is then returned via the unsigned int
93 value pointer you pass to it.
94
95 memcached_increment_with_initial() takes a key and keylength and increments
96 the value by the offset passed to it. If the object specified by key does
97 not exist, one of two things may happen: If the expiration value is
98 MEMCACHED_EXPIRATION_NOT_ADD, the operation will fail. For all other
99 expiration values, the operation will succeed by seeding the value for that
100 key with a initial value to expire with the provided expiration time. The
101 flags will be set to zero.The value is then returned via the unsigned int
102 value pointer you pass to it.
103
104 memcached_decrement_with_initial() takes a key and keylength and decrements
105 the value by the offset passed to it. If the object specified by key does
106 not exist, one of two things may happen: If the expiration value is
107 MEMCACHED_EXPIRATION_NOT_ADD, the operation will fail. For all other
108 expiration values, the operation will succeed by seeding the value for that
109 key with a initial value to expire with the provided expiration time. The
110 flags will be set to zero.The value is then returned via the unsigned int
111 value pointer you pass to it.
112
113 memcached_increment_by_key(), memcached_decrement_by_key(),
114 memcached_increment_with_initial_by_key(), and
115 memcached_decrement_with_initial_by_key() are master key equivalents of the
116 above.
117
118 =head1 RETURN
119
120 A value of type C<memcached_return_t> is returned.
121 On success that value will be C<MEMCACHED_SUCCESS>.
122 Use memcached_strerror() to translate this value to a printable string.
123
124 =head1 HOME
125
126 To find out more information please check:
127 L<https://launchpad.net/libmemcached>
128
129 =head1 AUTHOR
130
131 Brian Aker, E<lt>brian@tangent.orgE<gt>
132
133 =head1 SEE ALSO
134
135 memcached(1) libmemcached(3) memcached_strerror(3)
136
137 =cut
138