luafar/src/exported.c
void UpdateFileSelection(lua_State* L, struct PluginPanelItem *PanelItems, int ItemsNumber)
{
  int i;
  for(i=0; i<(int)ItemsNumber; i++)
  {
    lua_rawgeti(L, -1, i+1);           //+1
    if(lua_istable(L,-1))
    {
      lua_getfield(L,-1,"Flags");      //+2
      if(lua_toboolean(L,-1))
      {
        int success = 0;
        int Flags = GetFlagCombination(L,-1,&success);
        if(success && ((Flags & PPIF_SELECTED) == 0))
          PanelItems[i].Flags &= ~PPIF_SELECTED;
      }
      lua_pop(L,1);         //+1
    }
    lua_pop(L,1);           //+0
  }
}
// PanelItems table should be on Lua stack top
PanelItems table should be on Lua stack top
PanelItems table should be on Lua stack top
void UpdateFileSelection(lua_State* L, struct PluginPanelItem *PanelItems, int ItemsNumber)
{
  int i;
  for(i=0; i<(int)ItemsNumber; i++)
  {
    lua_rawgeti(L, -1, i+1);           
    if(lua_istable(L,-1))
    {
      lua_getfield(L,-1,"Flags");      
      if(lua_toboolean(L,-1))
      {
        int success = 0;
        int Flags = GetFlagCombination(L,-1,&success);
        if(success && ((Flags & PPIF_SELECTED) == 0))
          PanelItems[i].Flags &= ~PPIF_SELECTED;
      }
      lua_pop(L,1);         
    }
    lua_pop(L,1);           
  }
}
void UpdateFileSelection ( lua_State * L , struct PluginPanelItem * PanelItems , int ItemsNumber ) { int i ; for ( i = 0 ; i < ( int ) ItemsNumber ; i ++ ) { lua_rawgeti ( L , -1 , i + 1 ) ; if ( lua_istable ( L , -1 ) ) { lua_getfield ( L , -1 , " " ) ; if ( lua_toboolean ( L , -1 ) ) { int success = 0 ; int Flags = GetFlagCombination ( L , -1 , & success ) ; if ( success && ( ( Flags & PPIF_SELECTED ) == 0 ) ) PanelItems [ i ] . Flags &= ~ PPIF_SELECTED ; } lua_pop ( L , 1 ) ; } lua_pop ( L , 1 ) ; } }
PanelItems table should be on Lua stack top
PanelItems table should be on Lua stack top
//+1 //+2 //+1 //+0