lua.c File Reference

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_StateglobalL = NULL
static const char * progname = LUA_PROGNAME

Define Documentation

#define lua_c

Definition at line 13 of file lua.c.

#define notail (  )     {if ((x)[2] != '\0') return -1;}

Definition at line 264 of file lua.c.

Referenced by collectargs().


Function Documentation

static int collectargs ( char **  argv,
int *  pi,
int *  pv,
int *  pe 
) [static]

Definition at line 267 of file lua.c.

References notail.

Referenced by pmain().

static int docall ( lua_State L,
int  narg,
int  clear 
) [static]
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]
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]

Definition at line 329 of file lua.c.

References dofile(), dostring(), and LUA_INIT.

Referenced by pmain().

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]

Definition at line 60 of file lua.c.

Referenced by dotty(), main(), print_version(), and report().

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]
static void lstop ( lua_State L,
lua_Debug ar 
) [static]

Definition at line 28 of file lua.c.

References lua_sethook(), and luaL_error().

Referenced by laction().

int main ( int  argc,
char **  argv 
)
static int pmain ( lua_State L  )  [static]
static void print_usage ( void   )  [static]

Definition at line 44 of file lua.c.

References LUA_QL, and progname.

Referenced by pmain().

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]

Variable Documentation

lua_State* globalL = NULL [static]

Definition at line 22 of file lua.c.

const char* progname = LUA_PROGNAME [static]

Definition at line 24 of file lua.c.

Referenced by dotty(), pmain(), print_usage(), and report().


ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:50:00 2011 by Doxygen 1.6.1