Merge from trunk.
[awesomized/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 results
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 *memcached_result_create(memcached_st *ptr,
18 memcached_result_st *result);
19
20 void memcached_result_free(memcached_result_st *result);
21
22 char * memcached_result_key_value(memcached_result_st *result);
23
24 size_t memcached_result_key_length(memcached_result_st *result);
25
26 char *memcached_result_value(memcached_result_st *ptr);
27
28 size_t memcached_result_length(memcached_result_st *ptr);
29
30 uint32_t memcached_result_flags(memcached_result_st *result)
31
32 uint64_t memcached_result_cas(memcached_result_st *result);
33
34 memcached_return memcached_result_set_value (memcached_result_st *ptr,
35 char *value, size_t length)
36
37 void memcached_result_set_flags(memcached_result_st *ptr, uint32_t flags)
38
39 void memcached_result_set_expiration(memcached_result_st *ptr, time_t)
40
41 =head1 DESCRIPTION
42
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.
50
51 The structure of memcached_result_st has been encapsulated, you should not
52 write code to directly access members of the structure.
53
54 memcached_result_create() will either allocate memory for a
55 memcached_result_st or will initialize a structure passed to it.
56
57 memcached_result_free() will deallocate any memory attached to the
58 structure. If the structure was also alloacted, it will deallocate it.
59
60 memcached_result_key_value() returns the key value associated with the
61 current result object.
62
63 memcached_result_key_length() returns the key length associated with the
64 current result object.
65
66 memcached_result_value() returns the result value associated with the
67 current result object.
68
69 memcached_result_length() returns the result length associated with the
70 current result object.
71
72 memcached_result_flags() returns the flags associated with the
73 current result object.
74
75 memcached_result_cas() returns the cas associated with the
76 current result object. This value will only be available if the server
77 supports it.
78
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.
81
82 void memcached_result_set_flags() takes a result structure and stores
83 a new value for the flags field.
84
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
87 triggers).
88
89
90 =head1 RETURN
91
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.
95
96 =head1 HOME
97
98 To find out more information please check:
99 L<http://tangent.org/552/libmemcached.html>
100
101 =head1 AUTHOR
102
103 Brian Aker, E<lt>brian@tangent.orgE<gt>
104
105 =head1 SEE ALSO
106
107 memcached(1) libmemcached(3) memcached_strerror(3)
108
109 =cut
110