skipNext(3)

✨ NAME ✨

skipNext β€” bestie, this is the "find the next item" girlie πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <util/skiplist.h>

void *skipNext(skipList list, UINT32 *pkey, void **plock);

🌸 ARGUMENTS 🌸

  • list β€” the list you're searching in, duh πŸ™ˆ
  • pkey β€” a pointer to the previous key (pass 0 to start from the very beginning, main character energy πŸ‘‘)
  • plock β€” where the value lock goes (or NULL, if you're not about that lock life)

πŸ’– DESCRIPTION πŸ’–

Okay so here's the tea β˜• β€” skipNext goes searching in the list <list> for the item whose key is the next larger one than whatever's sitting in <pkey>, and it hands you back that item's value if it found one, or NULL if it didn't. No cap, that's it. ✨

And if <plock> is non-NULL? Then the lock it gives you back in <plock> is gonna be associated with the value it returned, periodt. And here's the important part, bestie β€” until you pass that lock over to skipRelease(), the value will NOT be freed by the freeValue callback (peep skipNewList() for the deets). So like, hold onto that lock responsibly 🫢

MT-Level: Safe if <list> is thread-safe. That's the whole vibe check. πŸ”₯


⭐ RETURN VALUE ⭐

  • pkey β€” gets set to the new key πŸŽ€
  • plock β€” gets set to the value lock πŸ”

🌈 SEE ALSO 🌈

skipDelete(3), skipFreeList(3), skipRelease(3), skipInsert(3), skipSearch(3), skipNext(3), skipNewList


and that's the whole page, bestie!! this one's brought to you by ClearSilver πŸ’œ and it's dated 12 July 2007 β€” iconic, vintage, timeless. mwah πŸ’‹