#include "libicl.h"#include "dictionary.h"#include <stddef.h>Go to the source code of this file.
Data Structures | |
| struct | htbucket_struct |
| struct | hthash_table_struct |
| struct | htfreeNodeData_struct |
Defines | |
| #define | DEBUG_LEVEL 1 |
Typedefs | |
| typedef htbucket_struct | htbucket |
| typedef hthash_table_struct | hthash_table |
| typedef htfreeNodeData_struct | htfreeNodeData |
Functions | |
| EXTERN int | oaa_ResolveVariable (char *inVarName, ICLTerm **resolvedVar) |
| EXTERN void | printDebug (int level, char *str,...) |
| Prints out debug messages. | |
| EXTERN void | printWarning (int level, char *str,...) |
| Prints out warning messages. | |
| void | print_dictionary (DICTIONARY *d) |
| Prints a dictionary's contents as ICLTerms. | |
| EXTERN char * | get64BitFormatWrapped (char *pre, char *post) |
| EXTERN char * | get64BitFormat () |
| hthash_table * | htconstruct_table (hthash_table *table, size_t size) |
| Initialize the hash_table to the size asked for. | |
| void * | htinsert (char *key, void *data, hthash_table *table) |
Insert key into hash table. | |
| void * | htlookup (char *key, hthash_table *table) |
| Look up a key and return the associated data. | |
| void * | htdel (char *key, hthash_table *table) |
| Delete a key from the hash table and return associated data, or NULL if not present. | |
| void | htenumerate (hthash_table *table, void(*func)(char *, void *, void *), void *otherData) |
| Simply invokes the function given as the second parameter for each node in the table, passing it the key and the associated data. | |
| void | htfree_table (hthash_table *table, void(*func)(void *)) |
| Frees a complete table by iterating over it and freeing each node. | |
| void | htprint (hthash_table *table) |
Definition in file libutils.h.
| #define DEBUG_LEVEL 1 |
Definition at line 32 of file libutils.h.
| typedef struct htbucket_struct htbucket |
| typedef struct htfreeNodeData_struct htfreeNodeData |
| typedef struct hthash_table_struct hthash_table |
| EXTERN char* get64BitFormat | ( | ) |
Definition at line 731 of file libutils.c.
| EXTERN char* get64BitFormatWrapped | ( | char * | pre, | |
| char * | post | |||
| ) |
Definition at line 691 of file libutils.c.
| hthash_table* htconstruct_table | ( | hthash_table * | table, | |
| size_t | size | |||
| ) |
Initialize the hash_table to the size asked for.
Allocates space for the correct number of pointers and sets them to NULL. If it can't allocate sufficient memory, signals error by setting the size of the table to 0.
Definition at line 426 of file libutils.c.
| void* htdel | ( | char * | key, | |
| hthash_table * | table | |||
| ) |
Delete a key from the hash table and return associated data, or NULL if not present.
Definition at line 554 of file libutils.c.
| void htenumerate | ( | hthash_table * | table, | |
| void(*)(char *, void *, void *) | func, | |||
| void * | otherData | |||
| ) |
Simply invokes the function given as the second parameter for each node in the table, passing it the key and the associated data.
Definition at line 657 of file libutils.c.
| void htfree_table | ( | hthash_table * | table, | |
| void(*)(void *) | func | |||
| ) |
Frees a complete table by iterating over it and freeing each node.
the second parameter is the address of a function it will call with a pointer to the data associated with each node. This function is responsible for freeing the data, or doing whatever is needed with it.
Definition at line 642 of file libutils.c.
| void* htinsert | ( | char * | key, | |
| void * | data, | |||
| hthash_table * | table | |||
| ) |
Insert key into hash table.
Returns pointer to old data associated with the key, if any, or NULL if the key wasn't in the table previously.
Definition at line 471 of file libutils.c.
| void* htlookup | ( | char * | key, | |
| hthash_table * | table | |||
| ) |
Look up a key and return the associated data.
Returns NULL if the key is not in the table.
Definition at line 533 of file libutils.c.
| void htprint | ( | hthash_table * | table | ) |
Definition at line 685 of file libutils.c.
| EXTERN int oaa_ResolveVariable | ( | char * | inVarName, | |
| ICLTerm ** | resolvedVar | |||
| ) |
Definition at line 64 of file libutils.c.
| void print_dictionary | ( | DICTIONARY * | d | ) |
| EXTERN void printDebug | ( | int | level, | |
| char * | str, | |||
| ... | ||||
| ) |
| EXTERN void printWarning | ( | int | level, | |
| char * | str, | |||
| ... | ||||
| ) |