QB_HDB_HAN...GET_ALWAYS(3)

πŸ’– qb_hdb_handle_get_always β€” the libqb bestie that grabs your instance and bumps its refcount πŸ’–

okay so bestie, we're in the libqb Programmer's Manual rn and this page is literally about one (1) function that goes and fetches the instance hanging out with your handle and then increments its refcount like the generous icon it is. no cap. 🫢


✨ NAME ✨

qb_hdb_handle_get_always β€” get the instance associated with this handle and increase it's refcount. πŸ’…


🌸 SYNOPSIS 🌸

#include <qb/qbhdb.h>

int32_t qb_hdb_handle_get_always(
    struct qb_hdb   *hdb,        /* the database instance */
    qb_handle_t      handle_in,  /* the handle */
    void           **instance    /* (out) pointer to the desired object. */
);

πŸŽ€ PARAMS πŸŽ€

  • hdb β€” the database instance, aka the whole vibe container πŸ—‚οΈ
  • handle_in β€” the handle, the little ticket that says "yeah this one" 🎟️
  • instance β€” (out) pointer to the desired object. it's the out param, so it's giving back to you, not taking πŸ“€

πŸ¦‹ DESCRIPTION πŸ¦‹

lowkey the prose section is keeping it mysterious, but here's the whole ✨ STRUCTURES ✨ tea anyway:

🧚 STRUCTURES 🧚

the struct qb_hdb itself, laid out exactly like this, do not come for me:

struct qb_hdb {
    uint32_t    handle_count;
    qb_array_t  handles;
    uint32_t    iterator;
    void      (*destructor)(void *);
    uint32_t    first_run;
};

that's the whole thing. handle_count, the handles array, an iterator, a destructor function pointer that takes a void *, and first_run. iconic honestly. πŸ‘‘


⭐ RETURN VALUE ⭐

(0 == ok, -errno failure) β€” so zero means slay, negative errno means something went πŸ’€.


πŸ’€ NOTE πŸ’€

This is currently an alias to qb_hdb_handle_get.

fr fr, right now it's just another name for the same thing. not me pointing that out but here we are πŸ™ˆ


🌈 SEE ALSO 🌈

go read those too, iykyk πŸ“šβœ¨


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


aaaand that's the page bestie!! this whole thing came from LIBQB, dated 2025-09-16, and the manual title up top was QB_HDB_HAN...GET_ALWAYS(3). mwah, go forth and get your instances πŸ«ΆπŸ’–πŸŒΈ

πŸ“¦ where this page comes from