Esempio n. 1
0
static int tree_gettableid(Ihandle* ih, lua_Object o)
{
  int ref = tree_getnumberintable(o);
  if(ref == 0)
		return -1;
  return IupTreeGetId(ih, (void*) ref);
}
Esempio n. 2
0
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);
}
Esempio n. 3
0
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;        
}
Esempio n. 4
0
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;        
}
Esempio n. 5
0
static void cfTreeGetId(void)
{
  lua_pushnumber(IupTreeGetId(iuplua_checkihandle(1), check_userdata(2)));
}