1VIEWHT(3)             MBK HASH TABLE MANAGEMENT FUNCTIONS            VIEWHT(3)
2
3
4

NAME

6       viewht - displays a hash table contents
7

SYNOPSIS

9       #include "mut.h"
10       void viewht(table, display)
11       ht ∗table;
12       char ∗(∗display)();
13

PARAMETER

15       table               Hash table to be viewed
16
17       display             Function  to  be used for displaying an item of the
18                           table This function needs a user  supplied  parame‐
19                           ter, the pointer to the item.
20

DESCRIPTION

22       viewht() displays all items of table :
23
24       index               This is the entry index of the hash table
25
26       key                 This  pointer  is the one given by the user.  It is
27                           displayed using something like
28                           fprintf(stdout, "%s\n", display(key));.
29
30       value               This is the value associated with the key.   It  is
31                           displayed as an int.
32

EXAMPLE

34       #include "mut.h"
35       #include <stdio.h>
36       typedef struct of_fp {
37          char ∗name;
38          float f;
39          void ∗p;
40       } fp;
41       char ∗printout(s)
42       fp ∗s;
43       {
44       char t[BUFSIZ];
45          sprintf(t, "name : `%s' :~~~: float value : `%.6f' <%#x>",
46             s->name, s->f, s->p);
47          return t;
48       }
49       void displayall(h)
50       ht *h;
51       {
52          viewht(h, printout);
53       }
54

SEE ALSO

56       mbk(1),  addht(3),  delht(3), addhtitem(3), gethtitem(3), sethtitem(3),
57       delhtitem(3).
58
59
60
61
62
63
64ASIM/LIP6                       October 1, 1997                      VIEWHT(3)
Impressum