int AG_InitCore (const char *progname, Uint flags)
void AG_AtExitFunc (void (*fn)(void))
void AG_Quit (void)
void AG_Destroy (void)
|
The
AG_InitCore() function initializes the
AG_Core library.
progname is an optional identifier for the program.
This name may be used to construct platform-specific directory paths.
Unless the
AG_CREATE_DATADIR flags option is set, the
progname argument can be NULL.
Available
flags options include:
AG_VERBOSE | Allow errors/warnings on the standard error output.
| AG_CREATE_DATADIR | Check that the application data directory exists, create it if necessary
(or fail if it cannot be created).
It contains the state of objects saved by
AG_ObjectSave(3). The default is
$HOME/.progname/ on Unix and platform-dependent elsewhere.
| AG_SOFT_TIMERS | Don't use OS-provided timer mechanisms (such as BSD
kqueue(2), Linux timerfd or
select(2)). Timers will be handled either by explicitely updating a software-based timing
wheel (see
AG_ProcessTimeouts(3)), or some other mechanism.
| AG_POSIX_USERS | If both
AG_User(3) modules "getenv" and "posix" are available, prefer "posix".
This is not the default because "posix" incurs potential startup overhead
while initially accessing the password database (and $HOME is all Agar
needs for its own purposes).
|
The
AG_AtExitFunc() registers a function that will be invoked automatically by
AG_Destroy().
AG_Quit() terminates the application by releasing resources allocated by
AG_Core and invoking
exit(2).
The
AG_Destroy() function releases all resources allocated by the
AG_Core library.
|