1 | /*****************************************************************************/ |
2 | /* */ |
3 | /* objfile.h */ |
4 | /* */ |
5 | /* Object file writing routines for the ca65 macroassembler */ |
6 | /* */ |
7 | /* */ |
8 | /* */ |
9 | /* (C) 1998-2011, Ullrich von Bassewitz */ |
10 | /* Roemerstrasse 52 */ |
11 | /* D-70794 Filderstadt */ |
12 | /* EMail: uz@cc65.org */ |
13 | /* */ |
14 | /* */ |
15 | /* This software is provided 'as-is', without any expressed or implied */ |
16 | /* warranty. In no event will the authors be held liable for any damages */ |
17 | /* arising from the use of this software. */ |
18 | /* */ |
19 | /* Permission is granted to anyone to use this software for any purpose, */ |
20 | /* including commercial applications, and to alter it and redistribute it */ |
21 | /* freely, subject to the following restrictions: */ |
22 | /* */ |
23 | /* 1. The origin of this software must not be misrepresented; you must not */ |
24 | /* claim that you wrote the original software. If you use this software */ |
25 | /* in a product, an acknowledgment in the product documentation would be */ |
26 | /* appreciated but is not required. */ |
27 | /* 2. Altered source versions must be plainly marked as such, and must not */ |
28 | /* be misrepresented as being the original software. */ |
29 | /* 3. This notice may not be removed or altered from any source */ |
30 | /* distribution. */ |
31 | /* */ |
32 | /*****************************************************************************/ |
33 | |
34 | |
35 | |
36 | #ifndef OBJFILE_H |
37 | #define OBJFILE_H |
38 | |
39 | |
40 | |
41 | /* common */ |
42 | #include "filepos.h" |
43 | #include "strbuf.h" |
44 | |
45 | |
46 | |
47 | /*****************************************************************************/ |
48 | /* Code */ |
49 | /*****************************************************************************/ |
50 | |
51 | |
52 | |
53 | void ObjOpen (void); |
54 | /* Open the object file for writing, write a dummy header */ |
55 | |
56 | void ObjClose (void); |
57 | /* Write an update header and close the object file. */ |
58 | |
59 | unsigned long ObjGetFilePos (void); |
60 | /* Get the current file position */ |
61 | |
62 | void ObjSetFilePos (unsigned long Pos); |
63 | /* Set the file position */ |
64 | |
65 | void ObjWrite8 (unsigned V); |
66 | /* Write an 8 bit value to the file */ |
67 | |
68 | void ObjWrite16 (unsigned V); |
69 | /* Write a 16 bit value to the file */ |
70 | |
71 | void ObjWrite24 (unsigned long V); |
72 | /* Write a 24 bit value to the file */ |
73 | |
74 | void ObjWrite32 (unsigned long V); |
75 | /* Write a 32 bit value to the file */ |
76 | |
77 | void ObjWriteVar (unsigned long V); |
78 | /* Write a variable sized value to the file in special encoding */ |
79 | |
80 | void ObjWriteStr (const char* S); |
81 | /* Write a string to the object file */ |
82 | |
83 | void ObjWriteBuf (const StrBuf* S); |
84 | /* Write a string to the object file */ |
85 | |
86 | void ObjWriteData (const void* Data, unsigned Size); |
87 | /* Write literal data to the file */ |
88 | |
89 | void ObjWritePos (const FilePos* Pos); |
90 | /* Write a file position to the object file */ |
91 | |
92 | void ObjStartOptions (void); |
93 | /* Mark the start of the option section */ |
94 | |
95 | void ObjEndOptions (void); |
96 | /* Mark the end of the option section */ |
97 | |
98 | void ObjStartFiles (void); |
99 | /* Mark the start of the files section */ |
100 | |
101 | void ObjEndFiles (void); |
102 | /* Mark the end of the files section */ |
103 | |
104 | void ObjStartSegments (void); |
105 | /* Mark the start of the segment section */ |
106 | |
107 | void ObjEndSegments (void); |
108 | /* Mark the end of the segment section */ |
109 | |
110 | void ObjStartImports (void); |
111 | /* Mark the start of the import section */ |
112 | |
113 | void ObjEndImports (void); |
114 | /* Mark the end of the import section */ |
115 | |
116 | void ObjStartExports (void); |
117 | /* Mark the start of the export section */ |
118 | |
119 | void ObjEndExports (void); |
120 | /* Mark the end of the export section */ |
121 | |
122 | void ObjStartDbgSyms (void); |
123 | /* Mark the start of the debug symbol section */ |
124 | |
125 | void ObjEndDbgSyms (void); |
126 | /* Mark the end of the debug symbol section */ |
127 | |
128 | void ObjStartLineInfos (void); |
129 | /* Mark the start of the line info section */ |
130 | |
131 | void ObjEndLineInfos (void); |
132 | /* Mark the end of the line info section */ |
133 | |
134 | void ObjStartStrPool (void); |
135 | /* Mark the start of the string pool section */ |
136 | |
137 | void ObjEndStrPool (void); |
138 | /* Mark the end of the string pool section */ |
139 | |
140 | void ObjStartAssertions (void); |
141 | /* Mark the start of the assertion table */ |
142 | |
143 | void ObjEndAssertions (void); |
144 | /* Mark the end of the assertion table */ |
145 | |
146 | void ObjStartScopes (void); |
147 | /* Mark the start of the scope table */ |
148 | |
149 | void ObjEndScopes (void); |
150 | /* Mark the end of the scope table */ |
151 | |
152 | void ObjStartSpans (void); |
153 | /* Mark the start of the span table */ |
154 | |
155 | void ObjEndSpans (void); |
156 | /* Mark the end of the span table */ |
157 | |
158 | |
159 | |
160 | /* End of objfile.h */ |
161 | |
162 | #endif |
163 | |