diff options
author | Freya Murphy <freya@freyacat.org> | 2023-12-17 11:10:04 -0500 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2023-12-17 11:10:04 -0500 |
commit | e0eacfa9773c83850ed5169d1e889ff845180581 (patch) | |
tree | 9f8bb433404ce7e4dda1b86ca4dd5d5a2fba10e9 /nbt/nbt.h | |
parent | snbt (diff) | |
download | nbtvis-main.tar.gz nbtvis-main.tar.bz2 nbtvis-main.zip |
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); |