libclod
C library for interacting with NBTs, region files, LOD data and other things.
Loading...
Searching...
No Matches
nbt.h File Reference
#include <clod/lib.h>
#include <clod/string.h>
#include <stdint.h>
#include <stddef.h>

Go to the source code of this file.

Classes

struct  clod_nbt_iter

Macros

#define CLOD_NBT_ZERO   (uint8_t)(0)
#define CLOD_NBT_INT8   (uint8_t)(1)
#define CLOD_NBT_INT16   (uint8_t)(2)
#define CLOD_NBT_INT32   (uint8_t)(3)
#define CLOD_NBT_INT64   (uint8_t)(4)
#define CLOD_NBT_FLOAT32   (uint8_t)(5)
#define CLOD_NBT_FLOAT64   (uint8_t)(6)
#define CLOD_NBT_INT8_ARRAY   (uint8_t)(7)
#define CLOD_NBT_INT32_ARRAY   (uint8_t)(11)
#define CLOD_NBT_INT64_ARRAY   (uint8_t)(12)
#define CLOD_NBT_STRING   (uint8_t)(8)
#define CLOD_NBT_LIST   (uint8_t)(9)
#define CLOD_NBT_COMPOUND   (uint8_t)(10)
#define CLOD_NBT_ROOT_COMPOUND_INIT   ((uint8_t[]){CLOD_NBT_COMPOUND, 0, 0, 0})
#define CLOD_NBT_ROOT_LIST_INIT(type)
#define CLOD_NBT_ITER_ZERO   { .type = CLOD_NBT_ZERO }

Functions

size_t clod_nbt_payload_size (const uint8_t *restrict payload, const void *end, uint8_t payload_type)
size_t clod_nbt_tag_size (const uint8_t *restrict tag, const void *end)
uint8_t * clod_nbt_tag_payload (const uint8_t *restrict tag, const void *end)
struct clod_string clod_nbt_tag_name (const uint8_t *tag, const void *end)
bool clod_nbt_iter_next (const uint8_t *restrict payload, const void *end, uint8_t payload_type, struct clod_nbt_iter *iter)
uint8_t * clod_nbt_compound_get (const uint8_t *restrict compound, const void *end, struct clod_string name)
uint8_t * clod_nbt_compound_add (uint8_t *restrict compound, const void **end, ptrdiff_t *free, struct clod_string name, uint8_t type)
bool clod_nbt_compound_del (uint8_t *restrict compound, const void **end, ptrdiff_t *free, struct clod_string name)
bool clod_nbt_list_resize (uint8_t *restrict list, const uint8_t **end, ptrdiff_t *free, uint8_t type, uint32_t length)