LibZip-0.10.2: Bindings to libzip, a library for manipulating zip archives.

Safe Haskell | None

Codec.Archive.LibZip.Types

Synopsis

- type Zip = Ptr C'zip
- type ZipFile = Ptr C'zip_file
- type ZipSource = Ptr C'zip_source
- data ZipStat = ZipStat {
  - zs'valid :: Word64
  - zs'name :: String
  - zs'index :: Integer
  - zs'size :: Integer
  - zs'comp_size :: Integer
  - zs'mtime :: UTCTime
  - zs'crc :: Word
  - zs'comp_method :: ZipCompMethod
  - zs'encryption_method :: ZipEncryptionMethod
  - zs'flags :: Word32
  }
- toZipStat :: C'zip_stat -> IO ZipStat
- data OpenFlag
  - = CreateFlag
  - | ExclFlag
  - | CheckConsFlag
- data FileFlag
  - = FileNOCASE
  - | FileNODIR
  - | FileCOMPRESSED
  - | FileUNCHANGED
  - | FileRECOMPRESS
  - | FileENCRYPTED
- data ArchiveFlag
  - = ArchiveTORRENT
  - | ArchiveRDONLY
- data CodecFlag = CodecENCODE
- data ZipError
  - = ErrOK
  - | ErrMULTIDISK
  - | ErrRENAME
  - | ErrCLOSE
  - | ErrSEEK
  - | ErrREAD
  - | ErrWRITE
  - | ErrCRC
  - | ErrZIPCLOSED
  - | ErrNOENT
  - | ErrEXISTS
  - | ErrOPEN
  - | ErrTMPOPEN
  - | ErrZLIB
  - | ErrMEMORY
  - | ErrCHANGED
  - | ErrCOMPNOTSUPP
  - | ErrEOF
  - | ErrINVAL
  - | ErrNOZIP
  - | ErrINTERNAL
  - | ErrINCONS
  - | ErrREMOVE
  - | ErrDELETED
  - | ErrENCRNOTSUPP
  - | ErrRDONLY
  - | ErrNOPASSWD
  - | ErrWRONGPASSWD
- data ZipCompMethod
  - = CompDEFAULT
  - | CompSTORE
  - | CompSHRINK
  - | CompREDUCE_1
  - | CompREDUCE_2
  - | CompREDUCE_3
  - | CompREDUCE_4
  - | CompIMPLODE
  - | CompDEFLATE
  - | CompDEFLATE64
  - | CompPKWARE_IMPLODE
  - | CompBZIP2
  - | CompLZMA
  - | CompTERSE
  - | CompLZ77
  - | CompWAVPACK
  - | CompPPMD
- data ZipEncryptionMethod
  - = EncryptNONE
  - | EncryptTRAD_PKWARE
  - | EncryptUNKNOWN
- combine :: (Enum a, Num b) => [a] -> b

# Documentation

type Zip = Ptr C'zip Source

Handler of the open zip file.

type ZipFile = Ptr C'zip_file Source

Handler of an open file in the zip archive.

type ZipSource = Ptr C'zip_source Source

Handler of data source for new files in the zip archive.

data ZipStat Source

File statistics expressed in native Haskell types.

Constructors

ZipStat |

Fields

zs'valid :: Word64
zs'name :: String
zs'index :: Integer
zs'size :: Integer
zs'comp_size :: Integer
zs'mtime :: UTCTime
zs'crc :: Word
zs'comp_method :: ZipCompMethod
zs'encryption_method :: ZipEncryptionMethod
zs'flags :: Word32

Instances

Eq ZipStat |
Show ZipStat |

toZipStat :: C'zip_stat -> IO ZipStat Source

Convert marshalled stat record.

data OpenFlag Source

Flags for opening an archive.

Constructors

CreateFlag | Create an archive if it does not exist.
ExclFlag | Error if the archive already exists.
CheckConsFlag | Check archive's consistency and error on failure.

