« blib/lib/Memcached/libmemcached/memcached_analyze.pm
↑ Summary
blib/lib/Memcached/libmemcached/memcached_behavior.pm »
| 1 | package Memcached::libmemcached::memcached_auto; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | memcached_increment, memcached_decrement, | ||
| 6 | memcached_increment_with_initial, memcached_decrement_with_initial - Manipulate | ||
| 7 | counters | ||
| 8 | |||
| 9 | =head1 LIBRARY | ||
| 10 | |||
| 11 | C Client Library for memcached (libmemcached, -lmemcached) | ||
| 12 | |||
| 13 | =head1 SYNOPSIS | ||
| 14 | |||
| 15 | #include <memcached.h> | ||
| 16 | |||
| 17 | memcached_return_t | ||
| 18 | memcached_increment (memcached_st *ptr, | ||
| 19 | const char *key, size_t key_length, | ||
| 20 | unsigned int offset, | ||
| 21 | uint64_t *value); | ||
| 22 | |||
| 23 | memcached_return_t | ||
| 24 | memcached_decrement (memcached_st *ptr, | ||
| 25 | const char *key, size_t key_length, | ||
| 26 | unsigned int offset, | ||
| 27 | uint64_t *value); | ||
| 28 | |||
| 29 | memcached_return_t | ||
| 30 | memcached_increment_with_initial (memcached_st *ptr, | ||
| 31 | const char *key, | ||
| 32 | size_t key_length, | ||
| 33 | uint64_t offset, | ||
| 34 | uint64_t initial, | ||
| 35 | time_t expiration, | ||
| 36 | uint64_t *value); | ||
| 37 | |||
| 38 | memcached_return_t | ||
| 39 | memcached_decrement_with_initial (memcached_st *ptr, | ||
| 40 | const char *key, | ||
| 41 | size_t key_length, | ||
| 42 | uint64_t offset, | ||
| 43 | uint64_t initial, | ||
| 44 | time_t expiration, | ||
| 45 | uint64_t *value); | ||
| 46 | |||
| 47 | memcached_return_t | ||
| 48 | memcached_increment_by_key (memcached_st *ptr, | ||
| 49 | const char *master_key, size_t master_key_length, | ||
| 50 | const char *key, size_t key_length, | ||
| 51 | unsigned int offset, | ||
| 52 | uint64_t *value); | ||
| 53 | |||
| 54 | memcached_return_t | ||
| 55 | memcached_decrement_by_key (memcached_st *ptr, | ||
| 56 | const char *master_key, size_t master_key_length, | ||
| 57 | const char *key, size_t key_length, | ||
| 58 | unsigned int offset, | ||
| 59 | uint64_t *value); | ||
| 60 | |||
| 61 | memcached_return_t | ||
| 62 | memcached_increment_with_initial_by_key (memcached_st *ptr, | ||
| 63 | const char *master_key, | ||
| 64 | size_t master_key_length, | ||
| 65 | const char *key, | ||
| 66 | size_t key_length, | ||
| 67 | uint64_t offset, | ||
| 68 | uint64_t initial, | ||
| 69 | time_t expiration, | ||
| 70 | uint64_t *value); | ||
| 71 | |||
| 72 | memcached_return_t | ||
| 73 | memcached_decrement_with_initial_by_key (memcached_st *ptr, | ||
| 74 | const char *master_key, | ||
| 75 | size_t master_key_length, | ||
| 76 | const char *key, | ||
| 77 | size_t key_length, | ||
| 78 | uint64_t offset, | ||
| 79 | uint64_t initial, | ||
| 80 | time_t expiration, | ||
| 81 | uint64_t *value); | ||
| 82 | |||
| 83 | =head1 DESCRIPTION | ||
| 84 | |||
| 85 | memcached(1) servers have the ability to increment and decrement keys | ||
| 86 | (overflow and underflow are not detected). This gives you the ability to use | ||
| 87 | memcached to generate shared sequences of values. | ||
| 88 | |||
| 89 | memcached_increment() takes a key and keylength and increments the value by | ||
| 90 | the offset passed to it. The value is then returned via the unsigned int | ||
| 91 | value pointer you pass to it. | ||
| 92 | |||
| 93 | memcached_decrement() takes a key and keylength and decrements the value by | ||
| 94 | the offset passed to it. The value is then returned via the unsigned int | ||
| 95 | value pointer you pass to it. | ||
| 96 | |||
| 97 | memcached_increment_with_initial() takes a key and keylength and increments | ||
| 98 | the value by the offset passed to it. If the object specified by key does | ||
| 99 | not exist, one of two things may happen: If the expiration value is | ||
| 100 | MEMCACHED_EXPIRATION_NOT_ADD, the operation will fail. For all other | ||
| 101 | expiration values, the operation will succeed by seeding the value for that | ||
| 102 | key with a initial value to expire with the provided expiration time. The | ||
| 103 | flags will be set to zero.The value is then returned via the unsigned int | ||
| 104 | value pointer you pass to it. | ||
| 105 | |||
| 106 | memcached_decrement_with_initial() takes a key and keylength and decrements | ||
| 107 | the value by the offset passed to it. If the object specified by key does | ||
| 108 | not exist, one of two things may happen: If the expiration value is | ||
| 109 | MEMCACHED_EXPIRATION_NOT_ADD, the operation will fail. For all other | ||
| 110 | expiration values, the operation will succeed by seeding the value for that | ||
| 111 | key with a initial value to expire with the provided expiration time. The | ||
| 112 | flags will be set to zero.The value is then returned via the unsigned int | ||
| 113 | value pointer you pass to it. | ||
| 114 | |||
| 115 | memcached_increment_by_key(), memcached_decrement_by_key(), | ||
| 116 | memcached_increment_with_initial_by_key(), and | ||
| 117 | memcached_decrement_with_initial_by_key() are master key equivalents of the | ||
| 118 | above. | ||
| 119 | |||
| 120 | =head1 RETURN | ||
| 121 | |||
| 122 | A value of type C<memcached_return_t> is returned. | ||
| 123 | On success that value will be C<MEMCACHED_SUCCESS>. | ||
| 124 | Use memcached_strerror() to translate this value to a printable string. | ||
| 125 | |||
| 126 | =head1 HOME | ||
| 127 | |||
| 128 | To find out more information please check: | ||
| 129 | L<https://launchpad.net/libmemcached> | ||
| 130 | |||
| 131 | =head1 AUTHOR | ||
| 132 | |||
| 133 | Brian Aker, E<lt>brian@tangent.orgE<gt> | ||
| 134 | |||
| 135 | =head1 SEE ALSO | ||
| 136 | |||
| 137 | memcached(1) libmemcached(3) memcached_strerror(3) | ||
| 138 | |||
| 139 | =cut | ||
| 140 | |||
| 141 | 1 | 1; |