#include <string.h>
#include "lua.h"
#include "ldebug.h"
#include "ldo.h"
#include "lfunc.h"
#include "lmem.h"
#include "lobject.h"
#include "lstring.h"
#include "lundump.h"
#include "lzio.h"
Go to the source code of this file.
Classes | |
struct | LoadState |
Macros | |
#define | lundump_c |
#define | LUA_CORE |
#define | LoadMem(S, b, n, size) LoadBlock(S,b,(n)*(size)) |
#define | LoadByte(S) (lu_byte)LoadChar(S) |
#define | LoadVar(S, x) LoadMem(S,&x,1,sizeof(x)) |
#define | LoadVector(S, b, n, size) LoadMem(S,b,n,size) |
#define | luai_verifycode(L, b, f) /* empty */ |
#define | N0 LUAC_HEADERSIZE |
#define | N1 (sizeof(LUA_SIGNATURE)-sizeof(char)) |
#define | N2 N1+2 |
#define | N3 N2+6 |
#define | MYINT(s) (s[0]-'0') |
#define | VERSION MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR) |
#define | FORMAT 0 /* this is the official format */ |
Functions | |
static l_noret | error (LoadState *S, const char *why) |
static void | LoadBlock (LoadState *S, void *b, size_t size) |
static int | LoadChar (LoadState *S) |
static int | LoadInt (LoadState *S) |
static lua_Number | LoadNumber (LoadState *S) |
static TString * | LoadString (LoadState *S) |
static void | LoadCode (LoadState *S, Proto *f) |
static void | LoadFunction (LoadState *S, Proto *f) |
static void | LoadConstants (LoadState *S, Proto *f) |
static void | LoadUpvalues (LoadState *S, Proto *f) |
static void | LoadDebug (LoadState *S, Proto *f) |
static void | LoadHeader (LoadState *S) |
Closure * | luaU_undump (lua_State *L, ZIO *Z, Mbuffer *buff, const char *name) |
void | luaU_header (lu_byte *h) |
#define FORMAT 0 /* this is the official format */ |
Definition at line 236 of file lundump.cpp.
Referenced by luaU_header().
Definition at line 36 of file lundump.cpp.
Referenced by LoadFunction(), and LoadUpvalues().
Definition at line 35 of file lundump.cpp.
Definition at line 37 of file lundump.cpp.
Referenced by LoadChar(), LoadInt(), LoadNumber(), and LoadString().
Definition at line 38 of file lundump.cpp.
Referenced by LoadCode(), and LoadDebug().
#define LUA_CORE |
Definition at line 9 of file lundump.cpp.
Definition at line 41 of file lundump.cpp.
Referenced by luaU_undump().
#define lundump_c |
Definition at line 8 of file lundump.cpp.
Definition at line 234 of file lundump.cpp.
#define N0 LUAC_HEADERSIZE |
Definition at line 184 of file lundump.cpp.
Referenced by LoadHeader().
#define N1 (sizeof(LUA_SIGNATURE)-sizeof(char)) |
Definition at line 185 of file lundump.cpp.
Referenced by LoadHeader().
#define N2 N1+2 |
Definition at line 186 of file lundump.cpp.
Referenced by LoadHeader().
#define N3 N2+6 |
Definition at line 187 of file lundump.cpp.
Referenced by LoadHeader().
#define VERSION MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR) |
Definition at line 235 of file lundump.cpp.
Referenced by luaU_header().
Definition at line 29 of file lundump.cpp.
References LoadState::L, LUA_ERRSYNTAX, luaD_throw(), luaO_pushfstring(), and LoadState::name.
Referenced by unit_type_data::add_advancement(), config::add_child_at(), game_config::add_color_info(), suh::add_user(), config::apply_diff(), check_error(), unit_type::check_id(), suh::check_name(), suh::check_password(), suh::check_realname(), check_timeout(), config::check_valid(), tconfig_implementation::child(), config::clear_diff_track(), wesnothd::client_address(), game_config::color_info(), ng::configure_engine::configure_engine(), mp::connect::connect(), mp::create::create(), default_map_generator_job::default_generate_map(), enter_lobby_mode(), preprocessor_streambuf::error(), ai::formula_ai::execute_variant(), preprocessor_data::get_chunk(), get_connection_details(), network_worker_pool::get_received_data(), get_resolution(), get_unit_type(), glewGetErrorString(), GPU_PushErrorCode(), font::manager::init(), team_builder::init(), game_launcher::init_lua_script(), mp::initial_level_config(), CVideo::initSDL(), unit_map::insert(), mp::wait::join_game(), load_fake_units(), gui::button::load_images(), LoadBlock(), LoadHeader(), LoadInt(), main(), font::manager::manager(), network::manager::manager(), simple_wml::node::node(), open_connection(), simple_wml::document::output(), wesnothd::parse_ip(), network_asio::connection::poll(), process_command_args(), t_translation::read_game_map(), network::receive_data(), suh::remove_user(), ng::flg_manager::resolve_random(), schema_validation::schema_validator::schema_validator(), user_handler::send_mail(), suh::set_user_detail(), lua_gui2::show_message_dialog(), addons_client::update_last_error(), suh::user_info(), and write_internal().
Definition at line 44 of file lundump.cpp.
References error(), luaZ_read(), and LoadState::Z.
Referenced by LoadHeader(), and LoadString().
Definition at line 85 of file lundump.cpp.
References Proto::code, LoadState::L, LoadInt(), LoadVector, luaM_newvector, and Proto::sizecode.
Referenced by LoadFunction().
Definition at line 95 of file lundump.cpp.
References i, Proto::k, LoadState::L, LoadChar(), LoadFunction(), LoadInt(), LoadNumber(), LoadString(), lua_assert, LUA_TBOOLEAN, LUA_TNIL, LUA_TNUMBER, LUA_TSTRING, luaF_newproto(), luaM_newvector, Proto::p, setbvalue, setnilvalue, setnvalue, setsvalue2n, Proto::sizek, and Proto::sizep.
Referenced by LoadFunction().
Definition at line 148 of file lundump.cpp.
References LocVar::endpc, i, LoadState::L, Proto::lineinfo, LoadInt(), LoadString(), LoadVector, Proto::locvars, luaM_newvector, Upvaldesc::name, Proto::sizelineinfo, Proto::sizelocvars, Proto::source, LocVar::startpc, Proto::upvalues, and LocVar::varname.
Referenced by LoadFunction().
Definition at line 170 of file lundump.cpp.
References Proto::is_vararg, Proto::lastlinedefined, Proto::linedefined, LoadByte, LoadCode(), LoadConstants(), LoadDebug(), LoadInt(), LoadUpvalues(), Proto::maxstacksize, and Proto::numparams.
Referenced by LoadConstants(), and luaU_undump().
Definition at line 189 of file lundump.cpp.
References error(), LoadBlock(), LUAC_HEADERSIZE, luaU_header(), N0, N1, N2, and N3.
Referenced by luaU_undump().
Definition at line 56 of file lundump.cpp.
References error(), and LoadVar.
Referenced by LoadCode(), LoadConstants(), LoadDebug(), LoadFunction(), and LoadUpvalues().
|
static |
Definition at line 71 of file lundump.cpp.
References LoadState::b, LoadState::L, LoadBlock(), LoadVar, luaS_newlstr(), and luaZ_openspace().
Referenced by LoadConstants(), and LoadDebug().
Definition at line 134 of file lundump.cpp.
References i, Upvaldesc::idx, Upvaldesc::instack, LoadState::L, LoadByte, LoadInt(), luaM_newvector, Upvaldesc::name, Proto::sizeupvalues, and Proto::upvalues.
Referenced by LoadFunction().
Definition at line 243 of file lundump.cpp.
References cast_byte, FORMAT, LUA_SIGNATURE, LUAC_TAIL, and VERSION.
Referenced by DumpHeader(), and LoadHeader().
Definition at line 205 of file lundump.cpp.
References LoadState::b, incr_top, LoadState::L, Closure::l, LoadFunction(), LoadHeader(), LUA_SIGNATURE, luaF_newLclosure(), luaF_newproto(), luai_verifycode, LoadState::name, LClosure::p, S, setclLvalue, Proto::sizeupvalues, lua_State::top, and LoadState::Z.
Referenced by f_parser().