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

Go to the source code of this file.

Macros

#define LUAC_DATA   "\x19\x93\r\n\x1a\n"
 
#define LUAC_INT   0x5678
 
#define LUAC_NUM   cast_num(370.5)
 
#define MYINT(s)   (s[0]-'0')
 
#define LUAC_VERSION   (MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR))
 
#define LUAC_FORMAT   0 /* this is the official format */
 

Functions

LUAI_FUNC LClosureluaU_undump (lua_State *L, ZIO *Z, const char *name)
 
LUAI_FUNC int luaU_dump (lua_State *L, const Proto *f, lua_Writer w, void *data, int strip)
 

Macro Definition Documentation

◆ LUAC_DATA

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

◆ LUAC_FORMAT

#define LUAC_FORMAT   0 /* this is the official format */

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

◆ LUAC_INT

#define LUAC_INT   0x5678

Definition at line 18 of file lua-5.3.6/src/lundump.h.

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

◆ LUAC_NUM

#define LUAC_NUM   cast_num(370.5)

Definition at line 19 of file lua-5.3.6/src/lundump.h.

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

◆ LUAC_VERSION

#define LUAC_VERSION   (MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR))

Definition at line 22 of file lua-5.3.6/src/lundump.h.

◆ MYINT

#define MYINT ( s)    (s[0]-'0')

Definition at line 21 of file lua-5.3.6/src/lundump.h.

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_undump()

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

Definition at line 265 of file lua-5.3.6/src/lundump.c.

265 {
266 LoadState S;
267 LClosure *cl;
268 if (*name == '@' || *name == '=')
269 S.name = name + 1;
270 else if (*name == LUA_SIGNATURE[0])
271 S.name = "binary string";
272 else
273 S.name = name;
274 S.L = L;
275 S.Z = Z;
276 checkHeader(&S);
277 cl = luaF_newLclosure(L, LoadByte(&S));
278 setclLvalue(L, L->top, cl);
279 luaD_inctop(L);
280 cl->p = luaF_newproto(L);
281 luaC_objbarrier(L, cl, cl->p);
282 LoadFunction(&S, cl->p, NULL);
283 lua_assert(cl->nupvalues == cl->p->sizeupvalues);
284 luai_verifycode(L, buff, cl->p);
285 return cl;
286}
const char * name
Definition lsqlite3.c:2154
Proto * luaF_newproto(lua_State *L)
Closure * luaF_newLclosure(lua_State *L, int nelems, Table *e)
#define luaC_objbarrier(L, p, o)
#define lua_assert(c)
#define LUA_SIGNATURE
#define LoadByte(S)
#define setclLvalue(L, obj, x)
void luaD_inctop(lua_State *L)
#define luai_verifycode(L, b, f)
static void LoadFunction(LoadState *S, Proto *f, TString *psource)
static void checkHeader(LoadState *S)
#define S(x)
Definition print.c:159
struct Proto * p