Fixed Win32 DLL support.
[libfirm] / include / libfirm / adt / eset.h
1 /*
2  * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief       a pointer hashset (WARNING: deprecated, use hashset_new.*
23  *              instead)
24  * @author      Hubert Schmid
25  * @date        09.06.2002
26  * @version     $Id$
27  * @deprecated
28  */
29 #ifndef FIRM_ADT_ESET_H
30 #define FIRM_ADT_ESET_H
31
32 #include "../begin.h"
33
34 /**
35  * "eset" is a set of addresses. The addresses are used for element
36  * compare and hash calculation.
37  * The value "NULL" can not be stored, as it is used as internal sentinel.
38  */
39 typedef struct eset eset;
40
41 /** Creates a new empty set. */
42 FIRM_API eset *eset_create(void);
43
44 /**
45  * Creates a copy of the given set. Does NOT work if NULL is contained in source. */
46 FIRM_API eset *eset_copy(eset *source);
47
48 /** Deletes a set. */
49 FIRM_API void eset_destroy(eset *s);
50
51 /** Returns the number of elements in the set. */
52 FIRM_API int eset_count(eset *s);
53
54 /** Inserts an address into the set. */
55 FIRM_API void eset_insert(eset *s, void *p);
56
57 /** Checks, whether an address is element of a set. */
58 FIRM_API int eset_contains(eset *s, void *p);
59
60 /**
61  * Starts the iteration over a set and returns the first element or NULL
62  * if the set is empty.
63  *
64  * @note: It is NOT possible to add new elements while iterating through a set.
65  */
66 FIRM_API void *eset_first(eset *s);
67
68 /**
69  * Continues iteration through a set and returns the next element or NULL if the
70  * iteration is finished.
71  *
72  * @note: It is NOT possible to add new elements while iterating through a set.
73  */
74 FIRM_API void *eset_next(eset *s);
75
76 /** Inserts all elements of source into target (union).  Does NOT work if NULL is contained in source. */
77 FIRM_API void eset_insert_all(eset *target, eset *source);
78
79 #include "../end.h"
80
81 #endif