aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/eina/src/include/eina_main.h
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/eina/src/include/eina_main.h')
-rw-r--r--libraries/eina/src/include/eina_main.h162
1 files changed, 162 insertions, 0 deletions
diff --git a/libraries/eina/src/include/eina_main.h b/libraries/eina/src/include/eina_main.h
new file mode 100644
index 0000000..fa34d59
--- /dev/null
+++ b/libraries/eina/src/include/eina_main.h
@@ -0,0 +1,162 @@
1/* EINA - EFL data type library
2 * Copyright (C) 2008 Cedric Bail
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library;
16 * if not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef EINA_MAIN_H_
20#define EINA_MAIN_H_
21
22#include "eina_types.h"
23
24/**
25 * @addtogroup Eina_Main_Group Main
26 *
27 * @brief These functions provide general initialisation and shut down
28 * functions.
29 */
30
31/**
32 * @addtogroup Eina_Core_Group Core
33 *
34 * @{
35 */
36
37/**
38 * @defgroup Eina_Main_Group Main
39 *
40 * @{
41 */
42
43/**
44 * @def EINA_VERSION_MAJOR
45 * @brief Major version of Eina
46 */
47#define EINA_VERSION_MAJOR 1
48
49/**
50 * @def EINA_VERSION_MINOR
51 * @brief Minor version of Eina
52 */
53#define EINA_VERSION_MINOR 0
54
55/**
56 * @typedef Eina_Version
57 * The version of Eina.
58 */
59typedef struct _Eina_Version
60{
61 int major; /**< Major component of the version */
62 int minor; /**< Minor component of the version */
63 int micro; /**< Micro component of the version */
64 int revision; /**< Revision component of the version */
65} Eina_Version;
66
67EAPI extern Eina_Version *eina_version;
68
69/**
70 * @brief Initialize the Eina library.
71 *
72 * @return 1 or greater on success, 0 on error.
73 *
74 * This function sets up all the eina modules. It returns 0 on
75 * failure (that is, when one of the module fails to initialize),
76 * otherwise it returns the number of times it has already been
77 * called.
78 *
79 * When Eina is not used anymore, call eina_shutdown() to shut down
80 * the Eina library.
81 */
82EAPI int eina_init(void);
83
84/**
85 * @brief Shut down the Eina library.
86 *
87 * @return 0 when all the modules is completely shut down, 1 or
88 * greater otherwise.
89 *
90 * This function shuts down the Eina library. It returns 0 when it has
91 * been called the same number of times than eina_init(). In that case
92 * it shut down all the Eina modules.
93 *
94 * Once this function succeeds (that is, @c 0 is returned), you must
95 * not call any of the Eina function anymore. You must call
96 * eina_init() again to use the Eina functions again.
97 */
98EAPI int eina_shutdown(void);
99
100/**
101 * @brief Initialize the mutexes of the Eina library.
102 *
103 * @return 1 or greater on success, 0 on error.
104 *
105 * This function sets up all the mutexes in all eina modules. It returns 0 on
106 * failure (that is, when one of the module fails to initialize),
107 * otherwise it returns the number of times it has already been
108 * called.
109 *
110 * When the mutexes are not used anymore, call eina_threads_shutdown() to shut down
111 * the mutexes.
112 *
113 * This function should never be called outside of the main loop.
114 */
115EAPI int eina_threads_init(void);
116
117/**
118 * @brief Shut down mutexes in the Eina library.
119 *
120 * @return 0 when all mutexes are completely shut down, 1 or
121 * greater otherwise.
122 *
123 * This function shuts down the mutexes in the Eina library. It returns 0 when it has
124 * been called the same number of times than eina_threads_init(). In that case
125 * it shut down all the mutexes.
126 *
127 * Once this function succeeds (that is, @c 0 is returned), you must
128 * not call any of the Eina function in a thread anymore. You must call
129 * eina_threads_init() again to use the Eina functions in a thread again.
130 *
131 * This function should never be called outside of the main loop.
132 */
133EAPI int eina_threads_shutdown(void);
134
135/**
136 * @brief Check if you are calling this function from the same thread Eina was initialized or not
137 * @since 1.1.0
138 *
139 * Most EFL function are not thread safe and all the call need to happen in
140 * the main loop. With this call you could know if you can call an EFL
141 * function or not.
142 */
143EAPI Eina_Bool eina_main_loop_is(void);
144
145/**
146 * @brief You should never use that function excpet if you really really know what your are doing.
147 * @since 1.1.0
148 *
149 * If you are reading this documentation, that certainly means you don't know what is the purpose of
150 * this call and you should just not use it.
151 */
152EAPI void eina_main_loop_define(void);
153
154/**
155 * @}
156 */
157
158/**
159 * @}
160 */
161
162#endif /* EINA_MAIN_H_ */