00001
00034 #ifndef YASM_OBJFMT_H
00035 #define YASM_OBJFMT_H
00036
00037 #ifndef YASM_DOXYGEN
00038
00041 typedef struct yasm_objfmt_base {
00043 const struct yasm_objfmt_module *module;
00044 } yasm_objfmt_base;
00045 #endif
00046
00048 struct yasm_objfmt_module {
00050 const char *name;
00051
00053 const char *keyword;
00054
00058 const char *extension;
00059
00063 const unsigned char default_x86_mode_bits;
00064
00066 const unsigned char id_at_ok;
00067
00073 const char **dbgfmt_keywords;
00074
00078 const char *default_dbgfmt_keyword;
00079
00081 const yasm_directive *directives;
00082
00084 const yasm_stdmac *stdmacs;
00085
00093 yasm_objfmt * (*create) (yasm_object *object);
00094
00098 void (*output) (yasm_object *o, FILE *f, int all_syms,
00099 yasm_errwarns *errwarns);
00100
00104 void (*destroy) ( yasm_objfmt *objfmt);
00105
00109 yasm_section * (*add_default_section) (yasm_object *object);
00110
00114 void (*init_new_section) (yasm_section *section, unsigned long line);
00115
00119 yasm_section *
00120 (*section_switch)(yasm_object *object, yasm_valparamhead *valparams,
00121 yasm_valparamhead *objext_valparams,
00122 unsigned long line);
00123
00127 yasm_symrec *
00128 (*get_special_sym)(yasm_object *object, const char *name,
00129 const char *parser);
00130 };
00131
00137 yasm_objfmt *yasm_objfmt_create
00138 (const yasm_objfmt_module *module, yasm_object *object);
00139
00150 void yasm_objfmt_output(yasm_object *object, FILE *f, int all_syms,
00151 yasm_errwarns *errwarns);
00152
00156 void yasm_objfmt_destroy( yasm_objfmt *objfmt);
00157
00162 yasm_section *yasm_objfmt_add_default_section(yasm_object *object);
00163
00169 void yasm_objfmt_init_new_section(yasm_object *object, unsigned long line);
00170
00180 yasm_section *yasm_objfmt_section_switch
00181 (yasm_object *object, yasm_valparamhead *valparams,
00182 yasm_valparamhead *objext_valparams, unsigned long line);
00183
00191 yasm_symrec *yasm_objfmt_get_special_sym
00192 (yasm_object *object, const char *name, const char *parser);
00193
00194 #ifndef YASM_DOXYGEN
00195
00196
00197
00198 #define yasm_objfmt_create(module, object) module->create(object)
00199
00200 #define yasm_objfmt_output(object, f, all_syms, ews) \
00201 ((yasm_objfmt_base *)((object)->objfmt))->module->output \
00202 (object, f, all_syms, ews)
00203 #define yasm_objfmt_destroy(objfmt) \
00204 ((yasm_objfmt_base *)objfmt)->module->destroy(objfmt)
00205 #define yasm_objfmt_section_switch(object, vpms, oe_vpms, line) \
00206 ((yasm_objfmt_base *)((object)->objfmt))->module->section_switch \
00207 (object, vpms, oe_vpms, line)
00208 #define yasm_objfmt_add_default_section(object) \
00209 ((yasm_objfmt_base *)((object)->objfmt))->module->add_default_section \
00210 (object)
00211 #define yasm_objfmt_init_new_section(section, line) \
00212 ((yasm_objfmt_base *)((object)->objfmt))->module->init_new_section \
00213 (section, line)
00214 #define yasm_objfmt_get_special_sym(object, name, parser) \
00215 ((yasm_objfmt_base *)((object)->objfmt))->module->get_special_sym \
00216 (object, name, parser)
00217
00218 #endif
00219
00220 #endif