From b3b8dfaaea2dba7e7b4b898a5f767a80f36319f1 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 17 Dec 2009 11:08:51 -0200 Subject: yet more options moved from luaconf.h into internal files --- loslib.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'loslib.c') diff --git a/loslib.c b/loslib.c index 5df75a5c..c51ce5eb 100644 --- a/loslib.c +++ b/loslib.c @@ -1,5 +1,5 @@ /* -** $Id: loslib.c,v 1.27 2009/11/24 12:05:44 roberto Exp roberto $ +** $Id: loslib.c,v 1.28 2009/12/17 12:26:09 roberto Exp roberto $ ** Standard Operating System library ** See Copyright Notice in lua.h */ @@ -20,6 +20,23 @@ #include "lualib.h" +/* +** list of valid conversion specifiers @* for the 'strftime' function +*/ +#if !defined(LUA_STRFTIMEOPTIONS) + +#if !defined(LUA_USE_POSIX) +#define LUA_STRFTIMEOPTIONS { "aAbBcdHIjmMpSUwWxXyYz%", "" } +#else +#define LUA_STRFTIMEOPTIONS { "aAbBcCdDeFgGhHIjmMnprRStTuUVwWxXyYzZ%", "", \ + "E", "cCxXyY", \ + "O", "deHImMSuUVwWy" } +#endif + +#endif + + + /* ** By default, Lua uses tmpnam except when POSIX is available, where it ** uses mkstemp. @@ -144,7 +161,7 @@ static int getfield (lua_State *L, const char *key, int d) { static const char *checkoption (lua_State *L, const char *conv, char *buff) { - static const char *const options[] = { LUA_STRFTIMEOPTIONS }; + static const char *const options[] = LUA_STRFTIMEOPTIONS; unsigned int i; for (i = 0; i < sizeof(options)/sizeof(options[0]); i += 2) { if (*conv != '\0' && strchr(options[i], *conv) != NULL) { -- cgit v1.2.3-55-g6feb