QB_LIST_REPLACE(3)

πŸ’– QB_LIST_REPLACE(3) πŸ’–

okay bestie, gather round, because this one is from the libqb Programmer's Manual and it's literally the glow-up function for linked list entries. it's giving "out with the old, in with the new" and honestly? iconic.


✨ NAME ✨

qb_list_replace β€” swap an old entry out and put a new one in its place. that's it, that's the whole job, and she does it flawlessly πŸ’…


🌸 SYNOPSIS 🌸

#include <qb/qblist.h>

static void qb_list_replace(
    struct qb_list_head   *old_one,  /* the element to be replaced */
    struct qb_list_head   *new_one   /* the new element to insert */
);

no cap, that's the entire signature. two pointers, zero drama 🫢


πŸŽ€ PARAMS πŸŽ€

  • old_one β€” the element that is getting replaced. she's served her time, let her rest 😭
  • new_one β€” the new element you're inserting. main character energy, stepping into the spotlight πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

πŸ’œ STRUCTURES πŸ’œ

here's the struct you're working with, bestie β€” memorize her, she's everywhere in this header:

struct qb_list_head {
    struct   next;
    struct   prev;
};

🌈 SEE ALSO 🌈

the whole friend group, fr fr:


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


and that's the whole page, bestie!! go replace some entries, slay responsibly, and remember: always init your lists before you touch them πŸ’–

this has been LIBQB, dated 2025-09-16, and yes it's still called QB_LIST_REPLACE(3) β€” periodt βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from