source: trunk/tools/common/kFileDef.h@ 824

Last change on this file since 824 was 824, checked in by bird, 26 years ago

Initial checkin.

File size: 3.3 KB
Line 
1/*
2 * kFileDef - Definition files.
3 *
4 * Copyright (c) 1999 knut st. osmundsen
5 *
6 */
7#ifndef _kFileDef_h_
8#define _kFileDef_h_
9
10/*******************************************************************************
11* Defined Constants *
12*******************************************************************************/
13#define ORD_START_INTERNAL_FUNCTIONS 1200
14
15
16/*******************************************************************************
17* Structures and Typedefs *
18*******************************************************************************/
19
20/**
21 * Segment list entry.
22 */
23typedef struct _DefSegment
24{
25 char *psz;
26 struct _DefSegment *pNext;
27} DEFSEGMENT, *PDEFSEGMENT;
28
29
30
31/**
32 * Import list entry.
33 */
34typedef struct _DefImport
35{
36 unsigned long ulOrdinal;
37 char *pszName;
38 char *pszDll;
39 char *pszIntName;
40 struct _DefImport *pNext;
41} DEFIMPORT, *PDEFIMPORT;
42
43
44/**
45 * Export list entry.
46 */
47typedef struct _DefExport
48{
49 unsigned long ulOrdinal;
50 char *pszName;
51 char *pszIntName;
52 BOOL fResident;
53 ULONG cParam;
54 struct _DefExport *pNext;
55} DEFEXPORT, *PDEFEXPORT;
56
57
58/**
59 * Definition files.
60 * TODO: error handling.
61 * @author knut st. osmundsen
62 */
63class kFileDef : public kFileFormatBase
64{
65 private:
66 /**@cat pointers to different sections */
67 char *pszType;
68 char *pszBase;
69 char *pszCode;
70 char *pszData;
71 char *pszDescription;
72 char *pszExeType;
73 char *pszHeapSize;
74 char *pszOld;
75 char *pszProtmode;
76 char *pszStackSize;
77 char *pszStub;
78
79 /**@cat Lists to multistatement sections */
80 PDEFSEGMENT pSegments;
81 PDEFIMPORT pImports;
82 PDEFEXPORT pExports;
83
84 /**@cat internal functions */
85 void read(FILE *phFile) throw (int);
86 char *readln(FILE *phFile, char *pszBuffer, int cbBuffer) throw (int);
87 BOOL isKeyword(const char *psz);
88
89 public:
90 /**@cat Constructor/Destructor */
91 kFileDef(FILE *phFile) throw(int);
92 virtual ~kFileDef();
93
94 /**@cat queries... */
95 BOOL queryModuleName(char *pszBuffer);
96 BOOL findFirstExport(PEXPORTENTRY pExport);
97 BOOL findNextExport(PEXPORTENTRY pExport);
98 BOOL isDef() const { return TRUE;}
99 char const *queryType(void) const { return pszType; }
100 char const *queryBase(void) const { return pszBase; }
101 char const *queryCode(void) const { return pszCode; }
102 char const *queryData(void) const { return pszData; }
103 char const *queryDescription(void) const { return pszDescription; }
104 char const *queryExeType(void) const { return pszExeType; }
105 char const *queryHeapSize(void) const { return pszHeapSize; }
106 char const *queryOld(void) const { return pszOld; }
107 char const *queryProtmode(void) const { return pszProtmode; }
108 char const *queryStackSize(void) const { return pszStackSize; }
109 char const *queryStub(void) const { return pszStub; }
110};
111
112
113#endif
Note: See TracBrowser for help on using the repository browser.