Changeset 5536 for trunk/tools
- Timestamp:
- Apr 17, 2001, 6:24:17 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/SDF/sdf.c
r2027 r5536 1 /* $Id: sdf.c,v 1. 1 1999-12-09 00:38:32bird Exp $1 /* $Id: sdf.c,v 1.2 2001-04-17 04:24:17 bird Exp $ 2 2 * 3 3 * SDF dumper. SDF == Structur Definition Files. … … 29 29 typedef struct _SDFType 30 30 { 31 CHARszName[33];32 CHARszStruct[34];33 ULONGcb;34 ULONGulPointerLevel;35 ULONGaul[8];31 char szName[33]; 32 char szStruct[34]; 33 unsigned long cb; 34 unsigned long ulPointerLevel; 35 unsigned long aul[8]; 36 36 } SDFTYPE, *PSDFTYPE; 37 37 38 38 typedef struct _SDFMember 39 39 { 40 CHARszName[33];41 CHARszType[33];42 CHARszType2[34];43 ULONGcb;44 ULONGoffset;45 UCHARch1;46 UCHARch2;47 UCHARch3;48 UCHARchPointerLevel;49 ULONGaul[5];40 char szName[33]; 41 char szType[33]; 42 char szType2[34]; 43 unsigned long cb; 44 unsigned long offset; 45 unsigned char ch1; 46 unsigned char ch2; 47 unsigned char ch3; 48 unsigned char chPointerLevel; 49 unsigned long aul[5]; 50 50 } SDFMEMBER, *PSDFMEMBER; 51 51 … … 53 53 typedef struct _SDFStruct 54 54 { 55 CHAR szName[68]; 56 ULONG cb; 57 ULONG cMembers; 58 ULONG ul1; 59 USHORT us2a; 60 USHORT us2b; 61 ULONG ul3; 62 ULONG ul4; 63 ULONG ul5; 64 ULONG ul6; 55 char szName[33]; 56 char szDescription[35]; 57 unsigned long cb; 58 unsigned long cMembers; 59 unsigned long ul1; 60 unsigned short us2a; 61 unsigned short us2b; 62 unsigned long ul3; 63 unsigned long ul4; 64 unsigned long ul5; 65 unsigned long ul6; 65 66 SDFMEMBER aMembers[1]; 66 67 } SDFSTRUCT, *PSDFSTRUCT; … … 69 70 typedef struct _SDFHeader 70 71 { 71 ULONGcStructs;72 ULONGcTypes;73 ULONGul[12];72 unsigned long cStructs; 73 unsigned long cTypes; 74 unsigned long ul[12]; 74 75 } SDFHEADER, *PSDFHEADER; 75 76 … … 141 142 142 143 printf("Header:\n" 143 "-------\n"); 144 "-------\n" 145 "cStructs=%d\n" 146 "cTypes=%d\n", 147 pHdr->cStructs, 148 pHdr->cTypes); 144 149 for (i = 0; i < sizeof(pHdr->ul) / sizeof(pHdr->ul[0]); i++) 145 150 printf("ul[%#x] = 0x%08x\n", … … 154 159 if (i > 0) 155 160 printf("\n"); 156 printf("%3d struct: %-20s #members: %3d cb: 0x%04x",157 i, pStruct->szName, pStruct->cMembers, pStruct->cb );158 printf(" ul1=%08x us2a=%04x us2b=%04x ul3=%08x ul4=%08x ul5=%08x ul6=%08x\n",161 printf("%3d struct: %-20s #members: %3d cb: 0x%04x offset: %08x description: %s\n", 162 i, pStruct->szName, pStruct->cMembers, pStruct->cb, (unsigned)pStruct - (unsigned)pvFile, pStruct->szDescription); 163 printf("(ul1=%08x us2a=%04x us2b=%04x ul3=%08x ul4=%08x ul5=%08x ul6=%08x)\n", 159 164 pStruct->ul1, pStruct->us2a, pStruct->us2b, pStruct->ul3, pStruct->ul4, pStruct->ul5, pStruct->ul6); 160 165 fprintf(phOut, "struct %s /* #memb %d size %d (0x%03x) */\n{\n", … … 165 170 int k, cchName; 166 171 char szName[80]; 167 printf("\tname: %-18s type: %-14s size: %0 2x offset: %02x chPointerLevel: %d ch1-3:",172 printf("\tname: %-18s type: %-14s size: %04x offset: %02x chPointerLevel: %d ch1-3:", 168 173 pStruct->aMembers[j].szName, 169 174 pStruct->aMembers[j].szType, … … 296 301 pStruct = (PSDFSTRUCT)((unsigned)(pStruct+1) + sizeof(SDFMEMBER)*(pStruct->cMembers - 1)); 297 302 303 printf("typearray offset: 0x%08x\n\n", (unsigned)pStruct - (unsigned)pHdr); 298 304 return (PSDFTYPE)(unsigned)pStruct; 299 305 }
Note:
See TracChangeset
for help on using the changeset viewer.