NNG_STAT_STRING(3)
π NNG_STAT_STRING(3) β nng_stat_string π
okay bestie, so this one lives in the NNG Reference Manual and it's literally the glow-up your stats snapshot deserves. it's called nng_stat_string, and no cap, it's about to hand you a string. π
β¨ NAME β¨
nng_stat_string β bestie, it gets the statistic string value π¦
β¨ SYNOPSIS β¨
#include <nng/nng.h>
typedef struct nng_stat nng_stat;
const char *nng_stat_string(nng_stat *stat);
she's simple, she's clean, she's iconic π
β¨ DESCRIPTION β¨
so nng_stat_string() returns a string value for the statistic stat, and stat must be of type NNG_STAT_STRING (go peek at nng_stat_type(3) if you need the receipts, iykyk).
now listen β if the statistic is not of type NNG_STAT_STRING, then NULL gets returned. that's it. that's the whole vibe check, and it failed. π
note bestie π«Ά β the string you get back is valid until nng_stats_free() is called to free the memory for the snapshot. so likeβ¦ use it, love it, don't hold onto it after the free, fr fr. it's giving borrowed, not given. π
β¨ RETURN VALUES β¨
the string value associated with stat! π or NULL if the statistic is not a string type. that's literally the whole menu, bestie. no surprises, no drama. β¨
β¨ ERRORS β¨
None. zero. zilch. not a single one. she doesn't miss. ππ
β¨ SEE ALSO β¨
libnng(3)nng_stats_get(3)nng_stats_type(3)nng_stats_value(3)nng_stat(5)nng(7)
okay so that's the whole page, and honestly? obsessed. πΈ go read the linked ones, they're all in the same friend group. π§
NNG Reference Manual Β· version date 2026-06-30 Β· NNG_STAT_STRING(3) β mwah, periodt ππ
π¦ where this page comes from
- ubuntu stonking: libnng-dev 1.12.0-1 Β· MIT OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms