Macros | Functions | Variables
loslib.c File Reference
#include "lprefix.h"
#include <errno.h>
#include <locale.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
Include dependency graph for loslib.c:

Go to the source code of this file.

Macros

#define l_gettime(L, arg)   luaL_checkinteger(L, arg)
 
#define l_gmtime(t, r)   ((void)(r)->tm_sec, gmtime(t))
 
#define l_localtime(t, r)   ((void)(r)->tm_sec, localtime(t))
 
#define l_pushtime(L, t)   lua_pushinteger(L,(lua_Integer)(t))
 
#define L_STRFTIMEC89   "aAbBcdHIjmMpSUwWxXyYZ%"
 
#define L_STRFTIMEC99
 
#define L_STRFTIMEWIN
 
#define l_timet   lua_Integer
 
#define loslib_c
 
#define LUA_LIB
 
#define LUA_STRFTIMEOPTIONS   L_STRFTIMEC99
 
#define lua_tmpnam(b, e)   { e = (tmpnam(b) == NULL); }
 
#define LUA_TMPNAMBUFSIZE   L_tmpnam
 
#define SIZETIMEFMT   250
 

Functions

static const char * checkoption (lua_State *L, const char *conv, ptrdiff_t convlen, char *buff)
 
static int getboolfield (lua_State *L, const char *key)
 
static int getfield (lua_State *L, const char *key, int d, int delta)
 
static time_t l_checktime (lua_State *L, int arg)
 
LUAMOD_API int luaopen_os (lua_State *L)
 
static int os_clock (lua_State *L)
 
static int os_date (lua_State *L)
 
static int os_difftime (lua_State *L)
 
static int os_execute (lua_State *L)
 
static int os_exit (lua_State *L)
 
static int os_getenv (lua_State *L)
 
static int os_remove (lua_State *L)
 
static int os_rename (lua_State *L)
 
static int os_setlocale (lua_State *L)
 
static int os_time (lua_State *L)
 
static int os_tmpname (lua_State *L)
 
static void setallfields (lua_State *L, struct tm *stm)
 
static void setboolfield (lua_State *L, const char *key, int value)
 
static void setfield (lua_State *L, const char *key, int value, int delta)
 

Variables

static const luaL_Reg syslib []
 

Macro Definition Documentation

◆ l_gettime

#define l_gettime (   L,
  arg 
)    luaL_checkinteger(L, arg)

Definition at line 69 of file loslib.c.

◆ l_gmtime

#define l_gmtime (   t,
 
)    ((void)(r)->tm_sec, gmtime(t))

Definition at line 94 of file loslib.c.

◆ l_localtime

#define l_localtime (   t,
 
)    ((void)(r)->tm_sec, localtime(t))

Definition at line 95 of file loslib.c.

◆ l_pushtime

#define l_pushtime (   L,
 
)    lua_pushinteger(L,(lua_Integer)(t))

Definition at line 68 of file loslib.c.

◆ L_STRFTIMEC89

#define L_STRFTIMEC89   "aAbBcdHIjmMpSUwWxXyYZ%"

Definition at line 34 of file loslib.c.

◆ L_STRFTIMEC99

#define L_STRFTIMEC99
Value:
"aAbBcCdDeFgGhHIjmMnprRStTuUVwWxXyYzZ%" \
"||" "EcECExEXEyEY" "OdOeOHOIOmOMOSOuOUOVOwOWOy" /* two-char options */

Definition at line 37 of file loslib.c.

◆ L_STRFTIMEWIN

#define L_STRFTIMEWIN
Value:
"aAbBcdHIjmMpSUwWxXyYzZ%" \
"||" "#c#x#d#H#I#j#m#M#S#U#w#W#y#Y" /* two-char options */

Definition at line 41 of file loslib.c.

◆ l_timet

#define l_timet   lua_Integer

Definition at line 67 of file loslib.c.

◆ loslib_c

#define loslib_c

Definition at line 7 of file loslib.c.

◆ LUA_LIB

#define LUA_LIB

Definition at line 8 of file loslib.c.

◆ LUA_STRFTIMEOPTIONS

#define LUA_STRFTIMEOPTIONS   L_STRFTIMEC99

Definition at line 49 of file loslib.c.

◆ lua_tmpnam

