TEMU  4.4
The Terma Emulator
Init.h
Go to the documentation of this file.
1 //===-- temu-c/Init.h - TEMU Library Initialisation -----------*- C++ -*-===//
2 //
3 // TEMU: The Terma Emulator
4 // (c) Terma 2015
5 // Authors: Mattias Holm <maho (at) terma.com>
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef TEMU_SUPPORT_INIT
10 #define TEMU_SUPPORT_INIT
11 #include "temu-c/Support/Attributes.h"
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 /*!
17  * Initialisation of TEMU support library.
18  *
19  * Call this function before any other use of TEMU. The function does
20  * not return failures, but halts on failed initialisation.
21  *
22  * The function should be called as early as possible in the
23  * application's execution. Preferably in the main function (though
24  * there is no strict requirement for this).
25  *
26  * The initialisation function is at present not thread safe, call it
27  * in the main thread only!
28  *
29  */
30 TEMU_API void temu_initSupportLib(void);
31 
32 /*!
33  * Create the temu config directories (typically ~/.config/temu/)
34  *
35  * This function is invoked by the init function normally, but it is
36  * useful in some cases to create the config dirs without calling
37  * init.
38  */
39 TEMU_API void temu_initConfigDirs(void);
40 
41 
42 /*!
43  * Init only license system.
44  *
45  * Initialise the license manager only. This can be used to check for
46  * whether the license is valid before proceeding with rest of the
47  * system initialisation. The function does not terminate the
48  * application on invalid license, but returns a non-zero value.
49  *
50  * \result 0 if the license is valid, other values indicate errors.
51  */
52 TEMU_API int temu_initLicense(void);
53 
54 /*!
55  * Initialise path finding support
56  *
57  * This function initialises auxillary path support needed by TEMU
58  * for locating supporting tools (e.g. stuff in libexec) and
59  * automatically appending of scripting search paths.
60  *
61  * In the future, this will likely be merged into initSupportLib for a
62  * unified init function, but this will break API compatibility, so
63  * this change is deferred to TEMU 3.
64  *
65  * Call the Function passing Argv0 of whatever you would do to invoke
66  * the temu command line tool. E.g. if temu is in your path and this
67  * is the installation you wish to use, the parameter should be
68  * "temu". However, if you wish to use a custom installation, pass the
69  * full path to the temu program. The base path can contain ~ for the
70  * current home dir and ~foo for the home dir of user foo.
71  *
72  * Note that it is not an error to omit this initialisation, but
73  * omitting it will imply that temu cannot launch UI models such as
74  * the ConsoleUI model.
75  *
76  * \param Argv0 Name of TEMU executable (typically passed as argv[0]
77  * to main)
78  */
79 TEMU_API void temu_initPathSupport(const char *Argv0);
80 
81 #ifdef __cplusplus
82 }
83 #endif
84 
85 #endif /* !TEMU_SUPPORT_INIT */
temu_initConfigDirs
TEMU_API void temu_initConfigDirs(void)
temu_initSupportLib
TEMU_API void temu_initSupportLib(void)
temu_initPathSupport
TEMU_API void temu_initPathSupport(const char *Argv0)
temu_initLicense
TEMU_API int temu_initLicense(void)