libyasm
objfmt.h
Go to the documentation of this file.
1 
30 #ifndef YASM_OBJFMT_H
31 #define YASM_OBJFMT_H
32 
33 #ifndef YASM_DOXYGEN
34 
37 typedef struct yasm_objfmt_base {
39  const struct yasm_objfmt_module *module;
40 } yasm_objfmt_base;
41 #endif
42 
46  const char *name;
47 
49  const char *keyword;
50 
54  /*@null@*/ const char *extension;
55 
59  const unsigned char default_x86_mode_bits;
60 
62  const unsigned char id_at_ok;
63 
69  const char **dbgfmt_keywords;
70 
75 
77  /*@null@*/ const yasm_directive *directives;
78 
81 
89  /*@null@*/ /*@only@*/ yasm_objfmt * (*create) (yasm_object *object);
90 
94  void (*output) (yasm_object *o, FILE *f, int all_syms,
95  yasm_errwarns *errwarns);
96 
100  void (*destroy) (/*@only@*/ yasm_objfmt *objfmt);
101 
105  yasm_section * (*add_default_section) (yasm_object *object);
106 
110  void (*init_new_section) (yasm_section *section, unsigned long line);
111 
115  /*@observer@*/ /*@null@*/ yasm_section *
116  (*section_switch)(yasm_object *object, yasm_valparamhead *valparams,
117  /*@null@*/ yasm_valparamhead *objext_valparams,
118  unsigned long line);
119 
123  /*@observer@*/ /*@null@*/ yasm_symrec *
124  (*get_special_sym)(yasm_object *object, const char *name,
125  const char *parser);
126 };
127 
133 /*@null@*/ /*@only@*/ yasm_objfmt *yasm_objfmt_create
134  (const yasm_objfmt_module *module, yasm_object *object);
135 
146 void yasm_objfmt_output(yasm_object *object, FILE *f, int all_syms,
147  yasm_errwarns *errwarns);
148 
152 void yasm_objfmt_destroy(/*@only@*/ yasm_objfmt *objfmt);
153 
159 
165 void yasm_objfmt_init_new_section(yasm_object *object, unsigned long line);
166 
176 /*@observer@*/ /*@null@*/ yasm_section *yasm_objfmt_section_switch
177  (yasm_object *object, yasm_valparamhead *valparams,
178  /*@null@*/ yasm_valparamhead *objext_valparams, unsigned long line);
179 
187 /*@observer@*/ /*@null@*/ yasm_symrec *yasm_objfmt_get_special_sym
188  (yasm_object *object, const char *name, const char *parser);
189 
190 #ifndef YASM_DOXYGEN
191 
192 /* Inline macro implementations for objfmt functions */
193 
194 #define yasm_objfmt_create(module, object) module->create(object)
195 
196 #define yasm_objfmt_output(object, f, all_syms, ews) \
197  ((yasm_objfmt_base *)((object)->objfmt))->module->output \
198  (object, f, all_syms, ews)
199 #define yasm_objfmt_destroy(objfmt) \
200  ((yasm_objfmt_base *)objfmt)->module->destroy(objfmt)
201 #define yasm_objfmt_section_switch(object, vpms, oe_vpms, line) \
202  ((yasm_objfmt_base *)((object)->objfmt))->module->section_switch \
203  (object, vpms, oe_vpms, line)
204 #define yasm_objfmt_add_default_section(object) \
205  ((yasm_objfmt_base *)((object)->objfmt))->module->add_default_section \
206  (object)
207 #define yasm_objfmt_init_new_section(section, line) \
208  ((yasm_objfmt_base *)((object)->objfmt))->module->init_new_section \
209  (section, line)
210 #define yasm_objfmt_get_special_sym(object, name, parser) \
211  ((yasm_objfmt_base *)((object)->objfmt))->module->get_special_sym \
212  (object, name, parser)
213 
214 #endif
215 
216 #endif