Add dict type

This commit is contained in:
2022-08-14 18:18:34 +03:00
parent 2ad4665e17
commit aa4828b4ed
15 changed files with 1222 additions and 177 deletions
+8
View File
@@ -57,17 +57,24 @@ typedef vtype_array arr_t;
typedef vtype_list list_t;
typedef vtype_map map_t;
typedef vtype_set set_t;
typedef vtype_dict dict_t;
typedef vtype_hash hash_t;
extern int libcdsb_vtype_compare_values(const void* s0, vtype t0, const void* s1, vtype t1);
extern int libcdsb_vtype_compare_values_eq(const void* s0, const void* s1, vtype t);
extern hash_t libcdsb_vtype_hash(void* value, vtype type);
#define vtype_stringify libcdsb_vtype_stringify
#define vtype_name libcdsb_vtype_name
#define vtype_compare libcdsb_vtype_compare_values
#define vtype_compare_eq libcdsb_vtype_compare_values_eq
#define vtype_hash libcdsb_vtype_hash
#define vtype_size(type) (LIBCDSB_VTYPE_SIZES[type])
#define vtypeof(x) (vtype)(_Generic((x),\
@@ -78,6 +85,7 @@ extern int libcdsb_vtype_compare_values_eq(const void* s0, const void* s1, vtype
const list_t*: VTYPE_LIST, list_t*: VTYPE_LIST, list_t: VTYPE_LIST,\
const map_t*: VTYPE_MAP, map_t*: VTYPE_MAP, map_t: VTYPE_MAP,\
const set_t*: VTYPE_SET, set_t*: VTYPE_SET, set_t: VTYPE_SET,\
const dict_t*: VTYPE_DICT, dict_t*: VTYPE_DICT, dict_t: VTYPE_DICT,\
const vtype_bool*: VTYPE_BOOLEAN, vtype_bool*: VTYPE_BOOLEAN, vtype_bool: VTYPE_BOOLEAN,\
const vtype_uint8*: VTYPE_UINT8, vtype_uint8*: VTYPE_UINT8, vtype_uint8: VTYPE_UINT8,\
const vtype_uint16*: VTYPE_UINT16, vtype_uint16*: VTYPE_UINT16, vtype_uint16: VTYPE_UINT16,\