46 const char *path_begin =
path;
53 index = (
ut64)strtoull(member, (
char **)&
path, 10);
54 if (member ==
path || *
path !=
']') {
55 eprintf(
"Type path: expected ] (\"%s\")",
path - 1);
66 for (membsize = 0; member[membsize]; ++membsize) {
67 if (strchr(
".[", member[membsize])) {
72 eprintf(
"Type path: expected member (\"%s\")",
path - 1);
79 size_t typenamesize = member - path_begin;
80 char *
typename =
malloc(typenamesize + 1);
84 strncpy(
typename, path_begin, typenamesize);
85 typename[typenamesize] =
'\0';
100 path = member + membsize;
103 eprintf(
"Type path: unexpected char (\"%s\")",
path - 1);
140 ut64 memb_offset = 0;
142 if (memb_offset ==
offset) {
181 ut64 memb_offset = 0;
183 if (memb_offset ==
offset) {
253 if (!strcmp(memb->
name, member)) {
277 if (!strcmp(memb->
name, member)) {
RZ_API RZ_OWN RzList * rz_type_db_get_base_types(const RzTypeDB *typedb)
Returns the list of all basic types.
RZ_API RZ_BORROW RzBaseType * rz_type_db_get_base_type(const RzTypeDB *typedb, RZ_NONNULL const char *name)
Searches for the RzBaseType in the types database given the name.
static static fork const void static count static fd const char const char static newpath const char static path const char path
RZ_API RZ_OWN RzType * rz_type_identifier_of_base_type(const RzTypeDB *typedb, RZ_NONNULL const RzBaseType *btype, bool is_const)
Creates a new RzType indentifier from the given RzBaseType.
RZ_API RZ_OWN RzType * rz_type_identifier_of_base_type_str(const RzTypeDB *typedb, RZ_NONNULL const char *name)
Creates a new RzType indentifier from the given RzBaseType name.
RZ_API void Ht_() free(HtName_(Ht) *ht)
static void list(RzEgg *egg)
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
RZ_API bool rz_list_join(RZ_NONNULL RzList *list1, RZ_NONNULL RzList *list2)
Joins 2 list into one (list2 pointer needs to be freed by the user)
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
void * malloc(size_t size)
insn_type_descr_t types[]
#define rz_warn_if_reached()
#define rz_return_val_if_fail(expr, val)
void(* RzListFree)(void *ptr)
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
@ RZ_BASE_TYPE_KIND_UNION
@ RZ_BASE_TYPE_KIND_STRUCT
@ RZ_TYPE_IDENTIFIER_KIND_STRUCT
@ RZ_TYPE_IDENTIFIER_KIND_UNION
@ RZ_TYPE_KIND_IDENTIFIER
#define rz_vector_foreach(vec, it)
RzBaseTypeStruct struct_data
RzBaseTypeUnion union_data
struct rz_type_t::@292::@294 identifier
RZ_API ut64 rz_type_db_struct_member_offset(RZ_NONNULL const RzTypeDB *typedb, RZ_NONNULL const char *name, RZ_NONNULL const char *member)
Returns the offset in bytes of the structure member if there is a match.
RZ_API st64 rz_type_offset_by_path(const RzTypeDB *typedb, RZ_NONNULL const char *path)
Returns the offset of the member given path.
static st64 path_walker(const RzTypeDB *typedb, const char *path)
static bool structured_member_walker(const RzTypeDB *typedb, RzList *list, RzType *parent, RzType *type, char *path, ut64 offset)
RZ_API RZ_OWN RzTypePath * rz_type_path_new(RZ_BORROW RZ_NONNULL RzType *type, RZ_OWN RZ_NONNULL char *path)
Creates a new instance of RzTypePath.
RZ_API RZ_OWN RzList * rz_type_db_get_by_offset(const RzTypeDB *typedb, ut64 offset)
Returns the list of all structured types that have members matching the offset.
RZ_API ut64 rz_type_db_struct_member_packed_offset(RZ_NONNULL const RzTypeDB *typedb, RZ_NONNULL const char *name, RZ_NONNULL const char *member)
Returns the packed offset in bits of the structure member if there is a match.
RZ_API RZ_OWN RzList * rz_type_path_by_offset(const RzTypeDB *typedb, RzBaseType *btype, ut64 offset)
Returns the list of all type paths matching the offset.
RZ_API void rz_type_path_free(RZ_NULLABLE RzTypePath *tpath)
Frees the RzTypePath.
RZ_API ut64 rz_type_db_get_bitsize(const RzTypeDB *typedb, RZ_NONNULL RzType *type)
Returns the type size in bits (target dependent)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()