Format/Parse/Print type information.
|
| typedef int idaapi | h2ti_type_cb(const char *name, const tinfo_t &tif, const char *cmt, const uint64 *value, void *cb_data) |
| | This callback will be called for each type/variable declaration. More...
|
| |
| typedef int | printer_t(const char *format,...) |
| | Specify a printing callback when parsing types. More...
|
| |
|
| idaman int ida_export | h2ti (til_t *ti, lexer_t *lx, const char *input, int flags=HTI_HIGH, h2ti_type_cb *type_cb=NULL, h2ti_type_cb *var_cb=NULL, printer_t *print_cb=NULL, void *_cb_data=NULL, abs_t _isabs=abs_unk) |
| | Convert declarations to type_t*. More...
|
| |
| idaman bool ida_export | parse_decl (tinfo_t *tif, qstring *out, til_t *til, const char *decl, int flags) |
| | Parse ONE declaration. More...
|
| |
| THREAD_SAFE int | convert_pt_flags_to_hti (int pt_flags) |
| | Convert Type parsing flags to Type formatting flags. More...
|
| |
| idaman int ida_export | parse_decls (til_t *til, const char *input, printer_t *printer, int hti_flags) |
| | Parse many declarations and store them in a til. More...
|
| |
| idaman bool ida_export | print_type (qstring *out, ea_t ea, int prtype_flags) |
| | Get type declaration for the specified address. More...
|
| |
| typedef int idaapi h2ti_type_cb(const char *name, const tinfo_t &tif, const char *cmt, const uint64 *value, void *cb_data) |
This callback will be called for each type/variable declaration.
- Parameters
-
| name | var/func/type name |
| tif | type info |
| cmt | main comment |
| value | symbol value |
| cb_data | data passed to callback |
- Return values
-
| T_CBBRKDEF | the type declaration won't be saved in the til |
| typedef int printer_t(const char *format,...) |
Convert declarations to type_t*.
This is a low level function - use parse_decls() or parse_decl()
- Parameters
-
| ti | type info library |
| lx | input lexer. may be NULL. always destroyed by h2ti() |
| input | file name or C declaration |
| flags | combination of Type formatting flags |
| type_cb | callback - for each type |
| var_cb | callback - for each var |
| print_cb | may pass msg() here |
| _cb_data | data passed to callbacks |
| _isabs | the expected abstracness of the type declaration(s) |
- Returns
- number of errors (they are displayed using print_cb). zero means ok
Parse ONE declaration.
If the input string contains more than one declaration, the first complete type declaration (PT_TYP) or the last variable declaration (PT_VAR) will be used.
- Note
- name & tif may be empty after the call!
- Parameters
-
| [out] | tif | type info |
| [out] | out | declared name |
| til | type library to use. may be NULL |
| decl | C declaration to parse |
| flags | combination of Type parsing flags bits |
- Return values
-
| true | ok |
| false | declaration is bad, the error message is displayed if !PT_SIL |
| THREAD_SAFE int convert_pt_flags_to_hti |
( |
int |
pt_flags | ) |
|
|
inline |
Parse many declarations and store them in a til.
If there are any errors, they will be printed using 'printer'. This function uses default include path and predefined macros from the database settings. It always uses the HTI_DCL bit.
- Parameters
-
| til | type library to store the result |
| input | input string or file name (see hti_flags) |
| printer | function to output error messages (use msg or NULL or your own callback) |
| hti_flags | combination of Type formatting flags |
- Returns
- number of errors, 0 means ok.
Get type declaration for the specified address.
- Parameters
-
- Returns
- success