#include <errno.h>
#include <locale.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
Go to the source code of this file.
Macros | |
#define | loslib_c |
#define | LUA_LIB |
#define | LUA_STRFTIMEOPTIONS { "aAbBcdHIjmMpSUwWxXyYz%", "" } |
#define | LUA_TMPNAMBUFSIZE L_tmpnam |
#define | lua_tmpnam(b, e) { e = (tmpnam(b) == NULL); } |
#define | l_gmtime(t, r) ((void)r, gmtime(t)) |
#define | l_localtime(t, r) ((void)r, localtime(t)) |
Functions | |
static int | os_execute (lua_State *L) |
static int | os_remove (lua_State *L) |
static int | os_rename (lua_State *L) |
static int | os_tmpname (lua_State *L) |
static int | os_getenv (lua_State *L) |
static int | os_clock (lua_State *L) |
static void | setfield (lua_State *L, const char *key, int value) |
static void | setboolfield (lua_State *L, const char *key, int value) |
static int | getboolfield (lua_State *L, const char *key) |
static int | getfield (lua_State *L, const char *key, int d) |
static const char * | checkoption (lua_State *L, const char *conv, char *buff) |
static int | os_date (lua_State *L) |
static int | os_time (lua_State *L) |
static int | os_difftime (lua_State *L) |
static int | os_setlocale (lua_State *L) |
static int | os_exit (lua_State *L) |
LUAMOD_API int | luaopen_os (lua_State *L) |
Variables | |
static const luaL_Reg | syslib [] |
Definition at line 72 of file loslib.cpp.
Referenced by os_date().
Definition at line 73 of file loslib.cpp.
Referenced by os_date().
#define loslib_c |
Definition at line 13 of file loslib.cpp.
#define LUA_LIB |
Definition at line 14 of file loslib.cpp.
#define LUA_STRFTIMEOPTIONS { "aAbBcdHIjmMpSUwWxXyYz%", "" } |
Definition at line 28 of file loslib.cpp.
Referenced by checkoption().
Definition at line 56 of file loslib.cpp.
Referenced by os_tmpname().
#define LUA_TMPNAMBUFSIZE L_tmpnam |
Definition at line 55 of file loslib.cpp.
Referenced by os_tmpname().
|
static |
Definition at line 170 of file loslib.cpp.
References i, lua_pushfstring(), LUA_STRFTIMEOPTIONS, luaL_argerror(), and preferences::options().
Referenced by os_date().
Definition at line 147 of file loslib.cpp.
References lua_getfield(), lua_isnil, lua_pop, and lua_toboolean().
Referenced by os_time().
Definition at line 156 of file loslib.cpp.
References d, int(), lua_getfield(), lua_pop, LUA_QS, lua_tointegerx(), and luaL_error().
Referenced by os_time().
LUAMOD_API int luaopen_os | ( | lua_State * | L | ) |
Definition at line 318 of file loslib.cpp.
References luaL_newlib.
Referenced by lua_kernel_base::lua_kernel_base().
Definition at line 121 of file loslib.cpp.
References lua_pushnumber().
Definition at line 194 of file loslib.cpp.
References checkoption(), l_gmtime, l_localtime, lua_createtable(), lua_pushnil(), luaL_addchar, luaL_addlstring(), luaL_buffinit(), luaL_checknumber(), luaL_opt, luaL_optstring, luaL_pushresult(), setboolfield(), setfield(), and util::strftime().
Definition at line 265 of file loslib.cpp.
References lua_pushnumber(), luaL_checknumber(), and luaL_optnumber().
Definition at line 79 of file loslib.cpp.
References lua_pushboolean(), luaL_execresult(), and luaL_optstring.
Definition at line 286 of file loslib.cpp.
References lua_close(), lua_isboolean, lua_toboolean(), and luaL_optint.
Definition at line 115 of file loslib.cpp.
References lua_pushstring(), and luaL_checkstring.
Definition at line 91 of file loslib.cpp.
References luaL_checkstring, and luaL_fileresult().
Definition at line 97 of file loslib.cpp.
References luaL_checkstring, and luaL_fileresult().
Definition at line 274 of file loslib.cpp.
References lua_pushstring(), luaL_checkoption(), and luaL_optstring.
Definition at line 240 of file loslib.cpp.
References getboolfield(), getfield(), lua_isnoneornil, lua_pushnil(), lua_pushnumber(), lua_settop(), LUA_TTABLE, and luaL_checktype().
Definition at line 104 of file loslib.cpp.
References lg::err(), lua_pushstring(), lua_tmpnam, LUA_TMPNAMBUFSIZE, and luaL_error().
Definition at line 140 of file loslib.cpp.
References lua_pushboolean(), and lua_setfield().
Referenced by os_date().
Definition at line 135 of file loslib.cpp.
References lua_pushinteger(), and lua_setfield().
Referenced by os_date().
|
static |
Definition at line 299 of file loslib.cpp.