MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / checkoption

Function checkoption

third-party/lua-5.5.0/src/loslib.c:275–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273
274
275static const char *checkoption (lua_State *L, const char *conv,
276 size_t convlen, char *buff) {
277 const char *option = LUA_STRFTIMEOPTIONS;
278 unsigned oplen = 1; /* length of options being checked */
279 for (; *option != '\0' && oplen <= convlen; option += oplen) {
280 if (*option == '|') /* next block? */
281 oplen++; /* will check options with next length (+1) */
282 else if (memcmp(conv, option, oplen) == 0) { /* match? */
283 memcpy(buff, conv, oplen); /* copy valid option to buffer */
284 buff[oplen] = '\0';
285 return conv + oplen; /* return next item */
286 }
287 }
288 luaL_argerror(L, 1,
289 lua_pushfstring(L, "invalid conversion specifier '%%%s'", conv));
290 return conv; /* to avoid warnings */
291}
292
293
294static time_t l_checktime (lua_State *L, int arg) {

Callers 1

os_dateFunction · 0.70

Calls 2

luaL_argerrorFunction · 0.70
lua_pushfstringFunction · 0.70

Tested by

no test coverage detected