1 /* EINA - EFL data type library
2 * Copyright (C) 2008 Cedric Bail
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.
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.
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/>.
22 #include "eina_types.h"
25 * @addtogroup Eina_Main_Group Main
27 * @brief These functions provide general initialisation and shut down
32 * @addtogroup Eina_Core_Group Core
38 * @defgroup Eina_Main_Group Main
44 * @def EINA_VERSION_MAJOR
45 * @brief Major version of Eina
47 #define EINA_VERSION_MAJOR 1
50 * @def EINA_VERSION_MINOR
51 * @brief Minor version of Eina
53 #define EINA_VERSION_MINOR 7
56 * @typedef Eina_Version
57 * The version of Eina.
59 typedef struct _Eina_Version
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 */
67 EAPI extern Eina_Version *eina_version;
70 * @brief Initialize the Eina library.
72 * @return 1 or greater on success, 0 on error.
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
79 * When Eina is not used anymore, call eina_shutdown() to shut down
82 EAPI int eina_init(void);
85 * @brief Shut down the Eina library.
87 * @return 0 when all the modules are completely shut down, 1 or
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.
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.
98 EAPI int eina_shutdown(void);
101 * @brief Initialize the mutexes of the Eina library.
103 * @return 1 or greater on success, 0 on error.
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
110 * When the mutexes are not used anymore, call eina_threads_shutdown() to shut down
113 * This function should never be called outside of the main loop.
115 EAPI int eina_threads_init(void);
118 * @brief Shut down mutexes in the Eina library.
120 * @return 0 when all mutexes are completely shut down, 1 or
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.
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.
131 * This function should never be called outside of the main loop.
133 EAPI int eina_threads_shutdown(void);
136 * @brief Check if you are calling this function from the same thread Eina was initialized or not
138 * @return #EINA_TRUE is the calling function is the same thread, #EINA_FALSE otherwise.
142 * Most EFL function are not thread safe and all the call need to happen in
143 * the main loop. With this call you could know if you can call an EFL
146 EAPI Eina_Bool eina_main_loop_is(void);
149 * @brief You should never use that function excpet if you really really know what your are doing.
152 * If you are reading this documentation, that certainly means you don't know what is the purpose of
153 * this call and you should just not use it.
155 EAPI void eina_main_loop_define(void);
165 #endif /* EINA_MAIN_H_ */