Skip site navigation (1)Skip section navigation (2)

  
 
  

home | help
VIEWHT(3)	       MBK HASH TABLE MANAGEMENT FUNCTIONS	       VIEWHT(3)

NAME
     viewht - displays a hash table contents

SYNOPSIS
     #include "mut.h"
     void viewht(table, display)
     ht *table;
     char *(*display)();

PARAMETER
     table		 Hash table to be viewed

     display		 Function to be used for displaying an item of the table
			 This  function  needs	a  user  supplied parameter, the
			 pointer to the item.

DESCRIPTION
     viewht() displays all items of table :

     index		 This is the entry index of the hash table

     key		 This pointer is the one given by the user.  It is  dis-
			 played using something like
			 fprintf(stdout, "%s\n", display(key));.

     value		 This  is the value associated with the key.  It is dis-
			 played as an int.

EXAMPLE
     #include "mut.h"
     #include <stdio.h>
     typedef struct of_fp {
	char *name;
	float f;
	void *p;
     } fp;
     char *printout(s)
     fp *s;
     {
     char t[BUFSIZ];
	sprintf(t, "name : `%s' :~~~: float value : `%.6f' <%#x>",
	   s->name, s->f, s->p);
	return t;
     }
     void displayall(h)
     ht *h;
     {
	viewht(h, printout);
     }

SEE ALSO
     mbk(1), addht(3), delht(3), addhtitem(3), gethtitem(3), sethtitem(3),  del-
     htitem(3).

ASIM/LIP6			 October 1, 1997		       VIEWHT(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=viewht&sektion=3&manpath=FreeBSD+Ports+15.1.quarterly>

home | help