~piotr-sikora/libmemcached/fix-tests-on-openbsd

« back to all changes in this revision

Viewing changes to docs/man/memcached_result_cas.3

Merge in all of build.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.TH "MEMCACHED_RESULT_CAS" "3" "April 09, 2011" "0.47" "libmemcached"
 
2
.SH NAME
 
3
memcached_result_cas \- Working with result sets
 
4
.
 
5
.nr rst2man-indent-level 0
 
6
.
 
7
.de1 rstReportMargin
 
8
\\$1 \\n[an-margin]
 
9
level \\n[rst2man-indent-level]
 
10
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 
11
-
 
12
\\n[rst2man-indent0]
 
13
\\n[rst2man-indent1]
 
14
\\n[rst2man-indent2]
 
15
..
 
16
.de1 INDENT
 
17
.\" .rstReportMargin pre:
 
18
. RS \\$1
 
19
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
 
20
. nr rst2man-indent-level +1
 
21
.\" .rstReportMargin post:
 
22
..
 
23
.de UNINDENT
 
24
. RE
 
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
 
30
..
 
31
.\" Man page generated from reStructeredText.
 
32
.
 
33
.sp
 
34
Work with memcached_result_st
 
35
.SH LIBRARY
 
36
.sp
 
37
C Client Library for memcached (libmemcached, \-lmemcached)
 
38
.SH SYNOPSIS
 
39
.sp
 
40
.nf
 
41
.ft C
 
42
#include <libmemcached/memcached.h>
 
43
 
 
44
memcached_result_st *
 
45
  memcached_result_create (memcached_st *ptr,
 
46
                           memcached_result_st *result);
 
47
 
 
48
void memcached_result_free (memcached_result_st *result);
 
49
 
 
50
const char * memcached_result_key_value (memcached_result_st *result);
 
51
 
 
52
size_t memcached_result_key_length (const memcached_result_st *result);
 
53
 
 
54
const char *memcached_result_value (memcached_result_st *ptr);
 
55
 
 
56
size_t memcached_result_length (const memcached_result_st *ptr);
 
57
 
 
58
uint32_t memcached_result_flags (const memcached_result_st *result)
 
59
 
 
60
uint64_t memcached_result_cas (const memcached_result_st *result);
 
61
 
 
62
memcached_return_t
 
63
  memcached_result_set_value (memcached_result_st *ptr,
 
64
                              const char *value, size_t length)
 
65
 
 
66
void memcached_result_set_flags (memcached_result_st *ptr, uint32_t flags)
 
67
 
 
68
void memcached_result_set_expiration (memcached_result_st *ptr, time_t)
 
69
.ft P
 
70
.fi
 
71
.SH DESCRIPTION
 
72
.sp
 
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.
 
80
.sp
 
81
The structure of memcached_result_st has been encapsulated, you should not
 
82
write code to directly access members of the structure.
 
83
.sp
 
84
memcached_result_create() will either allocate memory for a
 
85
memcached_result_st or will initialize a structure passed to it.
 
86
.sp
 
87
memcached_result_free() will deallocate any memory attached to the
 
88
structure. If the structure was also alloacted, it will deallocate it.
 
89
.sp
 
90
memcached_result_key_value() returns the key value associated with the
 
91
current result object.
 
92
.sp
 
93
memcached_result_key_length() returns the key length associated with the
 
94
current result object.
 
95
.sp
 
96
memcached_result_value() returns the result value associated with the
 
97
current result object.
 
98
.sp
 
99
memcached_result_length() returns the result length associated with the
 
100
current result object.
 
101
.sp
 
102
memcached_result_flags() returns the flags associated with the
 
103
current result object.
 
104
.sp
 
105
memcached_result_cas() returns the cas associated with the
 
106
current result object. This value will only be available if the server
 
107
testss it.
 
108
.sp
 
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.
 
111
.sp
 
112
void memcached_result_set_flags() takes a result structure and stores
 
113
a new value for the flags field.
 
114
.sp
 
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
 
117
triggers).
 
118
.sp
 
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.
 
122
.SH RETURN
 
123
.sp
 
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.
 
127
.SH HOME
 
128
.sp
 
129
To find out more information please check:
 
130
\fI\%https://launchpad.net/libmemcached\fP
 
131
.SH SEE ALSO
 
132
.sp
 
133
\fImemcached(1)\fP \fIlibmemcached(3)\fP \fImemcached_strerror(3)\fP
 
134
.SH AUTHOR
 
135
Brian Aker
 
136
.SH COPYRIGHT
 
137
2011, Brian Aker DataDifferential, http://datadifferential.com/
 
138
.\" Generated by docutils manpage writer.
 
139
.\" 
 
140
.