1MEMCACHED_SERVER_LIST_FREE(3)libmemcached-awesomeMEMCACHED_SERVER_LIST_FREE(3)
2
3
4
6 memcached_server_list_free - libmemcached Documentation
7
9 #include <libmemcached/memcached.h>
10 Compile and link with -lmemcached
11
12 typedef struct memcached_instance_st memcached_instance_st
13
14 typedef struct memcached_server_st memcached_server_st
15
16 typedef struct memcached_server_st *memcached_server_list_st
17
18 void memcached_server_list_free(memcached_server_list_st list)
19
20 Parameters
21 list -- instance of initialized memcached_server_list_st
22 object
23
24 memcached_server_list_st memcached_server_list_append(mem‐
25 cached_server_list_st list, const char *hostname, in_port_t port, mem‐
26 cached_return_t *error)
27
28 Parameters
29
30 • list -- instance of an existing mem‐
31 cached_server_list_st or nullptr to create one
32
33 • hostname -- the hostname or path to the socket, de‐
34 faults to localhost if null
35
36 • port -- the port to use, defaults to 11211 if 0
37
38 • error -- pointer to store any memcached_return_t error
39 indicating success
40
41 Returns
42 new instance of memcached_server_list_st on success or
43 nullptr on failure
44
45 uint32_t memcached_server_list_count(memcached_server_list_st list)
46
47 Parameters
48 list -- instance of memcached_server_list_st
49
50 Returns
51 count of servers in the list
52
53 const char *memcached_server_error(const memcached_instance_st *in‐
54 stance)
55
56 Parameters
57 instance -- pointer to an initialized memcached_in‐
58 stance_st object
59
60 Returns
61 last error message sent from the server to the client
62
63 void memcached_server_error_reset(const memcached_instance_st *list)
64 Deprecated since version 0.39.
65
66
67 void memcached_servers_parse()
68 Deprecated since version 0.39.
69
70
71 See memcached().
72
74 libmemcached operates on a list of hosts which are stored in mem‐
75 cached_server_st structures. You should not modify these structures di‐
76 rectly. Functions are provided to modify these structures.
77
78 memcached_server_list() is used to provide an array of all defined
79 hosts. This was incorrectly documented as "requiring free" up till
80 version 0.39.
81
82 memcached_server_list_free() deallocates all memory associated with the
83 array of memcached_server_st that you passed to it.
84
85 memcached_server_list_append() adds a server to the end of a mem‐
86 cached_server_st array. On error null will be returned and the mem‐
87 cached_return_t pointer you passed into the function will be set with
88 the appropriate error. If the value of port is zero, it is set to the
89 default port of a memcached server.
90
91 DEPRECATED memcached_servers_parse(), please see memcached()
92
93 memcached_server_error() can be used to look at the text of the last
94 error message sent by the server to to the client.
95
96 Before version 0.39 theses functions used a memcached_server_st *. In
97 0.39 memcached_server_st * was aliased to memcached_server_list_st.
98 This was done for a style reason to help clean up some concepts in the
99 code.
100
102 Varies, see particular functions.
103
105 memcached(1) libmemcached(3) memcached_servers(3) memcached_strerror(3)
106
107
108
109
1101.1 Sep 20, 2021 MEMCACHED_SERVER_LIST_FREE(3)