- if(td->type != STRING && td->type != SEQUENCE && td->type != ARRAY){
- if(flag == 0) structCount++;
- flag++;
- if((structCount > 1 || whichTypeFirst == 2) && flag == 1){
- fprintf(fp,"\t//copy struct to buffer\n");
- fprintf(fp,"\tmemcpy(ptr, &__%d, sizeof(struct %s_%s_%d));\n",structCount, ev->name, facName,structCount);
- fprintf(fp,"\tptr += sizeof(struct %s_%s_%d);\n\n",ev->name, facName,structCount);
- }
- }else if(td->type == SEQUENCE){
- flag = 0;
- fprintf(fp,"\t//copy sequence length and sequence to buffer\n");
- fprintf(fp,"\t*ptr = seqLength_%d;\n",++seqCount);
- fprintf(fp,"\tptr += sizeof(%s);\n",uintOutputTypes[td->size]);
- fprintf(fp,"\tmemcpy(ptr, %s, sizeof(%s) * seqLength_%d);\n",fld->name, getTypeStr(td), seqCount);
- fprintf(fp,"\tptr += sizeof(%s) * seqLength_%d;\n\n",getTypeStr(td), seqCount );
- }else if(td->type==STRING){
- flag = 0;
- fprintf(fp,"\t//copy string to buffer\n");
- fprintf(fp,"\tif(strLength_%d > 0){\n",++strCount);
- fprintf(fp,"\t\tmemcpy(ptr, %s, strLength_%d + 1);\n", fld->name, strCount);
- fprintf(fp,"\t\tptr += strLength_%d + 1;\n",strCount);
- fprintf(fp,"\t}else{\n");
- fprintf(fp,"\t\t*ptr = '\\0';\n");
- fprintf(fp,"\t\tptr += 1;\n");
- fprintf(fp,"\t}\n\n");
+// if(td->type != STRING && td->type != SEQUENCE && td->type != ARRAY){
+// if(flag == 0) structCount++;
+// flag++;
+// if((structCount > 1 || whichTypeFirst == 2) && flag == 1){
+// assert(0); // MD : disabled !
+// fprintf(fp,"\t//copy struct to buffer\n");
+// fprintf(fp,"\tmemcpy(ptr, &__%d, sizeof(struct %s_%s_%d));\n",
+// structCount, ev->name, facName,structCount);
+// fprintf(fp,"\tptr += sizeof(struct %s_%s_%d);\n\n",
+// ev->name, facName,structCount);
+// }
+ // }
+ //else if(td->type == SEQUENCE){
+ if(td->type == SEQUENCE){
+ flag = 0;
+ fprintf(fp,"\t\t//copy sequence length and sequence to buffer\n");
+ fprintf(fp,"\t\t*ptr = seqlength_%d;\n",++seqCount);
+ fprintf(fp,"\t\tptr += sizeof(%s);\n",uintOutputTypes[td->size]);
+ fprintf(fp,"\t\tmemcpy(ptr, %s, sizeof(%s) * seqlength_%d);\n",
+ fld->name, getTypeStr(td), seqCount);
+ fprintf(fp,"\t\tptr += sizeof(%s) * seqlength_%d;\n\n",
+ getTypeStr(td), seqCount);
+ }
+ else if(td->type==STRING){
+ flag = 0;
+ fprintf(fp,"\t\t//copy string to buffer\n");
+ fprintf(fp,"\t\tif(strlength_%d > 0){\n",++strCount);
+ fprintf(fp,"\t\t\tmemcpy(ptr, %s, strlength_%d + 1);\n",
+ fld->name, strCount);
+ fprintf(fp,"\t\t\tptr += strlength_%d + 1;\n",strCount);
+ fprintf(fp,"\t\t}else{\n");
+ fprintf(fp,"\t\t\t*ptr = '\\0';\n");
+ fprintf(fp,"\t\t\tptr += 1;\n");
+ fprintf(fp,"\t\t}\n\n");