1 | /* $Id: kFileSDF.h,v 1.2 2002-02-24 02:47:27 bird Exp $
|
---|
2 | *
|
---|
3 | * kFileSDF- Structure Defintion File class declaration.
|
---|
4 | *
|
---|
5 | * Copyright (c) 1999-2001 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
|
---|
6 | *
|
---|
7 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
8 | *
|
---|
9 | */
|
---|
10 |
|
---|
11 |
|
---|
12 |
|
---|
13 | /*******************************************************************************
|
---|
14 | * Structures and Typedefs *
|
---|
15 | *******************************************************************************/
|
---|
16 | typedef struct _SDFType
|
---|
17 | {
|
---|
18 | char szName[33];
|
---|
19 | char szStruct[34];
|
---|
20 | unsigned long cb;
|
---|
21 | unsigned long ulPointerLevel;
|
---|
22 | unsigned long aul[8];
|
---|
23 | } SDFTYPE, *PSDFTYPE;
|
---|
24 |
|
---|
25 | typedef struct _SDFMember
|
---|
26 | {
|
---|
27 | char szName[33];
|
---|
28 | char szType[33];
|
---|
29 | char szType2[34];
|
---|
30 | unsigned long cb;
|
---|
31 | unsigned long offset;
|
---|
32 | unsigned char ch1;
|
---|
33 | unsigned char ch2;
|
---|
34 | unsigned char ch3;
|
---|
35 | unsigned char chPointerLevel;
|
---|
36 | unsigned long aul[5];
|
---|
37 | } SDFMEMBER, *PSDFMEMBER;
|
---|
38 |
|
---|
39 |
|
---|
40 | typedef struct _SDFStruct
|
---|
41 | {
|
---|
42 | char szName[33];
|
---|
43 | char szDescription[35];
|
---|
44 | unsigned long cb;
|
---|
45 | unsigned long cMembers;
|
---|
46 | unsigned long ul1;
|
---|
47 | unsigned short us2a;
|
---|
48 | unsigned short us2b;
|
---|
49 | unsigned long ul3;
|
---|
50 | unsigned long ul4;
|
---|
51 | unsigned long ul5;
|
---|
52 | unsigned long ul6;
|
---|
53 | SDFMEMBER aMembers[1];
|
---|
54 | } SDFSTRUCT, *PSDFSTRUCT;
|
---|
55 |
|
---|
56 |
|
---|
57 | typedef struct _SDFHeader
|
---|
58 | {
|
---|
59 | unsigned long cStructs;
|
---|
60 | unsigned long cTypes;
|
---|
61 | unsigned long ul[12];
|
---|
62 | } SDFHEADER, *PSDFHEADER;
|
---|
63 |
|
---|
64 |
|
---|
65 |
|
---|
66 | /**
|
---|
67 | * Structure Definition File Class.
|
---|
68 | * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no)
|
---|
69 | */
|
---|
70 | class kFileSDF : public kFileFormatBase, public kDbgTypeI
|
---|
71 | {
|
---|
72 | private:
|
---|
73 | PSDFHEADER pHdr;
|
---|
74 | PSDFSTRUCT* papStructs;
|
---|
75 | PSDFTYPE paTypes;
|
---|
76 |
|
---|
77 | void parseSDFFile(void *pvFile) throw (kError);
|
---|
78 | PSDFTYPE getType(const char *pszType);
|
---|
79 | PSDFSTRUCT getStruct(const char *pszStruct);
|
---|
80 |
|
---|
81 | public:
|
---|
82 | kFileSDF(kFile *pFile) throw (kError);
|
---|
83 | ~kFileSDF() throw (kError);
|
---|
84 |
|
---|
85 | /** @cat Debug Type information methods. */
|
---|
86 | kDbgTypeEntry * dbgtypeFindFirst(int flFlags);
|
---|
87 | kDbgTypeEntry * dbgtypeFindNext(kDbgTypeEntry *kDbgTypeEntry);
|
---|
88 | void dbgtypeFindClose(kDbgTypeEntry *kDbgTypeEntry);
|
---|
89 |
|
---|
90 | kDbgTypeEntry * dbgtypeLookup(const char *pszName, int flFlags);
|
---|
91 |
|
---|
92 | /** @cat Generic dump */
|
---|
93 | KBOOL dump(kFile *pOut);
|
---|
94 | };
|
---|
95 |
|
---|