diff options
| author | Peng Wu <epico@dhcp-65-116.nay.redhat.com> | 2010-04-11 15:26:30 +0800 |
|---|---|---|
| committer | Peng Wu <alexepico@gmail.com> | 2010-05-19 10:09:32 +0800 |
| commit | 25776642382b9e780e197b9f85aeb5aeb7852c7b (patch) | |
| tree | 0c5c024bad9d797e99b9dbcc4fd7a716cfdb9ebc /lua/test-lua-plugin.c | |
| parent | 83ae73bf667347973ce53f8124a64310b00b0805 (diff) | |
refactor lua-plugin
Diffstat (limited to 'lua/test-lua-plugin.c')
| -rw-r--r-- | lua/test-lua-plugin.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lua/test-lua-plugin.c b/lua/test-lua-plugin.c index 44bce4a..c9a5f12 100644 --- a/lua/test-lua-plugin.c +++ b/lua/test-lua-plugin.c @@ -35,16 +35,14 @@ static int run_test(lua_State *L, const char * filename){ int main(int argc, char * argv[]){ printf("starting test...\n"); + g_type_init(); + + IBusEnginePlugin * plugin; + plugin = ibus_engine_plugin_new(); - IBusEnginePluginPrivate priv; - - priv.L = NULL; - priv.lua_commands = NULL; - - lua_plugin_init(&priv); - - run_test(priv.L, "test.lua"); + lua_State * L = ibus_engine_plugin_get_lua_State(plugin); + run_test(L, "test.lua"); - lua_plugin_fini(&priv); + g_object_unref(plugin); return 0; } |
