Rizin
unix-like reverse engineering framework and cli tools
rz_type.h File Reference
#include <rz_types.h>
#include <rz_util/rz_num.h>
#include <rz_util/rz_print.h>
#include <rz_bind.h>
#include <rz_io.h>
#include <rz_list.h>

Go to the source code of this file.

Classes

struct  rz_type_target_t
 
struct  rz_type_db_t
 
struct  rz_type_enum_case_t
 
struct  rz_type_struct_member_t
 
struct  rz_type_union_member_t
 
struct  rz_base_type_struct_t
 
struct  rz_base_type_union_t
 
struct  rz_base_type_enum_t
 
struct  rz_base_type_t
 
struct  rz_callable_arg_t
 
struct  rz_callable_at
 
struct  rz_type_t
 
struct  rz_type_path_t
 
struct  rz_type_constraint_t
 type constrained by the type conditions More...
 

Typedefs

typedef struct rz_type_target_t RzTypeTarget
 
typedef struct rz_type_parser_t RzTypeParser
 
typedef struct rz_type_db_t RzTypeDB
 
typedef struct rz_type_t RzType
 
typedef ut64 RzTypeAttribute
 
typedef struct rz_type_enum_case_t RzTypeEnumCase
 
typedef struct rz_type_struct_member_t RzTypeStructMember
 
typedef struct rz_type_union_member_t RzTypeUnionMember
 
typedef struct rz_base_type_struct_t RzBaseTypeStruct
 
typedef struct rz_base_type_union_t RzBaseTypeUnion
 
typedef struct rz_base_type_enum_t RzBaseTypeEnum
 
typedef struct rz_base_type_t RzBaseType
 
typedef struct rz_callable_arg_t RzCallableArg
 
typedef struct rz_callable_at RzCallable
 
typedef struct rz_type_path_t RzTypePath
 
typedef struct rz_type_constraint_t RzTypeConstraint
 type constrained by the type conditions More...
 

Enumerations

enum  RzTypeAttributeMask { RZ_TYPE_ATTRIBUTE_TYPECLASS_MASK = 0xF }
 
enum  RzTypeTypeclass {
  RZ_TYPE_TYPECLASS_NONE , RZ_TYPE_TYPECLASS_NUM , RZ_TYPE_TYPECLASS_INTEGRAL , RZ_TYPE_TYPECLASS_FLOATING ,
  RZ_TYPE_TYPECLASS_ADDRESS , RZ_TYPE_TYPECLASS_INTEGRAL_SIGNED , RZ_TYPE_TYPECLASS_INTEGRAL_UNSIGNED , RZ_TYPE_TYPECLASS_INVALID
}
 
enum  RzBaseTypeKind {
  RZ_BASE_TYPE_KIND_STRUCT , RZ_BASE_TYPE_KIND_UNION , RZ_BASE_TYPE_KIND_ENUM , RZ_BASE_TYPE_KIND_TYPEDEF ,
  RZ_BASE_TYPE_KIND_ATOMIC
}
 
enum  RzTypeKind { RZ_TYPE_KIND_IDENTIFIER , RZ_TYPE_KIND_POINTER , RZ_TYPE_KIND_ARRAY , RZ_TYPE_KIND_CALLABLE }
 
enum  RzTypeIdentifierKind { RZ_TYPE_IDENTIFIER_KIND_UNSPECIFIED , RZ_TYPE_IDENTIFIER_KIND_STRUCT , RZ_TYPE_IDENTIFIER_KIND_UNION , RZ_TYPE_IDENTIFIER_KIND_ENUM }
 
enum  RzTypeCond {
  RZ_TYPE_COND_AL = 0 , RZ_TYPE_COND_EQ , RZ_TYPE_COND_NE , RZ_TYPE_COND_GE ,
  RZ_TYPE_COND_GT , RZ_TYPE_COND_LE , RZ_TYPE_COND_LT , RZ_TYPE_COND_NV ,
  RZ_TYPE_COND_HS , RZ_TYPE_COND_LO , RZ_TYPE_COND_MI , RZ_TYPE_COND_PL ,
  RZ_TYPE_COND_VS , RZ_TYPE_COND_VC , RZ_TYPE_COND_HI , RZ_TYPE_COND_LS ,
  RZ_TYPE_COND_HEX_SCL_TRUE , RZ_TYPE_COND_HEX_SCL_FALSE , RZ_TYPE_COND_HEX_VEC_TRUE , RZ_TYPE_COND_HEX_VEC_FALSE ,
  RZ_TYPE_COND_EXCEPTION
}
 Type Conditions. More...
 
