LibTMJ
1.0.0
A library for loading JSON Tiled maps
|
Encoding/decoding routines. More...
Functions | |
uint8_t * | tmj_zstd_decompress (const uint8_t *data, size_t data_size, size_t *decompressed_size) |
Decompresses a zstd-compressed buffer of bytes. More... | |
uint8_t * | tmj_zlib_decompress (const uint8_t *data, size_t data_size, size_t *decompressed_size) |
Decompresses a zlib/gzip-compressed buffer of bytes. More... | |
uint8_t * | tmj_b64_decode (const char *data, size_t *decoded_size) |
Decodes a base64 string. More... | |
Encoding/decoding routines.
uint8_t* tmj_zstd_decompress | ( | const uint8_t * | data, |
size_t | data_size, | ||
size_t * | decompressed_size | ||
) |
Decompresses a zstd-compressed buffer of bytes.
This routine does not use streaming decompression, so the given buffer must have a frame header that includes the content size. See https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#frame_header for detail.
data | A zstd-compressed buffer of unsigned bytes. The zstd frame header for this buffer must include the content size. | |
data_size | The length of the buffer. | |
[out] | decompressed_size | The length of the returned decompressed buffer. |
Definition at line 10 of file decode.c.
uint8_t* tmj_zlib_decompress | ( | const uint8_t * | data, |
size_t | data_size, | ||
size_t * | decompressed_size | ||
) |
Decompresses a zlib/gzip-compressed buffer of bytes.
data | A zlib/gzip-compressed buffer of unsigned bytes. | |
data_size | The length of the buffer. | |
[out] | decompressed_size | The length of the returned decompressed buffer. |
Definition at line 62 of file decode.c.
uint8_t* tmj_b64_decode | ( | const char * | data, |
size_t * | decoded_size | ||
) |
Decodes a base64 string.
data | A null-terminated base64 string. | |
[out] | decoded_size | The length of the returned decoded buffer. |
Definition at line 287 of file decode.c.