/*
- * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
+ * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
* @author Hubert Schmid
* @date 09.06.2002
* @version $Id$
+ * @deprecated
*/
#ifndef FIRM_ADT_ESET_H
#define FIRM_ADT_ESET_H
+#include "../begin.h"
+
/**
* "eset" is a set of addresses. The addresses are used for element
* compare and hash calculation.
typedef struct eset eset;
/** Creates a new empty set. */
-eset *eset_create(void);
+FIRM_API eset *eset_create(void);
/**
* Creates a copy of the given set. Does NOT work if NULL is contained in source. */
-eset *eset_copy(eset *source);
+FIRM_API eset *eset_copy(eset *source);
/** Deletes a set. */
-void eset_destroy(eset *s);
+FIRM_API void eset_destroy(eset *s);
/** Returns the number of elements in the set. */
-int eset_count(eset *s);
+FIRM_API int eset_count(eset *s);
/** Inserts an address into the set. */
-void eset_insert(eset *s, void *p);
+FIRM_API void eset_insert(eset *s, void *p);
/** Checks, whether an address is element of a set. */
-int eset_contains(eset *s, void *p);
+FIRM_API int eset_contains(eset *s, void *p);
/**
* Starts the iteration over a set and returns the first element or NULL
*
* @note: It is NOT possible to add new elements while iterating through a set.
*/
-void *eset_first(eset *s);
+FIRM_API void *eset_first(eset *s);
/**
* Continues iteration through a set and returns the next element or NULL if the
*
* @note: It is NOT possible to add new elements while iterating through a set.
*/
-void *eset_next(eset *s);
+FIRM_API void *eset_next(eset *s);
/** Inserts all elements of source into target (union). Does NOT work if NULL is contained in source. */
-void eset_insert_all(eset *target, eset *source);
+FIRM_API void eset_insert_all(eset *target, eset *source);
+
+#define eset_foreach(eset, type, iter) \
+ for ((iter) = (type)eset_first((eset)); (iter) != NULL; (iter) = (type)eset_next((eset)))
+
+#include "../end.h"
#endif