#include <errno.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.
Macros | |
#define | _LARGEFILE_SOURCE 1 |
#define | _FILE_OFFSET_BITS 64 |
#define | liolib_c |
#define | LUA_LIB |
#define | lua_checkmode(mode) |
#define | lua_popen(L, c, m) |
#define | lua_pclose(L, file) ((void)((void)L, file), -1) |
#define | l_fseek(f, o, w) fseek(f,o,w) |
#define | l_ftell(f) ftell(f) |
#define | l_seeknum long |
#define | IO_PREFIX "_IO_" |
#define | IO_INPUT (IO_PREFIX "input") |
#define | IO_OUTPUT (IO_PREFIX "output") |
#define | tolstream(L) ((LStream *)luaL_checkudata(L, 1, LUA_FILEHANDLE)) |
#define | isclosed(p) ((p)->closef == NULL) |
#define | MAX_SIZE_T (~(size_t)0) |
Typedefs | |
typedef luaL_Stream | LStream |
Variables | |
static const luaL_Reg | iolib [] |
static const luaL_Reg | flib [] |
#define _FILE_OFFSET_BITS 64 |
Definition at line 13 of file liolib.cpp.
#define _LARGEFILE_SOURCE 1 |
Definition at line 12 of file liolib.cpp.
#define IO_INPUT (IO_PREFIX "input") |
Definition at line 117 of file liolib.cpp.
Referenced by io_input(), io_lines(), io_read(), and luaopen_io().
#define IO_OUTPUT (IO_PREFIX "output") |
Definition at line 118 of file liolib.cpp.
Referenced by io_close(), io_flush(), io_output(), io_write(), and luaopen_io().
#define IO_PREFIX "_IO_" |
Definition at line 116 of file liolib.cpp.
Referenced by getiofile().
Definition at line 126 of file liolib.cpp.
Referenced by f_gc(), f_tostring(), getiofile(), io_readline(), io_type(), and tofile().
Definition at line 108 of file liolib.cpp.
Referenced by f_seek().
Definition at line 109 of file liolib.cpp.
Referenced by f_seek().
#define l_seeknum long |
Definition at line 110 of file liolib.cpp.
Referenced by f_seek().
#define liolib_c |
Definition at line 22 of file liolib.cpp.
#define lua_checkmode | ( | mode | ) |
#define LUA_LIB |
Definition at line 23 of file liolib.cpp.
Definition at line 70 of file liolib.cpp.
Referenced by io_pclose().
#define MAX_SIZE_T (~(size_t)0) |
Definition at line 392 of file liolib.cpp.
Referenced by read_all().
#define tolstream | ( | L | ) | ((LStream *)luaL_checkudata(L, 1, LUA_FILEHANDLE)) |
Definition at line 124 of file liolib.cpp.
Referenced by aux_close(), f_gc(), f_tostring(), io_fclose(), io_noclose(), io_pclose(), and tofile().
typedef luaL_Stream LStream |
Definition at line 121 of file liolib.cpp.
Definition at line 175 of file liolib.cpp.
References luaL_Stream::closef, and tolstream.
Referenced by f_gc(), io_close(), and io_readline().
Definition at line 302 of file liolib.cpp.
References i, io_readline(), lua_gettop(), LUA_MINSTACK, lua_pushboolean(), lua_pushcclosure(), lua_pushinteger(), lua_pushvalue(), and luaL_argcheck.
Referenced by f_lines(), and io_lines().
Definition at line 622 of file liolib.cpp.
References LUA_FILEHANDLE, lua_pop, lua_pushvalue(), lua_setfield(), luaL_newmetatable(), and luaL_setfuncs().
Referenced by luaopen_io().
Definition at line 643 of file liolib.cpp.
References luaL_Stream::closef, luaL_Stream::f, io_noclose(), lua_pushvalue(), LUA_REGISTRYINDEX, lua_setfield(), and newprefile().
Referenced by luaopen_io().
Definition at line 581 of file liolib.cpp.
References luaL_fileresult(), and tofile().
Definition at line 191 of file liolib.cpp.
References aux_close(), luaL_Stream::f, isclosed, and tolstream.
Definition at line 315 of file liolib.cpp.
References aux_lines(), and tofile().
Definition at line 478 of file liolib.cpp.
Definition at line 545 of file liolib.cpp.
References l_fseek, l_ftell, l_seeknum, lua_pushnumber(), luaL_argcheck, luaL_checkoption(), luaL_fileresult(), luaL_optnumber(), and tofile().
Definition at line 564 of file liolib.cpp.
References LUAL_BUFFERSIZE, luaL_checkoption(), luaL_fileresult(), luaL_optinteger(), and tofile().
Definition at line 143 of file liolib.cpp.
References luaL_Stream::f, isclosed, lua_pushfstring(), lua_pushliteral, and tolstream.
Definition at line 538 of file liolib.cpp.
References g_write(), lua_pushvalue(), and tofile().
Definition at line 272 of file liolib.cpp.
References lua_getfield(), lua_isnoneornil, lua_pushvalue(), LUA_REGISTRYINDEX, lua_setfield(), lua_tostring, opencheck(), and tofile().
Referenced by io_input(), and io_output().
Definition at line 423 of file liolib.cpp.
References lua_gettop(), LUA_MINSTACK, lua_pop, lua_pushnil(), LUA_TNUMBER, lua_tointeger, lua_tostring, lua_type(), luaL_argcheck, luaL_argerror(), luaL_checkstack(), luaL_fileresult(), read_all(), read_chars(), read_line(), read_number(), and test_eof().
Referenced by f_read(), io_read(), and io_readline().
Definition at line 513 of file liolib.cpp.
References lua_gettop(), LUA_NUMBER_FMT, LUA_TNUMBER, lua_tonumber, lua_type(), luaL_checklstring(), and luaL_fileresult().
Referenced by f_write(), and io_write().
|
static |
Definition at line 262 of file liolib.cpp.
References luaL_Stream::f, IO_PREFIX, isclosed, lua_getfield(), LUA_REGISTRYINDEX, lua_touserdata(), and luaL_error().
Referenced by io_flush(), io_read(), and io_write().
Definition at line 183 of file liolib.cpp.
References aux_close(), IO_OUTPUT, lua_getfield(), lua_isnone, LUA_REGISTRYINDEX, and tofile().
Definition at line 202 of file liolib.cpp.
References luaL_Stream::f, luaL_fileresult(), and tolstream.
Referenced by newfile().
Definition at line 576 of file liolib.cpp.
References getiofile(), IO_OUTPUT, and luaL_fileresult().
Definition at line 289 of file liolib.cpp.
References g_iofile(), and IO_INPUT.
Definition at line 322 of file liolib.cpp.
References aux_lines(), IO_INPUT, lua_getfield(), lua_isnil, lua_isnone, lua_pushnil(), LUA_REGISTRYINDEX, lua_replace(), luaL_checkstring, opencheck(), and tofile().
Definition at line 634 of file liolib.cpp.
References luaL_Stream::closef, lua_pushliteral, lua_pushnil(), and tolstream.
Referenced by createstdfile().
Definition at line 225 of file liolib.cpp.
References luaL_Stream::f, lua_checkmode, luaL_argcheck, luaL_checkstring, luaL_fileresult(), luaL_optstring, and newfile().
Definition at line 294 of file liolib.cpp.
References g_iofile(), and IO_OUTPUT.
Definition at line 239 of file liolib.cpp.
References luaL_Stream::f, lua_pclose, luaL_execresult(), and tolstream.
Referenced by io_popen().
Definition at line 245 of file liolib.cpp.
References luaL_Stream::closef, luaL_Stream::f, io_pclose(), lua_popen, luaL_checkstring, luaL_fileresult(), luaL_optstring, and newprefile().
Definition at line 473 of file liolib.cpp.
References g_read(), getiofile(), and IO_INPUT.
Definition at line 483 of file liolib.cpp.
References aux_close(), luaL_Stream::f, g_read(), i, int(), isclosed, lua_assert, lua_isnil, lua_pushvalue(), lua_settop(), lua_toboolean(), lua_tointeger, lua_tostring, lua_touserdata(), lua_upvalueindex, and luaL_error().
Referenced by aux_lines().
Definition at line 255 of file liolib.cpp.
References luaL_Stream::f, luaL_fileresult(), and newfile().
Definition at line 129 of file liolib.cpp.
References isclosed, LUA_FILEHANDLE, lua_pushliteral, lua_pushnil(), luaL_checkany(), and luaL_testudata().
Definition at line 533 of file liolib.cpp.
References g_write(), getiofile(), and IO_OUTPUT.
LUAMOD_API int luaopen_io | ( | lua_State * | L | ) |
Definition at line 656 of file liolib.cpp.
References createmeta(), createstdfile(), IO_INPUT, IO_OUTPUT, and luaL_newlib.
Definition at line 209 of file liolib.cpp.
References luaL_Stream::closef, luaL_Stream::f, io_fclose(), and newprefile().
Referenced by io_open(), io_tmpfile(), and opencheck().
Definition at line 167 of file liolib.cpp.
References luaL_Stream::closef, LUA_FILEHANDLE, lua_newuserdata(), and luaL_setmetatable().
Referenced by createstdfile(), io_popen(), and newfile().
Definition at line 217 of file liolib.cpp.
References luaL_Stream::f, LUA_QS, luaL_error(), and newfile().
Referenced by g_iofile(), and io_lines().
Definition at line 394 of file liolib.cpp.
References luaL_addsize, LUAL_BUFFERSIZE, luaL_buffinit(), luaL_prepbuffsize(), luaL_pushresult(), and MAX_SIZE_T.
Referenced by g_read().
Definition at line 410 of file liolib.cpp.
References luaL_addsize, luaL_buffinit(), luaL_prepbuffsize(), and luaL_pushresult().
Referenced by g_read().
Definition at line 370 of file liolib.cpp.
References lua_rawlen(), luaL_addsize, LUAL_BUFFERSIZE, luaL_buffinit(), luaL_prepbuffer, and luaL_pushresult().
Referenced by g_read().
Definition at line 349 of file liolib.cpp.
References d, LUA_NUMBER_SCAN, lua_pushnil(), and lua_pushnumber().
Referenced by g_read().
|
static |
Definition at line 153 of file liolib.cpp.
References luaL_Stream::f, isclosed, lua_assert, luaL_error(), and tolstream.
Referenced by f_flush(), f_lines(), f_read(), f_seek(), f_setvbuf(), f_write(), g_iofile(), io_close(), and io_lines().
|
static |
|
static |
Definition at line 589 of file liolib.cpp.