Go to the source code of this file.
Classes | |
struct | Smain |
Defines | |
#define | lua_c |
#define | notail(x) {if ((x)[2] != '\0') return -1;} |
Functions | |
static void | lstop (lua_State *L, lua_Debug *ar) |
static void | laction (int i) |
static void | print_usage (void) |
static void | l_message (const char *pname, const char *msg) |
static int | report (lua_State *L, int status) |
static int | traceback (lua_State *L) |
static int | docall (lua_State *L, int narg, int clear) |
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 *pi, int *pv, int *pe) |
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 notail | ( | x | ) | {if ((x)[2] != '\0') return -1;} |
Definition at line 264 of file lua.c.
Referenced by collectargs().
static int collectargs | ( | char ** | argv, | |
int * | pi, | |||
int * | pv, | |||
int * | pe | |||
) | [static] |
static int docall | ( | lua_State * | L, | |
int | narg, | |||
int | clear | |||
) | [static] |
Definition at line 98 of file lua.c.
References laction(), lua_gc(), LUA_GCCOLLECT, lua_gettop(), lua_insert(), LUA_MULTRET, lua_pcall(), lua_pushcfunction, lua_remove(), and traceback().
Referenced by dofile(), dolibrary(), dostring(), dotty(), and handle_script().
static int dofile | ( | lua_State * | L, | |
const char * | name | |||
) | [static] |
Definition at line 140 of file lua.c.
References docall(), luaL_loadfile(), and report().
Referenced by handle_luainit(), and pmain().
static int dolibrary | ( | lua_State * | L, | |
const char * | name | |||
) | [static] |
Definition at line 152 of file lua.c.
References docall(), lua_getglobal, lua_pushstring(), and report().
Referenced by runargs().
static int dostring | ( | lua_State * | L, | |
const char * | s, | |||
const char * | name | |||
) | [static] |
Definition at line 146 of file lua.c.
References docall(), luaL_loadbuffer(), and report().
Referenced by handle_luainit(), and runargs().
static void dotty | ( | lua_State * | L | ) | [static] |
Definition at line 222 of file lua.c.
References docall(), l_message(), loadline(), lua_getglobal, lua_gettop(), lua_insert(), lua_pcall(), lua_pushfstring(), LUA_QL, lua_settop(), lua_tostring, progname, and report().
Referenced by pmain().
static const char* get_prompt | ( | lua_State * | L, | |
int | firstline | |||
) | [static] |
Definition at line 159 of file lua.c.
References lua_getfield(), LUA_GLOBALSINDEX, lua_pop, LUA_PROMPT, LUA_PROMPT2, and lua_tostring.
Referenced by pushline().
static int getargs | ( | lua_State * | L, | |
char ** | argv, | |||
int | n | |||
) | [static] |
Definition at line 122 of file lua.c.
References lua_createtable(), lua_pushstring(), lua_rawseti(), and luaL_checkstack().
Referenced by handle_script().
static int handle_luainit | ( | lua_State * | L | ) | [static] |
static int handle_script | ( | lua_State * | L, | |
char ** | argv, | |||
int | n | |||
) | [static] |
Definition at line 245 of file lua.c.
References docall(), getargs(), lua_insert(), lua_pop, lua_setglobal, luaL_loadfile(), and report().
Referenced by pmain().
static int incomplete | ( | lua_State * | L, | |
int | status | |||
) | [static] |
Definition at line 169 of file lua.c.
References LUA_ERRSYNTAX, lua_pop, LUA_QL, and lua_tolstring().
Referenced by loadline().
static void l_message | ( | const char * | pname, | |
const char * | msg | |||
) | [static] |
static void laction | ( | int | i | ) | [static] |
Definition at line 36 of file lua.c.
References lstop(), LUA_MASKCALL, LUA_MASKCOUNT, LUA_MASKRET, and lua_sethook().
Referenced by docall().
static int loadline | ( | lua_State * | L | ) | [static] |
Definition at line 202 of file lua.c.
References incomplete(), lua_concat(), lua_insert(), lua_pushliteral, lua_remove(), lua_saveline, lua_settop(), lua_strlen, lua_tostring, luaL_loadbuffer(), and pushline().
Referenced by dotty().
Definition at line 28 of file lua.c.
References lua_sethook(), and luaL_error().
Referenced by laction().
int main | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 383 of file lua.c.
References Smain::argc, Smain::argv, l_message(), lua_close(), lua_cpcall(), lua_open, pmain(), report(), and Smain::status.
static int pmain | ( | lua_State * | L | ) | [static] |
Definition at line 346 of file lua.c.
References Smain::argc, Smain::argv, collectargs(), dofile(), dotty(), handle_luainit(), handle_script(), lua_gc(), LUA_GCRESTART, LUA_GCSTOP, lua_stdin_is_tty, lua_touserdata(), luaL_openlibs(), print_usage(), print_version(), progname, runargs(), and Smain::status.
Referenced by main().
static void print_usage | ( | void | ) | [static] |
static void print_version | ( | void | ) | [static] |
Definition at line 117 of file lua.c.
References l_message(), LUA_COPYRIGHT, and LUA_RELEASE.
Referenced by pmain().
static int pushline | ( | lua_State * | L, | |
int | firstline | |||
) | [static] |
Definition at line 183 of file lua.c.
References get_prompt(), lua_freeline, LUA_MAXINPUT, lua_pushfstring(), lua_pushstring(), and lua_readline.
Referenced by loadline().
static int report | ( | lua_State * | L, | |
int | status | |||
) | [static] |
Definition at line 67 of file lua.c.
References l_message(), lua_isnil, lua_pop, lua_tostring, and progname.
Referenced by dofile(), dolibrary(), dostring(), dotty(), handle_script(), and main().
static int runargs | ( | lua_State * | L, | |
char ** | argv, | |||
int | n | |||
) | [static] |
Definition at line 300 of file lua.c.
References chunk(), dolibrary(), dostring(), and lua_assert.
Referenced by pmain().
static int traceback | ( | lua_State * | L | ) | [static] |
Definition at line 78 of file lua.c.
References lua_call(), lua_getfield(), LUA_GLOBALSINDEX, lua_isfunction, lua_isstring(), lua_istable, lua_pop, lua_pushinteger(), and lua_pushvalue().
Referenced by docall().
ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:50:00 2011 by Doxygen 1.6.1