Minetest  5.4.0
serialization.cpp File Reference
#include "serialization.h"
#include "util/serialize.h"
#include "zlib.h"
+ Include dependency graph for serialization.cpp:

Functions

void zerr (int ret)
 
void compressZlib (const u8 *data, size_t data_size, std::ostream &os, int level)
 
void compressZlib (const std::string &data, std::ostream &os, int level)
 
void decompressZlib (std::istream &is, std::ostream &os, size_t limit)
 
void compress (const SharedBuffer< u8 > &data, std::ostream &os, u8 version)
 
void decompress (std::istream &is, std::ostream &os, u8 version)
 

Function Documentation

◆ compress()

void compress ( const SharedBuffer< u8 > &  data,
std::ostream &  os,
u8  version 
)

References compressZlib(), SharedBuffer< T >::getSize(), and writeU32().

Referenced by ModApiUtil::Initialize(), ModApiUtil::InitializeAsync(), ModApiUtil::InitializeClient(), TestCompression::testRLECompression(), and TestCompression::testZlibCompression().

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

◆ compressZlib() [1/2]

void compressZlib ( const std::string &  data,
std::ostream &  os,
int  level 
)

References compressZlib().

+ Here is the call graph for this function:

◆ compressZlib() [2/2]

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

References zerr().

Referenced by TestCompression::_testZlibLimit(), compress(), compressZlib(), ModApiUtil::l_compress(), Server::SendItemDef(), Server::sendMetadataChanged(), Server::SendNodeDef(), MapBlock::serialize(), MapNode::serializeBulk(), and TestCompression::testZlibLargeData().

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

◆ decompress()

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

References decompressZlib(), and readU32().

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

+ 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(), MapBlock::deSerialize_pre22(), MapNode::deSerializeBulk(), Client::handleCommand_ItemDef(), Client::handleCommand_NodeDef(), Client::handleCommand_NodemetaChanged(), ModApiUtil::l_decompress(), and TestCompression::testZlibLargeData().

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

◆ zerr()

void zerr ( int  ret)

References dstream.

Referenced by compressZlib(), and decompressZlib().

+ Here is the caller graph for this function: