DTSEARCHEXIT(3)

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

πŸ’… DtSearchExit β€” library call πŸ’…

okay so bestie, welcome to the library call manual page for DtSearchExit β€” yes, the search-engine shutdown girly. 🫢 This is the one that does the orderly exit thing and then never comes back, no cap.

✨ NAME ✨

DtSearchExit β€” perform orderly shutdown of search engine. Literally that. πŸ’–

πŸŽ€ SYNOPSIS πŸŽ€

here’s the exact shape, bestie:

#include &<Dt/Search.h>
void DtSearchExit(
int return-code);

void DtSearchAddUserExit(
void (*user_exit)(int));

void DtSearchRemoveUserExit(
);

πŸ’– DESCRIPTION πŸ’–

Okay so DtSearchExit is an internal exit call for the online API. Any API module can call it when it detects a fatal error or an aborting signal. When it runs, it does an orderly shutdown of the search engine β€” including graceful database closure, communications disconnect, release of system resources, restoration of environment, etc., as necessary. It will call a user exit function if one was installed by DtSearchAddUserExit. 🫢

The final action is a call to the standard system exit function, so DtSearchExit never returns. The return_code you pass to DtSearchExit will eventually be the value passed to exit. 😭 No return ticket, bestie.

Using DtSearchExit is not required to use the DtSearch API. Each API function does its own resource cleanup before returning to the caller, so process termination outside of the API need not make further reference to the API. slay for self-cleaning functions honestly ✨

For the convenience of API users, DtSearchAddUserExit may be called to install an optional user_exit function which will be called from within DtSearchExit. The user_exit argument is a pointer to a user written function that takes an integer argument and returns void. If DtSearchExit is called, the value of return_code will be passed as the argument to the user_exit function. πŸŽ€

Calling DtSearchAddUserExit replaces a user_exit installed by a previous call, if any. User exits are typically installed to ensure that required application cleanup is performed if the API should happen to abort. Since DtSearchExit may be called from within a signal catching function, user_exit should not call functions which would be unsafe for a signal catcher to call, as defined by the POSIX standard.

⚠️ Important vibe check: that last part is not a drill. user_exit has to stay signal-catcher-safe per POSIX, okay? iykyk πŸ’…

DtSearchRemoveUserExit may be called to remove any user_exit installed by a previous call to DtSearchAddUserExit. cleanup queen behavior 🧚

🌈 RETURN VALUE 🌈

DtSearchExit and the user_exit installed by DtSearchAddUserExit do not return. Like, ever. πŸ’€βœ¨

πŸ‘‘ SEE ALSO πŸ‘‘

go read these too, bestie:


okay bestie, that’s the whole DtSearchExit(library call) footer vibe β€” no extra source/version/date line to copy here, just the manual name β€” so consider this your cute sign-off. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from