aboutsummaryrefslogtreecommitdiff
path: root/loslib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-12-17 11:08:51 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-12-17 11:08:51 -0200
commitb3b8dfaaea2dba7e7b4b898a5f767a80f36319f1 (patch)
treed9dd2e8cbeb216f0bc61f1058946fbfcca120237 /loslib.c
parentadc6a4865bfd12339ad7c31b43ba26206d385517 (diff)
downloadlua-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.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/loslib.c b/loslib.c
index 5df75a5c..c51ce5eb 100644
--- a/loslib.c
+++ b/loslib.c
@@ -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
146static const char *checkoption (lua_State *L, const char *conv, char *buff) { 163static 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) {