aboutsummaryrefslogtreecommitdiff
path: root/include/value.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/value.h')
-rw-r--r--include/value.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/include/value.h b/include/value.h
new file mode 100644
index 0000000..1d053b7
--- /dev/null
+++ b/include/value.h
@@ -0,0 +1,49 @@
+#ifndef TSL_VALUE_H
+#define TSL_VALUE_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+typedef enum {
+ TSL_TYPE_NULL,
+ TSL_TYPE_NUMBER,
+ TSL_TYPE_STRING,
+ TSL_TYPE_BOOL,
+ TSL_TYPE_LIST,
+ TSL_TYPE_MAP,
+ TSL_TYPE_USERDATA
+} TslType;
+
+typedef enum {
+ TSL_FALSE,
+ TSL_TRUE
+} TslBool;
+
+typedef struct {
+ char *data;
+ size_t size;
+} TslString;
+
+/* TODO: Implement this */
+typedef struct {
+ void *data;
+} TslList;
+
+/* TODO: Implement this */
+typedef struct {
+ void *data;
+} TslMap;
+
+typedef struct {
+ union {
+ double number;
+ TslString *string;
+ TslBool boolean;
+ TslList *list;
+ TslMap *map;
+ void *userdata;
+ } data;
+ uint8_t type;
+} TslValue;
+
+#endif /* TSL_VALUE_H */