|
libyasm
|
00001 00030 #ifndef YASM_SYMREC_H 00031 #define YASM_SYMREC_H 00032 00033 #ifndef YASM_LIB_DECL 00034 #define YASM_LIB_DECL 00035 #endif 00036 00041 typedef enum yasm_sym_status { 00042 YASM_SYM_NOSTATUS = 0, 00043 YASM_SYM_USED = 1 << 0, 00044 YASM_SYM_DEFINED = 1 << 1, 00045 YASM_SYM_VALUED = 1 << 2, 00046 YASM_SYM_NOTINTABLE = 1 << 3 00047 } yasm_sym_status; 00048 00052 typedef enum yasm_sym_vis { 00053 YASM_SYM_LOCAL = 0, 00054 YASM_SYM_GLOBAL = 1 << 0, 00055 YASM_SYM_COMMON = 1 << 1, 00056 YASM_SYM_EXTERN = 1 << 2, 00057 YASM_SYM_DLOCAL = 1 << 3 00058 } yasm_sym_vis; 00059 00061 YASM_LIB_DECL 00062 yasm_symtab *yasm_symtab_create(void); 00063 00069 YASM_LIB_DECL 00070 void yasm_symtab_destroy(/*@only@*/ yasm_symtab *symtab); 00071 00077 YASM_LIB_DECL 00078 void yasm_symtab_set_case_sensitive(yasm_symtab *symtab, int sensitive); 00079 00087 YASM_LIB_DECL 00088 /*@dependent@*/ yasm_symrec *yasm_symtab_abs_sym(yasm_symtab *symtab); 00089 00097 YASM_LIB_DECL 00098 /*@dependent@*/ yasm_symrec *yasm_symtab_use 00099 (yasm_symtab *symtab, const char *name, unsigned long line); 00100 00109 YASM_LIB_DECL 00110 /*@null@*/ /*@dependent@*/ yasm_symrec *yasm_symtab_get 00111 (yasm_symtab *symtab, const char *name); 00112 00120 YASM_LIB_DECL 00121 /*@dependent@*/ yasm_symrec *yasm_symtab_define_equ 00122 (yasm_symtab *symtab, const char *name, /*@keep@*/ yasm_expr *e, 00123 unsigned long line); 00124 00134 YASM_LIB_DECL 00135 /*@dependent@*/ yasm_symrec *yasm_symtab_define_label 00136 (yasm_symtab *symtab, const char *name, 00137 /*@dependent@*/ yasm_bytecode *precbc, int in_table, unsigned long line); 00138 00149 YASM_LIB_DECL 00150 /*@dependent@*/ yasm_symrec *yasm_symtab_define_curpos 00151 (yasm_symtab *symtab, const char *name, 00152 /*@dependent@*/ yasm_bytecode *precbc, unsigned long line); 00153 00162 YASM_LIB_DECL 00163 /*@dependent@*/ yasm_symrec *yasm_symtab_define_special 00164 (yasm_symtab *symtab, const char *name, yasm_sym_vis vis); 00165 00174 YASM_LIB_DECL 00175 /*@dependent@*/ yasm_symrec *yasm_symtab_declare 00176 (yasm_symtab *symtab, const char *name, yasm_sym_vis vis, 00177 unsigned long line); 00178 00185 YASM_LIB_DECL 00186 void yasm_symrec_declare(yasm_symrec *symrec, yasm_sym_vis vis, 00187 unsigned long line); 00188 00194 typedef int (*yasm_symtab_traverse_callback) 00195 (yasm_symrec *sym, /*@null@*/ void *d); 00196 00204 YASM_LIB_DECL 00205 int /*@alt void@*/ yasm_symtab_traverse 00206 (yasm_symtab *symtab, /*@null@*/ void *d, 00207 yasm_symtab_traverse_callback func); 00208 00210 typedef struct yasm_symtab_iter yasm_symtab_iter; 00211 00216 YASM_LIB_DECL 00217 const yasm_symtab_iter *yasm_symtab_first(const yasm_symtab *symtab); 00218 00223 YASM_LIB_DECL 00224 /*@null@*/ const yasm_symtab_iter *yasm_symtab_next 00225 (const yasm_symtab_iter *prev); 00226 00231 YASM_LIB_DECL 00232 yasm_symrec *yasm_symtab_iter_value(const yasm_symtab_iter *cur); 00233 00241 YASM_LIB_DECL 00242 void yasm_symtab_parser_finalize(yasm_symtab *symtab, int undef_extern, 00243 yasm_errwarns *errwarns); 00244 00250 YASM_LIB_DECL 00251 void yasm_symtab_print(yasm_symtab *symtab, FILE *f, int indent_level); 00252 00257 YASM_LIB_DECL 00258 /*@observer@*/ const char *yasm_symrec_get_name(const yasm_symrec *sym); 00259 00265 YASM_LIB_DECL 00266 /*@only@*/ char *yasm_symrec_get_global_name(const yasm_symrec *sym, 00267 const yasm_object *object); 00268 00273 YASM_LIB_DECL 00274 yasm_sym_vis yasm_symrec_get_visibility(const yasm_symrec *sym); 00275 00280 YASM_LIB_DECL 00281 yasm_sym_status yasm_symrec_get_status(const yasm_symrec *sym); 00282 00287 YASM_LIB_DECL 00288 unsigned long yasm_symrec_get_def_line(const yasm_symrec *sym); 00289 00294 YASM_LIB_DECL 00295 unsigned long yasm_symrec_get_decl_line(const yasm_symrec *sym); 00296 00301 YASM_LIB_DECL 00302 unsigned long yasm_symrec_get_use_line(const yasm_symrec *sym); 00303 00308 YASM_LIB_DECL 00309 /*@observer@*/ /*@null@*/ const yasm_expr *yasm_symrec_get_equ 00310 (const yasm_symrec *sym); 00311 00313 typedef /*@dependent@*/ yasm_bytecode *yasm_symrec_get_label_bytecodep; 00314 00321 YASM_LIB_DECL 00322 int yasm_symrec_get_label(const yasm_symrec *sym, 00323 /*@out@*/ yasm_symrec_get_label_bytecodep *precbc); 00324 00329 void yasm_symrec_set_size(yasm_symrec *sym, int size); 00330 00335 int yasm_symrec_get_size(const yasm_symrec *sym); 00336 00341 void yasm_symrec_set_segment(yasm_symrec *sym, const char *segment); 00342 00347 const char *yasm_symrec_get_segment(const yasm_symrec *sym); 00348 00354 YASM_LIB_DECL 00355 int yasm_symrec_is_abs(const yasm_symrec *sym); 00356 00361 YASM_LIB_DECL 00362 int yasm_symrec_is_special(const yasm_symrec *sym); 00363 00368 YASM_LIB_DECL 00369 int yasm_symrec_is_curpos(const yasm_symrec *sym); 00370 00375 YASM_LIB_DECL 00376 void yasm_symrec_set_objext_valparams 00377 (yasm_symrec *sym, /*@only@*/ yasm_valparamhead *objext_valparams); 00378 00384 YASM_LIB_DECL 00385 /*@null@*/ /*@dependent@*/ yasm_valparamhead *yasm_symrec_get_objext_valparams 00386 (yasm_symrec *sym); 00387 00392 YASM_LIB_DECL 00393 void yasm_symrec_set_common_size 00394 (yasm_symrec *sym, /*@only@*/ yasm_expr *common_size); 00395 00401 YASM_LIB_DECL 00402 /*@dependent@*/ /*@null@*/ yasm_expr **yasm_symrec_get_common_size 00403 (yasm_symrec *sym); 00404 00410 YASM_LIB_DECL 00411 /*@dependent@*/ /*@null@*/ void *yasm_symrec_get_data 00412 (yasm_symrec *sym, const yasm_assoc_data_callback *callback); 00413 00420 YASM_LIB_DECL 00421 void yasm_symrec_add_data(yasm_symrec *sym, 00422 const yasm_assoc_data_callback *callback, 00423 /*@only@*/ /*@null@*/ void *data); 00424 00430 YASM_LIB_DECL 00431 void yasm_symrec_print(const yasm_symrec *sym, FILE *f, int indent_level); 00432 00433 #endif
1.7.3