-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnbt.h
40 lines (30 loc) · 1.02 KB
/
nbt.h
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef MCMAP_NBT_H
#define MCMAP_NBT_H 1
enum nbt_tag_type
{
NBT_TAG_END = 0,
NBT_TAG_BYTE = 1,
NBT_TAG_SHORT = 2,
NBT_TAG_INT = 3,
NBT_TAG_LONG = 4,
NBT_TAG_FLOAT = 5,
NBT_TAG_DOUBLE = 6,
NBT_TAG_BLOB = 7,
NBT_TAG_STR = 8,
NBT_TAG_ARRAY = 9,
NBT_TAG_STRUCT = 10
};
struct nbt_tag;
struct nbt_tag *nbt_new_int(char *name, enum nbt_tag_type type, jint intv);
struct nbt_tag *nbt_new_long(char *name, jlong longv);
struct nbt_tag *nbt_new_double(char *name, enum nbt_tag_type type, double doublev);
struct nbt_tag *nbt_new_blob(char *name, enum nbt_tag_type type, const void *data, size_t len);
struct nbt_tag *nbt_new_str(char *name, const char *str);
struct nbt_tag *nbt_new_struct(char *name);
void nbt_free(gpointer tag);
struct buffer nbt_blob(struct nbt_tag *s);
struct nbt_tag *nbt_struct_field(struct nbt_tag *s, const char *name);
void nbt_struct_add(struct nbt_tag *s, struct nbt_tag *field);
struct buffer nbt_compress(struct nbt_tag *tag);
struct nbt_tag *nbt_uncompress(struct buffer buf);
#endif /* MCMAP_NBT_H */