Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

hash.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *cr
00003  *cr            (C) Copyright 1995-2019 The Board of Trustees of the
00004  *cr                        University of Illinois
00005  *cr                         All Rights Reserved
00006  *cr
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  * RCS INFORMATION:
00011  *
00012  *      $RCSfile: hash.h,v $
00013  *      $Author: johns $        $Locker:  $             $State: Exp $
00014  *      $Revision: 1.17 $      $Date: 2019/01/17 21:21:03 $
00015  *
00016  ***************************************************************************
00017  * DESCRIPTION:
00018  *   A simple hash table implementation for strings, contributed by John Stone,
00019  *   derived from his ray tracer code.
00020  ***************************************************************************/
00021 #ifndef HASH_H
00022 #define HASH_H
00023 
00025 typedef struct hash_t {
00026   struct hash_node_t **bucket;      /* array of hash nodes */
00027   int size;                         /* size of the array */
00028   int entries;                      /* number of entries in table */
00029   int downshift;                    /* shift count, used in hash function */
00030   int mask;                         /* used to select bits for hashing */
00031 } hash_t;
00032 
00033 #define HASH_FAIL -1
00034 
00035 #if defined(VMDPLUGIN_STATIC)
00036 #define VMDEXTERNSTATIC static
00037 #include "hash.c"
00038 #else
00039 
00040 #define VMDEXTERNSTATIC 
00041 
00042 #ifdef __cplusplus
00043 extern "C" {
00044 #endif
00045 
00047 void hash_init(hash_t *, int);
00048 
00050 int hash_lookup (const hash_t *, const char *);
00051 
00053 int hash_insert (hash_t *, const char *, int);
00054 
00056 int hash_delete (hash_t *, const char *);
00057 
00059 int hash_entries(hash_t *);
00060 
00062 void hash_destroy(hash_t *);
00063 
00065 char *hash_stats (hash_t *);
00066 
00067 #ifdef __cplusplus
00068 }
00069 #endif
00070 
00071 #endif
00072 
00073 #endif

Generated on Fri Mar 29 02:45:20 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002