dbh_erase(3)
π dbh_erase(3) β the DBHashTables Programmers' Manual, bestie edition β¨
okay so welcome to the DBHashTables Programmers' Manual, section 3, page dbh_erase. This is your one-stop group chat for deleting stuff (emotionally and structurally) π
πΈ NAME πΈ
dbh_erase, dbh_unerase, dbh_prune.3, dbh_unprune.3 β erase/unerase records or prune/unprune entire branches
π SYNOPSIS π
#include <dbh.h>
int dbh_erase (DBHashTable *dbh);
int dbh_unerase (DBHashTable *dbh);
int dbh_prune (DBHashTable *dbh, unsigned char *key, unsigned char
subtree_length);
int dbh_unprune (DBHashTable *dbh, unsigned char *key, unsigned char
subtree_length);
β¨ DESCRIPTION β¨
π dbh_erase
Marks the record that's currently loaded into memory as erased. That's it, that's the whole thing.
π¨ bestie listen: if there's no record currently loaded, the behaviour is undefined. Like, genuinely undefined. Don't do it. Not the vibe.
π¦ dbh_unerase
This one is the opposite of dbh_erase (). It marks the record currently loaded into memory as unerased β putting it back, un-cancelling it, restoring the girlies.
π and again: if no record is currently loaded, behaviour is undefined. Same rules, same drama.
π dbh_prune
Erases a whole subtree from the record currently loaded into memory. It's giving spring cleaning but make it data structures π§Ή
Important tea tho: the records are not really removed fisically, they're just marked erased so they may be recovered β if they haven't been overwritten later on. So it's less "deleted" and more "put in the group chat archive."
They only get permanently removed after the DBHashTable is reconstructed with dbh_regen_sweep () or dbh_regen_fanout (). that's when it's actually gone gone π
π dbh_unprune
Does the opposite of dbh_prune (), marking the entire subtree as unerased. Undo button, slay.
π but fair warning: it may fail to work if records have been overwritten since the dbh_prune () instruction was issued. No cap. Once it's overwritten, the un-prune can't save you.
π the key and subtree_length situation
In the dbh_prune and dbh_unprune routines:
keyis the key of the top level record of the subtree to erasesubtree_lengthis the number of branches to erase
β RETURN VALUE β
0on error1otherwise
periodt. π
π SEE ALSO π
dbh (0)dbh_find (3)dbh_load (3)dbh_sweep (3)dbh_regen_sweep (3)
π Author π
Edscott Wilson Garcia <edscott@xfce.org>
and that's the page!! brought to you by the DBHashTables manual, section DBH, filed under dbh_erase(3) β go forth and erase responsibly, 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