Re: [PATCH 1/2] xdiff-interface: export comparing and hashing strings
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Oct 25, 2017, 04:26 UTC
- Message-ID
- <CAPig+cR1Lw=JGJ7BoTdvM_PG+sjAoas=GTbs2fkRTYq35Mj2sg@mail.gmail.com>
- In-Reply-To
- <20171024234234.10944-2-sbeller@google.com>
On Tue, Oct 24, 2017 at 7:42 PM, Stefan Beller <sbeller@google.com> wrote:
Show 20 quoted lines
> This will turn out to be useful in a later patch. > > xdl_recmatch is exported in xdiff/xutils.h, to be used by various > xdiff/*.c files, but not outside of xdiff/. This one makes it available > to the outside, too. > > While at it, add documentation. > > Signed-off-by: Stefan Beller <sbeller@google.com> > --- > diff --git a/xdiff-interface.h b/xdiff-interface.h > @@ -29,4 +29,20 @@ extern void xdiff_clear_find_func(xdemitconf_t *xecfg); > +/* > + * Compare the strings l1 with l2 which are of size s1 and s2 respectively. > + * Returns 1 if the strings are deemed equal, 0 otherwise. > + * The `flags` given as XDF_WHITESPACE_FLAGS determine how white spaces > + * are treated for the comparision. > + */ > +extern int xdiff_compare_lines(const char *a, long len_a, > + const char *b, long len_b, long flags);
The comment block talks about 'l1', 'l2', 's1', and 's2', but the declaration uses 'a', 'b, 'len_a', 'len_b'. Confusing.