102 list->sorted =
false;
177 void *item =
iter->data;
212 if (!(list2->length)) {
215 if (!(list1->length)) {
216 list1->head = list2->head;
217 list1->tail = list2->tail;
219 list1->tail->n = list2->head;
220 list2->head->p = list1->tail;
221 list1->tail = list2->tail;
222 list1->tail->n =
NULL;
223 list1->sorted =
false;
225 list1->length += list2->length;
227 list2->head = list2->tail =
NULL;
266 for (
i = 0;
i < arr_size;
i++) {
298 list->tail->n = item;
301 item->
p =
list->tail;
308 list->sorted =
false;
324 list->head->p = item;
327 item->
n =
list->head;
348 if (!
list->head || !
n) {
351 for (it =
list->head,
i = 0; it && it->
data; it = it->
n,
i++) {
431 for (it =
list->head,
i = 0; it && it->
data; it = it->
n,
i++) {
433 if (!it->
p && !it->
n) {
482 for (it =
list->head; it && it->
data; it = it->
p) {
507 rz_list_foreach (
list,
iter, data) {
523 for (it =
list->head; it && it->
data &&
cmp(data, it->
data) > 0; it = it->
n) {
557 for (it =
list->head,
i = 0; it; it = it->
n,
i++) {
563 list->sorted =
false;
580 for (it =
list->head,
i = 0; it && it->
data; it = it->
n,
i++) {
636 while (first || second) {
725 for (it =
list->head; it && it->
data; it = it->
n) {
726 for (it2 = it->
n; it2 && it2->
data; it2 = it2->
n) {
745 if (
list->length > 43) {
766 rz_list_foreach (
list,
iter, item) {
768 rz_list_foreach (nl, iter2, item2) {
769 if (
cmp(item, item2) == 0) {
792 rz_list_foreach (
list,
iter, item) {
static RzILOpEffect * cmp(cs_insn *insn, bool is_thumb)
static char * slow(struct match *, char *, char *, sopno, sopno)
static char * fast(struct match *, char *, char *, sopno, sopno)
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API const KEY_TYPE bool * found
static void list(RzEgg *egg)
RZ_API RZ_BORROW RzListIter * rz_list_iter_get_next(RzListIter *list)
returns the next RzList iterator in the list
static RzListIter * _r_list_half_split(RzListIter *head)
RZ_API void rz_list_insertion_sort(RZ_NONNULL RzList *list, RZ_NONNULL RzListComparator cmp)
Insertion sorts the list via the RzListComparator.
RZ_API RZ_BORROW void * rz_list_iter_get_next_data(RzListIter *list)
returns the value stored in the next RzList iterator
RZ_API RZ_BORROW RzListIter * rz_list_find(RZ_NONNULL const RzList *list, const void *p, RZ_NONNULL RzListComparator cmp)
Returns RzListIter element which matches via the RzListComparator.
RZ_API RZ_BORROW RzListIter * rz_list_contains(RZ_NONNULL const RzList *list, RZ_NONNULL const void *ptr)
Returns the RzListIter of the given pointer, if found.
RZ_API RZ_OWN RzList * rz_list_uniq(RZ_NONNULL const RzList *list, RZ_NONNULL RzListComparator cmp)
Returns a new RzList which contains only unique values.
RZ_API RZ_BORROW RzListIter * rz_list_prepend(RZ_NONNULL RzList *list, void *data)
Appends at the beginning of the list a new element.
RZ_API void rz_list_split(RZ_NONNULL RzList *list, void *ptr)
RZ_API RZ_BORROW RzListIter * rz_list_iterator(const RzList *list)
returns the first RzList iterator int the list
RZ_API RZ_BORROW RzListIter * rz_list_insert(RZ_NONNULL RzList *list, ut32 n, void *data)
Inserts a new element at the N-th position.
RZ_API void rz_list_iter_free(RzListIter *list)
RZ_API void rz_list_reverse(RZ_NONNULL RzList *list)
Reverses the list.
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_find_ptr(RZ_NONNULL const RzList *list, RZ_NONNULL const void *ptr)
Returns the RzListIter of the given pointer, if found.
RZ_API void rz_list_merge_sort(RZ_NONNULL RzList *list, RZ_NONNULL RzListComparator cmp)
Merge sorts the list via the RzListComparator.
RZ_API RZ_BORROW void * rz_list_get_bottom(RZ_NONNULL const RzList *list)
Returns the first element of the list.
RZ_API void rz_list_delete(RZ_NONNULL RzList *list, RZ_NONNULL RzListIter *iter)
Removes an entry in the list by using the RzListIter pointer.
RZ_API RZ_OWN RzList * rz_list_clone(RZ_NONNULL const RzList *list)
Shallow copies of the list (but doesn't free its elements)
RZ_API RZ_OWN RzList * rz_list_new_from_array(RZ_NONNULL const void **arr, size_t arr_size)
Allocates a new RzList and adds an array elements to it.
RZ_API void * rz_list_iter_get_data(RzListIter *list)
returns the value stored in the list element
RZ_API bool rz_list_delete_data(RZ_NONNULL RzList *list, void *ptr)
Deletes an entry in the list by searching for a pointer.
RZ_API RZ_BORROW void * rz_list_get_top(RZ_NONNULL const RzList *list)
Returns the last element of the list.
RZ_API RZ_OWN void * rz_list_pop(RZ_NONNULL RzList *list)
Removes and returns the last element of the list.
RZ_API RZ_OWN RzList * rz_list_new(void)
Returns a new initialized RzList pointer (free method is not initialized)
static RzListIter * _merge(RzListIter *first, RzListIter *second, RzListComparator cmp)
RZ_API RZ_OWN RzList * rz_list_of_sdblist(SdbList *sl)
Converts a SdbList into a RzList.
RZ_API void rz_list_sort(RZ_NONNULL RzList *list, RZ_NONNULL RzListComparator cmp)
Sorts via merge sort or via insertion sort a list.
RZ_API RZ_OWN char * rz_list_to_str(RZ_NONNULL RzList *list, char ch)
Casts a RzList containg strings into a concatenated string.
RZ_API ut32 rz_list_del_n(RZ_NONNULL RzList *list, ut32 n)
Removes the N-th element of the list.
RZ_API RZ_OWN RzListIter * rz_list_item_new(void *data)
Creates a RzListIter element that can be inserted into a RzList.
RZ_API ut32 rz_list_set_n(RZ_NONNULL RzList *list, ut32 n, void *p)
Sets the N-th element of the list.
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 void * rz_list_first(RZ_NONNULL const RzList *list)
Returns the first element of the list.
RZ_API RZ_BORROW void * rz_list_last(RZ_NONNULL const RzList *list)
Returns the last element of the list.
RZ_API RZ_BORROW void * rz_list_get_n(RZ_NONNULL const RzList *list, ut32 n)
Returns the N-th element of the list.
RZ_API RZ_BORROW RzListIter * rz_list_push(RZ_NONNULL RzList *list, void *item)
Alias for rz_list_append.
RZ_API ut32 rz_list_length(RZ_NONNULL const RzList *list)
Returns the length of the list.
RzListIter * rz_list_iter_new(void)
RZ_API RZ_OWN void * rz_list_pop_head(RZ_NONNULL RzList *list)
Removes and returns the first element of the list.
RZ_API void rz_list_split_iter(RZ_NONNULL RzList *list, RZ_NONNULL RzListIter *iter)
RZ_API RzListIter * rz_list_get_next(RzListIter *list)
Returns the next element of the list.
RZ_API void rz_list_init(RZ_NONNULL RzList *list)
Initializes the RzList pointer.
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
static RzListIter * _merge_sort(RzListIter *head, RzListComparator cmp)
RZ_API RZ_BORROW RzListIter * rz_list_add_sorted(RZ_NONNULL RzList *list, void *data, RZ_NONNULL RzListComparator cmp)
Adds an element to a sorted list via the RzListComparator.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
RZ_API void rz_list_purge(RZ_NONNULL RzList *list)
Empties the list without freeing the list pointer.
void * calloc(size_t number, size_t size)
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")
#define ls_foreach(list, it, pos)
#define rz_return_if_fail(expr)
#define rz_return_val_if_fail(expr, val)
void(* RzListFree)(void *ptr)
int(* RzListComparator)(const void *value, const void *list_data)
RZ_API RZ_OWN char * rz_strbuf_drain(RzStrBuf *sb)
RZ_API RzStrBuf * rz_strbuf_new(const char *s)
RZ_API bool rz_strbuf_appendf(RzStrBuf *sb, const char *fmt,...) RZ_PRINTF_CHECK(2
static char * sdbkv_key(const SdbKv *kv)
struct rz_list_iter_t * n
struct rz_list_iter_t * p