4 memcached_increment, memcached_decrement, memcached_increment_with_initial, memcached_decrement_with_initial
5 ************************************************************************************************************
16 C Client Library for memcached (libmemcached, -lmemcached)
27 #include <libmemcached/memcached.h>
30 memcached_increment (memcached_st *ptr,
31 const char *key, size_t key_length,
36 memcached_decrement (memcached_st *ptr,
37 const char *key, size_t key_length,
42 memcached_increment_with_initial (memcached_st *ptr,
51 memcached_decrement_with_initial (memcached_st *ptr,
60 memcached_increment_by_key (memcached_st *ptr,
61 const char *master_key, size_t master_key_length,
62 const char *key, size_t key_length,
67 memcached_decrement_by_key (memcached_st *ptr,
68 const char *master_key, size_t master_key_length,
69 const char *key, size_t key_length,
74 memcached_increment_with_initial_by_key (memcached_st *ptr,
75 const char *master_key,
76 size_t master_key_length,
85 memcached_decrement_with_initial_by_key (memcached_st *ptr,
86 const char *master_key,
87 size_t master_key_length,
102 memcached(1) servers have the ability to increment and decrement keys
103 (overflow and underflow are not detected). This gives you the ability to use
104 memcached to generate shared sequences of values.
106 memcached_increment() takes a key and keylength and increments the value by
107 the offset passed to it. The value is then returned via the unsigned int
108 value pointer you pass to it.
110 memcached_decrement() takes a key and keylength and decrements the value by
111 the offset passed to it. The value is then returned via the unsigned int
112 value pointer you pass to it.
114 memcached_increment_with_initial() takes a key and keylength and increments
115 the value by the offset passed to it. If the object specified by key does
116 not exist, one of two things may happen: If the expiration value is
117 MEMCACHED_EXPIRATION_NOT_ADD, the operation will fail. For all other
118 expiration values, the operation will succeed by seeding the value for that
119 key with a initial value to expire with the provided expiration time. The
120 flags will be set to zero.The value is then returned via the unsigned int
121 value pointer you pass to it.
123 memcached_decrement_with_initial() takes a key and keylength and decrements
124 the value by the offset passed to it. If the object specified by key does
125 not exist, one of two things may happen: If the expiration value is
126 MEMCACHED_EXPIRATION_NOT_ADD, the operation will fail. For all other
127 expiration values, the operation will succeed by seeding the value for that
128 key with a initial value to expire with the provided expiration time. The
129 flags will be set to zero.The value is then returned via the unsigned int
130 value pointer you pass to it.
132 memcached_increment_by_key(), memcached_decrement_by_key(),
133 memcached_increment_with_initial_by_key(), and
134 memcached_decrement_with_initial_by_key() are master key equivalents of the
143 A value of type \ ``memcached_return_t``\ is returned.
144 On success that value will be \ ``MEMCACHED_SUCCESS``\ .
145 Use memcached_strerror() to translate this value to a printable string.
153 To find out more information please check:
154 `https://launchpad.net/libmemcached <https://launchpad.net/libmemcached>`_
162 Brian Aker, <brian@tangent.org>
170 memcached(1) libmemcached(3) memcached_strerror(3)