]> git.sur5r.net Git - cc65/blob - src/ld65/o65.h
Allow numeric OS types in the config file
[cc65] / src / ld65 / o65.h
1 /*****************************************************************************/
2 /*                                                                           */
3 /*                                   o65.h                                   */
4 /*                                                                           */
5 /*                  Module to handle the o65 binary format                   */
6 /*                                                                           */
7 /*                                                                           */
8 /*                                                                           */
9 /* (C) 1999-2005 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 O65_H
37 #define O65_H
38
39
40
41 #include <stdio.h>
42
43 #include "extsyms.h"
44 #include "config.h"
45
46
47
48 /*****************************************************************************/
49 /*                                   Data                                    */
50 /*****************************************************************************/
51
52
53
54 /* Structure describing the format */
55 typedef struct O65Desc O65Desc;
56
57 /* Option tags */
58 #define O65OPT_FILENAME         0
59 #define O65OPT_OS               1
60 #define O65OPT_ASM              2
61 #define O65OPT_AUTHOR           3
62 #define O65OPT_TIMESTAMP        4
63
64 /* Operating system codes for O65OPT_OS */
65 #define O65OS_MIN               1
66 #define O65OS_OSA65             1
67 #define O65OS_LUNIX             2
68 #define O65OS_CC65              3
69 #define O65OS_MAX               255
70
71
72
73 /*****************************************************************************/
74 /*                                   Code                                    */
75 /*****************************************************************************/
76
77
78
79 O65Desc* NewO65Desc (void);
80 /* Create, initialize and return a new O65 descriptor struct */
81
82 void FreeO65Desc (O65Desc* D);
83 /* Delete the descriptor struct with cleanup */
84
85 void O65Set6502 (O65Desc* D);
86 /* Enable 6502 mode */
87
88 void O65Set65816 (O65Desc* D);
89 /* Enable 816 mode */
90
91 void O65SetSmallModel (O65Desc* D);
92 /* Enable a small memory model executable */
93
94 void O65SetLargeModel (O65Desc* D);
95 /* Enable a large memory model executable */
96
97 void O65SetAlignment (O65Desc* D, unsigned Align);
98 /* Set the executable alignment */
99
100 void O65SetOption (O65Desc* D, unsigned Type, const void* Data, unsigned DataLen);
101 /* Set an o65 header option */
102
103 void O65SetOS (O65Desc* D, unsigned OS, unsigned Version, unsigned Id);
104 /* Set an option describing the target operating system */
105
106 ExtSym* O65GetImport (O65Desc* D, unsigned Ident);
107 /* Return the imported symbol or NULL if not found */
108
109 void O65SetImport (O65Desc* D, unsigned Ident);
110 /* Set an imported identifier */
111
112 ExtSym* O65GetExport (O65Desc* D, unsigned Ident);
113 /* Return the exported symbol or NULL if not found */
114
115 void O65SetExport (O65Desc* D, unsigned Ident);
116 /* Set an exported identifier */
117
118 void O65WriteTarget (O65Desc* D, File* F);
119 /* Write an o65 output file */
120
121
122
123 /* End of o65.h */
124
125 #endif
126
127
128