00001
00034 #ifndef YASM_CORETYPE_H
00035 #define YASM_CORETYPE_H
00036
00037 #ifndef YASM_LIB_DECL
00038 #define YASM_LIB_DECL
00039 #endif
00040
00042 typedef struct yasm_arch yasm_arch;
00044 typedef struct yasm_preproc yasm_preproc;
00046 typedef struct yasm_parser yasm_parser;
00048 typedef struct yasm_objfmt yasm_objfmt;
00050 typedef struct yasm_dbgfmt yasm_dbgfmt;
00052 typedef struct yasm_listfmt yasm_listfmt;
00053
00055 typedef struct yasm_objfmt_module yasm_objfmt_module;
00057 typedef struct yasm_dbgfmt_module yasm_dbgfmt_module;
00058
00064 typedef struct yasm_stdmac {
00065 const char *parser;
00066 const char *preproc;
00071 const char **macros;
00072 } yasm_stdmac;
00073
00077 typedef struct yasm_assoc_data_callback {
00081 void (*destroy) ( void *data);
00082
00088 void (*print) (void *data, FILE *f, int indent_level);
00089 } yasm_assoc_data_callback;
00090
00094 typedef struct yasm_errwarns yasm_errwarns;
00095
00097 typedef struct yasm_bytecode yasm_bytecode;
00098
00100 typedef struct yasm_object yasm_object;
00101
00103 typedef struct yasm_section yasm_section;
00104
00106 typedef struct yasm_symtab yasm_symtab;
00107
00109 typedef struct yasm_symrec yasm_symrec;
00110
00112 typedef struct yasm_expr yasm_expr;
00114 typedef struct yasm_intnum yasm_intnum;
00118 typedef struct yasm_floatnum yasm_floatnum;
00119
00125 typedef struct yasm_value {
00130 yasm_expr *abs;
00131
00135 yasm_symrec *rel;
00136
00138 yasm_symrec *wrt;
00139
00143 unsigned int seg_of : 1;
00144
00149 unsigned int rshift : 7;
00150
00156 unsigned int curpos_rel : 1;
00157
00162 unsigned int ip_rel : 1;
00163
00168 unsigned int jump_target : 1;
00169
00176 unsigned int section_rel : 1;
00177
00179 unsigned int no_warn : 1;
00180
00184 unsigned int sign : 1;
00185
00187 unsigned int size : 8;
00188 } yasm_value;
00189
00191 #define YASM_VALUE_RSHIFT_MAX 127
00192
00196 typedef struct yasm_linemap yasm_linemap;
00197
00201 typedef struct yasm_valparam yasm_valparam;
00205 typedef struct yasm_valparamhead yasm_valparamhead;
00209 typedef struct yasm_directive yasm_directive;
00210
00214 typedef struct yasm_effaddr yasm_effaddr;
00215
00219 typedef struct yasm_insn yasm_insn;
00220
00222 typedef enum yasm_expr_op {
00223 YASM_EXPR_IDENT,
00224 YASM_EXPR_ADD,
00225 YASM_EXPR_SUB,
00226 YASM_EXPR_MUL,
00227 YASM_EXPR_DIV,
00228 YASM_EXPR_SIGNDIV,
00229 YASM_EXPR_MOD,
00230 YASM_EXPR_SIGNMOD,
00231 YASM_EXPR_NEG,
00232 YASM_EXPR_NOT,
00233 YASM_EXPR_OR,
00234 YASM_EXPR_AND,
00235 YASM_EXPR_XOR,
00236 YASM_EXPR_XNOR,
00237 YASM_EXPR_NOR,
00238 YASM_EXPR_SHL,
00239 YASM_EXPR_SHR,
00240 YASM_EXPR_LOR,
00241 YASM_EXPR_LAND,
00242 YASM_EXPR_LNOT,
00243 YASM_EXPR_LXOR,
00244 YASM_EXPR_LXNOR,
00245 YASM_EXPR_LNOR,
00246 YASM_EXPR_LT,
00247 YASM_EXPR_GT,
00248 YASM_EXPR_EQ,
00249 YASM_EXPR_LE,
00250 YASM_EXPR_GE,
00251 YASM_EXPR_NE,
00252 YASM_EXPR_NONNUM,
00253 YASM_EXPR_SEG,
00254 YASM_EXPR_WRT,
00256 YASM_EXPR_SEGOFF
00257 } yasm_expr_op;
00258
00277 typedef int (*yasm_output_value_func)
00278 (yasm_value *value, unsigned char *buf, unsigned int destsize,
00279 unsigned long offset, yasm_bytecode *bc, int warn, void *d);
00280
00298 typedef int (*yasm_output_reloc_func)
00299 (yasm_symrec *sym, yasm_bytecode *bc, unsigned char *buf,
00300 unsigned int destsize, unsigned int valsize, int warn, void *d);
00301
00309 YASM_LIB_DECL
00310 int yasm__mergesort(void *base, size_t nmemb, size_t size,
00311 int (*compar)(const void *, const void *));
00312
00319 YASM_LIB_DECL
00320 char *yasm__strsep(char **stringp, const char *delim);
00321
00328 YASM_LIB_DECL
00329 int yasm__strcasecmp(const char *s1, const char *s2);
00330
00338 YASM_LIB_DECL
00339 int yasm__strncasecmp(const char *s1, const char *s2, size_t n);
00340
00346 YASM_LIB_DECL
00347 char *yasm__xstrdup(const char *str);
00348
00355 YASM_LIB_DECL
00356 char *yasm__xstrndup(const char *str, size_t max);
00357
00364 YASM_LIB_DECL
00365 extern void * (*yasm_xmalloc) (size_t size);
00366
00374 YASM_LIB_DECL
00375 extern void * (*yasm_xcalloc) (size_t nelem, size_t elsize);
00376
00384 YASM_LIB_DECL
00385 extern void * (*yasm_xrealloc)
00386 ( void *oldmem, size_t size)
00387 ;
00388
00393 YASM_LIB_DECL
00394 extern void (*yasm_xfree) ( void *p)
00395 ;
00396
00397 #endif