static int tree_gettableid(Ihandle* ih, lua_Object o) { int ref = tree_getnumberintable(o); if(ref == 0) return -1; return IupTreeGetId(ih, (void*) ref); }
VALUE rb_IupTreeGetId(VALUE node,VALUE v_userid) { int v; void *userid = (void*)NUM2ULONG(v_userid); VALUE v_ih = rb_iv_get(node,"@ihandle"); v = IupTreeGetId((Ihandle*)NUM2ULONG(v_ih),userid); return INT2FIX((int)v); }
static int TreeGetId(lua_State *L) { Ihandle *ih = iuplua_checkihandle(L,1); int ref = tree_gettableref(L, 2); if (ref == LUA_NOREF) lua_pushnil(L); else { int id; if (ref >= 0) ref++; /* only positive references are shifted */ id = IupTreeGetId(ih, (void*)ref); if (id == -1) lua_pushnil(L); else lua_pushinteger(L, id); } return 1; }
static int TreeGetId(lua_State *L) { Ihandle *h = iuplua_checkihandle(L,1); int ref = gettableref(L, 2); if(ref == 0) { lua_pushnil(L); } else { int id = IupTreeGetId(h, (char*) ref); if(id < 0) lua_pushnil(L); else lua_pushnumber(L,id); } return 1; }
static void cfTreeGetId(void) { lua_pushnumber(IupTreeGetId(iuplua_checkihandle(1), check_userdata(2))); }