create_enum_type

// Enum type information
class enum_type_data_t
{
  // tattr_enum, see TAENUM_... flags
  attribute taenum_bits;

  // enum member sizes (shift amount) and style, see BTE_... constants
  attribute bte;

  // number of enum members
  attribute member_cnt;

  // add enum constant
  success add_constant(string name, string name, uint64 value, string comment=nullptr);
};

// Get named local type TID
//       name - type name
// returns: TID or BADADDR
long get_named_type_tid(string name);

// Get numbered local type TID
//       ord - type ordinal
// returns: TID or BADADDR
long get_numbered_type_tid(long ord);

// create type enum
//       enum_name - type name
//       ei - enum type data of type enum_type_data_t
//       enum_width - the width of a enum element, allowed values: 0 (unspecified),1,2,4,8
//       sign - enum signess (any from TYPE_SIGN_... constants)
//       convert_to_bitmask - try convert enum to bitmask enum (0-false or 1-true)
//       enum_cmt - enum type comment
// returns: enum TID
long create_enum_type(
        string enum_name,
        object ei,
        long enum_width,
        long sign,
        long convert_to_bitmask,
        string enum_cmt=nullptr);
// type signedness
#define TYPE_SIGN_NO_SIGN        0  // no sign, or unknown
#define TYPE_SIGN_TYPE_SIGNED    1  // signed type
#define TYPE_SIGN_TYPE_UNSIGNED  2  // unsigned type

Last updated

Was this helpful?