00001
00034 #ifndef YASM_LISTFMT_H
00035 #define YASM_LISTFMT_H
00036
00037 #ifndef YASM_DOXYGEN
00038
00041 typedef struct yasm_listfmt_base {
00043 const struct yasm_listfmt_module *module;
00044 } yasm_listfmt_base;
00045 #endif
00046
00048 typedef struct yasm_listfmt_module {
00050 const char *name;
00051
00053 const char *keyword;
00054
00062 yasm_listfmt * (*create)
00063 (const char *in_filename, const char *obj_filename);
00064
00068 void (*destroy) ( yasm_listfmt *listfmt);
00069
00073 void (*output) (yasm_listfmt *listfmt, FILE *f, yasm_linemap *linemap,
00074 yasm_arch *arch);
00075 } yasm_listfmt_module;
00076
00081 const char *yasm_listfmt_keyword(const yasm_listfmt *listfmt);
00082
00091 yasm_listfmt *yasm_listfmt_create
00092 (const yasm_listfmt_module *module, const char *in_filename,
00093 const char *obj_filename);
00094
00098 void yasm_listfmt_destroy( yasm_listfmt *listfmt);
00099
00107 void yasm_listfmt_output(yasm_listfmt *listfmt, FILE *f,
00108 yasm_linemap *linemap, yasm_arch *arch);
00109
00110 #ifndef YASM_DOXYGEN
00111
00112
00113
00114 #define yasm_listfmt_keyword(listfmt) \
00115 (((yasm_listfmt_base *)listfmt)->module->keyword)
00116
00117 #define yasm_listfmt_create(module, in_filename, obj_filename) \
00118 module->create(in_filename, obj_filename)
00119
00120 #define yasm_listfmt_destroy(listfmt) \
00121 ((yasm_listfmt_base *)listfmt)->module->destroy(listfmt)
00122
00123 #define yasm_listfmt_output(listfmt, f, linemap, a) \
00124 ((yasm_listfmt_base *)listfmt)->module->output(listfmt, f, linemap, a)
00125
00126 #endif
00127
00128 #endif