aboutsummaryrefslogtreecommitdiff
path: root/src/vdf/vdf.h
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2022-06-29 18:35:24 +0200
committerJan200101 <sentrycraft123@gmail.com>2022-06-29 18:35:24 +0200
commitd89a23076329c7fb8dd259fa4ef4c354d22a457e (patch)
tree52c7f50d2bae2ff487aae3e5f7d8b856aeff9762 /src/vdf/vdf.h
parente8cac02fb846428c86b4fe19038893b4fb040af2 (diff)
downloadOFQT-d89a23076329c7fb8dd259fa4ef4c354d22a457e.tar.gz
OFQT-d89a23076329c7fb8dd259fa4ef4c354d22a457e.zip
remove unimportant vdf data types, make vdf failure more transparent
Diffstat (limited to 'src/vdf/vdf.h')
-rw-r--r--src/vdf/vdf.h35
1 files changed, 11 insertions, 24 deletions
diff --git a/src/vdf/vdf.h b/src/vdf/vdf.h
index d9755da..cf44c9c 100644
--- a/src/vdf/vdf.h
+++ b/src/vdf/vdf.h
@@ -13,11 +13,7 @@ enum vdf_data_type
VDF_TYPE_NONE,
VDF_TYPE_ARRAY,
VDF_TYPE_STRING,
- VDF_TYPE_INT,
- VDF_TYPE_FLOAT,
- VDF_TYPE_PTR,
- VDF_TYPE_WSTRING,
- VDF_TYPE_COLOR
+ VDF_TYPE_INT
};
struct vdf_object;
@@ -33,17 +29,7 @@ union vdf_data {
size_t len;
} data_string;
- int data_int;
- float data_float;
-
- void* data_ptr; // TYPE?
-
- struct {
- wchar_t* str;
- size_t len;
- } data_wstring;
-
- uint32_t color; // RGBA
+ int64_t data_int;
};
struct vdf_object
@@ -55,18 +41,19 @@ struct vdf_object
union vdf_data data;
};
-struct vdf_object* vdf_parse_file(const char* path);
+struct vdf_object* vdf_parse_buffer(const char*, size_t);
+struct vdf_object* vdf_parse_file(const char*);
-size_t vdf_object_get_array_length(struct vdf_object* o);
-struct vdf_object* vdf_object_index_array(struct vdf_object* o, size_t index);
-struct vdf_object* vdf_object_index_array_str(struct vdf_object* o, char* str);
+size_t vdf_object_get_array_length(struct vdf_object*);
+struct vdf_object* vdf_object_index_array(struct vdf_object*, size_t);
+struct vdf_object* vdf_object_index_array_str(struct vdf_object*, char*);
-const char* vdf_object_get_string(struct vdf_object* o);
+const char* vdf_object_get_string(struct vdf_object*);
-int vdf_object_get_int(struct vdf_object* o);
+int vdf_object_get_int(struct vdf_object*);
-void vdf_print_object(struct vdf_object* o);
-void vdf_free_object(struct vdf_object* o);
+void vdf_print_object(struct vdf_object*);
+void vdf_free_object(struct vdf_object*);
#ifdef __cplusplus
}