free(thisvar);
}
+inline int SimpleHashcountset(struct SimpleHash * thisvar) {
+ return thisvar->numelements;
+}
+
int SimpleHashfirstkey(struct SimpleHash *thisvar) {
struct ArraySimple *ptr=thisvar->listhead;
int index=0;
}
return 0;
}
+
+inline struct SimpleIterator * noargallocateSimpleIterator() {
+ return (struct SimpleIterator*)malloc(sizeof(struct SimpleIterator));
+}
+
+inline struct SimpleIterator * allocateSimpleIterator(struct ArraySimple *start, struct ArraySimple *tl, int tlindex) {
+ struct SimpleIterator *thisvar=(struct SimpleIterator*)malloc(sizeof(struct SimpleIterator));
+ thisvar->cur = start;
+ thisvar->index=0;
+ thisvar->tailindex=tlindex;
+ thisvar->tail=tl;
+ return thisvar;
+}
+
+inline int hasNext(struct SimpleIterator *thisvar) {
+ if (thisvar->cur==thisvar->tail &&
+ thisvar->index==thisvar->tailindex)
+ return 0;
+ while((thisvar->index==ARRAYSIZE)||!thisvar->cur->nodes[thisvar->index].inuse) {
+ if (thisvar->index==ARRAYSIZE) {
+ thisvar->index=0;
+ thisvar->cur=thisvar->cur->nextarray;
+ } else
+ thisvar->index++;
+ }
+ if (thisvar->cur->nodes[thisvar->index].inuse)
+ return 1;
+ else
+ return 0;
+}
+
+inline int next(struct SimpleIterator *thisvar) {
+ return thisvar->cur->nodes[thisvar->index++].data;
+}
+
+inline int key(struct SimpleIterator *thisvar) {
+ return thisvar->cur->nodes[thisvar->index].key;
+}
int tailindex;
};
-inline int SimpleHashcountset(struct SimpleHash * thisvar) {
- return thisvar->numelements;
-}
-
+inline int SimpleHashcountset(struct SimpleHash * thisvar);
/* SimpleHashExcepion *************************************************/
int index,tailindex;
};
-inline struct SimpleIterator * noargallocateSimpleIterator() {
- return (struct SimpleIterator*)malloc(sizeof(struct SimpleIterator));
-}
-
-inline struct SimpleIterator * allocateSimpleIterator(struct ArraySimple *start, struct ArraySimple *tl, int tlindex) {
- struct SimpleIterator *thisvar=(struct SimpleIterator*)malloc(sizeof(struct SimpleIterator));
- thisvar->cur = start;
- thisvar->index=0;
- thisvar->tailindex=tlindex;
- thisvar->tail=tl;
- return thisvar;
-}
-
-inline int hasNext(struct SimpleIterator *thisvar) {
- if (thisvar->cur==thisvar->tail &&
- thisvar->index==thisvar->tailindex)
- return 0;
- while((thisvar->index==ARRAYSIZE)||!thisvar->cur->nodes[thisvar->index].inuse) {
- if (thisvar->index==ARRAYSIZE) {
- thisvar->index=0;
- thisvar->cur=thisvar->cur->nextarray;
- } else
- thisvar->index++;
- }
- if (thisvar->cur->nodes[thisvar->index].inuse)
- return 1;
- else
- return 0;
-}
-
-inline int next(struct SimpleIterator *thisvar) {
- return thisvar->cur->nodes[thisvar->index++].data;
-}
-
-inline int key(struct SimpleIterator *thisvar) {
- return thisvar->cur->nodes[thisvar->index].key;
-}
+inline struct SimpleIterator * noargallocateSimpleIterator();
+
+inline struct SimpleIterator * allocateSimpleIterator(struct ArraySimple *start, struct ArraySimple *tl, int tlindex);
+
+inline int hasNext(struct SimpleIterator *thisvar);
+inline int next(struct SimpleIterator *thisvar);
+
+inline int key(struct SimpleIterator *thisvar);
struct RepairHashNode * allocateRepairHashNode(int setrelation, int rule, int lvalue, int rvalue, int data, int data2,int ismodify);
+
+
struct RepairHashNode {
struct RepairHashNode *next;
struct RepairHashNode *lnext;
private void generate_stateobject() {
CodeWriter crhead = new StandardCodeWriter(outputhead);
+ CodeWriter craux = new StandardCodeWriter(outputaux);
crhead.outputline("struct "+name+"_state {");
Iterator globals=state.stGlobals.descriptors();
while (globals.hasNext()) {
crhead.outputline(vd.getType().getGenerateType().getSafeSymbol()+" "+vd.getSafeSymbol()+";");
}
crhead.outputline("};");
+ crhead.outputline("struct "+name+"_state * allocate"+name+"_state();");
+ craux.outputline("struct "+name+"_state * allocate"+name+"_state()");
+ craux.startblock();
+ craux.outputline("return (struct "+name+"_state *) malloc(sizeof(struct "+name+"_state));");
+ craux.endblock();
+
+ crhead.outputline("void free"+name+"_state(struct "+name+"_state *);");
+ craux.outputline("void free"+name+"_state(struct "+name+"_state * thisvar)");
+ craux.startblock();
+ craux.outputline("free(thisvar);");
+ craux.endblock();
+
crhead.outputline("void "+name+"_statecomputesizes(struct "+name+"_state * ,int *,int **);");
crhead.outputline("void "+name+"_staterecomputesizes(struct "+name+"_state *);");
}
}
}
}
- craux.outputline("struct "+ name+"* "+name+"()");
+ craux.outputline("struct "+ name+"* allocate"+name+"()");
craux.startblock();
craux.outputline("/* creating hashtables */");