IDA SDK
Modules | Enumerations | Functions
Named types

Detailed Description

functions to work with named types

Modules

 Flags for named types
 
 C/C++ naming flags
 

Enumerations

enum  tinfo_code_t { TERR_OK = 0, TERR_SAVE = -1, TERR_SERIALIZE = -2, TERR_WRONGNAME = -3 }
 Error codes for save_tinfo functions: More...
 

Functions

idaman int ida_export get_named_type (const til_t *ti, const char *name, int ntf_flags, const type_t **type=NULL, const p_list **fields=NULL, const char **cmt=NULL, const p_list **fieldcmts=NULL, sclass_t *sclass=NULL, uint32 *value=NULL)
 Get named typeinfo. More...
 
int idaapi get_named_type64 (const til_t *ti, const char *name, int ntf_flags, const type_t **type=NULL, const p_list **fields=NULL, const char **cmt=NULL, const p_list **fieldcmts=NULL, sclass_t *sclass=NULL, uint64 *value=NULL)
 See get_named_type() above. More...
 
idaman bool ida_export del_named_type (til_t *ti, const char *name, int ntf_flags)
 Delete information about a symbol. More...
 
idaman const char *ida_export first_named_type (const til_t *ti, int ntf_flags)
 Enumerate types. More...
 
idaman const char *ida_export next_named_type (const til_t *ti, const char *name, int ntf_flags)
 Enumerate types. More...
 
idaman bool ida_export decorate_name (qstring *out, const char *name, bool mangle, cm_t cc=CM_CC_UNKNOWN, const tinfo_t *type=NULL)
 Decorate/undecorate a C symbol name. More...
 
idaman bool ida_export gen_decorate_name (qstring *out, const char *name, bool mangle, cm_t cc, const tinfo_t *type)
 Generic function for decorate_name() (may be used in IDP modules)
 
idaman ssize_t ida_export calc_c_cpp_name (qstring *out, const char *name, const tinfo_t *type, int ccn_flags)
 Get C or C++ form of the name. More...
 

Enumeration Type Documentation

Error codes for save_tinfo functions:

Enumerator
TERR_OK 

ok

TERR_SAVE 

failed to save

TERR_SERIALIZE 

failed to serialize

TERR_WRONGNAME 

name is not acceptable

Function Documentation

idaman int ida_export get_named_type ( const til_t ti,
const char *  name,
int  ntf_flags,
const type_t **  type = NULL,
const p_list **  fields = NULL,
const char **  cmt = NULL,
const p_list **  fieldcmts = NULL,
sclass_t sclass = NULL,
uint32 value = NULL 
)

Get named typeinfo.

The returned pointers are pointers to static storage.
They are valid until free_til(), set_named_type(), del_named_type(),
rename_named_type(), set_numbered_type(), del_numbered_type(),
and idb structure/enum manipulation (in other words, until til_t is changed).

Parameters
tipointer to type information library
namename of type
ntf_flagscombination of Flags for named types
typeptr to ptr to output buffer for the type info
fieldsptr to ptr to the field/args names. may be NULL
cmtptr to ptr to the main comment. may be NULL
fieldcmtsptr to ptr to the field/args comments. may be NULL
sclassptr to storage class
valueptr to symbol value. for types, ptr to the ordinal number
Return values
0can't find the named type (or name==NULL)
1ok, the buffers are filled with information (if not NULL)
2ok, found it in a base til
int idaapi get_named_type64 ( const til_t ti,
const char *  name,
int  ntf_flags,
const type_t **  type = NULL,
const p_list **  fields = NULL,
const char **  cmt = NULL,
const p_list **  fieldcmts = NULL,
sclass_t sclass = NULL,
uint64 value = NULL 
)
inline

See get_named_type() above.

Note
If the value in the 'ti' library is 32-bit, it will be sign-extended before being stored in the 'value' pointer.
idaman bool ida_export del_named_type ( til_t ti,
const char *  name,
int  ntf_flags 
)

Delete information about a symbol.

Parameters
titype library
namename of symbol
ntf_flagscombination of Flags for named types
Returns
success
idaman const char* ida_export first_named_type ( const til_t ti,
int  ntf_flags 
)

Enumerate types.

Returns mangled names. Never returns anonymous types. To include it, enumerate types by ordinals.

idaman const char* ida_export next_named_type ( const til_t ti,
const char *  name,
int  ntf_flags 
)

Enumerate types.

Returns mangled names. Never returns anonymous types. To include it, enumerate types by ordinals.

idaman bool ida_export decorate_name ( qstring out,
const char *  name,
bool  mangle,
cm_t  cc = CM_CC_UNKNOWN,
const tinfo_t type = NULL 
)

Decorate/undecorate a C symbol name.

Parameters
outoutput buffer
namename of symbol
mangletrue-mangle, false-unmangle
cccalling convention
typename type (NULL-unknown)
Returns
success
idaman ssize_t ida_export calc_c_cpp_name ( qstring out,
const char *  name,
const tinfo_t type,
int  ccn_flags 
)

Get C or C++ form of the name.

Parameters
outoutput buffer
nameoriginal (mangled or decorated) name
typename type if known, otherwise NULL
ccn_flagsone of C/C++ naming flags