mcchunktools
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Data Structures | Typedefs | Enumerations | Functions
nbt.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include "buffer.h"
#include "list.h"
Include dependency graph for nbt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  nbt_node
 

Typedefs

typedef struct nbt_node nbt_node
 
typedef bool(* nbt_visitor_t )(nbt_node *node, void *aux)
 
typedef bool(* nbt_predicate_t )(const nbt_node *node, void *aux)
 

Enumerations

enum  nbt_status {
  NBT_OK = 0, NBT_ERR = -1, NBT_EMEM = -2, NBT_EIO = -3,
  NBT_EZ = -4
}
 
enum  nbt_type {
  TAG_INVALID = 0, TAG_BYTE = 1, TAG_SHORT = 2, TAG_INT = 3,
  TAG_LONG = 4, TAG_FLOAT = 5, TAG_DOUBLE = 6, TAG_BYTE_ARRAY = 7,
  TAG_STRING = 8, TAG_LIST = 9, TAG_COMPOUND = 10, TAG_INT_ARRAY = 11
}
 
enum  nbt_compression_strategy { STRAT_GZIP, STRAT_INFLATE }
 

Functions

nbt_nodenbt_parse_file (FILE *fp)
 
nbt_nodenbt_parse_path (const char *filename)
 
nbt_nodenbt_parse_compressed (const void *chunk_start, size_t length)
 
nbt_status nbt_dump_file (const nbt_node *tree, FILE *fp, nbt_compression_strategy)
 
struct buffer nbt_dump_compressed (const nbt_node *tree, nbt_compression_strategy)
 
nbt_nodenbt_parse (const void *memory, size_t length)
 
char * nbt_dump_ascii (const nbt_node *tree)
 
struct buffer nbt_dump_binary (const nbt_node *tree)
 
nbt_nodenbt_clone (nbt_node *)
 
void nbt_free (nbt_node *)
 
void nbt_free_list (struct nbt_list *)
 
bool nbt_map (nbt_node *tree, nbt_visitor_t, void *aux)
 
nbt_nodenbt_filter (const nbt_node *tree, nbt_predicate_t, void *aux)
 
nbt_nodenbt_filter_inplace (nbt_node *tree, nbt_predicate_t, void *aux)
 
nbt_nodenbt_find (nbt_node *tree, nbt_predicate_t, void *aux)
 
nbt_nodenbt_find_by_name (nbt_node *tree, const char *name)
 
nbt_nodenbt_find_by_path (nbt_node *tree, const char *path)
 
size_t nbt_size (const nbt_node *tree)
 
nbt_nodenbt_list_item (nbt_node *list, int n)
 
bool nbt_eq (const nbt_node *restrict a, const nbt_node *restrict b)
 
const char * nbt_type_to_string (nbt_type)
 
const char * nbt_error_to_string (nbt_status)
 

Typedef Documentation

typedef struct nbt_node nbt_node
typedef bool(* nbt_predicate_t)(const nbt_node *node, void *aux)

Definition at line 230 of file nbt.h.

typedef bool(* nbt_visitor_t)(nbt_node *node, void *aux)

Definition at line 223 of file nbt.h.

Enumeration Type Documentation

Enumerator
STRAT_GZIP 
STRAT_INFLATE 

Definition at line 50 of file nbt.h.

enum nbt_status
Enumerator
NBT_OK 
NBT_ERR 
NBT_EMEM 
NBT_EIO 
NBT_EZ 

Definition at line 26 of file nbt.h.

enum nbt_type
Enumerator
TAG_INVALID 
TAG_BYTE 
TAG_SHORT 
TAG_INT 
TAG_LONG 
TAG_FLOAT 
TAG_DOUBLE 
TAG_BYTE_ARRAY 
TAG_STRING 
TAG_LIST 
TAG_COMPOUND 
TAG_INT_ARRAY 

Definition at line 34 of file nbt.h.

Function Documentation

nbt_node* nbt_clone ( nbt_node )
char* nbt_dump_ascii ( const nbt_node tree)
struct buffer nbt_dump_binary ( const nbt_node tree)
struct buffer nbt_dump_compressed ( const nbt_node tree,
nbt_compression_strategy   
)
nbt_status nbt_dump_file ( const nbt_node tree,
FILE *  fp,
nbt_compression_strategy   
)
bool nbt_eq ( const nbt_node *restrict  a,
const nbt_node *restrict  b 
)
const char* nbt_error_to_string ( nbt_status  )
nbt_node* nbt_filter ( const nbt_node tree,
nbt_predicate_t  ,
void *  aux 
)
nbt_node* nbt_filter_inplace ( nbt_node tree,
nbt_predicate_t  ,
void *  aux 
)
nbt_node* nbt_find ( nbt_node tree,
nbt_predicate_t  ,
void *  aux 
)
nbt_node* nbt_find_by_name ( nbt_node tree,
const char *  name 
)
nbt_node* nbt_find_by_path ( nbt_node tree,
const char *  path 
)
void nbt_free ( nbt_node )
void nbt_free_list ( struct nbt_list *  )
nbt_node* nbt_list_item ( nbt_node list,
int  n 
)
bool nbt_map ( nbt_node tree,
nbt_visitor_t  ,
void *  aux 
)
nbt_node* nbt_parse ( const void *  memory,
size_t  length 
)
nbt_node* nbt_parse_compressed ( const void *  chunk_start,
size_t  length 
)
nbt_node* nbt_parse_file ( FILE *  fp)
nbt_node* nbt_parse_path ( const char *  filename)
size_t nbt_size ( const nbt_node tree)
const char* nbt_type_to_string ( nbt_type  )