| 521 | } |
| 522 | |
| 523 | void bDNA::dumpTypeDefinitions() |
| 524 | { |
| 525 | int i; |
| 526 | |
| 527 | int numTypes = mTypes.size(); |
| 528 | |
| 529 | for (i = 0; i < numTypes; i++) |
| 530 | { |
| 531 | } |
| 532 | |
| 533 | for (i = 0; i < (int)mStructs.size(); i++) |
| 534 | { |
| 535 | int totalBytes = 0; |
| 536 | short *oldStruct = mStructs[i]; |
| 537 | |
| 538 | int oldLookup = getReverseType(oldStruct[0]); |
| 539 | if (oldLookup == -1) |
| 540 | { |
| 541 | mCMPFlags[i] = FDF_NONE; |
| 542 | continue; |
| 543 | } |
| 544 | |
| 545 | short *newStruct = mStructs[oldLookup]; |
| 546 | char *typeName = mTypes[newStruct[0]]; |
| 547 | printf("%3d: %s ", i, typeName); |
| 548 | |
| 549 | //char *name = mNames[oldStruct[1]]; |
| 550 | int len = oldStruct[1]; |
| 551 | printf(" (%d fields) ", len); |
| 552 | oldStruct += 2; |
| 553 | |
| 554 | printf("{"); |
| 555 | int j; |
| 556 | for (j = 0; j < len; ++j, oldStruct += 2) |
| 557 | { |
| 558 | const char *name = m_Names[oldStruct[1]].m_name; |
| 559 | printf("%s %s", mTypes[oldStruct[0]], name); |
| 560 | int elemNumBytes = 0; |
| 561 | int arrayDimensions = getArraySizeNew(oldStruct[1]); |
| 562 | |
| 563 | if (m_Names[oldStruct[1]].m_isPointer) |
| 564 | { |
| 565 | elemNumBytes = VOID_IS_8 ? 8 : 4; |
| 566 | } |
| 567 | else |
| 568 | { |
| 569 | elemNumBytes = getLength(oldStruct[0]); |
| 570 | } |
| 571 | printf(" /* %d bytes */", elemNumBytes * arrayDimensions); |
| 572 | |
| 573 | if (j == len - 1) |
| 574 | { |
| 575 | printf(";}"); |
| 576 | } |
| 577 | else |
| 578 | { |
| 579 | printf("; "); |
| 580 | } |