1 .TH "MEMCACHED_RESULT_KEY_LENGTH" "3" "October 26, 2011" "1.0.2" "libmemcached"
3 memcached_result_key_length \- 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.
35 #include <libmemcached/memcached_pool.h>
38 .B memcached_result_st
42 .B memcached_result_st * memcached_result_create (memcached_st *ptr, memcached_result_st *result);
46 .B void memcached_result_free (memcached_result_st *result);
50 .B const char * memcached_result_key_value (memcached_result_st *result);
54 .B size_t memcached_result_key_length (const memcached_result_st *result);
58 .B const char *memcached_result_value (memcached_result_st *ptr);
62 .B size_t memcached_result_length (const memcached_result_st *ptr);
66 .B uint32_t memcached_result_flags(const \fI\%memcached_result_st\fP\fI\ *result\fP)
70 .B uint64_t memcached_result_cas (const memcached_result_st *result);
74 .B memcached_return_t memcached_result_set_value(\fI\%memcached_result_st\fP\fI\ *ptr\fP, const char\fI\ *value\fP, size_t\fI\ length\fP)
78 .B void memcached_result_set_flags(\fI\%memcached_result_st\fP\fI\ *ptr\fP, uint32_t\fI\ flags\fP)
82 .B void memcached_result_set_expiration(\fI\%memcached_result_st\fP\fI\ *ptr\fP, time_t)
85 Compile and link with \-lmemcachedutil \-lmemcached
88 libmemcached(3) can optionally return a \fI\%memcached_result_st\fP which
89 acts as a result object. The result objects have added benefits over the
90 character pointer returns, in that they are forward compatible with new
91 return items that future memcached servers may implement (the best current
92 example of this is the CAS return item). The structures can also be reused,
93 which will save on calls to malloc(3). It is suggested that you use result
94 objects over char * return functions.
96 The structure of \fI\%memcached_result_st\fP has been encapsulated, you should
97 not write code to directly access members of the structure.
99 \fBmemcached_result_create()\fP will either allocate memory for a
100 \fI\%memcached_result_st\fP or will initialize a structure passed to it.
102 \fBmemcached_result_free()\fP will deallocate any memory attached to the
103 structure. If the structure was also allocated, it will deallocate it.
105 \fBmemcached_result_key_value()\fP returns the key value associated with the
106 current result object.
108 \fBmemcached_result_key_length()\fP returns the key length associated with
109 the current result object.
111 \fBmemcached_result_value()\fP returns the result value associated with the
112 current result object.
114 \fBmemcached_result_length()\fP returns the result length associated with
115 the current result object.
117 \fI\%memcached_result_flags()\fP returns the flags associated with the
118 current result object.
120 \fBmemcached_result_cas()\fP returns the cas associated with the
121 current result object. This value will only be available if the server
124 \fI\%memcached_result_set_value()\fP takes a byte array and a size and sets
125 the result to this value. This function is used for trigger responses.
127 \fBvoid memcached_result_set_flags()\fP takes a result structure and stores
128 a new value for the flags field.
130 \fBvoid memcached_result_set_expiration(A)()\fP takes a result structure and stores a new value for the expiration field (this is only used by read
133 You may wish to avoid using memcached_result_create(3) with a
134 stack based allocation. The most common issues related to ABI safety involve
135 heap allocated structures.
138 Varies, see particular functions. All structures must have
139 \fBmemcached_result_free()\fP called on them for cleanup purposes. Failure
140 to do this will result in leaked memory.
143 To find out more information please check:
144 \fI\%http://libmemcached.org/\fP
147 \fImemcached(1)\fP \fIlibmemcached(3)\fP \fImemcached_strerror(3)\fP
151 2011, Brian Aker DataDifferential, http://datadifferential.com/
152 .\" Generated by docutils manpage writer.