3 memcached_increment, memcached_decrement,
4 memcached_increment_with_initial, memcached_decrement_with_initial
8 C Client Library for memcached (libmemcached, -lmemcached)
12 #include <memcached.h>
15 memcached_increment (memcached_st *ptr,
16 const char *key, size_t key_length,
21 memcached_decrement (memcached_st *ptr,
22 const char *key, size_t key_length,
27 memcached_increment_with_initial (memcached_st *ptr,
36 memcached_decrement_with_initial (memcached_st *ptr,
46 memcached(1) servers have the ability to increment and decrement keys
47 (overflow and underflow are not detected). This gives you the ability to use
48 memcached to generate shared sequences of values.
50 memcached_increment() takes a key and keylength and increments the value by
51 the offset passed to it. The value is then returned via the unsigned int
52 value pointer you pass to it.
54 memcached_decrement() takes a key and keylength and decrements the value by
55 the offset passed to it. The value is then returned via the unsigned int
56 value pointer you pass to it.
58 memcached_increment_with_initial() takes a key and keylength and increments
59 the value by the offset passed to it. If the object specified by key does
60 not exist, one of two things may happen: If the expiration value is
61 MEMCACHED_EXPIRATION_NOT_ADD, the operation will fail. For all other
62 expiration values, the operation will succeed by seeding the value for that
63 key with a initial value to expire with the provided expiration time. The
64 flags will be set to zero.The value is then returned via the unsigned int
65 value pointer you pass to it.
67 memcached_decrement_with_initial() takes a key and keylength and decrements
68 the value by the offset passed to it. If the object specified by key does
69 not exist, one of two things may happen: If the expiration value is
70 MEMCACHED_EXPIRATION_NOT_ADD, the operation will fail. For all other
71 expiration values, the operation will succeed by seeding the value for that
72 key with a initial value to expire with the provided expiration time. The
73 flags will be set to zero.The value is then returned via the unsigned int
74 value pointer you pass to it.
78 A value of type C<memcached_return> is returned.
79 On success that value will be C<MEMCACHED_SUCCESS>.
80 Use memcached_strerror() to translate this value to a printable string.
84 To find out more information please check:
85 L<http://tangent.org/552/libmemcached.html>
89 Brian Aker, E<lt>brian@tangent.orgE<gt>
93 memcached(1) libmemcached(3) memcached_strerror(3)