Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
29 lines
1.1 KiB
C++
29 lines
1.1 KiB
C++
#ifndef _MINI_LZO_WRAPPER_H_
|
|
#define _MINI_LZO_WRAPPER_H_
|
|
|
|
#include "minilzo.h"
|
|
|
|
class CMiniLZOCompress
|
|
{
|
|
public:
|
|
|
|
inline static bool Compress(const char* in, unsigned long in_len, char* out, unsigned long* lp_out_len);
|
|
inline static bool Decompress(const char* in, unsigned long in_len, char* out, unsigned long* buffersize_in_out_len);
|
|
|
|
static bool TestMiniLZO();
|
|
};
|
|
|
|
inline bool CMiniLZOCompress::Compress(const char* in, unsigned long in_len, char* out, unsigned long* lp_out_len)
|
|
{
|
|
lzo_voidp wrkmem[LZO1X_1_MEM_COMPRESS]; // ½ºÅà ¹öÆÛ¸¦ »ç¿ëÇÑ´Ù.
|
|
return (LZO_E_OK == lzo1x_1_compress(reinterpret_cast<const lzo_byte*>(in), in_len,
|
|
reinterpret_cast<lzo_byte*>(out), reinterpret_cast<lzo_uintp>(lp_out_len), wrkmem));
|
|
}
|
|
|
|
inline bool CMiniLZOCompress::Decompress(const char* in, unsigned long in_len, char* out, unsigned long* buffersize_in_out_len)
|
|
{
|
|
return (LZO_E_OK == lzo1x_decompress_safe(reinterpret_cast<const lzo_byte*>(in), in_len,
|
|
reinterpret_cast<lzo_byte*>(out), reinterpret_cast<lzo_uintp>(buffersize_in_out_len), 0));
|
|
}
|
|
|
|
#endif |