docs: flush libmemcached
[awesomized/libmemcached] / docs / source / libmemcached / memcached_server_st.rst
1 Managing lists of servers
2 =========================
3
4 SYNOPSIS
5 --------
6
7 #include <libmemcached/memcached.h>
8 Compile and link with -lmemcached
9
10 .. c:type:: struct memcached_instance_st memcached_instance_st
11
12 .. c:type:: struct memcached_server_st memcached_server_st
13
14 .. c:type:: struct memcached_server_st *memcached_server_list_st
15
16 .. function:: void memcached_server_list_free (memcached_server_list_st list)
17
18 :param list: instance of initialized `memcached_server_list_st` object
19
20 .. function:: memcached_server_list_st memcached_server_list_append (memcached_server_list_st list, const char *hostname, in_port_t port, memcached_return_t *error)
21
22 :param list: instance of an existing `memcached_server_list_st` or nullptr to create one
23 :param hostname: the hostname or path to the socket, defaults to localhost if null
24 :param port: the port to use, defaults to 11211 if 0
25 :param error: pointer to store any `memcached_return_t` error indicating success
26 :returns: new instance of `memcached_server_list_st` on success or nullptr on failure
27
28 .. function:: uint32_t memcached_server_list_count (memcached_server_list_st list)
29
30 :param list: instance of `memcached_server_list_st`
31 :returns: count of servers in the list
32
33 .. function:: const char *memcached_server_error (const memcached_instance_st * instance)
34
35 :param instance: pointer to an initialized `memcached_instance_st` object
36 :returns: last error message sent from the server to the client
37
38 .. function:: void memcached_server_error_reset (const memcached_instance_st * list)
39
40 .. deprecated:: 0.39
41
42 .. function:: void memcached_servers_parse ()
43
44 .. deprecated:: 0.39
45
46 See `memcached`.
47
48 DESCRIPTION
49 -----------
50
51 `libmemcached` operates on a list of hosts which are stored in
52 :type:`memcached_server_st` structures. You should not modify these structures
53 directly. Functions are provided to modify these structures.
54
55 :func:`memcached_server_list` is used to provide an array of all defined hosts.
56 This was incorrectly documented as "requiring free" up till version 0.39.
57
58 :func:`memcached_server_list_free` deallocates all memory associated with the
59 array of :type:`memcached_server_st` that you passed to it.
60
61 :func:`memcached_server_list_append` adds a server to the end of a
62 :type:`memcached_server_st` array. On error null will be returned and the
63 :type:`memcached_return_t` 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
64 port of a memcached server.
65
66 DEPRECATED :func:`memcached_servers_parse`, please see :func:`memcached`
67
68 :func:`memcached_server_error` can be used to look at the text of the last
69 error message sent by the server to to the client.
70
71 Before version 0.39 theses functions used a memcached_server_st \*. In 0.39
72 memcached_server_st \* was aliased to :type:`memcached_server_list_st`.
73 This was done for a style reason to help clean up some concepts in the code.
74
75 RETURN VALUE
76 ------------
77
78 Varies, see particular functions.
79
80 SEE ALSO
81 --------
82
83 .. only:: man
84
85 :manpage:`memcached(1)`
86 :manpage:`libmemcached(3)`
87 :manpage:`memcached_servers(3)`
88 :manpage:`memcached_strerror(3)`
89
90 .. only:: html
91
92 * :manpage:`memcached(1)`
93 * :doc:`../libmemcached`
94 * :doc:`memcached_servers`
95 * :doc:`memcached_strerror`