Files
fx/fx.collections/include/fx/collections/hashtable.h
T

57 lines
1.7 KiB
C

#ifndef FX_COLLECTIONS_HASHTABLE_H_
#define FX_COLLECTIONS_HASHTABLE_H_
#include <fx/bst.h>
#include <fx/iterator.h>
#include <fx/macros.h>
#include <fx/misc.h>
#include <fx/queue.h>
#include <fx/status.h>
#include <fx/value.h>
#include <stddef.h>
FX_DECLS_BEGIN;
#define FX_TYPE_HASHTABLE (fx_hashtable_get_type())
#define FX_TYPE_HASHTABLE_ITERATOR (fx_hashtable_iterator_get_type())
#define FX_TYPE_HASHTABLE_ITEM (fx_hashtable_item_get_type())
FX_DECLARE_TYPE(fx_hashtable);
FX_DECLARE_TYPE(fx_hashtable_iterator);
FX_DECLARE_TYPE(fx_hashtable_item);
FX_TYPE_CLASS_DECLARATION_BEGIN(fx_hashtable)
FX_TYPE_CLASS_DECLARATION_END(fx_hashtable)
FX_TYPE_CLASS_DECLARATION_BEGIN(fx_hashtable_iterator)
FX_TYPE_CLASS_DECLARATION_END(fx_hashtable_iterator)
FX_TYPE_CLASS_DECLARATION_BEGIN(fx_hashtable_item)
FX_TYPE_CLASS_DECLARATION_END(fx_hashtable_item)
FX_API fx_type_id fx_hashtable_get_type(void);
FX_API fx_type_id fx_hashtable_iterator_get_type(void);
FX_API fx_type_id fx_hashtable_item_get_type(void);
FX_TYPE_DEFAULT_CONSTRUCTOR(fx_hashtable, FX_TYPE_HASHTABLE);
FX_API fx_hashtable *fx_hashtable_create(void);
FX_API fx_status
fx_hashtable_put(fx_hashtable *hashtable, fx_value *key, fx_value *value);
FX_API const fx_value *fx_hashtable_get(
const fx_hashtable *hashtable,
const fx_value *key);
FX_API size_t fx_hashtable_get_count(const fx_hashtable *hashtable);
FX_API bool fx_hashtable_is_empty(const fx_hashtable *hashtable);
FX_API const fx_iterator *fx_hashtable_begin(const fx_hashtable *hashtable);
FX_API const fx_value *fx_hashtable_item_get_key(const fx_hashtable_item *item);
FX_API const fx_value *fx_hashtable_item_get_value(
const fx_hashtable_item *item);
FX_DECLS_END;
#endif