cdb_firstkey(3)

πŸ“¦
version 0.34 Β· 3 versions
, in alpine 3.24, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu resolute, ubuntu stonking

πŸ’– cdb_firstkey β€” find first physical record in constant database πŸ’–

okay bestie, welcome to the Library Functions Manual ✨ this one's a lil function called cdb_firstkey(3) and she's here to help you find the very first record in your constant database. yes, the first one. the physical one. the main character of the record list. πŸ‘‘


✨ SYNTAX ✨

like, here's how you summon her:

#include <libowfat/cdb.h>
#include <libowfat/uint32.h>

int cdb_firstkey(struct cdb *c, uint32 *kpos);

no cap, that's the whole thing. two includes, one function. clean. πŸ’…


🌸 DESCRIPTION 🌸

so cdb_firstkey finds the physically first record in the constant database. that's it, that's the job. she shows up, she locates the first record, she hands it to you. iconic behaviour, honestly. πŸ¦‹

and once you've got it? you're not done yet, bestie β€” you still gotta get the details out of it. that's where her friends come in:

  • use cdb_datapos or cdb_keypos to get the position πŸ”
  • use cdb_datalen and cdb_keylen to get the len πŸ“

like, cdb_firstkey gets you to the record, and those four are how you actually read what's in it. team effort fr fr 🫢

heads up: it's the physically first record, not like... a sorted or alphabetical first one. just so we're clear. no assumptions, okay? 😌

πŸ‘€ SEE ALSO πŸ‘€

go read these next, they're the rest of the saga:


and that's the whole page, babe πŸ’œ written up as cdb_firstkey(3), straight out of the Library Functions Manual β€” mwah, slay, go forth and find your first record πŸŒˆβ­πŸ’–