dbh_create(3)

πŸ“¦ version 5.0.22, in fedora 43, fedora 44

πŸ’– NAME πŸ’–

ok so bestie, meet the girlies: dbh_open, dbh_openR, and dbh_create β€” they open a DBHashTable or make a brand new one, no cap πŸ’…


✨ SYNOPSIS ✨

#include <dbh.h>

DBHashTable *dbh_open(constchar*path);
DBHashTable *dbh_openR(constchar*path);
DBHashTable *dbh_create (const char *path, unsigned char key_length);

🌸 DESCRIPTION 🌸

okay so here's the tea πŸ«– β€” you've got three functions and they each have main character energy in their own way:

  • dbh_open() β€” opens an existing DBHashTable at path in read/write mode. She's got range, she can do both.
  • dbh_openR() β€” same path, but opens in read-only mode. Look but don't touch, periodt. πŸ‘€
  • dbh_create() β€” the icon herself ✨ she creates, initializes and opens a new DBHashTable in read/write mode.

and about key_length: it's the fixed length of the record access key, and it must be less than 256. it's giving very specific, very demure. πŸ™ˆ

ngl the important bit: you only gotta specify key_length when the DBHashTable is being created and initialized. after that, she already knows who she is. πŸŽ€

πŸ¦‹ RETURN VALUE πŸ¦‹

when it slays (success πŸ’–): you get back a pointer to a newly initialized and open DBHashTable. iconic.

when it doesn't: you get NULL 😭 and errno gets set appropriately, so go check on her.


πŸ’€ NOTES πŸ’€

⚠️ WARNING bestie, this is the serious one ⚠️ dbh_create() will overwrite any file with the specified path β€” and that includes any previous DBH file. like, gone gone. no undo. πŸ™ˆ so pls be sure before you commit.

also, lowkey a flex: Cuantified keys assure that large DBHashes are spread out optimally. she's optimized, she's balanced, she's thriving 🌈⭐


πŸ‘‘ SEE ALSO πŸ‘‘

  • dbh (0)
  • dbh_open (3)
  • dbh_openR (3)
  • dbh_close (3)
  • dbh_destroy (3)
  • dbh_genkey (3)

🌷 Author 🌷

Edscott Wilson Garcia <edscott@xfce.org> β€” the original main character, we stan 🫢


k bye bestie, that's the whole DBHashTables Programmers' Manual page for dbh_create(3), version DBH πŸŽ€ go forth and hash responsibly, mwah πŸ’…βœ¨

πŸ“¦ where this page comes from