Various bug fixes related to the C switch.
[repair.git] / Repair / RepairCompiler / MCC / CRuntime / tmap.h
1 #ifndef TMAP_H
2 #define TMAP_H
3 #include "classlist.h"
4 #include "redblack.h"
5
6 #ifndef bool
7 #define bool int
8 #endif
9
10 #ifndef true
11 #define true 1
12 #endif
13
14 #ifndef false
15 #define false 0
16 #endif
17
18 struct typemap * allocatetypemap();
19 void freetypemap(struct typemap *);
20 void typemapreset(struct typemap *);
21 void initializetypemapstack(struct typemap *, void *high);
22
23 void typemapallocate(struct typemap *, void *, int);
24 void typemapdeallocate(struct typemap *, void *);
25 bool typemapassertvalidmemoryB(struct typemap *, void* low, void* high);
26 bool typemapasserttypeB(struct typemap *, void *ptr, void *high, int structure);
27 bool typemapassertvalidmemory(struct typemap *, void* low, int structure);
28 bool typemapasserttype(struct typemap *, void *ptr, int structure);
29 bool typemapistype(struct typemap *, void *ptr, void *high, int structure);
30 bool typemapcheckmemory(struct typemap *, void* low, void* high);
31 bool typemapchecktype(struct typemap *, bool doaction,void *ptr, int structure);
32 bool typemapchecktypeB(struct typemap *, bool doaction, void *low, void *high,int structure, struct rbtree *ttree);
33 int typemapfindoffsetstructure(struct typemap *, int s, int offset);
34
35
36 struct typemap {
37   void *low;
38   void *high;
39   struct rbtree *alloctree;
40   struct rbtree *typetree;
41 };
42
43 struct structuremap * allocatestructuremap(int s);
44 void freestructuremap(struct structuremap *);
45
46 struct structuremap {
47   int str;
48   struct rbtree *typetree;
49 };
50 #endif