Lines Matching refs:Hashmap
33 * necessary to instantiate an object for each Hashmap use.
50 typedef struct Hashmap Hashmap; /* Maps keys to values */
51 typedef struct OrderedHashmap OrderedHashmap; /* Like Hashmap, but also remembers entry insertion order */
114 __builtin_types_compatible_p(typeof(h), Hashmap*) || \
119 (__builtin_types_compatible_p(typeof(h), Hashmap*) || \
129 (Hashmap*)(h), \
142 Hashmap *internal_hashmap_new(const struct hash_ops *hash_ops HASHMAP_DEBUG_PARAMS);
148 static inline Hashmap *hashmap_free(Hashmap *h) {
156 static inline Hashmap *hashmap_free_free(Hashmap *h) {
163 Hashmap *hashmap_free_free_free(Hashmap *h);
169 static inline Hashmap *hashmap_copy(Hashmap *h) {
170 return (Hashmap*) internal_hashmap_copy(HASHMAP_BASE(h));
176 int internal_hashmap_ensure_allocated(Hashmap **h, const struct hash_ops *hash_ops HASHMAP_DEBUG_PARAMS);
181 int hashmap_put(Hashmap *h, const void *key, void *value);
186 int hashmap_update(Hashmap *h, const void *key, void *value);
191 int hashmap_replace(Hashmap *h, const void *key, void *value);
197 static inline void *hashmap_get(Hashmap *h, const void *key) {
204 void *hashmap_get2(Hashmap *h, const void *key, void **rkey);
210 static inline bool hashmap_contains(Hashmap *h, const void *key) {
218 static inline void *hashmap_remove(Hashmap *h, const void *key) {
225 void *hashmap_remove2(Hashmap *h, const void *key, void **rkey);
230 void *hashmap_remove_value(Hashmap *h, const void *key, void *value);
235 int hashmap_remove_and_put(Hashmap *h, const void *old_key, const void *new_key, void *value);
240 int hashmap_remove_and_replace(Hashmap *h, const void *old_key, const void *new_key, void *value);
245 /* Since merging data from a OrderedHashmap into a Hashmap or vice-versa
247 int internal_hashmap_merge(Hashmap *h, Hashmap *other);
252 static inline int hashmap_reserve(Hashmap *h, unsigned entries_add) {
261 static inline int hashmap_move(Hashmap *h, Hashmap *other) {
269 static inline int hashmap_move_one(Hashmap *h, Hashmap *other, const void *key) {
277 static inline unsigned hashmap_size(Hashmap *h) {
284 static inline bool hashmap_isempty(Hashmap *h) {
292 static inline unsigned hashmap_buckets(Hashmap *h) {
300 static inline void *hashmap_iterate(Hashmap *h, Iterator *i, const void **key) {
308 static inline void hashmap_clear(Hashmap *h) {
316 static inline void hashmap_clear_free(Hashmap *h) {
323 void hashmap_clear_free_free(Hashmap *h);
340 static inline void *hashmap_steal_first(Hashmap *h) {
348 static inline void *hashmap_steal_first_key(Hashmap *h) {
356 static inline void *hashmap_first_key(Hashmap *h) {
364 static inline void *hashmap_first(Hashmap *h) {
375 static inline char **hashmap_get_strv(Hashmap *h) {
408 DEFINE_TRIVIAL_CLEANUP_FUNC(Hashmap*, hashmap_free);
409 DEFINE_TRIVIAL_CLEANUP_FUNC(Hashmap*, hashmap_free_free);
410 DEFINE_TRIVIAL_CLEANUP_FUNC(Hashmap*, hashmap_free_free_free);