3 memcached_increment, memcached_decrement,
4 memcached_increment_with_initial, memcached_decrement_with_initial - Manipulate
9 C Client Library for memcached (libmemcached, -lmemcached)
13 #include <memcached.h>
16 memcached_increment (memcached_st *ptr,
17 const char *key, size_t key_length,
22 memcached_decrement (memcached_st *ptr,
23 const char *key, size_t key_length,
28 memcached_increment_with_initial (memcached_st *ptr,
37 memcached_decrement_with_initial (memcached_st *ptr,
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,
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,
60 memcached_increment_with_initial_by_key (memcached_st *ptr,
61 const char *master_key,
62 size_t master_key_length,
71 memcached_decrement_with_initial_by_key (memcached_st *ptr,
72 const char *master_key,
73 size_t master_key_length,
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.
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.
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.
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.
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.
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
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.
126 To find out more information please check:
127 L<https://launchpad.net/libmemcached>
131 Brian Aker, E<lt>brian@tangent.orgE<gt>
135 memcached(1) libmemcached(3) memcached_strerror(3)