libircbot
library providing a framework for implementing an IRC bot
Loading...
Searching...
No Matches
hashtable.h
Go to the documentation of this file.
1#ifndef IRCBOT_HASHTABLE_H
2#define IRCBOT_HASHTABLE_H
3
8#include <ircbot/decl.h>
9
10#include <stddef.h>
11#include <stdint.h>
12
16C_CLASS_DECL(IBHashTable);
17
21C_CLASS_DECL(IBHashTableIterator);
22
29DECLEXPORT IBHashTable *IBHashTable_create(uint8_t bits)
30 ATTR_RETNONNULL;
31
41DECLEXPORT void IBHashTable_set(IBHashTable *self, const char *key,
42 void *obj, void (*deleter)(void *))
43 CMETHOD ATTR_NONNULL((2)) ATTR_NONNULL((3));
44
52DECLEXPORT int IBHashTable_delete(IBHashTable *self, const char *key)
53 CMETHOD ATTR_NONNULL((2));
54
60DECLEXPORT size_t IBHashTable_count(const IBHashTable *self) CMETHOD ATTR_PURE;
61
68DECLEXPORT void *IBHashTable_get(const IBHashTable *self, const char *key)
69 CMETHOD ATTR_NONNULL((2));
70
79DECLEXPORT IBHashTableIterator *IBHashTable_iterator(const IBHashTable *self)
80 CMETHOD ATTR_RETNONNULL;
81
87DECLEXPORT void IBHashTable_destroy(IBHashTable *self);
88
96DECLEXPORT int IBHashTableIterator_moveNext(IBHashTableIterator *self) CMETHOD;
97
103DECLEXPORT const char *IBHashTableIterator_key(const IBHashTableIterator *self)
104 CMETHOD ATTR_PURE;
105
111DECLEXPORT void *IBHashTableIterator_current(const IBHashTableIterator *self)
112 CMETHOD ATTR_PURE;
113
118DECLEXPORT void IBHashTableIterator_destroy(IBHashTableIterator *self);
119
120#endif
A hash table storing any data objects using string keys.
void IBHashTable_set(IBHashTable *self, const char *key, void *obj, void(*deleter)(void *))
Set a new object for a key.
IBHashTable * IBHashTable_create(uint8_t bits)
IBHashTable default constructor.
An iterator over the contents of an IBHashTable.
Common preprocessor declarations for libircbot.