65#define N_DIFF_COMMON 0
67#define N_DIFF_DELETE 1
69#define N_DIFF_INSERT 2
72#define N_DIFF_NO_LINE ((size_t)-1)
75#define N_DIFF_CONTEXT_FULL ((size_t)-1)
78#define N_DIFF_MAX_EDITS_DEFAULT 1000
82#define N_DIFF_MAX_EDITS_CEILING 4000
Structure of a generic LIST container.
size_t line_a
zero based position in the first text, or N_DIFF_NO_LINE
int truncated
1 when the edit limit was hit and the differing region was reported as one delete run followed by one...
size_t nb_deleted
number of N_DIFF_DELETE lines
size_t nb_inserted
number of N_DIFF_INSERT lines
size_t nb_common
number of N_DIFF_COMMON lines
int op
N_DIFF_COMMON, N_DIFF_DELETE or N_DIFF_INSERT.
char * text
line content, without its newline, owned by the result
size_t line_b
zero based position in the second text, or N_DIFF_NO_LINE
LIST * lines
LIST of N_DIFF_LINE*, in output order.
void n_diff_result_free(N_DIFF_RESULT **result)
Free an edit script and every line it holds.
N_DIFF_RESULT * n_diff_lines(const char *text_a, const char *text_b, size_t max_edits)
Compare two texts line by line.
N_STR * n_diff_to_unified(const N_DIFF_RESULT *result, size_t context)
Render an edit script as unified diff text.
one line of an edit script
edit script turning one text into another
A box including a string and his lenght.
List structures and definitions.
N_STR and string function declaration.