-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelta_8c.html
More file actions
624 lines (569 loc) · 36.9 KB
/
delta_8c.html
File metadata and controls
624 lines (569 loc) · 36.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
<!-- HTML header for doxygen 1.8.10-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<title>librsync: delta.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<!-- ad -->
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- librsync -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-3547096055927362"
data-ad-slot="8322976738"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">librsync
 <span id="projectnumber">2.3.4</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(function() {
initMenu('',false,false,'search.php','Search');
});
/* @license-end */
</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#define-members">Macros</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">delta.c File Reference</div></div>
</div><!--header-->
<div class="contents">
<p>Generate in streaming mode an rsync delta given a set of signatures, and a new file.
<a href="#details">More...</a></p>
<div class="textblock"><div class="dynheader">
Include dependency graph for delta.c:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="delta_8c__incl.svg" width="1328" height="411"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
</div>
<p><a href="delta_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ad38b7f45cf4177503166b0d00af71cff"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="delta_8c.html#ad38b7f45cf4177503166b0d00af71cff">MAX_MISS_LEN</a>   (<a class="el" href="job_8h.html#abdbdf5fbcdaed953e687867db175e4c5">MAX_DELTA_CMD</a> - 3)</td></tr>
<tr class="memdesc:ad38b7f45cf4177503166b0d00af71cff"><td class="mdescLeft"> </td><td class="mdescRight">Max length of a miss is 64K including 3 command bytes. <a href="delta_8c.html#ad38b7f45cf4177503166b0d00af71cff">More...</a><br /></td></tr>
<tr class="separator:ad38b7f45cf4177503166b0d00af71cff"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a6a992cf5dc0916678a7094c21b85d5fe"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="librsync_8h.html#a7feb858ceba3b8f3cf048d49be108253">rs_result</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="delta_8c.html#a6a992cf5dc0916678a7094c21b85d5fe">rs_delta_s_scan</a> (<a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> *job)</td></tr>
<tr class="memdesc:a6a992cf5dc0916678a7094c21b85d5fe"><td class="mdescLeft"> </td><td class="mdescRight">Get a block of data if possible, and see if it matches. <a href="delta_8c.html#a6a992cf5dc0916678a7094c21b85d5fe">More...</a><br /></td></tr>
<tr class="separator:a6a992cf5dc0916678a7094c21b85d5fe"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a55891ddb7cdcd5790b38ced140734102"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="librsync_8h.html#a7feb858ceba3b8f3cf048d49be108253">rs_result</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="delta_8c.html#a55891ddb7cdcd5790b38ced140734102">rs_delta_s_flush</a> (<a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> *job)</td></tr>
<tr class="separator:a55891ddb7cdcd5790b38ced140734102"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:afd7b048f68dab7cb6fc927802823ea4e"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="librsync_8h.html#a7feb858ceba3b8f3cf048d49be108253">rs_result</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="delta_8c.html#afd7b048f68dab7cb6fc927802823ea4e">rs_delta_s_end</a> (<a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> *job)</td></tr>
<tr class="separator:afd7b048f68dab7cb6fc927802823ea4e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5892bb518dcd0dd6ae8114e84a97cbc8"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="librsync_8h.html#a7feb858ceba3b8f3cf048d49be108253">rs_result</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="delta_8c.html#a5892bb518dcd0dd6ae8114e84a97cbc8">rs_getinput</a> (<a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> *job, size_t block_len)</td></tr>
<tr class="separator:a5892bb518dcd0dd6ae8114e84a97cbc8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a02cb5f8a81c7cb63d2557023c56929e7"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="delta_8c.html#a02cb5f8a81c7cb63d2557023c56929e7">rs_findmatch</a> (<a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> *job, rs_long_t *match_pos, size_t *match_len)</td></tr>
<tr class="memdesc:a02cb5f8a81c7cb63d2557023c56929e7"><td class="mdescLeft"> </td><td class="mdescRight">find a match at scan_pos, returning the match_pos and match_len. <a href="delta_8c.html#a02cb5f8a81c7cb63d2557023c56929e7">More...</a><br /></td></tr>
<tr class="separator:a02cb5f8a81c7cb63d2557023c56929e7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acc386d6304337b138b79b5712c15931a"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="librsync_8h.html#a7feb858ceba3b8f3cf048d49be108253">rs_result</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="delta_8c.html#acc386d6304337b138b79b5712c15931a">rs_appendmatch</a> (<a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> *job, rs_long_t match_pos, size_t match_len)</td></tr>
<tr class="memdesc:acc386d6304337b138b79b5712c15931a"><td class="mdescLeft"> </td><td class="mdescRight">Append a match at match_pos of length match_len to the delta, extending a previous match if possible, or flushing any previous miss/match. <a href="delta_8c.html#acc386d6304337b138b79b5712c15931a">More...</a><br /></td></tr>
<tr class="separator:acc386d6304337b138b79b5712c15931a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a832b35b9afeeb51561f08daf13738571"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="librsync_8h.html#a7feb858ceba3b8f3cf048d49be108253">rs_result</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="delta_8c.html#a832b35b9afeeb51561f08daf13738571">rs_appendmiss</a> (<a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> *job, size_t miss_len)</td></tr>
<tr class="memdesc:a832b35b9afeeb51561f08daf13738571"><td class="mdescLeft"> </td><td class="mdescRight">Append a miss of length miss_len to the delta, extending a previous miss if possible, or flushing any previous match. <a href="delta_8c.html#a832b35b9afeeb51561f08daf13738571">More...</a><br /></td></tr>
<tr class="separator:a832b35b9afeeb51561f08daf13738571"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8c7bfd74ede4c7fa74eeca10bb5d6679"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="librsync_8h.html#a7feb858ceba3b8f3cf048d49be108253">rs_result</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="delta_8c.html#a8c7bfd74ede4c7fa74eeca10bb5d6679">rs_appendflush</a> (<a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> *job)</td></tr>
<tr class="memdesc:a8c7bfd74ede4c7fa74eeca10bb5d6679"><td class="mdescLeft"> </td><td class="mdescRight">Flush any accumulating hit or miss, appending it to the delta. <a href="delta_8c.html#a8c7bfd74ede4c7fa74eeca10bb5d6679">More...</a><br /></td></tr>
<tr class="separator:a8c7bfd74ede4c7fa74eeca10bb5d6679"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2e40db810b7290fe6d5fd1be2656e04d"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="librsync_8h.html#a7feb858ceba3b8f3cf048d49be108253">rs_result</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="delta_8c.html#a2e40db810b7290fe6d5fd1be2656e04d">rs_processmatch</a> (<a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> *job)</td></tr>
<tr class="memdesc:a2e40db810b7290fe6d5fd1be2656e04d"><td class="mdescLeft"> </td><td class="mdescRight">Process matching data in the scoop. <a href="delta_8c.html#a2e40db810b7290fe6d5fd1be2656e04d">More...</a><br /></td></tr>
<tr class="separator:a2e40db810b7290fe6d5fd1be2656e04d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a17e651660e2da438be938cfcf4f5d0b7"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="librsync_8h.html#a7feb858ceba3b8f3cf048d49be108253">rs_result</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="delta_8c.html#a17e651660e2da438be938cfcf4f5d0b7">rs_processmiss</a> (<a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> *job)</td></tr>
<tr class="memdesc:a17e651660e2da438be938cfcf4f5d0b7"><td class="mdescLeft"> </td><td class="mdescRight">Process miss data in the scoop. <a href="delta_8c.html#a17e651660e2da438be938cfcf4f5d0b7">More...</a><br /></td></tr>
<tr class="separator:a17e651660e2da438be938cfcf4f5d0b7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a761d7df9081cf4ab4510e1cebc7c604a"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="librsync_8h.html#a7feb858ceba3b8f3cf048d49be108253">rs_result</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="delta_8c.html#a761d7df9081cf4ab4510e1cebc7c604a">rs_delta_s_slack</a> (<a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> *job)</td></tr>
<tr class="memdesc:a761d7df9081cf4ab4510e1cebc7c604a"><td class="mdescLeft"> </td><td class="mdescRight">State function that does a slack delta containing only literal data to recreate the input. <a href="delta_8c.html#a761d7df9081cf4ab4510e1cebc7c604a">More...</a><br /></td></tr>
<tr class="separator:a761d7df9081cf4ab4510e1cebc7c604a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8df6a969396ff04b72ebff623ec4c603"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="librsync_8h.html#a7feb858ceba3b8f3cf048d49be108253">rs_result</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="delta_8c.html#a8df6a969396ff04b72ebff623ec4c603">rs_delta_s_header</a> (<a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> *job)</td></tr>
<tr class="memdesc:a8df6a969396ff04b72ebff623ec4c603"><td class="mdescLeft"> </td><td class="mdescRight">State function for writing out the header of the encoding job. <a href="delta_8c.html#a8df6a969396ff04b72ebff623ec4c603">More...</a><br /></td></tr>
<tr class="separator:a8df6a969396ff04b72ebff623ec4c603"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a59fe8536218632417097d084606bb675"><td class="memItemLeft" align="right" valign="top"><a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="delta_8c.html#a59fe8536218632417097d084606bb675">rs_delta_begin</a> (<a class="el" href="librsync_8h.html#afb2a9cb505daeb8e519d06686f5caabf">rs_signature_t</a> *sig)</td></tr>
<tr class="memdesc:a59fe8536218632417097d084606bb675"><td class="mdescLeft"> </td><td class="mdescRight">Prepare to compute a streaming delta. <a href="delta_8c.html#a59fe8536218632417097d084606bb675">More...</a><br /></td></tr>
<tr class="separator:a59fe8536218632417097d084606bb675"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >Generate in streaming mode an rsync delta given a set of signatures, and a new file. </p>
<p >The size of blocks for signature generation is determined by the block size in the incoming signature.</p>
<p >To calculate a signature, we need to be able to see at least one block of the new file at a time. Once we have that, we calculate its weak signature, and see if there is any block in the signature hash table that has the same weak sum. If there is one, then we also compute the strong sum of the new block, and cross check that. If they're the same, then we can assume we have a match.</p>
<p >The final block of the file has to be handled a little differently, because it may be a short match. Short blocks in the signature don't include their length – we just allow for the final short block of the file to match any block in the signature, and if they have the same checksum we assume they must have the same length. Therefore, when we emit a COPY command, we have to send it with a length that is the same as the block matched, and not the block length from the signature.</p>
<p >Profiling results as of v1.26, 2001-03-18:</p>
<p >If everything matches, then we spend almost all our time in rs_mdfour64 and rs_weak_sum, which is unavoidable and therefore a good profile.</p>
<p >If nothing matches, it is not so good.</p>
<p >2002-06-26: Donovan Baarda</p>
<p >The following is based entirely on pysync. It is much cleaner than the previous incarnation of this code. It is slightly complicated because in this case the output can block, so the main delta loop needs to stop when this happens.</p>
<p >In pysync a 'last' attribute is used to hold the last miss or match for extending if possible. In this code, basis_len and scan_pos are used instead of 'last'. When basis_len > 0, last is a match. When basis_len = 0 and scan_pos is > 0, last is a miss. When both are 0, last is None (ie, nothing).</p>
<p >Pysync is also slightly different in that a 'flush' method is available to force output of accumulated data. This 'flush' is use to finalise delta calculation. In librsync input is terminated with an eof flag on the input stream. I have structured this code similar to pysync with a seperate flush function that is used when eof is reached. This allows for a flush style API if one is ever needed. Note that flush in pysync can be used for more than just terminating delta calculation, so a flush based API can in some ways be more flexible...</p>
<p >The input data is first scanned, then processed. Scanning identifies input data as misses or matches, and emits the instruction stream. Processing the data consumes it off the input scoop and outputs the processed miss data into the tube.</p>
<p >The scoop contains all data yet to be processed. The scan_pos is an index into the scoop that indicates the point scanned to. As data is scanned, scan_pos is incremented. As data is processed, it is removed from the scoop and scan_pos adjusted. Everything gets complicated because the tube can block. When the tube is blocked, no data can be processed. </p>
<p class="definition">Definition in file <a class="el" href="delta_8c_source.html">delta.c</a>.</p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ad38b7f45cf4177503166b0d00af71cff" name="ad38b7f45cf4177503166b0d00af71cff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad38b7f45cf4177503166b0d00af71cff">◆ </a></span>MAX_MISS_LEN</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define MAX_MISS_LEN   (<a class="el" href="job_8h.html#abdbdf5fbcdaed953e687867db175e4c5">MAX_DELTA_CMD</a> - 3)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Max length of a miss is 64K including 3 command bytes. </p>
<p class="definition">Definition at line <a class="el" href="delta_8c_source.html#l00103">103</a> of file <a class="el" href="delta_8c_source.html">delta.c</a>.</p>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a6a992cf5dc0916678a7094c21b85d5fe" name="a6a992cf5dc0916678a7094c21b85d5fe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6a992cf5dc0916678a7094c21b85d5fe">◆ </a></span>rs_delta_s_scan()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="librsync_8h.html#a7feb858ceba3b8f3cf048d49be108253">rs_result</a> rs_delta_s_scan </td>
<td>(</td>
<td class="paramtype"><a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> * </td>
<td class="paramname"><em>job</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get a block of data if possible, and see if it matches. </p>
<p >On each call, we try to process all of the input data available on the scoop and input buffer. </p>
<p class="definition">Definition at line <a class="el" href="delta_8c_source.html#l00122">122</a> of file <a class="el" href="delta_8c_source.html">delta.c</a>.</p>
</div>
</div>
<a id="a55891ddb7cdcd5790b38ced140734102" name="a55891ddb7cdcd5790b38ced140734102"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a55891ddb7cdcd5790b38ced140734102">◆ </a></span>rs_delta_s_flush()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="librsync_8h.html#a7feb858ceba3b8f3cf048d49be108253">rs_result</a> rs_delta_s_flush </td>
<td>(</td>
<td class="paramtype"><a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> * </td>
<td class="paramname"><em>job</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="delta_8c_source.html#l00164">164</a> of file <a class="el" href="delta_8c_source.html">delta.c</a>.</p>
</div>
</div>
<a id="afd7b048f68dab7cb6fc927802823ea4e" name="afd7b048f68dab7cb6fc927802823ea4e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afd7b048f68dab7cb6fc927802823ea4e">◆ </a></span>rs_delta_s_end()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="librsync_8h.html#a7feb858ceba3b8f3cf048d49be108253">rs_result</a> rs_delta_s_end </td>
<td>(</td>
<td class="paramtype"><a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> * </td>
<td class="paramname"><em>job</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="delta_8c_source.html#l00204">204</a> of file <a class="el" href="delta_8c_source.html">delta.c</a>.</p>
</div>
</div>
<a id="a5892bb518dcd0dd6ae8114e84a97cbc8" name="a5892bb518dcd0dd6ae8114e84a97cbc8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5892bb518dcd0dd6ae8114e84a97cbc8">◆ </a></span>rs_getinput()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="librsync_8h.html#a7feb858ceba3b8f3cf048d49be108253">rs_result</a> rs_getinput </td>
<td>(</td>
<td class="paramtype"><a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> * </td>
<td class="paramname"><em>job</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>block_len</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="delta_8c_source.html#l00210">210</a> of file <a class="el" href="delta_8c_source.html">delta.c</a>.</p>
</div>
</div>
<a id="a02cb5f8a81c7cb63d2557023c56929e7" name="a02cb5f8a81c7cb63d2557023c56929e7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a02cb5f8a81c7cb63d2557023c56929e7">◆ </a></span>rs_findmatch()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static int rs_findmatch </td>
<td>(</td>
<td class="paramtype"><a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> * </td>
<td class="paramname"><em>job</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">rs_long_t * </td>
<td class="paramname"><em>match_pos</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t * </td>
<td class="paramname"><em>match_len</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>find a match at scan_pos, returning the match_pos and match_len. </p>
<p >Note that this will calculate weak_sum if required. It will also determine the match_len.</p>
<p >This routine could be modified to do xdelta style matches that would extend matches past block boundaries by matching backwards and forwards beyond the block boundaries. Extending backwards would require decrementing scan_pos as appropriate. </p>
<p class="definition">Definition at line <a class="el" href="delta_8c_source.html#l00229">229</a> of file <a class="el" href="delta_8c_source.html">delta.c</a>.</p>
</div>
</div>
<a id="acc386d6304337b138b79b5712c15931a" name="acc386d6304337b138b79b5712c15931a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acc386d6304337b138b79b5712c15931a">◆ </a></span>rs_appendmatch()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="librsync_8h.html#a7feb858ceba3b8f3cf048d49be108253">rs_result</a> rs_appendmatch </td>
<td>(</td>
<td class="paramtype"><a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> * </td>
<td class="paramname"><em>job</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">rs_long_t </td>
<td class="paramname"><em>match_pos</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>match_len</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Append a match at match_pos of length match_len to the delta, extending a previous match if possible, or flushing any previous miss/match. </p>
<p class="definition">Definition at line <a class="el" href="delta_8c_source.html#l00258">258</a> of file <a class="el" href="delta_8c_source.html">delta.c</a>.</p>
</div>
</div>
<a id="a832b35b9afeeb51561f08daf13738571" name="a832b35b9afeeb51561f08daf13738571"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a832b35b9afeeb51561f08daf13738571">◆ </a></span>rs_appendmiss()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="librsync_8h.html#a7feb858ceba3b8f3cf048d49be108253">rs_result</a> rs_appendmiss </td>
<td>(</td>
<td class="paramtype"><a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> * </td>
<td class="paramname"><em>job</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>miss_len</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Append a miss of length miss_len to the delta, extending a previous miss if possible, or flushing any previous match. </p>
<p >This also breaks misses up into 32KB segments to avoid accumulating too much in memory. </p>
<p class="definition">Definition at line <a class="el" href="delta_8c_source.html#l00288">288</a> of file <a class="el" href="delta_8c_source.html">delta.c</a>.</p>
</div>
</div>
<a id="a8c7bfd74ede4c7fa74eeca10bb5d6679" name="a8c7bfd74ede4c7fa74eeca10bb5d6679"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8c7bfd74ede4c7fa74eeca10bb5d6679">◆ </a></span>rs_appendflush()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="librsync_8h.html#a7feb858ceba3b8f3cf048d49be108253">rs_result</a> rs_appendflush </td>
<td>(</td>
<td class="paramtype"><a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> * </td>
<td class="paramname"><em>job</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Flush any accumulating hit or miss, appending it to the delta. </p>
<p class="definition">Definition at line <a class="el" href="delta_8c_source.html#l00302">302</a> of file <a class="el" href="delta_8c_source.html">delta.c</a>.</p>
</div>
</div>
<a id="a2e40db810b7290fe6d5fd1be2656e04d" name="a2e40db810b7290fe6d5fd1be2656e04d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2e40db810b7290fe6d5fd1be2656e04d">◆ </a></span>rs_processmatch()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="librsync_8h.html#a7feb858ceba3b8f3cf048d49be108253">rs_result</a> rs_processmatch </td>
<td>(</td>
<td class="paramtype"><a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> * </td>
<td class="paramname"><em>job</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Process matching data in the scoop. </p>
<p >The scoop contains match data at scan_buf of length scan_pos. This function processes that match data, returning RS_DONE if it completes, or RS_BLOCKED if it gets blocked. After it completes scan_pos is reset to still point at the next unscanned data.</p>
<p >This function currently just removes data from the scoop and adjusts scan_pos appropriately. In the future this could be used for something like context compressing of miss data. Note that it also calls rs_tube_catchup to output any pending output. </p>
<p class="definition">Definition at line <a class="el" href="delta_8c_source.html#l00332">332</a> of file <a class="el" href="delta_8c_source.html">delta.c</a>.</p>
</div>
</div>
<a id="a17e651660e2da438be938cfcf4f5d0b7" name="a17e651660e2da438be938cfcf4f5d0b7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a17e651660e2da438be938cfcf4f5d0b7">◆ </a></span>rs_processmiss()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="librsync_8h.html#a7feb858ceba3b8f3cf048d49be108253">rs_result</a> rs_processmiss </td>
<td>(</td>
<td class="paramtype"><a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> * </td>
<td class="paramname"><em>job</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Process miss data in the scoop. </p>
<p >The scoop contains miss data at scan_buf of length scan_pos. This function processes that miss data, returning RS_DONE if it completes, or RS_BLOCKED if it gets blocked. After it completes scan_pos is reset to still point at the next unscanned data.</p>
<p >This function uses rs_tube_copy to queue copying from the scoop into output. and uses rs_tube_catchup to do the copying. This automaticly removes data from the scoop, but this can block. While rs_tube_catchup is blocked, scan_pos does not point at legit data, so scanning can also not proceed.</p>
<p >In the future this could do compression of miss data before outputing it. </p>
<p class="definition">Definition at line <a class="el" href="delta_8c_source.html#l00355">355</a> of file <a class="el" href="delta_8c_source.html">delta.c</a>.</p>
</div>
</div>
<a id="a761d7df9081cf4ab4510e1cebc7c604a" name="a761d7df9081cf4ab4510e1cebc7c604a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a761d7df9081cf4ab4510e1cebc7c604a">◆ </a></span>rs_delta_s_slack()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="librsync_8h.html#a7feb858ceba3b8f3cf048d49be108253">rs_result</a> rs_delta_s_slack </td>
<td>(</td>
<td class="paramtype"><a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> * </td>
<td class="paramname"><em>job</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>State function that does a slack delta containing only literal data to recreate the input. </p>
<p class="definition">Definition at line <a class="el" href="delta_8c_source.html#l00367">367</a> of file <a class="el" href="delta_8c_source.html">delta.c</a>.</p>
</div>
</div>
<a id="a8df6a969396ff04b72ebff623ec4c603" name="a8df6a969396ff04b72ebff623ec4c603"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8df6a969396ff04b72ebff623ec4c603">◆ </a></span>rs_delta_s_header()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="librsync_8h.html#a7feb858ceba3b8f3cf048d49be108253">rs_result</a> rs_delta_s_header </td>
<td>(</td>
<td class="paramtype"><a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> * </td>
<td class="paramname"><em>job</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>State function for writing out the header of the encoding job. </p>
<p class="definition">Definition at line <a class="el" href="delta_8c_source.html#l00384">384</a> of file <a class="el" href="delta_8c_source.html">delta.c</a>.</p>
</div>
</div>
<a id="a59fe8536218632417097d084606bb675" name="a59fe8536218632417097d084606bb675"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a59fe8536218632417097d084606bb675">◆ </a></span>rs_delta_begin()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="librsync_8h.html#add6622b38e3fa557301a190876d5ed4a">rs_job_t</a> * rs_delta_begin </td>
<td>(</td>
<td class="paramtype"><a class="el" href="librsync_8h.html#afb2a9cb505daeb8e519d06686f5caabf">rs_signature_t</a> * </td>
<td class="paramname"><em>sig</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Prepare to compute a streaming delta. </p>
<dl class="todo"><dt><b><a class="el" href="todo.html#_todo000004">Todo:</a></b></dt><dd>Add a version of this that takes a <a class="el" href="librsync_8h.html#ab6abafd1db0a3947bb3c076507f4f7c2" title="A uint32 magic number, emitted in bigendian/network order at the start of librsync files.">rs_magic_number</a> controlling the delta format. </dd></dl>
<p class="definition">Definition at line <a class="el" href="delta_8c_source.html#l00396">396</a> of file <a class="el" href="delta_8c_source.html">delta.c</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.10-->
<!-- start footer part -->
<!-- ad -->
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- librsync -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-3547096055927362"
data-ad-slot="8322976738"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<!-- analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-71109100-1', 'auto');
ga('send', 'pageview');
</script>
<hr class="footer"/><address class="footer"><small>
Generated on Sun Feb 19 2023 16:26:50 for librsync by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.9.4
</small></address>
</body>
</html>