X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=include%2Flibfirm%2Fadt%2Feset.h;h=a68328bba32440c5195513b25ce9d78e0c7267b1;hb=5fd96fd51994f8a78491a266f80b30a34d1a6c7b;hp=60284fdb8defa6ac8f0373ec2c77717949fb22e3;hpb=435253f3a8766fec2ac2adf559bb10cfcb5d36f4;p=libfirm diff --git a/include/libfirm/adt/eset.h b/include/libfirm/adt/eset.h index 60284fdb8..a68328bba 100644 --- a/include/libfirm/adt/eset.h +++ b/include/libfirm/adt/eset.h @@ -1,5 +1,5 @@ /* - * 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. * @@ -24,10 +24,13 @@ * @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. @@ -36,23 +39,23 @@ 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 @@ -60,7 +63,7 @@ int eset_contains(eset *s, void *p); * * @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 @@ -68,9 +71,14 @@ void *eset_first(eset *s); * * @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