diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-12-17 11:08:51 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-12-17 11:08:51 -0200 |
| commit | b3b8dfaaea2dba7e7b4b898a5f767a80f36319f1 (patch) | |
| tree | d9dd2e8cbeb216f0bc61f1058946fbfcca120237 /loslib.c | |
| parent | adc6a4865bfd12339ad7c31b43ba26206d385517 (diff) | |
| download | lua-b3b8dfaaea2dba7e7b4b898a5f767a80f36319f1.tar.gz lua-b3b8dfaaea2dba7e7b4b898a5f767a80f36319f1.tar.bz2 lua-b3b8dfaaea2dba7e7b4b898a5f767a80f36319f1.zip | |
yet more options moved from luaconf.h into internal files
Diffstat (limited to 'loslib.c')
| -rw-r--r-- | loslib.c | 21 |
1 files changed, 19 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: loslib.c,v 1.27 2009/11/24 12:05:44 roberto Exp roberto $ | 2 | ** $Id: loslib.c,v 1.28 2009/12/17 12:26:09 roberto Exp roberto $ |
| 3 | ** Standard Operating System library | 3 | ** Standard Operating System library |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -21,6 +21,23 @@ | |||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | /* | 23 | /* |
| 24 | ** list of valid conversion specifiers @* for the 'strftime' function | ||
| 25 | */ | ||
| 26 | #if !defined(LUA_STRFTIMEOPTIONS) | ||
| 27 | |||
| 28 | #if !defined(LUA_USE_POSIX) | ||
| 29 | #define LUA_STRFTIMEOPTIONS { "aAbBcdHIjmMpSUwWxXyYz%", "" } | ||
| 30 | #else | ||
| 31 | #define LUA_STRFTIMEOPTIONS { "aAbBcCdDeFgGhHIjmMnprRStTuUVwWxXyYzZ%", "", \ | ||
| 32 | "E", "cCxXyY", \ | ||
| 33 | "O", "deHImMSuUVwWy" } | ||
| 34 | #endif | ||
| 35 | |||
| 36 | #endif | ||
| 37 | |||
| 38 | |||
| 39 | |||
| 40 | /* | ||
| 24 | ** By default, Lua uses tmpnam except when POSIX is available, where it | 41 | ** By default, Lua uses tmpnam except when POSIX is available, where it |
| 25 | ** uses mkstemp. | 42 | ** uses mkstemp. |
| 26 | */ | 43 | */ |
| @@ -144,7 +161,7 @@ static int getfield (lua_State *L, const char *key, int d) { | |||
| 144 | 161 | ||
| 145 | 162 | ||
| 146 | static const char *checkoption (lua_State *L, const char *conv, char *buff) { | 163 | static const char *checkoption (lua_State *L, const char *conv, char *buff) { |
| 147 | static const char *const options[] = { LUA_STRFTIMEOPTIONS }; | 164 | static const char *const options[] = LUA_STRFTIMEOPTIONS; |
| 148 | unsigned int i; | 165 | unsigned int i; |
| 149 | for (i = 0; i < sizeof(options)/sizeof(options[0]); i += 2) { | 166 | for (i = 0; i < sizeof(options)/sizeof(options[0]); i += 2) { |
| 150 | if (*conv != '\0' && strchr(options[i], *conv) != NULL) { | 167 | if (*conv != '\0' && strchr(options[i], *conv) != NULL) { |
