0 | module System.Zlib.Types
2 | import Derive.Prelude
4 | %language ElabReflection
13 | record ZStreamHandle where
14 | constructor MkZStreamHandle
24 | data ZlibCompressionLevel
28 | | DefaultCompression
29 | | CompressionLevel Int
31 | %runElab derive "ZlibCompressionLevel" [Show,Eq]
36 | zlibCompressionLevelValue : ZlibCompressionLevel -> Int
37 | zlibCompressionLevelValue NoCompression = 0
38 | zlibCompressionLevelValue BestSpeed = 1
39 | zlibCompressionLevelValue BestCompression = 9
40 | zlibCompressionLevelValue DefaultCompression = (-
1)
41 | zlibCompressionLevelValue (CompressionLevel n) = n
54 | %runElab derive "FlushMode" [Show,Eq]
59 | flushModeValue : FlushMode -> Int
60 | flushModeValue NoFlush = 0
61 | flushModeValue PartialFlush = 1
62 | flushModeValue SyncFlush = 2
63 | flushModeValue FullFlush = 3
64 | flushModeValue Finish = 4
65 | flushModeValue Block = 5
81 | %runElab derive "Wrapper" [Show,Eq]
86 | defaultWindowBits : Int
87 | defaultWindowBits = 15
92 | windowBits : Wrapper -> Int
93 | windowBits ZlibWrapper = 15
94 | windowBits GZipWrapper = 31
95 | windowBits RawWrapper = (-
15)
107 | %runElab derive "Strategy" [Show,Eq]
112 | strategyValue : Strategy -> Int
113 | strategyValue DefaultStrategy = 0
114 | strategyValue Filtered = 1
115 | strategyValue HuffmanOnly = 2
116 | strategyValue RLE = 3
117 | strategyValue Fixed = 4