MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / newprefile

Function newprefile

3rd/lua-5.4.3/src/liolib.c:201–206  ·  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

199** handle is in a consistent state.
200*/
201static LStream *newprefile (lua_State *L) {
202 LStream *p = (LStream *)lua_newuserdatauv(L, sizeof(LStream), 0);
203 p->closef = NULL; /* mark file handle as 'closed' */
204 luaL_setmetatable(L, LUA_FILEHANDLE);
205 return p;
206}
207
208
209/*

Callers 3

newfileFunction · 0.85
io_popenFunction · 0.85
createstdfileFunction · 0.85

Calls 2

lua_newuserdatauvFunction · 0.85
luaL_setmetatableFunction · 0.85

Tested by

no test coverage detected