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/big_endian.h>
#include <clod/sstr.h>
#include <stddef.h>

Go to the source code of this file.

Classes

struct  clod_nbt_iter

Macros

#define CLOD_NBT_ZERO   (char)(0)
#define CLOD_NBT_INT8   (char)(1)
#define CLOD_NBT_INT16   (char)(2)
#define CLOD_NBT_INT32   (char)(3)
#define CLOD_NBT_INT64   (char)(4)
#define CLOD_NBT_FLOAT32   (char)(5)
#define CLOD_NBT_FLOAT64   (char)(6)
#define CLOD_NBT_INT8_ARRAY   (char)(7)
#define CLOD_NBT_INT32_ARRAY   (char)(11)
#define CLOD_NBT_INT64_ARRAY   (char)(12)
#define CLOD_NBT_STRING   (char)(8)
#define CLOD_NBT_LIST   (char)(9)
#define CLOD_NBT_COMPOUND   (char)(10)
#define CLOD_NBT_ROOT_COMPOUND_INIT   ((char[]){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 char *restrict payload, const void *end, char payload_type)
size_t clod_nbt_tag_size (const char *restrict tag, const void *end)
char * clod_nbt_tag_payload (const char *restrict tag, const void *end)
clod_sstr clod_nbt_tag_name (const char *tag, const void *end)
bool clod_nbt_iter_next (const char *restrict payload, const void *end, char payload_type, struct clod_nbt_iter *iter)
char * clod_nbt_compound_get (const char *restrict compound, const void *end, clod_sstr name)
char * clod_nbt_compound_add (char *restrict compound, const void **end, ptrdiff_t *free, clod_sstr name, char type)
bool clod_nbt_compound_del (char *restrict compound, const void **end, ptrdiff_t *free, clod_sstr name)
bool clod_nbt_list_resize (char *restrict list, const char **end, ptrdiff_t *free, char type, uint32_t length)