Merge in trunk
[awesomized/libmemcached] / docs / man / memcached_fetch.3
1 .TH "MEMCACHED_FETCH" "3" "October 18, 2011" "1.01" "libmemcached"
2 .SH NAME
3 memcached_fetch \- Retrieving data from the server
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 .SH SYNOPSIS
34 .sp
35 #include <libmemcached/memcached.h>
36 .INDENT 0.0
37 .TP
38 .B char *memcached_fetch(memcached_st\fI\ *ptr\fP, char\fI\ *key\fP, size_t\fI\ *key_length\fP, size_t\fI\ *value_length\fP, uint32_t\fI\ *flags\fP, memcached_return_t\fI\ *error\fP)
39 .sp
40 Deprecated since version 0.50: Use \fBmemcached_fetch_result()\fP instead.
41 .UNINDENT
42 .sp
43 Compile and link with \-lmemcached
44 .SH DESCRIPTION
45 .sp
46 \fI\%memcached_fetch()\fP is used to fetch an individual value from the server. \fBmemcached_mget()\fP must always be called before using this method.
47 You must pass in a key and its length to fetch the object. You must supply
48 three pointer variables which will give you the state of the returned
49 object. A \fBuint32_t\fP pointer to contain whatever flags you stored with the value, a \fBsize_t\fP pointer which will be filled with size of of the
50 object, and a \fBmemcached_return_t\fP pointer to hold any error. The
51 object will be returned upon success and NULL will be returned on failure. \fBMEMCACHD_END\fP is returned by the *error value when all objects that have been found are returned. The final value upon \fBMEMCACHED_END\fP is null.
52 .sp
53 Values returned by \fI\%memcached_fetch()\fP must be freed by the caller.
54 .sp
55 All of the above functions are not tested when the
56 \fBMEMCACHED_BEHAVIOR_USE_UDP\fP has been set. Executing any of these
57 functions with this behavior on will result in \fBMEMCACHED_NOT_SUPPORTED\fP being returned, or for those functions which do not return a \fBmemcached_return_t\fP, the error function parameter will be set to \fBMEMCACHED_NOT_SUPPORTED\fP.
58 .SH RETURN
59 .sp
60 \fI\%memcached_fetch()\fP sets error to
61 to \fBMEMCACHED_END\fP upon successful conclusion.
62 \fBMEMCACHED_NOTFOUND\fP will be return if no keys at all were found.
63 .sp
64 \fBMEMCACHED_KEY_TOO_BIG\fP is set to error whenever :c:\fBmemcached_fetch()\fP was used
65 and the key was set larger then \fBMEMCACHED_MAX_KEY\fP, which was the largest
66 key allowed for the original memcached ascii server.
67 .SH HOME
68 .sp
69 To find out more information please check:
70 \fI\%http://libmemcached.org/\fP
71 .SH SEE ALSO
72 .sp
73 \fImemcached(1)\fP \fIlibmemcached(3)\fP \fImemcached_strerror(3)\fP \fImemcached_fetch_result(3)\fP
74 .SH AUTHOR
75 Brian Aker
76 .SH COPYRIGHT
77 2011, Brian Aker DataDifferential, http://datadifferential.com/
78 .\" Generated by docutils manpage writer.
79 .\"
80 .