ObjFW
|
00001 /* 00002 * Copyright (c) 2008, 2009, 2010, 2011, 2012 00003 * Jonathan Schleifer <js@webkeks.org> 00004 * 00005 * All rights reserved. 00006 * 00007 * This file is part of ObjFW. It may be distributed under the terms of the 00008 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in 00009 * the packaging of this file. 00010 * 00011 * Alternatively, it may be distributed under the terms of the GNU General 00012 * Public License, either version 2 or 3, which can be found in the file 00013 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this 00014 * file. 00015 */ 00016 00017 #import "OFDictionary.h" 00018 00019 struct of_dictionary_hashtable_bucket 00020 { 00021 id key, object; 00022 uint32_t hash; 00023 }; 00024 00025 @interface OFDictionary_hashtable: OFDictionary 00026 { 00027 struct of_dictionary_hashtable_bucket **data; 00028 uint32_t size; 00029 size_t count; 00030 } 00031 00032 #if defined(OF_SET_HASHTABLE_M) || defined(OF_COUNTED_SET_HASHTABLE_M) 00033 - _initWithDictionary: (OFDictionary*)dictionary 00034 copyKeys: (BOOL)copyKeys; 00035 #endif 00036 @end 00037 00038 @interface OFDictionaryEnumerator_hashtable: OFEnumerator 00039 { 00040 OFDictionary_hashtable *dictionary; 00041 struct of_dictionary_hashtable_bucket **data; 00042 uint32_t size; 00043 unsigned long mutations; 00044 unsigned long *mutationsPtr; 00045 uint32_t pos; 00046 } 00047 00048 - initWithDictionary: (OFDictionary_hashtable*)dictionary 00049 data: (struct of_dictionary_hashtable_bucket**)data 00050 size: (uint32_t)size 00051 mutationsPointer: (unsigned long*)mutationsPtr; 00052 @end 00053 00054 @interface OFDictionaryKeyEnumerator_hashtable: OFDictionaryEnumerator_hashtable 00055 @end 00056 00057 @interface OFDictionaryObjectEnumerator_hashtable: 00058 OFDictionaryEnumerator_hashtable 00059 @end 00060 00061 #ifdef __cplusplus 00062 extern "C" { 00063 #endif 00064 extern struct of_dictionary_hashtable_bucket 00065 of_dictionary_hashtable_deleted_bucket; 00066 #ifdef __cplusplus 00067 } 00068 #endif