4 extern jmp_buf error_handler;
5 extern int instructioncount;
6 extern int failurecount;
11 #define TAGARRAYINTERVAL 10
12 #define OBJECTARRAYINTERVAL 10
14 #define ARRAYSET(array, type, index, value) \
15 ((type *)(&(& array->___length___)[1]))[index]=value
17 #define ARRAYGET(array, type, index) \
18 ((type *)(&(& array->___length___)[1]))[index]
27 void * allocate_newglobal(transrecord_t *, int type);
28 struct ArrayObject * allocate_newarrayglobal(transrecord_t *, int type, int length);
33 void * allocate_new(void *, int type);
34 struct ArrayObject * allocate_newarray(void *, int type, int length);
35 struct ___String___ * NewString(void *, const char *str,int length);
36 struct ___TagDescriptor___ * allocate_tag(void *ptr, int index);
38 void * allocate_new(int type);
39 struct ArrayObject * allocate_newarray(int type, int length);
40 struct ___String___ * NewString(const char *str,int length);
41 struct ___TagDescriptor___ * allocate_tag(int index);
46 void initializeexithandler();
47 void failedboundschk();
50 void injectinstructionfailure();
51 void createstartupobject();
54 #define VAR(name) ___params___->name
55 #define CALL00(name) name(struct name ## _params * ___params___)
56 #define CALL01(name, alt) name(struct name ## _params * ___params___)
57 #define CALL02(name, alt1, alt2) name(struct name ## _params * ___params___)
58 #define CALL11(name,rest, alt) name(struct name ## _params * ___params___, rest)
59 #define CALL12(name,rest, alt1, alt2) name(struct name ## _params * ___params___, rest)
60 #define CALL22(name, rest, rest2, alt1, alt2) name(struct name ## _params * ___params___, rest, rest2)
61 #define CALL23(name, rest, rest2, alt1, alt2, alt3) name(struct name ## _params * ___params___, rest, rest2)
62 #define CALL24(name, rest, rest2, alt1, alt2, alt3, alt4) name(struct name ## _params * ___params___, rest, rest2)
63 #define CALL34(name, rest, rest2, rest3, alt1, alt2, alt3, alt4) name(struct name ## _params * ___params___, rest, rest2, rest3)
65 #define VAR(name) name
66 #define CALL00(name) name()
67 #define CALL01(name, alt) name(alt)
68 #define CALL02(name, alt1, alt2) name(alt1, alt2)
69 #define CALL11(name,rest, alt) name(alt)
70 #define CALL12(name,rest, alt1, alt2) name(alt1, alt2)
71 #define CALL22(name, rest, rest2, alt1, alt2) name(alt1, alt2)
72 #define CALL23(name, rest, rest2, alt1, alt2, alt3) name(alt1, alt2, alt3)
73 #define CALL24(name, rest, rest2, alt1, alt2, alt3, alt4) name(alt1, alt2, alt3, alt4)
74 #define CALL34(name, rest, rest2, rest3, alt1, alt2, alt3, alt4) name(alt1, alt2, alt3, alt4)
78 #include "SimpleHash.h"
79 #include "ObjectHash.h"
81 #include "structdefs.h"
83 #include "optionalstruct.h"
87 struct failedtasklist {
88 struct taskdescriptor *task;
92 struct failedtasklist *next;
96 void flagorand(void * ptr, int ormask, int andmask);
97 void flagorandinit(void * ptr, int ormask, int andmask);
101 struct tagobjectiterator {
102 int istag; /* 0 if object iterator, 1 if tag iterator */
103 struct ObjectIterator it; /* Object iterator */
104 struct ObjectHash * objectset;
109 int tagobjindex; /* Index for tag or object depending on use */
110 /*if tag we have an object binding */
113 /*if object, we may have one or more tag bindings */
115 int tagbindings[MAXTASKPARAMS-1]; /* list slots */
118 struct parameterwrapper {
119 struct parameterwrapper *next;
120 struct ObjectHash * objectset;
125 struct taskdescriptor * task;
127 struct tagobjectiterator iterators[MAXTASKPARAMS-1];
130 struct taskparamdescriptor {
131 struct taskdescriptor * task;
133 void ** parameterArray;
139 int hashCodetpd(struct taskparamdescriptor *);
140 int comparetpd(struct taskparamdescriptor *, struct taskparamdescriptor *);
142 void toiReset(struct tagobjectiterator * it);
143 int toiHasNext(struct tagobjectiterator *it, void ** objectarray OPTARG(int * failed));
144 void toiNext(struct tagobjectiterator *it , void ** objectarray OPTARG(int * failed));
145 void processobject(struct parameterwrapper *parameter, int index, struct parameterdescriptor *pd, int *iteratorcount, int * statusarray, int numparams);
146 void processtags(struct parameterdescriptor *pd, int index, struct parameterwrapper *parameter, int * iteratorcount, int *statusarray, int numparams);
147 void builditerators(struct taskdescriptor * task, int index, struct parameterwrapper * parameter);
148 int enqueuetasks(struct parameterwrapper *parameter, struct parameterwrapper *prevptr, struct ___Object___ *ptr, int * enterflags, int numenterflags);