Merge branch 'main' into feature/new-object-system
This commit is contained in:
@@ -7,27 +7,17 @@
|
||||
#include <blue/core/status.h>
|
||||
#include <blue/ds/object.h>
|
||||
#include <blue/ds/type.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#define B_HASHMAP(p) ((b_hashmap *)(p))
|
||||
#define B_HASHMAP(p) ((b_hashmap *)(p))
|
||||
|
||||
#define B_HASHMAP_KEY(k, ks) \
|
||||
{ \
|
||||
.key_data = (k), .key_size = (ks) \
|
||||
}
|
||||
#define B_HASHMAP_VALUE(v, vs) \
|
||||
{ \
|
||||
.value_data = (v), .value_size = (vs) \
|
||||
}
|
||||
#define B_HASHMAP_KEY(k, ks) {.key_data = (k), .key_size = (ks)}
|
||||
#define B_HASHMAP_VALUE(v, vs) {.value_data = (v), .value_size = (vs)}
|
||||
|
||||
#define B_HASHMAP_ITEM(k, ks, v, vs) \
|
||||
{ \
|
||||
.key = B_HASHMAP_KEY(k, ks), .value = B_HASHMAP_VALUE(v, vs) \
|
||||
}
|
||||
{.key = B_HASHMAP_KEY(k, ks), .value = B_HASHMAP_VALUE(v, vs)}
|
||||
|
||||
#define B_HASHMAP_ITEM_END \
|
||||
{ \
|
||||
.key = {0}, .value = { 0 } \
|
||||
}
|
||||
#define B_HASHMAP_ITEM_END {.key = {0}, .value = {0}}
|
||||
|
||||
#define b_hashmap_foreach(it, hashmap) \
|
||||
for (int z__b_unique_name() = b_hashmap_iterator_begin(hashmap, it); \
|
||||
@@ -38,7 +28,12 @@ typedef struct b_hashmap b_hashmap;
|
||||
typedef void (*b_hashmap_key_destructor)(void *);
|
||||
typedef void (*b_hashmap_value_destructor)(void *);
|
||||
|
||||
typedef enum b_hashmap_key_flags {
|
||||
B_HASHMAP_KEY_F_INTVALUE = 0x01u,
|
||||
} b_hashmap_key_flags;
|
||||
|
||||
typedef struct b_hashmap_key {
|
||||
b_hashmap_key_flags key_flags;
|
||||
const void *key_data;
|
||||
size_t key_size;
|
||||
} b_hashmap_key;
|
||||
|
||||
Reference in New Issue
Block a user