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

Function l_checkmode

3rd/lua-5.4.3/src/liolib.c:40–44  ·  view source on GitHub ↗

Check whether 'mode' matches '[rwa]%+?[L_MODEEXT]*' */

Source from the content-addressed store, hash-verified

38
39/* Check whether 'mode' matches '[rwa]%+?[L_MODEEXT]*' */
40static int l_checkmode (const char *mode) {
41 return (*mode != '\0' && strchr("rwa", *(mode++)) != NULL &&
42 (*mode != '+' || ((void)(++mode), 1)) && /* skip if char is '+' */
43 (strspn(mode, L_MODEEXT) == strlen(mode))); /* check extensions */
44}
45
46#endif
47

Callers 1

io_openFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected