Github User Fetcher 1.0.0
C Application with Server and GUI
|
#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 | liolib_c |
#define | LUA_LIB |
#define | IO_INPUT 1 |
#define | IO_OUTPUT 2 |
#define | tofilep(L) ((FILE **)luaL_checkudata(L, 1, LUA_FILEHANDLE)) |
Functions | |
static int | pushresult (lua_State *L, int i, const char *filename) |
static void | fileerror (lua_State *L, int arg, const char *filename) |
static int | io_type (lua_State *L) |
static FILE * | tofile (lua_State *L) |
static FILE ** | newfile (lua_State *L) |
static int | io_noclose (lua_State *L) |
static int | io_pclose (lua_State *L) |
static int | io_fclose (lua_State *L) |
static int | aux_close (lua_State *L) |
static int | io_close (lua_State *L) |
static int | io_gc (lua_State *L) |
static int | io_tostring (lua_State *L) |
static int | io_open (lua_State *L) |
static int | io_popen (lua_State *L) |
static int | io_tmpfile (lua_State *L) |
static FILE * | getiofile (lua_State *L, int findex) |
static int | g_iofile (lua_State *L, int f, const char *mode) |
static int | io_input (lua_State *L) |
static int | io_output (lua_State *L) |
static int | io_readline (lua_State *L) |
static void | aux_lines (lua_State *L, int idx, int toclose) |
static int | f_lines (lua_State *L) |
static int | io_lines (lua_State *L) |
static int | read_number (lua_State *L, FILE *f) |
static int | test_eof (lua_State *L, FILE *f) |
static int | read_line (lua_State *L, FILE *f) |
static int | read_chars (lua_State *L, FILE *f, size_t n) |
static int | g_read (lua_State *L, FILE *f, int first) |
static int | io_read (lua_State *L) |
static int | f_read (lua_State *L) |
static int | g_write (lua_State *L, FILE *f, int arg) |
static int | io_write (lua_State *L) |
static int | f_write (lua_State *L) |
static int | f_seek (lua_State *L) |
static int | f_setvbuf (lua_State *L) |
static int | io_flush (lua_State *L) |
static int | f_flush (lua_State *L) |
static void | createmeta (lua_State *L) |
static void | createstdfile (lua_State *L, FILE *f, int k, const char *fname) |
static void | newfenv (lua_State *L, lua_CFunction cls) |
LUALIB_API int | luaopen_io (lua_State *L) |
Variables | |
static const char *const | fnames [] = {"input", "output"} |
static const luaL_Reg | iolib [] |
static const luaL_Reg | flib [] |
#define IO_INPUT 1 |
Definition at line 23 of file lua-5.1.5/src/liolib.c.
Referenced by io_input(), io_lines(), io_read(), and luaopen_io().
#define IO_OUTPUT 2 |
Definition at line 24 of file lua-5.1.5/src/liolib.c.
Referenced by io_close(), io_flush(), io_output(), io_write(), and luaopen_io().
#define liolib_c |
Definition at line 13 of file lua-5.1.5/src/liolib.c.
#define LUA_LIB |
Definition at line 14 of file lua-5.1.5/src/liolib.c.
#define tofilep | ( | L | ) | ((FILE **)luaL_checkudata(L, 1, LUA_FILEHANDLE)) |
Definition at line 54 of file lua-5.1.5/src/liolib.c.
Referenced by io_fclose(), io_gc(), io_pclose(), io_tostring(), and tofile().
|
static |
Definition at line 127 of file lua-5.1.5/src/liolib.c.
References lua_getfenv(), lua_getfield(), and lua_tocfunction().
Referenced by io_close(), io_gc(), and io_readline().
|
static |
Definition at line 234 of file lua-5.1.5/src/liolib.c.
References io_readline(), lua_pushboolean(), lua_pushcclosure(), and lua_pushvalue().
Referenced by f_lines(), and io_lines().
|
static |
Definition at line 510 of file lua-5.1.5/src/liolib.c.
References flib, LUA_FILEHANDLE, lua_pushvalue(), lua_setfield(), luaL_newmetatable(), luaL_register(), and NULL.
Referenced by luaopen_io().
|
static |
Definition at line 518 of file lua-5.1.5/src/liolib.c.
References LUA_ENVIRONINDEX, lua_pushvalue(), lua_rawseti(), lua_setfenv(), lua_setfield(), and newfile().
Referenced by luaopen_io().
|
static |
Definition at line 475 of file lua-5.1.5/src/liolib.c.
References NULL, pushresult(), and tofile().
|
static |
Definition at line 241 of file lua-5.1.5/src/liolib.c.
References aux_lines(), and tofile().
Referenced by io_lines().
|
static |
Definition at line 386 of file lua-5.1.5/src/liolib.c.
|
static |
Definition at line 442 of file lua-5.1.5/src/liolib.c.
References lua_pushinteger(), luaL_checkoption(), luaL_optlong, NULL, pushresult(), and tofile().
|
static |
Definition at line 458 of file lua-5.1.5/src/liolib.c.
References LUAL_BUFFERSIZE, luaL_checkoption(), luaL_optinteger(), NULL, pushresult(), and tofile().
|
static |
Definition at line 437 of file lua-5.1.5/src/liolib.c.
|
static |
Definition at line 48 of file lua-5.1.5/src/liolib.c.
References arg, lua_pushfstring(), lua_tostring, and luaL_argerror().
Referenced by g_iofile(), and io_lines().
|
static |
Definition at line 200 of file lua-5.1.5/src/liolib.c.
References fileerror(), LUA_ENVIRONINDEX, lua_isnoneornil, lua_pushvalue(), lua_rawgeti(), lua_rawseti(), lua_tostring, newfile(), NULL, and tofile().
Referenced by io_input(), and io_output().
|
static |
Definition at line 334 of file lua-5.1.5/src/liolib.c.
References lua_gettop(), LUA_MINSTACK, lua_pop, lua_pushnil(), LUA_TNUMBER, lua_tointeger, lua_tostring, lua_type(), luaL_argcheck, luaL_argerror(), luaL_checkstack(), NULL, pushresult(), read_chars(), read_line(), read_number(), and test_eof().
|
static |
Definition at line 413 of file lua-5.1.5/src/liolib.c.
References arg, fwrite(), lua_gettop(), LUA_NUMBER_FMT, LUA_TNUMBER, lua_tonumber, lua_type(), luaL_checklstring(), NULL, pushresult(), and s.
Referenced by f_write(), and io_write().
|
static |
Definition at line 190 of file lua-5.1.5/src/liolib.c.
References fnames, LUA_ENVIRONINDEX, lua_rawgeti(), lua_touserdata(), luaL_error(), and NULL.
Referenced by io_flush(), io_read(), and io_write().
|
static |
Definition at line 134 of file lua-5.1.5/src/liolib.c.
References aux_close(), IO_OUTPUT, LUA_ENVIRONINDEX, lua_isnone, lua_rawgeti(), and tofile().
|
static |
Definition at line 119 of file lua-5.1.5/src/liolib.c.
References NULL, pushresult(), and tofilep.
Referenced by luaopen_io().
|
static |
Definition at line 470 of file lua-5.1.5/src/liolib.c.
References getiofile(), IO_OUTPUT, NULL, and pushresult().
|
static |
Definition at line 142 of file lua-5.1.5/src/liolib.c.
References aux_close(), NULL, and tofilep.
|
static |
Definition at line 221 of file lua-5.1.5/src/liolib.c.
References g_iofile(), and IO_INPUT.
|
static |
Definition at line 248 of file lua-5.1.5/src/liolib.c.
References aux_lines(), f_lines(), fileerror(), IO_INPUT, LUA_ENVIRONINDEX, lua_gettop(), lua_isnoneornil, lua_rawgeti(), luaL_checkstring, newfile(), and NULL.
|
static |
Definition at line 98 of file lua-5.1.5/src/liolib.c.
References lua_pushliteral, and lua_pushnil().
Referenced by luaopen_io().
|
static |
Definition at line 161 of file lua-5.1.5/src/liolib.c.
References luaL_checkstring, luaL_optstring, newfile(), NULL, and pushresult().
|
static |
Definition at line 226 of file lua-5.1.5/src/liolib.c.
References g_iofile(), and IO_OUTPUT.
|
static |
Definition at line 108 of file lua-5.1.5/src/liolib.c.
References lua_pclose, NULL, pushresult(), and tofilep.
Referenced by luaopen_io().
|
static |
Definition at line 174 of file lua-5.1.5/src/liolib.c.
References lua_popen, luaL_checkstring, luaL_optstring, newfile(), NULL, and pushresult().
|
static |
Definition at line 381 of file lua-5.1.5/src/liolib.c.
References g_read(), getiofile(), and IO_INPUT.
|
static |
Definition at line 391 of file lua-5.1.5/src/liolib.c.
References aux_close(), lua_pushvalue(), lua_settop(), lua_toboolean(), lua_touserdata(), lua_upvalueindex, luaL_error(), NULL, and read_line().
Referenced by aux_lines().
|
static |
Definition at line 183 of file lua-5.1.5/src/liolib.c.
References newfile(), NULL, and pushresult().
|
static |
Definition at line 151 of file lua-5.1.5/src/liolib.c.
References lua_pushfstring(), lua_pushliteral, NULL, and tofilep.
|
static |
Definition at line 57 of file lua-5.1.5/src/liolib.c.
References LUA_FILEHANDLE, lua_getfield(), lua_getmetatable(), lua_pushliteral, lua_pushnil(), lua_rawequal(), LUA_REGISTRYINDEX, lua_touserdata(), luaL_checkany(), and NULL.
|
static |
Definition at line 432 of file lua-5.1.5/src/liolib.c.
References g_write(), getiofile(), and IO_OUTPUT.
LUALIB_API int luaopen_io | ( | lua_State * | L | ) |
Definition at line 537 of file lua-5.1.5/src/liolib.c.
References createmeta(), createstdfile(), io_fclose(), IO_INPUT, io_noclose(), IO_OUTPUT, io_pclose(), iolib, LUA_ENVIRONINDEX, lua_getfield(), LUA_IOLIBNAME, lua_pop, lua_replace, lua_setfenv(), luaL_register(), and newfenv().
|
static |
Definition at line 530 of file lua-5.1.5/src/liolib.c.
References lua_createtable(), lua_pushcfunction, and lua_setfield().
Referenced by luaopen_io().
|
static |
Definition at line 86 of file lua-5.1.5/src/liolib.c.
References LUA_FILEHANDLE, lua_newuserdata, lua_setmetatable(), luaL_getmetatable, and NULL.
Referenced by createstdfile(), g_iofile(), io_lines(), io_open(), io_popen(), and io_tmpfile().
|
static |
Definition at line 30 of file lua-5.1.5/src/liolib.c.
References lua_pushboolean(), lua_pushfstring(), lua_pushinteger(), and lua_pushnil().
Referenced by f_flush(), f_seek(), f_setvbuf(), g_read(), g_write(), io_fclose(), io_flush(), io_open(), io_pclose(), io_popen(), and io_tmpfile().
|
static |
Definition at line 316 of file lua-5.1.5/src/liolib.c.
References fread(), lua_objlen(), luaL_addsize, LUAL_BUFFERSIZE, luaL_buffinit(), luaL_prepbuffer, and luaL_pushresult().
Referenced by g_read().
|
static |
Definition at line 294 of file lua-5.1.5/src/liolib.c.
References lua_objlen(), luaL_addsize, LUAL_BUFFERSIZE, luaL_buffinit(), luaL_prepbuffer, luaL_pushresult(), and NULL.
Referenced by g_read(), and io_readline().
|
static |
Definition at line 273 of file lua-5.1.5/src/liolib.c.
References LUA_NUMBER_SCAN, lua_pushnil(), and lua_pushnumber().
Referenced by g_read().
|
static |
Definition at line 286 of file lua-5.1.5/src/liolib.c.
References lua_pushlstring(), and NULL.
Referenced by g_read().
|
static |
Definition at line 72 of file lua-5.1.5/src/liolib.c.
References luaL_error(), NULL, and tofilep.
Referenced by f_flush(), f_lines(), f_read(), f_seek(), f_setvbuf(), f_write(), g_iofile(), and io_close().
|
static |
Definition at line 496 of file lua-5.1.5/src/liolib.c.
Referenced by createmeta().
|
static |
Definition at line 27 of file lua-5.1.5/src/liolib.c.
Referenced by getiofile().
|
static |
Definition at line 480 of file lua-5.1.5/src/liolib.c.
Referenced by luaopen_io().