#ifndef TMAP_H
#define TMAP_H
#include "classlist.h"
-#include "redblack.h"
-#ifndef bool
-#define bool int
-#endif
-
-#ifndef true
-#define true 1
-#endif
-
-#ifndef false
-#define false 0
-#endif
-
-struct typemap * allocatetypemap();
-void freetypemap(struct typemap *);
-void typemapreset(struct typemap *);
-void initializetypemapstack(struct typemap *, void *high);
-
-void typemapallocate(struct typemap *, void *, int);
-void typemapdeallocate(struct typemap *, void *);
-bool typemapassertvalidmemoryB(struct typemap *, void* low, void* high);
-bool typemapasserttypeB(struct typemap *, void *ptr, void *high, int structure);
-bool typemapassertvalidmemory(struct typemap *, void* low, int structure);
-bool typemapasserttype(struct typemap *, void *ptr, int structure);
-bool typemapistype(struct typemap *, void *ptr, void *high, int structure);
-bool typemapcheckmemory(struct typemap *, void* low, void* high);
-bool typemapchecktype(struct typemap *, bool doaction,void *ptr, int structure);
-bool typemapchecktypeB(struct typemap *, bool doaction, void *low, void *high,int structure, struct rbtree *ttree);
-int typemapfindoffsetstructure(struct typemap *, int s, int offset);
-
-
-struct typemap {
+class typemap {
+ public:
+ typemap(typeobject *);
+ ~typemap();
+ void allocate(void *, int);
+ void deallocate(void *);
+ bool assertvalidmemory(void* low, void* high);
+ bool asserttype(void *ptr, void *high, int structure);
+ bool assertvalidmemory(void* low, int structure);
+ bool asserttype(void *ptr, int structure);
+ bool istype(void *ptr, void *high, int structure);
+ void reset();
+ typeobject *size;
+ void initializestack(void *high);
+ private:
void *low;
void *high;
+ bool checkmemory(void* low, void* high);
+ bool checktype(bool doaction,void *ptr, int structure);
+ bool checktype(bool doaction, void *low, void *high,int structure, struct rbtree *ttree);
+ int findoffsetstructure(int s, int offset);
struct rbtree *alloctree;
struct rbtree *typetree;
};
-struct structuremap * allocatestructuremap(int s);
-void freestructuremap(struct structuremap *);
-
-struct structuremap {
+class structuremap {
+ public:
+ structuremap(int s);
+ ~structuremap();
int str;
struct rbtree *typetree;
};