summaryrefslogtreecommitdiff
path: root/xd.ser
diff options
context:
space:
mode:
Diffstat (limited to 'xd.ser')
-rwxr-xr-xxd.ser138
1 files changed, 138 insertions, 0 deletions
diff --git a/xd.ser b/xd.ser
new file mode 100755
index 0000000..7dd91c6
--- /dev/null
+++ b/xd.ser
@@ -0,0 +1,138 @@
+;; -*- Emacs-Lisp -*-
+
+(defmodule xd 3 "xdelta.h" nil)
+
+(defimport "libedsio/edsio.ser")
+
+(defsertype XdeltaChecksum 1
+ ((high uint16)
+ (low uint16)
+ )
+ ()
+ )
+
+(defsertype XdeltaIndex 2
+ ((file_len uint)
+ (file_md5 (bytes 16))
+ (index (array XdeltaChecksum))
+ )
+ ()
+ )
+
+(defsertype XdeltaSourceInfo 3
+ ((name string)
+ (md5 (bytes 16))
+ (len uint)
+ (isdata boolean) ;;; if true, then its source index is 0 and it is the data segment
+ (sequential boolean) ;;; if true, then offset field is not persistent, but instead
+ ;;; recomputed when loaded as the sum of
+ ;;; previous instruction's length fields, to
+ ;;; indicate a sequential read
+ )
+ ("guint32 position"
+ "guint32 copies"
+ "guint32 copy_length"
+ "FileHandle *in")
+ )
+
+(defsertype XdeltaControl 7
+ ((to_md5 (bytes 16))
+ (to_len uint)
+ (has_data boolean)
+ (source_info (array (ptr XdeltaSourceInfo)))
+ (inst (array XdeltaInstruction))
+ )
+ ("GArray *inst_array"
+ "GPtrArray *source_info_array"
+ )
+ )
+
+(defsertype XdeltaInstruction 8
+ ((index uint)
+ (offset uint)
+ (length uint)
+ )
+ ("guint32 output_start")
+ )
+
+;; rsync stuff
+
+(defsertype RsyncIndexElt 9
+ ((md5 (bytes 16))
+ (cksum XdeltaChecksum)
+ )
+ ("SerialRsyncIndexElt* next"
+ "gint match_offset")
+ )
+
+(defsertype RsyncIndex 10
+ ((seg_len uint)
+ (file_len uint)
+ (file_md5 (bytes 16))
+ (index (array RsyncIndexElt))
+ )
+ ("SerialRsyncIndexElt** table"
+ "guint table_size")
+ )
+
+;; backward compat, these are the 1.0 defs
+
+(defsertype Version0SourceInfo 4
+ ((md5 (bytes 16))
+ (real_md5 (bytes 16))
+ (length uint)
+ )
+ ()
+ )
+
+(defsertype Version0Control 5
+ ((normalized boolean)
+ (data_len uint)
+ (to_info Version0SourceInfo)
+ (source_info (array (ptr Version0SourceInfo)))
+ (inst (array Version0Instruction))
+ )
+ ("GArray *inst_array"
+ "GPtrArray *source_info_array"
+ )
+ )
+
+(defsertype Version0Instruction 6
+ ((offset uint)
+ (length uint)
+ )
+ ("guint8 type" ;; these two fields get packed into length
+ "guint8 index"
+ )
+ )
+
+;; events
+
+(defetype handle "FileHandle*")
+
+(defevent TooFewSources Error () ()
+ "Too few input sources")
+
+(defevent TooManySources Error () ()
+ "Too many input sources")
+
+(defevent OutOfRangeSourceIndex Error ((index int)) ()
+ "Instruction references out-of-range source index: ${INDEX}")
+
+(defevent InvalidControl Error () ()
+ "Delta control is corrupt")
+
+(defevent InvalidRsyncCache Error () ()
+ "The rsync checksum cache is corrupt")
+
+(defevent IncompatibleDelta Error () ()
+ "The delta was not produced according by the `xdelta delta' command")
+
+(defevent StreamChecksumFailed Error ((stream handle) (expected string) (received string)) ()
+ "${STREAM}: Checksum validation failed, expected: ${EXPECTED}, received: ${RECEIVED}")
+
+(defevent StreamLengthFailed Error ((stream handle) (expected int) (received int)) ()
+ "${STREAM}: Length validation failed, expected: ${EXPECTED}, received: ${RECEIVED}")
+
+(defevent BackwardCompatibilityMode Information ((version string)) ()
+ "Reading a version ${VERSION} delta control")