The Battle for Wesnoth  1.15.2+dev
Classes | Macros | Functions
lundump.cpp File Reference
#include "lprefix.h"
#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"
Include dependency graph for lundump.cpp:

Go to the source code of this file.

Classes

struct  LoadState
 

Macros

#define lundump_c
 
#define LUA_CORE
 
#define luai_verifycode(L, b, f)   /* empty */
 
#define LoadVector(S, b, n)   LoadBlock(S,b,(n)*sizeof((b)[0]))
 
#define LoadVar(S, x)   LoadVector(S,&x,1)
 
#define checksize(S, t)   fchecksize(S,sizeof(t),#t)
 

Functions

static l_noret error (LoadState *S, const char *why)
 
static void LoadBlock (LoadState *S, void *b, size_t size)
 
static lu_byte LoadByte (LoadState *S)
 
static int LoadInt (LoadState *S)
 
static lua_Number LoadNumber (LoadState *S)
 
static lua_Integer LoadInteger (LoadState *S)
 
static TStringLoadString (LoadState *S)
 
static void LoadCode (LoadState *S, Proto *f)
 
static void LoadFunction (LoadState *S, Proto *f, TString *psource)
 
static void LoadConstants (LoadState *S, Proto *f)
 
static void LoadProtos (LoadState *S, Proto *f)
 
static void LoadUpvalues (LoadState *S, Proto *f)
 
static void LoadDebug (LoadState *S, Proto *f)
 
static void checkliteral (LoadState *S, const char *s, const char *msg)
 
static void fchecksize (LoadState *S, size_t size, const char *tname)
 
static void checkHeader (LoadState *S)
 
LClosureluaU_undump (lua_State *L, ZIO *Z, const char *name)
 

Macro Definition Documentation

◆ checksize

#define checksize (   S,
  t 
)    fchecksize(S,sizeof(t),#t)

Definition at line 234 of file lundump.cpp.

Referenced by checkHeader().

◆ LoadVar

#define LoadVar (   S,
 
)    LoadVector(S,&x,1)

Definition at line 57 of file lundump.cpp.

Referenced by LoadByte(), LoadInt(), LoadInteger(), LoadNumber(), and LoadString().

◆ LoadVector

#define LoadVector (   S,
  b,
  n 
)    LoadBlock(S,b,(n)*sizeof((b)[0]))

Definition at line 49 of file lundump.cpp.

Referenced by checkliteral(), LoadCode(), LoadDebug(), and LoadString().

◆ LUA_CORE

#define LUA_CORE

Definition at line 8 of file lundump.cpp.

◆ luai_verifycode

#define luai_verifycode (   L,
  b,
  f 
)    /* empty */

Definition at line 28 of file lundump.cpp.

Referenced by luaU_undump().

◆ lundump_c

#define lundump_c

Definition at line 7 of file lundump.cpp.

Function Documentation

◆ checkHeader()

static void checkHeader ( LoadState S)
static

◆ checkliteral()

static void checkliteral ( LoadState S,
const char *  s,
const char *  msg 
)
static

Definition at line 219 of file lundump.cpp.

References error(), LoadVector, LUA_SIGNATURE, and LUAC_DATA.

Referenced by checkHeader().

◆ error()

static l_noret error ( LoadState S,
const char *  why 
)
static

Definition at line 39 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(), config::apply_diff(), unit_type::check_id(), config::check_valid(), checkHeader(), checkliteral(), config_implementation::child(), config::clear_diff_track(), client_address(), game_config::color_info(), default_map_generator_job::default_generate_map(), preprocessor_streambuf::error(), fchecksize(), preprocessor_data::get_chunk(), get_resolution(), get_unit_type(), game_launcher::init_lua_script(), mp::initial_level_config(), CVideo::initSDL(), unit_map::insert(), spirit_po::catalog< hashmap_type, pf_compiler >::insert_message(), game_lua_kernel::intf_get_fog_or_shroud(), load_fake_units(), gui::button::load_images(), LoadBlock(), luaW_checkunit(), luaW_checkunit_ptr(), luaW_checkunit_ref(), luaW_tounit(), luaW_tounit_ptr(), luaW_tounit_ref(), main(), font::manager::manager(), simple_wml::node::node(), simple_wml::document::output(), wesnothd::parse_ip(), gui2::dialogs::unit_recruit::pre_show(), gui2::dialogs::mp_create_game::pre_show(), preprocessor_streambuf::preprocessor_streambuf(), process_command_args(), gui2::dialogs::mp_lobby::process_network_data(), t_translation::read_builder_map(), server_base::read_from_fifo(), t_translation::read_game_map(), theme::remove_object(), ng::flg_manager::resolve_random(), schema_validation::schema_validator::schema_validator(), font::sdl_ttf::sdl_ttf(), server_base::serve(), lua_gui2::show_message_dialog(), server_base::start_server(), unit_type_data::unit_type_data(), addons_client::update_last_error(), and write_internal().

◆ fchecksize()

static void fchecksize ( LoadState S,
size_t  size,
const char *  tname 
)
static

Definition at line 228 of file lundump.cpp.

References error(), LoadState::L, LoadByte(), and luaO_pushfstring().

◆ LoadBlock()

static void LoadBlock ( LoadState S,
void *  b,
size_t  size 
)
static

Definition at line 51 of file lundump.cpp.

References error(), luaZ_read(), and LoadState::Z.

◆ LoadByte()

static lu_byte LoadByte ( LoadState S)
static

Definition at line 60 of file lundump.cpp.

References LoadVar.

Referenced by checkHeader(), fchecksize(), LoadConstants(), LoadFunction(), LoadString(), LoadUpvalues(), and luaU_undump().

◆ LoadCode()

static void LoadCode ( LoadState S,
Proto f 
)
static

Definition at line 107 of file lundump.cpp.

References Proto::code, f, LoadState::L, LoadFunction(), LoadInt(), LoadVector, luaM_newvector, n, and Proto::sizecode.

Referenced by LoadFunction().

◆ LoadConstants()

static void LoadConstants ( LoadState S,
Proto f 
)
static

◆ LoadDebug()

static void LoadDebug ( LoadState S,
Proto f 
)
static

◆ LoadFunction()

static void LoadFunction ( LoadState S,
Proto f,
TString psource 
)
static

◆ LoadInt()

static int LoadInt ( LoadState S)
static

Definition at line 67 of file lundump.cpp.

References LoadVar.

Referenced by LoadCode(), LoadConstants(), LoadDebug(), LoadFunction(), LoadProtos(), and LoadUpvalues().

◆ LoadInteger()

static lua_Integer LoadInteger ( LoadState S)
static

Definition at line 81 of file lundump.cpp.

References LoadVar.

Referenced by checkHeader(), and LoadConstants().

◆ LoadNumber()

static lua_Number LoadNumber ( LoadState S)
static

Definition at line 74 of file lundump.cpp.

References LoadVar.

Referenced by checkHeader(), and LoadConstants().

◆ LoadProtos()

static void LoadProtos ( LoadState S,
Proto f 
)
static

◆ LoadString()

static TString* LoadString ( LoadState S)
static

◆ LoadUpvalues()

static void LoadUpvalues ( LoadState S,
Proto f 
)
static

◆ luaU_undump()

LClosure* luaU_undump ( lua_State L,
ZIO Z,
const char *  name 
)