62
svn_txdelta(&delta_stream,
63
svn_stream_from_aprfile(source_file, fpool),
64
svn_stream_from_aprfile(target_file, fpool),
63
svn_txdelta2(&delta_stream,
64
svn_stream_from_aprfile(source_file, fpool),
65
svn_stream_from_aprfile(target_file, fpool),
68
70
err = svn_txdelta_next_window(&delta_window, delta_stream, wpool);
86
open_binary_read(const char *path, apr_pool_t *pool)
91
apr_err = apr_file_open(&fp, path, (APR_READ | APR_BINARY),
92
APR_OS_DEFAULT, pool);
96
fprintf(stderr, "unable to open \"%s\" for reading\n", path);
105
main(int argc, char **argv)
107
apr_file_t *source_file_A = NULL;
108
apr_file_t *target_file_A = NULL;
88
do_one_test_cycle(apr_file_t *source_file_A, apr_file_t *target_file_A,
89
apr_file_t *source_file_B, apr_file_t *target_file_B,
90
int quiet, apr_pool_t *pool)
110
93
apr_off_t len_A = 0;
112
apr_file_t *source_file_B = NULL;
113
apr_file_t *target_file_B = NULL;
115
96
apr_off_t len_B = 0;
120
if (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'q')
127
pool = svn_pool_create(NULL);
131
target_file_A = open_binary_read(argv[1], pool);
135
source_file_A = open_binary_read(argv[1], pool);
136
target_file_A = open_binary_read(argv[2], pool);
140
source_file_A = open_binary_read(argv[1], pool);
141
target_file_A = open_binary_read(argv[2], pool);
142
source_file_B = open_binary_read(argv[2], pool);
143
target_file_B = open_binary_read(argv[3], pool);
148
"Usage: vdelta-test [-q] <target>\n"
149
" or: vdelta-test [-q] <source> <target>\n"
150
" or: vdelta-test [-q] <source> <intermediate> <target>\n");
154
98
do_one_diff(source_file_A, target_file_A,
155
99
&count_A, &len_A, quiet, pool, "A ", stdout);
181
125
apr_file_seek(target_file_B, APR_SET, &offset);
184
svn_txdelta(&stream_A,
185
svn_stream_from_aprfile(source_file_A, fpool),
186
svn_stream_from_aprfile(target_file_A, fpool),
188
svn_txdelta(&stream_B,
189
svn_stream_from_aprfile(source_file_B, fpool),
190
svn_stream_from_aprfile(target_file_B, fpool),
128
svn_txdelta2(&stream_A,
129
svn_stream_from_aprfile(source_file_A, fpool),
130
svn_stream_from_aprfile(target_file_A, fpool),
133
svn_txdelta2(&stream_B,
134
svn_stream_from_aprfile(source_file_B, fpool),
135
svn_stream_from_aprfile(target_file_B, fpool),
193
139
for (count_AB = 0; count_AB < count_B; ++count_AB)
219
165
fprintf(stdout, "AB: (LENGTH %" APR_OFF_T_FMT " +%d)\n",
220
166
len_AB, count_AB);
172
open_binary_read(const char *path, apr_pool_t *pool)
174
apr_status_t apr_err;
177
apr_err = apr_file_open(&fp, path, (APR_READ | APR_BINARY),
178
APR_OS_DEFAULT, pool);
182
fprintf(stderr, "unable to open \"%s\" for reading\n", path);
191
main(int argc, char **argv)
193
apr_file_t *source_file_A = NULL;
194
apr_file_t *target_file_A = NULL;
196
apr_file_t *source_file_B = NULL;
197
apr_file_t *target_file_B = NULL;
205
const char *const arg = argv[1];
211
else if (svn_ctype_isdigit(arg[1]))
212
repeat = atoi(arg + 1);
219
pool = svn_pool_create(NULL);
223
target_file_A = open_binary_read(argv[1], pool);
227
source_file_A = open_binary_read(argv[1], pool);
228
target_file_A = open_binary_read(argv[2], pool);
232
source_file_A = open_binary_read(argv[1], pool);
233
target_file_A = open_binary_read(argv[2], pool);
234
source_file_B = open_binary_read(argv[2], pool);
235
target_file_B = open_binary_read(argv[3], pool);
240
"Usage: vdelta-test [-q] [-<repeat>] <target>\n"
241
" or: vdelta-test [-q] [-<repeat>] <source> <target>\n"
242
" or: vdelta-test [-q] [-<repeat>] "
243
"<source> <intermediate> <target>\n");
249
apr_off_t offset = 0;
251
do_one_test_cycle(source_file_A, target_file_A,
252
source_file_B, target_file_B,
255
if (source_file_A) apr_file_seek(source_file_A, APR_SET, &offset);
256
if (target_file_A) apr_file_seek(target_file_A, APR_SET, &offset);
257
if (source_file_B) apr_file_seek(source_file_B, APR_SET, &offset);
258
if (target_file_B) apr_file_seek(target_file_B, APR_SET, &offset);
223
261
if (source_file_A) apr_file_close(source_file_A);
224
262
if (target_file_A) apr_file_close(target_file_A);