diff options
author | Peng Wu <epico@dhcp-65-116.nay.redhat.com> | 2010-04-11 15:10:41 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2010-05-19 10:09:32 +0800 |
commit | 83ae73bf667347973ce53f8124a64310b00b0805 (patch) | |
tree | 177acaebf4e76eaa53d69d73495caa20cf6b9ab2 /lua/lua-plugin-init.c | |
parent | 7505cd8f7c7298f6db1dc1ad665b082810234944 (diff) | |
download | ibus-libpinyin-83ae73bf667347973ce53f8124a64310b00b0805.tar.gz ibus-libpinyin-83ae73bf667347973ce53f8124a64310b00b0805.tar.xz ibus-libpinyin-83ae73bf667347973ce53f8124a64310b00b0805.zip |
refactor lua-plugin gobject interface.
Diffstat (limited to 'lua/lua-plugin-init.c')
-rw-r--r-- | lua/lua-plugin-init.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/lua/lua-plugin-init.c b/lua/lua-plugin-init.c index 403be44..42c6f5c 100644 --- a/lua/lua-plugin-init.c +++ b/lua/lua-plugin-init.c @@ -29,41 +29,6 @@ void lua_plugin_openlibs (lua_State *L) { } } -int lua_plugin_init(IBusEnginePluginPrivate * plugin){ - g_assert(NULL == plugin->L); - /* initialize Lua */ - plugin->L = lua_open(); - - /* enable libs in sandbox */ - lua_plugin_openlibs(plugin->L); - - if ( NULL == plugin->lua_commands ) - plugin->lua_commands = g_array_new(TRUE, TRUE, sizeof(lua_command_t)); - - return 0; -} - -int lua_plugin_fini(IBusEnginePluginPrivate * plugin){ - size_t i; - lua_command_t * command; - - if ( plugin->lua_commands ){ - for ( i = 0; i < plugin->lua_commands->len; ++i){ - command = &g_array_index(plugin->lua_commands, lua_command_t, i); - g_free((gpointer)command->command_name); - g_free((gpointer)command->lua_function_name); - g_free((gpointer)command->description); - g_free((gpointer)command->leading); - g_free((gpointer)command->help); - } - g_array_free(plugin->lua_commands, TRUE); - plugin->lua_commands = NULL; - } - - lua_close(plugin->L); - return 0; -} - static int ime_get_last_commit(lua_State* L){ /*TODO: not implemented. */ fprintf(stderr, "TODO: ime_get_last_commit unimplemented.\n"); |