#include "lprefix.h"
#include <ctype.h>
#include <errno.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
Go to the source code of this file.
|
#define | IO_INPUT (IO_PREFIX "input") |
|
#define | IO_OUTPUT (IO_PREFIX "output") |
|
#define | IO_PREFIX "_IO_" |
|
#define | IOPREF_LEN (sizeof(IO_PREFIX)/sizeof(char) - 1) |
|
#define | isclosed(p) ((p)->closef == NULL) |
|
#define | l_checkmodep(m) ((m[0] == 'r' || m[0] == 'w') && m[1] == '\0') |
|
#define | l_fseek(f, o, w) fseek(f,o,w) |
|
#define | l_ftell(f) ftell(f) |
|
#define | l_getc(f) getc(f) |
|
#define | l_lockfile(f) ((void)0) |
|
#define | L_MAXLENNUM 200 |
|
#define | L_MODEEXT "b" |
|
#define | l_pclose(L, file) ((void)L, (void)file, -1) |
|
#define | l_popen(L, c, m) |
|
#define | l_seeknum long |
|
#define | l_unlockfile(f) ((void)0) |
|
#define | liolib_c |
|
#define | LUA_LIB |
|
#define | MAXARGLINE 250 |
|
#define | tolstream(L) ((LStream *)luaL_checkudata(L, 1, LUA_FILEHANDLE)) |
|
|
static int | aux_close (lua_State *L) |
|
static void | aux_lines (lua_State *L, int toclose) |
|
static void | createmeta (lua_State *L) |
|
static void | createstdfile (lua_State *L, FILE *f, const char *k, const char *fname) |
|
static int | f_close (lua_State *L) |
|
static int | f_flush (lua_State *L) |
|
static int | f_gc (lua_State *L) |
|
static int | f_lines (lua_State *L) |
|
static int | f_read (lua_State *L) |
|
static int | f_seek (lua_State *L) |
|
static int | f_setvbuf (lua_State *L) |
|
static int | f_tostring (lua_State *L) |
|
static int | f_write (lua_State *L) |
|
static int | g_iofile (lua_State *L, const char *f, const char *mode) |
|
static int | g_read (lua_State *L, FILE *f, int first) |
|
static int | g_write (lua_State *L, FILE *f, int arg) |
|
static FILE * | getiofile (lua_State *L, const char *findex) |
|
static int | io_close (lua_State *L) |
|
static int | io_fclose (lua_State *L) |
|
static int | io_flush (lua_State *L) |
|
static int | io_input (lua_State *L) |
|
static int | io_lines (lua_State *L) |
|
static int | io_noclose (lua_State *L) |
|
static int | io_open (lua_State *L) |
|
static int | io_output (lua_State *L) |
|
static int | io_pclose (lua_State *L) |
|
static int | io_popen (lua_State *L) |
|
static int | io_read (lua_State *L) |
|
static int | io_readline (lua_State *L) |
|
static int | io_tmpfile (lua_State *L) |
|
static int | io_type (lua_State *L) |
|
static int | io_write (lua_State *L) |
|
static int | l_checkmode (const char *mode) |
|
LUAMOD_API int | luaopen_io (lua_State *L) |
|
static LStream * | newfile (lua_State *L) |
|
static LStream * | newprefile (lua_State *L) |
|
static int | nextc (RN *rn) |
|
static void | opencheck (lua_State *L, const char *fname, const char *mode) |
|
static void | read_all (lua_State *L, FILE *f) |
|
static int | read_chars (lua_State *L, FILE *f, size_t n) |
|
static int | read_line (lua_State *L, FILE *f, int chop) |
|
static int | read_number (lua_State *L, FILE *f) |
|
static int | readdigits (RN *rn, int hex) |
|
static int | test2 (RN *rn, const char *set) |
|
static int | test_eof (lua_State *L, FILE *f) |
|
static FILE * | tofile (lua_State *L) |
|
◆ IO_INPUT
◆ IO_OUTPUT
◆ IO_PREFIX
◆ IOPREF_LEN
#define IOPREF_LEN (sizeof(IO_PREFIX)/sizeof(char) - 1) |
◆ isclosed
#define isclosed |
( |
|
p | ) |
((p)->closef == NULL) |
◆ l_checkmodep
#define l_checkmodep |
( |
|
m | ) |
((m[0] == 'r' || m[0] == 'w') && m[1] == '\0') |
◆ l_fseek
#define l_fseek |
( |
|
f, |
|
|
|
o, |
|
|
|
w |
|
) |
| fseek(f,o,w) |
◆ l_ftell
#define l_ftell |
( |
|
f | ) |
ftell(f) |
◆ l_getc
#define l_getc |
( |
|
f | ) |
getc(f) |
◆ l_lockfile
#define l_lockfile |
( |
|
f | ) |
((void)0) |
◆ L_MAXLENNUM
◆ L_MODEEXT
◆ l_pclose
#define l_pclose |
( |
|
L, |
|
|
|
file |
|
) |
| ((void)L, (void)file, -1) |
◆ l_popen
#define l_popen |
( |
|
L, |
|
|
|
c, |
|
|
|
m |
|
) |
| |
Value:
luaL_error(L, "'popen' not supported"), \
(FILE*)0)
Definition at line 76 of file liolib.c.
◆ l_seeknum
◆ l_unlockfile
#define l_unlockfile |
( |
|
f | ) |
((void)0) |
◆ liolib_c
◆ LUA_LIB
◆ MAXARGLINE
◆ tolstream
◆ LStream
◆ aux_close()
◆ aux_lines()
static void aux_lines |
( |
lua_State * |
L, |
|
|
int |
toclose |
|
) |
| |
|
static |
◆ createmeta()
◆ createstdfile()
static void createstdfile |
( |
lua_State * |
L, |
|
|
FILE * |
f, |
|
|
const char * |
k, |
|
|
const char * |
fname |
|
) |
| |
|
static |
◆ f_close()
◆ f_flush()
◆ f_gc()
◆ f_lines()
◆ f_read()
◆ f_seek()
◆ f_setvbuf()
◆ f_tostring()
◆ f_write()
◆ g_iofile()
static int g_iofile |
( |
lua_State * |
L, |
|
|
const char * |
f, |
|
|
const char * |
mode |
|
) |
| |
|
static |
◆ g_read()
static int g_read |
( |
lua_State * |
L, |
|
|
FILE * |
f, |
|
|
int |
first |
|
) |
| |
|
static |
◆ g_write()
static int g_write |
( |
lua_State * |
L, |
|
|
FILE * |
f, |
|
|
int |
arg |
|
) |
| |
|
static |
◆ getiofile()
static FILE* getiofile |
( |
lua_State * |
L, |
|
|
const char * |
findex |
|
) |
| |
|
static |
◆ io_close()
◆ io_fclose()
◆ io_flush()
◆ io_input()
◆ io_lines()
◆ io_noclose()
◆ io_open()
◆ io_output()
◆ io_pclose()
◆ io_popen()
◆ io_read()
◆ io_readline()
◆ io_tmpfile()
◆ io_type()
◆ io_write()
◆ l_checkmode()
static int l_checkmode |
( |
const char * |
mode | ) |
|
|
static |
◆ luaopen_io()
◆ newfile()
◆ newprefile()
◆ nextc()
static int nextc |
( |
RN * |
rn | ) |
|
|
static |
◆ opencheck()
static void opencheck |
( |
lua_State * |
L, |
|
|
const char * |
fname, |
|
|
const char * |
mode |
|
) |
| |
|
static |
◆ read_all()
static void read_all |
( |
lua_State * |
L, |
|
|
FILE * |
f |
|
) |
| |
|
static |
◆ read_chars()
static int read_chars |
( |
lua_State * |
L, |
|
|
FILE * |
f, |
|
|
size_t |
n |
|
) |
| |
|
static |
◆ read_line()
static int read_line |
( |
lua_State * |
L, |
|
|
FILE * |
f, |
|
|
int |
chop |
|
) |
| |
|
static |
◆ read_number()
static int read_number |
( |
lua_State * |
L, |
|
|
FILE * |
f |
|
) |
| |
|
static |
◆ readdigits()
static int readdigits |
( |
RN * |
rn, |
|
|
int |
hex |
|
) |
| |
|
static |
◆ test2()
static int test2 |
( |
RN * |
rn, |
|
|
const char * |
set |
|
) |
| |
|
static |
◆ test_eof()
static int test_eof |
( |
lua_State * |
L, |
|
|
FILE * |
f |
|
) |
| |
|
static |
◆ tofile()
◆ iolib
Initial value:
Definition at line 741 of file liolib.c.
◆ metameth
Initial value:= {
{"__index", NULL},
{NULL, NULL}
}
Definition at line 775 of file liolib.c.
◆ meth
Initial value:
Definition at line 760 of file liolib.c.