4 * Copyrigth (C) 1995-2007 University of Karlsruhe. All right reserved.
6 * This file is part of libFirm.
8 * This file may be distributed and/or modified under the terms of the
9 * GNU General Public License version 2 as published by the Free Software
10 * Foundation and appearing in the file LICENSE.GPL included in the
11 * packaging of this file.
13 * Licensees holding valid libFirm Professional Edition licenses may use
14 * this file in accordance with the libFirm Commercial License.
15 * Agreement provided with the Software.
17 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
18 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * @brief Lists, err, Sets
26 * @date Mon 18 Oct 2004
29 # ifndef FIRM_ANA2_LSET_H
30 # define FIRM_ANA2_LSET_H
33 Data Types and Structures
35 /* Lists, err, Sets */
36 typedef struct lset_entry
39 struct lset_entry *next;
45 lset_entry_t *last; /* useful for lset_append */
46 lset_entry_t *curs; /* for lset_first/lset_next */
50 /* create a new lset */
51 lset_t *lset_create (void);
52 /* check whether the lset contains an entry for the given data */
53 int lset_contains (lset_t*, void*);
54 /* check whether the given lset is empty */
55 int lset_empty (lset_t*);
56 /* insert the data into the lset (unless there's an entry for it
58 void lset_insert (lset_t*, void*);
59 /* insert all entries from src into tgt */
60 void lset_insert_all (lset_t*, lset_t*);
61 /* append src to tgt. src is deallocated. */
62 void lset_append (lset_t*, lset_t*);
64 /* remove the entry for the given data element from the lset. return
65 TRUE iff it was on the list in the first place, FALSE else */
66 int lset_remove (lset_t*, void*);
67 /* prepare the given lset for an iteration. return the first element. */
68 void *lset_first (lset_t*);
69 /* after calling lset_first, get the next element, if applicable, or
71 void *lset_next (lset_t*);
72 /* say how many entries there are in the given lset */
73 int lset_n_entries (lset_t*);
74 /* deallocate the lset and all of its entries */
75 void lset_destroy (lset_t*);
84 Revision 1.1 2004/10/21 11:09:37 liekweg
85 Moved memwalk stuf into irmemwalk
86 Moved lset stuff into lset
87 Moved typalise stuff into typalise