symlist.h

Mon, 16 Feb 2004 18:04:44 +0100

author
tuomov
date
Mon, 16 Feb 2004 18:04:44 +0100
changeset 60
a4033700e35c
child 62
aae5facf9fc5
permissions
-rw-r--r--

trunk: changeset 1313
Moved Ion object system and other generic code from Ion to libtu.

60
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
1 /*
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
2 * libtu/symlist.h
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
3 *
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
4 * Copyright (c) Tuomo Valkonen 1999-2004.
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
5 *
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
6 * You may distribute and modify this library under the terms of either
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
7 * the Clarified Artistic License or the GNU LGPL, version 2.1 or later.
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
8 */
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
9
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
10 #ifndef LIBTU_SYMLIST_H
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
11 #define LIBTU_SYMLIST_H
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
12
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
13 #include "types.h"
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
14 #include "obj.h"
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
15
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
16
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
17 INTRSTRUCT(Symlist);
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
18
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
19
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
20 DECLSTRUCT(Symlist){
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
21 void *symbol;
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
22 Symlist *next, *prev;
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
23 };
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
24
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
25
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
26 #define ITERATE_SYMLIST(TYPE, VAR, LIST) \
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
27 for((VAR)=(TYPE)symlist_init_iter(LIST); \
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
28 (VAR)!=NULL; \
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
29 (VAR)=(TYPE)symlist_iter())
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
30
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
31
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
32 bool symlist_insert(Symlist **symlist, void *symbol);
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
33 void symlist_remove(Symlist **symlist, void *symbol);
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
34 void symlist_clear(Symlist **symlist);
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
35 void *symlist_init_iter(Symlist *symlist);
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
36 void *symlist_iter();
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
37
a4033700e35c trunk: changeset 1313
tuomov
parents:
diff changeset
38 #endif /* LIBTU_SYMLIST_H */

mercurial