addTH(2)

ORIGIN
Cao-vlsi libraries, log package, libtshmmm.a

NAME
addTH - adds a new item in a hash table.

SYNOPSIS
#include "logmmm.h"
void addTH(pTable,key,value)
pTH pTable;
char *key;
int value;

PARAMETERS

pTable
    Hash table.

key Key used by the hash coding function.

value
    Associated value (pointer must be casted)

DESCRIPTION
addTH() adds a new item in pTable. If the key already exists, the old value is replaced by the new value. Value must be distinct from -1 (EMPTYTH) and -2 (DELETETH). The length of the table increases automatically when the length given in createTH() is insufficient.

EXAMPLE
#include "mutnnn.h"
#include "logmmm.h"
pTH mytable;
mytable = createTH(100);
addTH(mytable,namealloc("var1"),0);
addTH(mytable,namealloc("var2"),1);

ERROR
"addTH : error - value is EMPTYTH or DELETETH"
The value must be distinct from -1 and -2.

SEE ALSO
log(1), tsh(1), createTH(2), destroyTH(2), searchTH(2), deleteTH(2), displayTH(2).

SUPPORT STATUS
if bugs arise, please e-mail to cao-vlsi@masi.ibp.fr