Updating for 1.0.2 release
[awesomized/libmemcached] / docs / man / memcached_append.3
1 .TH "MEMCACHED_APPEND" "3" "October 26, 2011" "1.0.2" "libmemcached"
2 .SH NAME
3 memcached_append \- Appending to or Prepending to data on 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 .sp
34 Appending or Prepending to data on the server
35 .SH SYNOPSIS
36 .sp
37 #include <libmemcached/memcached.h>
38 .INDENT 0.0
39 .TP
40 .B memcached_return_t memcached_prepend(memcached_st\fI\ *ptr\fP, const char\fI\ *key\fP, size_t\fI\ key_length\fP, const char\fI\ *value\fP, size_t\fI\ value_length\fP, time_t\fI\ expiration\fP, uint32_t\fI\ flags\fP)
41 .UNINDENT
42 .INDENT 0.0
43 .TP
44 .B memcached_return_t memcached_append(memcached_st\fI\ *ptr\fP, const char\fI\ *key\fP, size_t\fI\ key_length\fP, const char\fI\ *value\fP, size_t\fI\ value_length\fP, time_t\fI\ expiration\fP, uint32_t\fI\ flags\fP)
45 .UNINDENT
46 .INDENT 0.0
47 .TP
48 .B memcached_return_t memcached_prepend_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags);
49 .UNINDENT
50 .INDENT 0.0
51 .TP
52 .B memcached_return_t memcached_append_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags);
53 .UNINDENT
54 .sp
55 Compile and link with \-lmemcached
56 .SH DESCRIPTION
57 .sp
58 \fI\%memcached_prepend()\fP and memcached_append are used to
59 modify information on a server. All methods take a key, and its length to
60 store the object. Keys are currently limited to 250 characters when using
61 either a version of memcached which is 1.4 or below, or when using the text
62 protocol. You must supply both a value and a length. Optionally you
63 may test an expiration time for the object and a 16 byte value (it is
64 meant to be used as a bitmap). "flags" is a 4byte space that is stored
65 alongside of the main value. Many sub libraries make use of this field,
66 so in most cases users should avoid making use of it.
67 .sp
68 \fI\%memcached_prepend()\fP places a segment of data before the last piece
69 of data stored. Currently expiration and key are not used in the server.
70 .sp
71 \fI\%memcached_append()\fP places a segment of data at the end of the last
72 piece of data stored. Currently expiration and key are not used in the server.
73 .sp
74 \fBmemcached_prepend_by_key()\fP and
75 \fBmemcached_append_by_key_by_key()\fP methods both behave in a similar
76 method as the non key methods. The difference is that they use their
77 group_key parameter to map objects to particular servers.
78 .sp
79 If you are looking for performance, \fBmemcached_set()\fP with non\-blocking
80 IO is the fastest way to store data on the server.
81 .sp
82 All of the above functions are testsed with the
83 \fBMEMCACHED_BEHAVIOR_USE_UDP\fP behavior enabled. However, when using
84 these operations with this behavior on, there are limits to the size of the
85 payload being sent to the server. The reason for these limits is that the
86 Memcached Server does not allow multi\-datagram requests
87 and the current server implementation sets a datagram size to 1400 bytes. Due
88 to protocol overhead, the actual limit of the user supplied data is less than
89 1400 bytes and depends on the protocol in use as, well as the operation being
90 executed. When running with the binary protocol,
91 \fBMEMCACHED_BEHAVIOR_BINARY_PROTOCOL\fP, the size of the key,value,
92 flags and expiry combined may not exceed 1368 bytes. When running with the
93 ASCII protocol, the exact limit fluctuates depending on which function is
94 being executed and whether the function is a cas operation or not. For
95 non\-cas ASCII set operations, there are at least 1335 bytes available
96 to split among the key, key_prefix, and value; for cas ASCII operations
97 there are at least 1318 bytes available to split among the key, key_prefix
98 and value. If the total size of the command, including overhead, exceeds
99 1400 bytes, a \fBMEMCACHED_WRITE_FAILURE\fP will be returned.
100 .SH RETURN
101 .sp
102 All methods return a value of type \fBmemcached_return_t\fP.
103 On success the value will be \fBMEMCACHED_SUCCESS\fP.
104 Use \fBmemcached_strerror()\fP to translate this value to a printable
105 string.
106 .SH HOME
107 .sp
108 To find out more information please check:
109 \fI\%http://libmemcached.org/\fP
110 .SH SEE ALSO
111 .sp
112 \fImemcached(1)\fP \fIlibmemached(3)\fP \fImemcached_strerror(3)\fP \fImemcached_set(3)\fP \fImemcached_add(3)\fP \fImemcached_cas(3)\fP \fImemcached_replace(3)\fP
113 .SH AUTHOR
114 Brian Aker
115 .SH COPYRIGHT
116 2011, Brian Aker DataDifferential, http://datadifferential.com/
117 .\" Generated by docutils manpage writer.
118 .\"
119 .