Source

hs-libzip / LibZip / Codec / Archive / LibZip.hs

Diff from to

File LibZip/Codec/Archive/LibZip.hs

 runPureSource src pState pData len cmd
   | cmd == c'ZIP_SOURCE_OPEN = return 0
   | cmd == c'ZIP_SOURCE_READ = do
-      state <- peek (castPtr pState :: Ptr st)
-      case readSrc (src { srcState = state }) (fromIntegral len) state of
-        Just (len',bs,state') -> do
+      s <- peek (castPtr pState :: Ptr st)
+      case readSrc (src { srcState = s }) (fromIntegral len) s of
+        Just (len',bs,s') -> do
           pokeArray (castPtr pData :: Ptr Word8) (map (toEnum.fromEnum) bs)
-          poke (castPtr pState) state'
+          poke (castPtr pState) s'
           return (fromIntegral len')
         Nothing -> return (-1)
   | cmd == c'ZIP_SOURCE_CLOSE = return 0
       return $ fromIntegral (2 * sizeOf esys)
   | cmd == c'ZIP_SOURCE_FREE = return 0
   | otherwise = return (-1)
-        
+
 -- | Get zip archive comment.
 getComment :: [FileFlag]  -- ^ 'FileUNCHANGED' can be used.
            -> Archive (Maybe String)
 
 -- | Set comment for a file in the archive (referenced by position index).
 setFileCommentIx :: Integer    -- ^ Position index of a file in the archive.
-                 -> String     -- ^ New file comment. 
+                 -> String     -- ^ New file comment.
                  -> Archive ()
 setFileCommentIx i comment = do
   z <- getZip