MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / lua_setreadonly

Function lua_setreadonly

other_src/lua/src/lapi.cpp:1090–1102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1088
1089
1090LUA_API void lua_setreadonly (lua_State *L, int idx, int state) { /*BZ*/
1091 const lu_byte mask = (LUA_READONLY_OLD_LUA_BIT | LUA_READONLY_OLD_CAPI_BIT |
1092 LUA_READONLY_NEW_LUA_BIT | LUA_READONLY_NEW_CAPI_BIT);
1093 StkId o;
1094 Table* t;
1095 lua_lock(L);
1096 api_checknelems(L, 1);
1097 o = index2adr(L, idx);
1098 api_check(L, ttistable(o));
1099 t = hvalue(o);
1100 t->readonly = (t->readonly & ~mask) | (cast(lu_byte, state) & mask);
1101 lua_unlock(L);
1102}
1103
1104#endif
1105

Callers 1

treadonlyFunction · 0.85

Calls 1

index2adrFunction · 0.70

Tested by

no test coverage detected