DTSEARCHRETRIEVE(3)

πŸ“¦
version 2.5.3 Β· 2 versions
, in nixos 26.05

πŸ’– DtSearchRetrieve β€” library call, bestie πŸ’–

🌸 NAME 🌸

DtSearchRetrieve β€” Return clear text of documents from DtSearch databases. That's the whole name vibe: it's literally here to hand you the clear text of docs from DtSearch databases. πŸ’…

✨ SYNOPSIS ✨

Include it exactly like this, no cap:

#include &<Dt/Search.h>
int DtSearchRetrieve(
char *dbname,
DB_ADDR dba,
char **cleartext,
long *clearlen,
int *fzkeyi);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's the tea: DtSearchRetrieve retrieves the uncompressed document text of a specified DtSearch document listed in the DtSrResult list from a previous call to DtSearchQuery. It will be successful only in an AusText type database where the documents are stored directly in a database repository. Periodt. 🫢

πŸŽ€ ARGUMENTS πŸŽ€

  • dbname β€” Specifies which database the document is stored in. It can be any one of the database name strings returned from DtSearchInit or DtSearchReinit. If dbname is NULL, the first database name string is used. So bestie, no dbname? Default to the first one. ✨
  • dba β€” The database address of the desired record from the DtSrResult.dba field in a search results list. It's giving VIP address for the exact record you want. 🎫
  • cleartext β€” Specifies a pointer where a zero terminated C string containing the document text will be stored. The string is allocated storage that will be freed by the next call to this function. That's the whole lifecycle, iykyk. 🧚
  • clearlen β€” Specifies a pointer where the length of the cleartext string will be stored. Length check, but make it pointer. πŸ“
  • fzkeyi β€” This is a reserved argument. It should always be NULL. Not me looking at a reserved slot β€” literally always NULL, bestie. 🚫

πŸ”₯ RETURN VALUE πŸ”₯

DtSearchRetrieve returns DtSrOK as well as the cleartext string, when document retrieval is completely successful. Vibe check: passed, slay. βœ…

It returns DtSrNOTAVAIL if the document text is not available from the database for whatever reason. No text? No vibes. 😭

Any other return code signifies failure and user messages on the MessageList explain why. So check the MessageList, bestie β€” it's giving receipts. 🧾

Any API function can also return DtSrREINIT and the return codes for fatal engine errors at any time. Highkey important, fr fr. ⚠️

🌈 SEE ALSO 🌈

Go read these too, bestie:

πŸ’– okay bye bestie β€” this was DtSearchRetrieve from the library call manual, and the footer is literally just that library-call vibe: no extra source/version or date gossip here. Mwah! πŸ’‹

πŸ“¦ where this page comes from