90 return (
char *)vec->
a + vec->
elem_size * index;
96 return (
void *)vec->
a;
169 #define rz_vector_foreach(vec, it) \
170 if (!rz_vector_empty(vec)) \
171 for (it = (void *)(vec)->a; (char *)it != (char *)(vec)->a + ((vec)->len * (vec)->elem_size); it = (void *)((char *)it + (vec)->elem_size))
173 #define rz_vector_foreach_prev(vec, it) \
174 if (!rz_vector_empty(vec)) \
175 for (it = (void *)((char *)(vec)->a + (((vec)->len - 1) * (vec)->elem_size)); (char *)it != (char *)(vec)->a - (vec)->elem_size; it = (void *)((char *)it - (vec)->elem_size))
177 #define rz_vector_enumerate(vec, it, i) \
178 if (!rz_vector_empty(vec)) \
179 for (it = (void *)(vec)->a, i = 0; i < (vec)->len; it = (void *)((char *)it + (vec)->elem_size), i++)
190 #define rz_vector_lower_bound(vec, x, i, cmp) \
192 size_t h = (vec)->len, m; \
193 for (i = 0; i < h;) { \
194 m = i + ((h - i) >> 1); \
195 if ((cmp(x, ((char *)(vec)->a + (vec)->elem_size * m))) > 0) { \
203 #define rz_vector_upper_bound(vec, x, i, cmp) \
205 size_t h = (vec)->len, m; \
206 for (i = 0; i < h;) { \
207 m = i + ((h - i) >> 1); \
208 if ((cmp(x, ((char *)(vec)->a + (vec)->elem_size * m))) < 0) { \
238 return ((
void **)vec->
v.
a)[index];
243 ((
void **)vec->
v.
a)[index] =
e;
253 return ((
void **)vec->
v.
a) + index;
259 return (
void **)vec->
v.
a;
265 return ((
void **)vec->
v.
a)[0];
271 return ((
void **)vec->
v.
a)[vec->
v.
len - 1];
334 #define rz_pvector_foreach(vec, it) \
335 for (it = (void **)(vec)->v.a; (vec)->v.len && it != (void **)(vec)->v.a + (vec)->v.len; it++)
338 #define rz_pvector_foreach_prev(vec, it) \
339 for (it = ((vec)->v.len == 0 ? NULL : (void **)(vec)->v.a + (vec)->v.len - 1); it && it != (void **)(vec)->v.a - 1; it--)
351 #define rz_array_lower_bound(array, len, x, i, cmp) \
354 for (i = 0; i < h;) { \
355 m = i + ((h - i) >> 1); \
356 if (cmp((x), ((array)[m])) > 0) { \
374 #define rz_array_upper_bound(array, len, x, i, cmp) \
377 for (i = 0; i < h;) { \
378 m = i + ((h - i) >> 1); \
379 if (cmp((x), ((array)[m])) < 0) { \
393 #define rz_array_find(array, x, itr, start, stop, cmp) \
395 for (itr = start; itr < stop; itr++) { \
396 if (cmp((array[itr]), x) == 0) { \
412 #define rz_pvector_lower_bound(vec, x, i, cmp) \
413 rz_array_lower_bound((void **)(vec)->v.a, (vec)->v.len, x, i, cmp)
424 #define rz_pvector_upper_bound(vec, x, i, cmp) \
425 rz_array_upper_bound((void **)(vec)->v.a, (vec)->v.len, x, i, cmp)
static RzILOpEffect * cmp(cs_insn *insn, bool is_thumb)
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 count
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 static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
RZ_API void Ht_() free(HtName_(Ht) *ht)
#define rz_return_if_fail(expr)
#define rz_return_val_if_fail(expr, val)
static void ** rz_pvector_data(RzPVector *vec)
static void * rz_pvector_tail(RzPVector *vec)
RZ_API void * rz_vector_assign_at(RzVector *vec, size_t index, void *elem)
RZ_API void rz_vector_pop(RzVector *vec, void *into)
static void ** rz_pvector_reserve(RzPVector *vec, size_t capacity)
static void * rz_vector_index_ptr(RzVector *vec, size_t index)
void(* RzVectorFree)(void *e, void *user)
RZ_API void rz_pvector_sort(RzPVector *vec, RzPVectorComparator cmp)
RZ_API void rz_vector_pop_front(RzVector *vec, void *into)
RZ_API void * rz_vector_push_front(RzVector *vec, void *x)
RZ_API void * rz_pvector_pop(RzPVector *vec)
static void ** rz_pvector_insert_range(RzPVector *vec, size_t index, void **first, size_t count)
RZ_API void * rz_vector_flush(RzVector *vec)
Turn the vector into a fixed-size array. This will clear the vector and return an array of its origin...
static void ** rz_pvector_push_front(RzPVector *vec, void *x)
static void rz_pvector_set(RzPVector *vec, size_t index, void *e)
static void ** rz_pvector_index_ptr(RzPVector *vec, size_t index)
struct rz_pvector_t RzPVector
RZ_API void rz_pvector_remove_data(RzPVector *vec, void *x)
RZ_API void rz_pvector_init(RzPVector *vec, RzPVectorFree free)
RZ_API void rz_vector_remove_at(RzVector *vec, size_t index, void *into)
RZ_API void rz_pvector_fini(RzPVector *vec)
static void * rz_vector_tail(RzVector *vec)
RZ_API void * rz_vector_reserve(RzVector *vec, size_t capacity)
static size_t rz_pvector_len(const RzPVector *vec)
RZ_API void * rz_vector_push(RzVector *vec, void *x)
RZ_API RzPVector * rz_pvector_new(RzPVectorFree free)
void(* RzPVectorFree)(void *e)
static void * rz_vector_head(RzVector *vec)
static bool rz_pvector_empty(RzPVector *vec)
RZ_API void * rz_pvector_remove_at(RzPVector *vec, size_t index)
static void ** rz_pvector_push(RzPVector *vec, void *x)
RZ_API void * rz_pvector_pop_front(RzPVector *vec)
RZ_API void ** rz_pvector_contains(RzPVector *vec, void *x)
static void ** rz_pvector_shrink(RzPVector *vec)
RZ_API void rz_vector_fini(RzVector *vec)
RZ_API void rz_vector_free(RzVector *vec)
RZ_API void rz_pvector_free(RzPVector *vec)
RZ_API void * rz_vector_insert_range(RzVector *vec, size_t index, void *first, size_t count)
RZ_API RzVector * rz_vector_clone(RzVector *vec)
RZ_API RzVector * rz_vector_new(size_t elem_size, RzVectorFree free, void *free_user)
RZ_API RzPVector * rz_pvector_new_with_len(RzPVectorFree free, size_t length)
RZ_API void rz_vector_clear(RzVector *vec)
static void ** rz_pvector_flush(RzPVector *vec)
static size_t rz_vector_len(const RzVector *vec)
RZ_API void rz_vector_assign(RzVector *vec, void *p, void *elem)
RZ_API void rz_vector_init(RzVector *vec, size_t elem_size, RzVectorFree free, void *free_user)
static bool rz_vector_empty(const RzVector *vec)
RZ_API void * rz_vector_insert(RzVector *vec, size_t index, void *x)
RZ_API void rz_vector_remove_range(RzVector *vec, size_t index, size_t count, void *into)
int(* RzPVectorComparator)(const void *a, const void *b)
RZ_API void rz_pvector_clear(RzPVector *vec)
struct rz_vector_t RzVector
static void * rz_pvector_at(const RzPVector *vec, size_t index)
int(* RzVectorComparator)(const void *a, const void *b)
RZ_API void rz_vector_sort(RzVector *vec, RzVectorComparator cmp, bool reverse)
Sort function for RzVector.
static void * rz_pvector_head(RzPVector *vec)
RZ_API void * rz_vector_shrink(RzVector *vec)
static void ** rz_pvector_insert(RzPVector *vec, size_t index, void *x)