Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
lundump.h File Reference
#include "lobject.h"
#include "lzio.h"

Go to the source code of this file.

Macros

#define LUAC_VERSION   0x51
 
#define LUAC_FORMAT   0
 
#define LUAC_HEADERSIZE   12
 

Functions

LUAI_FUNC ProtoluaU_undump (lua_State *L, ZIO *Z, Mbuffer *buff, const char *name)
 
LUAI_FUNC void luaU_header (char *h)
 
LUAI_FUNC int luaU_dump (lua_State *L, const Proto *f, lua_Writer w, void *data, int strip)
 

Macro Definition Documentation

◆ LUAC_FORMAT

#define LUAC_FORMAT   0

Definition at line 31 of file lua-5.1.5/src/lundump.h.

Referenced by checkHeader(), checkHeader(), DumpHeader(), dumpHeader(), and luaU_header().

◆ LUAC_HEADERSIZE

#define LUAC_HEADERSIZE   12

Definition at line 34 of file lua-5.1.5/src/lundump.h.

Referenced by DumpHeader(), DumpHeader(), LoadHeader(), and LoadHeader().

◆ LUAC_VERSION

#define LUAC_VERSION   0x51

Definition at line 28 of file lua-5.1.5/src/lundump.h.

Referenced by checkHeader(), checkHeader(), DumpHeader(), dumpHeader(), and luaU_header().

Function Documentation

◆ luaU_dump()

LUAI_FUNC int luaU_dump ( lua_State * L,
const Proto * f,
lua_Writer w,
void * data,
int strip )

Definition at line 153 of file lua-5.1.5/src/ldump.c.

154{
155 DumpState D;
156 D.L=L;
157 D.writer=w;
158 D.data=data;
159 D.strip=strip;
160 D.status=0;
161 DumpHeader(&D);
162 DumpFunction(f,NULL,&D);
163 return D.status;
164}
#define NULL
Definition gmacros.h:924
static void DumpHeader(DumpState *D)
static void DumpFunction(const Proto *f, const TString *p, DumpState *D)
lua_State * L
lua_Writer writer

◆ luaU_header()

LUAI_FUNC void luaU_header ( char * h)

Definition at line 214 of file lua-5.1.5/src/lundump.c.

215{
216 int x=1;
217 memcpy(h,LUA_SIGNATURE,sizeof(LUA_SIGNATURE)-1);
218 h+=sizeof(LUA_SIGNATURE)-1;
219 *h++=(char)LUAC_VERSION;
220 *h++=(char)LUAC_FORMAT;
221 *h++=(char)*(char*)&x; /* endianness */
222 *h++=(char)sizeof(int);
223 *h++=(char)sizeof(size_t);
224 *h++=(char)sizeof(Instruction);
225 *h++=(char)sizeof(lua_Number);
226 *h++=(char)(((lua_Number)0.5)==0); /* is lua_Number integral? */
227}
lu_int32 Instruction
LUA_NUMBER lua_Number
#define LUA_SIGNATURE
#define LUAC_FORMAT
#define LUAC_VERSION

References LUA_SIGNATURE, LUAC_FORMAT, and LUAC_VERSION.

Referenced by DumpHeader(), DumpHeader(), and LoadHeader().

◆ luaU_undump()

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

Definition at line 195 of file lua-5.1.5/src/lundump.c.

196{
197 LoadState S;
198 if (*name=='@' || *name=='=')
199 S.name=name+1;
200 else if (*name==LUA_SIGNATURE[0])
201 S.name="binary string";
202 else
203 S.name=name;
204 S.L=L;
205 S.Z=Z;
206 S.b=buff;
207 LoadHeader(&S);
208 return LoadFunction(&S,luaS_newliteral(L,"=?"));
209}
const char * name
Definition lsqlite3.c:2154
#define luaS_newliteral(L, s)
static void LoadHeader(LoadState *S)
static Proto * LoadFunction(LoadState *S, TString *p)
#define S(x)
Definition print.c:159
const char * name