MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / checkcontrol

Function checkcontrol

3rd/lua-5.4.3/src/lauxlib.c:1045–1055  ·  view source on GitHub ↗

** Check whether message is a control message. If so, execute the ** control or ignore it if unknown. */

Source from the content-addressed store, hash-verified

1043** control or ignore it if unknown.
1044*/
1045static int checkcontrol (lua_State *L, const char *message, int tocont) {
1046 if (tocont || *(message++) != '@') /* not a control message? */
1047 return 0;
1048 else {
1049 if (strcmp(message, "off") == 0)
1050 lua_setwarnf(L, warnfoff, L); /* turn warnings off */
1051 else if (strcmp(message, "on") == 0)
1052 lua_setwarnf(L, warnfon, L); /* turn warnings on */
1053 return 1; /* it was a control message */
1054 }
1055}
1056
1057
1058static void warnfoff (void *ud, const char *message, int tocont) {

Callers 2

warnfoffFunction · 0.85
warnfonFunction · 0.85

Calls 1

lua_setwarnfFunction · 0.85

Tested by

no test coverage detected