forked from enlightenment/efl
eolian: add runtime API to get file format version
This is useful for FFI based bindings (like the Lua or Python ones) and so on.
This commit is contained in:
parent
21790b055b
commit
223c0a0fdc
|
@ -290,6 +290,7 @@ ffi.cdef [[
|
|||
|
||||
int eolian_init(void);
|
||||
int eolian_shutdown(void);
|
||||
unsigned short eolian_file_format_version_get(void);
|
||||
Eolian_State *eolian_state_new(void);
|
||||
void eolian_state_free(Eolian_State *state);
|
||||
Eolian_Panic_Cb eolian_state_panic_cb_set(Eolian_State *state, Eolian_Panic_Cb cb);
|
||||
|
@ -491,6 +492,7 @@ local init = function()
|
|||
eolian = util.lib_load("eolian")
|
||||
eina = util.lib_load("eina")
|
||||
eolian.eolian_init()
|
||||
M.file_format_version = eolian.eolian_file_format_version_get()
|
||||
end
|
||||
|
||||
local shutdown = function()
|
||||
|
|
|
@ -485,6 +485,15 @@ EAPI int eolian_init(void);
|
|||
*/
|
||||
EAPI int eolian_shutdown(void);
|
||||
|
||||
/*
|
||||
* @brief Get the Eolian file format version.
|
||||
*
|
||||
* This is the same as the #EOLIAN_FILE_FORMAT_VERSION macro, but allows
|
||||
* retrieval of the version at runtime, so it can be used by FFI based
|
||||
* bindings in dynamic languages to do runtime checks and so on.
|
||||
*/
|
||||
EAPI unsigned short eolian_file_format_version_get(void);
|
||||
|
||||
/*
|
||||
* @brief Create a new Eolian state.
|
||||
*
|
||||
|
|
|
@ -68,3 +68,7 @@ EAPI int eolian_shutdown(void)
|
|||
return _eolian_init_counter;
|
||||
}
|
||||
|
||||
EAPI unsigned short eolian_file_format_version_get(void)
|
||||
{
|
||||
return EOLIAN_FILE_FORMAT_VERSION;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue