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_TAIL   "\x19\x93\r\n\x1a\n"
 
#define LUAC_HEADERSIZE   (sizeof(LUA_SIGNATURE)-sizeof(char)+2+6+sizeof(LUAC_TAIL)-sizeof(char))
 

Functions

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

Macro Definition Documentation

◆ LUAC_HEADERSIZE

#define LUAC_HEADERSIZE   (sizeof(LUA_SIGNATURE)-sizeof(char)+2+6+sizeof(LUAC_TAIL)-sizeof(char))

Definition at line 26 of file lua-5.2.4/src/lundump.h.

◆ LUAC_TAIL

#define LUAC_TAIL   "\x19\x93\r\n\x1a\n"

Definition at line 23 of file lua-5.2.4/src/lundump.h.

Referenced by 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 ( lu_byte * h)

Definition at line 244 of file lua-5.2.4/src/lundump.c.

245{
246 int x=1;
247 memcpy(h,LUA_SIGNATURE,sizeof(LUA_SIGNATURE)-sizeof(char));
248 h+=sizeof(LUA_SIGNATURE)-sizeof(char);
249 *h++=cast_byte(VERSION);
250 *h++=cast_byte(FORMAT);
251 *h++=cast_byte(*(char*)&x); /* endianness */
252 *h++=cast_byte(sizeof(int));
253 *h++=cast_byte(sizeof(size_t));
254 *h++=cast_byte(sizeof(Instruction));
255 *h++=cast_byte(sizeof(lua_Number));
256 *h++=cast_byte(((lua_Number)0.5)==0); /* is lua_Number integral? */
257 memcpy(h,LUAC_TAIL,sizeof(LUAC_TAIL)-sizeof(char));
258}
lu_int32 Instruction
#define cast_byte(i)
LUA_NUMBER lua_Number
#define LUA_SIGNATURE
#define VERSION
#define FORMAT
#define LUAC_TAIL

References cast_byte, FORMAT, LUA_SIGNATURE, LUAC_TAIL, and VERSION.

Referenced by LoadHeader().

◆ luaU_undump()

LUAI_FUNC Closure * 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

References incr_top, Closure::l, LoadFunction(), LoadFunction(), LoadHeader(), LoadHeader(), LUA_SIGNATURE, luaF_newLclosure(), luaF_newproto(), luai_verifycode, luaS_newliteral, name, LoadState::name, LClosure::p, S, setclLvalue, Proto::sizeupvalues, and lua_State::top.

Referenced by f_parser(), f_parser(), f_parser(), and f_parser().