---
name: "addht"
section: "3"
platform: "linux"
package: "alliance"
version: "5.1.1-3"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/addht"
---

# addht(3)

create an hash table

## NAME

addht - create an hash table

## SYNOPSYS

```
#include "mut.h"
ht ∗addht(len)
unsigned int len;
```

## PARAMETER

- *len*

  Number of entries in the hash table

## DESCRIPTION

**addht()** creates a new hash table in memory. *len* is an estimate of the maximum number of entries that the table will contain. This number may be automatically adjusted when using access functions by a dynamic reallocation, in order to warranty fast access time.

## EXAMPLE

```
#include "mut.h"
ht ∗sigHtable(ptfig) /∗ h table suitable for signals ∗/
lofig_list ∗ptfig;
{
losig_list ∗ptsig = ptfig->LOSIG;
unsigned int i = 0;
	while (ptsig) {
		i++;
		ptsig = ptsig->NEXT;
	}
	return addht(i);
}
```

## ERROR

**"∗∗∗ mbk error ∗∗∗ illegal addht :** *len* **is '0'"**

The hash table size cannot be zero, guess why!

## SEE ALSO

**mbk**(1), [**delht**(3)](/delht/3.md), [**addhtitem**(3)](/addhtitem/3.md), [**gethtitem**(3)](/gethtitem/3.md), [**sethtitem**(3)](/sethtitem/3.md), [**delhtitem**(3)](/delhtitem/3.md), [**viewht**(3)](/viewht/3.md).
