commit 2f26640c77e9b4d1a303b6c3c7776ff75ad51111 from: Stefan Sperling date: Sat Oct 17 00:26:51 2020 UTC revert db941c24; callers would also need private structs for that idea to work commit - 66ea8e5adfb496de581ba4b78479f3258692ee9e commit + 2f26640c77e9b4d1a303b6c3c7776ff75ad51111 blob - 788ee7f70a4767c36639c50287ba611f2f917dda blob + eb5ea9058a20bee4cbe0ab59e51b057ac8067878 --- include/diff_output.h +++ include/diff_output.h @@ -61,12 +61,6 @@ int diff_chunk_get_right_end(const struct diff_chunk * void diff_chunk_context_get(struct diff_chunk_context *cc, const struct diff_result *r, int chunk_idx, int context_lines); -int diff_chunk_context_empty(const struct diff_chunk_context *cc); -int diff_chunk_contexts_touch(const struct diff_chunk_context *cc, - const struct diff_chunk_context *other); -void diff_chunk_contexts_merge(struct diff_chunk_context *cc, - const struct diff_chunk_context *other); - struct diff_output_unidiff_state; struct diff_output_unidiff_state *diff_output_unidiff_state_alloc(void); void diff_output_unidiff_state_reset(struct diff_output_unidiff_state *state); blob - 1895fddf12374a72d9b814e673fe12a6e3737678 blob + f48c869ab05318ba318a42e11631e120cedb7cb6 --- lib/diff_internal.h +++ lib/diff_internal.h @@ -178,6 +178,19 @@ diff_chunk_type(const struct diff_chunk *chunk) return CHUNK_SAME; } +struct diff_chunk_context; + +bool +diff_chunk_context_empty(const struct diff_chunk_context *cc); + +bool +diff_chunk_contexts_touch(const struct diff_chunk_context *cc, + const struct diff_chunk_context *other); + +void +diff_chunk_contexts_merge(struct diff_chunk_context *cc, + const struct diff_chunk_context *other); + struct diff_state { /* The final result passed to the original diff caller. */ struct diff_result *result; blob - f9307b1fc9fb1776eb3f64b4bf48067896283ca3 blob + 92805f9927a54bfd10e75d1fa3b36915ff80bd93 --- lib/diff_output_unidiff.c +++ lib/diff_output_unidiff.c @@ -28,7 +28,7 @@ #include "diff_internal.h" #include "diff_debug.h" -int +bool diff_chunk_context_empty(const struct diff_chunk_context *cc) { return diff_range_empty(&cc->chunk); @@ -94,7 +94,7 @@ diff_chunk_context_get(struct diff_chunk_context *cc, }; } -int +bool diff_chunk_contexts_touch(const struct diff_chunk_context *cc, const struct diff_chunk_context *other) {