Memcac...ver_st(3pm)

πŸ’– NAME πŸ’–

okay bestie, gather round β€” this page is the whole girl squad of functions that Manage server list πŸ’…

The lineup is:

  • memcached_server_list_free
  • memcached_server_list_append
  • memcached_server_list_count
  • memcached_servers_parse

It's a perl doc page, section 3pm, and yes it's the one with the squeezed title Memcac...ver_st(3pm) β€” the terminal was being dramatic and truncating, we move on πŸ’€


πŸ“š LIBRARY πŸ“š

C Client Library for memcached β€” that's libmemcached, linked with -lmemcached.


πŸŽ€ SYNOPSIS πŸŽ€

#include <memcached.h>

const memcached_server_instance_st
  memcached_server_list (memcached_st *ptr);

void memcached_server_list_free (memcached_server_list_st list);

memcached_server_list_st
  memcached_server_list_append (memcached_server_list_st list,
                                const char *hostname,
                                unsigned int port,
                                memcached_return_t *error);

uint32_t memcached_server_list_count (memcached_server_list_st list);

memcached_server_list_st memcached_servers_parse (const char *server_strings);

const char *memcached_server_error (memcached_server_instance_st instance);

🚫 DEPRECATED 🚫

void memcached_server_error_reset (memcached_server_instance_st list);

she's deprecated, bestie β€” don't build your whole personality around her. πŸ™ˆ


🌸 DESCRIPTION 🌸

libmemcached(3) operates on a list of hosts, and those hosts live in memcached_server_st structures. Do not touch those structures directly, periodt. The way that you get to poke at them is through the functions here (and more can be added β€” literally just ask! 🫢).

  • memcached_server_list() β€” hands you an array of every host that's defined. ✨ Fun lore: up until version 0.39 this was incorrectly documented as "requiring free()". It does not. The docs simply lied, iykyk.
  • memcached_server_list_free() β€” deallocates all the memory associated with the array of memcached_server_st that you passed in. Let her go, girl 🌈
  • memcached_server_list_append() β€” adds a server to the end of a memcached_server_st array. If something goes wrong, null gets returned and the memcached_return_t pointer you passed in gets set to the appropriate error. And if the value of port is zero? It gets set to the default port of a memcached server. cute, no notes πŸ’…
  • memcached_servers_parse() β€” takes a string (the type used for the command line applications) and parses it into an array of memcached_server_st. Example being "localhost, foo:555, foo, bar". Every host except foo:555 gets the default port, and foo:555 gets a port of 555. she's specific, she's iconic πŸ‘‘
  • memcached_server_error() β€” lets you look at the text of the last error message that the server sent to the client. your receipts, basically 🧾
⚠️ history lesson: before version 0.39 these functions used a memcache_server_st *. In 0.39, memcached_server_st * was aliased to memcached_server_list_st. It was done for a style reason / to help clean up some concepts in the code. so it's a glow-up, not a plot hole πŸ’–

πŸ” RETURN πŸ”

Varies β€” see the particular functions, bestie 😭


🏠 HOME 🏠

To find out more information please check:

https://launchpad.net/libmemcached


πŸ‘‘ AUTHOR πŸ‘‘

Brian Aker, <brian@tangent.org>


πŸ¦‹ SEE ALSO πŸ¦‹

memcached(1) libmemcached(3) memcached_strerror(3)


and that's the whole page, no cap πŸ’–βœ¨

This one was served up by perl v5.42.3, dated 2026-08-19 β€” so go forth, manage your server lists, and slay πŸŽ€πŸ«ΆπŸŒŸ

πŸ“¦ where this page comes from