X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fadt%2Fcpset.h;h=6dae90d9c9a26b3b55662b52df34e348cd28d4c0;hb=34e3b8d50bce639e760da7233524a4db85c80290;hp=60e06d8bad99457c19b9428a269baf535b829aef;hpb=040ff4a40f6d02d7e6ab69059e7ed899f88446f0;p=libfirm diff --git a/ir/adt/cpset.h b/ir/adt/cpset.h index 60e06d8ba..6dae90d9c 100644 --- a/ir/adt/cpset.h +++ b/ir/adt/cpset.h @@ -1,20 +1,6 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. - * * This file is part of libFirm. - * - * This file may be distributed and/or modified under the terms of the - * GNU General Public License version 2 as published by the Free Software - * Foundation and appearing in the file LICENSE.GPL included in the - * packaging of this file. - * - * Licensees holding valid libFirm Professional Edition licenses may use - * this file in accordance with the libFirm Commercial License. - * Agreement provided with the Software. - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE. + * Copyright (C) 2012 University of Karlsruhe. */ /** @@ -22,11 +8,17 @@ * @date 16.03.2007 * @brief a set of pointers with a custom compare function * @author Matthias Braun - * @version $Id$ */ #ifndef FIRM_ADT_CPSET_H #define FIRM_ADT_CPSET_H +/** + * @ingroup adt + * @defgroup Pointer Set (custom Compare) + * A pointer set with user-definable compare function + * @{ + */ + /** * The type of a cpset compare function. * @@ -39,14 +31,11 @@ typedef int (*cpset_cmp_function) (const void *p1, const void *p2); /** * The type of a cpset hash function. - * - * @param p1 pointer to an element - * @param p2 pointer to another element - * - * @return 1 if the elements are identically, zero else */ typedef unsigned (*cpset_hash_function) (const void *obj); +/** @cond PRIVATE */ + #define HashSet cpset_t #define HashSetIterator cpset_iterator_t #define HashSetEntry cpset_hashset_entry_t @@ -59,11 +48,20 @@ typedef unsigned (*cpset_hash_function) (const void *obj); #undef HashSetIterator #undef HashSet +/** @endcond */ + +/** a pointer set with custom compare function */ +typedef struct cpset_t cpset_t; +/** iterator over a pointer set with custom compare function + * @see #cpset_t */ +typedef struct cpset_iterator_t cpset_iterator_t; + /** * Initializes a cpset * - * @param cpset Pointer to allocated space for the cpset - * @param cmp_function The compare function to use + * @param cpset Pointer to allocated space for the cpset + * @param hash_function The hash function to use + * @param cmp_function The compare function to use */ void cpset_init(cpset_t *cpset, cpset_hash_function hash_function, cpset_cmp_function cmp_function); @@ -71,9 +69,10 @@ void cpset_init(cpset_t *cpset, cpset_hash_function hash_function, /** * Initializes a cpset * - * @param cpset Pointer to allocated space for the cpset - * @param cmp_function The compare function to use - * @param expected_elements Number of elements expected in the cpset (roughly) + * @param cpset Pointer to allocated space for the cpset + * @param hash_function The hash function to use + * @param cmp_function The compare function to use + * @param expected_elements Number of elements expected in the cpset (roughly) */ void cpset_init_size(cpset_t *cpset, cpset_hash_function hash_function, cpset_cmp_function cmp_function, @@ -150,4 +149,6 @@ void *cpset_iterator_next(cpset_iterator_t *iterator); */ void cpset_remove_iterator(cpset_t *cpset, const cpset_iterator_t *iterator); -#endif /* FIRM_ADT_CPSET_H */ +/** @} */ + +#endif