#include <errno.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "lua.h"#include "lauxlib.h"#include "ldo.h"#include "lfunc.h"#include "lmem.h"#include "lobject.h"#include "lopcodes.h"#include "lstring.h"#include "lundump.h"Go to the source code of this file.
Classes | |
| struct | Smain |
Defines | |
| #define | luac_c |
| #define | LUA_CORE |
| #define | PROGNAME "luac" |
| #define | OUTPUT PROGNAME ".out" |
| #define | IS(s) (strcmp(argv[i],s)==0) |
| #define | toproto(L, i) (clvalue(L->top+(i))->l.p) |
Functions | |
| static void | fatal (const char *message) |
| static void | cannot (const char *what) |
| static void | usage (const char *message) |
| static int | doargs (int argc, char *argv[]) |
| static const Proto * | combine (lua_State *L, int n) |
| static int | writer (lua_State *L, const void *p, size_t size, void *u) |
| static int | pmain (lua_State *L) |
| int | main (int argc, char *argv[]) |
Variables | |
| static int | listing = 0 |
| static int | dumping = 1 |
| static int | stripping = 0 |
| static char | Output [] = { OUTPUT } |
| static const char * | output = Output |
| static const char * | progname = PROGNAME |
| #define toproto | ( | L, | |||
| i | ) | (clvalue(L->top+(i))->l.p) |
| static void cannot | ( | const char * | what | ) | [static] |
Definition at line 119 of file luac.cpp.
References Proto::code, CREATE_ABC, CREATE_ABx, incr_top, luaF_newproto(), luaM_newvector, luaS_newliteral, Proto::maxstacksize, OP_CALL, OP_CLOSURE, OP_RETURN, Proto::p, PROGNAME, setptvalue2s, Proto::sizecode, Proto::sizep, Proto::source, lua_State::top, and toproto.
Referenced by pmain().
| static int doargs | ( | int | argc, | |
| char * | argv[] | |||
| ) | [static] |
| static void fatal | ( | const char * | message | ) | [static] |
| int main | ( | int | argc, | |
| char * | argv[] | |||
| ) |
Definition at line 186 of file luac.cpp.
References Smain::argc, Smain::argv, doargs(), fatal(), lua_close(), lua_cpcall(), lua_open, lua_tostring, NULL, and pmain().
| static int pmain | ( | lua_State * | L | ) | [static] |
Definition at line 158 of file luac.cpp.
References Smain::argc, Smain::argv, cannot(), combine(), dumping, fatal(), IS, listing, lua_checkstack(), lua_lock, lua_tostring, lua_touserdata(), lua_unlock, luaL_loadfile(), luaU_dump(), NULL, output, stripping, and writer().
| static void usage | ( | const char * | message | ) | [static] |
| static int writer | ( | lua_State * | L, | |
| const void * | p, | |||
| size_t | size, | |||
| void * | u | |||
| ) | [static] |
int dumping = 1 [static] |
int listing = 0 [static] |
char Output[] = { OUTPUT } [static] |
int stripping = 0 [static] |
1.5.3