lundump.cpp File Reference

#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

Defines

#define lundump_c
#define LUA_CORE
#define IF(c, s)   if (c) error(S,s)
#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)

Functions

static void 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 TStringLoadString (LoadState *S)
static void LoadCode (LoadState *S, Proto *f)
static ProtoLoadFunction (LoadState *S, TString *p)
static void LoadConstants (LoadState *S, Proto *f)
static void LoadDebug (LoadState *S, Proto *f)
static void LoadHeader (LoadState *S)
ProtoluaU_undump (lua_State *L, ZIO *Z, Mbuffer *buff, const char *name)
void luaU_header (char *h)


Define Documentation

#define IF ( c,
s   )     if (c) error(S,s)

Definition at line 33 of file lundump.cpp.

Referenced by LoadBlock(), LoadConstants(), LoadFunction(), LoadHeader(), and LoadInt().

#define LoadByte (  )     (lu_byte)LoadChar(S)

Definition at line 43 of file lundump.cpp.

Referenced by LoadFunction().

#define LoadMem ( S,
b,
n,
size   )     LoadBlock(S,b,(n)*(size))

Definition at line 42 of file lundump.cpp.

#define LoadVar ( S,
x   )     LoadMem(S,&x,1,sizeof(x))

Definition at line 44 of file lundump.cpp.

Referenced by LoadChar(), LoadInt(), LoadNumber(), and LoadString().

#define LoadVector ( S,
b,
n,
size   )     LoadMem(S,b,n,size)

Definition at line 45 of file lundump.cpp.

Referenced by LoadCode(), and LoadDebug().

#define LUA_CORE

Definition at line 10 of file lundump.cpp.

#define lundump_c

Definition at line 9 of file lundump.cpp.


Function Documentation

static void error ( LoadState S,
const char *  why 
) [static]

Definition at line 35 of file lundump.cpp.

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

Referenced by LandVisibilityPatch::calculateErrors(), SoundSource::create(), Image::createResize(), Water2::generate(), LUAScriptHook::loadHook(), and SoundBufferWav::SoundBufferWav().

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

Definition at line 47 of file lundump.cpp.

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

Referenced by LoadHeader(), and LoadString().

static int LoadChar ( LoadState S  )  [static]

Definition at line 53 of file lundump.cpp.

References LoadVar.

Referenced by LoadConstants().

static void LoadCode ( LoadState S,
Proto f 
) [static]

Definition at line 89 of file lundump.cpp.

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

Referenced by LoadFunction().

static void LoadConstants ( LoadState S,
Proto f 
) [static]

Definition at line 99 of file lundump.cpp.

References IF, Proto::k, LoadState::L, LoadChar(), LoadFunction(), LoadInt(), LoadNumber(), LoadString(), LUA_TBOOLEAN, LUA_TNIL, LUA_TNUMBER, LUA_TSTRING, luaM_newvector, NULL, Proto::p, setbvalue, setnilvalue, setnvalue, setsvalue2n, Proto::sizek, Proto::sizep, and Proto::source.

Referenced by LoadFunction().

static void LoadDebug ( LoadState S,
Proto f 
) [static]

Definition at line 136 of file lundump.cpp.

References LocVar::endpc, LoadState::L, Proto::lineinfo, LoadInt(), LoadString(), LoadVector, Proto::locvars, luaM_newvector, NULL, Proto::sizelineinfo, Proto::sizelocvars, Proto::sizeupvalues, LocVar::startpc, Proto::upvalues, and LocVar::varname.

Referenced by LoadFunction().

static Proto * LoadFunction ( LoadState S,
TString p 
) [static]

Definition at line 160 of file lundump.cpp.

References IF, incr_top, Proto::is_vararg, LoadState::L, Proto::lastlinedefined, Proto::linedefined, LoadByte, LoadCode(), LoadConstants(), LoadDebug(), LoadInt(), LoadString(), luaF_newproto(), luaG_checkcode(), Proto::maxstacksize, NULL, Proto::numparams, Proto::nups, setptvalue2s, Proto::source, and lua_State::top.

Referenced by LoadConstants(), and luaU_undump().

static void LoadHeader ( LoadState S  )  [static]

Definition at line 179 of file lundump.cpp.

References IF, LoadBlock(), LUAC_HEADERSIZE, and luaU_header().

Referenced by luaU_undump().

static int LoadInt ( LoadState S  )  [static]

Definition at line 60 of file lundump.cpp.

References IF, and LoadVar.

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

static lua_Number LoadNumber ( LoadState S  )  [static]

Definition at line 68 of file lundump.cpp.

References LoadVar.

Referenced by LoadConstants().

static TString* LoadString ( LoadState S  )  [static]

Definition at line 75 of file lundump.cpp.

References LoadState::b, LoadState::L, LoadBlock(), LoadVar, luaS_newlstr(), luaZ_openspace(), and NULL.

Referenced by LoadConstants(), LoadDebug(), and LoadFunction().

void luaU_header ( char *  h  ) 

Definition at line 210 of file lundump.cpp.

Referenced by DumpHeader(), and LoadHeader().

Proto* luaU_undump ( lua_State L,
ZIO Z,
Mbuffer buff,
const char *  name 
)

Definition at line 191 of file lundump.cpp.

Referenced by f_parser().


Generated on Mon Feb 16 15:14:58 2009 for Scorched3D by  doxygen 1.5.3