5 * File name: ir/ana2/lset.h
6 * Purpose: Lists, err, Sets
9 * Created: Mon 18 Oct 2004
11 * Copyright: (c) 1999-2004 Universität Karlsruhe
12 * Licence: This file is protected by GPL - GNU GENERAL PUBLIC LICENSE.
19 Data Types and Structures
21 /* Lists, err, Sets */
22 typedef struct lset_entry
25 struct lset_entry *next;
31 lset_entry_t *last; /* useful for lset_append */
32 lset_entry_t *curs; /* for lset_first/lset_next */
36 /* create a new lset */
37 lset_t *lset_create (void);
38 /* check whether the lset contains an entry for the given data */
39 int lset_contains (lset_t*, void*);
40 /* check whether the given lset is empty */
41 int lset_empty (lset_t*);
42 /* insert the data into the lset (unless there's an entry for it
44 void lset_insert (lset_t*, void*);
45 /* insert all entries from src into tgt */
46 void lset_insert_all (lset_t*, lset_t*);
47 /* append src to tgt. src is deallocated. */
48 void lset_append (lset_t*, lset_t*);
50 /* remove the entry for the given data element from the lset. return
51 TRUE iff it was on the list in the first place, FALSE else */
52 int lset_remove (lset_t*, void*);
53 /* prepare the given lset for an iteration. return the first element. */
54 void *lset_first (lset_t*);
55 /* after calling lset_first, get the next element, if applicable, or
57 void *lset_next (lset_t*);
58 /* say how many entries there are in the given lset */
59 int lset_n_entries (lset_t*);
60 /* deallocate the lset and all of its entries */
61 void lset_destroy (lset_t*);
65 # endif /* not defined _LSET_H_ */
70 Revision 1.1 2004/10/21 11:09:37 liekweg
71 Moved memwalk stuf into irmemwalk
72 Moved lset stuff into lset
73 Moved typalise stuff into typalise