libyasm
section.h
Go to the documentation of this file.
1 
30 #ifndef YASM_SECTION_H
31 #define YASM_SECTION_H
32 
33 #ifndef YASM_LIB_DECL
34 #define YASM_LIB_DECL
35 #endif
36 
40 typedef struct yasm_reloc yasm_reloc;
41 
42 struct yasm_reloc {
43  /*@reldef@*/ STAILQ_ENTRY(yasm_reloc) link;
45  /*@dependent@*/ yasm_symrec *sym;
46 };
47 
50 typedef struct yasm_overrides {
53  int
56 
58 struct yasm_object {
59  /*@owned@*/ char *src_filename;
60  /*@owned@*/ char *obj_filename;
62  /*@owned@*/ yasm_symtab *symtab;
63  /*@owned@*/ yasm_arch *arch;
64  /*@owned@*/ yasm_objfmt *objfmt;
65  /*@owned@*/ yasm_dbgfmt *dbgfmt;
66  /*@owned@*/ yasm_overrides *overrides;
71  /*@dependent@*/ /*@null@*/ yasm_section *cur_section;
72 
74  /*@reldef@*/ STAILQ_HEAD(yasm_sectionhead, yasm_section) sections;
75 
79  /*@owned@*/ struct HAMT *directives;
80 
82  /*@owned@*/ char *global_prefix;
83 
85  /*@owned@*/ char *global_suffix;
86 };
87 
98 YASM_LIB_DECL
99 /*@null@*/ /*@only@*/ yasm_object *yasm_object_create
100  (const char *src_filename, const char *obj_filename,
101  /*@kept@*/ yasm_arch *arch,
102  const yasm_objfmt_module *objfmt_module,
103  const yasm_dbgfmt_module *dbgfmt_module);
104 
119 YASM_LIB_DECL
120 /*@dependent@*/ yasm_section *yasm_object_get_general
121  (yasm_object *object, const char *name, unsigned long align, int code,
122  int res_only, /*@out@*/ int *isnew, unsigned long line);
123 
134 YASM_LIB_DECL
135 int yasm_object_directive(yasm_object *object, const char *name,
136  const char *parser, yasm_valparamhead *valparams,
137  yasm_valparamhead *objext_valparams,
138  unsigned long line);
139 
144 YASM_LIB_DECL
145 void yasm_object_destroy(/*@only@*/ yasm_object *object);
146 
152 YASM_LIB_DECL
153 void yasm_object_print(const yasm_object *object, FILE *f, int indent_level);
154 
160 YASM_LIB_DECL
161 void yasm_object_finalize(yasm_object *object, yasm_errwarns *errwarns);
162 
170 YASM_LIB_DECL
172  (yasm_object *object, /*@null@*/ void *d,
173  int (*func) (yasm_section *sect, /*@null@*/ void *d));
174 
180 YASM_LIB_DECL
181 /*@dependent@*/ /*@null@*/ yasm_section *yasm_object_find_general
182  (yasm_object *object, const char *name);
183 
188 YASM_LIB_DECL
189 void yasm_object_set_source_fn(yasm_object *object, const char *src_filename);
190 
195 YASM_LIB_DECL
196 void yasm_object_set_global_prefix(yasm_object *object, const char *prefix);
197 
202 YASM_LIB_DECL
203 void yasm_object_set_global_suffix(yasm_object *object, const char *suffix);
204 
211 YASM_LIB_DECL
212 void yasm_object_optimize(yasm_object *object, yasm_errwarns *errwarns);
213 
218 YASM_LIB_DECL
220 
225 YASM_LIB_DECL
226 unsigned long yasm_section_get_opt_flags(const yasm_section *sect);
227 
232 YASM_LIB_DECL
233 void yasm_section_set_opt_flags(yasm_section *sect, unsigned long opt_flags);
234 
240 YASM_LIB_DECL
241 int yasm_section_is_default(const yasm_section *sect);
242 
247 YASM_LIB_DECL
248 void yasm_section_set_default(yasm_section *sect, int def);
249 
254 YASM_LIB_DECL
256 
262 YASM_LIB_DECL
263 /*@dependent@*/ /*@null@*/ void *yasm_section_get_data
264  (yasm_section *sect, const yasm_assoc_data_callback *callback);
265 
272 YASM_LIB_DECL
274  const yasm_assoc_data_callback *callback,
275  /*@null@*/ /*@only@*/ void *data);
276 
286 YASM_LIB_DECL
288  void (*destroy_func) (/*@only@*/ void *reloc));
289 
294 YASM_LIB_DECL
296 
301 /*@null@*/ yasm_reloc *yasm_section_reloc_next(yasm_reloc *reloc);
302 #ifndef YASM_DOXYGEN
303 #define yasm_section_reloc_next(x) STAILQ_NEXT((x), link)
304 #endif
305 
311 YASM_LIB_DECL
312 void yasm_reloc_get(yasm_reloc *reloc, yasm_intnum **addrp,
313  /*@dependent@*/ yasm_symrec **symp);
314 
320 YASM_LIB_DECL
322 
328 YASM_LIB_DECL
330 
340 YASM_LIB_DECL
341 /*@only@*/ /*@null@*/ yasm_bytecode *yasm_section_bcs_append
342  (yasm_section *sect,
343  /*@returned@*/ /*@only@*/ /*@null@*/ yasm_bytecode *bc);
344 
355 YASM_LIB_DECL
357  (yasm_section *sect, /*@null@*/ yasm_errwarns *errwarns,
358  /*@null@*/ void *d, int (*func) (yasm_bytecode *bc, /*@null@*/ void *d));
359 
364 YASM_LIB_DECL
365 /*@observer@*/ const char *yasm_section_get_name(const yasm_section *sect);
366 
372 YASM_LIB_DECL
373 void yasm_section_set_align(yasm_section *sect, unsigned long align,
374  unsigned long line);
375 
380 YASM_LIB_DECL
381 unsigned long yasm_section_get_align(const yasm_section *sect);
382 
389 YASM_LIB_DECL
390 void yasm_section_print(/*@null@*/ const yasm_section *sect, FILE *f,
391  int indent_level, int print_bcs);
392 
393 #endif