enum  RzTypePrintOpts {
  RZ_TYPE_PRINT_NO_OPTS = 0 , RZ_TYPE_PRINT_MULTILINE = 1 << 0 , RZ_TYPE_PRINT_UNFOLD_ANON_ONLY = 1 << 1 , RZ_TYPE_PRINT_UNFOLD_ANON_ONLY_STRICT = 1 << 2 ,
  RZ_TYPE_PRINT_ZERO_VLA = 1 << 3 , RZ_TYPE_PRINT_NO_END_SEMICOLON = 1 << 4 , RZ_TYPE_PRINT_ANONYMOUS = 1 << 5 , RZ_TYPE_PRINT_END_NEWLINE = 1 << 6 ,
  RZ_TYPE_PRINT_SHOW_TYPEDEF = 1 << 7
}
 

Functions

 RZ_LIB_VERSION_HEADER (rz_type)
 

Typedef Documentation

◆ RzBaseType

typedef struct rz_base_type_t RzBaseType

◆ RzBaseTypeEnum

◆ RzBaseTypeStruct

◆ RzBaseTypeUnion

◆ RzCallable

typedef struct rz_callable_at RzCallable

◆ RzCallableArg

◆ RzType

typedef struct rz_type_t RzType

Definition at line 18 of file rz_type.h.

◆ RzTypeAttribute

Definition at line 52 of file rz_type.h.

◆ RzTypeConstraint

type constrained by the type conditions

◆ RzTypeDB

typedef struct rz_type_db_t RzTypeDB

◆ RzTypeEnumCase

◆ RzTypeParser

Definition at line 18 of file rz_type.h.

◆ RzTypePath

typedef struct rz_type_path_t RzTypePath

◆ RzTypeStructMember

◆ RzTypeTarget

◆ RzTypeUnionMember

Enumeration Type Documentation

◆ RzBaseTypeKind

Enumerator
RZ_BASE_TYPE_KIND_STRUCT 
RZ_BASE_TYPE_KIND_UNION 
RZ_BASE_TYPE_KIND_ENUM 
RZ_BASE_TYPE_KIND_TYPEDEF 
RZ_BASE_TYPE_KIND_ATOMIC 

Definition at line 72 of file rz_type.h.

