TDB_FETCH(3)
π TDB_FETCH(3) π
okay bestie, welcome to tdb_fetch β it's a section 3 manual page from the Linux Programmer's Manual, and it's literally the "grab me that one record" function for a tdb database. no cap.
β¨ NAME β¨
tdb_fetch β fetch a record from a tdb database π
π¦ SYNOPSIS π¦
#include <tdb.h>
TDB_DATA tdb_fetch(TDB_CONTEXT *tdb, TDB_DATA key);
πΈ DESCRIPTION πΈ
So the whole vibe here: you want a record out of the tdb database, and you find it by its key. That key is just a lump of data, and it's what the database uses as the index β like a little name tag so it knows which record you're talking about. π«Ά
The TDB_DATA structure gets used for both the key and the return value, and it is defined as:
typedef struct {
char *dptr;
size_t dsize;
} TDB_DATA;
that's it, that's the whole struct. iconic. π
β RETURN VALUE β
If the call succeeds, you get a TDB_DATA structure back with the dptr structure filled in. π
If the call fails, dptr gets set to NULL. π
NOTE: the caller is responsible for freeing the data pointed to by dptr. no really β that memory is yours now, bestie. free it. don't just leave it there. π
π AUTHORS π
- Software: Andrew Tridgell <tridge@linuxcare.com> and Luke Kenneth Casson Leighton
- Man page: Ben Woodard <ben@valinux.com>
π SEE ALSO π
and that's the whole page, fr fr π
this one came from Samba, dated Aug 16, 2000, and it lives at TDB_FETCH(3). mwah, go free your dptr. π¦β¨
π¦ where this page comes from
- debian trixie: libtdb-dev 2:1.4.13+samba4.22.10+dfsg-0+deb13u2 Β· GPL-3.0-or-later
- debian trixie: libtdb-dev 2:1.4.13+samba4.22.11+dfsg-0+deb13u1 Β· GPL-3.0-or-later
- ubuntu questing: libtdb-dev 2:1.4.13+samba4.22.3+dfsg-4ubuntu2
- ubuntu questing: libtdb-dev 2:1.4.13+samba4.22.3+dfsg-4ubuntu2.4
- ubuntu resolute: libtdb-dev 2:1.4.14+samba4.23.6+dfsg-1ubuntu2 Β· GPL-3.0-or-later
- ubuntu resolute: libtdb-dev 2:1.4.14+samba4.23.6+dfsg-1ubuntu2.2 Β· GPL-3.0-or-later
- ubuntu stonking: libtdb-dev 2:1.4.15+samba4.24.7+dfsg-1ubuntu1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms