Reverting back to older version of memslap, and renaming other version
[m6w6/libmemcached] / docs / memcached_result_st.pod
1 =head1 NAME
2
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 memcached_result_st
7
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_result_st *
18 memcached_result_create (memcached_st *ptr,
19 memcached_result_st *result);
20
21 void memcached_result_free (memcached_result_st *result);
22
23 const char * memcached_result_key_value (memcached_result_st *result);
24
25 size_t memcached_result_key_length (const memcached_result_st *result);
26
27 const char *memcached_result_value (memcached_result_st *ptr);
28
29 size_t memcached_result_length (const memcached_result_st *ptr);
30
31 uint32_t memcached_result_flags (const memcached_result_st *result)
32
33 uint64_t memcached_result_cas (const memcached_result_st *result);
34
35 memcached_return_t
36 memcached_result_set_value (memcached_result_st *ptr,
37 const char *value, size_t length)
38
39 void memcached_result_set_flags (memcached_result_st *ptr, uint32_t flags)
40
41 void memcached_result_set_expiration (memcached_result_st *ptr, time_t)
42
43 =head1 DESCRIPTION
44
45 libmemcached(3) can optionally return a memcached_result_st which acts as a
46 result object. The result objects have added benefits over the character
47 pointer returns in that they are forward compatible with new return items
48 that future memcached servers may implement (the best current example of
49 this is the CAS return item). The structures can also be reused which will
50 save on calls to malloc(3). It is suggested that you use result objects over
51 char * return functions.
52
53 The structure of memcached_result_st has been encapsulated, you should not
54 write code to directly access members of the structure.
55
56 memcached_result_create() will either allocate memory for a
57 memcached_result_st or will initialize a structure passed to it.
58
59 memcached_result_free() will deallocate any memory attached to the
60 structure. If the structure was also alloacted, it will deallocate it.
61
62 memcached_result_key_value() returns the key value associated with the
63 current result object.
64
65 memcached_result_key_length() returns the key length associated with the
66 current result object.
67
68 memcached_result_value() returns the result value associated with the
69 current result object.
70
71 memcached_result_length() returns the result length associated with the
72 current result object.
73
74 memcached_result_flags() returns the flags associated with the
75 current result object.
76
77 memcached_result_cas() returns the cas associated with the
78 current result object. This value will only be available if the server
79 supports it.
80
81 memcached_result_set_value() takes a byte array and a size and sets
82 the result to this value. This function is used for trigger responses.
83
84 void memcached_result_set_flags() takes a result structure and stores
85 a new value for the flags field.
86
87 void memcached_result_set_expiration(A) takes a result structure and stores
88 a new value for the expiration field (this is only used by read through
89 triggers).
90
91 You may wish to avoid using memcached_result_create(3) with a
92 stack based allocation. The most common issues related to ABI safety involve
93 heap allocated structures.
94
95 =head1 RETURN
96
97 Varies, see particular functions. All structures must have
98 memcached_result_free() called on them for cleanup purposes. Failure to
99 do this will result in leaked memory.
100
101 =head1 HOME
102
103 To find out more information please check:
104 L<https://launchpad.net/libmemcached>
105
106 =head1 AUTHOR
107
108 Brian Aker, E<lt>brian@tangent.orgE<gt>
109
110 =head1 SEE ALSO
111
112 memcached(1) libmemcached(3) memcached_strerror(3)
113
114 =cut
115