On the diff-optimizations-tokens branch:
Add skeleton implementation of suffix scanning.
Getting tokens backwards (datasource_get_previous_token), and pushing back
suffix tokens (token_pushback_suffix), are still stub implementations, which
will be added in a follow up commit.
* subversion/include/svn_diff.h
(svn_diff_fns_t): Add new function types datasource_get_previous_token and
token_pushback_suffix. Add parameter open_at_end to datasource_open.
* subversion/libsvn_diff/diff_file.c
(datasource_get_previous_token): New function, stub implementation.
(token_pushback_suffix): New function, stub implementation.
(datasource_open): Add parameter open_at_end. Add implementation to open the
datasource at the end (read last chunk, point curp to the last byte). Make
sure the actual file is only opened if hasn't been opened yet, so this
function can be reused to jump to the end or the beginning of the file
at will. While we are at it, remove local variables curp and endp, since
they aren't needed anymore.
* subversion/libsvn_diff/diff_memory.c
(datasource_get_previous_token): New function, stub implementation.
(token_pushback_suffix): New function, stub implementation.
(datasource_open): Add parameter open_at_end.
* subversion/libsvn_diff/token.c
(svn_diff__get_tokens): Pass FALSE for parameter open_at_end to
datasource_open, for backwards compatibility.
(find_identical_suffix): New function.
(find_identical_prefix): Remove parameter reached_one_eof, and convert it to
a local variable, since it doesn't need to be returned anymore.
(svn_diff__get_all_tokens): Add call to find_identical_suffix, before
calling find_identical_prefix, and call datasource_open in between to
reposition the datasource at the end and the start respectively.
git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/diff-optimizations-tokens@1039986 13f79535-47bb-0310-9956-ffa450edef68
4 files changed