Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
c_packer.h File Reference
#include <string>
#include <vector>
#include "irrlichttypes.h"
#include "util/basic_macros.h"
#include <lua.h>
+ Include dependency graph for c_packer.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  PackedInstr
 Represents a single instruction that pushes a new value or operates with existing ones. More...
 
struct  PackedValue
 A packed value can be a primitive like a string or number but also a table including all of its contents. More...
 

Macros

#define INSTR_SETTABLE   (-10)
 
#define INSTR_POP   (-11)
 
#define INSTR_PUSHREF   (-12)
 
#define INSTR_SETMETATABLE   (-13)
 

Typedefs

typedef void *(* PackInFunc) (lua_State *L, int idx)
 
typedef void(* PackOutFunc) (lua_State *L, void *ptr)
 

Functions

void script_register_packer (lua_State *L, const char *regname, PackInFunc fin, PackOutFunc fout)
 
PackedValuescript_pack (lua_State *L, int idx)
 
void script_unpack (lua_State *L, PackedValue *val)
 
void script_dump_packed (const PackedValue *val)
 

Macro Definition Documentation

◆ INSTR_POP

#define INSTR_POP   (-11)

◆ INSTR_PUSHREF

#define INSTR_PUSHREF   (-12)

◆ INSTR_SETMETATABLE

#define INSTR_SETMETATABLE   (-13)

◆ INSTR_SETTABLE

#define INSTR_SETTABLE   (-10)

Typedef Documentation

◆ PackInFunc

typedef void *(* PackInFunc) (lua_State *L, int idx)

◆ PackOutFunc

typedef void(* PackOutFunc) (lua_State *L, void *ptr)

Function Documentation

◆ script_dump_packed()

void script_dump_packed ( const PackedValue val)

References FATAL_ERROR, PackedValue::i, INSTR_POP, INSTR_PUSHREF, INSTR_SETMETATABLE, INSTR_SETTABLE, and uses_sdata().

Referenced by ModApiServer::l_serialize_roundtrip().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ script_pack()

PackedValue * script_pack ( lua_State *  L,
int  idx 
)

References absidx(), idx, and pack_inner().

Referenced by ModApiServer::l_do_async_callback(), ModApiServer::l_serialize_roundtrip(), AsyncWorkerThread::run(), and ServerScripting::saveGlobals().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ script_register_packer()

void script_register_packer ( lua_State *  L,
const char *  regname,
PackInFunc  fin,
PackOutFunc  fout 
)

References CUSTOM_RIDX_METATABLE_MAP, FATAL_ERROR_IF, g_packers, and g_packers_lock.

Referenced by LuaItemStack::Register(), LuaPerlinNoise::Register(), LuaPerlinNoiseMap::Register(), and LuaVoxelManip::Register().

+ Here is the caller graph for this function:

◆ script_unpack()

void script_unpack ( lua_State *  L,
PackedValue val 
)

References PackedValue::contains_userdata, find_packer(), get_known_lua_metatables(), PackedValue::i, INSTR_POP, INSTR_PUSHREF, INSTR_SETMETATABLE, INSTR_SETTABLE, sanity_check, and uses_sdata().

Referenced by EmergeScripting::EmergeScripting(), ServerScripting::InitializeAsync(), ModApiServer::l_serialize_roundtrip(), AsyncWorkerThread::run(), and AsyncEngine::stepJobResults().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: