]> git.sur5r.net Git - cc65/blob - src/ca65/objfile.h
Restructuring the object file format
[cc65] / src / ca65 / objfile.h
1 /*****************************************************************************/
2 /*                                                                           */
3 /*                                 objfile.h                                 */
4 /*                                                                           */
5 /*         Object file writing routines for the ca65 macroassembler          */
6 /*                                                                           */
7 /*                                                                           */
8 /*                                                                           */
9 /* (C) 1998-2003 Ullrich von Bassewitz                                       */
10 /*               Römerstrasse 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
44
45
46 /*****************************************************************************/
47 /*                                   Code                                    */
48 /*****************************************************************************/
49
50
51
52 void ObjOpen (void);
53 /* Open the object file for writing, write a dummy header */
54
55 void ObjClose (void);
56 /* Write an update header and close the object file. */
57
58 unsigned long ObjGetFilePos (void);
59 /* Get the current file position */
60
61 void ObjSetFilePos (unsigned long Pos);
62 /* Set the file position */
63
64 void ObjWrite8 (unsigned V);
65 /* Write an 8 bit value to the file */
66
67 void ObjWrite16 (unsigned V);
68 /* Write a 16 bit value to the file */
69
70 void ObjWrite24 (unsigned long V);
71 /* Write a 24 bit value to the file */
72
73 void ObjWrite32 (unsigned long V);
74 /* Write a 32 bit value to the file */
75
76 void ObjWriteVar (unsigned long V);
77 /* Write a variable sized value to the file in special encoding */
78
79 void ObjWriteStr (const char* S);
80 /* Write a string to the object file */
81
82 void ObjWriteData (const void* Data, unsigned Size);
83 /* Write literal data to the file */
84
85 void ObjWritePos (const FilePos* Pos);
86 /* Write a file position to the object file */
87
88 void ObjStartOptions (void);
89 /* Mark the start of the option section */
90
91 void ObjEndOptions (void);
92 /* Mark the end of the option section */
93
94 void ObjStartFiles (void);
95 /* Mark the start of the files section */
96
97 void ObjEndFiles (void);
98 /* Mark the end of the files section */
99
100 void ObjStartSegments (void);
101 /* Mark the start of the segment section */
102
103 void ObjEndSegments (void);
104 /* Mark the end of the segment section */
105
106 void ObjStartImports (void);
107 /* Mark the start of the import section */
108
109 void ObjEndImports (void);
110 /* Mark the end of the import section */
111
112 void ObjStartExports (void);
113 /* Mark the start of the export section */
114
115 void ObjEndExports (void);
116 /* Mark the end of the export section */
117
118 void ObjStartDbgSyms (void);
119 /* Mark the start of the debug symbol section */
120
121 void ObjEndDbgSyms (void);
122 /* Mark the end of the debug symbol section */
123
124 void ObjStartLineInfos (void);
125 /* Mark the start of the line info section */
126
127 void ObjEndLineInfos (void);
128 /* Mark the end of the line info section */
129
130 void ObjStartStrPool (void);
131 /* Mark the start of the string pool section */
132
133 void ObjEndStrPool (void);
134 /* Mark the end of the string pool section */
135
136
137
138 /* End of objfile.h */
139
140 #endif
141
142
143