Hash Table
[Utilities]
Detailed Description
- The hash table can be indexed by strings or pointer address, and each value can contain strings, pointers or function pointers.
- See iup_table.h
Enumerations | |
enum | Itable_IndexTypes { IUPTABLE_POINTERINDEXED = 10, IUPTABLE_STRINGINDEXED } |
enum | Itable_Types { IUPTABLE_POINTER, IUPTABLE_STRING, IUPTABLE_FUNCPOINTER } |
Functions | |
Itable * | iupTableCreate (enum Itable_IndexTypes indexType) |
Itable * | iupTableCreateSized (enum Itable_IndexTypes indexType, unsigned int initialSizeIndex) |
void | iupTableDestroy (Itable *n) |
int | iupTableCount (Itable *it) |
void | iupTableSet (Itable *n, const char *key, void *value, enum Itable_Types itemType) |
void | iupTableSetFunc (Itable *n, const char *key, Ifunc func) |
void * | iupTableGet (Itable *n, const char *key) |
Ifunc | iupTableGetFunc (Itable *n, const char *key, void **value) |
void * | iupTableGetTyped (Itable *n, const char *key, enum Itable_Types *itemType) |
void | iupTableRemove (Itable *n, const char *key) |
char * | iupTableFirst (Itable *it) |
char * | iupTableNext (Itable *it) |
void * | iupTableGetCurr (Itable *it) |
char * | iupTableRemoveCurr (Itable *it) |
Enumeration Type Documentation
|
How the table key is interpreted. |
|
How the value is interpreted. |
Function Documentation
|
Creates a hash table with an initial default size. This function is equivalent to iupTableCreateSized(0); |
|
Creates a hash table with the specified initial size. Use this function if you expect the table to become very large. initialSizeIndex is an array into the (internal) list of possible hash table sizes. Currently only indexes from 0 to 8 are supported. If you specify a higher value here, the maximum allowed value will be used. |
|
Destroys the Itable. This function does also free the memory of strings contained in the table!!!! |
|
Returns the number of keys stored in the table. |
|
Store an element in the table. |
|
Store a function pointer in the table. Type is set to IUPTABLE_FUNCPOINTER. |
|
Retrieves an element from the table. Returns NULL if not found. |
|
Retrieves a function pointer from the table. If not a function or not found returns NULL. value always contains the element pointer. |
|
Retrieves an element from the table and its type. |
|
Removes the entry at the specified key from the hash table and frees the memory used by it if it is a string... |
|
Key iteration function. Returns a key. To iterate over all keys call iupTableFirst at the first and call iupTableNext in a loop until 0 is returned... Do NOT change the content of the hash table during iteration. During an iteration you can use context with iupTableGetCurr() to access the value of the key very fast. |
|
Key iteration function. See iupTableNext. |
|
Returns the value at the current position. The current context is an iterator that is filled by iupTableNext(). iupTableGetCur() is faster then iupTableGet(), so when you want to access an item stored at a key returned by iupTableNext(), use this function instead of iupTableGet(). |
|
Removes the current element and returns the next key. Use this function to remove an element during an iteration. |