Instances

Enum OpenFlag |
Eq OpenFlag |
Show OpenFlag |

data FileFlag Source

Flags for accessing files in the archive. Please consult `libzip` documentation about their use.

Constructors

FileNOCASE | Ignore case on name lookup.
FileNODIR | Ignore directory component.
FileCOMPRESSED | Read the compressed data.
FileUNCHANGED | Read the original data, ignore changes.
FileRECOMPRESS | Force recompression of data.
FileENCRYPTED | Read encrypted data (implies FileCOMPRESSED).

Instances

Enum FileFlag |
Eq FileFlag |
Show FileFlag |

data ArchiveFlag Source

`libzip` archive global flags

Constructors

ArchiveTORRENT |
ArchiveRDONLY |

Instances

Enum ArchiveFlag |
Eq ArchiveFlag |
Show ArchiveFlag |

data CodecFlag Source

`libzip` flags for compression and encryption sources

Constructors

CodecENCODE |

Instances

Enum CodecFlag |
Eq CodecFlag |
Show CodecFlag |

data ZipError Source

`libzip` error codes.

Constructors

ErrOK | No error.
ErrMULTIDISK | Multi-disk zip archives not supported.
ErrRENAME | Renaming temporary file failed.
ErrCLOSE | Closing zip archive failed.
ErrSEEK | Seek error.
ErrREAD | Read error.
ErrWRITE | Write error.
ErrCRC | CRC error.
ErrZIPCLOSED | Containing zip archive was closed.
ErrNOENT | No such file.
ErrEXISTS | File already exists.
ErrOPEN | Can't open file.
ErrTMPOPEN | Failure to create temporary file.
ErrZLIB | Zlib error.
ErrMEMORY | Malloc error.
ErrCHANGED | Entry has been changed.
ErrCOMPNOTSUPP | Compression method not supported.
ErrEOF | Premature EOF.
ErrINVAL | Invalid argument.
ErrNOZIP | Not a zip archive.
ErrINTERNAL | Internal error.
ErrINCONS | Zip archive inconsistent.
ErrREMOVE | Can't remove file.
ErrDELETED | Entry has been deleted.
ErrENCRNOTSUPP | Encryption method not supported.
ErrRDONLY | Read-only archive.
ErrNOPASSWD | No password provided.
ErrWRONGPASSWD | Wrong password provided.

Instances

Enum ZipError |
Eq ZipError |
Show ZipError |
Typeable ZipError |
Exception ZipError |

data ZipCompMethod Source

Compression methods.

Constructors

CompDEFAULT | Better of deflate or store.
CompSTORE | Stored (uncompressed).
CompSHRINK | Shrunk.
CompREDUCE_1 | Reduced with factor 1
CompREDUCE_2 | Reduced with factor 2
CompREDUCE_3 | Reduced with factor 3
CompREDUCE_4 | Reduced with factor 4
CompIMPLODE | Imploded.
CompDEFLATE | Deflated.
CompDEFLATE64 | Deflate64.
CompPKWARE_IMPLODE | PKWARE imploding.
CompBZIP2 | Compressed using BZIP2 algorithm.
CompLZMA | LZMA (EFS)
CompTERSE | Compressed using IBM TERSE (new).
CompLZ77 | IBM LZ77 z Architecture (PFS).
CompWAVPACK | WavPack compressed data.
CompPPMD | PPMd version I, Rev 1.

Instances

Enum ZipCompMethod |
Eq ZipCompMethod |
Show ZipCompMethod |

data ZipEncryptionMethod Source

Encryption methods.

Constructors

EncryptNONE | Not encrypted.
EncryptTRAD_PKWARE | Traditional PKWARE encryption.
EncryptUNKNOWN | Unknown algorithm.

Instances

Enum ZipEncryptionMethod |
Eq ZipEncryptionMethod |
Show ZipEncryptionMethod |

combine :: (Enum a, Num b) => [a] -> bSource