Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
serialization.cpp File Reference
#include "serialization.h"
#include "log.h"
#include "util/serialize.h"
#include <zlib.h>
#include <zstd.h>
#include <memory>
+ Include dependency graph for serialization.cpp:

Classes

class  ZlibAutoDeleter< F >
 
struct  ZSTD_Deleter
 

Functions

static void zerr (int ret)
 
void compressZlib (const u8 *data, size_t data_size, std::ostream &os, int level)
 
void decompressZlib (std::istream &is, std::ostream &os, size_t limit)
 
void compressZstd (const u8 *data, size_t data_size, std::ostream &os, int level)
 
void decompressZstd (std::istream &is, std::ostream &os)
 
void compress (const u8 *data, u32 size, std::ostream &os, u8 version, int level)
 
void decompress (std::istream &is, std::ostream &os, u8 version)
 

Function Documentation

◆ compress()

void compress ( const u8 * data,
u32 size,
std::ostream & os,
u8 version,
int level )

References compressZlib(), compressZstd(), and writeU32().

Referenced by compress(), ModApiUtil::Initialize(), ModApiUtil::InitializeAsync(), ModApiUtil::InitializeClient(), MapBlock::serialize(), Schematic::serializeToMts(), and TestCompression::testRLECompression().

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

◆ compressZlib()

void compressZlib ( const u8 * data,
size_t data_size,
std::ostream & os,
int level )

References zerr().

Referenced by TestCompression::_testZlibLimit(), compress(), compressZlib(), encodePNG(), ModApiUtil::l_compress(), Server::SendItemDef(), Server::sendMetadataChanged(), Server::SendNodeDef(), TestCompression::testZlibCompression(), and TestCompression::testZlibLargeData().

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

◆ compressZstd()

void compressZstd ( const u8 * data,
size_t data_size,
std::ostream & os,
int level )

References dstream.

Referenced by compress(), compressZstd(), ModApiUtil::l_compress(), and TestCompression::testZstdLargeData().

+ Here is the caller graph for this function:

◆ decompress()

void decompress ( std::istream & is,
std::ostream & os,
u8 version )

References decompressZlib(), decompressZstd(), and readU32().

Referenced by MapBlock::deSerialize(), MapBlock::deSerialize_pre22(), Schematic::deserializeFromMts(), ModApiUtil::Initialize(), ModApiUtil::InitializeAsync(), ModApiUtil::InitializeClient(), and TestCompression::testRLECompression().

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

◆ decompressZlib()

void decompressZlib ( std::istream & is,
std::ostream & os,
size_t limit )

References dstream, and zerr().

Referenced by TestCompression::_testZlibLimit(), decompress(), MapBlock::deSerialize_pre22(), Client::handleCommand_ItemDef(), Client::handleCommand_NodeDef(), Client::handleCommand_NodemetaChanged(), ModApiUtil::l_decompress(), TestCompression::testZlibCompression(), and TestCompression::testZlibLargeData().

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

◆ decompressZstd()

void decompressZstd ( std::istream & is,
std::ostream & os )

References dstream.

Referenced by decompress(), ModApiUtil::l_decompress(), TestMapBlock::testSave29(), and TestCompression::testZstdLargeData().

+ Here is the caller graph for this function:

◆ zerr()

static void zerr ( int ret)
static

References dstream.

Referenced by compressZlib(), and decompressZlib().

+ Here is the caller graph for this function: