Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

xhash_tmpl_h.inc File Reference

data type independent hash table template (external hashing). More...

#include "common.h"
#include <sys/types.h>
#include "tmpl_common.h"

Include dependency graph for xhash_tmpl_h.inc:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define XHPFX   XH_FUNC_PFX
 define a convenient abbreviation for the macro containing the current hash tables function name prefix.


Typedefs

typedef XH_TABLE_NAME * XH_TABLE_NAME
 hide the data types true nature from the user.


Functions

XH_TABLE_NAME xh_pfx_Init (const size_t size)
 initialises a new instance of a hash table object. More...

int xh_pfx_Insert (XH_TABLE_NAME this, XH_KEY key, XH_CARGO new_load)
 inserts a new key / value pair into the table. More...

int xh_pfx_Delete (XH_TABLE_NAME this, XH_KEY key)
 removes key / value pair from the table. More...

XH_CARGO xh_pfx_Get (XH_TABLE_NAME this, const XH_KEY key)
 retrieves the data corresponding to a given key. More...

int xh_pfx_Terminate (XH_TABLE_NAME this)
 frees all ressources and destroys the table object. More...


Detailed Description

data type independent hash table template (external hashing).

Definition in file xhash_tmpl_h.inc.


Function Documentation

int xh_pfx_Delete XH_TABLE_NAME    this,
XH_KEY    key
 

removes key / value pair from the table.

<prefix>Delete removes data and its key from table.

Parameters:
this  the hash table object
key  the key of the data to be removed
Returns:
returns 0 on success and -1 if the key could not be found in the table

XH_CARGO xh_pfx_Get XH_TABLE_NAME    this,
const XH_KEY    key
 

retrieves the data corresponding to a given key.

<prefix>Get returns the data belonging to key.

Parameters:
this  the hash table object
key  the key of the data to be returned
Returns:
returns 0 on success and -1 if the key could not be found in the table

XH_TABLE_NAME xh_pfx_Init const size_t    size
 

initialises a new instance of a hash table object.

<prefix>Init initialises and returns a new instance of a hash table

Returns:
returns an empty hash table

int xh_pfx_Insert XH_TABLE_NAME    this,
XH_KEY    key,
XH_CARGO    new_load
 

inserts a new key / value pair into the table.

<prefix>Insert inserts new data associated with a keyinto the table. If there was any other value with the same key in the list before, it is replaced.

Parameters:
this  the hash table object
key  the key to retrieve the data
new_load  data to store
Returns:
returns 0 on success and -1 on failure

int xh_pfx_Terminate XH_TABLE_NAME    this
 

frees all ressources and destroys the table object.

<prefix>Terminate cleans up. The table object is invalid after a call of <prefix>Terminate.

Parameters:
this  the hash table object
Returns:
returns 0 on success and -1 if you should have bought a new computer some weeks ago.


Generated on Fri Jan 25 22:41:02 2002 for PDepp Webserver by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001