#define lua_tmpnam (   b,
 
)    { e = (tmpnam(b) == NULL); }

Definition at line 133 of file loslib.c.

◆ LUA_TMPNAMBUFSIZE

#define LUA_TMPNAMBUFSIZE   L_tmpnam

Definition at line 132 of file loslib.c.

◆ SIZETIMEFMT

#define SIZETIMEFMT   250

Definition at line 301 of file loslib.c.

Function Documentation

◆ checkoption()

static const char* checkoption ( lua_State L,
const char *  conv,
ptrdiff_t  convlen,
char *  buff 
)
static

Definition at line 274 of file loslib.c.

◆ getboolfield()

static int getboolfield ( lua_State L,
const char *  key 
)
static

Definition at line 243 of file loslib.c.

◆ getfield()

static int getfield ( lua_State L,
const char *  key,
int  d,
int  delta 
)
static

Definition at line 251 of file loslib.c.

◆ l_checktime()

static time_t l_checktime ( lua_State L,
int  arg 
)
static

Definition at line 293 of file loslib.c.

◆ luaopen_os()

LUAMOD_API int luaopen_os ( lua_State L)

Definition at line 426 of file loslib.c.

◆ os_clock()

static int os_clock ( lua_State L)
static

Definition at line 186 of file loslib.c.

◆ os_date()

static int os_date ( lua_State L)
static

Definition at line 304 of file loslib.c.

◆ os_difftime()

static int os_difftime ( lua_State L)
static

Definition at line 372 of file loslib.c.

◆ os_execute()

static int os_execute ( lua_State L)
static

Definition at line 142 of file loslib.c.

◆ os_exit()

static int os_exit ( lua_State L)
static

Definition at line 394 of file loslib.c.

◆ os_getenv()

static int os_getenv ( lua_State L)
static

Definition at line 180 of file loslib.c.

◆ os_remove()

static int os_remove ( lua_State L)
static

Definition at line 156 of file loslib.c.

◆ os_rename()

static int os_rename ( lua_State L)
static

Definition at line 162 of file loslib.c.

◆ os_setlocale()

static int os_setlocale ( lua_State L)
static

Definition at line 382 of file loslib.c.

◆ os_time()

static int os_time ( lua_State L)
static

Definition at line 346 of file loslib.c.

◆ os_tmpname()

static int os_tmpname ( lua_State L)
static

Definition at line 169 of file loslib.c.

◆ setallfields()

static void setallfields ( lua_State L,
struct tm *  stm 
)
static

Definition at line 230 of file loslib.c.

◆ setboolfield()

static void setboolfield ( lua_State L,
const char *  key,
int  value 
)
static

Definition at line 219 of file loslib.c.

◆ setfield()

static void setfield ( lua_State L,
const char *  key,
int  value,
int  delta 
)
static

Definition at line 209 of file loslib.c.

Variable Documentation

◆ syslib

const luaL_Reg syslib[]
static
Initial value:
= {
{"clock", os_clock},
{"date", os_date},
{"difftime", os_difftime},
{"execute", os_execute},
{"exit", os_exit},
{"getenv", os_getenv},
{"remove", os_remove},
{"rename", os_rename},
{"setlocale", os_setlocale},
{"time", os_time},
{"tmpname", os_tmpname},
{NULL, NULL}
}

Definition at line 407 of file loslib.c.

os_tmpname
static int os_tmpname(lua_State *L)
Definition: loslib.c:169
os_exit
static int os_exit(lua_State *L)
Definition: loslib.c:394
os_time
static int os_time(lua_State *L)
Definition: loslib.c:346
os_clock
static int os_clock(lua_State *L)
Definition: loslib.c:186
os_setlocale
static int os_setlocale(lua_State *L)
Definition: loslib.c:382
os_rename
static int os_rename(lua_State *L)
Definition: loslib.c:162
os_getenv
static int os_getenv(lua_State *L)
Definition: loslib.c:180
os_date
static int os_date(lua_State *L)
Definition: loslib.c:304
os_execute
static int os_execute(lua_State *L)
Definition: loslib.c:142
os_difftime
static int os_difftime(lua_State *L)
Definition: loslib.c:372
os_remove
static int os_remove(lua_State *L)
Definition: loslib.c:156


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:49