cdb_read(3)

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

πŸ’– cdb_read(3) β€” Library Functions Manual πŸ’–

okay bestie, so this is cdb_read, living in section 3 of the manual (that's the library-functions girlies ✨), and it is literally the "gimme those bytes" function for a constant database. no cap.


🌸 NAME 🌸

cdb_read β€” read bytes from a constant database πŸ’…


✨ SYNTAX ✨

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

int cdb_read(struct cdb *c, char *buf, size_t len, uint32 position);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea πŸ“ β€” cdb_read reads len bytes starting at position from c and drops them into buf. that's it, that's the whole job. main character energy, honestly πŸ‘‘

and like, where do you even get those numbers? bestie:

  • want the position? use cdb_datapos or cdb_keypos πŸ’–
  • want the len? use cdb_datalen or cdb_keylen ✨

and one super important thing, no skipping this part β€” buf needs to point to a memory region large enough to hold len bytes. like actually large enough. do not play with her πŸ™ˆ she will not check for you, iykyk.


πŸŽ€ RETURN VALUE πŸŽ€

  • 0 β€” everything went well, we ate, no crumbs πŸ”₯
  • -1 β€” an error happened, and it sets errno appropriately 😭

periodt.


πŸ’œ SEE ALSO πŸ’œ


and that's the page!! 🫢 the footer energy is just cdb_read(3) β€” no version number, no date, no source line, she's mysterious like that 🧚 honestly iconic of her. go forth and read your bytes, bestie πŸ’…πŸŒΈ