dbh_macros(3)
β¨ dbh_macros β the manual page, but make it cute β¨
okay bestie, you're in the DBHashTables Programmers' Manual section 3, and this is dbh_macros(3). yes the title of the page and the manual name are the same-ish, we're folding that in, we're moving on. π
π NAME
dbh_macros β the macros available in dbh, and yes they're giving convenience, they're giving shortcuts, they're giving "I don't wanna touch the struct directly" energy.
π¦ SYNOPSIS
#include <dbh.h>
unsigned char DBH_KEYLENGTH (DBHashTable * dbh);
FILE_POINTER DBH_RECORD_SIZE (DBHashTable * dbh);
void *DBH_KEY (DBHashTable * dbh);
void *DBH_DATA (DBHashTable * dbh);
FILE_POINTER DBH_ERASED_SPACE (DBHashTable * dbh);
FILE_POINTER DBH_DATA_SPACE (DBHashTable * dbh);
FILE_POINTER DBH_TOTAL_SPACE (DBHashTable * dbh);
FILE_POINTER DBH_FORMAT_SPACE (DBHashTable * dbh);
FILE_POINTER DBH_RECORDS (DBHashTable * dbh);
FILE_POINTER DBH_MAXIMUM_RECORD_SIZE (DBHashTable * dbh);
char *DBH_PATH (DBHashTable * dbh);
like. look at that list. eleven of them. all iconic, all just vibing with a DBHashTable * dbh and nothing else. πΈ
π DESCRIPTION
These are the convenience macros, bestie β they reach into a DBHashTable structure and pull out the elements for you so you don't have to go digging around in there yourself. lowkey the nicest thing anyone's ever done for us.
π DBH_KEYLENGTH ()
returns the keylenth in bytes that's associated to the DBHashTable. (yes, the manual says "keylenth", we're keeping it, it's part of the lore now π)
and here's the thing: that value is fixed at the moment the DBHashTable is created with dbh_create. so no, it does not change later. it's locked in. periodt.
π DBH_RECORD_SIZE ()
returns the size of the current record that's loaded up in memory.
β οΈ but if no record has been loaded? then the return value is not defined. not "zero", not "probably fine", not "eh it'll work" β not defined. so maybe don't. π
π DBH_KEY ()
hands you a pointer to the current DBHashTable key area. go forth. π«Ά
π DBH_DATA ()
hands you a pointer to the current DBHashTable data area. the data one. not the key one. we love a distinction.
π DBH_ERASED_SPACE ()
returns how many bytes are taken up by erased data in the DBHashTable. the ghost data. the leftovers. π
π DBH_DATA_SPACE ()
returns how many bytes are taken up by valid data in the DBHashTable. the real ones. the main characters. π
π DBH_TOTAL_SPACE ()
returns the total amount of bytes taken up by the DBHashTable. everything. all of it. the whole vibe check. π₯
π DBH_FORMAT_SPACE ()
returns the total amount of bytes taken up by the format of the DBHashTable. the structure itself, not the contents. it's giving scaffolding. β¨
π DBH_RECORDS ()
returns the number of records in the DBHashTable. just a count. a little census. adorable. π
π DBH_MAXIMUM_RECORD_SIZE ()
returns the maximum allocated space for data in the current DBHashTable record. so like, the ceiling. the cap. the limit. π
π DBH_PATH ()
returns a pointer to a string containing the path to the current DBHashTable. it knows where it lives. self-aware king. π
π§ SEE ALSO
dbh (0)
πΈ Author
Edscott Wilson Garcia <edscott@xfce.org>
okay and that's the whole page, no cap β this was DBHashTables, DBH, dbh_macros(3). thanks for coming to my ted talk, go write some hash tables bestie πππ¦
π¦ where this page comes from
- fedora 43: dbh-devel 1:5.0.16-24.fc43 Β· GPL-3.0-or-later
- fedora 43: dbh-devel 1:5.0.16-24.fc43 Β· GPL-3.0-or-later
- fedora 43: dbh-devel 1:5.0.22-1.fc43 Β· GPL-3.0-or-later
- fedora 43: dbh-devel 1:5.0.22-1.fc43 Β· GPL-3.0-or-later
- fedora 44: dbh-devel 1:5.0.22-3.fc44 Β· GPL-3.0-or-later
- fedora 44: dbh-devel 1:5.0.22-3.fc44 Β· GPL-3.0-or-later
- Copyright (c) 2010 Edscott Wilson Garcia (edscott@xfce.org)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms