.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "MEMCACHED_SERVER_LIST_APPEND" "3" "May 01, 2024" "1.1" "libmemcached-awesome" .SH NAME memcached_server_list_append \- libmemcached Documentation .SH SYNOPSIS .INDENT 0.0 .TP .B #include Compile and link with \-lmemcached .UNINDENT .INDENT 0.0 .TP .B typedef struct \fI\%memcached_instance_st\fP memcached_instance_st .UNINDENT .INDENT 0.0 .TP .B typedef struct \fI\%memcached_server_st\fP memcached_server_st .UNINDENT .INDENT 0.0 .TP .B typedef struct \fI\%memcached_server_st\fP *memcached_server_list_st .UNINDENT .INDENT 0.0 .TP .B void memcached_server_list_free(memcached_server_list_st list) .INDENT 7.0 .TP .B Parameters \fBlist\fP \-\- instance of initialized \fBmemcached_server_list_st\fP object .UNINDENT .UNINDENT .INDENT 0.0 .TP .B memcached_server_list_st memcached_server_list_append(memcached_server_list_st list, const char *hostname, in_port_t port, \X'tty: link #_CPPv418memcached_return_t'\fI\%memcached_return_t\fP\X'tty: link' *error) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBlist\fP \-\- instance of an existing \fBmemcached_server_list_st\fP or nullptr to create one .IP \(bu 2 \fBhostname\fP \-\- the hostname or path to the socket, defaults to localhost if null .IP \(bu 2 \fBport\fP \-\- the port to use, defaults to 11211 if 0 .IP \(bu 2 \fBerror\fP \-\- pointer to store any \X'tty: link #_CPPv418memcached_return_t'\fI\%memcached_return_t\fP\X'tty: link' error indicating success .UNINDENT .TP .B Returns new instance of \fBmemcached_server_list_st\fP on success or nullptr on failure .UNINDENT .UNINDENT .INDENT 0.0 .TP .B uint32_t memcached_server_list_count(memcached_server_list_st list) .INDENT 7.0 .TP .B Parameters \fBlist\fP \-\- instance of \fBmemcached_server_list_st\fP .TP .B Returns count of servers in the list .UNINDENT .UNINDENT .INDENT 0.0 .TP .B const char *memcached_server_error(const memcached_instance_st *instance) .INDENT 7.0 .TP .B Parameters \fBinstance\fP \-\- pointer to an initialized \fBmemcached_instance_st\fP object .TP .B Returns last error message sent from the server to the client .UNINDENT .UNINDENT .INDENT 0.0 .TP .B void memcached_server_error_reset(const memcached_instance_st *list) Deprecated since version 0.39. .UNINDENT .INDENT 0.0 .TP .B void memcached_servers_parse() Deprecated since version 0.39. .sp See \X'tty: link #_CPPv49memcachedPKc6size_t'\fI\%memcached()\fP\X'tty: link'\&. .UNINDENT .SH DESCRIPTION .sp \fBlibmemcached\fP operates on a list of hosts which are stored in \fBmemcached_server_st\fP structures. You should not modify these structures directly. Functions are provided to modify these structures. .sp \fBmemcached_server_list()\fP is used to provide an array of all defined hosts. This was incorrectly documented as \(dqrequiring free\(dq up till version 0.39. .sp \fI\%memcached_server_list_free()\fP deallocates all memory associated with the array of \fBmemcached_server_st\fP that you passed to it. .sp \fI\%memcached_server_list_append()\fP adds a server to the end of a \fBmemcached_server_st\fP array. On error null will be returned and the \X'tty: link #_CPPv418memcached_return_t'\fI\%memcached_return_t\fP\X'tty: link' pointer you passed into the function will be set with the appropriate error. If the value of port is zero, it is set to the default port of a memcached server. .sp DEPRECATED \fI\%memcached_servers_parse()\fP, please see \X'tty: link #_CPPv49memcachedPKc6size_t'\fI\%memcached()\fP\X'tty: link' .sp \fI\%memcached_server_error()\fP can be used to look at the text of the last error message sent by the server to to the client. .sp Before version 0.39 theses functions used a memcached_server_st *. In 0.39 memcached_server_st * was aliased to \fBmemcached_server_list_st\fP\&. This was done for a style reason to help clean up some concepts in the code. .SH RETURN VALUE .sp Varies, see particular functions. .SH SEE ALSO .sp \fB\X'tty: link https://linux.die.net/man/1/memcached'\fI\%memcached(1)\fP\X'tty: link'\fP \fB\X'tty: link https://linux.die.net/man/3/libmemcached'\fI\%libmemcached(3)\fP\X'tty: link'\fP \fB\X'tty: link https://linux.die.net/man/3/memcached_servers'\fI\%memcached_servers(3)\fP\X'tty: link'\fP \fB\X'tty: link https://linux.die.net/man/3/memcached_strerror'\fI\%memcached_strerror(3)\fP\X'tty: link'\fP .\" Generated by docutils manpage writer. .