TDB_DELETE(3)

πŸ“¦
version 1.4.15+samba4.24.7 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– TDB_DELETE πŸ’–

okay bestie, welcome to tdb_delete β€” it's from the Linux Programmer's Manual (section 3, we're fancy like that πŸ’…), and it's the part where we yeet a record straight out of a tdb database. no takebacks, no receipts.


✨ NAME ✨

tdb_delete β€” delete a record from a tdb database. that's it. that's the whole job. she's a one-task queen πŸ‘‘


🌸 SYNOPSIS 🌸

#include <tdb.h>

int tdb_delete(TDB_CONTEXT *tdb, TDB_DATA key);

like… two args, one int back. lowkey elegant, highkey iconic.


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: you hand her a key, she finds the record in the tdb database whose key matches it, and she deletes it. gone. bye. 🫢

and what even is a key? it's a lump of data that is used as the index into the database. that's the whole concept β€” a blob of bytes doing the job of a lookup tag. no cap.

the TDB_DATA structure is defined as:

typedef struct {
     char *dptr;
     size_t dsize;
} TDB_DATA;

so dptr is your pointer to the data and dsize is how big it is. pointer plus length, the classic duo, the main character energy pairing of C πŸ’€


⭐ RETURN VALUE ⭐

  • 0 β€” success, we ate, the record is deleted πŸŽ€
  • -1 β€” failure, it's giving sad girl hours 😭

that's the entire scale. binary. no in-between. periodt.


πŸ‘‘ AUTHORS πŸ‘‘

  • Software: Andrew Tridgell <tridge@linuxcare.com> and Luke Kenneth Casson Leighton
  • Man page: Ben Woodard <ben@valinux.com>

shoutout to the devs, absolute legends, we stan 🌈


πŸ”₯ SEE ALSO πŸ”₯

go read those next, iykyk πŸ’œ


and that's the whole page bestie β€” brought to you by Samba, dated Aug 16, 2000, and it was TDB_DELETE(3) all along. mwah πŸ’‹βœ¨