MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / newprefile

Function newprefile

third-party/lua-5.2.4/src/liolib.c:168–173  ·  view source on GitHub ↗

** When creating file handles, always creates a `closed' file handle ** before opening the actual file; so, if there is a memory error, the ** file is not left opened. */

Source from the content-addressed store, hash-verified

166** file is not left opened.
167*/
168static LStream *newprefile (lua_State *L) {
169 LStream *p = (LStream *)lua_newuserdata(L, sizeof(LStream));
170 p->closef = NULL; /* mark file handle as 'closed' */
171 luaL_setmetatable(L, LUA_FILEHANDLE);
172 return p;
173}
174
175
176static int aux_close (lua_State *L) {

Callers 3

newfileFunction · 0.70
io_popenFunction · 0.70
createstdfileFunction · 0.70

Calls 2

lua_newuserdataFunction · 0.70
luaL_setmetatableFunction · 0.70

Tested by

no test coverage detected