![]() |
torcs - 1.2.2 | ![]() |
00001 /* 00002 The contents of this file are subject to the Mozilla Public License 00003 Version 1.0 (the "License"); you may not use this file except in 00004 compliance with the License. You may obtain a copy of the License at 00005 http://www.mozilla.org/MPL/ 00006 00007 Software distributed under the License is distributed on an "AS IS" 00008 basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 00009 License for the specific language governing rights and limitations 00010 under the License. 00011 00012 The Original Code is expat. 00013 00014 The Initial Developer of the Original Code is James Clark. 00015 Portions created by James Clark are Copyright (C) 1998 00016 James Clark. All Rights Reserved. 00017 00018 Contributor(s): 00019 $Id: hashtable.h,v 1.1.1.1 2001/06/24 18:29:46 torcs Exp $ 00020 */ 00021 00022 00023 #include <stddef.h> 00024 00025 #ifdef XML_UNICODE 00026 typedef const wchar_t *KEY; 00027 #else 00028 typedef const char *KEY; 00029 #endif 00030 00031 typedef struct { 00032 KEY name; 00033 } NAMED; 00034 00035 typedef struct { 00036 NAMED **v; 00037 size_t size; 00038 size_t used; 00039 size_t usedLim; 00040 } HASH_TABLE; 00041 00042 NAMED *lookup(HASH_TABLE *table, KEY name, size_t createSize); 00043 void hashTableInit(HASH_TABLE *); 00044 void hashTableDestroy(HASH_TABLE *); 00045 00046 typedef struct { 00047 NAMED **p; 00048 NAMED **end; 00049 } HASH_TABLE_ITER; 00050 00051 void hashTableIterInit(HASH_TABLE_ITER *, const HASH_TABLE *); 00052 NAMED *hashTableIterNext(HASH_TABLE_ITER *);