dbh_set_size(3)

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

πŸ’– dbh_set_size(3) β€” DBHashTables Programmers' Manual πŸ’–

okay bestie, we're in the DBHashTables programmer's manual, section 3, and today's main character is dbh_set_size πŸ’…


✨ NAME ✨

dbh_set_size, dbh_set_recordsize β€” set maximum or current record size πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <dbh.h>

int dbh_set_size (DBHashTable *dbh, FILE_POINTERsize);
void dbh_set_recordsize (DBHashTable *dbh, int record_size );

🌸 DESCRIPTION 🌸

so there's two functions here and they're lowkey cousins, but they do different things, ok? let's go πŸ’œ

dbh_set_size defines the maximum amount of memory that's gonna be allocated to the DBHashTable records. and listen β€” this is nonvolatile information, meaning you literally only need to set it once and it sticks. the default is 1024 bytes. no cap. ⭐

dbh_set_recordsize sets the recordsize of the data in the current DBHashTable, and it gets called implicitly by calling dbh_set_data. so if you're using dbh_set_data you're already covered, bestie 🫢

but fr fr: it is very important to call this function if dbh_set_data is not used. Unpredictable results will follow if record_size is not set. like, chaos. we don't want chaos. 😭

DBHashTable records are variable in length, so use this function at least once if you're planning to use fixed length records. the parameter record_size is the amount of bytes to be reserved for the current DBHashTable record data. that's the whole vibe. ✨


πŸ‘‘ RETURN VALUE πŸ‘‘

  • dbh_set_size returns 0 on error, 1 otherwise. (yes, 0 means error here, it's giving chaotic but that's just how it is πŸ™ˆ)
  • dbh_set_recordsize returns the amount of bytes in the current DBHashTable record.

🌈 SEE ALSO 🌈

  • dbh (0)
  • dbh_update (3)
  • dbh_writeheader (3)
  • dbh_set_data (3)
  • dbh_set_key (3)

πŸŽ€ Author πŸŽ€

Edscott Wilson Garcia <edscott@xfce.org> β€” iconic, we stan πŸ’–


and that's the tea, bestie πŸ“ this page came to you from DBHashTables, version DBH, as dbh_set_size(3) β€” go forth and set your sizes correctly, mwah πŸ’…βœ¨πŸ§š

πŸ“¦ where this page comes from