| 24 | static int ts_lua_context_set(lua_State *L); |
| 25 | |
| 26 | void |
| 27 | ts_lua_inject_context_api(lua_State *L) |
| 28 | { |
| 29 | lua_newtable(L); /* .ctx */ |
| 30 | |
| 31 | lua_createtable(L, 0, 2); /* metatable for context */ |
| 32 | |
| 33 | lua_pushcfunction(L, ts_lua_context_get); |
| 34 | lua_setfield(L, -2, "__index"); |
| 35 | lua_pushcfunction(L, ts_lua_context_set); |
| 36 | lua_setfield(L, -2, "__newindex"); |
| 37 | |
| 38 | lua_setmetatable(L, -2); |
| 39 | |
| 40 | lua_setfield(L, -2, "ctx"); |
| 41 | } |
| 42 | |
| 43 | void |
| 44 | ts_lua_create_context_table(lua_State *L) |
no outgoing calls
no test coverage detected