diff options
Diffstat (limited to '')
-rw-r--r-- | nbt/nbt.h (renamed from src/tag.h) | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -1,14 +1,13 @@ -#pragma once - -#include "stream.h" -#include "map.h" +#pragma once #include <stdint.h> #include <stdbool.h> #include <arpa/inet.h> -#include <string.h> #include <unistd.h> +#include "map.h" +#include "stream.h" + typedef enum: int8_t { TAG_END = 0, TAG_BYTE = 1, @@ -25,8 +24,6 @@ typedef enum: int8_t { TAG_LONG_ARRAY = 12 } tagtype_t ; -struct tag_t; - typedef union { int8_t b; int16_t s; @@ -72,6 +69,16 @@ typedef enum { } format_t; void tag_free(tag_t *tag); + bool tag_read(tag_t *tag, const stream_t *stream, format_t format); bool tag_print(tag_t *tag, const stream_t *stream, format_t format); +bool json_read(tag_t *tag, const stream_t *stream); +bool json_print(const tag_t *tag, const stream_t *stream); + +bool nbt_read(tag_t *tag, const stream_t *stream); +bool nbt_print(const tag_t *tag, const stream_t *stream); + +bool snbt_read(tag_t *tag, const stream_t *stream); +bool snbt_print(const tag_t *tag, const stream_t *stream); +bool snbt_allowed_ident(char c); |