The Battle for Wesnoth  1.15.12+dev
Classes | Macros | Functions
lundump.cpp File Reference
#include "lprefix.h"
#include <limits.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, 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 size_t loadUnsigned (LoadState *S, size_t limit)
 
static size_t loadSize (LoadState *S)
 
static int loadInt (LoadState *S)
 
static lua_Number loadNumber (LoadState *S)
 
static lua_Integer loadInteger (LoadState *S)
 
static TStringloadStringN (LoadState *S, Proto *p)
 
static TStringloadString (LoadState *S, Proto *p)
 
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 288 of file lundump.cpp.

Referenced by checkHeader().

◆ loadVar

#define loadVar (   S,
 
)    loadVector(S,&x,1)

Definition at line 58 of file lundump.cpp.

Referenced by loadInteger(), and loadNumber().

◆ loadVector

#define loadVector (   S,
  b,
  n 
)    loadBlock(S,b,(n)*sizeof((b)[0]))

Definition at line 50 of file lundump.cpp.

Referenced by checkliteral(), loadCode(), loadDebug(), and loadStringN().

◆ LUA_CORE

#define LUA_CORE

Definition at line 8 of file lundump.cpp.

◆ luai_verifycode

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

Definition at line 29 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 273 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 40 of file lundump.cpp.

References LoadState::L, LUA_ERRSYNTAX, luaD_throw(), luaO_pushfstring(), and LoadState::name.

Referenced by config::add_child_at(), game_config::add_color_info(), unit_type_data::apply_base_unit(), config::apply_diff(), unit_type::check_id(), config::check_valid(), checkHeader(), checkliteral(), config_implementation::child(), config::child(), config::clear_diff_track(), client_address(), game_config::color_info(), default_map_generator_job::default_generate_map(), addons_client::delete_remote_addon(), preprocessor_streambuf::error(), fchecksize(), config::find_child(), preprocessor_data::get_chunk(), get_resolution(), 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(), game_config_manager::load_addons_cfg(), load_fake_units(), gui::button::load_images(), loadBlock(), loadByte(), loadString(), loadUnsigned(), 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(), 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 282 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 52 of file lundump.cpp.

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

◆ loadByte()

static lu_byte loadByte ( LoadState S)
static

◆ loadCode()

static void loadCode ( LoadState S,
Proto f 
)
static

◆ 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 88 of file lundump.cpp.

References cast_int, and loadUnsigned().

Referenced by loadCode(), loadConstants(), loadDebug(), loadFunction(), loadProtos(), and loadUpvalues().

◆ loadInteger()

static lua_Integer loadInteger ( LoadState S)
static

Definition at line 100 of file lundump.cpp.

References loadVar.

Referenced by checkHeader(), and loadConstants().

◆ loadNumber()

static lua_Number loadNumber ( LoadState S)
static

Definition at line 93 of file lundump.cpp.

References loadVar.

Referenced by checkHeader(), and loadConstants().

◆ loadProtos()

static void loadProtos ( LoadState S,
Proto f 
)
static

◆ loadSize()

static size_t loadSize ( LoadState S)
static

Definition at line 83 of file lundump.cpp.

References loadUnsigned().

Referenced by loadStringN().

◆ loadString()

static TString* loadString ( LoadState S,
Proto p 
)
static

Definition at line 136 of file lundump.cpp.

References error(), and loadStringN().

Referenced by loadConstants().

◆ loadStringN()

static TString* loadStringN ( LoadState S,
Proto p 
)
static

◆ loadUnsigned()

static size_t loadUnsigned ( LoadState S,
size_t  limit 
)
static

Definition at line 69 of file lundump.cpp.

References b, error(), and loadByte().

Referenced by loadInt(), and loadSize().

◆ loadUpvalues()

static void loadUpvalues ( LoadState S,
Proto f 
)
static

◆ luaU_undump()

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