4da24c67e5b7a0b1dfed3a535a838b7561146642
[awesomized/libmemcached] / docs / man / memcached_clone.3
1 .TH "MEMCACHED_CLONE" "3" "May 23, 2011" "0.47" "libmemcached"
2 .SH NAME
3 memcached_clone \- libmemcached Documentation
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 memcached_st *memcached_create (memcached_st *ptr);
39 .UNINDENT
40 .INDENT 0.0
41 .TP
42 .B void memcached_free (memcached_st *ptr);
43 .UNINDENT
44 .INDENT 0.0
45 .TP
46 .B memcached_st *memcached_clone (memcached_st *destination, memcached_st *source);
47 .UNINDENT
48 .INDENT 0.0
49 .TP
50 .B void memcached_servers_reset(memcached_st);
51 .UNINDENT
52 .sp
53 Compile and link with \-lmemcached
54 .SH DESCRIPTION
55 .sp
56 memcached_create() is used to create a \fBmemcached_st\fP structure that will then
57 be used by other libmemcached(3) functions to communicate with the server. You
58 should either pass a statically declared \fBmemcached_st\fP to memcached_create() or
59 a NULL. If a NULL passed in then a structure is allocated for you.
60 .sp
61 Please note, when you write new application use memcached_create_with_options() over memcached_create().
62 .sp
63 memcached_clone() is similar to memcached_create(3) but it copies the
64 defaults and list of servers from the source \fBmemcached_st\fP. If you pass a null as
65 the argument for the source to clone, it is the same as a call to memcached_create().
66 If the destination argument is NULL a \fBmemcached_st\fP will be allocated for you.
67 .sp
68 memcached_servers_reset() allows you to zero out the list of servers that
69 the memcached_st has.
70 .sp
71 To clean up memory associated with a \fBmemcached_st\fP structure you should pass
72 it to memcached_free() when you are finished using it. memcached_free() is
73 the only way to make sure all memory is deallocated when you finish using
74 the structure.
75 .sp
76 You may wish to avoid using memcached_create(3) or memcached_clone(3) with a
77 stack based allocation. The most common issues related to ABI safety involve
78 heap allocated structures.
79 .SH RETURN
80 .sp
81 memcached_create() returns a pointer to the memcached_st that was created
82 (or initialized). On an allocation failure, it returns NULL.
83 .sp
84 memcached_clone() returns a pointer to the memcached_st that was created
85 (or initialized). On an allocation failure, it returns NULL.
86 .SH HOME
87 .sp
88 To find out more information please check:
89 \fI\%http://libmemcached.org/\fP
90 .SH SEE ALSO
91 .sp
92 \fImemcached(1)\fP \fIlibmemcached(3)\fP \fImemcached_strerror(3)\fP
93 .SH AUTHOR
94 Brian Aker
95 .SH COPYRIGHT
96 2011, Brian Aker DataDifferential, http://datadifferential.com/
97 .\" Generated by docutils manpage writer.
98 .\"
99 .