annotate src/klist.h @ 1494:9225a90ad7dd

make Doctree a non-virtual class Doctree now is a proper class with it's own implementation. StyleEngine no longer needs to provide the Doctree interface itself. This hopefully make the code easier to understand and should also be a bit faster as no virtual methods are involved.
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Thu, 07 Jan 2010 16:23:05 +0100
parents 6ee11bf9e3ea
children
rev   line source
0
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
1 #ifndef __KLIST_H__
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
2 #define __KLIST_H__
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
3
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
4 #include "../dlib/dlib.h"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
5
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
6
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
7 #ifdef __cplusplus
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
8 extern "C" {
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
9 #endif /* __cplusplus */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
10
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
11 typedef struct _KlistNode KlistNode_t;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
12 typedef struct _Klist Klist_t;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
13
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
14 struct _KlistNode {
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
15 int Key; /* primary key */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
16 void *Data; /* data reference */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
17 };
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
18
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
19 struct _Klist {
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
20 Dlist *List;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
21 int Clean; /* check flag */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
22 int Counter; /* counter (for making keys) */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
23 };
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
24
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
25
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
26 /*
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
27 * Function prototypes
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
28 */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
29 void* a_Klist_get_data(Klist_t *Klist, int Key);
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
30 int a_Klist_insert(Klist_t **Klist, void *Data);
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
31 void a_Klist_remove(Klist_t *Klist, int Key);
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
32 int a_Klist_length(Klist_t *Klist);
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
33 void a_Klist_free(Klist_t **Klist);
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
34
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
35
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
36 #ifdef __cplusplus
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
37 }
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
38 #endif /* __cplusplus */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
39
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
40 #endif /* __KLIST_H__ */