Github User Fetcher 1.0.0
C Application with Server and GUI
|
#include <signal.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 | lua_c |
#define | LUA_PROMPT "> " |
#define | LUA_PROMPT2 ">> " |
#define | LUA_PROGNAME "lua" |
#define | LUA_MAXINPUT 512 |
#define | LUA_INIT "LUA_INIT" |
#define | LUA_INITVERSION LUA_INIT "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR |
#define | lua_stdin_is_tty() 1 /* assume stdin is a tty */ |
#define | lua_readline(L, b, p) |
#define | lua_saveline(L, idx) { (void)L; (void)idx; } |
#define | lua_freeline(L, b) { (void)L; (void)b; } |
#define | EOFMARK "<eof>" |
#define | marklen (sizeof(EOFMARK)/sizeof(char) - 1) |
#define | noextrachars(x) {if ((x)[2] != '\0') return -1;} |
#define | has_i 0 /* -i */ |
#define | has_v 1 /* -v */ |
#define | has_e 2 /* -e */ |
#define | has_E 3 /* -E */ |
#define | num_has 4 /* number of 'has_*' */ |
Functions | |
static void | lstop (lua_State *L, lua_Debug *ar) |
static void | laction (int i) |
static void | print_usage (const char *badoption) |
static void | l_message (const char *pname, const char *msg) |
static int | report (lua_State *L, int status) |
static void | finalreport (lua_State *L, int status) |
static int | traceback (lua_State *L) |
static int | docall (lua_State *L, int narg, int nres) |
static void | print_version (void) |
static int | getargs (lua_State *L, char **argv, int n) |
static int | dofile (lua_State *L, const char *name) |
static int | dostring (lua_State *L, const char *s, const char *name) |
static int | dolibrary (lua_State *L, const char *name) |
static const char * | get_prompt (lua_State *L, int firstline) |
static int | incomplete (lua_State *L, int status) |
static int | pushline (lua_State *L, int firstline) |
static int | loadline (lua_State *L) |
static void | dotty (lua_State *L) |
static int | handle_script (lua_State *L, char **argv, int n) |
static int | collectargs (char **argv, int *args) |
static int | runargs (lua_State *L, char **argv, int n) |
static int | handle_luainit (lua_State *L) |
static int | pmain (lua_State *L) |
int | main (int argc, char **argv) |
Variables | |
static lua_State * | globalL = NULL |
static const char * | progname = LUA_PROGNAME |
#define EOFMARK "<eof>" |
Definition at line 244 of file lua-5.2.4/src/lua.c.
Referenced by incomplete().
#define has_e 2 /* -e */ |
Definition at line 351 of file lua-5.2.4/src/lua.c.
Referenced by collectargs(), pmain(), and pmain().
#define has_E 3 /* -E */ |
Definition at line 352 of file lua-5.2.4/src/lua.c.
Referenced by collectargs(), and pmain().
#define has_i 0 /* -i */ |
Definition at line 349 of file lua-5.2.4/src/lua.c.
Referenced by collectargs(), pmain(), and pmain().
#define has_v 1 /* -v */ |
Definition at line 350 of file lua-5.2.4/src/lua.c.
Referenced by collectargs(), pmain(), and pmain().
#define lua_c |
Definition at line 13 of file lua-5.2.4/src/lua.c.
#define lua_freeline | ( | L, | |
b ) { (void)L; (void)b; } |
Definition at line 81 of file lua-5.2.4/src/lua.c.
Referenced by pushline(), and pushline().
#define LUA_INIT "LUA_INIT" |
Definition at line 35 of file lua-5.2.4/src/lua.c.
Referenced by handle_luainit().
#define LUA_INITVERSION LUA_INIT "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR |
Definition at line 38 of file lua-5.2.4/src/lua.c.
Referenced by handle_luainit().
#define LUA_MAXINPUT 512 |
Definition at line 31 of file lua-5.2.4/src/lua.c.
Referenced by pushline(), and pushline().
#define LUA_PROGNAME "lua" |
Definition at line 27 of file lua-5.2.4/src/lua.c.
#define LUA_PROMPT "> " |
Definition at line 22 of file lua-5.2.4/src/lua.c.
Referenced by get_prompt(), and get_prompt().
#define LUA_PROMPT2 ">> " |
Definition at line 23 of file lua-5.2.4/src/lua.c.
Referenced by get_prompt(), and get_prompt().
#define lua_readline | ( | L, | |
b, | |||
p ) |
Definition at line 77 of file lua-5.2.4/src/lua.c.
Referenced by pushline(), and pushline().
#define lua_saveline | ( | L, | |
idx ) { (void)L; (void)idx; } |
Definition at line 80 of file lua-5.2.4/src/lua.c.
Referenced by loadline(), and loadline().
Definition at line 54 of file lua-5.2.4/src/lua.c.
#define marklen (sizeof(EOFMARK)/sizeof(char) - 1) |
Definition at line 245 of file lua-5.2.4/src/lua.c.
Referenced by incomplete().
#define noextrachars | ( | x | ) | {if ((x)[2] != '\0') return -1;} |
Definition at line 345 of file lua-5.2.4/src/lua.c.
Referenced by collectargs().
#define num_has 4 /* number of 'has_*' */ |
Definition at line 354 of file lua-5.2.4/src/lua.c.
Referenced by pmain().
|
static |
Definition at line 357 of file lua-5.2.4/src/lua.c.
References has_e, has_E, has_i, has_v, noextrachars, and NULL.
Referenced by pmain().
|
static |
Definition at line 172 of file lua-5.2.4/src/lua.c.
References globalL, laction(), lua_gettop(), lua_insert, lua_pcall, lua_pushcfunction, lua_remove, and traceback().
Referenced by dofile(), dolibrary(), dostring(), dotty(), and handle_script().
|
static |
Definition at line 210 of file lua-5.2.4/src/lua.c.
References docall(), LUA_OK, luaL_loadfile, name, and report().
Referenced by handle_luainit(), and pmain().
|
static |
Definition at line 224 of file lua-5.2.4/src/lua.c.
References docall(), lua_getglobal, LUA_OK, lua_pushstring(), lua_setglobal, name, and report().
Referenced by runargs().
|
static |
Definition at line 217 of file lua-5.2.4/src/lua.c.
References docall(), LUA_OK, luaL_loadbuffer, name, report(), and s.
Referenced by handle_luainit(), and runargs().
|
static |
Definition at line 303 of file lua-5.2.4/src/lua.c.
References docall(), l_message(), loadline(), lua_getglobal, lua_gettop(), lua_insert, LUA_MINSTACK, LUA_MULTRET, LUA_OK, lua_pcall, lua_pushfstring(), LUA_QL, lua_settop(), lua_tostring, luaL_checkstack(), NULL, progname, and report().
Referenced by pmain().
|
static |
Definition at line 149 of file lua-5.2.4/src/lua.c.
References l_message(), LUA_OK, lua_pop, lua_tostring, LUA_TSTRING, lua_type(), NULL, and progname.
Referenced by main().
|
static |
Definition at line 235 of file lua-5.2.4/src/lua.c.
References lua_getglobal, LUA_PROMPT, LUA_PROMPT2, lua_tostring, and NULL.
Referenced by pushline().
|
static |
Definition at line 192 of file lua-5.2.4/src/lua.c.
References lua_createtable(), lua_pushstring(), lua_rawseti(), and luaL_checkstack().
Referenced by handle_script().
|
static |
Definition at line 423 of file lua-5.2.4/src/lua.c.
References dofile(), dostring(), LUA_INIT, LUA_INITVERSION, LUA_OK, name, and NULL.
Referenced by pmain().
|
static |
Definition at line 326 of file lua-5.2.4/src/lua.c.
References docall(), getargs(), lua_insert, LUA_MULTRET, LUA_OK, lua_pop, lua_setglobal, luaL_loadfile, NULL, and report().
Referenced by pmain().
|
static |
Definition at line 247 of file lua-5.2.4/src/lua.c.
References EOFMARK, LUA_ERRSYNTAX, lua_pop, lua_tolstring(), and marklen.
Referenced by loadline().
|
static |
Definition at line 129 of file lua-5.2.4/src/lua.c.
References luai_writestringerror.
Referenced by dotty(), finalreport(), main(), and report().
|
static |
Definition at line 101 of file lua-5.2.4/src/lua.c.
References globalL, lstop(), LUA_MASKCALL, LUA_MASKCOUNT, LUA_MASKRET, and lua_sethook().
Referenced by docall().
|
static |
Definition at line 281 of file lua-5.2.4/src/lua.c.
References incomplete(), lua_concat(), lua_insert, lua_pushliteral, lua_remove, lua_saveline, lua_settop(), lua_tolstring(), luaL_loadbuffer, and pushline().
Referenced by dotty().
Definition at line 94 of file lua-5.2.4/src/lua.c.
References lua_sethook(), luaL_error(), and NULL.
Referenced by laction().
int main | ( | int | argc, |
char ** | argv ) |
Definition at line 480 of file lua-5.2.4/src/lua.c.
References finalreport(), l_message(), lua_close(), LUA_OK, lua_pcall, lua_pushcfunction, lua_pushinteger(), lua_pushlightuserdata(), lua_toboolean(), luaL_newstate(), NULL, and pmain().
|
static |
Definition at line 438 of file lua-5.2.4/src/lua.c.
References collectargs(), dofile(), dotty(), handle_luainit(), handle_script(), has_e, has_E, has_i, has_v, lua_gc(), LUA_GCRESTART, LUA_GCSTOP, LUA_OK, lua_pushboolean(), LUA_REGISTRYINDEX, lua_setfield(), lua_stdin_is_tty, lua_tointeger, lua_touserdata(), luaL_checkversion, luaL_openlibs(), NULL, num_has, print_usage(), print_version(), progname, and runargs().
Referenced by main().
|
static |
Definition at line 108 of file lua-5.2.4/src/lua.c.
References LUA_QL, luai_writestringerror, and progname.
|
static |
Definition at line 186 of file lua-5.2.4/src/lua.c.
References LUA_COPYRIGHT.
Referenced by pmain().
|
static |
Definition at line 260 of file lua-5.2.4/src/lua.c.
References get_prompt(), lua_freeline, LUA_MAXINPUT, lua_pop, lua_pushfstring(), lua_pushstring(), and lua_readline.
Referenced by loadline().
|
static |
Definition at line 135 of file lua-5.2.4/src/lua.c.
References l_message(), lua_gc(), LUA_GCCOLLECT, lua_isnil, LUA_OK, lua_pop, lua_tostring, NULL, and progname.
Referenced by dofile(), dolibrary(), dostring(), dotty(), and handle_script().
|
static |
Definition at line 395 of file lua-5.2.4/src/lua.c.
References chunk(), dolibrary(), dostring(), lua_assert, LUA_OK, and NULL.
Referenced by pmain().
|
static |
Definition at line 160 of file lua-5.2.4/src/lua.c.
References lua_isnoneornil, lua_pushliteral, lua_tostring, luaL_callmeta(), and luaL_traceback().
Referenced by docall().
Definition at line 88 of file lua-5.2.4/src/lua.c.
|
static |
Definition at line 90 of file lua-5.2.4/src/lua.c.
Referenced by dotty(), finalreport(), pmain(), print_usage(), and report().