1 .TH "MEMCACHED_CLONE" "3" "April 14, 2011" "0.47" "libmemcached"
3 memcached_clone \- libmemcached Documentation
5 .nr rst2man-indent-level 0
9 level \\n[rst2man-indent-level]
10 level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
17 .\" .rstReportMargin pre:
19 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
20 . nr rst2man-indent-level +1
21 .\" .rstReportMargin post:
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
31 .\" Man page generated from reStructeredText.
34 Create a memcached_st structure
37 #include <libmemcached/memcached.h>
40 .B memcached_st *memcached_create (memcached_st *ptr);
44 .B void memcached_free (memcached_st *ptr);
48 .B memcached_st *memcached_clone (memcached_st *destination, memcached_st *source);
52 .B void memcached_servers_reset(memcached_st);
55 Compile and link with \-lmemcached
58 memcached_create() is used to create a \fBmemcached_st\fP structure that will then
59 be used by other libmemcached(3) functions to communicate with the server. You
60 should either pass a statically declared \fBmemcached_st\fP to memcached_create() or
61 a NULL. If a NULL passed in then a structure is allocated for you.
63 Please note, when you write new application use memcached_create_with_options() over memcached_create().
65 memcached_clone() is similar to memcached_create(3) but it copies the
66 defaults and list of servers from the source \fBmemcached_st\fP. If you pass a null as
67 the argument for the source to clone, it is the same as a call to memcached_create().
68 If the destination argument is NULL a \fBmemcached_st\fP will be allocated for you.
70 memcached_servers_reset() allows you to zero out the list of servers that
73 To clean up memory associated with a \fBmemcached_st\fP structure you should pass
74 it to memcached_free() when you are finished using it. memcached_free() is
75 the only way to make sure all memory is deallocated when you finish using
78 You may wish to avoid using memcached_create(3) or memcached_clone(3) with a
79 stack based allocation. The most common issues related to ABI safety involve
80 heap allocated structures.
83 memcached_create() returns a pointer to the memcached_st that was created
84 (or initialized). On an allocation failure, it returns NULL.
86 memcached_clone() returns a pointer to the memcached_st that was created
87 (or initialized). On an allocation failure, it returns NULL.
90 To find out more information please check:
91 \fI\%http://libmemcached.org/\fP
94 \fImemcached(1)\fP \fIlibmemcached(3)\fP \fImemcached_strerror(3)\fP
98 2011, Brian Aker DataDifferential, http://datadifferential.com/
99 .\" Generated by docutils manpage writer.