MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / checkoption

Function checkoption

extlibs/lua/src/loslib.c:272–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

os_dateFunction · 0.85

Calls 2

luaL_argerrorFunction · 0.85
lua_pushfstringFunction · 0.85

Tested by

no test coverage detected