1 | /*****************************************************************************/ |
2 | /* */ |
3 | /* condes.h */ |
4 | /* */ |
5 | /* Module constructor/destructor support */ |
6 | /* */ |
7 | /* */ |
8 | /* */ |
9 | /* (C) 2000-2012, 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 CONDES_H |
37 | #define CONDES_H |
38 | |
39 | |
40 | |
41 | /* common */ |
42 | #include "filepos.h" |
43 | |
44 | |
45 | |
46 | /*****************************************************************************/ |
47 | /* Forwards */ |
48 | /*****************************************************************************/ |
49 | |
50 | |
51 | |
52 | struct Export; |
53 | |
54 | |
55 | |
56 | /*****************************************************************************/ |
57 | /* Data */ |
58 | /*****************************************************************************/ |
59 | |
60 | |
61 | |
62 | /* Order of the tables */ |
63 | typedef enum { |
64 | cdIncreasing, /* Increasing priority - default */ |
65 | cdDecreasing /* Decreasing priority */ |
66 | } ConDesOrder; |
67 | |
68 | /* Data for a forced condes import */ |
69 | typedef struct ConDesImport ConDesImport; |
70 | struct ConDesImport { |
71 | unsigned Name; /* Name of the import */ |
72 | FilePos Pos; /* Position of import in the config file */ |
73 | unsigned AddrSize; /* Address size of the symbol */ |
74 | }; |
75 | |
76 | |
77 | |
78 | /*****************************************************************************/ |
79 | /* Code */ |
80 | /*****************************************************************************/ |
81 | |
82 | |
83 | |
84 | void ConDesAddExport (struct Export* E); |
85 | /* Add the given export to the list of constructors/destructor */ |
86 | |
87 | void ConDesSetSegName (unsigned Type, unsigned SegName); |
88 | /* Set the segment name where the table should go */ |
89 | |
90 | const ConDesImport* ConDesGetImport (unsigned Type); |
91 | /* Get the forced import for the given ConDes type. Returns NULL if there is |
92 | ** no forced import for this type. |
93 | */ |
94 | |
95 | void ConDesSetImport (unsigned Type, const ConDesImport* Import); |
96 | /* Set the forced import for the given ConDes type */ |
97 | |
98 | void ConDesSetLabel (unsigned Type, unsigned Name); |
99 | /* Set the label for the given ConDes type */ |
100 | |
101 | void ConDesSetCountSym (unsigned Type, unsigned Name); |
102 | /* Set the name for the given ConDes count symbol */ |
103 | |
104 | void ConDesSetOrder (unsigned Type, ConDesOrder Order); |
105 | /* Set the sorting oder for the given ConDes table */ |
106 | |
107 | int ConDesHasSegName (unsigned Type); |
108 | /* Return true if a segment name is already defined for this ConDes type */ |
109 | |
110 | int ConDesHasLabel (unsigned Type); |
111 | /* Return true if a label is already defined for this ConDes type */ |
112 | |
113 | void ConDesCreate (void); |
114 | /* Create the condes tables if requested */ |
115 | |
116 | void ConDesDump (void); |
117 | /* Dump ConDes data to stdout for debugging */ |
118 | |
119 | |
120 | |
121 | /* End of condes.h */ |
122 | |
123 | #endif |
124 | |