OLD | NEW |
1 /** | 1 /** |
2 * \file libyasm/objfmt.h | 2 * \file libyasm/objfmt.h |
3 * \brief YASM object format module interface. | 3 * \brief YASM object format module interface. |
4 * | 4 * |
5 * \rcs | 5 * \rcs |
6 * $Id: objfmt.h 2166 2009-01-02 08:33:21Z peter $ | 6 * $Id: objfmt.h 2310 2010-03-28 19:28:54Z peter $ |
7 * \endrcs | 7 * \endrcs |
8 * | 8 * |
9 * \license | 9 * \license |
10 * Copyright (C) 2001-2007 Peter Johnson | 10 * Copyright (C) 2001-2007 Peter Johnson |
11 * | 11 * |
12 * Redistribution and use in source and binary forms, with or without | 12 * Redistribution and use in source and binary forms, with or without |
13 * modification, are permitted provided that the following conditions | 13 * modification, are permitted provided that the following conditions |
14 * are met: | 14 * are met: |
15 * - Redistributions of source code must retain the above copyright | 15 * - Redistributions of source code must retain the above copyright |
16 * notice, this list of conditions and the following disclaimer. | 16 * notice, this list of conditions and the following disclaimer. |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 /** Module-level implementation of yasm_objfmt_destroy(). | 101 /** Module-level implementation of yasm_objfmt_destroy(). |
102 * Call yasm_objfmt_destroy() instead of calling this function. | 102 * Call yasm_objfmt_destroy() instead of calling this function. |
103 */ | 103 */ |
104 void (*destroy) (/*@only@*/ yasm_objfmt *objfmt); | 104 void (*destroy) (/*@only@*/ yasm_objfmt *objfmt); |
105 | 105 |
106 /** Module-level implementation of yasm_objfmt_add_default_section(). | 106 /** Module-level implementation of yasm_objfmt_add_default_section(). |
107 * Call yasm_objfmt_add_default_section() instead of calling this function. | 107 * Call yasm_objfmt_add_default_section() instead of calling this function. |
108 */ | 108 */ |
109 yasm_section * (*add_default_section) (yasm_object *object); | 109 yasm_section * (*add_default_section) (yasm_object *object); |
110 | 110 |
| 111 /** Module-level implementation of yasm_objfmt_init_new_section(). |
| 112 * Call yasm_objfmt_init_new_section() instead of calling this function. |
| 113 */ |
| 114 void (*init_new_section) (yasm_section *section, unsigned long line); |
| 115 |
111 /** Module-level implementation of yasm_objfmt_section_switch(). | 116 /** Module-level implementation of yasm_objfmt_section_switch(). |
112 * Call yasm_objfmt_section_switch() instead of calling this function. | 117 * Call yasm_objfmt_section_switch() instead of calling this function. |
113 */ | 118 */ |
114 /*@observer@*/ /*@null@*/ yasm_section * | 119 /*@observer@*/ /*@null@*/ yasm_section * |
115 (*section_switch)(yasm_object *object, yasm_valparamhead *valparams, | 120 (*section_switch)(yasm_object *object, yasm_valparamhead *valparams, |
116 /*@null@*/ yasm_valparamhead *objext_valparams, | 121 /*@null@*/ yasm_valparamhead *objext_valparams, |
117 unsigned long line); | 122 unsigned long line); |
118 | 123 |
119 /** Module-level implementation of yasm_objfmt_get_special_sym(). | 124 /** Module-level implementation of yasm_objfmt_get_special_sym(). |
120 * Call yasm_objfmt_get_special_sym() instead of calling this function. | 125 * Call yasm_objfmt_get_special_sym() instead of calling this function. |
(...skipping 28 matching lines...) Expand all Loading... |
149 * \param objfmt object format | 154 * \param objfmt object format |
150 */ | 155 */ |
151 void yasm_objfmt_destroy(/*@only@*/ yasm_objfmt *objfmt); | 156 void yasm_objfmt_destroy(/*@only@*/ yasm_objfmt *objfmt); |
152 | 157 |
153 /** Add a default section to an object. | 158 /** Add a default section to an object. |
154 * \param object object | 159 * \param object object |
155 * \return Default section. | 160 * \return Default section. |
156 */ | 161 */ |
157 yasm_section *yasm_objfmt_add_default_section(yasm_object *object); | 162 yasm_section *yasm_objfmt_add_default_section(yasm_object *object); |
158 | 163 |
| 164 /** Initialize the object-format specific portion of a section. Called |
| 165 * by yasm_object_get_general(); in general should not be directly called. |
| 166 * \param section section |
| 167 * \param line virtual line (from yasm_linemap) |
| 168 */ |
| 169 void yasm_objfmt_init_new_section(yasm_object *object, unsigned long line); |
| 170 |
159 /** Switch object file sections. The first val of the valparams should | 171 /** Switch object file sections. The first val of the valparams should |
160 * be the section name. Calls yasm_object_get_general() to actually get | 172 * be the section name. Calls yasm_object_get_general() to actually get |
161 * the section. | 173 * the section. |
162 * \param object object | 174 * \param object object |
163 * \param valparams value/parameters | 175 * \param valparams value/parameters |
164 * \param objext_valparams object format-specific value/parameters | 176 * \param objext_valparams object format-specific value/parameters |
165 * \param line virtual line (from yasm_linemap) | 177 * \param line virtual line (from yasm_linemap) |
166 * \return NULL on error, otherwise new section. | 178 * \return NULL on error, otherwise new section. |
167 */ | 179 */ |
168 /*@observer@*/ /*@null@*/ yasm_section *yasm_objfmt_section_switch | 180 /*@observer@*/ /*@null@*/ yasm_section *yasm_objfmt_section_switch |
(...skipping 20 matching lines...) Expand all Loading... |
189 ((yasm_objfmt_base *)((object)->objfmt))->module->output \ | 201 ((yasm_objfmt_base *)((object)->objfmt))->module->output \ |
190 (object, f, all_syms, ews) | 202 (object, f, all_syms, ews) |
191 #define yasm_objfmt_destroy(objfmt) \ | 203 #define yasm_objfmt_destroy(objfmt) \ |
192 ((yasm_objfmt_base *)objfmt)->module->destroy(objfmt) | 204 ((yasm_objfmt_base *)objfmt)->module->destroy(objfmt) |
193 #define yasm_objfmt_section_switch(object, vpms, oe_vpms, line) \ | 205 #define yasm_objfmt_section_switch(object, vpms, oe_vpms, line) \ |
194 ((yasm_objfmt_base *)((object)->objfmt))->module->section_switch \ | 206 ((yasm_objfmt_base *)((object)->objfmt))->module->section_switch \ |
195 (object, vpms, oe_vpms, line) | 207 (object, vpms, oe_vpms, line) |
196 #define yasm_objfmt_add_default_section(object) \ | 208 #define yasm_objfmt_add_default_section(object) \ |
197 ((yasm_objfmt_base *)((object)->objfmt))->module->add_default_section \ | 209 ((yasm_objfmt_base *)((object)->objfmt))->module->add_default_section \ |
198 (object) | 210 (object) |
| 211 #define yasm_objfmt_init_new_section(section, line) \ |
| 212 ((yasm_objfmt_base *)((object)->objfmt))->module->init_new_section \ |
| 213 (section, line) |
199 #define yasm_objfmt_get_special_sym(object, name, parser) \ | 214 #define yasm_objfmt_get_special_sym(object, name, parser) \ |
200 ((yasm_objfmt_base *)((object)->objfmt))->module->get_special_sym \ | 215 ((yasm_objfmt_base *)((object)->objfmt))->module->get_special_sym \ |
201 (object, name, parser) | 216 (object, name, parser) |
202 | 217 |
203 #endif | 218 #endif |
204 | 219 |
205 #endif | 220 #endif |
OLD | NEW |