2 * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
6 * This file may be distributed and/or modified under the terms of the
7 * GNU General Public License version 2 as published by the Free Software
8 * Foundation and appearing in the file LICENSE.GPL included in the
9 * packaging of this file.
11 * Licensees holding valid libFirm Professional Edition licenses may use
12 * this file in accordance with the libFirm Commercial License.
13 * Agreement provided with the Software.
15 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * @brief implementation of pset_new
23 * @author Matthias Braun
32 /** probing method: quadratic probing */
34 #define HashSet pset_new_t
35 #define HashSetIterator pset_new_iterator_t
36 #define ValueType void*
37 #define NullValue NULL
38 #define DeletedValue ((void*)-1)
39 #define KeysEqual(this,key1,key2) 1
40 #define SetRangeEmpty(ptr,size) memset(ptr, 0, (size) * sizeof(HashSetEntry))
42 #define hashset_init pset_new_init
43 #define hashset_init_size pset_new_init_size
44 #define hashset_destroy pset_new_destroy
45 #define hashset_insert pset_new_insert
46 #define hashset_remove pset_new_remove
47 #define hashset_find pset_new_find
48 #define hashset_size pset_new_size
49 #define hashset_iterator_init pset_new_iterator_init
50 #define hashset_iterator_next pset_new_iterator_next
51 #define hashset_remove_iterator pset_new_remove_iterator
55 int pset_new_contains(const pset_new_t *pset_new, const ValueType val)
57 return pset_new_find(pset_new, val) != NullValue;