QB_IPCS_CO...TATS_GET_2(3)

πŸ’– qb_ipcs_connection_stats_get_2 β€” bestie's guide to snatching connection stats πŸ’–

okay so this one lives in the libqb Programmer's Manual, section 3, and it's giving "I just want my stats and I want them NOW" energy. sit down, grab a boba, we're doing this πŸ§‹βœ¨


✨ NAME ✨

qb_ipcs_connection_stats_get_2 β€” get (and allocate) the connection statistics. yes, and allocate. she's not just fetching, she's also out here making you a whole new struct. girlboss behaviour honestly πŸ‘‘


✨ SYNOPSIS ✨

#include <qb/qbipcs.h>

struct qb_ipcs_connection_stats_2 * qb_ipcs_connection_stats_get_2(
    qb_ipcs_connection_t   *c,                 /* connection instance */
    int32_t                 clear_after_read   /* clear stats after copying them into stats */
);

so you pass in your connection, you tell her whether to wipe the stats after she copies them, and she hands you back a freshly allocated struct. the way that she allocates it FOR you 🫢


✨ PARAMS ✨

  • c β€” connection instance. the actual connection you're being nosy about. no connection, no stats, that's the vibe check 🌸
  • clear_after_read β€” clear stats after copying them into stats. so like, do you want a snapshot or do you want a reset button? set this and she wipes the counters clean after she copies them out. lowkey iconic for "give me the delta since last time" situations πŸ’…

✨ DESCRIPTION ✨

ngl bestie... this section is empty in the original. like, fully blank. the manpage said "DESCRIPTION" and then just... said nothing. no cap. the name, the params and the return value are doing all the talking here πŸ’€


✨ RETURN VALUE ✨

  • NULL β€” if there's no memory, or if your connection is invalid. sad girl hours 😭
  • allocated statistics structure β€” and heads up, queen: you have to free it. user must free it. it's yours now, you're responsible for it, that's the whole deal πŸŽ€
⚠️ fr fr, do NOT forget to free the returned struct. she allocated it, she's not cleaning up after you. that's your mess bestie πŸ’…

✨ SEE ALSO ✨

the whole friend group, obviously πŸ¦‹


Copyright (C) 2010-2020 Red Hat, Inc.


and that's the tea πŸ“ stay safe, free your structs, and remember: libqb, dated 2025-09-16 β€” she ate and left no crumbs πŸ‘‘πŸ’œ byeeee πŸ¦‹βœ¨

πŸ“¦ where this page comes from