Fossil SCM
Replaced old GIF diagrams from the delta_format.wiki doc with Pikchrs. Also removed delta?.gif from test/commit-warning.test.
Commit
d7c074e7fafb0575358f194015b2654f453361e6503a37aa330ca0bf2ff1fba4
Parent
ec816c919e241a8…
9 files changed
-6
-6
+64
-16
| --- test/commit-warning.test | ||
| +++ test/commit-warning.test | ||
| @@ -270,16 +270,10 @@ | ||
| 270 | 270 | 1\twww/build-icons/src.gif\tbinary data |
| 271 | 271 | 1\twww/build-icons/win32.gif\tbinary data |
| 272 | 272 | 1\twww/concept1.gif\tbinary data |
| 273 | 273 | 1\twww/concept2.gif\tbinary data |
| 274 | 274 | 1\twww/copyright-release.pdf\tbinary data |
| 275 | - 1\twww/delta1.gif\tbinary data | |
| 276 | - 1\twww/delta2.gif\tbinary data | |
| 277 | - 1\twww/delta3.gif\tbinary data | |
| 278 | - 1\twww/delta4.gif\tbinary data | |
| 279 | - 1\twww/delta5.gif\tbinary data | |
| 280 | - 1\twww/delta6.gif\tbinary data | |
| 281 | 275 | 1\twww/encode1.gif\tbinary data |
| 282 | 276 | 1\twww/encode10.gif\tbinary data |
| 283 | 277 | 1\twww/encode2.gif\tbinary data |
| 284 | 278 | 1\twww/encode3.gif\tbinary data |
| 285 | 279 | 1\twww/encode4.gif\tbinary data |
| 286 | 280 | |
| 287 | 281 | DELETED www/delta1.gif |
| 288 | 282 | DELETED www/delta2.gif |
| 289 | 283 | DELETED www/delta3.gif |
| 290 | 284 | DELETED www/delta4.gif |
| 291 | 285 | DELETED www/delta5.gif |
| 292 | 286 | DELETED www/delta6.gif |
| --- test/commit-warning.test | |
| +++ test/commit-warning.test | |
| @@ -270,16 +270,10 @@ | |
| 270 | 1\twww/build-icons/src.gif\tbinary data |
| 271 | 1\twww/build-icons/win32.gif\tbinary data |
| 272 | 1\twww/concept1.gif\tbinary data |
| 273 | 1\twww/concept2.gif\tbinary data |
| 274 | 1\twww/copyright-release.pdf\tbinary data |
| 275 | 1\twww/delta1.gif\tbinary data |
| 276 | 1\twww/delta2.gif\tbinary data |
| 277 | 1\twww/delta3.gif\tbinary data |
| 278 | 1\twww/delta4.gif\tbinary data |
| 279 | 1\twww/delta5.gif\tbinary data |
| 280 | 1\twww/delta6.gif\tbinary data |
| 281 | 1\twww/encode1.gif\tbinary data |
| 282 | 1\twww/encode10.gif\tbinary data |
| 283 | 1\twww/encode2.gif\tbinary data |
| 284 | 1\twww/encode3.gif\tbinary data |
| 285 | 1\twww/encode4.gif\tbinary data |
| 286 | |
| 287 | ELETED www/delta1.gif |
| 288 | ELETED www/delta2.gif |
| 289 | ELETED www/delta3.gif |
| 290 | ELETED www/delta4.gif |
| 291 | ELETED www/delta5.gif |
| 292 | ELETED www/delta6.gif |
| --- test/commit-warning.test | |
| +++ test/commit-warning.test | |
| @@ -270,16 +270,10 @@ | |
| 270 | 1\twww/build-icons/src.gif\tbinary data |
| 271 | 1\twww/build-icons/win32.gif\tbinary data |
| 272 | 1\twww/concept1.gif\tbinary data |
| 273 | 1\twww/concept2.gif\tbinary data |
| 274 | 1\twww/copyright-release.pdf\tbinary data |
| 275 | 1\twww/encode1.gif\tbinary data |
| 276 | 1\twww/encode10.gif\tbinary data |
| 277 | 1\twww/encode2.gif\tbinary data |
| 278 | 1\twww/encode3.gif\tbinary data |
| 279 | 1\twww/encode4.gif\tbinary data |
| 280 | |
| 281 | ELETED www/delta1.gif |
| 282 | ELETED www/delta2.gif |
| 283 | ELETED www/delta3.gif |
| 284 | ELETED www/delta4.gif |
| 285 | ELETED www/delta5.gif |
| 286 | ELETED www/delta6.gif |
| --- test/commit-warning.test | ||
| +++ test/commit-warning.test | ||
| @@ -270,16 +270,10 @@ | ||
| 270 | 270 | 1\twww/build-icons/src.gif\tbinary data |
| 271 | 271 | 1\twww/build-icons/win32.gif\tbinary data |
| 272 | 272 | 1\twww/concept1.gif\tbinary data |
| 273 | 273 | 1\twww/concept2.gif\tbinary data |
| 274 | 274 | 1\twww/copyright-release.pdf\tbinary data |
| 275 | - 1\twww/delta1.gif\tbinary data | |
| 276 | - 1\twww/delta2.gif\tbinary data | |
| 277 | - 1\twww/delta3.gif\tbinary data | |
| 278 | - 1\twww/delta4.gif\tbinary data | |
| 279 | - 1\twww/delta5.gif\tbinary data | |
| 280 | - 1\twww/delta6.gif\tbinary data | |
| 281 | 275 | 1\twww/encode1.gif\tbinary data |
| 282 | 276 | 1\twww/encode10.gif\tbinary data |
| 283 | 277 | 1\twww/encode2.gif\tbinary data |
| 284 | 278 | 1\twww/encode3.gif\tbinary data |
| 285 | 279 | 1\twww/encode4.gif\tbinary data |
| 286 | 280 | |
| 287 | 281 | DELETED www/delta1.gif |
| 288 | 282 | DELETED www/delta2.gif |
| 289 | 283 | DELETED www/delta3.gif |
| 290 | 284 | DELETED www/delta4.gif |
| 291 | 285 | DELETED www/delta5.gif |
| 292 | 286 | DELETED www/delta6.gif |
| --- test/commit-warning.test | |
| +++ test/commit-warning.test | |
| @@ -270,16 +270,10 @@ | |
| 270 | 1\twww/build-icons/src.gif\tbinary data |
| 271 | 1\twww/build-icons/win32.gif\tbinary data |
| 272 | 1\twww/concept1.gif\tbinary data |
| 273 | 1\twww/concept2.gif\tbinary data |
| 274 | 1\twww/copyright-release.pdf\tbinary data |
| 275 | 1\twww/delta1.gif\tbinary data |
| 276 | 1\twww/delta2.gif\tbinary data |
| 277 | 1\twww/delta3.gif\tbinary data |
| 278 | 1\twww/delta4.gif\tbinary data |
| 279 | 1\twww/delta5.gif\tbinary data |
| 280 | 1\twww/delta6.gif\tbinary data |
| 281 | 1\twww/encode1.gif\tbinary data |
| 282 | 1\twww/encode10.gif\tbinary data |
| 283 | 1\twww/encode2.gif\tbinary data |
| 284 | 1\twww/encode3.gif\tbinary data |
| 285 | 1\twww/encode4.gif\tbinary data |
| 286 | |
| 287 | ELETED www/delta1.gif |
| 288 | ELETED www/delta2.gif |
| 289 | ELETED www/delta3.gif |
| 290 | ELETED www/delta4.gif |
| 291 | ELETED www/delta5.gif |
| 292 | ELETED www/delta6.gif |
| --- test/commit-warning.test | |
| +++ test/commit-warning.test | |
| @@ -270,16 +270,10 @@ | |
| 270 | 1\twww/build-icons/src.gif\tbinary data |
| 271 | 1\twww/build-icons/win32.gif\tbinary data |
| 272 | 1\twww/concept1.gif\tbinary data |
| 273 | 1\twww/concept2.gif\tbinary data |
| 274 | 1\twww/copyright-release.pdf\tbinary data |
| 275 | 1\twww/encode1.gif\tbinary data |
| 276 | 1\twww/encode10.gif\tbinary data |
| 277 | 1\twww/encode2.gif\tbinary data |
| 278 | 1\twww/encode3.gif\tbinary data |
| 279 | 1\twww/encode4.gif\tbinary data |
| 280 | |
| 281 | ELETED www/delta1.gif |
| 282 | ELETED www/delta2.gif |
| 283 | ELETED www/delta3.gif |
| 284 | ELETED www/delta4.gif |
| 285 | ELETED www/delta5.gif |
| 286 | ELETED www/delta6.gif |
D
www/delta1.gif
Binary file
D
www/delta2.gif
Binary file
D
www/delta3.gif
Binary file
D
www/delta4.gif
Binary file
D
www/delta5.gif
Binary file
D
www/delta6.gif
Binary file
+64
-16
| --- www/delta_format.wiki | ||
| +++ www/delta_format.wiki | ||
| @@ -61,21 +61,30 @@ | ||
| 61 | 61 | that returns one row for the header, for the trailer, and for each segment |
| 62 | 62 | in delta D. |
| 63 | 63 | |
| 64 | 64 | |
| 65 | 65 | <a name="structure"></a><h1>2.0 Structure</h1> |
| 66 | -<img src="delta1.gif" align="left" hspace="10"> | |
| 66 | +<verbatim type="pikchr"> | |
| 67 | + leftmargin = 0.1 | |
| 68 | + box height 50% "Header" | |
| 69 | + box same "Segments" | |
| 70 | + box same "Trailer" | |
| 71 | +</verbatim> | |
| 67 | 72 | |
| 68 | 73 | <p>A delta consists of three parts, a "header", a "trailer", and a |
| 69 | 74 | "segment-list" between them.</p> |
| 70 | 75 | |
| 71 | 76 | <p>Both header and trailer provide information about the target |
| 72 | 77 | helping the decoder, and the segment-list describes how the target can |
| 73 | 78 | be constructed from the original.</p> |
| 74 | 79 | |
| 75 | 80 | <a name="header"></a><h2>2.1 Header</h2> |
| 76 | -<img src="delta6.gif" align="left" hspace="10"> | |
| 81 | +<verbatim type="pikchr"> | |
| 82 | + leftmargin = 0.1 | |
| 83 | + box height 50% "Size" | |
| 84 | + box same "\"\\n\"" | |
| 85 | +</verbatim> | |
| 77 | 86 | |
| 78 | 87 | <p>The header consists of a single number followed by a newline |
| 79 | 88 | character (ASCII 0x0a). The number is the length of the target in |
| 80 | 89 | bytes.</p> |
| 81 | 90 | |
| @@ -83,11 +92,15 @@ | ||
| 83 | 92 | the target (and allocate any necessary memory based on that) by simply |
| 84 | 93 | reading the first line of the delta and decoding the number found |
| 85 | 94 | there. In other words, before it has to decode everything else.</p> |
| 86 | 95 | |
| 87 | 96 | <a name="trailer"></a><h2>2.2 Trailer</h2> |
| 88 | -<img src="delta5.gif" align="left" hspace="10"> | |
| 97 | +<verbatim type="pikchr"> | |
| 98 | + leftmargin = 0.1 | |
| 99 | + box height 50% "Checksum" | |
| 100 | + box same "\":\"" | |
| 101 | +</verbatim> | |
| 89 | 102 | |
| 90 | 103 | <p>The trailer consists of a single number followed by a semicolon (ASCII |
| 91 | 104 | 0x3b). This number is a checksum of the target and can be used by a |
| 92 | 105 | decoder to verify that the delta applied correctly, reconstructing the |
| 93 | 106 | target from the original.</p> |
| @@ -100,11 +113,32 @@ | ||
| 100 | 113 | <p>By putting this information at the end of the delta a decoder has |
| 101 | 114 | it available immediately after the target has been reconstructed |
| 102 | 115 | fully.</p> |
| 103 | 116 | |
| 104 | 117 | <a name="slist"></a><h2>2.3 Segment-List</h2> |
| 105 | -<img src="delta2.gif" align="left" hspace="10"> | |
| 118 | +<verbatim type="pikchr"> | |
| 119 | + leftmargin = 0.1 | |
| 120 | + PART1: [ | |
| 121 | + B1: box height 50% width 15% "" | |
| 122 | + B2: box same "" | |
| 123 | + B3: box same "" | |
| 124 | + move 0.1 ; box same invisible "***" ; move 0.1 | |
| 125 | + box height 50% width 15% "" | |
| 126 | + I1: line down 50% from B2 .s | |
| 127 | + arrow right until even with B3.e | |
| 128 | + box "Insert Literal" height 50% | |
| 129 | + line down 75% from I1 .s | |
| 130 | + arrow right until even with B3.e | |
| 131 | + box "Copy Range" height 50% | |
| 132 | + ] | |
| 133 | + down | |
| 134 | + box invisible "" height 0.1 | |
| 135 | + box "Length" height 50% with .nw at (PART1.w, previous.s) | |
| 136 | + right | |
| 137 | + box "\":\"" same | |
| 138 | + box "Bytes" same | |
| 139 | +</verbatim> | |
| 106 | 140 | |
| 107 | 141 | <p>The segment-list of a delta describes how to create the target from |
| 108 | 142 | the original by a combination of inserting literal byte-sequences and |
| 109 | 143 | copying ranges of bytes from the original. This is where the |
| 110 | 144 | compression takes place, by encoding the large common parts of |
| @@ -117,11 +151,17 @@ | ||
| 117 | 151 | <a name="insertlit"></a><h3>2.3.1 Insert Literal</h3> |
| 118 | 152 | |
| 119 | 153 | <p>A literal is specified by two elements, the size of the literal in |
| 120 | 154 | bytes, and the bytes of the literal itself.</p> |
| 121 | 155 | |
| 122 | -<img src="delta4.gif" align="left" hspace="10"> | |
| 156 | +<verbatim type="pikchr"> | |
| 157 | + leftmargin = 0.1 | |
| 158 | + box "Length" height 50% | |
| 159 | + box "\":\"" same | |
| 160 | + box "Bytes" same | |
| 161 | +</verbatim> | |
| 162 | + | |
| 123 | 163 | <p>The length is written first, followed by a colon character (ASCII |
| 124 | 164 | 0x3a), followed by the bytes of the literal.</p> |
| 125 | 165 | |
| 126 | 166 | <a name="copyrange"></a><h3>2.3.2 Copy Range</h3> |
| 127 | 167 | |
| @@ -128,11 +168,19 @@ | ||
| 128 | 168 | <p>A range to copy is specified by two numbers, the offset of the |
| 129 | 169 | first byte in the original to copy, and the size of the range, in |
| 130 | 170 | bytes. The size zero is special, its usage indicates that the range |
| 131 | 171 | extends to the end of the original.</p> |
| 132 | 172 | |
| 133 | -<img src="delta3.gif" align="left" hspace="10"> | |
| 173 | +<verbatim type="pikchr"> | |
| 174 | + leftmargin = 0.1 | |
| 175 | + box "Length" height 50% | |
| 176 | + box "\"@\"" same | |
| 177 | + box "Offset" same | |
| 178 | + box "\",\"" same | |
| 179 | +</verbatim> | |
| 180 | + | |
| 181 | + | |
| 134 | 182 | <p>The length is written first, followed by an "at" character (ASCII |
| 135 | 183 | 0x40), then the offset, followed by a comma (ASCII 0x2c).</p> |
| 136 | 184 | |
| 137 | 185 | <a name="intcoding"></a><h1>3.0 Encoding of integers</h1> |
| 138 | 186 | |
| @@ -181,20 +229,20 @@ | ||
| 181 | 229 | |
| 182 | 230 | <p>This can be taken apart into the following parts:</p> |
| 183 | 231 | |
| 184 | 232 | <table border=1> |
| 185 | 233 | <tr><th>What </th> <th>Encoding </th><th>Meaning </th><th>Details</th></tr> |
| 186 | -<tr><td>Header</td> <td>1Xb </td><td>Size </td><td> 6246 </td></tr> | |
| 187 | -<tr><td>S-List</td> <td>4E@0, </td><td>Copy </td><td> 270 @ 0 </td></tr> | |
| 188 | -<tr><td> </td> <td>2:th </td><td>Literal </td><td> 2 'th' </td></tr> | |
| 189 | -<tr><td> </td> <td>FN@4C, </td><td>Copy </td><td> 983 @ 268 </td></tr> | |
| 190 | -<tr><td> </td> <td>6:scenda </td><td>Literal </td><td> 6 'scenda' </td></tr> | |
| 191 | -<tr><td> </td> <td>1B@Jd, </td><td>Copy </td><td> 75 @ 1256 </td></tr> | |
| 192 | -<tr><td> </td> <td>6:scenda </td><td>Literal </td><td> 6 'scenda' </td></tr> | |
| 193 | -<tr><td> </td> <td>5x@Kt, </td><td>Copy </td><td> 380 @ 1336 </td></tr> | |
| 194 | -<tr><td> </td> <td>6:pieces </td><td>Literal </td><td> 6 'pieces' </td></tr> | |
| 195 | -<tr><td> </td> <td>79@Qt, </td><td>Copy </td><td> 457 @ 1720 </td></tr> | |
| 234 | +<tr><td>Header</td> <td>1Xb </td><td>Size </td><td> 6246 </td></tr> | |
| 235 | +<tr><td>S-List</td> <td>4E@0, </td><td>Copy </td><td> 270 @ 0 </td></tr> | |
| 236 | +<tr><td> </td> <td>2:th </td><td>Literal </td><td> 2 'th' </td></tr> | |
| 237 | +<tr><td> </td> <td>FN@4C, </td><td>Copy </td><td> 983 @ 268 </td></tr> | |
| 238 | +<tr><td> </td> <td>6:scenda </td><td>Literal </td><td> 6 'scenda' </td></tr> | |
| 239 | +<tr><td> </td> <td>1B@Jd, </td><td>Copy </td><td> 75 @ 1256 </td></tr> | |
| 240 | +<tr><td> </td> <td>6:scenda </td><td>Literal </td><td> 6 'scenda' </td></tr> | |
| 241 | +<tr><td> </td> <td>5x@Kt, </td><td>Copy </td><td> 380 @ 1336 </td></tr> | |
| 242 | +<tr><td> </td> <td>6:pieces </td><td>Literal </td><td> 6 'pieces' </td></tr> | |
| 243 | +<tr><td> </td> <td>79@Qt, </td><td>Copy </td><td> 457 @ 1720 </td></tr> | |
| 196 | 244 | <tr><td> </td> <td>F: Example: eskil</td><td>Literal </td><td> 15 ' Example: eskil'</td></tr> |
| 197 | 245 | <tr><td> </td> <td>~E@Y0, </td><td>Copy </td><td> 4046 @ 2176 </td></tr> |
| 198 | 246 | <tr><td>Trailer</td><td>2zMM3E </td><td>Checksum</td><td> -1101438770 </td></tr> |
| 199 | 247 | </table> |
| 200 | 248 | |
| 201 | 249 |
| --- www/delta_format.wiki | |
| +++ www/delta_format.wiki | |
| @@ -61,21 +61,30 @@ | |
| 61 | that returns one row for the header, for the trailer, and for each segment |
| 62 | in delta D. |
| 63 | |
| 64 | |
| 65 | <a name="structure"></a><h1>2.0 Structure</h1> |
| 66 | <img src="delta1.gif" align="left" hspace="10"> |
| 67 | |
| 68 | <p>A delta consists of three parts, a "header", a "trailer", and a |
| 69 | "segment-list" between them.</p> |
| 70 | |
| 71 | <p>Both header and trailer provide information about the target |
| 72 | helping the decoder, and the segment-list describes how the target can |
| 73 | be constructed from the original.</p> |
| 74 | |
| 75 | <a name="header"></a><h2>2.1 Header</h2> |
| 76 | <img src="delta6.gif" align="left" hspace="10"> |
| 77 | |
| 78 | <p>The header consists of a single number followed by a newline |
| 79 | character (ASCII 0x0a). The number is the length of the target in |
| 80 | bytes.</p> |
| 81 | |
| @@ -83,11 +92,15 @@ | |
| 83 | the target (and allocate any necessary memory based on that) by simply |
| 84 | reading the first line of the delta and decoding the number found |
| 85 | there. In other words, before it has to decode everything else.</p> |
| 86 | |
| 87 | <a name="trailer"></a><h2>2.2 Trailer</h2> |
| 88 | <img src="delta5.gif" align="left" hspace="10"> |
| 89 | |
| 90 | <p>The trailer consists of a single number followed by a semicolon (ASCII |
| 91 | 0x3b). This number is a checksum of the target and can be used by a |
| 92 | decoder to verify that the delta applied correctly, reconstructing the |
| 93 | target from the original.</p> |
| @@ -100,11 +113,32 @@ | |
| 100 | <p>By putting this information at the end of the delta a decoder has |
| 101 | it available immediately after the target has been reconstructed |
| 102 | fully.</p> |
| 103 | |
| 104 | <a name="slist"></a><h2>2.3 Segment-List</h2> |
| 105 | <img src="delta2.gif" align="left" hspace="10"> |
| 106 | |
| 107 | <p>The segment-list of a delta describes how to create the target from |
| 108 | the original by a combination of inserting literal byte-sequences and |
| 109 | copying ranges of bytes from the original. This is where the |
| 110 | compression takes place, by encoding the large common parts of |
| @@ -117,11 +151,17 @@ | |
| 117 | <a name="insertlit"></a><h3>2.3.1 Insert Literal</h3> |
| 118 | |
| 119 | <p>A literal is specified by two elements, the size of the literal in |
| 120 | bytes, and the bytes of the literal itself.</p> |
| 121 | |
| 122 | <img src="delta4.gif" align="left" hspace="10"> |
| 123 | <p>The length is written first, followed by a colon character (ASCII |
| 124 | 0x3a), followed by the bytes of the literal.</p> |
| 125 | |
| 126 | <a name="copyrange"></a><h3>2.3.2 Copy Range</h3> |
| 127 | |
| @@ -128,11 +168,19 @@ | |
| 128 | <p>A range to copy is specified by two numbers, the offset of the |
| 129 | first byte in the original to copy, and the size of the range, in |
| 130 | bytes. The size zero is special, its usage indicates that the range |
| 131 | extends to the end of the original.</p> |
| 132 | |
| 133 | <img src="delta3.gif" align="left" hspace="10"> |
| 134 | <p>The length is written first, followed by an "at" character (ASCII |
| 135 | 0x40), then the offset, followed by a comma (ASCII 0x2c).</p> |
| 136 | |
| 137 | <a name="intcoding"></a><h1>3.0 Encoding of integers</h1> |
| 138 | |
| @@ -181,20 +229,20 @@ | |
| 181 | |
| 182 | <p>This can be taken apart into the following parts:</p> |
| 183 | |
| 184 | <table border=1> |
| 185 | <tr><th>What </th> <th>Encoding </th><th>Meaning </th><th>Details</th></tr> |
| 186 | <tr><td>Header</td> <td>1Xb </td><td>Size </td><td> 6246 </td></tr> |
| 187 | <tr><td>S-List</td> <td>4E@0, </td><td>Copy </td><td> 270 @ 0 </td></tr> |
| 188 | <tr><td> </td> <td>2:th </td><td>Literal </td><td> 2 'th' </td></tr> |
| 189 | <tr><td> </td> <td>FN@4C, </td><td>Copy </td><td> 983 @ 268 </td></tr> |
| 190 | <tr><td> </td> <td>6:scenda </td><td>Literal </td><td> 6 'scenda' </td></tr> |
| 191 | <tr><td> </td> <td>1B@Jd, </td><td>Copy </td><td> 75 @ 1256 </td></tr> |
| 192 | <tr><td> </td> <td>6:scenda </td><td>Literal </td><td> 6 'scenda' </td></tr> |
| 193 | <tr><td> </td> <td>5x@Kt, </td><td>Copy </td><td> 380 @ 1336 </td></tr> |
| 194 | <tr><td> </td> <td>6:pieces </td><td>Literal </td><td> 6 'pieces' </td></tr> |
| 195 | <tr><td> </td> <td>79@Qt, </td><td>Copy </td><td> 457 @ 1720 </td></tr> |
| 196 | <tr><td> </td> <td>F: Example: eskil</td><td>Literal </td><td> 15 ' Example: eskil'</td></tr> |
| 197 | <tr><td> </td> <td>~E@Y0, </td><td>Copy </td><td> 4046 @ 2176 </td></tr> |
| 198 | <tr><td>Trailer</td><td>2zMM3E </td><td>Checksum</td><td> -1101438770 </td></tr> |
| 199 | </table> |
| 200 | |
| 201 |
| --- www/delta_format.wiki | |
| +++ www/delta_format.wiki | |
| @@ -61,21 +61,30 @@ | |
| 61 | that returns one row for the header, for the trailer, and for each segment |
| 62 | in delta D. |
| 63 | |
| 64 | |
| 65 | <a name="structure"></a><h1>2.0 Structure</h1> |
| 66 | <verbatim type="pikchr"> |
| 67 | leftmargin = 0.1 |
| 68 | box height 50% "Header" |
| 69 | box same "Segments" |
| 70 | box same "Trailer" |
| 71 | </verbatim> |
| 72 | |
| 73 | <p>A delta consists of three parts, a "header", a "trailer", and a |
| 74 | "segment-list" between them.</p> |
| 75 | |
| 76 | <p>Both header and trailer provide information about the target |
| 77 | helping the decoder, and the segment-list describes how the target can |
| 78 | be constructed from the original.</p> |
| 79 | |
| 80 | <a name="header"></a><h2>2.1 Header</h2> |
| 81 | <verbatim type="pikchr"> |
| 82 | leftmargin = 0.1 |
| 83 | box height 50% "Size" |
| 84 | box same "\"\\n\"" |
| 85 | </verbatim> |
| 86 | |
| 87 | <p>The header consists of a single number followed by a newline |
| 88 | character (ASCII 0x0a). The number is the length of the target in |
| 89 | bytes.</p> |
| 90 | |
| @@ -83,11 +92,15 @@ | |
| 92 | the target (and allocate any necessary memory based on that) by simply |
| 93 | reading the first line of the delta and decoding the number found |
| 94 | there. In other words, before it has to decode everything else.</p> |
| 95 | |
| 96 | <a name="trailer"></a><h2>2.2 Trailer</h2> |
| 97 | <verbatim type="pikchr"> |
| 98 | leftmargin = 0.1 |
| 99 | box height 50% "Checksum" |
| 100 | box same "\":\"" |
| 101 | </verbatim> |
| 102 | |
| 103 | <p>The trailer consists of a single number followed by a semicolon (ASCII |
| 104 | 0x3b). This number is a checksum of the target and can be used by a |
| 105 | decoder to verify that the delta applied correctly, reconstructing the |
| 106 | target from the original.</p> |
| @@ -100,11 +113,32 @@ | |
| 113 | <p>By putting this information at the end of the delta a decoder has |
| 114 | it available immediately after the target has been reconstructed |
| 115 | fully.</p> |
| 116 | |
| 117 | <a name="slist"></a><h2>2.3 Segment-List</h2> |
| 118 | <verbatim type="pikchr"> |
| 119 | leftmargin = 0.1 |
| 120 | PART1: [ |
| 121 | B1: box height 50% width 15% "" |
| 122 | B2: box same "" |
| 123 | B3: box same "" |
| 124 | move 0.1 ; box same invisible "***" ; move 0.1 |
| 125 | box height 50% width 15% "" |
| 126 | I1: line down 50% from B2 .s |
| 127 | arrow right until even with B3.e |
| 128 | box "Insert Literal" height 50% |
| 129 | line down 75% from I1 .s |
| 130 | arrow right until even with B3.e |
| 131 | box "Copy Range" height 50% |
| 132 | ] |
| 133 | down |
| 134 | box invisible "" height 0.1 |
| 135 | box "Length" height 50% with .nw at (PART1.w, previous.s) |
| 136 | right |
| 137 | box "\":\"" same |
| 138 | box "Bytes" same |
| 139 | </verbatim> |
| 140 | |
| 141 | <p>The segment-list of a delta describes how to create the target from |
| 142 | the original by a combination of inserting literal byte-sequences and |
| 143 | copying ranges of bytes from the original. This is where the |
| 144 | compression takes place, by encoding the large common parts of |
| @@ -117,11 +151,17 @@ | |
| 151 | <a name="insertlit"></a><h3>2.3.1 Insert Literal</h3> |
| 152 | |
| 153 | <p>A literal is specified by two elements, the size of the literal in |
| 154 | bytes, and the bytes of the literal itself.</p> |
| 155 | |
| 156 | <verbatim type="pikchr"> |
| 157 | leftmargin = 0.1 |
| 158 | box "Length" height 50% |
| 159 | box "\":\"" same |
| 160 | box "Bytes" same |
| 161 | </verbatim> |
| 162 | |
| 163 | <p>The length is written first, followed by a colon character (ASCII |
| 164 | 0x3a), followed by the bytes of the literal.</p> |
| 165 | |
| 166 | <a name="copyrange"></a><h3>2.3.2 Copy Range</h3> |
| 167 | |
| @@ -128,11 +168,19 @@ | |
| 168 | <p>A range to copy is specified by two numbers, the offset of the |
| 169 | first byte in the original to copy, and the size of the range, in |
| 170 | bytes. The size zero is special, its usage indicates that the range |
| 171 | extends to the end of the original.</p> |
| 172 | |
| 173 | <verbatim type="pikchr"> |
| 174 | leftmargin = 0.1 |
| 175 | box "Length" height 50% |
| 176 | box "\"@\"" same |
| 177 | box "Offset" same |
| 178 | box "\",\"" same |
| 179 | </verbatim> |
| 180 | |
| 181 | |
| 182 | <p>The length is written first, followed by an "at" character (ASCII |
| 183 | 0x40), then the offset, followed by a comma (ASCII 0x2c).</p> |
| 184 | |
| 185 | <a name="intcoding"></a><h1>3.0 Encoding of integers</h1> |
| 186 | |
| @@ -181,20 +229,20 @@ | |
| 229 | |
| 230 | <p>This can be taken apart into the following parts:</p> |
| 231 | |
| 232 | <table border=1> |
| 233 | <tr><th>What </th> <th>Encoding </th><th>Meaning </th><th>Details</th></tr> |
| 234 | <tr><td>Header</td> <td>1Xb </td><td>Size </td><td> 6246 </td></tr> |
| 235 | <tr><td>S-List</td> <td>4E@0, </td><td>Copy </td><td> 270 @ 0 </td></tr> |
| 236 | <tr><td> </td> <td>2:th </td><td>Literal </td><td> 2 'th' </td></tr> |
| 237 | <tr><td> </td> <td>FN@4C, </td><td>Copy </td><td> 983 @ 268 </td></tr> |
| 238 | <tr><td> </td> <td>6:scenda </td><td>Literal </td><td> 6 'scenda' </td></tr> |
| 239 | <tr><td> </td> <td>1B@Jd, </td><td>Copy </td><td> 75 @ 1256 </td></tr> |
| 240 | <tr><td> </td> <td>6:scenda </td><td>Literal </td><td> 6 'scenda' </td></tr> |
| 241 | <tr><td> </td> <td>5x@Kt, </td><td>Copy </td><td> 380 @ 1336 </td></tr> |
| 242 | <tr><td> </td> <td>6:pieces </td><td>Literal </td><td> 6 'pieces' </td></tr> |
| 243 | <tr><td> </td> <td>79@Qt, </td><td>Copy </td><td> 457 @ 1720 </td></tr> |
| 244 | <tr><td> </td> <td>F: Example: eskil</td><td>Literal </td><td> 15 ' Example: eskil'</td></tr> |
| 245 | <tr><td> </td> <td>~E@Y0, </td><td>Copy </td><td> 4046 @ 2176 </td></tr> |
| 246 | <tr><td>Trailer</td><td>2zMM3E </td><td>Checksum</td><td> -1101438770 </td></tr> |
| 247 | </table> |
| 248 | |
| 249 |