** Check whether message is a control message. If so, execute the ** control or ignore it if unknown. */
| 1087 | ** control or ignore it if unknown. |
| 1088 | */ |
| 1089 | static int checkcontrol (lua_State *L, const char *message, int tocont) { |
| 1090 | if (tocont || *(message++) != '@') /* not a control message? */ |
| 1091 | return 0; |
| 1092 | else { |
| 1093 | if (strcmp(message, "off") == 0) |
| 1094 | lua_setwarnf(L, warnfoff, L); /* turn warnings off */ |
| 1095 | else if (strcmp(message, "on") == 0) |
| 1096 | lua_setwarnf(L, warnfon, L); /* turn warnings on */ |
| 1097 | return 1; /* it was a control message */ |
| 1098 | } |
| 1099 | } |
| 1100 | |
| 1101 | |
| 1102 | static void warnfoff (void *ud, const char *message, int tocont) { |
no test coverage detected