MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / createmetatable

Function createmetatable

lua/lstrlib.c:845–857  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

843
844
845static void createmetatable (lua_State *L) {
846 lua_createtable(L, 0, 1); /* create metatable for strings */
847 lua_pushliteral(L, ""); /* dummy string */
848 lua_pushvalue(L, -2);
849 lua_setmetatable(L, -2); /* set string metatable */
850 lua_pop(L, 1); /* pop dummy string */
851 lua_pushvalue(L, -2); /* string library... */
852 lua_setfield(L, -2, "__index"); /* ...is the __index metamethod */
853 /* COMDB2 MODIFICATION */
854 lua_pushcfunction(L, l_column_cast);
855 lua_setfield(L, -2, "__cast");
856 lua_pop(L, 1); /* pop metatable */
857}
858
859
860/*

Callers 1

luaopen_stringFunction · 0.85

Calls 4

lua_createtableFunction · 0.85
lua_pushvalueFunction · 0.85
lua_setmetatableFunction · 0.85
lua_setfieldFunction · 0.85

Tested by

no test coverage detected