summaryrefslogtreecommitdiff
path: root/src/Data
diff options
context:
space:
mode:
Diffstat (limited to 'src/Data')
-rw-r--r--src/Data/Torrent.hs18
-rw-r--r--src/Data/Tox/Onion.hs1
2 files changed, 10 insertions, 9 deletions
diff --git a/src/Data/Torrent.hs b/src/Data/Torrent.hs
index 69461488..32c709be 100644
--- a/src/Data/Torrent.hs
+++ b/src/Data/Torrent.hs
@@ -42,7 +42,7 @@ module Data.Torrent
42 , FileOffset 42 , FileOffset
43 , FileSize 43 , FileSize
44 , FileInfo (..) 44 , FileInfo (..)
45#ifdef VERSION_lens 45#ifdef USE_lens
46 , fileLength 46 , fileLength
47 , filePath 47 , filePath
48 , fileMD5Sum 48 , fileMD5Sum
@@ -50,7 +50,7 @@ module Data.Torrent
50 50
51 -- ** Layout info 51 -- ** Layout info
52 , LayoutInfo (..) 52 , LayoutInfo (..)
53#ifdef VERSION_lens 53#ifdef USE_lens
54 , singleFile 54 , singleFile
55 , multiFile 55 , multiFile
56 , rootDirName 56 , rootDirName
@@ -90,7 +90,7 @@ module Data.Torrent
90 -- ** Piece control 90 -- ** Piece control
91 , HashList (..) 91 , HashList (..)
92 , PieceInfo (..) 92 , PieceInfo (..)
93#ifdef VERSION_lens 93#ifdef USE_lens
94 , pieceLength 94 , pieceLength
95 , pieceHashes 95 , pieceHashes
96#endif 96#endif
@@ -102,7 +102,7 @@ module Data.Torrent
102 102
103 -- * Info dictionary 103 -- * Info dictionary
104 , InfoDict (..) 104 , InfoDict (..)
105#ifdef VERSION_lens 105#ifdef USE_lens
106 , infohash 106 , infohash
107 , layoutInfo 107 , layoutInfo
108 , pieceInfo 108 , pieceInfo
@@ -115,7 +115,7 @@ module Data.Torrent
115 -- * Torrent file 115 -- * Torrent file
116 , Torrent(..) 116 , Torrent(..)
117 117
118#ifdef VERSION_lens 118#ifdef USE_lens
119 -- ** Lenses 119 -- ** Lenses
120 , announce 120 , announce
121 , announceList 121 , announceList
@@ -378,7 +378,7 @@ data FileInfo a = FileInfo {
378 , Functor, Foldable 378 , Functor, Foldable
379 ) 379 )
380 380
381#ifdef VERSION_lens 381#ifdef USE_lens
382makeLensesFor 382makeLensesFor
383 [ ("fiLength", "fileLength") 383 [ ("fiLength", "fileLength")
384 , ("fiMD5Sum", "fileMD5Sum") 384 , ("fiMD5Sum", "fileMD5Sum")
@@ -467,7 +467,7 @@ data LayoutInfo
467 , liDirName :: !BS.ByteString 467 , liDirName :: !BS.ByteString
468 } deriving (Show, Read, Eq, Typeable) 468 } deriving (Show, Read, Eq, Typeable)
469 469
470#ifdef VERSION_lens 470#ifdef USE_lens
471makeLensesFor 471makeLensesFor
472 [ ("liFile" , "singleFile" ) 472 [ ("liFile" , "singleFile" )
473 , ("liFiles" , "multiFile" ) 473 , ("liFiles" , "multiFile" )
@@ -695,7 +695,7 @@ data PieceInfo = PieceInfo
695 -- ^ Concatenation of all 20-byte SHA1 hash values. 695 -- ^ Concatenation of all 20-byte SHA1 hash values.
696 } deriving (Show, Read, Eq, Typeable) 696 } deriving (Show, Read, Eq, Typeable)
697 697
698#ifdef VERSION_lens 698#ifdef USE_lens
699-- | Number of bytes in each piece. 699-- | Number of bytes in each piece.
700makeLensesFor [("piPieceLength", "pieceLength")] ''PieceInfo 700makeLensesFor [("piPieceLength", "pieceLength")] ''PieceInfo
701 701
@@ -902,7 +902,7 @@ data Torrent = Torrent
902 -- encrypted SHA-1 hash of the info dictionary). 902 -- encrypted SHA-1 hash of the info dictionary).
903 } deriving (Show, Eq, Typeable) 903 } deriving (Show, Eq, Typeable)
904 904
905#ifdef VERSION_lens 905#ifdef USE_lens
906makeLensesFor 906makeLensesFor
907 [ ("tAnnounce" , "announce" ) 907 [ ("tAnnounce" , "announce" )
908 , ("tAnnounceList", "announceList") 908 , ("tAnnounceList", "announceList")
diff --git a/src/Data/Tox/Onion.hs b/src/Data/Tox/Onion.hs
index 85a9d21e..bd802c75 100644
--- a/src/Data/Tox/Onion.hs
+++ b/src/Data/Tox/Onion.hs
@@ -704,6 +704,7 @@ data DataToRoute = DataToRoute
704 { dataFromKey :: PublicKey -- Real public key of sender 704 { dataFromKey :: PublicKey -- Real public key of sender
705 , dataToRoute :: Encrypted OnionData -- (Word8,ByteString) -- DHTPK 0x9c 705 , dataToRoute :: Encrypted OnionData -- (Word8,ByteString) -- DHTPK 0x9c
706 } 706 }
707 deriving Show
707 708
708instance Sized DataToRoute where 709instance Sized DataToRoute where
709 size = ConstSize 32 <> contramap dataToRoute size 710 size = ConstSize 32 <> contramap dataToRoute size