2014-12-08 03:38:04 -08:00
|
|
|
/**
|
|
|
|
* @file Elua.h
|
|
|
|
* @brief Elua Library
|
|
|
|
*
|
|
|
|
* @defgroup Elua Elua
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @section intro Elua library
|
|
|
|
*
|
|
|
|
* The Elua library was created to ease integration of EFL Lua into other EFL
|
|
|
|
* libraries or applications. Using the Elua library you can easily create a
|
|
|
|
* Lua state that is fully set up for running EFL Lua bindings.
|
|
|
|
*
|
|
|
|
* You can find the API documentation at @ref Elua
|
|
|
|
*/
|
|
|
|
#ifndef _ELUA_H
|
|
|
|
#define _ELUA_H
|
|
|
|
|
|
|
|
#ifdef EAPI
|
|
|
|
# undef EAPI
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
# ifdef EFL_ELUA_BUILD
|
|
|
|
# ifdef DLL_EXPORT
|
|
|
|
# define EAPI __declspec(dllexport)
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif /* ! DLL_EXPORT */
|
|
|
|
# else
|
|
|
|
# define EAPI __declspec(dllimport)
|
|
|
|
# endif /* ! EFL_ELUA_BUILD */
|
|
|
|
#else
|
|
|
|
# ifdef __GNUC__
|
|
|
|
# if __GNUC__ >= 4
|
|
|
|
# define EAPI __attribute__ ((visibility("default")))
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
|
|
|
#endif /* ! _WIN32 */
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef EFL_BETA_API_SUPPORT
|
|
|
|
|
2014-12-12 02:44:58 -08:00
|
|
|
#include <lua.h>
|
|
|
|
#include <lualib.h>
|
|
|
|
#include <lauxlib.h>
|
|
|
|
|
2015-04-08 05:56:19 -07:00
|
|
|
typedef struct _Elua_State
|
|
|
|
{
|
|
|
|
lua_State *luastate;
|
|
|
|
} Elua_State;
|
|
|
|
|
2014-12-11 07:48:18 -08:00
|
|
|
EAPI int elua_init(void);
|
|
|
|
EAPI int elua_shutdown(void);
|
|
|
|
|
2015-04-08 06:00:57 -07:00
|
|
|
EAPI Elua_State *elua_state_new(void);
|
|
|
|
EAPI void elua_state_free(Elua_State *state);
|
|
|
|
|
2015-04-08 06:29:58 -07:00
|
|
|
EAPI Elua_State *elua_state_from_lua_get(lua_State *L);
|
|
|
|
|
2015-04-08 06:43:52 -07:00
|
|
|
EAPI int elua_report_error(Elua_State *es, const char *pname, int status);
|
2014-12-17 06:43:50 -08:00
|
|
|
|
2014-12-12 02:44:58 -08:00
|
|
|
EAPI void elua_state_setup_i18n(lua_State *L);
|
|
|
|
|
2014-12-12 04:04:10 -08:00
|
|
|
EAPI int elua_io_popen(lua_State *L);
|
2014-12-12 05:39:57 -08:00
|
|
|
EAPI int elua_io_loadfile(lua_State *L, const char *fname);
|
|
|
|
EAPI void elua_io_register(lua_State *L);
|
2014-12-12 04:04:10 -08:00
|
|
|
|
2014-12-08 03:38:04 -08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} // extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|