3 memcached_result_create, memcached_result_free,
4 memcached_result_key_value, memcached_result_key_length,
5 memcached_result_value, memcached_result_length,
6 memcached_result_flags, memcached_result_cas - Work with results
11 C Client Library for memcached (libmemcached, -lmemcached)
15 #include <memcached.h>
17 memcached_result_st *memcached_result_create(memcached_st *ptr,
18 memcached_result_st *result);
20 void memcached_result_free(memcached_result_st *result);
22 char * memcached_result_key_value(memcached_result_st *result);
24 size_t memcached_result_key_length(memcached_result_st *result);
26 char *memcached_result_value(memcached_result_st *ptr);
28 size_t memcached_result_length(memcached_result_st *ptr);
30 uint32_t memcached_result_flags(memcached_result_st *result)
32 uint64_t memcached_result_cas(memcached_result_st *result);
34 memcached_return memcached_result_set_value (memcached_result_st *ptr,
35 char *value, size_t length)
37 void memcached_result_set_flags(memcached_result_st *ptr, uint32_t flags)
39 void memcached_result_set_expiration(memcached_result_st *ptr, time_t)
43 libmemcached(3) can optionally return a memcached_result_st which acts as a
44 result object. The result objects have added benefits over the character
45 pointer returns in that they are forward compatible with new return items
46 that future memcached servers may implement (the best current example of
47 this is the CAS return item). The structures can also be reused which will
48 save on calls to malloc(3). It is suggested that you use result objects over
49 char * return functions.
51 The structure of memcached_result_st has been encapsulated, you should not
52 write code to directly access members of the structure.
54 memcached_result_create() will either allocate memory for a
55 memcached_result_st or will initialize a structure passed to it.
57 memcached_result_free() will deallocate any memory attached to the
58 structure. If the structure was also alloacted, it will deallocate it.
60 memcached_result_key_value() returns the key value associated with the
61 current result object.
63 memcached_result_key_length() returns the key length associated with the
64 current result object.
66 memcached_result_value() returns the result value associated with the
67 current result object.
69 memcached_result_length() returns the result length associated with the
70 current result object.
72 memcached_result_flags() returns the flags associated with the
73 current result object.
75 memcached_result_cas() returns the cas associated with the
76 current result object. This value will only be available if the server
79 memcached_result_set_value() takes a byte array and a size and sets
80 the result to this value. This function is used for trigger responses.
82 void memcached_result_set_flags() takes a result structure and stores
83 a new value for the flags field.
85 void memcached_result_set_expiration(A) takes a result structure and stores
86 a new value for the expiration field (this is only used by read through
92 Varies, see particular functions. All structures must have
93 memcached_result_free() called on them for cleanup purposes. Failure to
94 do this will result in leaked memory.
98 To find out more information please check:
99 L<http://tangent.org/552/libmemcached.html>
103 Brian Aker, E<lt>brian@tangent.orgE<gt>
107 memcached(1) libmemcached(3) memcached_strerror(3)