Merge build trunk.
[awesomized/libmemcached] / docs / man / memcached_create.3
1 .TH "MEMCACHED_CREATE" "3" "October 18, 2011" "1.01" "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 memcachd_st
39 .UNINDENT
40 .INDENT 0.0
41 .TP
42 .B memcached_st* memcached_create(memcached_st\fI\ *ptr\fP)
43 .UNINDENT
44 .INDENT 0.0
45 .TP
46 .B void memcached_free(memcached_st\fI\ *ptr\fP)
47 .UNINDENT
48 .INDENT 0.0
49 .TP
50 .B memcached_st* memcached_clone(memcached_st\fI\ *destination\fP, memcached_st\fI\ *source\fP)
51 .UNINDENT
52 .INDENT 0.0
53 .TP
54 .B void memcached_servers_reset(memcached_st)
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 \fBmemcached_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 \fBmemcached_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_create_with_options()\fP over
68 \fI\%memcached_create()\fP.
69 .sp
70 \fI\%memcached_clone()\fP is similar to \fI\%memcached_create()\fP but
71 it copies the defaults and list of servers from the source
72 \fBmemcached_st\fP. If you pass a null as the argument for the source
73 to clone, it is the same as a call to \fI\%memcached_create()\fP.
74 If the destination argument is NULL a \fBmemcached_st\fP will be allocated
75 for you.
76 .sp
77 \fI\%memcached_servers_reset()\fP allows you to zero out the list of
78 servers that the \fBmemcached_st\fP has.
79 .sp
80 To clean up memory associated with a \fBmemcached_st\fP structure you
81 should pass it to \fI\%memcached_free()\fP when you are finished using it.
82 \fI\%memcached_free()\fP is the only way to make sure all memory is
83 deallocated when you finish using the structure.
84 .sp
85 You may wish to avoid using memcached_create(3) or memcached_clone(3) with a
86 stack based allocation. The most common issues related to ABI safety involve
87 heap allocated structures.
88 .SH RETURN
89 .sp
90 \fI\%memcached_create()\fP returns a pointer to the \fBmemcached_st\fP
91 that was created (or initialized). On an allocation failure, it returns NULL.
92 .sp
93 \fI\%memcached_clone()\fP returns a pointer to the \fBmemcached_st\fP
94 that was created (or initialized). On an allocation failure, it returns NULL.
95 .SH HOME
96 .sp
97 To find out more information please check:
98 \fI\%http://libmemcached.org/\fP
99 .SH SEE ALSO
100 .sp
101 \fImemcached(1)\fP \fIlibmemcached(3)\fP \fImemcached_strerror(3)\fP
102 .SH AUTHOR
103 Brian Aker
104 .SH COPYRIGHT
105 2011, Brian Aker DataDifferential, http://datadifferential.com/
106 .\" Generated by docutils manpage writer.
107 .\"
108 .