Changeset 5536 for trunk/tools


Ignore:
Timestamp:
Apr 17, 2001, 6:24:17 AM (24 years ago)
Author:
bird
Message:

Minor changes to the output.
Structures are synced with the ones in kFileSDF.h.

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:32 bird Exp $
     1/* $Id: sdf.c,v 1.2 2001-04-17 04:24:17 bird Exp $
    22 *
    33 * SDF dumper. SDF == Structur Definition Files.
     
    2929typedef struct _SDFType
    3030{
    31     CHAR szName[33];
    32     CHAR szStruct[34];
    33     ULONG cb;
    34     ULONG ulPointerLevel;
    35     ULONG aul[8];
     31    char            szName[33];
     32    char            szStruct[34];
     33    unsigned long  cb;
     34    unsigned long  ulPointerLevel;
     35    unsigned long  aul[8];
    3636} SDFTYPE, *PSDFTYPE;
    3737
    3838typedef struct _SDFMember
    3939{
    40     CHAR  szName[33];
    41     CHAR  szType[33];
    42     CHAR  szType2[34];
    43     ULONG cb;
    44     ULONG offset;
    45     UCHAR ch1;
    46     UCHAR ch2;
    47     UCHAR ch3;
    48     UCHAR chPointerLevel;
    49     ULONG aul[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];
    5050} SDFMEMBER, *PSDFMEMBER;
    5151
     
    5353typedef struct _SDFStruct
    5454{
    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;
    6566    SDFMEMBER aMembers[1];
    6667} SDFSTRUCT, *PSDFSTRUCT;
     
    6970typedef struct _SDFHeader
    7071{
    71     ULONG cStructs;
    72     ULONG cTypes;
    73     ULONG ul[12];
     72    unsigned long  cStructs;
     73    unsigned long  cTypes;
     74    unsigned long  ul[12];
    7475} SDFHEADER, *PSDFHEADER;
    7576
     
    141142
    142143    printf("Header:\n"
    143            "-------\n");
     144           "-------\n"
     145           "cStructs=%d\n"
     146           "cTypes=%d\n",
     147           pHdr->cStructs,
     148           pHdr->cTypes);
    144149    for (i = 0; i < sizeof(pHdr->ul) / sizeof(pHdr->ul[0]); i++)
    145150        printf("ul[%#x] = 0x%08x\n",
     
    154159        if (i > 0)
    155160            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",
    159164               pStruct->ul1, pStruct->us2a, pStruct->us2b, pStruct->ul3, pStruct->ul4, pStruct->ul5, pStruct->ul6);
    160165        fprintf(phOut, "struct %s /* #memb %d size %d (0x%03x) */\n{\n",
     
    165170            int k, cchName;
    166171            char szName[80];
    167             printf("\tname: %-18s type: %-14s size: %02x  offset: %02x  chPointerLevel: %d ch1-3:",
     172            printf("\tname: %-18s type: %-14s size: %04x  offset: %02x  chPointerLevel: %d ch1-3:",
    168173                   pStruct->aMembers[j].szName,
    169174                   pStruct->aMembers[j].szType,
     
    296301        pStruct = (PSDFSTRUCT)((unsigned)(pStruct+1) + sizeof(SDFMEMBER)*(pStruct->cMembers - 1));
    297302
     303    printf("typearray offset: 0x%08x\n\n", (unsigned)pStruct - (unsigned)pHdr);
    298304    return (PSDFTYPE)(unsigned)pStruct;
    299305}
Note: See TracChangeset for help on using the changeset viewer.