Github User Fetcher 1.0.0
C Application with Server and GUI
|
#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"
Go to the source code of this file.
Macros | |
#define | loslib_c |
#define | LUA_LIB |
#define | L_STRFTIMEC89 "aAbBcdHIjmMpSUwWxXyYZ%" |
#define | L_STRFTIMEC99 |
#define | L_STRFTIMEWIN |
#define | LUA_STRFTIMEOPTIONS L_STRFTIMEC99 |
#define | l_timet lua_Integer |
#define | l_pushtime(L, t) lua_pushinteger(L,(lua_Integer)(t)) |
#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 | LUA_TMPNAMBUFSIZE L_tmpnam |
#define | lua_tmpnam(b, e) { e = (tmpnam(b) == NULL); } |
#define | SIZETIMEFMT 250 |
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, int delta) |
static void | setboolfield (lua_State *L, const char *key, int value) |
static void | setallfields (lua_State *L, struct tm *stm) |
static int | getboolfield (lua_State *L, const char *key) |
static int | getfield (lua_State *L, const char *key, int d, int delta) |
static const char * | checkoption (lua_State *L, const char *conv, ptrdiff_t convlen, char *buff) |
static time_t | l_checktime (lua_State *L, int arg) |
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 [] |
#define l_gettime | ( | L, | |
arg ) luaL_checkinteger(L, arg) |
Definition at line 69 of file lua-5.4.3/src/loslib.c.
Referenced by l_checktime().
#define l_gmtime | ( | t, | |
r ) ((void)(r)->tm_sec, gmtime(t)) |
Definition at line 94 of file lua-5.4.3/src/loslib.c.
Referenced by os_date().
#define l_localtime | ( | t, | |
r ) ((void)(r)->tm_sec, localtime(t)) |
Definition at line 95 of file lua-5.4.3/src/loslib.c.
Referenced by os_date().
#define l_pushtime | ( | L, | |
t ) lua_pushinteger(L,(lua_Integer)(t)) |
Definition at line 68 of file lua-5.4.3/src/loslib.c.
Referenced by os_time().
#define L_STRFTIMEC89 "aAbBcdHIjmMpSUwWxXyYZ%" |
Definition at line 34 of file lua-5.4.3/src/loslib.c.
#define L_STRFTIMEC99 |
Definition at line 37 of file lua-5.4.3/src/loslib.c.
#define L_STRFTIMEWIN |
Definition at line 41 of file lua-5.4.3/src/loslib.c.
#define l_timet lua_Integer |
Definition at line 67 of file lua-5.4.3/src/loslib.c.
Referenced by l_checktime(), and os_time().
#define loslib_c |
Definition at line 7 of file lua-5.4.3/src/loslib.c.
#define LUA_LIB |
Definition at line 8 of file lua-5.4.3/src/loslib.c.
#define LUA_STRFTIMEOPTIONS L_STRFTIMEC99 |
Definition at line 49 of file lua-5.4.3/src/loslib.c.
Referenced by checkoption().
#define lua_tmpnam | ( | b, | |
e ) { e = (tmpnam(b) == NULL); } |
Definition at line 133 of file lua-5.4.3/src/loslib.c.
Referenced by os_tmpname().
#define LUA_TMPNAMBUFSIZE L_tmpnam |
Definition at line 132 of file lua-5.4.3/src/loslib.c.
Referenced by os_tmpname().
#define SIZETIMEFMT 250 |
Definition at line 301 of file lua-5.4.3/src/loslib.c.
Referenced by os_date().
|
static |
Definition at line 274 of file lua-5.4.3/src/loslib.c.
References lua_pushfstring(), LUA_STRFTIMEOPTIONS, and luaL_argerror().
Referenced by os_date().
|
static |
Definition at line 243 of file lua-5.4.3/src/loslib.c.
References lua_getfield(), lua_pop, LUA_TNIL, and lua_toboolean().
Referenced by os_time().
|
static |
Definition at line 251 of file lua-5.4.3/src/loslib.c.
References lua_getfield(), lua_pop, LUA_TNIL, lua_tointegerx(), and luaL_error().
Referenced by os_time().
|
static |
Definition at line 293 of file lua-5.4.3/src/loslib.c.
References arg, l_gettime, l_timet, and luaL_argcheck.
Referenced by os_date(), and os_difftime().
LUAMOD_API int luaopen_os | ( | lua_State * | L | ) |
Definition at line 426 of file lua-5.4.3/src/loslib.c.
References luaL_newlib, and syslib.
|
static |
Definition at line 186 of file lua-5.4.3/src/loslib.c.
References lua_pushnumber().
|
static |
Definition at line 304 of file lua-5.4.3/src/loslib.c.
References checkoption(), l_checktime(), l_gmtime, l_localtime, lua_createtable(), luaL_addchar, luaL_addsize, luaL_buffinit(), luaL_error(), luaL_opt, luaL_optlstring(), luaL_prepbuffsize(), luaL_pushresult(), NULL, s, setallfields(), and SIZETIMEFMT.
|
static |
Definition at line 372 of file lua-5.4.3/src/loslib.c.
References l_checktime(), and lua_pushnumber().
|
static |
Definition at line 142 of file lua-5.4.3/src/loslib.c.
References lua_pushboolean(), luaL_execresult(), luaL_optstring, and NULL.
|
static |
Definition at line 394 of file lua-5.4.3/src/loslib.c.
References lua_close(), lua_isboolean, lua_toboolean(), and luaL_optinteger().
|
static |
Definition at line 180 of file lua-5.4.3/src/loslib.c.
References lua_pushstring(), and luaL_checkstring.
|
static |
Definition at line 156 of file lua-5.4.3/src/loslib.c.
References luaL_checkstring, and luaL_fileresult().
|
static |
Definition at line 162 of file lua-5.4.3/src/loslib.c.
References luaL_checkstring, luaL_fileresult(), and NULL.
|
static |
Definition at line 382 of file lua-5.4.3/src/loslib.c.
References lua_pushstring(), luaL_checkoption(), luaL_optstring, and NULL.
|
static |
Definition at line 346 of file lua-5.4.3/src/loslib.c.
References getboolfield(), getfield(), l_pushtime, l_timet, lua_isnoneornil, lua_settop(), LUA_TTABLE, luaL_checktype(), luaL_error(), NULL, and setallfields().
|
static |
Definition at line 169 of file lua-5.4.3/src/loslib.c.
References lua_pushstring(), lua_tmpnam, LUA_TMPNAMBUFSIZE, and luaL_error().
|
static |
Definition at line 230 of file lua-5.4.3/src/loslib.c.
References setboolfield(), and setfield().
|
static |
Definition at line 219 of file lua-5.4.3/src/loslib.c.
References lua_pushboolean(), lua_setfield(), and value.
Referenced by setallfields().
|
static |
Definition at line 209 of file lua-5.4.3/src/loslib.c.
References lua_pushinteger(), lua_setfield(), luaL_error(), and value.
Referenced by setallfields().
|
static |
Definition at line 407 of file lua-5.4.3/src/loslib.c.
Referenced by luaopen_os().