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_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 | L_MAXDATEFIELD (INT_MAX / 2) |
#define | SIZETIMEFMT 250 |
Functions | |
static time_t | l_checktime (lua_State *L, int arg) |
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 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 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_gmtime | ( | t, | |
r ) ((void)(r)->tm_sec, gmtime(t)) |
Definition at line 92 of file lua-5.3.6/src/loslib.c.
Referenced by os_date().
#define l_localtime | ( | t, | |
r ) ((void)(r)->tm_sec, localtime(t)) |
Definition at line 93 of file lua-5.3.6/src/loslib.c.
Referenced by os_date().
#define L_MAXDATEFIELD (INT_MAX / 2) |
Definition at line 236 of file lua-5.3.6/src/loslib.c.
Referenced by getfield().
#define l_pushtime | ( | L, | |
t ) lua_pushinteger(L,(lua_Integer)(t)) |
Definition at line 67 of file lua-5.3.6/src/loslib.c.
Referenced by os_time().
#define L_STRFTIMEC89 "aAbBcdHIjmMpSUwWxXyYZ%" |
Definition at line 34 of file lua-5.3.6/src/loslib.c.
#define L_STRFTIMEC99 |
Definition at line 37 of file lua-5.3.6/src/loslib.c.
#define L_STRFTIMEWIN |
Definition at line 41 of file lua-5.3.6/src/loslib.c.
#define l_timet lua_Integer |
Definition at line 66 of file lua-5.3.6/src/loslib.c.
Referenced by os_time().
#define loslib_c |
Definition at line 7 of file lua-5.3.6/src/loslib.c.
#define LUA_LIB |
Definition at line 8 of file lua-5.3.6/src/loslib.c.
#define LUA_STRFTIMEOPTIONS L_STRFTIMEC99 |
Definition at line 49 of file lua-5.3.6/src/loslib.c.
Referenced by checkoption().
#define lua_tmpnam | ( | b, | |
e ) { e = (tmpnam(b) == NULL); } |
Definition at line 131 of file lua-5.3.6/src/loslib.c.
Referenced by os_tmpname().
#define LUA_TMPNAMBUFSIZE L_tmpnam |
Definition at line 130 of file lua-5.3.6/src/loslib.c.
Referenced by os_tmpname().
#define SIZETIMEFMT 250 |
Definition at line 280 of file lua-5.3.6/src/loslib.c.
Referenced by os_date().
|
static |
Definition at line 260 of file lua-5.3.6/src/loslib.c.
References lua_pushfstring(), LUA_STRFTIMEOPTIONS, and luaL_argerror().
Referenced by os_date().
|
static |
Definition at line 226 of file lua-5.3.6/src/loslib.c.
References lua_getfield(), lua_pop, LUA_TNIL, and lua_toboolean().
Referenced by os_time().
|
static |
Definition at line 239 of file lua-5.3.6/src/loslib.c.
References L_MAXDATEFIELD, lua_getfield(), lua_pop, LUA_TNIL, lua_tointegerx(), and luaL_error().
Referenced by os_time().
|
static |
Definition at line 69 of file lua-5.3.6/src/loslib.c.
References arg, luaL_argcheck, and luaL_checkinteger().
Referenced by os_date(), and os_difftime().
LUAMOD_API int luaopen_os | ( | lua_State * | L | ) |
Definition at line 405 of file lua-5.3.6/src/loslib.c.
References luaL_newlib, and syslib.
|
static |
Definition at line 183 of file lua-5.3.6/src/loslib.c.
References lua_pushnumber().
|
static |
Definition at line 283 of file lua-5.3.6/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 351 of file lua-5.3.6/src/loslib.c.
References l_checktime(), and lua_pushnumber().
|
static |
Definition at line 141 of file lua-5.3.6/src/loslib.c.
References lua_pushboolean(), luaL_execresult(), luaL_optstring, and NULL.
|
static |
Definition at line 373 of file lua-5.3.6/src/loslib.c.
References lua_close(), lua_isboolean, lua_toboolean(), and luaL_optinteger().
|
static |
Definition at line 177 of file lua-5.3.6/src/loslib.c.
References lua_pushstring(), and luaL_checkstring.
|
static |
Definition at line 153 of file lua-5.3.6/src/loslib.c.
References luaL_checkstring, and luaL_fileresult().
|
static |
Definition at line 159 of file lua-5.3.6/src/loslib.c.
References luaL_checkstring, luaL_fileresult(), and NULL.
|
static |
Definition at line 361 of file lua-5.3.6/src/loslib.c.
References lua_pushstring(), luaL_checkoption(), luaL_optstring, and NULL.
|
static |
Definition at line 325 of file lua-5.3.6/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 166 of file lua-5.3.6/src/loslib.c.
References lua_pushstring(), lua_tmpnam, LUA_TMPNAMBUFSIZE, and luaL_error().
|
static |
Definition at line 213 of file lua-5.3.6/src/loslib.c.
References setboolfield(), and setfield().
|
static |
Definition at line 202 of file lua-5.3.6/src/loslib.c.
References lua_pushboolean(), lua_setfield(), and value.
Referenced by setallfields().
|
static |
Definition at line 197 of file lua-5.3.6/src/loslib.c.
References lua_pushinteger(), lua_setfield(), and value.
Referenced by setallfields().
|
static |
Definition at line 386 of file lua-5.3.6/src/loslib.c.
Referenced by luaopen_os().