TEMU  2
The Terma Emulator
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Init.h File Reference
Include dependency graph for Init.h:

Go to the source code of this file.

Functions

TEMU_API void temu_initSupportLib (void)
 
TEMU_API void temu_initConfigDirs (void)
 
TEMU_API int temu_initLicense (void)
 
TEMU_API void temu_initPathSupport (const char *Argv0)
 

Function Documentation

TEMU_API void temu_initConfigDirs ( void  )

Create the temu config directories (typically ~/.config/temu/)

This function is invoked by the init function normally, but it is useful in some cases to create the config dirs without calling init.

TEMU_API int temu_initLicense ( void  )

Init only license system.

Initialise the license manager only. This can be used to check for whether the license is valid before proceeding with rest of the system initialisation. The function does not terminate the application on invalid license, but returns a non-zero value.

Returns
0 if the license is valid, other values indicate errors.
TEMU_API void temu_initPathSupport ( const char *  Argv0)

Initialise path finding support

This function initialises auxillary path support needed by T-EMU for locating supporting tools (e.g. stuff in libexec) and automatically appending of scripting search paths.

In the future, this will likely be merged into initSupportLib for a unified init function, but this will break API compatibility, so this change is deferred to T-EMU 3.

Call the Function passing Argv0 of whatever you would do to invoke the temu command line tool. E.g. if temu is in your path and this is the installation you wish to use, the parameter should be "temu". However, if you wish to use a custom installation, pass the full path to the temu program. The base path can contain ~ for the current home dir and ~foo for the home dir of user foo.

Note that it is not an error to omit this initialisation, but omitting it will imply that temu cannot launch UI models such as the ConsoleUI model.

Parameters
Argv0Name of T-EMU executable (typically passed as argv[0] to main)
TEMU_API void temu_initSupportLib ( void  )

Initialisation of T-EMU support library.

Call this function before any other use of T-EMU. The function does not return failures, but halts on failed initialisation.

The function should be called as early as possible in the application's execution. Preferably in the main function (though there is no strict requirement for this).

The initialisation function is at present not thread safe, call it in the main thread only!