177bb4c89986558f51b7be7714540ce7ee5b1166
[awesomized/libmemcached] / docs / memcached_auto.pod
1 =head1 NAME
2
3 memcached_increment, memcached_decrement,
4 memcached_increment_with_initial, memcached_decrement_with_initial
5
6 =head1 LIBRARY
7
8 C Client Library for memcached (libmemcached, -lmemcached)
9
10 =head1 SYNOPSIS
11
12 #include <memcached.h>
13
14 memcached_return
15 memcached_increment (memcached_st *ptr,
16 const char *key, size_t key_length,
17 unsigned int offset,
18 uint64_t *value);
19
20 memcached_return
21 memcached_decrement (memcached_st *ptr,
22 const char *key, size_t key_length,
23 unsigned int offset,
24 uint64_t *value);
25
26 memcached_return
27 memcached_increment_with_initial (memcached_st *ptr,
28 const char *key,
29 size_t key_length,
30 uint64_t offset,
31 uint64_t initial,
32 time_t expiration,
33 uint64_t *value);
34
35 memcached_return
36 memcached_decrement_with_initial (memcached_st *ptr,
37 const char *key,
38 size_t key_length,
39 uint64_t offset,
40 uint64_t initial,
41 time_t expiration,
42 uint64_t *value);
43
44 =head1 DESCRIPTION
45
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.
49
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.
53
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.
57
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.
66
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.
75
76 =head1 RETURN
77
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.
81
82 =head1 HOME
83
84 To find out more information please check:
85 L<http://tangent.org/552/libmemcached.html>
86
87 =head1 AUTHOR
88
89 Brian Aker, E<lt>brian@tangent.orgE<gt>
90
91 =head1 SEE ALSO
92
93 memcached(1) libmemcached(3) memcached_strerror(3)
94
95 =cut
96