00001 #ifndef _DYLIB_HASH_H 00002 #define _DYLIB_HASH_H 00003 /* 00004 This file is part of the support library for the OsiDylp LP distribution. 00005 00006 Copyright (C) 2005 Lou Hafer 00007 00008 School of Computing Science 00009 Simon Fraser University 00010 Burnaby, B.C., V5A 1S6, Canada 00011 lou@cs.sfu.ca 00012 00013 This program is free software; you can redistribute it and/or modify it 00014 under the terms of the GNU General Public License as published by the Free 00015 Software Foundation; either version 2 of the License, or (at your option) 00016 any later version. 00017 00018 This program is distributed in the hope that it will be useful, but WITHOUT 00019 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00020 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 00021 more details. 00022 00023 You should have received a copy of the GNU General Public License along 00024 with this program; if not, write to the Free Software Foundation, Inc., 00025 51 Franklin St., Fifth Floor, Boston, MA 02110-1301 USA 00026 */ 00027 00028 /* Hash Table Structures */ 00029 00030 /* 00031 In order that the hashing routines can be used for a number of different 00032 tables, they do not have any knowledge of the thing being hashed. All that 00033 is maintained is the association between a key and some generic object. 00034 00035 @(#)hash.h 1.3 06/22/04 00036 svn/cvs: $Id: dylib_hash.h 71 2006-06-09 04:21:15Z andreasw $ 00037 */ 00038 00039 /* 00040 The basic hash table entry structure 00041 00042 field description 00043 ----- ----------- 00044 next next entry at this bucket 00045 key hash key (character string) 00046 ent structure associated with this entry 00047 */ 00048 00049 typedef struct hel_tag { struct hel_tag *next ; 00050 const char *key ; 00051 void *ent ; } hel ; 00052 00053 /* Hash table interface routines */ 00054 00055 extern void *lookup(const char *key, hel *hashtab[], int size), 00056 *search(const char *key, hel *hashtab[], int size, bool init), 00057 *enter(const char *key, hel *hashtab[], int size, void *entry), 00058 *erase(const char *key, hel *hashtab[], int size) ; 00059 00060 #endif /* _DYLIB_HASH_H */