Agar

<-- Back to AG_Intro.3

SYNOPSIS

#include <agar/core.h>

DESCRIPTION

The AG_Core library implements the Agar AG_Object(3) system and provides interfaces to common operating system services (filesystems, network APIs, threads). The Agar-GUI library is based on AG_Core, but AG_Core itself contains no GUI-related code and can be installed independently.

For a complete listing of available subsystems and interfaces, see the AGAR-CORE section of AG_Intro(3).

INITIALIZATION


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_VERBOSEAllow errors/warnings on the standard error output.
AG_CREATE_DATADIRCheck that the application's run-time data directory exists, create it if necessary, and fail if it cannot be created. This directory contains the state of objects saved with AG_ObjectSave(3). The default is $HOME/.<progname> on Unix, and platform-dependent on other platforms.
AG_SOFT_TIMERSDon't use operating-system provided timer mechanisms such as BSD kqueue(2), Linux timerfd or POSIX select(2). The processing of timers will be handled either by explicit updating of software-based timing wheel (e.g., by calling AG_ProcessTimeouts(3)), or some other mechanism.

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.

AGAR VERSION INFORMATION


void AG_GetVersion (AG_AgarVersion *ver)

bool AG_VERSION_ATLEAST (int major, int minor, int patchlevel)


The AG_GetVersion() function fills an AG_AgarVersion structure with version information:
typedef struct ag_agar_version {
	int major;
	int minor;
	int patch;
	const char *release;
} AG_AgarVersion;

Agar does not need to have been previously initialized for AG_GetVersion() to work.

The AG_VERSION_ATLEAST() macro evaluates to true if the current Agar version is equal to, or exceeds the given version number.

SEE ALSO

AG_Config(3), AG_DataSource(3), AG_Db(3), AG_DSO(3), AG_Error(3), AG_Event(3), AG_EventLoop(3), AG_Execute(3), AG_File(3), AG_Intro(3), AG_Limits(3), AG_Net(3), AG_Object(3), AG_String(3), AG_TextElement(3), AG_Threads(3), AG_Time(3), AG_Timer(3), AG_User(3), AG_Variable(3), AG_Version(3)

HISTORY

The AG_InitCore() function first appeared in Agar 1.0.

Csoft.net ElectronTubeStore.com