2023-04-04 15:24:25 -04:00
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// This module contains routines to serialize and deserialize
|
|
|
|
|
// lua data structures. These routines can handle cyclic data
|
|
|
|
|
// structures.
|
|
|
|
|
//
|
|
|
|
|
// These routines are used for some specific difference
|
|
|
|
|
// transmission cases, but they're not the heart of the lua
|
|
|
|
|
// difference transmission system.
|
|
|
|
|
//
|
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
2026-02-25 01:58:19 -05:00
|
|
|
#pragma once
|
2023-04-04 15:24:25 -04:00
|
|
|
|
|
|
|
|
#include "luastack.hpp"
|
|
|
|
|
#include "streambuffer.hpp"
|
|
|
|
|
|
|
|
|
|
// serialize_lua
|
|
|
|
|
//
|
|
|
|
|
// Serialize a value from the LuaSlot and store it in the StreamBuffer.
|
|
|
|
|
// On success, returns empty string.
|
|
|
|
|
//
|
|
|
|
|
// If there is an error, returns an error message. In this case, the
|
|
|
|
|
// streambuffer contains garbage.
|
|
|
|
|
//
|
2023-04-06 20:12:03 -04:00
|
|
|
eng::string serialize_lua(LuaCoreStack &LS0, LuaSlot val, StreamBuffer *sb);
|
2023-04-04 15:24:25 -04:00
|
|
|
|
|
|
|
|
// deserialize_lua
|
|
|
|
|
//
|
|
|
|
|
// Deserialize a value from the StreamBuffer and store it in the LuaSlot.
|
|
|
|
|
// On success, returns empty string.
|
|
|
|
|
//
|
|
|
|
|
// If there is an error, returns an error message. In this case, the
|
|
|
|
|
// streambuffer is likely only partially consumed.
|
|
|
|
|
//
|
2023-04-06 20:12:03 -04:00
|
|
|
eng::string deserialize_lua(LuaCoreStack &LS0, LuaSlot val, StreamBuffer *sb);
|