Re: [PATCHv5 04/17] diff: introduce more flexible emit function
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Jun 13, 2017, 21:54 UTC
- Message-ID
- <20170613145457.2e888c27@twelve2.svl.corp.google.com>
- In-Reply-To
- <20170524214036.29623-5-sbeller@google.com>
On Wed, 24 May 2017 14:40:23 -0700 Stefan Beller <sbeller@google.com> wrote:
Show 7 quoted lines
> Currently, diff output is written either through the emit_line_0 > function or through the FILE * in struct diff_options directly. To > make it easier to teach diff to buffer its output (which will be done > in a subsequent commit), introduce a more flexible emit_line() function. > In this commit, direct usages of emit_line_0() are replaced with > emit_line(); subsequent commits will also replace usages of the > FILE * with emit().
Check the names of the functions in this paragraph.
Show 12 quoted lines
> diff --git a/diff.c b/diff.c > index 2f9722b382..3569857818 100644 > --- a/diff.c > +++ b/diff.c > @@ -516,36 +516,30 @@ static void check_blank_at_eof(mmfile_t *mf1, mmfile_t *mf2, > ecbdata->blank_at_eof_in_postimage = (at - l2) + 1; > } > > -static void emit_line_0(struct diff_options *o, const char *set, const char *reset, > - int first, const char *line, int len) > +static void emit_line(struct diff_options *o, const char *set, const char *reset, > + int add_line_prefix, int sign, const char *line, int len)
In the future, this function is going to be used even to emit partial lines - could this be called emit() instead?