QB_LIST_ADD(3)

πŸŽ€ QB_LIST_ADD β€” bestie edition πŸŽ€

okay so we're doing qb_list_add(3) from the libqb Programmer's Manual, and honestly? it's giving humble little workhorse. πŸ’… it adds a thing to a list. that's the whole gig. iconic behaviour, no notes.


✨ NAME ✨

qb_list_add β€” add this element to the list. 🫢


✨ SYNOPSIS ✨

#include <qb/qblist.h>

static void qb_list_add(
    struct qb_list_head   *element,  /* the new element to insert. */
    struct qb_list_head   *head      /* pointer to the list head */
);

so yeah, you pull in qb/qblist.h, and then qb_list_add() takes two pointers and returns absolutely nothing (void, she's mysterious, she's low maintenance πŸ’€).


✨ PARAMS ✨

  • element β€” the new element to insert. this is the baby you're yeeting into the list. 🌸
  • head β€” pointer to the list head. this is the ✨main character✨ β€” the anchor point you're attaching everything to.

✨ DESCRIPTION ✨

ngl bestie… there's literally nothing here in the original. the DESCRIPTION section is empty. fr fr. no lore, no extra tea. πŸ™ˆ

what we do know lives in the NAME, PARAMS and SYNOPSIS above: this function adds your element to the list headed by head. that's it, that's the vibe check, and it passed. πŸ’–


✨ STRUCTURES ✨

here's the struct you're working with, and yes, we are copying it exactly as-is, no editing, no "fixing," hands off the keyboard bestie:

struct qb_list_head {
    struct   next;
    struct   prev;
};

struct qb_list_head is giving linked-list-node energy: it's got a next and a prev, so your elements know their neighbours on both sides. πŸ¦‹


✨ SEE ALSO ✨

the whole friend group, go say hi πŸ‘‘:


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

that's the legal bit, and we respect it. 🌈


and that's a wrap on the libqb page, dated 2025-09-16, brought to you by LIBQB β€” QB_LIST_ADD(3) out. slay, stay safe, and always init your lists before you add to them πŸ’œπŸ§šβœ¨

πŸ“¦ where this page comes from