.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Memcached::libmemcached::memcached_create 3pm" .TH Memcached::libmemcached::memcached_create 3pm "2020-11-09" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" memcached_create, memcached_free, memcached_clone, memcached_servers_reset\- Create a memcached_st structure .SH "LIBRARY" .IX Header "LIBRARY" C Client Library for memcached (libmemcached, \-lmemcached) .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& #include \& \& memcached_st *memcached_create (memcached_st *ptr); \& \& void memcached_free (memcached_st *ptr); \& \& memcached_st *memcached_clone (memcached_st *destination, memcached_st *source); \& \& void memcached_servers_reset(memcached_st); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBmemcached_create()\fR is used to create a \f(CW\*(C`memcached_st\*(C'\fR structure that will then be used by other \fBlibmemcached\fR\|(3) functions to communicate with the server. You should either pass a statically declared \f(CW\*(C`memcached_st\*(C'\fR to \fBmemcached_create()\fR or a \s-1NULL.\s0 If a \s-1NULL\s0 passed in then a structure is allocated for you. .PP \&\fBmemcached_clone()\fR is similar to \fBmemcached_create\fR\|(3) but it copies the defaults and list of servers from the source \f(CW\*(C`memcached_st\*(C'\fR. If you pass a null as the argument for the source to clone, it is the same as a call to \fBmemcached_create()\fR. If the destination argument is \s-1NULL\s0 a \f(CW\*(C`memcached_st\*(C'\fR will be allocated for you. .PP \&\fBmemcached_servers_reset()\fR allows you to zero out the list of servers that the memcached_st has. .PP To clean up memory associated with a \f(CW\*(C`memcached_st\*(C'\fR structure you should pass it to \fBmemcached_free()\fR when you are finished using it. \fBmemcached_free()\fR is the only way to make sure all memory is deallocated when you finish using the structure. .PP You may wish to avoid using \fBmemcached_create\fR\|(3) or \fBmemcached_clone\fR\|(3) with a stack based allocation. The most common issues related to \s-1ABI\s0 safety involve heap allocated structures. .SH "RETURN" .IX Header "RETURN" \&\fBmemcached_create()\fR returns a pointer to the memcached_st that was created (or initialized). On an allocation failure, it returns \s-1NULL.\s0 .PP \&\fBmemcached_clone()\fR returns a pointer to the memcached_st that was created (or initialized). On an allocation failure, it returns \s-1NULL.\s0 .SH "HOME" .IX Header "HOME" To find out more information please check: .SH "AUTHOR" .IX Header "AUTHOR" Brian Aker, .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBmemcached\fR\|(1) \fBlibmemcached\fR\|(3) \fBmemcached_strerror\fR\|(3)