From 113f004efdbf39ef37a1758b862117b38ba4fedf Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Thu, 1 Apr 2010 16:34:21 +0800 Subject: begin lua-plugin integration. --- lua/lua-plugin.h | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'lua/lua-plugin.h') diff --git a/lua/lua-plugin.h b/lua/lua-plugin.h index b2fe8e5..2ffdeed 100644 --- a/lua/lua-plugin.h +++ b/lua/lua-plugin.h @@ -5,6 +5,34 @@ int lua_plugin_init(lua_State * L); int lua_plugin_fini(lua_State * L); #define LUA_IMELIBNAME "ime" -LUALIB_API int (luaopen_ime) (lua_State *L); +LUALIB_API int (luaopen_ime) (lua_State * L); + +typedef struct{ + const char * command_name; + const char * lua_function_name; + const char * description; + const char * leading; /* optional, default "digit". */ + const char * help; /* optional. */ +} lua_command_t; + +/** + * retrieve all available lua plugin commands. + * return array of command informations of type lua_command_t. + */ +GArray * lua_plugin_ime_get_available_commands(lua_State * L); + +/** + * retval int: only support string or string array. + */ +int lua_plugin_ime_call(lua_State * L, const lua_command_t * command, const char * argument /*optional, maybe NULL.*/); + +/** + * retrieve the retval string value. (value has been copied.) + */ +const char * lua_plugin_ime_get_retval(lua_State * L); +/** + * retrieve the array of string values. (string values have been copied.) + */ +GArray * lua_plugin_ime_get_retvals(lua_State * L); #endif -- cgit