QB_HDB_HANDLE_GET(3)

πŸ’– qb_hdb_handle_get β€” get ur fave instance back (and bump its refcount) πŸ’–

okay so bestie, we're in the libqb Programmer's Manual, section 3, and this page is literally just about one tiny little function that goes and fetches the instance chillin' behind a handle β€” and then bumps its refcount so nobody yeets it out from under you. no cap. 🫢


✨ NAME ✨

qb_hdb_handle_get β€” Get the instance associated with this handle and increase it's refcount.


πŸŽ€ SYNOPSIS πŸŽ€

#include <qb/qbhdb.h>

int32_t qb_hdb_handle_get(
    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. this is the hdb u got ur hands on, ur whole little handle database, the moment. πŸ‘‘
  • handle_in β€” the handle. the actual handle u want to look up, periodt.
  • instance β€” (out) pointer to the desired object. it's an out param, so the function writes into this β€” that's where ur object pointer lands. ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

ok so ngl, the original page literally leaves this section empty β€” no prose, nothing, it just goes straight into the struct. so bestie there is no extra lore here, no secret tips, no hidden behaviour notes. we move. πŸ’…


πŸ’œ STRUCTURES πŸ’œ

here's the struct that goes with all this, verbatim, character for character, because we do not mess with the code:

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

🌈 RETURN VALUE 🌈

(0 == ok, -errno failure)

translation: 0 means we ate and everything's fine πŸ’…, anything negative is a failure and it's -errno, so like the negative of whatever errno was. slay.


πŸ’€ SEE ALSO πŸ’€

go read these too, they're the whole friend group:


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


okay that's the whole page, mwah πŸŽ€ sending u off with the softest little sign-off: this came out of LIBQB, dated 2025-09-16, and it's filed under QB_HDB_HANDLE_GET(3) β€” go get that handle bestie, it's giving main character energy fr fr πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from