# lua.c File Reference

`#include <signal.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include "lua.h"`
`#include "lauxlib.h"`
`#include "lualib.h"`

## 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 Documentation

#define lua_c

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

## Function Documentation

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

static int docall | ( | lua_State * | L,
|  | int | narg,
|  | int | clear |
| ) |  |  | `[static]`

static int dofile | ( | lua_State * | L,
|  | const char * | name |
| ) |  |  | `[static]`

static int dolibrary | ( | lua_State * | L,
|  | const char * | name |
| ) |  |  | `[static]`

static int dostring | ( | lua_State * | L,
|  | const char * | s,
|  | const char * | name |
| ) |  |  | `[static]`

static void dotty | ( | lua_State * | L | ) | `[static]`

static const char* get_prompt | ( | lua_State * | L,
|  | int | firstline |
| ) |  |  | `[static]`

static int getargs | ( | lua_State * | L,
|  | char ** | argv,
|  | int | n |
| ) |  |  | `[static]`

static int handle_luainit | ( | lua_State * | L | ) | `[static]`

static int handle_script | ( | lua_State * | L,
|  | char ** | argv,
|  | int | n |
| ) |  |  | `[static]`

static int incomplete | ( | lua_State * | L,
|  | int | status |
| ) |  |  | `[static]`

static void l_message | ( | const char * | pname,
|  | const char * | msg |
| ) |  |  | `[static]`

static void laction | ( | int | i | ) | `[static]`

static int loadline | ( | lua_State * | L | ) | `[static]`

static void lstop | ( | lua_State * | L,
|  | lua_Debug * | ar |
| ) |  |  | `[static]`

int main | ( | int | argc,
|  | char ** | argv |
| ) |  |  |

static int pmain | ( | lua_State * | L | ) | `[static]`

static void print_usage | ( | void |  | ) | `[static]`

static void print_version | ( | void |  | ) | `[static]`

static int pushline | ( | lua_State * | L,
|  | int | firstline |
| ) |  |  | `[static]`

static int report | ( | lua_State * | L,
|  | int | status |
| ) |  |  | `[static]`

static int runargs | ( | lua_State * | L,
|  | char ** | argv,
|  | int | n |
| ) |  |  | `[static]`

static int traceback | ( | lua_State * | L | ) | `[static]`

## Variable Documentation

lua_State* globalL = NULL`[static]`

const char* progname = LUA_PROGNAME`[static]`