MEMCACHED_SERVER_LIST_FREE(3)
π MEMCACHED_SERVER_LIST_FREE π
okay so hi bestie, welcome to section 3 of the manual for libmemcached-awesome πΈ this is the page about memcached_server_list_free and the lil server-list squad it rolls with. grab a boba, we're doing pointers π§β¨
β¨ NAME β¨
memcached_server_list_free β libmemcached Documentation. that's it, that's the name, no cap π
π¦ SYNOPSIS π¦
first things first, you gotta pull in the header:
#include <libmemcached/memcached.h>
and then you compile and link with -lmemcached. yes literally those exact flags, don't freestyle it π
now the typedefs, and listen, these are important so read them slowly:
typedef struct memcached_instance_st memcached_instance_st
typedef struct memcached_server_st memcached_server_st
typedef struct memcached_server_st *memcached_server_list_st
okay and here come the functions π
π memcached_server_list_free
void memcached_server_list_free(memcached_server_list_st list)
Parameters
listβ instance of initializedmemcached_server_list_stobject
π memcached_server_list_append
memcached_server_list_st
memcached_server_list_append(memcached_server_list_st list, const char
*hostname, in_port_t port, memcached_return_t *error)
Parameters
listβ instance of an existingmemcached_server_list_stornullptrto create onehostnameβ the hostname or path to the socket, defaults tolocalhostif nullportβ the port to use, defaults to11211if0errorβ pointer to store anymemcached_return_terror indicating success
Returns
new instance of memcached_server_list_st on success or nullptr on failure
π memcached_server_list_count
uint32_t memcached_server_list_count(memcached_server_list_st list)
Parameters
listβ instance ofmemcached_server_list_st
Returns
count of servers in the list
π memcached_server_error
const char *memcached_server_error(const memcached_instance_st
*instance)
Parameters
instanceβ pointer to an initializedmemcached_instance_stobject
Returns
last error message sent from the server to the client
π memcached_server_error_reset
void memcached_server_error_reset(const memcached_instance_st *list)
π« Deprecated since version 0.39. she's retired bestie, do not use her.
π memcached_servers_parse
void memcached_servers_parse()
π« Deprecated since version 0.39.
See memcached().
π DESCRIPTION π
so here's the whole vibe: libmemcached operates on a list of hosts which are stored in memcached_server_st structures. and like, do NOT modify these structures directly, i'm so serious π that's literally what the functions are for. Functions are provided to modify these structures. use them. love them. respect them. π«Ά
memcached_server_list() is used to provide an array of all defined hosts. and okay funny story, this was incorrectly documented as "requiring free" up till version 0.39. embarrassing behavior honestly, we don't talk about it π
memcached_server_list_free() deallocates all memory associated with the array of memcached_server_st that you passed to it. it's giving cleanup era π§Ήβ¨
memcached_server_list_append() adds a server to the end of a memcached_server_st array. On error null will be returned and the 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 port of a memcached server. cute right? iconic default behavior π
DEPRECATED memcached_servers_parse(), please see memcached(). like genuinely please see it, this one's old news π
memcached_server_error() can be used to look at the text of the last error message sent by the server to to the client. yes it says "to to", we're keeping it, it's part of the lore π
Before version 0.39 theses functions used a memcached_server_st *. In 0.39 memcached_server_st * was aliased to memcached_server_list_st. This was done for a style reason to help clean up some concepts in the code. glow-up arc fr fr πβ
π₯ RETURN VALUE π₯
Varies, see particular functions. yeah that's the whole thing, it's giving mysterious main character energy, go read the individual functions bestie π
π SEE ALSO π
and that's the page!! π this was libmemcached-awesome, version 1.1, dated Jul 24, 2025 β go forth and free your server lists responsibly, mwah πβ¨π
π¦ where this page comes from
- fedora 43: libmemcached-awesome-devel 1.1.4-7.fc43 Β· BSD-3-Clause
- fedora 43: libmemcached-awesome-devel 1.1.4-7.fc43 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms