MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / newprefile

Function newprefile

extlibs/lua/src/liolib.c:189–194  ·  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 ** handle is in a consistent state. */

Source from the content-addressed store, hash-verified

187** handle is in a consistent state.
188*/
189static LStream *newprefile (lua_State *L) {
190 LStream *p = (LStream *)lua_newuserdatauv(L, sizeof(LStream), 0);
191 p->closef = NULL; /* mark file handle as 'closed' */
192 luaL_setmetatable(L, LUA_FILEHANDLE);
193 return p;
194}
195
196
197/*

Callers 3

newfileFunction · 0.85
io_popenFunction · 0.85
createstdfileFunction · 0.85

Calls 2

lua_newuserdatauvFunction · 0.85
luaL_setmetatableFunction · 0.70

Tested by

no test coverage detected