DTSEARCHINIT(3)
π NAME π
DtSearchInit β a library call that initializes the DtSearch online API for subsequent calls. Main-character setup step, no cap β¨
β¨ SYNOPSIS β¨
#include &<Dt/Search.h>
int DtSearchInit(
void *argv0,
char *userid,
long switches,
char *ocf_file,
FILE *err_file,
char ***dbnames,
int *dbcount);
π«Ά DESCRIPTION π«Ά
Okay so DtSearchInit opens databases and other files and initializes the search engine API for subsequent requests. It must be the first online DtSearch function called β no jumping ahead, bestie. π«Ά
DtSearchInit may be called only once, although DtSrReinit may be called at any time after DtSearchInit. Not me noticing the reinit loophole π
If this function fails, the caller should display the MessageList returned and exit; no subsequent requests will be possible.
So if it flops, it's giving end-of-program energy π
π ARGUMENTS π
argv0β Specifies the program name to be assembled into usage, error, and debug messages from the API. It is intended to be the value ofargv[0]frommain. Like the API needs to know your name for the group chat π«Άuseridβ Specifies a 1- to 8-character name to use for log messages to distinguish between users and applications where multiple copies of the engine are running. IfNULL, the first 8 characters of theLOGNAMEenvironment variable are used. Short username, literally πswitchesβ Specifies a set of bit switches used principally to enable printing debugging statements and controlling signal registration. It's giving control-panel energy ποΈDtSrInNOLOCALEβ Do not executesetlocalewithinDtSearchInit.DtSrInSIGNALβ Register DtSearch abort signal handlers.DtSrInENAB_NOHUPβ ReenableNOHUPfor offline background programs. This is also the normal action unlessDtSrInSIGNALhas been specified, in which case normal action is to abort onSIGHUPsignal. Highkey important signal lore β‘DtSrInIDEBUGβ Writes initialization trace messages toerr_file.DtSrInSDEBUGβ Writes query and search trace messages toerr_file.DtSrInRDEBUGβ Writes document retrieval trace messages toerr_file.DtSrInANY_DEBUGβ Equivalent to(DtSrInIDEBUG | DtSrInSDEBUG |DtSrInRDEBUG).DtSrInRDWRβ Opens database files for both read and write. The default is read-only. Read-only is the default, no cap π§
For example, to enable trace statements only for search and retrieval operations, pass switches as (DtSrInSDEBUG | DtSrInRDEBUG). Pass zero for switches for most normal API operations. Zero being the normal one is so iconic β¨
ocf_fileβ Specifies the fully qualified path and base file name of the API ocf configuration file. IfNULL, the initialization function looks for an ocf file with a base name of eitherdtsearch.ocforaustext.ocfin the directory specified by theDTSROCFPATHenvironment variable, in the current working directory, or in theHOMEdirectory, in that order. Seedtsrocffile(4)for the format of an ocf file. The search order is literally a scavenger hunt πerr_fileβ Specifies a pointer to a previously opened text stream file where the API will write fatal error and debug trace messages. The normal value passed forerr_fileisNULL, in which case such messages will be written tostderr.stderrstays catching strays, periodt πdbnamesβ Specifies an address where a pointer to an array of static database name string pointers will be placed. Each string identifies a single database successfully opened by this function. A database name string from this array will be used in most later API function calls. Thedbnmember inDtSrResultis an index into this array. Array girlies, this one's for you πdbcountβ Specifies a pointer to theintwhere the size of thedbnamesarray will be stored. Just the count, bestie π’
π RETURN VALUE π
DtSearchInit returns DtSrOK, and possible messages on the MessageList, if the API is successfully initialized. It returns DtSrFAIL and messages on the MessageList if the API cannot be successfully initialized. So it's either slay or sad-girl hours, no in-between πβ¨
π ENVIRONMENT VARIABLES π
LOGNAMEβ First 8 characters are used foruseridif that argument is not passed.DTSROCFPATHβ Specifies a directory where the API configuration ocf file may be located. Used in lieu of specifying theocf_fileargument.HOMEβ Specifies an alternative directory in which to look for the ocf file if theocf_fileargument is not passed, if theDTSROCFPATHenvironment variable is not specified, or if the ocf file is not found either in theDTSROCFPATHdirectory or in the current working directory.
π¦ SEE ALSO π¦
Okay bestie, that's the whole page. The footer/source-version line is DtSearchInit(library call) β no separate date text was on it, so that's the whole sign-off. xoxo π
π
π¦ where this page comes from
- nixos 26.05: cde 2.5.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms