libyasm
coretype.h
Go to the documentation of this file.
1 
30 #ifndef YASM_CORETYPE_H
31 #define YASM_CORETYPE_H
32 
33 #ifndef YASM_LIB_DECL
34 #define YASM_LIB_DECL
35 #endif
36 
38 typedef struct yasm_arch yasm_arch;
40 typedef struct yasm_preproc yasm_preproc;
42 typedef struct yasm_parser yasm_parser;
44 typedef struct yasm_objfmt yasm_objfmt;
46 typedef struct yasm_dbgfmt yasm_dbgfmt;
48 typedef struct yasm_listfmt yasm_listfmt;
49 
54 
60 typedef struct yasm_stdmac {
61  const char *parser;
62  const char *preproc;
67  const char **macros;
68 } yasm_stdmac;
69 
73 typedef struct yasm_assoc_data_callback {
77  void (*destroy) (/*@only@*/ void *data);
78 
84  void (*print) (void *data, FILE *f, int indent_level);
86 
91 
94 
96 typedef struct yasm_object yasm_object;
97 
99 typedef struct yasm_section yasm_section;
100 
102 typedef struct yasm_symtab yasm_symtab;
103 
105 typedef struct yasm_symrec yasm_symrec;
106 
108 typedef struct yasm_expr yasm_expr;
110 typedef struct yasm_intnum yasm_intnum;
115 
121 typedef struct yasm_value {
126  /*@null@*/ /*@only@*/ yasm_expr *abs;
127 
131  /*@null@*/ /*@dependent@*/ yasm_symrec *rel;
132 
134  /*@null@*/ /*@dependent@*/ yasm_symrec *wrt;
135 
139  unsigned int seg_of : 1;
140 
145  unsigned int rshift : 7;
146 
152  unsigned int curpos_rel : 1;
153 
158  unsigned int ip_rel : 1;
159 
164  unsigned int jump_target : 1;
165 
172  unsigned int section_rel : 1;
173 
175  unsigned int no_warn : 1;
176 
180  unsigned int sign : 1;
181 
183  unsigned int size : 8;
184 } yasm_value;
185 
187 #define YASM_VALUE_RSHIFT_MAX 127
188 
192 typedef struct yasm_linemap yasm_linemap;
193 
206 
210 typedef struct yasm_effaddr yasm_effaddr;
211 
215 typedef struct yasm_insn yasm_insn;
216 
218 typedef enum yasm_expr_op {
254 } yasm_expr_op;
255 
274 typedef int (*yasm_output_value_func)
275  (yasm_value *value, /*@out@*/ unsigned char *buf, unsigned int destsize,
276  unsigned long offset, yasm_bytecode *bc, int warn, /*@null@*/ void *d);
277 
295 typedef int (*yasm_output_reloc_func)
296  (yasm_symrec *sym, yasm_bytecode *bc, unsigned char *buf,
297  unsigned int destsize, unsigned int valsize, int warn, void *d);
298 
306 YASM_LIB_DECL
307 int yasm__mergesort(void *base, size_t nmemb, size_t size,
308  int (*compar)(const void *, const void *));
309 
316 YASM_LIB_DECL
317 /*@null@*/ char *yasm__strsep(char **stringp, const char *delim);
318 
325 YASM_LIB_DECL
326 int yasm__strcasecmp(const char *s1, const char *s2);
327 
335 YASM_LIB_DECL
336 int yasm__strncasecmp(const char *s1, const char *s2, size_t n);
337 
343 YASM_LIB_DECL
344 /*@only@*/ char *yasm__xstrdup(const char *str);
345 
352 YASM_LIB_DECL
353 /*@only@*/ char *yasm__xstrndup(const char *str, size_t max);
354 
361 YASM_LIB_DECL
362 extern /*@only@*/ /*@out@*/ void * (*yasm_xmalloc) (size_t size);
363 
371 YASM_LIB_DECL
372 extern /*@only@*/ void * (*yasm_xcalloc) (size_t nelem, size_t elsize);
373 
381 YASM_LIB_DECL
382 extern /*@only@*/ void * (*yasm_xrealloc)
383  (/*@only@*/ /*@out@*/ /*@returned@*/ /*@null@*/ void *oldmem, size_t size)
384  /*@modifies oldmem@*/;
385 
390 YASM_LIB_DECL
391 extern void (*yasm_xfree) (/*@only@*/ /*@out@*/ /*@null@*/ void *p)
392  /*@modifies p@*/;
393 
394 #endif