Go to the source code of this file.
◆ DIFF_IS_LINES_METHOD
#define DIFF_IS_LINES_METHOD |
( |
|
x | ) |
(x.elem_at == methods_lines.elem_at) |
◆ line_compare()
static int line_compare |
( |
const char * |
a_elem, |
|
|
const char * |
b_elem |
|
) |
| |
|
static |
Definition at line 53 of file lines_diff.c.
54 return strcmp(a_elem, b_elem);
◆ line_elem_at()
Definition at line 49 of file lines_diff.c.
RZ_API RZ_BORROW void * rz_list_get_n(RZ_NONNULL const RzList *list, ut32 n)
Returns the N-th element of the list.
References rz_list_get_n().
◆ line_free()
static void line_free |
( |
RzList * |
array | ) |
|
|
static |
Definition at line 66 of file lines_diff.c.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
References rz_list_free().
◆ line_hash()
Definition at line 57 of file lines_diff.c.
RZ_API ut32 rz_diff_hash_data(RZ_NULLABLE const ut8 *buffer, ut32 size)
Calculates the hash of any given data.
References rz_diff_hash_data().
◆ line_stringify()
static void line_stringify |
( |
const char * |
a_elem, |
|
|
RzStrBuf * |
sb |
|
) |
| |
|
static |
◆ tokenize_lines()
Definition at line 8 of file lines_diff.c.
16 RZ_LOG_ERROR(
"rz_diff_line_new: cannot allocate list of lines\n");
17 goto tokenize_newlines_fail;
20 size = strlen(
string);
21 for (
size_t i = 0;
i <
size; ++
i) {
22 if (
string[
i] ==
'\n') {
25 RZ_LOG_ERROR(
"rz_diff_line_new: cannot allocate line or add it to the list\n");
27 goto tokenize_newlines_fail;
36 RZ_LOG_ERROR(
"rz_diff_line_new: cannot allocate last line or add it to the list\n");
38 goto tokenize_newlines_fail;
44 tokenize_newlines_fail:
static RzBinSourceLineInfo * lines(RzBinFile *bf)
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_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
void(* RzListFree)(void *ptr)
#define RZ_LOG_ERROR(fmtstr,...)
RZ_API char * rz_str_ndup(RZ_NULLABLE const char *ptr, int len)
Create new copy of string ptr limited to size len.
References free(), i, setup::line, lines(), NULL, rz_list_append(), rz_list_free(), rz_list_newf(), RZ_LOG_ERROR, and rz_str_ndup().
Referenced by rz_diff_lines_new().
◆ methods_lines
Initial value:= {
}
static bool fake_ignore(const void *value)
void(* RzDiffMethodFree)(const void *array)
static int line_compare(const char *a_elem, const char *b_elem)
static void line_free(RzList *array)
static void line_stringify(const char *a_elem, RzStrBuf *sb)
static ut32 line_hash(const char *elem)
static const void * line_elem_at(const RzList *array, ut32 index)
const void *(* RzDiffMethodElemAt)(RZ_BORROW const void *array, ut32 index)
ut32(* RzDiffMethodElemHash)(RZ_BORROW const void *elem)
void(* RzDiffMethodStringify)(RZ_BORROW const void *elem, RZ_BORROW RzStrBuf *sb)
int(* RzDiffMethodCompare)(RZ_BORROW const void *a_elem, RZ_BORROW const void *b_elem)
Definition at line 70 of file lines_diff.c.
Referenced by rz_diff_lines_new().