NAME
|
tbl – octopus generic integer table module |
SYNOPSIS
|
include "tbl.m"; tbl := load Tbl Tbl–>PATH; Table: adt[T] {
|
DESCRIPTION
|
Tbl is a generic hash table, indexed by integer values. It is
taken (stolen) from the implementation of styxpersist(2). New creates a new table with nslots buckets in the hash. The nilval argument should be a null value of the appropriate type. Add adds an element to the table using id as the key. If an element with the same key exists it returns –1 and refuses to add the given element. Del removes an element with the given id from the dable, and returns it.
Find looks up the element with the given id and returns it. |
EXAMPLE
Create a has table of references to File with 103 buckets, and
add a file with key 0 to it.
|
SOURCE
|
/usr/octopus/port/lib/tbl.b |