Functions for a table data structure, which is similar to a hash (only with no indexing).
Included Files
- #include </usr/lib/gcc-lib/i486-pc-linux-gnu/3.2.3/include/stdio.h>
- #include </usr/include/stdlib.h>
- #include </usr/include/string.h>
char PROCNAME[128]
struct tm* CUR_TIME
ubs_table GLOBAL
int LOGLEVEL
Adds a new keypair (key, value) to a table
int ubs_table_add ( ubs_table* t, char* key, char* value )
- int ubs_table_add
- Returns OK on success, NO_MEM if memory allocation fails
- ubs_table* t
- Table to add the keypair to
- char* key
- The key
- char* value
- Value for the key
Changes the value of a key in a ubs_table structure
int ubs_table_change ( ubs_table* t, char* key, char* newval )
- int ubs_table_change
- Returns OK if successful, FAIL if the key does not exist in the table already
- ubs_table* t
- Table to read from
- char* key
- The key to change the value for
- char* newval
- New value for this key
Returns the value for a key in a ubs_table
char* ubs_table_data ( ubs_table* t, char* key )
- char* ubs_table_data
- Returns the string corresponding to the key passed in, or NULL if no such key exists
- ubs_table* t
- Table to read from
- char* key
- The key to seek
Checks to see if a key is present in the table
int ubs_table_exists ( ubs_table* t, char* key )
- int ubs_table_exists
- Returns YES if the key is found, NO if not
- ubs_table* t
- Table to read from
- char* key
- The key to seek
Creates memory and initializes a new ubs_table data structure. This function must be called before the ubs_table can be used.
int ubs_table_init ( ubs_table* t )
- ubs_table* t
- Pointer to the table to be initialized
int ubs_table Returns OK on success, NO_MEM if memory allocation failed
int ubs_table_remove ( ubs_table* t, char* key )