28 ht_pp_insert(cache,
str,
r);
38 rz_list_foreach (newly_added, it,
s) {
39 ht_pp_delete(cache,
s);
47 if (!cache_newly_added) {
64 for (
i = 0;
i < arguments;
i++) {
72 char *argument_type =
sdb_anext(values, &argument_name);
75 argument_name =
rz_strf(arg_name,
"arg%d",
i);
77 char *error_msg =
NULL;
79 if (!ttype || error_msg) {
80 eprintf(
"error parsing \"%s\" func arg type \"%s\": %s\n",
name, argument_type, error_msg);
107 char *error_msg =
NULL;
109 if (!ttype || error_msg) {
110 eprintf(
"error parsing \"%s\" func return type \"%s\": %s \n",
name, rettype, error_msg);
114 callable->
ret = ttype;
133 return !strcmp(
v,
"func");
138 HtPP *type_str_cache = ht_pp_new0();
139 if (!type_str_cache) {
154 ht_pp_free(type_str_cache);
236 if (callable->
noret) {
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 RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
RZ_API RZ_BORROW RzListIter * rz_list_push(RZ_NONNULL RzList *list, void *item)
Alias for rz_list_append.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
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 bool sdb_bool_get(Sdb *db, const char *str, ut32 *cas)
RZ_API int sdb_num_set(Sdb *s, const char *key, ut64 v, ut32 cas)
RZ_API int sdb_bool_set(Sdb *db, const char *str, bool v, ut32 cas)
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)
#define rz_strf(buf,...)
Convenience macro for local temporary strings.
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 void rz_strbuf_init(RzStrBuf *sb)
static void ** rz_pvector_reserve(RzPVector *vec, size_t capacity)
static size_t rz_pvector_len(const RzPVector *vec)
static void ** rz_pvector_push(RzPVector *vec, void *x)
#define rz_pvector_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_filter(Sdb *s, SdbForeachCallback filter, bool sorted)
RZ_API char * sdb_anext(char *str, char **next)
static char * sdbkv_key(const SdbKv *kv)
RZ_API bool rz_type_db_load_callables_sdb_str(RzTypeDB *typedb, RZ_NONNULL const char *str)
Loads the callable types from SDB KV string.
static RzType * parse_type_string_cached(RzTypeParser *parser, HtPP *cache, const char *str, char **error_msg, RZ_OUT RzList *newly_added)
static RzCallable * get_callable_type(RzTypeDB *typedb, Sdb *sdb, const char *name, HtPP *type_str_cache)
RZ_API bool rz_serialize_callables_load(RZ_NONNULL Sdb *db, RZ_NONNULL RzTypeDB *typedb, RZ_NULLABLE RzSerializeResultInfo *res)
Loads the callable types from SDB.
static bool sdb_load_by_path(RZ_NONNULL RzTypeDB *typedb, RZ_NONNULL const char *path)
RZ_API bool rz_type_db_load_callables_sdb(RzTypeDB *typedb, RZ_NONNULL const char *path)
Loads the callable types from compiled SDB specified by path.
static bool sdb_load_callables(RzTypeDB *typedb, Sdb *sdb)
static bool export_callable_cb(void *user, const void *k, const void *v)
static bool callable_export_sdb(RZ_NONNULL Sdb *db, RZ_NONNULL const RzTypeDB *typedb)
static void type_string_cache_rollback(HtPP *cache, RzList *newly_added)
RZ_API void rz_serialize_callables_save(RZ_NONNULL Sdb *db, RZ_NONNULL RzTypeDB *typedb)
Saves the callable types into SDB.
static void save_callable(const RzTypeDB *typedb, Sdb *sdb, const RzCallable *callable)
static bool filter_func(void *user, const char *k, const char *v)
static bool sdb_load_from_string(RZ_NONNULL RzTypeDB *typedb, RZ_NONNULL const char *string)
RzPVector * args
optional for the time being
RZ_API RZ_OWN RzCallable * rz_type_func_new(RzTypeDB *typedb, RZ_NONNULL const char *name, RZ_OWN RZ_NULLABLE RzType *type)
Creates a new RzCallable type.
RZ_API void rz_type_callable_free(RZ_NONNULL RzCallable *callable)
Frees the RzCallable.
RZ_API void rz_type_callable_arg_free(RzCallableArg *arg)
Frees the RzCallableArg.
RZ_API void rz_type_free(RZ_NULLABLE RzType *type)
Frees the RzType.
RZ_API RZ_OWN RzType * rz_type_clone(RZ_BORROW RZ_NONNULL const RzType *type)
Creates an exact clone of the RzType.
RZ_API RZ_OWN char * rz_type_as_string(const RzTypeDB *typedb, RZ_NONNULL const RzType *type)
Returns the type C representation.
void error(const char *msg)