From e0eacfa9773c83850ed5169d1e889ff845180581 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Sun, 17 Dec 2023 11:10:04 -0500 Subject: refactor --- src/tag.h | 77 --------------------------------------------------------------- 1 file changed, 77 deletions(-) delete mode 100644 src/tag.h (limited to 'src/tag.h') diff --git a/src/tag.h b/src/tag.h deleted file mode 100644 index 81d1950..0000000 --- a/src/tag.h +++ /dev/null @@ -1,77 +0,0 @@ -#pragma once - -#include "stream.h" -#include "map.h" - -#include -#include -#include -#include -#include - -typedef enum: int8_t { - TAG_END = 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, - TAG_LONG_ARRAY = 12 -} tagtype_t ; - -struct tag_t; - -typedef union { - int8_t b; - int16_t s; - int32_t i; - int64_t l; - float f; - double d; - struct { - int32_t size; - int8_t *data; - } b_arr; - struct { - uint16_t size; - char *data; - } string; - struct { - tagtype_t type; - int32_t size; - struct tag_t *tags; - } list; - map_t compound; - struct { - int32_t size; - int32_t *data; - } i_arr; - struct { - int32_t size; - int64_t *data; - } l_arr; -} tagdata_t; - -typedef struct tag_t { - tagtype_t type; - tagdata_t data; - uint16_t name_len; - char *name; -} tag_t; - -typedef enum { - JSON, - NBT, - SNBT -} 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); - -- cgit v1.2.3-freya