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
53void ObjOpen (void);
54/* Open the object file for writing, write a dummy header */
55
56void ObjClose (void);
57/* Write an update header and close the object file. */
58
59unsigned long ObjGetFilePos (void);
60/* Get the current file position */
61
62void ObjSetFilePos (unsigned long Pos);
63/* Set the file position */
64
65void ObjWrite8 (unsigned V);
66/* Write an 8 bit value to the file */
67
68void ObjWrite16 (unsigned V);
69/* Write a 16 bit value to the file */
70
71void ObjWrite24 (unsigned long V);
72/* Write a 24 bit value to the file */
73
74void ObjWrite32 (unsigned long V);
75/* Write a 32 bit value to the file */
76
77void ObjWriteVar (unsigned long V);
78/* Write a variable sized value to the file in special encoding */
79
80void ObjWriteStr (const char* S);
81/* Write a string to the object file */
82
83void ObjWriteBuf (const StrBuf* S);
84/* Write a string to the object file */
85
86void ObjWriteData (const void* Data, unsigned Size);
87/* Write literal data to the file */
88
89void ObjWritePos (const FilePos* Pos);
90/* Write a file position to the object file */
91
92void ObjStartOptions (void);
93/* Mark the start of the option section */
94
95void ObjEndOptions (void);
96/* Mark the end of the option section */
97
98void ObjStartFiles (void);
99/* Mark the start of the files section */
100
101void ObjEndFiles (void);
102/* Mark the end of the files section */
103
104void ObjStartSegments (void);
105/* Mark the start of the segment section */
106
107void ObjEndSegments (void);
108/* Mark the end of the segment section */
109
110void ObjStartImports (void);
111/* Mark the start of the import section */
112
113void ObjEndImports (void);
114/* Mark the end of the import section */
115
116void ObjStartExports (void);
117/* Mark the start of the export section */
118
119void ObjEndExports (void);
120/* Mark the end of the export section */
121
122void ObjStartDbgSyms (void);
123/* Mark the start of the debug symbol section */
124
125void ObjEndDbgSyms (void);
126/* Mark the end of the debug symbol section */
127
128void ObjStartLineInfos (void);
129/* Mark the start of the line info section */
130
131void ObjEndLineInfos (void);
132/* Mark the end of the line info section */
133
134void ObjStartStrPool (void);
135/* Mark the start of the string pool section */
136
137void ObjEndStrPool (void);
138/* Mark the end of the string pool section */
139
140void ObjStartAssertions (void);
141/* Mark the start of the assertion table */
142
143void ObjEndAssertions (void);
144/* Mark the end of the assertion table */
145
146void ObjStartScopes (void);
147/* Mark the start of the scope table */
148
149void ObjEndScopes (void);
150/* Mark the end of the scope table */
151
152void ObjStartSpans (void);
153/* Mark the start of the span table */
154
155void ObjEndSpans (void);
156/* Mark the end of the span table */
157
158
159
160/* End of objfile.h */
161
162#endif
163