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