packages feed

bindings-libzip 0.11 → 1.0.1

raw patch · 2 files changed

+86/−19 lines, 2 files

Files

Bindings/LibZip.hsc view
@@ -2,25 +2,24 @@ #include <zip.h>  -- | This module provides automatic low-level bindings to @libzip@--- library, version 0.11. See also:+-- library, version 1.0. See also: -- --   * @libzip@ documention: <http://nih.at/libzip/libzip.html> and @zip.h@ -- --   * @bindings-DSL@ documentation:---     <http://bitbucket.org/mauricio/bindings-dsl/wiki/Home>+--     <https://github.com/jwiegley/bindings-dsl> -- -- Higher-level interface is provided by a separate LibZip package: -- --   * <http://hackage.haskell.org/package/LibZip> --+-- Note: this is the first version to support libzip 1.0 and it lacks+-- support for some of the new libzip functions. Contributions are welcome.   module Bindings.LibZip where #strict_import -#opaque_t zip-#opaque_t zip_file-#opaque_t zip_source #integral_t zip_flags_t  -- flags for zip_open@@ -29,6 +28,7 @@ #num ZIP_EXCL #num ZIP_CHECKCONS #num ZIP_TRUNCATE+#num ZIP_RDONLY  -- flags for zip_name_locate, zip_fopen, zip_stat, ... @@ -50,7 +50,6 @@  -- archive global flags flags -#num ZIP_AFL_TORRENT #num ZIP_AFL_RDONLY  -- new extra field@@ -58,11 +57,6 @@ #num ZIP_EXTRA_FIELD_ALL #num ZIP_EXTRA_FIELD_NEW --- flags for compression and encryption sources--#num ZIP_CODEC_DECODE-#num ZIP_CODEC_ENCODE- -- libzip error codes  #num ZIP_ER_OK@@ -93,6 +87,9 @@ #num ZIP_ER_RDONLY #num ZIP_ER_NOPASSWD #num ZIP_ER_WRONGPASSWD+#num ZIP_ER_OPNOTSUPP+#num ZIP_ER_INUSE+#num ZIP_ER_TELL  -- type of system error value @@ -126,21 +123,87 @@ #num ZIP_EM_TRAD_PKWARE #num ZIP_EM_UNKNOWN +#num ZIP_OPSYS_DOS+#num ZIP_OPSYS_AMIGA+#num ZIP_OPSYS_OPENVMS+#num ZIP_OPSYS_UNIX+#num ZIP_OPSYS_VM_CMS+#num ZIP_OPSYS_ATARI_ST+#num ZIP_OPSYS_OS_2+#num ZIP_OPSYS_MACINTOSH+#num ZIP_OPSYS_Z_SYSTEM+#num ZIP_OPSYS_CPM+#num ZIP_OPSYS_WINDOWS_NTFS+#num ZIP_OPSYS_MVS+#num ZIP_OPSYS_VSE+#num ZIP_OPSYS_ACORN_RISC+#num ZIP_OPSYS_VFAT+#num ZIP_OPSYS_ALTERNATE_MVS+#num ZIP_OPSYS_BEOS+#num ZIP_OPSYS_TANDEM+#num ZIP_OPSYS_OS_400+#num ZIP_OPSYS_OS_X+ #integral_t enum zip_source_cmd+#synonym_t zip_source_cmd_t, <enum zip_source_cmd> #num ZIP_SOURCE_OPEN #num ZIP_SOURCE_READ #num ZIP_SOURCE_CLOSE #num ZIP_SOURCE_STAT #num ZIP_SOURCE_ERROR #num ZIP_SOURCE_FREE+#num ZIP_SOURCE_SEEK+#num ZIP_SOURCE_TELL+#num ZIP_SOURCE_BEGIN_WRITE+#num ZIP_SOURCE_COMMIT_WRITE+#num ZIP_SOURCE_ROLLBACK_WRITE+#num ZIP_SOURCE_WRITE+#num ZIP_SOURCE_SEEK_WRITE+#num ZIP_SOURCE_TELL_WRITE+#num ZIP_SOURCE_SUPPORTS+#num ZIP_SOURCE_REMOVE +#num ZIP_SOURCE_SUPPORTS_READABLE+#num ZIP_SOURCE_SUPPORTS_SEEKABLE+#num ZIP_SOURCE_SUPPORTS_WRITABLE +-- /* for use by sources */+-- struct zip_source_args_seek {+--     zip_int64_t offset;+--     int whence;+-- };+#starttype struct zip_source_args_seek+#field offset, CLLong+#field whence, CInt+#stoptype +#synonym_t zip_source_args_seek_t, <struct zip_source_args_seek>+ -- typedef zip_int64_t (*zip_source_callback)(void *, void *, zip_uint64_t, enum zip_source_cmd); #callback zip_source_callback , Ptr () -> Ptr () -> CULLong -> <zip_source_cmd> -> IO CULLong -#num ZIP_SOURCE_ERR_LOWER+-- /* error information */+-- /* use zip_error_*() to access */+-- struct zip_error {+--     int zip_err;	/* libzip error code (ZIP_ER_*) */+--     int sys_err;	/* copy of errno (E*) or zlib error code */+--     char *str;		/* string representation or NULL */+-- };+#starttype struct zip_error+#field zip_err, CInt+#field sys_err, CInt+#field str,     CString+#stoptype +#opaque_t struct zip+#opaque_t struct zip_file+#opaque_t struct zip_source+#synonym_t zip_t, <struct zip>+#synonym_t zip_error_t, <struct zip_error>+#synonym_t zip_file_t, <struct zip_file>+#synonym_t zip_source_t, <struct zip_source>+#synonym_t zip_stat_t, <struct zip_stat>+ #num ZIP_STAT_NAME #num ZIP_STAT_INDEX #num ZIP_STAT_SIZE@@ -210,7 +273,14 @@ #ccall zip_replace , Ptr <zip> -> CULLong -> Ptr <zip_source> -> IO (CInt) #ccall zip_set_file_comment , Ptr <zip> -> CULLong -> CString -> CInt -> IO (CInt) +-- deprecated since 1.0+#ccall zip_error_get_sys_type , CInt -> IO (CInt)+#ccall zip_error_get , Ptr <zip> -> Ptr CInt -> Ptr CInt -> IO ()+#ccall zip_error_to_str , Ptr CChar -> CULLong -> CInt -> CInt -> IO (CInt)+#ccall zip_file_error_get , Ptr <zip_file> -> Ptr CInt -> Ptr CInt -> IO ()+ -- the rest of the API+-- TODO: add new functions which appeared in 1.0  #ccall zip_archive_set_tempdir , Ptr <zip> -> CString -> IO (CInt) #ccall zip_file_add , Ptr <zip> -> CString -> Ptr <zip_source> -> <zip_flags_t> -> IO (CLLong)@@ -221,13 +291,9 @@ #ccall zip_file_extra_field_delete , Ptr <zip> -> CULLong -> CUShort -> <zip_flags_t> -> IO (CInt) #ccall zip_file_extra_field_delete_by_id , Ptr <zip> -> CULLong -> CUShort -> CUShort -> <zip_flags_t> -> IO (CInt) #ccall zip_error_clear , Ptr <zip> -> IO ()-#ccall zip_error_get , Ptr <zip> -> Ptr CInt -> Ptr CInt -> IO ()-#ccall zip_error_get_sys_type , CInt -> IO (CInt)-#ccall zip_error_to_str , Ptr CChar -> CULLong -> CInt -> CInt -> IO (CInt) #ccall zip_fclose , Ptr <zip_file> -> IO (CInt) #ccall zip_fdopen , CInt -> CInt -> Ptr CInt -> IO (Ptr <zip>) #ccall zip_file_error_clear , Ptr <zip_file> -> IO ()-#ccall zip_file_error_get , Ptr <zip_file> -> Ptr CInt -> Ptr CInt -> IO () #ccall zip_file_strerror , Ptr <zip_file> -> IO (CString) #ccall zip_fopen , Ptr <zip> -> CString -> <zip_flags_t> -> IO (Ptr <zip_file>) #ccall zip_fopen_encrypted , Ptr <zip> -> CString -> <zip_flags_t> -> CString -> IO (Ptr <zip_file>)
bindings-libzip.cabal view
@@ -1,8 +1,8 @@ Name:                bindings-libzip-Version:             0.11+Version:             1.0.1 Synopsis:            Low level bindings to libzip. Description:-  This package provides low-level bindings to libzip (v0.11) library.+  This package provides low-level bindings to libzip (v1.0.1) library.   For higher-level interface please use LibZip package:   <http://hackage.haskell.org/package/LibZip> @@ -36,7 +36,8 @@     Includes: zip.h     Extra-Libraries: zip z   else-    PkgConfig-Depends: libzip == 0.11.*+    PkgConfig-Depends: libzip >= 1.0 && < 2.0    GHC-Options:         -Wall -fno-warn-unused-imports+