
memcached_increment, memcached_decrement

C Client Library for memcached (libmemcached, -lmemcached)

#include <memcached.h>
memcached_return
memcached_increment (memcached_st *ptr,
const char *key, size_t key_length,
unsigned int offset,
uint64_t *value);
memcached_return
memcached_decrement (memcached_st *ptr,
const char *key, size_t key_length,
unsigned int offset,
uint64_t *value);

memcached(1) servers have the ability to increment and decrement keys (overflow and underflow are not detected). This gives you the ability to use memcached to generate shared sequences of values.
memcached_increment() takes a key and keylength and increments the value by the offset passed to it. The value is then returned via the unsigned int value pointer you pass to it.
memcached_decrement() takes a key and keylength and decrements the value by the offset passed to it. The value is then returned via the unsigned int value pointer you pass to it.

A value of type memcached_return is returned. On success that value will be MEMCACHED_SUCCESS. Use memcached_strerror() to translate this value to a printable string.

To find out more information please check: http://tangent.org/552/libmemcached.html

Brian Aker, <brian@tangent.org>

memcached(1) libmemcached(3) memcached_strerror(3)