#include <rz_regex.h>
#include <rz_util.h>
#include <rz_cons.h>
#include "pager_private.h"
Go to the source code of this file.
|
RZ_IPI void | pager_color_line (const char *line, RzStrpool *p, RzList *ml) |
|
RZ_IPI void | pager_printpage (const char *line, int *index, RzList **mla, int from, int to, int w) |
|
RZ_IPI int | pager_next_match (int from, RzList **mla, int lcount) |
|
RZ_IPI int | pager_prev_match (int from, RzList **mla) |
|
RZ_IPI bool | pager_all_matches (const char *s, RzRegex *rx, RzList **mla, int *lines, int lcount) |
|
RZ_IPI int * | pager_splitlines (char *s, int *lines_count) |
|
◆ pager_all_matches()
Definition at line 101 of file pager.c.
105 for (l = 0; l < lcount; l++) {
107 const char *loff =
s +
lines[l];
108 char *clean =
strdup(loff);
114 m.rm_eo = slen = strlen(clean);
117 if (!cpos ||
m.rm_so >= ncpos) {
122 ms->
rm_so = cpos[
m.rm_so];
123 ms->
rm_eo = cpos[
m.rm_eo];
static RzILOpEffect * mla(cs_insn *insn, bool is_thumb)
static RzBinSourceLineInfo * lines(RzBinFile *bf)
RZ_API void Ht_() free(HtName_(Ht) *ht)
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_purge(RZ_NONNULL RzList *list)
Empties the list without freeing the list pointer.
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 int rz_regex_exec(const RzRegex *preg, const char *string, size_t nmatch, RzRegexMatch __pmatch[], int eflags)
#define RZ_REGEX_STARTEND
RZ_API int rz_str_ansi_filter(char *str, char **out, int **cposs, int len)
References free(), lines(), regress::m, mla(), NULL, rz_regmatch_t::rm_eo, rz_regmatch_t::rm_so, rz_list_append(), rz_list_purge(), RZ_NEW0, rz_regex_exec(), RZ_REGEX_STARTEND, rz_str_ansi_filter(), s, and strdup().
Referenced by rz_cons_less_str().
◆ pager_color_line()
Definition at line 9 of file pager.c.
15 RZ_CONS_INVERT(
true,
true),
16 RZ_CONS_INVERT(
false,
true)
23 rz_list_foreach (ml, it,
m) {
27 m_len =
m->rm_eo -
m->rm_so;
RZ_API char * rz_str_ndup(RZ_NULLABLE const char *ptr, int len)
Create new copy of string ptr limited to size len.
RZ_API int rz_strpool_append(RzStrpool *p, const char *s)
RZ_API char * rz_strpool_empty(RzStrpool *p)
RZ_API int rz_strpool_memcat(RzStrpool *p, const char *s, int len)
References free(), setup::line, regress::m, NULL, p, rz_str_ansi_filter(), rz_str_ndup(), rz_strpool_append(), rz_strpool_empty(), and rz_strpool_memcat().
Referenced by pager_printpage().
◆ pager_next_match()
Definition at line 74 of file pager.c.
76 if (
from > lcount - 2) {
79 for (l =
from + 1; l < lcount; l++) {
RZ_API RZ_BORROW void * rz_list_first(RZ_NONNULL const RzList *list)
Returns the first element of the list.
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr from
References from, mla(), and rz_list_first().
Referenced by rz_cons_less_str().
◆ pager_prev_match()
◆ pager_printpage()
Definition at line 48 of file pager.c.
65 rz_cons_print(
p->str);
RZ_API void rz_cons_clear00(void)
RZ_API void rz_cons_reset_colors(void)
RZ_API void rz_cons_flush(void)
RZ_API void rz_cons_println(const char *str)
RZ_API int rz_strpool_ansi_chop(RzStrpool *p, int n)
RZ_API void rz_strpool_free(RzStrpool *p)
RZ_API RzStrpool * rz_strpool_new(int sz)
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr socklen_t static fromlen const void const struct sockaddr to
References from, i, setup::line, mla(), p, pager_color_line(), rz_cons_clear00(), rz_cons_flush(), rz_cons_println(), rz_cons_reset_colors(), rz_strpool_ansi_chop(), rz_strpool_free(), rz_strpool_new(), to, and w.
Referenced by rz_cons_less_str().
◆ pager_splitlines()
RZ_IPI int* pager_splitlines |
( |
char * |
s, |
|
|
int * |
lines_count |
|
) |
| |