now that strings can contain UTF-8 codepoints and null chars, the b_dict api has been enhanced to accept keys as b_strings as well as regular c-strings. keys are now stored as b_strings internally, to allow a wider range of keys to be used.
29 lines
408 B
C
29 lines
408 B
C
#ifndef _B_DICT_H_
|
|
#define _B_DICT_H_
|
|
|
|
#include "object.h"
|
|
|
|
#include <blue/core/btree.h>
|
|
#include <blue/core/queue.h>
|
|
|
|
struct b_string;
|
|
|
|
struct b_dict_bucket_item {
|
|
b_queue_entry bi_entry;
|
|
struct b_string *bi_str;
|
|
struct b_object *bi_value;
|
|
};
|
|
|
|
struct b_dict_bucket {
|
|
b_btree_node bk_node;
|
|
uint64_t bk_hash;
|
|
b_queue bk_items;
|
|
};
|
|
|
|
struct b_dict {
|
|
struct b_object d_base;
|
|
b_btree d_buckets;
|
|
};
|
|
|
|
#endif
|