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

Last change on this file since 8360 was 8360, checked in by bird, 23 years ago

Support for other watcom target OSes.

File size: 4.4 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 KBOOL fResident;
53 unsigned long 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 kExportI, public kFileFormatBase, public kModuleI
64{
65 private:
66 /**@cat pointers to different sections */
67 char *pszType;
68 KBOOL fProgram;
69 KBOOL fLibrary;
70 KBOOL fPhysicalDevice;
71 KBOOL fVirtualDevice;
72 KBOOL fInitInstance;
73 KBOOL fTermInstance;
74 KBOOL fInitGlobal;
75 KBOOL fTermGlobal;
76 char *pszModName;
77 char chAppType;
78
79 char *pszBase;
80 char *pszCode;
81 char *pszData;
82 char *pszDescription;
83 char *pszExeType;
84 char *pszHeapSize;
85 char *pszOld;
86 char *pszProtmode;
87 char *pszStackSize;
88 char *pszStub;
89
90 /**@cat Lists to multistatement sections */
91 PDEFSEGMENT pSegments;
92 PDEFIMPORT pImports;
93 PDEFEXPORT pExports;
94
95 /**@cat internal functions */
96 void read(kFile *pFile) throw (kError);
97 char *readln(kFile *pFile, char *pszBuffer, int cbBuffer) throw (kError);
98 KBOOL isKeyword(const char *psz);
99 KBOOL setModuleName(void);
100
101 public:
102 /**@cat Constructor/Destructor */
103 kFileDef(kFile *pFile) throw(kError);
104 virtual ~kFileDef();
105
106 /** @cat Module information methods. */
107 KBOOL moduleGetName(char *pszBuffer, int cchSize = 260);
108
109 /** @cat Export enumeration methods. */
110 KBOOL exportFindFirst(kExportEntry *pExport);
111 KBOOL exportFindNext(kExportEntry *pExport);
112 void exportFindClose(kExportEntry *pExport);
113
114 /** @cat Export Lookup methods */
115 KBOOL exportLookup(unsigned long ulOrdinal, kExportEntry *pExport);
116 KBOOL exportLookup(const char * pszName, kExportEntry *pExport);
117
118 /**@cat queries... */
119 KBOOL isDef() const { return TRUE;}
120 char const *queryModuleName(void) const { return pszModName; }
121 char const *queryType(void) const { return pszType; }
122 char const *queryBase(void) const { return pszBase; }
123 char const *queryCode(void) const { return pszCode; }
124 char const *queryData(void) const { return pszData; }
125 char const *queryDescription(void) const { return pszDescription; }
126 char const *queryExeType(void) const { return pszExeType; }
127 char const *queryHeapSize(void) const { return pszHeapSize; }
128 char const *queryOld(void) const { return pszOld; }
129 char const *queryProtmode(void) const { return pszProtmode; }
130 char const *queryStackSize(void) const { return pszStackSize; }
131 char const *queryStub(void) const { return pszStub; }
132
133 /**@cat Operations */
134 KBOOL makeWatcomLinkFileAddtion(kFile *pFile, int enmOS) throw(kError);
135
136 enum {fullscreen = 0, pmvio = 2, pm = 3, unknown = 255};
137 enum {os2, dos, win32, win16, nlm, qnx, elf};
138};
139
140#endif
Note: See TracBrowser for help on using the repository browser.