#include <errno.h>
#include <locale.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <dirent.h>
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
gehe zum Quellcode dieser Datei
|
static int | os_pushresult (lua_State *L, int i, const char *filename) |
|
static int | os_remove (lua_State *L) |
|
static int | os_rename (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 int | os_date (lua_State *L) |
|
static int | os_time (lua_State *L) |
|
static int | os_difftime (lua_State *L) |
|
static int | os_mkdir (lua_State *L) |
|
static int | get_table_optbool (lua_State *L, int narg, const char *fname, int d) |
|
static int | os_listdir (lua_State *L) |
|
static int | idir_iter (lua_State *L) |
|
static int | idir_gc (lua_State *L) |
|
static int | os_idir (lua_State *L) |
|
static void | idir_register (lua_State *L) |
|
static int | os_stat (lua_State *L) |
|
static int | os_utime (lua_State *L) |
|
LUALIB_API int | luaopen_os (lua_State *L) |
|
#define IDIR_META "chdk_idir_meta" |
static int get_table_optbool |
( |
lua_State * |
L, |
|
|
int |
narg, |
|
|
const char * |
fname, |
|
|
int |
d |
|
) |
| |
|
static |
Definiert in Zeile 135 der Datei loslib.c.
153 else if (
strcmp(s,
"*t") == 0) {
168 cc[0] =
'%'; cc[2] =
'\0';
171 if (*s !=
'%' || *(s + 1) ==
'\0')
177 reslen =
strftime(buff,
sizeof(buff), cc, stm);
Definiert in Zeile 247 der Datei loslib.c.
249 #if defined(HOST_LUA) && !defined(_WIN32)
static int os_pushresult |
( |
lua_State * |
L, |
|
|
int |
i, |
|
|
const char * |
filename |
|
) |
| |
|
static |
Definiert in Zeile 426 der Datei loslib.c.
429 int result =
stat(name,&st);
455 #define DOS_ATTR_DIRECTORY 0x10
456 #ifndef CAM_DRYOS_2_3_R39
458 setfield(L,
"blocks",(st.st_size/512) + (st.st_size%512)?1:0);
460 if ( S_ISDIR(st.st_mode) ) {
468 if S_ISREG(st.st_mode) {
484 setfield(L,
"reserved1",st.reserved1);
485 setfield(L,
"reserved2",st.reserved2);
486 setfield(L,
"reserved3",st.reserved3);
487 setfield(L,
"reserved4",st.reserved4);
488 setfield(L,
"reserved5",st.reserved5);
489 setfield(L,
"reserved6",st.reserved6);
Definiert in Zeile 187 der Datei loslib.c.
197 ts.tm_hour =
getfield(L,
"hour", 12);
198 ts.tm_mday =
getfield(L,
"day", -1);
199 ts.tm_mon =
getfield(L,
"month", -1) - 1;
200 ts.tm_year =
getfield(L,
"year", -1) - 1900;
static void setboolfield |
( |
lua_State * |
L, |
|
|
const char * |
key, |
|
|
int |
value |
|
) |
| |
|
static |
Initialisierung:
Definiert in Zeile 415 der Datei loslib.c.
Initialisierung:
Definiert in Zeile 513 der Datei loslib.c.