module Haskpatch.Format.Vcdiff where
import Binrep.Type.Magic
import Binrep.Type.Varint
import Binrep.Type.Common
import Strongweak
import Numeric.Natural
import Data.ByteString ( ByteString )
import Data.Word ( Word8 )
data Vcdiff (s :: Strength) = Vcdiff
{ :: Header s
}
data (s :: Strength) =
{ :: SW s (Magic '[0xD6, 0xC3, 0xC4, 0x00])
, :: SW s (Magic '[0x00])
}
data Window (s :: Strength) = Window
{ forall (s :: Strength). Window s -> SW s (Magic '[0])
windowIndicator :: SW s (Magic '[0x00])
, forall (s :: Strength). Window s -> Delta s
windowDelta :: Delta s
}
data Delta (s :: Strength) = Delta
{ forall (s :: Strength). Delta s -> SW s (Magic '[0])
deltaIndicator :: SW s (Magic '[0x00])
, forall (s :: Strength). Delta s -> ByteString
deltaAddRun :: ByteString
, forall (s :: Strength). Delta s -> [InstrCode]
deltaInstrs :: [InstrCode]
, forall (s :: Strength). Delta s -> ByteString
deltaCopy :: ByteString
}
data InstrCode = InstrCode
{ InstrCode -> InstrTriple
instrCodeTriple1 :: InstrTriple
, InstrCode -> InstrTriple
instrCodeTriple2 :: InstrTriple
}
data InstrTriple = InstrTriple
{ InstrTriple -> Instr
instrTripleInstr :: Instr
, InstrTriple -> Word8
instrTripleSize :: Word8
, InstrTriple -> Word8
instrTripleMode :: Word8
}
data Instr = Instr0Noop | Instr1Add | Instr2Run | Instr3Copy
type VcdiffVarint = Varnat 'Redundant 'OnContinues 'BE Natural