72  {
77  RZ_BASE_TYPE_KIND_ATOMIC, // For real atomic base types
RzBaseTypeKind
Definition: rz_type.h:72
@ RZ_BASE_TYPE_KIND_TYPEDEF
Definition: rz_type.h:76
@ RZ_BASE_TYPE_KIND_ATOMIC
Definition: rz_type.h:77
@ RZ_BASE_TYPE_KIND_UNION
Definition: rz_type.h:74
@ RZ_BASE_TYPE_KIND_STRUCT
Definition: rz_type.h:73
@ RZ_BASE_TYPE_KIND_ENUM
Definition: rz_type.h:75

◆ RzTypeAttributeMask

Enumerator
RZ_TYPE_ATTRIBUTE_TYPECLASS_MASK 

Definition at line 54 of file rz_type.h.

54  {
55  // A first group - typeclasses
56  RZ_TYPE_ATTRIBUTE_TYPECLASS_MASK = 0xF, //< to store typeclasses
57  // The rest are reserved
RzTypeAttributeMask
Definition: rz_type.h:54
@ RZ_TYPE_ATTRIBUTE_TYPECLASS_MASK
Definition: rz_type.h:56

◆ RzTypeCond

enum RzTypeCond

Type Conditions.

Enumerator
RZ_TYPE_COND_AL 

Always executed (no condition)

RZ_TYPE_COND_EQ 

Equal.

RZ_TYPE_COND_NE 

Not equal.

RZ_TYPE_COND_GE 

Greater or equal.

RZ_TYPE_COND_GT 

Greater than.

RZ_TYPE_COND_LE 

Less or equal.

RZ_TYPE_COND_LT 

Less than.

RZ_TYPE_COND_NV 

Never executed must be a nop? :D.

RZ_TYPE_COND_HS 

Carry set >, ==, or unordered.

RZ_TYPE_COND_LO 

Carry clear Less than.

RZ_TYPE_COND_MI 

Minus, negative Less than.

RZ_TYPE_COND_PL 

Plus, positive or zero >, ==, or unordered.

RZ_TYPE_COND_VS 

Overflow Unordered.

RZ_TYPE_COND_VC 

No overflow Not unordered.

RZ_TYPE_COND_HI 

Unsigned higher Greater than, or unordered.

RZ_TYPE_COND_LS 

Unsigned lower or same Less than or equal.

RZ_TYPE_COND_HEX_SCL_TRUE 
RZ_TYPE_COND_HEX_SCL_FALSE 
RZ_TYPE_COND_HEX_VEC_TRUE 
RZ_TYPE_COND_HEX_VEC_FALSE 
RZ_TYPE_COND_EXCEPTION 

Definition at line 182 of file rz_type.h.

182  {
183  RZ_TYPE_COND_AL = 0,
199  RZ_TYPE_COND_HEX_SCL_TRUE, // Hexagon only: Scalar instruction if(Pu)
200  RZ_TYPE_COND_HEX_SCL_FALSE, // Hexagon only: Scalar instruction if(!Pu)
201  RZ_TYPE_COND_HEX_VEC_TRUE, // Hexagon only: Vector instruction if(Pu)
202  RZ_TYPE_COND_HEX_VEC_FALSE, // Hexagon only: Vector instruction if(!Pu)
203  RZ_TYPE_COND_EXCEPTION, // when the jump is taken only during an exception
204 } RzTypeCond;
RzTypeCond
Type Conditions.
Definition: rz_type.h:182
@ RZ_TYPE_COND_LO
Carry clear Less than.
Definition: rz_type.h:192
@ RZ_TYPE_COND_VS
Overflow Unordered.
Definition: rz_type.h:195
@ RZ_TYPE_COND_HEX_SCL_TRUE
Definition: rz_type.h:199
@ RZ_TYPE_COND_LE
Less or equal.
Definition: rz_type.h:188
@ RZ_TYPE_COND_GE
Greater or equal.
Definition: rz_type.h:186
@ RZ_TYPE_COND_HEX_VEC_TRUE
Definition: rz_type.h:201
@ RZ_TYPE_COND_VC
No overflow Not unordered.
Definition: rz_type.h:196
@ RZ_TYPE_COND_HEX_SCL_FALSE
Definition: rz_type.h:200
@ RZ_TYPE_COND_LS
Unsigned lower or same Less than or equal.
Definition: rz_type.h:198
@ RZ_TYPE_COND_NV
Never executed must be a nop? :D.
Definition: rz_type.h:190
@ RZ_TYPE_COND_EQ
Equal.
Definition: rz_type.h:184
@ RZ_TYPE_COND_HS
Carry set >, ==, or unordered.
Definition: rz_type.h:191
@ RZ_TYPE_COND_NE
Not equal.
Definition: rz_type.h:185
@ RZ_TYPE_COND_AL
Always executed (no condition)
Definition: rz_type.h:183
@ RZ_TYPE_COND_MI
Minus, negative Less than.
Definition: rz_type.h:193
@ RZ_TYPE_COND_HI
Unsigned higher Greater than, or unordered.
Definition: rz_type.h:197
@ RZ_TYPE_COND_GT
Greater than.
Definition: rz_type.h:187
@ RZ_TYPE_COND_HEX_VEC_FALSE
Definition: rz_type.h:202
@ RZ_TYPE_COND_PL
Plus, positive or zero >, ==, or unordered.
Definition: rz_type.h:194
@ RZ_TYPE_COND_LT
Less than.
Definition: rz_type.h:189
@ RZ_TYPE_COND_EXCEPTION
Definition: rz_type.h:203

◆ RzTypeIdentifierKind

Enumerator
RZ_TYPE_IDENTIFIER_KIND_UNSPECIFIED 
RZ_TYPE_IDENTIFIER_KIND_STRUCT 
RZ_TYPE_IDENTIFIER_KIND_UNION 
RZ_TYPE_IDENTIFIER_KIND_ENUM 

Definition at line 134 of file rz_type.h.

134  {
RzTypeIdentifierKind
Definition: rz_type.h:134
@ RZ_TYPE_IDENTIFIER_KIND_STRUCT
Definition: rz_type.h:136
@ RZ_TYPE_IDENTIFIER_KIND_UNSPECIFIED
Definition: rz_type.h:135
@ RZ_TYPE_IDENTIFIER_KIND_ENUM
Definition: rz_type.h:138
@ RZ_TYPE_IDENTIFIER_KIND_UNION
Definition: rz_type.h:137

◆ RzTypeKind

enum RzTypeKind
Enumerator
RZ_TYPE_KIND_IDENTIFIER 
RZ_TYPE_KIND_POINTER 
RZ_TYPE_KIND_ARRAY 
RZ_TYPE_KIND_CALLABLE 

Definition at line 127 of file rz_type.h.

127  {
132 } RzTypeKind;
RzTypeKind
Definition: rz_type.h:127
@ RZ_TYPE_KIND_ARRAY
Definition: rz_type.h:130
@ RZ_TYPE_KIND_CALLABLE
Definition: rz_type.h:131
@ RZ_TYPE_KIND_IDENTIFIER
Definition: rz_type.h:128
@ RZ_TYPE_KIND_POINTER
Definition: rz_type.h:129

◆ RzTypePrintOpts

Enumerator
RZ_TYPE_PRINT_NO_OPTS 
RZ_TYPE_PRINT_MULTILINE 
RZ_TYPE_PRINT_UNFOLD_ANON_ONLY 
RZ_TYPE_PRINT_UNFOLD_ANON_ONLY_STRICT 
RZ_TYPE_PRINT_ZERO_VLA 
RZ_TYPE_PRINT_NO_END_SEMICOLON 
RZ_TYPE_PRINT_ANONYMOUS 
RZ_TYPE_PRINT_END_NEWLINE 
RZ_TYPE_PRINT_SHOW_TYPEDEF 

Definition at line 214 of file rz_type.h.

214  {
215  RZ_TYPE_PRINT_NO_OPTS = 0, // no options
216  RZ_TYPE_PRINT_MULTILINE = 1 << 0, // print multiline string (every single type on a single line)
217  RZ_TYPE_PRINT_UNFOLD_ANON_ONLY = 1 << 1, // only unfold anonymous structs/unions/enums (applies only to inner members, not the root member)
218  RZ_TYPE_PRINT_UNFOLD_ANON_ONLY_STRICT = 1 << 2, // only unfold anonymous structs/unions/enums
219  RZ_TYPE_PRINT_ZERO_VLA = 1 << 3, // use [0] to denote VLA instead of (default) []
220  RZ_TYPE_PRINT_NO_END_SEMICOLON = 1 << 4, // return a string without a semicolon at end
221  RZ_TYPE_PRINT_ANONYMOUS = 1 << 5, // use "[struct|union|enum] anonymous" as the typename for anonymous structs/unions/enums
222  RZ_TYPE_PRINT_END_NEWLINE = 1 << 6, // return a string with a newline at the end
223  RZ_TYPE_PRINT_SHOW_TYPEDEF = 1 << 7 // show typedefs wherever found
RzTypePrintOpts
Definition: rz_type.h:214
@ RZ_TYPE_PRINT_NO_END_SEMICOLON
Definition: rz_type.h:220
@ RZ_TYPE_PRINT_ZERO_VLA
Definition: rz_type.h:219
@ RZ_TYPE_PRINT_SHOW_TYPEDEF
Definition: rz_type.h:223
@ RZ_TYPE_PRINT_NO_OPTS
Definition: rz_type.h:215
@ RZ_TYPE_PRINT_UNFOLD_ANON_ONLY
Definition: rz_type.h:217
@ RZ_TYPE_PRINT_UNFOLD_ANON_ONLY_STRICT
Definition: rz_type.h:218
@ RZ_TYPE_PRINT_END_NEWLINE
Definition: rz_type.h:222
@ RZ_TYPE_PRINT_MULTILINE
Definition: rz_type.h:216
@ RZ_TYPE_PRINT_ANONYMOUS
Definition: rz_type.h:221

◆ RzTypeTypeclass

Enumerator
RZ_TYPE_TYPECLASS_NONE 
RZ_TYPE_TYPECLASS_NUM 
RZ_TYPE_TYPECLASS_INTEGRAL 
RZ_TYPE_TYPECLASS_FLOATING 
RZ_TYPE_TYPECLASS_ADDRESS 
RZ_TYPE_TYPECLASS_INTEGRAL_SIGNED 
RZ_TYPE_TYPECLASS_INTEGRAL_UNSIGNED 
RZ_TYPE_TYPECLASS_INVALID 

Definition at line 61 of file rz_type.h.

61  {
62  RZ_TYPE_TYPECLASS_NONE, //< most generic types
63  RZ_TYPE_TYPECLASS_NUM, //< all numbers
64  RZ_TYPE_TYPECLASS_INTEGRAL, //< all integer numbers
65  RZ_TYPE_TYPECLASS_FLOATING, //< all floating point numbers
66  RZ_TYPE_TYPECLASS_ADDRESS, //< integer types to work with pointers
67  RZ_TYPE_TYPECLASS_INTEGRAL_SIGNED, //< all signed integral types (subclass of Integral)
68  RZ_TYPE_TYPECLASS_INTEGRAL_UNSIGNED, //< all unsigned integral types (subclass of Integral)
RzTypeTypeclass
Definition: rz_type.h:61
@ RZ_TYPE_TYPECLASS_FLOATING
Definition: rz_type.h:65
@ RZ_TYPE_TYPECLASS_NONE
Definition: rz_type.h:62
@ RZ_TYPE_TYPECLASS_INVALID
Definition: rz_type.h:69
@ RZ_TYPE_TYPECLASS_ADDRESS
Definition: rz_type.h:66
@ RZ_TYPE_TYPECLASS_NUM
Definition: rz_type.h:63
@ RZ_TYPE_TYPECLASS_INTEGRAL
Definition: rz_type.h:64
@ RZ_TYPE_TYPECLASS_INTEGRAL_SIGNED
Definition: rz_type.h:67
@ RZ_TYPE_TYPECLASS_INTEGRAL_UNSIGNED
Definition: rz_type.h:68

Function Documentation

◆ RZ_LIB_VERSION_HEADER()

RZ_LIB_VERSION_HEADER ( rz_type  )