Diff
Not logged in

Differences From:

File www/delta_format.html part of check-in [5fcb36c81b] - Added documentation of the delta format by aku on 2007-08-26 01:32:11. Also file www/delta_format.html part of check-in [452a71f40b] - Merge in aku's documentation updates. by drh on 2007-08-26 03:03:58. [view]

To:

File www/delta_format.html part of check-in [6f1af23ebe] - Added section numbers to delta format, labels for linking, navigation bar. Added delta encoder description (incomplete, right now only all the trivial parts). Using TeX for formulas, and mimetex for conversion. by aku on 2007-08-26 22:22:01. [view]

@@ -2,8 +2,10 @@
 <head>
 <title>Fossil Delta Format</title>
 </head>
 <body bgcolor="white">
+<p>[ <a href="index.html">Index</a> ]</p>
+<hr>
 <h1 align="center">
 Fossil Delta Format
 </h1>
 
@@ -16,9 +18,9 @@
 also known as "delta". It is targeted at developers working on either
 <a href="index.html">fossil</a> itself, or on tools compatible with
 it.</p>
 
-<h2>Structure</h2>
+<a name="structure"><h2>1.0 Structure</h2>
 <img src="delta1.gif" align="left" hspace="10">
 
 <p>A delta consists of three parts, a "header", a "trailer", and a
 "segment-list" between them.</p>
@@ -26,9 +28,9 @@
 <p>Both header and trailer provide information about the target
 helping the decoder, and the segment-list describes how the target can
 be constructed from the original.</p>
 
-<h3>Header</h3>
+<a name="header"><h3>1.1 Header</h3>
 <img src="delta6.gif" align="left" hspace="10">
 
 <p>The header consists of a single number followed by a newline
 character (ASCII 0x0a). The number is the length of the target in
@@ -38,9 +40,9 @@
 the target (and allocate any necessary memory based on that) by simply
 reading the first line of the delta and decoding the number found
 there. In other words, before it has to decode everything else.</p>
 
-<h3>Trailer</h3>
+<a name="trailer"><h3>1.2 Trailer</h3>
 <img src="delta5.gif" align="left" hspace="10">
 
 <p>The trailer consists of a single number followed by a semicolon (ASCII
 0x3b). This number is a checksum of the target and can be used by a
@@ -55,9 +57,9 @@
 <p>By putting this information at the end of the delta a decoder has
 it available immediately after the target has been reconstructed
 fully.</p>
 
-<h3>Segment-List</h3>
+<a name="slist"><h3>1.3 Segment-List</h3>
 <img src="delta2.gif" align="left" hspace="10">
 
 <p>The segment-list of a delta describes how to create the target from
 the original by a combination of inserting literal byte-sequences and
@@ -68,9 +70,9 @@
 <p>The target is constructed from beginning to end, with the data
 generated by each instruction appended after the data of all previous
 instructions, with no gaps.</p>
 
-<h4>Insert Literal</h4>
+<a name="insertlit"><h4>1.3.1 Insert Literal</h4>
 
 <p>A literal is specified by two elements, the size of the literal in
 bytes, and the bytes of the literal itself.</p>
 
@@ -77,9 +79,9 @@
 <img src="delta4.gif" align="left" hspace="10">
 <p>The length is written first, followed by a colon character (ASCII
 0x3a), followed by the bytes of the literal.</p>
 
-<h4>Copy Range</h4>
+<a name="copyrange"><h4>1.3.2 Copy Range</h4>
 
 <p>A range to copy is specified by two numbers, the offset of the
 first byte in the original to copy, and the size of the range, in
 bytes. The size zero is special, its usage indicates that the range
@@ -88,9 +90,9 @@
 <img src="delta3.gif" align="left" hspace="10">
 <p>The length is written first, followed by an "at" character (ASCII
 0x40), then the offset, followed by a comma (ASCII 0x2c).</p>
 
-<h2>Encoding of integers</h2>
+<a name="intcoding"><h2>2.0 Encoding of integers</h2>
 
 <p>
 The format currently handles only 32 bit integer numbers. They are
 written base-64 encoded, MSB first, and without leading
@@ -101,11 +103,11 @@
 The base-64 coding is described in
 <a href="http://www.ietf.org/rfc/rfc3548.txt">RFC 3548</a>.
 </p>
 
-<h2>Examples</h2>
-
-<h3>Number encoding</h3>
+<a name="examples"><h2>3.0 Examples</h2>
+
+<a name="examplesint"><h3>3.1 Integer encoding</h3>
 
 <table border=1>
 <tr>
 <th>Value</th>
@@ -124,9 +126,9 @@
 <td>2zMM3E</td>
 </tr>
 </table>
 
-<h3>Delta</h3>
+<a name="examplesdelta"><h3>3.2 Delta encoding</h3>
 
 <p>An example of a delta using the specified encoding is:</p>
 
 <table border=1><tr><td><pre>
@@ -200,9 +202,9 @@
 </pre></td></tr></table>
 
 
 
-<h2>Notes</h2>
+<a name="notes"><h2>Notes</h2>
 
 <ul>
 <li>Pure text files generate a pure text delta.
 </li>