2009-01-23 06:46:56 -08:00
|
|
|
/* EINA - EFL data type library
|
|
|
|
* Copyright (C) 2008 Cedric Bail
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library;
|
|
|
|
* if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef EINA_MAIN_H_
|
|
|
|
#define EINA_MAIN_H_
|
|
|
|
|
2013-11-04 01:31:48 -08:00
|
|
|
#include <Efl_Config.h>
|
|
|
|
|
2010-04-29 10:21:14 -07:00
|
|
|
#include "eina_types.h"
|
|
|
|
|
2011-04-07 05:38:55 -07:00
|
|
|
/**
|
|
|
|
* @addtogroup Eina_Main_Group Main
|
|
|
|
*
|
|
|
|
* @brief These functions provide general initialisation and shut down
|
|
|
|
* functions.
|
|
|
|
*/
|
|
|
|
|
2009-06-22 13:03:58 -07:00
|
|
|
/**
|
|
|
|
* @addtogroup Eina_Core_Group Core
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @defgroup Eina_Main_Group Main
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2010-08-16 23:58:26 -07:00
|
|
|
/**
|
|
|
|
* @def EINA_VERSION_MAJOR
|
|
|
|
* @brief Major version of Eina
|
|
|
|
*/
|
2013-11-04 01:31:48 -08:00
|
|
|
#define EINA_VERSION_MAJOR EFL_VERSION_MAJOR
|
2010-08-16 23:58:26 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @def EINA_VERSION_MINOR
|
|
|
|
* @brief Minor version of Eina
|
|
|
|
*/
|
2013-11-04 01:31:48 -08:00
|
|
|
#define EINA_VERSION_MINOR EFL_VERSION_MINOR
|
2010-08-16 23:58:26 -07:00
|
|
|
|
|
|
|
/**
|
2010-09-08 10:41:05 -07:00
|
|
|
* @typedef Eina_Version
|
2010-08-16 23:58:26 -07:00
|
|
|
* The version of Eina.
|
|
|
|
*/
|
|
|
|
typedef struct _Eina_Version
|
|
|
|
{
|
|
|
|
int major; /**< Major component of the version */
|
|
|
|
int minor; /**< Minor component of the version */
|
|
|
|
int micro; /**< Micro component of the version */
|
|
|
|
int revision; /**< Revision component of the version */
|
|
|
|
} Eina_Version;
|
|
|
|
|
|
|
|
EAPI extern Eina_Version *eina_version;
|
|
|
|
|
2011-04-07 05:38:55 -07:00
|
|
|
/**
|
|
|
|
* @brief Initialize the Eina library.
|
|
|
|
*
|
|
|
|
* @return 1 or greater on success, 0 on error.
|
|
|
|
*
|
|
|
|
* This function sets up all the eina modules. It returns 0 on
|
|
|
|
* failure (that is, when one of the module fails to initialize),
|
|
|
|
* otherwise it returns the number of times it has already been
|
|
|
|
* called.
|
|
|
|
*
|
|
|
|
* When Eina is not used anymore, call eina_shutdown() to shut down
|
|
|
|
* the Eina library.
|
|
|
|
*/
|
2009-01-23 06:46:56 -08:00
|
|
|
EAPI int eina_init(void);
|
2011-04-07 05:38:55 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Shut down the Eina library.
|
|
|
|
*
|
2012-04-15 17:21:57 -07:00
|
|
|
* @return 0 when all the modules are completely shut down, 1 or
|
2011-04-07 05:38:55 -07:00
|
|
|
* greater otherwise.
|
|
|
|
*
|
|
|
|
* This function shuts down the Eina library. It returns 0 when it has
|
|
|
|
* been called the same number of times than eina_init(). In that case
|
|
|
|
* it shut down all the Eina modules.
|
|
|
|
*
|
|
|
|
* Once this function succeeds (that is, @c 0 is returned), you must
|
|
|
|
* not call any of the Eina function anymore. You must call
|
|
|
|
* eina_init() again to use the Eina functions again.
|
|
|
|
*/
|
2009-01-23 06:46:56 -08:00
|
|
|
EAPI int eina_shutdown(void);
|
2011-04-07 05:38:55 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Initialize the mutexes of the Eina library.
|
|
|
|
*
|
|
|
|
* @return 1 or greater on success, 0 on error.
|
|
|
|
*
|
|
|
|
* This function sets up all the mutexes in all eina modules. It returns 0 on
|
|
|
|
* failure (that is, when one of the module fails to initialize),
|
|
|
|
* otherwise it returns the number of times it has already been
|
|
|
|
* called.
|
|
|
|
*
|
|
|
|
* When the mutexes are not used anymore, call eina_threads_shutdown() to shut down
|
|
|
|
* the mutexes.
|
2011-05-02 04:20:00 -07:00
|
|
|
*
|
|
|
|
* This function should never be called outside of the main loop.
|
2011-04-07 05:38:55 -07:00
|
|
|
*/
|
2009-11-01 11:50:18 -08:00
|
|
|
EAPI int eina_threads_init(void);
|
2011-04-07 05:38:55 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Shut down mutexes in the Eina library.
|
|
|
|
*
|
|
|
|
* @return 0 when all mutexes are completely shut down, 1 or
|
|
|
|
* greater otherwise.
|
|
|
|
*
|
|
|
|
* This function shuts down the mutexes in the Eina library. It returns 0 when it has
|
|
|
|
* been called the same number of times than eina_threads_init(). In that case
|
|
|
|
* it shut down all the mutexes.
|
|
|
|
*
|
|
|
|
* Once this function succeeds (that is, @c 0 is returned), you must
|
|
|
|
* not call any of the Eina function in a thread anymore. You must call
|
|
|
|
* eina_threads_init() again to use the Eina functions in a thread again.
|
2011-05-02 04:20:00 -07:00
|
|
|
*
|
|
|
|
* This function should never be called outside of the main loop.
|
2011-04-07 05:38:55 -07:00
|
|
|
*/
|
2009-11-01 11:50:18 -08:00
|
|
|
EAPI int eina_threads_shutdown(void);
|
|
|
|
|
2011-07-29 07:56:42 -07:00
|
|
|
/**
|
|
|
|
* @brief Check if you are calling this function from the same thread Eina was initialized or not
|
2011-12-07 04:07:18 -08:00
|
|
|
*
|
|
|
|
* @return #EINA_TRUE is the calling function is the same thread, #EINA_FALSE otherwise.
|
|
|
|
*
|
2011-08-01 07:59:51 -07:00
|
|
|
* @since 1.1.0
|
2011-07-29 07:56:42 -07:00
|
|
|
*
|
|
|
|
* Most EFL function are not thread safe and all the call need to happen in
|
|
|
|
* the main loop. With this call you could know if you can call an EFL
|
|
|
|
* function or not.
|
|
|
|
*/
|
|
|
|
EAPI Eina_Bool eina_main_loop_is(void);
|
|
|
|
|
2011-08-17 02:42:43 -07:00
|
|
|
/**
|
|
|
|
* @brief You should never use that function excpet if you really really know what your are doing.
|
|
|
|
* @since 1.1.0
|
|
|
|
*
|
|
|
|
* If you are reading this documentation, that certainly means you don't know what is the purpose of
|
|
|
|
* this call and you should just not use it.
|
|
|
|
*/
|
|
|
|
EAPI void eina_main_loop_define(void);
|
|
|
|
|
2009-06-22 13:03:58 -07:00
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
2009-01-23 06:46:56 -08:00
|
|
|
#endif /* EINA_MAIN_H_ */
|