dbh_update(3)
πΎ dbh_update(3) β straight from the DBHashTables Programmers' Manual, bestie
okay so this is a page from the DBHashTables Programmers' Manual, and it's literally just about pushing your stuff to disk. two functions, both iconic, both doing the "save my work" thing. let's get into it π«Ά
β¨ NAME β¨
dbh_update, dbh_writeheader β write data record or file header to disk
so like, one of them saves a record, the other saves the file header. different jobs, same slay π
πΈ SYNOPSIS πΈ
#include <dbh.h>
FILE_POINTER dbh_update (DBHashTable *dbh);
int dbh_writeheader (DBHashTable *dbh);
there she is. include the header, call the function, that's the whole vibe β¨
π¦ DESCRIPTION π¦
okay so dbh_update will update the current record in memory to the disk based hash. the way that it does this for erased records and unerased records alike?? obsessed. BUT β and this is the plot twist π β if an erased record gets updated, it is automatically unerased. like it comes back to life. resurrection era. no cap.
dbh_writeheader will write out the DBHashTable header information. and ngl, it is advisable to call this function immediately after creation of a new DBHashTable to force a buffer flush. like do it right away, don't be out here ghosting your buffer π
bestie please calldbh_writeheaderright after you make a newDBHashTable. the buffer flush is not gonna happen on its own, fr fr.
β RETURN VALUE β
okay so the return values are giving very different energy:
dbh_updateβ returns0on error, and the byte offset of loaded record otherwisedbh_writeheaderβ returns0if error,1otherwise
so for dbh_update, 0 is the bad one (which, yes, is a little chaotic of it π), and for dbh_writeheader it's a cute little 0 or 1 situation. know the difference, iykyk.
π SEE ALSO π
go read these next, bestie, they're all part of the family:
dbh (0)dbh_set_data (3)dbh_set_key (3)dbh_set_size (3)dbh_set_recordsize (3)dbh_load (3)dbh_sweep (3)
π Author π
Edscott Wilson Garcia <edscott@xfce.org> β king behavior, we love to see it π
that's the whole page, and that's on DBHashTables, the DBH manual, dbh_update(3) πβ¨ thanks for reading, ily, now go flush that buffer π¦π
π¦ 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