IDA SDK

- Main Page
- Header Files
- Classes
- Modules

Modules | Functions
Named types

## Detailed Description

functions to work with named types

## Modules
| Flags for named types
| C/C++ naming flags

## 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 ida_export | 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 | set_named_type (til_t *ti, const char *name, int ntf_flags, const type_t *ptr, const p_list *fields=NULL, const char *cmt=NULL, const p_list *fieldcmts=NULL, const sclass_t *sclass=NULL, const uint32 *value=NULL)
| Set named typeinfo. More...
bool | set_named_type64 (til_t *ti, const char *name, int ntf_flags, const type_t *ptr, const p_list *fields=NULL, const char *cmt=NULL, const p_list *fieldcmts=NULL, const sclass_t *sclass=NULL, const uint64 *value=NULL)
| See set_named_type()
idaman size_t ida_export | get_named_type_size (const til_t *ti, const char *name, int ntf_flags, size_t *lp=NULL)
| Get size of the named type. More...
idaman bool ida_export | del_named_type (til_t *ti, const char *name, int ntf_flags)
| Delete information about a symbol. More...
idaman int ida_export | rename_named_type (til_t *ti, const char *from, const char *to, int ntf_flags)
| Rename a type or 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_name3 (qstring *out, const char *name, bool mangle, cm_t cc=CM_CC_UNKNOWN)
| Decorate/undecorate a C symbol name. More...
idaman bool ida_export | gen_decorate_name3 (qstring *out, const char *name, bool mangle, cm_t cc)
| Generic function for decorate_name3() (may be used in IDP modules)
idaman ssize_t ida_export | calc_c_cpp_name4 (qstring *out, const char *name, const tinfo_t *type, int ccn_flags)
| Get C or C++ form of the name. More...

## 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

  ti | pointer to type information library
  name | name of type
  ntf_flags | combination of Flags for named types
  type | ptr to ptr to output buffer for the type info
  fields | ptr to ptr to the field/args names. may be NULL
  cmt | ptr to ptr to the main comment. may be NULL
  fieldcmts | ptr to ptr to the field/args comments. may be NULL
  sclass | ptr to storage class
  value | ptr to symbol value. for types, ptr to the ordinal number

Return values

  0 | can't find the named type (or name==NULL)
  1 | ok, the buffers are filled with information (if not NULL)
  2 | ok, found it in a base til

int ida_export 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 set_named_type | ( | til_t * | ti,
|  | const char * | name,
|  | int | ntf_flags,
|  | const type_t * | ptr,
|  | const p_list * | fields = `NULL`,
|  | const char * | cmt = `NULL`,
|  | const p_list * | fieldcmts = `NULL`,
|  | const sclass_t * | sclass = `NULL`,
|  | const uint32 * | value = `NULL`
| ) |  |

Set named typeinfo.

Parameters

  ti | pointer to til.
  name | name of type (any ascii string)
  ntf_flags | combination of Flags for named types
  ptr | pointer to typeinfo to save
  fields | ptr to the field/args names. may be NULL
  cmt | ptr to the main comment. may be NULL
  fieldcmts | ptr to the field/args comments. may be NULL
  sclass | ptr to storage class. may be NULL
  value | ptr to symbol value. for types, ptr to the ordinal number. may be NULL

Return values

  false | name==NULL or ptr==NULL
  true | successfully saved the typeinfo

idaman size_t ida_export get_named_type_size | ( | const til_t * | ti,
|  | const char * | name,
|  | int | ntf_flags,
|  | size_t * | lp = `NULL`
| ) |  |

Get size of the named type.

Return values

  -1 | error (unknown name)
  0 | unknown size
  >0 | the size

idaman bool ida_export del_named_type | ( | til_t * | ti,
|  | const char * | name,
|  | int | ntf_flags
| ) |  |

Delete information about a symbol.

Parameters

  ti | type library
  name | name of symbol
  ntf_flags | combination of Flags for named types

Returns
  success

idaman int ida_export rename_named_type | ( | til_t * | ti,
|  | const char * | from,
|  | const char * | to,
|  | int | ntf_flags
| ) |  |

Rename a type or a symbol.

If NTF_TYPE is specified and numbered types are enabled (idati has them enabled) then this function can be used to add or delete type names.
The ordinals can be specified as specially crafted names: '#' followed by set_de(ordinal).

Parameters

  ti | type library
  from | source name
  to | destination name. NULL denotes anonymous name
  ntf_flags | combination of Flags for named types

Returns
  error code

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_name3 | ( | qstring * | out,
|  | const char * | name,
|  | bool | mangle,
|  | cm_t | cc = `CM_CC_UNKNOWN`
| ) |  |

Decorate/undecorate a C symbol name.

Parameters

  out | output buffer
  name | name of symbol
  mangle | true-mangle, false-unmangle
  cc | calling convention

Returns
  success

idaman ssize_t ida_export calc_c_cpp_name4 | ( | qstring * | out,
|  | const char * | name,
|  | const tinfo_t * | type,
|  | int | ccn_flags
| ) |  |

Get C or C++ form of the name.

Parameters

  out | output buffer
  name | original (mangled or decorated) name
  type | name type if known, otherwise NULL
  ccn_flags | one of C/C++ naming flags