Merge Trond
[m6w6/libmemcached] / docs / memcached_auto.pod
1 =head1 NAME
2
3 memcached_increment, memcached_decrement,
4 memcached_increment_with_initial, memcached_decrement_with_initial - Manipulate
5 counters
6
7 =head1 LIBRARY
8
9 C Client Library for memcached (libmemcached, -lmemcached)
10
11 =head1 SYNOPSIS
12
13 #include <memcached.h>
14
15 memcached_return
16 memcached_increment (memcached_st *ptr,
17 const char *key, size_t key_length,
18 unsigned int offset,
19 uint64_t *value);
20
21 memcached_return
22 memcached_decrement (memcached_st *ptr,
23 const char *key, size_t key_length,
24 unsigned int offset,
25 uint64_t *value);
26
27 memcached_return
28 memcached_increment_with_initial (memcached_st *ptr,
29 const char *key,
30 size_t key_length,
31 uint64_t offset,
32 uint64_t initial,
33 time_t expiration,
34 uint64_t *value);
35
36 memcached_return
37 memcached_decrement_with_initial (memcached_st *ptr,
38 const char *key,
39 size_t key_length,
40 uint64_t offset,
41 uint64_t initial,
42 time_t expiration,
43 uint64_t *value);
44
45 =head1 DESCRIPTION
46
47 memcached(1) servers have the ability to increment and decrement keys
48 (overflow and underflow are not detected). This gives you the ability to use
49 memcached to generate shared sequences of values.
50
51 memcached_increment() takes a key and keylength and increments the value by
52 the offset passed to it. The value is then returned via the unsigned int
53 value pointer you pass to it.
54
55 memcached_decrement() takes a key and keylength and decrements the value by
56 the offset passed to it. The value is then returned via the unsigned int
57 value pointer you pass to it.
58
59 memcached_increment_with_initial() takes a key and keylength and increments
60 the value by the offset passed to it. If the object specified by key does
61 not exist, one of two things may happen: If the expiration value is
62 MEMCACHED_EXPIRATION_NOT_ADD, the operation will fail. For all other
63 expiration values, the operation will succeed by seeding the value for that
64 key with a initial value to expire with the provided expiration time. The
65 flags will be set to zero.The value is then returned via the unsigned int
66 value pointer you pass to it.
67
68 memcached_decrement_with_initial() takes a key and keylength and decrements
69 the value by the offset passed to it. If the object specified by key does
70 not exist, one of two things may happen: If the expiration value is
71 MEMCACHED_EXPIRATION_NOT_ADD, the operation will fail. For all other
72 expiration values, the operation will succeed by seeding the value for that
73 key with a initial value to expire with the provided expiration time. The
74 flags will be set to zero.The value is then returned via the unsigned int
75 value pointer you pass to it.
76
77 =head1 RETURN
78
79 A value of type C<memcached_return> is returned.
80 On success that value will be C<MEMCACHED_SUCCESS>.
81 Use memcached_strerror() to translate this value to a printable string.
82
83 =head1 HOME
84
85 To find out more information please check:
86 L<http://tangent.org/552/libmemcached.html>
87
88 =head1 AUTHOR
89
90 Brian Aker, E<lt>brian@tangent.orgE<gt>
91
92 =head1 SEE ALSO
93
94 memcached(1) libmemcached(3) memcached_strerror(3)
95
96 =cut
97