QB_MAP_NOTIFY_ADD(3)

πŸ’– qb_map_notify_add β€” from the libqb Programmer's Manual (section 3) πŸ’–

okay so bestie, welcome to qb_map_notify_add(3) 🌸 this is the libqb girly whose whole job is adding a notifier to the map. that's it. that's the gig. and honestly? she ate. πŸ‘‘


✨ NAME ✨

qb_map_notify_add β€” Add a notifier to the map.


✨ SYNOPSIS ✨

#include <qb/qbmap.h>

int32_t qb_map_notify_add(
    qb_map_t         *m,          /* the map instance */
    /*
     * the key (or prefix) to attach the notification to.
     */
    const char       *key,
    qb_map_notify_fn  fn,         /* the callback */
    int32_t           events,     /* the type of events to register for. */
    void             *user_data   /* a pointer to be passed into the callback*/
);

like look at her. five params. no notes. πŸ’…


✨ PARAMS ✨

  • m β€” the map instance πŸ—ΊοΈ the actual map you're attaching this whole situation to.
  • key β€” the key (or prefix) to attach the notification to. yes, or prefix, we'll get to that, hold on πŸ”‘
  • fn β€” the callback. the little function that gets to hear about everything πŸ“ž
  • events β€” the type of events to register for. you're picking which drama you want notifications about πŸ‘€
  • user_data β€” a pointer to be passed into the callback. your lil emotional support pointer, hand-delivered straight to fn 🫢

✨ DESCRIPTION ✨

so um. the description section in the original is literally empty. nothing. void. a whole blank space πŸ’€ not me pointing it out but here we are β€” the vibes are immaculate and the prose is nonexistent. the NAME and PARAMS are doing all the heavy lifting, periodt.


✨ RETURN VALUE ✨

  • 0 β€” success πŸŽ€ we love to see it
  • -errno β€” failure 😭 it's giving "something went wrong" and the error code is negative, iykyk

✨ NOTE ✨

you can use key prefixes with trie maps. 🌈 so like β€” trie maps only, bestie. don't try that on the others, they're not built for it.


✨ SEE ALSO ✨

the whole friend group showed up, no cap:


Copyright (C) 2010-2020 Red Hat, Inc. 🫢 protecting the girlies since 2010.


okay that's the whole page, you're so welcome πŸ’œ this was libqb's Programmer's Manual, page QB_MAP_NOTIFY_ADD(3), dated 2025-09-16 β€” and that's the sign-off, mwah, go add a notifier to your map bestie πŸ¦‹βœ¨

πŸ“¦ where this page comes from