22 type->attrs = typeclass;
57 char *val_key =
rz_str_newf(
"enum.%s.%s", sname, cur);
84 tpair->
type = base_type;
113 char *type_key =
rz_str_newf(
"struct.%s.%s", sname, cur);
130 char *error_msg =
NULL;
132 if (!ttype || error_msg) {
160 tpair->
type = base_type;
190 char *type_key =
rz_str_newf(
"union.%s.%s", sname, cur);
201 char *error_msg =
NULL;
203 if (!ttype || error_msg) {
229 tpair->
type = base_type;
250 char *error_msg =
NULL;
252 if (!ttype || error_msg) {
257 base_type->
type = ttype;
258 if (!base_type->
type) {
267 tpair->
type = base_type;
294 base_type->
type = ttype;
309 tpair->
type = base_type;
337 if (tpair && tpair->
type) {
359 const char *kind =
"struct";
370 char *sname =
type->name;
388 rz_strbuf_setf(¶m_key,
"%s.%s.%s", kind, sname, member_sname),
407 const char *kind =
"union";
418 char *sname =
type->name;
436 rz_strbuf_setf(¶m_key,
"%s.%s.%s", kind, sname, member_sname),
468 char *sname =
type->name;
469 sdb_set(sdb, sname,
"enum", 0);
514 char *sname =
type->name;
515 sdb_set(sdb, sname,
"type", 0);
547 char *sname =
type->name;
548 sdb_set(sdb, sname,
"typedef", 0);
569 switch (
type->kind) {
RZ_API void rz_type_base_type_free(RzBaseType *type)
Frees the RzBaseType instance and all of its members.
RZ_API RZ_OWN RzBaseType * rz_type_base_type_new(RzBaseTypeKind kind)
Allocates a new instance of RzBaseType given the kind.
RZ_API RZ_OWN RzType * rz_type_parse_string_single(RzTypeParser *parser, const char *code, char **error_msg)
Parses the single C type definition.
static static fork const void static count static fd const char const char static newpath const char static path const char path
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len key
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API int sdb_query_lines(Sdb *s, const char *cmd)
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
RZ_API void ls_free(SdbList *list)
#define ls_foreach(list, it, pos)
RZ_API ut64 sdb_num_get(Sdb *s, const char *key, ut32 *cas)
#define rz_return_if_fail(expr)
#define rz_return_val_if_fail(expr, val)
RZ_API bool rz_file_exists(const char *str)
#define RZ_LOG_DEBUG(fmtstr,...)
#define RZ_STR_ISNOTEMPTY(x)
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
RZ_API char * rz_str_sanitize_sdb_key(const char *s)
#define RZ_STR_ISEMPTY(x)
RZ_API char * rz_strbuf_get(RzStrBuf *sb)
RZ_API const char * rz_strbuf_initf(RzStrBuf *sb, const char *fmt,...)
RZ_API const char * rz_strbuf_setf(RzStrBuf *sb, const char *fmt,...) RZ_PRINTF_CHECK(2
RZ_API void rz_strbuf_fini(RzStrBuf *sb)
RZ_API bool rz_strbuf_appendf(RzStrBuf *sb, const char *fmt,...) RZ_PRINTF_CHECK(2
RZ_API void rz_strbuf_init(RzStrBuf *sb)
@ RZ_BASE_TYPE_KIND_TYPEDEF
@ RZ_BASE_TYPE_KIND_ATOMIC
@ RZ_BASE_TYPE_KIND_UNION
@ RZ_BASE_TYPE_KIND_STRUCT
@ RZ_TYPE_ATTRIBUTE_TYPECLASS_MASK
@ RZ_TYPE_IDENTIFIER_KIND_UNSPECIFIED
@ RZ_TYPE_TYPECLASS_INVALID
@ RZ_TYPE_KIND_IDENTIFIER
RZ_API void * rz_vector_reserve(RzVector *vec, size_t capacity)
RZ_API void * rz_vector_push(RzVector *vec, void *x)
#define rz_vector_foreach(vec, it)
RZ_API Sdb * sdb_new(const char *path, const char *name, int lock)
RZ_API int sdb_set(Sdb *s, const char *key, const char *val, ut32 cas)
RZ_API void sdb_close(Sdb *s)
RZ_API Sdb * sdb_new0(void)
RZ_API char * sdb_get(Sdb *s, const char *key, ut32 *cas)
RZ_API bool sdb_free(Sdb *s)
RZ_API const char * sdb_const_get(Sdb *s, const char *key, ut32 *cas)
RZ_API SdbList * sdb_foreach_list(Sdb *s, bool sorted)
RZ_API char * sdb_anext(char *str, char **next)
RZ_API int sdb_alen(const char *str)
#define sdb_aforeach_next(x)
#define sdb_aforeach(x, y)
static char * sdbkv_key(const SdbKv *kv)
static char * sdbkv_value(const SdbKv *kv)
static TypeFormatPair * get_atomic_type(RzTypeDB *typedb, Sdb *sdb, const char *sname)
static TypeFormatPair * get_struct_type(RzTypeDB *typedb, Sdb *sdb, const char *sname)
static TypeFormatPair * get_typedef_type(RzTypeDB *typedb, Sdb *sdb, const char *sname)
void sdb_save_base_type(const RzTypeDB *typedb, RZ_NONNULL Sdb *sdb, const RzBaseType *type)
static bool export_base_type_cb(void *user, const void *k, const void *v)
static bool types_export_sdb(RZ_NONNULL Sdb *db, RZ_NONNULL const RzTypeDB *typedb)
static void save_enum(const RzTypeDB *typedb, Sdb *sdb, const RzBaseType *type)
static RzTypeTypeclass get_base_type_typeclass(RZ_NONNULL const RzBaseType *type)
static void set_base_type_typeclass(RZ_NONNULL RzBaseType *type, RzTypeTypeclass typeclass)
static void save_struct(const RzTypeDB *typedb, Sdb *sdb, const RzBaseType *type)
static void save_union(const RzTypeDB *typedb, Sdb *sdb, const RzBaseType *type)
static TypeFormatPair * get_enum_type(Sdb *sdb, const char *sname)
RZ_IPI bool types_load_sdb(RZ_NONNULL Sdb *db, RZ_NONNULL RzTypeDB *typedb)
static bool sdb_load_by_path(RZ_NONNULL RzTypeDB *typedb, RZ_NONNULL const char *path)
RZ_API void rz_serialize_types_save(RZ_NONNULL Sdb *db, RZ_NONNULL const RzTypeDB *typedb)
Saves the types into SDB.
RZ_API bool rz_type_db_load_sdb_str(RzTypeDB *typedb, RZ_NONNULL const char *str)
Loads the types from SDB KV string.
RZ_API bool rz_serialize_types_load(RZ_NONNULL Sdb *db, RZ_NONNULL RzTypeDB *typedb, RZ_NULLABLE RzSerializeResultInfo *res)
Loads the types from SDB.
static void save_typedef(const RzTypeDB *typedb, Sdb *sdb, const RzBaseType *type)
bool sdb_load_base_types(RzTypeDB *typedb, Sdb *sdb)
static void save_atomic_type(const RzTypeDB *typedb, Sdb *sdb, const RzBaseType *type)
static TypeFormatPair * get_union_type(RzTypeDB *typedb, Sdb *sdb, const char *sname)
static char * get_type_data(Sdb *sdb, const char *type, const char *sname)
static bool sdb_load_from_string(RZ_NONNULL RzTypeDB *typedb, RZ_NONNULL const char *string)
RZ_API bool rz_type_db_load_sdb(RzTypeDB *typedb, RZ_NONNULL const char *path)
Loads the types from compiled SDB specified by path.
RzBaseTypeStruct struct_data
RzBaseTypeUnion union_data
struct rz_type_t::@292::@294 identifier
RZ_API RZ_OWN char * rz_type_as_string(const RzTypeDB *typedb, RZ_NONNULL const RzType *type)
Returns the type C representation.
RZ_API RZ_BORROW const char * rz_type_typeclass_as_string(RzTypeTypeclass typeclass)
Returns the string representation of a typeclass.
RZ_API RzTypeTypeclass rz_type_typeclass_from_string(RZ_NONNULL const char *typeclass)
Returns the typeclass from the string name of it.
void error(const char *msg)