aboutsummaryrefslogtreecommitdiff
path: root/include/value.h
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-01-24 09:11:53 +0100
committerdec05eba <dec05eba@protonmail.com>2020-01-24 09:11:53 +0100
commit1dd53ce54c2008e3a11a636a496853cf6f9a5d65 (patch)
tree73f8ff8d048c8b1e4c6cf7acfd3e229650d044d5 /include/value.h
parent26f8fbc2c657ecffc874410691dd3fc83ba11131 (diff)
Convert hash map to gc, implement more instructions and call command
Diffstat (limited to 'include/value.h')
-rw-r--r--include/value.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/value.h b/include/value.h
index 58e57fe..e26cc4a 100644
--- a/include/value.h
+++ b/include/value.h
@@ -3,11 +3,13 @@
#include <stddef.h>
#include <stdint.h>
+#include "string_view.h"
typedef enum {
TSL_TYPE_NULL,
TSL_TYPE_NUMBER,
TSL_TYPE_STRING,
+ TSL_TYPE_STRING_VIEW,
TSL_TYPE_BOOL,
TSL_TYPE_LIST,
TSL_TYPE_MAP,
@@ -23,13 +25,14 @@ typedef enum {
} TslBool;
typedef struct {
- char *data;
+ uint8_t *data;
size_t size;
} TslString;
/* TODO: Implement this */
typedef struct {
void *data;
+ size_t size;
} TslList;
/* TODO: Implement this */
@@ -41,6 +44,7 @@ typedef struct {
union {
TslNumber number;
TslString *string;
+ TslStringView string_view;
TslBool boolean;
TslList *list;
TslMap *map;
@@ -49,4 +53,8 @@ typedef struct {
uint8_t type;
} TslValue;
+uint64_t tsl_value_hash(const TslValue *value);
+/* Returns 1 if equal, otherwise returns 0 */
+int tsl_value_equals(const TslValue *lhs, const TslValue *rhs);
+
#endif /* TSL_VALUE_H */