1
.TH "MEMCACHED_RESULT_CAS" "3" "April 09, 2011" "0.47" "libmemcached"
3
memcached_result_cas \- Working with result sets
5
.nr rst2man-indent-level 0
9
level \\n[rst2man-indent-level]
10
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
17
.\" .rstReportMargin pre:
19
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
20
. nr rst2man-indent-level +1
21
.\" .rstReportMargin post:
25
.\" indent \\n[an-margin]
26
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
27
.nr rst2man-indent-level -1
28
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
29
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
31
.\" Man page generated from reStructeredText.
34
Work with memcached_result_st
37
C Client Library for memcached (libmemcached, \-lmemcached)
42
#include <libmemcached/memcached.h>
45
memcached_result_create (memcached_st *ptr,
46
memcached_result_st *result);
48
void memcached_result_free (memcached_result_st *result);
50
const char * memcached_result_key_value (memcached_result_st *result);
52
size_t memcached_result_key_length (const memcached_result_st *result);
54
const char *memcached_result_value (memcached_result_st *ptr);
56
size_t memcached_result_length (const memcached_result_st *ptr);
58
uint32_t memcached_result_flags (const memcached_result_st *result)
60
uint64_t memcached_result_cas (const memcached_result_st *result);
63
memcached_result_set_value (memcached_result_st *ptr,
64
const char *value, size_t length)
66
void memcached_result_set_flags (memcached_result_st *ptr, uint32_t flags)
68
void memcached_result_set_expiration (memcached_result_st *ptr, time_t)
73
libmemcached(3) can optionally return a memcached_result_st which acts as a
74
result object. The result objects have added benefits over the character
75
pointer returns in that they are forward compatible with new return items
76
that future memcached servers may implement (the best current example of
77
this is the CAS return item). The structures can also be reused which will
78
save on calls to malloc(3). It is suggested that you use result objects over
79
char * return functions.
81
The structure of memcached_result_st has been encapsulated, you should not
82
write code to directly access members of the structure.
84
memcached_result_create() will either allocate memory for a
85
memcached_result_st or will initialize a structure passed to it.
87
memcached_result_free() will deallocate any memory attached to the
88
structure. If the structure was also alloacted, it will deallocate it.
90
memcached_result_key_value() returns the key value associated with the
91
current result object.
93
memcached_result_key_length() returns the key length associated with the
94
current result object.
96
memcached_result_value() returns the result value associated with the
97
current result object.
99
memcached_result_length() returns the result length associated with the
100
current result object.
102
memcached_result_flags() returns the flags associated with the
103
current result object.
105
memcached_result_cas() returns the cas associated with the
106
current result object. This value will only be available if the server
109
memcached_result_set_value() takes a byte array and a size and sets
110
the result to this value. This function is used for trigger responses.
112
void memcached_result_set_flags() takes a result structure and stores
113
a new value for the flags field.
115
void memcached_result_set_expiration(A) takes a result structure and stores
116
a new value for the expiration field (this is only used by read through
119
You may wish to avoid using memcached_result_create(3) with a
120
stack based allocation. The most common issues related to ABI safety involve
121
heap allocated structures.
124
Varies, see particular functions. All structures must have
125
memcached_result_free() called on them for cleanup purposes. Failure to
126
do this will result in leaked memory.
129
To find out more information please check:
130
\fI\%https://launchpad.net/libmemcached\fP
133
\fImemcached(1)\fP \fIlibmemcached(3)\fP \fImemcached_strerror(3)\fP
137
2011, Brian Aker DataDifferential, http://datadifferential.com/
138
.\" Generated by docutils manpage writer.