+/*
+ * This file is part of libFirm.
+ * Copyright (C) 2012 University of Karlsruhe.
+ */
+
/**
* @file
* @date 16.03.2007
* @brief a set of pointers with a custom compare function
* @author Matthias Braun
- * @version $Id$
*/
-#ifndef _FIRM_CPSET_H_
-#define _FIRM_CPSET_H_
+#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.
/**
* 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
#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);
/**
* 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 (rougly)
+ * @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,
*/
void cpset_remove_iterator(cpset_t *cpset, const cpset_iterator_t *iterator);
+/** @} */
+
#endif