#include "stream.h" #include #include /// Creates and pushes new Stream into the Lua stack. /// \param L Lua state to push to /// \param fd File descriptor used by stream /// \return TODO int stream_push_new(lua_State * L, const int fd) { struct stream * s = lua_newuserdata(L, sizeof(struct stream)); s->fd = fd; if (1 == luaL_newmetatable(L, "stream")) { // TODO: initialize metatable for stream } lua_setmetatable(L, -2); return LUA_OK; }