36 typedef const void *(*RzDiffMethodElemAt)(
RZ_BORROW const void *array,
ut32 index);
57 #define RZ_DIFF_OP_SIZE_A(op) (((op)->a_end) - ((op)->a_beg))
58 #define RZ_DIFF_OP_SIZE_B(op) (((op)->b_end) - ((op)->b_beg))
59 #define RZ_DIFF_DEFAULT_N_GROUPS 3
RZ_API RZ_OWN RzDiff * rz_diff_generic_new(RZ_BORROW const void *a, ut32 a_size, RZ_BORROW const void *b, ut32 b_size, RZ_NONNULL RzDiffMethods *methods)
Returns the structure needed to diff arrays of user defined types.
RZ_API RZ_BORROW const void * rz_diff_get_b(RZ_NONNULL RzDiff *diff)
returns the pointer of the B array that passed to rz_diff_XXX_new()
RZ_API RZ_OWN RzList * rz_diff_opcodes_new(RZ_NONNULL RzDiff *diff)
Generates a list of steps needed to go from A to B.
RZ_API ut32 rz_diff_hash_data(RZ_NULLABLE const ut8 *buffer, ut32 size)
Calculates the hash of any given data.
RZ_API RZ_BORROW const void * rz_diff_get_a(RZ_NONNULL RzDiff *diff)
returns the pointer of the A array that passed to rz_diff_XXX_new()
RZ_API RZ_OWN RzList * rz_diff_matches_new(RZ_NONNULL RzDiff *diff)
generates a list of matching blocks
RZ_API bool rz_diff_sizes_ratio(RZ_NONNULL RzDiff *diff, RZ_NONNULL double *result)
Calculates the size ratio between A and B.
RZ_API bool rz_diff_ratio(RZ_NONNULL RzDiff *diff, RZ_NONNULL double *result)
Calculates the similarity ratio between A and B.
RZ_API RZ_OWN RzDiff * rz_diff_lines_new(RZ_BORROW const char *a, RZ_BORROW const char *b, RZ_NULLABLE RzDiffIgnoreLine ignore)
Returns the structure needed to diff lines.
RZ_API RZ_OWN RzDiff * rz_diff_bytes_new(RZ_BORROW const ut8 *a, ut32 a_size, RZ_BORROW const ut8 *b, ut32 b_size, RZ_NULLABLE RzDiffIgnoreByte ignore)
Returns the structure needed to diff buffers of ut8.
RZ_API RZ_OWN RzList * rz_diff_opcodes_grouped_new(RZ_NONNULL RzDiff *diff, ut32 n_groups)
Generates groups of opcodes needed to go from A to B.
RZ_API void rz_diff_free(RZ_NULLABLE RzDiff *diff)
frees the diff structure
RZ_API bool rz_diff_myers_distance(RZ_NONNULL const ut8 *a, ut32 la, RZ_NONNULL const ut8 *b, ut32 lb, RZ_NULLABLE ut32 *distance, RZ_NULLABLE double *similarity)
Calculates the distance between two buffers using the Myers algorithm.
RZ_API bool rz_diff_levenstein_distance(RZ_NONNULL const ut8 *a, ut32 la, RZ_NONNULL const ut8 *b, ut32 lb, RZ_NULLABLE ut32 *distance, RZ_NULLABLE double *similarity)
Calculates the distance between two buffers using the Levenshtein algorithm.
const void *(* RzDiffMethodElemAt)(RZ_BORROW const void *array, ut32 index)
ut32(* RzDiffMethodElemHash)(RZ_BORROW const void *elem)
bool(* RzDiffMethodIgnore)(RZ_BORROW const void *elem)
RZ_LIB_VERSION_HEADER(rz_diff)
bool(* RzDiffIgnoreLine)(RZ_BORROW const char *line)
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)
struct rz_diff_op_t RzDiffOp
bool(* RzDiffIgnoreByte)(const ut64 byte)
enum rz_diff_op_type_t RzDiffOpType
struct rz_diff_methods_t RzDiffMethods
struct match_p_t RzDiffMatch
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr from
static struct sockaddr static addrlen static backlog const void static flags void struct sockaddr socklen_t static fromlen const void const struct sockaddr to
RzDiffMethodStringify stringify
elements from A and B
RzDiffMethodCompare compare
elements from A and B
RzDiffMethodElemAt elem_at
can be either be an element of A or B
RzDiffMethodElemHash elem_hash
can be either be an element of A or B
RzDiffMethodIgnore ignore
elements from A and B
RZ_API RZ_OWN char * rz_diff_unified_text(RZ_NONNULL RzDiff *diff, RZ_NULLABLE const char *from, RZ_NULLABLE const char *to, bool show_time, bool color)
Produces a diff output with A and B inputs presented immediately adjacent to each other.
RZ_API RZ_OWN PJ * rz_diff_unified_json(RZ_NONNULL RzDiff *diff, RZ_NULLABLE const char *from, RZ_NULLABLE const char *to, bool show_time)
Produces a diff output to convert A in B in a JSON format.
ut64(WINAPI *w32_GetEnabledXStateFeatures)()