summaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2010-04-23 14:13:01 +0800
committerPeng Wu <alexepico@gmail.com>2010-05-19 10:09:32 +0800
commitf49a84c21e00e023a2732aea6156e5727b373618 (patch)
tree3f3498a8b003c4575207689759406f65aade3eea /lua
parent090a378d1b42c5d72615b5d4a7c3bf93d99a2078 (diff)
downloadibus-libpinyin-f49a84c21e00e023a2732aea6156e5727b373618.tar.gz
ibus-libpinyin-f49a84c21e00e023a2732aea6156e5727b373618.tar.xz
ibus-libpinyin-f49a84c21e00e023a2732aea6156e5727b373618.zip
dump all arguments for register_trigger.
Diffstat (limited to 'lua')
-rw-r--r--lua/lua-plugin-init.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/lua/lua-plugin-init.c b/lua/lua-plugin-init.c
index 417dbbb..d381308 100644
--- a/lua/lua-plugin-init.c
+++ b/lua/lua-plugin-init.c
@@ -193,7 +193,30 @@ static int ime_register_command(lua_State * L){
static int ime_register_trigger(lua_State * L){
const char * lua_function_name = luaL_checklstring(L, 1, NULL);
const char * description = luaL_checklstring(L, 2, NULL);
+ size_t num; size_t i;
fprintf(stderr, "TODO: ime_register_trigger unimplemented when called with %s (%s).\n", lua_function_name, description);
+
+ luaL_checktype(L, 3, LUA_TTABLE);
+ fprintf(stderr, "TODO: register_trigger with input_trigger_strings:\n");
+ num = lua_objlen(L, 3);
+ for ( i = 0; i < num; ++i) {
+ lua_pushinteger(L, i + 1);
+ lua_gettable(L, 3);
+ fprintf(stderr, "%d:%s\t", i + 1, lua_tostring(L, -1));
+ lua_pop(L, 1);
+ }
+ fprintf(stderr, "\n");
+
+ luaL_checktype(L, 4, LUA_TTABLE);
+ fprintf(stderr, "TODO: register_trigger with candidate_trigger_strings:\n");
+ num = lua_objlen(L, 4);
+ for ( i = 0; i < num; ++i) {
+ lua_pushinteger(L, i + 1);
+ lua_gettable(L, 4);
+ fprintf(stderr, "%d:%s\t", i + 1, lua_tostring(L, -1));
+ }
+ fprintf(stderr, "\n");
+
return 0;
}