MEMCACHED_USER_DATA(3)

πŸ’– MEMCACHED_USER_DATA πŸ’–

okay so bestie, this is the memcached_user_data page from libmemcached β€” you know, the C library that talks to memcached 🫢. It lives in libmemcached-awesome and it's literally about stashing your pointer inside their struct. iconic behaviour honestly.


✨ NAME ✨

memcached_user_data β€” libmemcached Documentation πŸ“–


🌸 SYNOPSIS 🌸

#include <libmemcached/memcached.h>
       Compile and link with -lmemcached
void *memcached_get_user_data(memcached_st *ptr)

Parameters

  • ptr β€” pointer to initialized memcached_st struct

Returns

  • opaque pointer to the user supplied data
void *memcached_set_user_data(memcached_st *ptr, void *data)

Parameters

  • ptr β€” pointer to initialized memcached_st struct
  • data β€” opaque pointer to user supplied data

Returns

  • opaque pointer to the previously set data

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea πŸ“ β€” libmemcached lets you store a pointer to your own user specific data right inside the memcached_st structure. like, it's your little corner of the struct, your locker, your emotional support pointer. no cap. πŸ’…

memcached_set_user_data() is the one you call to set the user specific data in the memcached_st structure. that's it. that's the job.

memcached_get_user_data() is the one you call to retrieve the user specific data from the memcached_st structure. the way these two are literally a matched set 😭🫢


πŸ‘‘ RETURN VALUE πŸ‘‘

memcached_set_user_data() returns the previous value of the user specific data. yes bestie, it hands you back the old one β€” lowkey thoughtful.

memcached_get_user_data() returns the current value of the user specific data. as it should. ⭐


🌈 SEE ALSO 🌈


and that's the whole page, fr fr πŸ’œ this was version 1.1, dated Jul 24, 2025, from the libmemcached-awesome girlies β€” ty for coming to my ted talk, mwah πŸŽ€βœ¨

πŸ“¦ where this page comes from