TDB_EXISTS(3)

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

πŸ’– TDB_EXISTS β€” bestie's guide to the tdb_exists(3) manual page πŸ’–

okay so. you're here, you're in the Linux Programmer's Manual, and you wanna know if a record is literally in your tdb database or not. this page has u covered, no cap. ✨


🌸 NAME 🌸

tdb_exists β€” check for the existence of a record in a tdb database πŸ¦‹


✨ SYNOPSIS ✨

#include <tdb.h>

int tdb_exists(TDB_CONTEXT *tdb, TDB_DATA key);

πŸ’… DESCRIPTION πŸ’…

so the whole vibe here is: you're testing to see if a key exists. that's it, that's the job. πŸŽ€

  • tdb β€” this is a pointer that got handed to you by tdb_open. like, it's the returned one, don't just make one up bestie 😭
  • key β€” this is a lump of data, and it's used as the index into the database. the way it just *indexes*… iconic.

and the TDB_DATA structure is defined as:

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

that's it. that's the struct. dptr and dsize. periodt. πŸ’œ


πŸ”₯ RETURN VALUE πŸ”₯

the vibes are very binary here:

  • if the key is found β†’ 1 is returned 🫢
  • otherwise β†’ 0 is returned

no in-between, no maybe, no "it's complicated". just 1 or 0. slay.


πŸ‘‘ AUTHORS πŸ‘‘

the legends behind this whole thing:

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

🌈 SEE ALSO 🌈

go check out these besties too, iykyk:


lowkey a lil reminder: tdb_exists is a test, not a read. it's giving "are u there" energy, not "tell me everything about urself". just sayin πŸ’–

and that's the page, bestie!! this one's from the Samba crew, dated Aug 17, 2000 β€” a whole classic, a vintage icon, and honestly it still ate πŸ’…βœ¨ mwah, go check ur keys πŸ¦‹