MCPcopy Create free account
hub / github.com/Tencent/UnLua / luaL_fileresult

Function luaL_fileresult

Plugins/UnLuaExtensions/LuaProtobuf/Source/src/pb.cpp:88–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86#include <errno.h>
87
88static int luaL_fileresult(lua_State *L, int stat, const char *fname) {
89 int en = errno;
90 if (stat) return lua_pushboolean(L, 1), 1;
91 lua_pushnil(L);
92 lua_pushfstring(L, "%s: %s", fname, strerror(en));
93 /*if (fname) lua_pushfstring(L, "%s: %s", fname, strerror(en));
94 else lua_pushstring(L, strerror(en));*//* NOT USED */
95 lua_pushinteger(L, en);
96 return 3;
97}
98
99#endif /* not LuaJIT */
100

Callers 4

io_writeFunction · 0.70
Lio_readFunction · 0.70
Lio_dumpFunction · 0.70
Lpb_loadfileFunction · 0.70

Calls 4

lua_pushbooleanFunction · 0.85
lua_pushnilFunction · 0.85
lua_pushfstringFunction · 0.85
lua_pushintegerFunction · 0.85

Tested by

no test coverage detected