aboutsummaryrefslogtreecommitdiff
path: root/include/value.h
diff options
context:
space:
mode:
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 */