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
00070 const char **dbgfmt_keywords;
00071
00075 const char *default_dbgfmt_keyword;
00076
00078 const yasm_directive *directives;
00079
00081 const yasm_stdmac *stdmacs;
00082
00090 yasm_objfmt * (*create) (yasm_object *object);
00091
00095 void (*output) (yasm_object *o, FILE *f, int all_syms,
00096 yasm_errwarns *errwarns);
00097
00101 void (*destroy) ( yasm_objfmt *objfmt);
00102
00106 yasm_section * (*add_default_section) (yasm_object *object);
00107
00111 yasm_section *
00112 (*section_switch)(yasm_object *object, yasm_valparamhead *valparams,
00113 yasm_valparamhead *objext_valparams,
00114 unsigned long line);
00115
00119 yasm_symrec *
00120 (*get_special_sym)(yasm_object *object, const char *name,
00121 const char *parser);
00122 };
00123
00129 yasm_objfmt *yasm_objfmt_create
00130 (const yasm_objfmt_module *module, yasm_object *object);
00131
00142 void yasm_objfmt_output(yasm_object *object, FILE *f, int all_syms,
00143 yasm_errwarns *errwarns);
00144
00148 void yasm_objfmt_destroy( yasm_objfmt *objfmt);
00149
00154 yasm_section *yasm_objfmt_add_default_section(yasm_object *object);
00155
00165 yasm_section *yasm_objfmt_section_switch
00166 (yasm_object *object, yasm_valparamhead *valparams,
00167 yasm_valparamhead *objext_valparams, unsigned long line);
00168
00176 yasm_symrec *yasm_objfmt_get_special_sym
00177 (yasm_object *object, const char *name, const char *parser);
00178
00179 #ifndef YASM_DOXYGEN
00180
00181
00182
00183 #define yasm_objfmt_create(module, object) module->create(object)
00184
00185 #define yasm_objfmt_output(object, f, all_syms, ews) \
00186 ((yasm_objfmt_base *)((object)->objfmt))->module->output \
00187 (object, f, all_syms, ews)
00188 #define yasm_objfmt_destroy(objfmt) \
00189 ((yasm_objfmt_base *)objfmt)->module->destroy(objfmt)
00190 #define yasm_objfmt_section_switch(object, vpms, oe_vpms, line) \
00191 ((yasm_objfmt_base *)((object)->objfmt))->module->section_switch \
00192 (object, vpms, oe_vpms, line)
00193 #define yasm_objfmt_add_default_section(object) \
00194 ((yasm_objfmt_base *)((object)->objfmt))->module->add_default_section \
00195 (object)
00196 #define yasm_objfmt_get_special_sym(object, name, parser) \
00197 ((yasm_objfmt_base *)((object)->objfmt))->module->get_special_sym \
00198 (object, name, parser)
00199
00200 #endif
00201
00202 #endif