Rizin
unix-like reverse engineering framework and cli tools
vmarks.c File Reference
#include <rz_core.h>

Go to the source code of this file.

Functions

RZ_API void rz_core_visual_mark_reset (RzCore *core)
 
RZ_API bool rz_core_visual_mark_dump (RzCore *core)
 
RZ_API void rz_core_visual_mark_set (RzCore *core, ut8 ch, ut64 addr)
 
RZ_API void rz_core_visual_mark_del (RzCore *core, ut8 ch)
 
RZ_API void rz_core_visual_mark (RzCore *core, ut8 ch)
 
RZ_API void rz_core_visual_mark_seek (RzCore *core, ut8 ch)
 

Function Documentation

◆ rz_core_visual_mark()

RZ_API void rz_core_visual_mark ( RzCore core,
ut8  ch 
)

Definition at line 47 of file vmarks.c.

47  {
48  if (IS_DIGIT(ch)) {
49  ch += ASCII_MAX + 1;
50  }
51  rz_core_visual_mark_set(core, ch, core->offset);
52 }
#define IS_DIGIT(x)
Definition: rz_str_util.h:11
#define ASCII_MAX
ut64 offset
Definition: rz_core.h:301
RZ_API void rz_core_visual_mark_set(RzCore *core, ut8 ch, ut64 addr)
Definition: vmarks.c:33

References ASCII_MAX, IS_DIGIT, rz_core_t::offset, and rz_core_visual_mark_set().

Referenced by __add_visual_mark(), and rz_core_visual_cmd().

◆ rz_core_visual_mark_del()

RZ_API void rz_core_visual_mark_del ( RzCore core,
ut8  ch 
)

Definition at line 40 of file vmarks.c.

40  {
41  if (!core->marks_init) {
42  return;
43  }
44  core->marks[ch] = UT64_MAX;
45 }
#define UT64_MAX
Definition: rz_types_base.h:86
ut64 marks[UT8_MAX+1]
Definition: rz_core.h:392
bool marks_init
Definition: rz_core.h:391

References rz_core_t::marks, rz_core_t::marks_init, and UT64_MAX.

Referenced by __handle_visual_mark(), and rz_core_visual_cmd().

◆ rz_core_visual_mark_dump()

RZ_API bool rz_core_visual_mark_dump ( RzCore core)

Definition at line 14 of file vmarks.c.

14  {
15  size_t i;
16  if (!core->marks_init) {
17  return false;
18  }
19  bool res = false;
20  for (i = 0; i < UT8_MAX; i++) {
21  if (core->marks[i] != UT64_MAX) {
22  if (i > ASCII_MAX) {
23  rz_cons_printf("fV %zu 0x%" PFMT64x "\n", i - ASCII_MAX - 1, core->marks[i]);
24  } else {
25  rz_cons_printf("fV %c 0x%" PFMT64x "\n", (char)i, core->marks[i]);
26  }
27  res = true;
28  }
29  }
30  return res;
31 }
lzma_index ** i
Definition: index.h:629
RZ_API int rz_cons_printf(const char *format,...)
Definition: cons.c:1202
#define PFMT64x
Definition: rz_types.h:393
#define UT8_MAX

References ASCII_MAX, i, rz_core_t::marks, rz_core_t::marks_init, PFMT64x, rz_cons_printf(), UT64_MAX, and UT8_MAX.

Referenced by __handle_visual_mark(), and rz_core_visual_cmd().

◆ rz_core_visual_mark_reset()

RZ_API void rz_core_visual_mark_reset ( RzCore core)

Definition at line 6 of file vmarks.c.

6  {
7  size_t i;
8  for (i = 0; i < UT8_MAX; i++) {
9  core->marks[i] = UT64_MAX;
10  }
11  core->marks_init = true;
12 }

References i, rz_core_t::marks, rz_core_t::marks_init, UT64_MAX, and UT8_MAX.

Referenced by rz_core_visual_mark_set().

◆ rz_core_visual_mark_seek()

RZ_API void rz_core_visual_mark_seek ( RzCore core,
ut8  ch 
)

Definition at line 54 of file vmarks.c.

54  {
55  if (core->marks_init && core->marks[ch] != UT64_MAX) {
56  rz_core_seek(core, core->marks[ch], true);
57  }
58 }
RZ_API bool rz_core_seek(RzCore *core, ut64 addr, bool rb)
Seek to addr.
Definition: seek.c:116

References rz_core_t::marks, rz_core_t::marks_init, rz_core_seek(), and UT64_MAX.

Referenced by __handle_visual_mark(), and rz_core_visual_cmd().

◆ rz_core_visual_mark_set()

RZ_API void rz_core_visual_mark_set ( RzCore core,
ut8  ch,
ut64  addr 
)

Definition at line 33 of file vmarks.c.

33  {
34  if (!core->marks_init) {
36  }
37  core->marks[ch] = addr;
38 }
RZ_API void rz_core_visual_mark_reset(RzCore *core)
Definition: vmarks.c:6
static int addr
Definition: z80asm.c:58

References addr, rz_core_t::marks, rz_core_t::marks_init, and rz_core_visual_mark_reset().

Referenced by rz_core_visual_mark().