MCPcopy Create free account
hub / github.com/Segs/Segs / lua_load

Function lua_load

3rd_party/lua_sol2/include/sol.hpp:2764–2779  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2762}
2763
2764COMPAT53_API int lua_load(lua_State *L, lua_Reader reader, void *data, const char *source, const char *mode) {
2765 int status = LUA_OK;
2766 compat53_reader_data compat53_data = { reader, data, 1, 0, 0 };
2767 compat53_data.peeked_data = reader(L, data, &(compat53_data.peeked_data_size));
2768 if (compat53_data.peeked_data && compat53_data.peeked_data_size &&
2769 compat53_data.peeked_data[0] == LUA_SIGNATURE[0]) /* binary file? */
2770 status = compat53_checkmode(L, mode, "binary", LUA_ERRSYNTAX);
2771 else
2772 status = compat53_checkmode(L, mode, "text", LUA_ERRSYNTAX);
2773 if (status != LUA_OK)
2774 return status;
2775 /* we need to call the original 5.1 version of lua_load! */
2776#undef lua_load
2777 return lua_load(L, compat53_reader, &compat53_data, source);
2778#define lua_load COMPAT53_CONCAT(COMPAT53_PREFIX, _load_53)
2779}
2780
2781typedef struct {
2782 int n; /* number of pre-read characters */

Callers 2

luaL_loadfilexFunction · 0.85
loadMethod · 0.85

Calls 1

compat53_checkmodeFunction · 0.85

Tested by

no test coverage detected