MEMCACHED_SET_USER_DATA(3)
β¨ MEMCACHED_SET_USER_DATA β¨
okay bestie, welcome to the libmemcached-awesome corner of the manual, section 3, and today's main character is memcached_set_user_data π
this one's from the MEMCACHED_SET_USER_DATA(3) page and it's literally just about stashing your own little pointer inside a memcached_st. cute, right? π
πΈ NAME πΈ
memcached_set_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 initializedmemcached_ststruct
Returns
- opaque pointer to the user supplied data
void *memcached_set_user_data(memcached_st *ptr, void *data)
Parameters
ptrβ pointer to initializedmemcached_ststructdataβ 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, a little pocket in there that's all yours π«Ά
memcached_set_user_data() is the one that sets the user specific data in the memcached_st structure.
memcached_get_user_data() is the one that gets the user specific data back out of the memcached_st structure.
set it, get it, slay it. periodt. π
π RETURN VALUE π
memcached_set_user_data() returns the previous value of the user specific data.
memcached_get_user_data() returns the current value of the user specific data.
ngl the "previous value" thing is the iconic part β you're not getting nothing back, you're getting what was there before you swapped it in. iykyk π₯
π SEE ALSO π
version 1.1 πΈ dated Jul 24, 2025 β that's the whole page bestie, go set some user data and be the main character of your own memcached_st πβ¨ππ¦
π¦ 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