Commit 3d61544b authored by Matthias Braun's avatar Matthias Braun
Browse files

make cpset, pset_new API private

parent be5b04af
......@@ -26,8 +26,6 @@
#ifndef FIRM_ADT_CPSET_H
#define FIRM_ADT_CPSET_H
#include "../begin.h"
/**
* @ingroup adt
* @defgroup Pointer Set (custom Compare)
......@@ -79,7 +77,7 @@ typedef struct cpset_iterator_t cpset_iterator_t;
* @param hash_function The hash function to use
* @param cmp_function The compare function to use
*/
FIRM_API void cpset_init(cpset_t *cpset, cpset_hash_function hash_function,
void cpset_init(cpset_t *cpset, cpset_hash_function hash_function,
cpset_cmp_function cmp_function);
/**
......@@ -90,7 +88,7 @@ FIRM_API void cpset_init(cpset_t *cpset, cpset_hash_function hash_function,
* @param cmp_function The compare function to use
* @param expected_elements Number of elements expected in the cpset (roughly)
*/
FIRM_API void cpset_init_size(cpset_t *cpset, cpset_hash_function hash_function,
void cpset_init_size(cpset_t *cpset, cpset_hash_function hash_function,
cpset_cmp_function cmp_function,
size_t expected_elements);
......@@ -100,7 +98,7 @@ FIRM_API void cpset_init_size(cpset_t *cpset, cpset_hash_function hash_function,
*
* @param cpset Pointer to the cpset
*/
FIRM_API void cpset_destroy(cpset_t *cpset);
void cpset_destroy(cpset_t *cpset);
/**
* Inserts an element into a cpset.
......@@ -109,7 +107,7 @@ FIRM_API void cpset_destroy(cpset_t *cpset);
* @param obj Element to insert into the cpset
* @returns The element itself or a pointer to an existing element
*/
FIRM_API void* cpset_insert(cpset_t *cpset, void *obj);
void* cpset_insert(cpset_t *cpset, void *obj);
/**
* Removes an element from a cpset. Does nothing if the cpset doesn't contain the
......@@ -118,7 +116,7 @@ FIRM_API void* cpset_insert(cpset_t *cpset, void *obj);
* @param cpset Pointer to the cpset
* @param obj Pointer to remove from the cpset
*/
FIRM_API void cpset_remove(cpset_t *cpset, const void *obj);
void cpset_remove(cpset_t *cpset, const void *obj);
/**
* Tests whether a cpset contains a pointer
......@@ -127,7 +125,7 @@ FIRM_API void cpset_remove(cpset_t *cpset, const void *obj);
* @param obj The pointer to find
* @returns An equivalent object to @p obj or NULL
*/
FIRM_API void *cpset_find(const cpset_t *cpset, const void *obj);
void *cpset_find(const cpset_t *cpset, const void *obj);
/**
* Returns the number of pointers contained in the cpset
......@@ -135,7 +133,7 @@ FIRM_API void *cpset_find(const cpset_t *cpset, const void *obj);
* @param cpset Pointer to the cpset
* @returns Number of pointers contained in the cpset
*/
FIRM_API size_t cpset_size(const cpset_t *cpset);
size_t cpset_size(const cpset_t *cpset);
/**
* Initializes a cpset iterator. Sets the iterator before the first element in
......@@ -144,7 +142,7 @@ FIRM_API size_t cpset_size(const cpset_t *cpset);
* @param iterator Pointer to already allocated iterator memory
* @param cpset Pointer to the cpset
*/
FIRM_API void cpset_iterator_init(cpset_iterator_t *iterator, const cpset_t *cpset);
void cpset_iterator_init(cpset_iterator_t *iterator, const cpset_t *cpset);
/**
* Advances the iterator and returns the current element or NULL if all elements
......@@ -155,7 +153,7 @@ FIRM_API void cpset_iterator_init(cpset_iterator_t *iterator, const cpset_t *cps
* @param iterator Pointer to the cpset iterator.
* @returns Next element in the cpset or NULL
*/
FIRM_API void *cpset_iterator_next(cpset_iterator_t *iterator);
void *cpset_iterator_next(cpset_iterator_t *iterator);
/**
* Removed the element the iterator currently points to
......@@ -163,10 +161,8 @@ FIRM_API void *cpset_iterator_next(cpset_iterator_t *iterator);
* @param cpset Pointer to the cpset
* @param iterator Pointer to the cpset iterator.
*/
FIRM_API void cpset_remove_iterator(cpset_t *cpset, const cpset_iterator_t *iterator);
void cpset_remove_iterator(cpset_t *cpset, const cpset_iterator_t *iterator);
/** @} */
#include "../end.h"
#endif
......@@ -31,8 +31,6 @@
#ifndef FIRM_ADT_PSET_NEW_H
#define FIRM_ADT_PSET_NEW_H
#include "../begin.h"
/** @cond PRIVATE */
#define HashSet pset_new_t
......@@ -58,7 +56,7 @@ typedef struct pset_new_iterator_t pset_new_iterator_t;
*
* @param pset_new Pointer to allocated space for the pset_new
*/
FIRM_API void pset_new_init(pset_new_t *pset_new);
void pset_new_init(pset_new_t *pset_new);
/**
* Initializes a pset_new
......@@ -66,7 +64,7 @@ FIRM_API void pset_new_init(pset_new_t *pset_new);
* @param pset_new Pointer to allocated space for the pset_new
* @param expected_elements Number of elements expected in the pset_new (roughly)
*/
FIRM_API void pset_new_init_size(pset_new_t *pset_new, size_t expected_elements);
void pset_new_init_size(pset_new_t *pset_new, size_t expected_elements);
/**
* Destroys a pset_new and frees the memory allocated for hashtable. The memory of
......@@ -74,7 +72,7 @@ FIRM_API void pset_new_init_size(pset_new_t *pset_new, size_t expected_elements)
*
* @param pset_new Pointer to the pset_new
*/
FIRM_API void pset_new_destroy(pset_new_t *pset_new);
void pset_new_destroy(pset_new_t *pset_new);
/**
* Inserts an element into a pset_new.
......@@ -83,7 +81,7 @@ FIRM_API void pset_new_destroy(pset_new_t *pset_new);
* @param ptr Pointer to insert into the pset_new
* @returns 1 if the pointer was inserted, 0 if it was already there
*/
FIRM_API int pset_new_insert(pset_new_t *pset_new, void *ptr);
int pset_new_insert(pset_new_t *pset_new, void *ptr);
/**
* Removes an element from a pset_new. Does nothing if the pset_new doesn't contain the
......@@ -92,7 +90,7 @@ FIRM_API int pset_new_insert(pset_new_t *pset_new, void *ptr);
* @param pset_new Pointer to the pset_new
* @param ptr Pointer to remove from the pset_new
*/
FIRM_API void pset_new_remove(pset_new_t *pset_new, const void *ptr);
void pset_new_remove(pset_new_t *pset_new, const void *ptr);
/**
* Tests whether a pset_new contains a pointer
......@@ -101,7 +99,7 @@ FIRM_API void pset_new_remove(pset_new_t *pset_new, const void *ptr);
* @param ptr The pointer to test
* @returns 1 @p pset_new contains the @p ptr, 0 otherwise
*/
FIRM_API int pset_new_contains(const pset_new_t *pset_new, const void *ptr);
int pset_new_contains(const pset_new_t *pset_new, const void *ptr);
/**
* Returns the number of pointers contained in the pset_new
......@@ -109,7 +107,7 @@ FIRM_API int pset_new_contains(const pset_new_t *pset_new, const void *ptr);
* @param pset_new Pointer to the pset_new
* @returns Number of pointers contained in the pset_new
*/
FIRM_API size_t pset_new_size(const pset_new_t *pset_new);
size_t pset_new_size(const pset_new_t *pset_new);
/**
* Initializes a pset_new iterator. Sets the iterator before the first element in
......@@ -118,7 +116,7 @@ FIRM_API size_t pset_new_size(const pset_new_t *pset_new);
* @param iterator Pointer to already allocated iterator memory
* @param pset_new Pointer to the pset_new
*/
FIRM_API void pset_new_iterator_init(pset_new_iterator_t *iterator, const pset_new_t *pset_new);
void pset_new_iterator_init(pset_new_iterator_t *iterator, const pset_new_t *pset_new);
/**
* Advances the iterator and returns the current element or NULL if all elements
......@@ -129,7 +127,7 @@ FIRM_API void pset_new_iterator_init(pset_new_iterator_t *iterator, const pset_n
* @param iterator Pointer to the pset_new iterator.
* @returns Next element in the pset_new or NULL
*/
FIRM_API void* pset_new_iterator_next(pset_new_iterator_t *iterator);
void* pset_new_iterator_next(pset_new_iterator_t *iterator);
/**
* Removes the element that the iterator currently points to from the hashset.
......@@ -137,7 +135,7 @@ FIRM_API void* pset_new_iterator_next(pset_new_iterator_t *iterator);
* @param pset_new Pointer to the pset_new
* @param iterator Pointer to the iterator
*/
FIRM_API void pset_new_remove_iterator(pset_new_t *pset_new, const pset_new_iterator_t *iterator);
void pset_new_remove_iterator(pset_new_t *pset_new, const pset_new_iterator_t *iterator);
/**
* Convenience macro for iterating over a pset_new.
......@@ -147,6 +145,4 @@ FIRM_API void pset_new_remove_iterator(pset_new_t *pset_new, const pset_new_iter
ptr = (type) pset_new_iterator_next(&iter); \
ptr != NULL; ptr = (type) pset_new_iterator_next(&iter))
#include "../end.h"
#endif
......@@ -38,7 +38,7 @@
#include "irgmod.h"
#include "irnodeset.h"
#include "irnodehashmap.h"
#include "adt/cpset.h"
#include "cpset.h"
#include "bearch.h"
#include "beuses.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment