Type related functions and class. More...
Classes | |
| struct | typestring |
| Type string. More... | |
Functions | |
| const type_t * | remove_typedef (const type_t *type, const p_list **fields=NULL) |
| Resolve a typedef. | |
| bool | is_type_correct (const type_t *ptr) |
| Verify a type string. | |
| bool | is_type_integral (const type_t *type) |
| Is integral type? | |
| bool | is_type_small_struni (const type_t *ptr) |
| Is a small structure or union? | |
| bool | is_ptr_or_array (type_t t) |
| Is a pointer or array type? | |
| bool | is_paf (type_t t) |
| Is a pointer, array, or function type? | |
| const type_t * | skip_ptr_or_array_header (const type_t *t) |
| Skip pointer or array type header. | |
| int | partial_type_num (const type_t *type) |
| Calculate number of partial subtypes. | |
| type_t | get_float_bit (int width) |
| Get a type byte for a floating point value. | |
| typestring | get_int_type_by_width_and_sign (int srcwidth, type_sign_t sign) |
| Create a type string by width and sign. | |
| typestring | get_unk_type (int size) |
| Create a partial type string by width. | |
| typestring | dummy_ptrtype (int ptrsize, bool isfp) |
| Generate a dummy pointer type. | |
| bool | get_member_type (const member_t *mptr, typestring *type, qtype *fields=NULL) |
| Get type of a structure field. | |
| typestring | make_array (const type_t *type, int nelems) |
| Create an array type. | |
| typestring | make_pointer (const typestring &type) |
| Create a pointer type. | |
| typestring | create_typedef (const char *name) |
| Create a reference to a named type. | |
| typestring | remove_pointer (const typestring &type) |
| Get pointed object type. | |
| bool | cnv_array_to_ptr (typestring &type) |
| Convert array type into pointer type. | |
Type related functions and class.
| bool cnv_array_to_ptr | ( | typestring & | type | ) |
Convert array type into pointer type.
This function performs the following conversion: "type[]" -> "type *"
| type | array type. |
Definition at line 4086 of file hexrays.hpp.
References hexdsp.
| typestring create_typedef | ( | const char * | name | ) |
Create a reference to a named type.
| name | type name |
Definition at line 4070 of file hexrays.hpp.
References hexdsp.
| typestring dummy_ptrtype | ( | int | ptrsize, | |
| bool | isfp | |||
| ) |
Generate a dummy pointer type.
| buf | output buffer | |
| bufsize | size of output buffer. must be bigger than 4 bytes (at least) | |
| ptrsize | size of pointed object | |
| isfp | is floating point object? |
Definition at line 4040 of file hexrays.hpp.
References hexdsp.
| type_t get_float_bit | ( | int | width | ) |
Get a type byte for a floating point value.
| width | width of the desired type |
Definition at line 3992 of file hexrays.hpp.
References hexdsp.
| typestring get_int_type_by_width_and_sign | ( | int | srcwidth, | |
| type_sign_t | sign | |||
| ) |
Create a type string by width and sign.
Returns a simple type (examples: int, short) with the given width and sign.
| srcwidth | size of the type in bytes | |
| sign | sign of the type |
Definition at line 4024 of file hexrays.hpp.
References hexdsp.
| bool get_member_type | ( | const member_t * | mptr, | |
| typestring * | type, | |||
| qtype * | fields = NULL | |||
| ) |
Get type of a structure field.
This function performs validity checks of the field type. Wrong types are rejected.
| mptr | structure field | |
| type | pointer to the variable where the type is returned. This parameter can be NULL. | |
| fields | pointer to the variable where the fields are returned. This parameter can be NULL. |
Definition at line 4048 of file hexrays.hpp.
References hexdsp.
| typestring get_unk_type | ( | int | size | ) |
Create a partial type string by width.
Returns a partially defined type (examples: _DWORD, _BYTE) with the given width.
| size | size of the type in bytes |
Definition at line 4032 of file hexrays.hpp.
References hexdsp.
| bool is_type_correct | ( | const type_t * | ptr | ) |
Verify a type string.
Definition at line 3968 of file hexrays.hpp.
References hexdsp.
| bool is_type_integral | ( | const type_t * | type | ) |
Is integral type?
Definition at line 3974 of file hexrays.hpp.
References hexdsp.
| bool is_type_small_struni | ( | const type_t * | ptr | ) |
Is a small structure or union?
Definition at line 3980 of file hexrays.hpp.
References hexdsp.
| typestring make_array | ( | const type_t * | type, | |
| int | nelems | |||
| ) |
Create an array type.
This function performs the following conversion: "type" -> "type[N]"
| type | array element type. | |
| nelems | number of array elements. zero represents unknown array dimensions. |
Definition at line 4054 of file hexrays.hpp.
References hexdsp.
| typestring make_pointer | ( | const typestring & | type | ) |
Create a pointer type.
This function performs the following conversion: "type" -> "type*"
| type | object type. |
Definition at line 4062 of file hexrays.hpp.
References hexdsp.
| int partial_type_num | ( | const type_t * | type | ) |
Calculate number of partial subtypes.
Definition at line 3986 of file hexrays.hpp.
References hexdsp.
| typestring remove_pointer | ( | const typestring & | type | ) |
Get pointed object type.
This function performs the following conversion: "type*" -> "type"
| type | this parameter should be of a pointer type. The function will return the pointed type. If the parameter is not a pointer, then it is returned as is. |
Definition at line 4078 of file hexrays.hpp.
References hexdsp.
| const type_t * remove_typedef | ( | const type_t * | type, | |
| const p_list ** | fields = NULL | |||
| ) |
Resolve a typedef.
This function never returns NULL. If an invalid type is encountered, it throws vd_failure_t with MERR_UNKTYPE
type if the input type was not a typedef. | type | type string to resolve | |
| fields | ptr to ptr to the accompanying fields string |
Definition at line 3962 of file hexrays.hpp.
References hexdsp.
| const type_t* skip_ptr_or_array_header | ( | const type_t * | t | ) |
Skip pointer or array type header.
Definition at line 244 of file hexrays.hpp.