/* set functions from list 'l' into table at top - 'nup'; each function gets the 'nup' elements at the top as upvalues. Returns with only the table at the stack.  */
LUALIB_API void luaL_setfuncs(lua_State *L, const luaL_Reg *l, int nup)
/* set functions from list 'l' into table at top - 'nup'; each function gets the 'nup' elements at the top as upvalues. Returns with only the table at the stack.  */
LUALIB_API void luaL_setfuncs(lua_State *L, const luaL_Reg *l, int nup)
{
    if (l->func == NULL)
      lua_pushboolean(L, 0);
    else {
      int i;
      for (i = 0; i < nup; i++)
        lua_pushvalue(L, -nup);
      lua_pushcclosure(L, l->func, nup);
    }
    lua_setfield(L, -(nup + 2), l->name);
  }
  lua_pop(L, nup);
}