MCPcopy Create free account
hub / github.com/TypesettingTools/Aegisub / check_udata

Function check_udata

libaegisub/lua/utils.cpp:79–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79void *check_udata(lua_State *L, int idx, const char *mt) {
80 void *p = lua_touserdata(L, idx);
81 if (!p) typerror(L, idx, mt);
82 if (!lua_getmetatable(L, idx)) typerror(L, idx, mt);
83
84 lua_getfield(L, LUA_REGISTRYINDEX, mt);
85 if (!lua_rawequal(L, -1, -2)) typerror(L, idx, mt);
86
87 lua_pop(L, 2);
88 return p;
89}
90
91static int moon_line(lua_State *L, int lua_line, std::string const& file) {
92 if (luaL_dostring(L, "return require 'moonscript.line_tables'")) {

Callers 1

utils.hFile · 0.85

Calls 1

typerrorFunction · 0.85

Tested by

no test coverage detected