LibTMJ  1.0.0
A library for loading JSON Tiled maps
Functions | Variables
decode.c File Reference
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include "decode.h"
#include "log.h"
Include dependency graph for decode.c:

Go to the source code of this file.

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...
 
size_t b64_decode_size (const char *data)
 Calculates the size of the data decoded from the given base64 string. More...
 
bool b64_is_valid_char (char c)
 
char * tmj_b64_encode (uint8_t *data)
 Unimplemented, but may be useful to implement in the future. More...
 
uint8_t * tmj_b64_decode (const char *data, size_t *decoded_size)
 Decodes a base64 string. More...
 

Variables

const char b64_encode_table [] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
 
const unsigned char b64_decode_table []
 

Function Documentation

◆ b64_decode_size()

size_t b64_decode_size ( const char *  data)

Calculates the size of the data decoded from the given base64 string.

Definition at line 246 of file decode.c.

Here is the caller graph for this function:

◆ b64_is_valid_char()

bool b64_is_valid_char ( char  c)

Definition at line 267 of file decode.c.

Here is the caller graph for this function:

◆ tmj_b64_encode()

char* tmj_b64_encode ( uint8_t *  data)

Unimplemented, but may be useful to implement in the future.

Definition at line 283 of file decode.c.

Variable Documentation

◆ b64_encode_table

const char b64_encode_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"

Definition at line 215 of file decode.c.

◆ b64_decode_table

const unsigned char b64_decode_table[]
Initial value:
= { 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 62, 255, 255, 255, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255,
255, 255, 255, 255, 255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 255, 255, 255, 255, 255, 255, 26,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
47, 48, 49, 50, 51, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, }

Definition at line 216 of file decode.c.