/'
zip.bi -- exported declarations.
Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner

This file is part of libzip, a library to manipulate ZIP archives.
The authors can be contacted at <libzip@nih.at>

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. The names of the authors may not be used to endorse or promote
products derived from this software without specific prior
written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
'/
''
''
'' zip -- header translated with help of SWIG FB wrapper
''

#inclib "zip"


#ifndef __zip_bi__

#define __zip_bi__


#include once "crt/sys/types.bi"

#include once "crt/time.bi"

#include once "crt/stdio.bi"


''from zipconf.h
#define SHORT_LIBZIP 2

#define INT_LIBZIP 4

#define LONG_LIBZIP 4

#define LONGLONG_LIBZIP 8


type zip_int8_t as byte
type zip_uint8_t as ubyte
type zip_int16_t as short
type zip_uint16_t as ushort
type zip_int32_t as integer
type zip_uint32_t as uinteger
type zip_int64_t as longint
type zip_uint64_t as ulongint

#define ZIP_INT8_MIN -&h80

#define ZIP_INT8_MAX &h7f

#define ZIP_UINT8_MAX &hff

#define ZIP_INT16_MIN -&h8000

#define ZIP_INT16_MAX &h7fff

#define ZIP_UINT16_MAX &hffff

#define ZIP_INT32_MIN -&h80000000L

#define ZIP_INT32_MAX &h7fffffffL

#define ZIP_UINT32_MAX &hffffffffLU

#define ZIP_INT64_MIN -&h8000000000000000LL

#define ZIP_INT64_MAX &h7fffffffffffffffLL

#define ZIP_UINT64_MAX &hffffffffffffffffLLU


#define ZIP_CREATE 1

#define ZIP_EXCL 2

#define ZIP_CHECKCONS 4


#define ZIP_FL_NOCASE 1

#define ZIP_FL_NODIR 2

#define ZIP_FL_COMPRESSED 4

#define ZIP_FL_UNCHANGED 8

#define ZIP_FL_RECOMPRESS 16

#define ZIP_FL_ENCRYPTED 32


#define ZIP_AFL_TORRENT 1

#define ZIP_AFL_RDONLY 2


#define ZIP_CODEC_ENCODE 1


#define ZIP_ER_OK 0

#define ZIP_ER_MULTIDISK 1

#define ZIP_ER_RENAME 2

#define ZIP_ER_CLOSE 3

#define ZIP_ER_SEEK 4

#define ZIP_ER_READ 5

#define ZIP_ER_WRITE 6

#define ZIP_ER_CRC 7

#define ZIP_ER_ZIPCLOSED 8

#define ZIP_ER_NOENT 9

#define ZIP_ER_EXISTS 10

#define ZIP_ER_OPEN 11

#define ZIP_ER_TMPOPEN 12

#define ZIP_ER_ZLIB 13

#define ZIP_ER_MEMORY 14

#define ZIP_ER_CHANGED 15

#define ZIP_ER_COMPNOTSUPP 16

#define ZIP_ER_EOF 17

#define ZIP_ER_INVAL 18

#define ZIP_ER_NOZIP 19

#define ZIP_ER_INTERNAL 20

#define ZIP_ER_INCONS 21

#define ZIP_ER_REMOVE 22

#define ZIP_ER_DELETED 23

#define ZIP_ER_ENCRNOTSUPP 24

#define ZIP_ER_RDONLY 25

#define ZIP_ER_NOPASSWD 26

#define ZIP_ER_WRONGPASSWD 27


#define ZIP_ET_NONE 0

#define ZIP_ET_SYS 1

#define ZIP_ET_ZLIB 2


#define ZIP_CM_DEFAULT -1

#define ZIP_CM_STORE 0

#define ZIP_CM_SHRINK 1

#define ZIP_CM_REDUCE_1 2

#define ZIP_CM_REDUCE_2 3

#define ZIP_CM_REDUCE_3 4

#define ZIP_CM_REDUCE_4 5

#define ZIP_CM_IMPLODE 6

#define ZIP_CM_DEFLATE 8

#define ZIP_CM_DEFLATE64 9

#define ZIP_CM_PKWARE_IMPLODE 10

#define ZIP_CM_BZIP2 12

#define ZIP_CM_LZMA 14

#define ZIP_CM_TERSE 18

#define ZIP_CM_LZ77 19

#define ZIP_CM_WAVPACK 97

#define ZIP_CM_PPMD 98


#define ZIP_EM_NONE 0

#define ZIP_EM_TRAD_PKWARE 1

#define ZIP_EM_UNKNOWN &hffff


enum zip_source_cmd
ZIP_SOURCE_OPEN
ZIP_SOURCE_READ
ZIP_SOURCE_CLOSE
ZIP_SOURCE_STAT
ZIP_SOURCE_ERROR
ZIP_SOURCE_FREE
end enum

#define ZIP_SOURCE_ERR_LOWER -2

#define ZIP_STAT_NAME &h0001

#define ZIP_STAT_INDEX_ &h0002

#define ZIP_STAT_SIZE &h0004

#define ZIP_STAT_COMP_SIZE &h0008

#define ZIP_STAT_MTIME &h0010

#define ZIP_STAT_CRC &h0020

#define ZIP_STAT_COMP_METHOD &h0040

#define ZIP_STAT_ENCRYPTION_METHOD &h0080


type zip_stat_
valid as zip_uint64_t
name as zstring ptr
index as zip_uint64_t
size as zip_uint64_t
comp_size as zip_uint64_t
mtime as time_t
crc as zip_uint32_t
comp_method as zip_uint16_t
encryption_method as zip_uint16_t
end type

type zip as any
type zip_file as any
type zip_source as any

type zip_source_callback as function cdecl(byval as any ptr, byval as any ptr, byval as zip_uint64_t, byval as zip_source_cmd) as zip_int64_t
type zip_source_layered_callback as function cdecl(byval as zip_source ptr, byval as any ptr, byval as any ptr, byval as zip_uint64_t, byval as zip_source_cmd) as zip_int64_t
type zip_compression_implementation as function cdecl(byval as zip ptr, byval as zip_source ptr, byval as zip_uint16_t, byval as integer) as zip_source ptr
type zip_encryption_implementation as function cdecl(byval as zip ptr, byval as zip_source ptr, byval as zip_uint16_t, byval as integer, byval as zstring ptr) as zip_source ptr

extern "C"

declare function zip_add (byval as zip ptr, byval as zstring ptr, byval as zip_source ptr) as zip_int64_t
declare function zip_add_dir (byval as zip ptr, byval as zstring ptr) as zip_int64_t
declare function zip_close (byval as zip ptr) as integer
declare function zip_delete (byval as zip ptr, byval as zip_uint64_t) as integer
declare sub zip_error_clear (byval as zip ptr)
declare sub zip_error_get (byval as zip ptr, byval as integer ptr, byval as integer ptr)
declare function zip_error_get_sys_type (byval as integer) as integer
declare function zip_error_to_str (byval as zstring ptr, byval as zip_uint64_t, byval as integer, byval as integer) as integer
declare function zip_fclose (byval as zip_file ptr) as integer
declare function zip_fdopen (byval as integer, byval as integer, byval as integer ptr) as zip ptr
declare sub zip_file_error_clear (byval as zip_file ptr)
declare sub zip_file_error_get (byval as zip_file ptr, byval as integer ptr, byval as integer ptr)
declare function zip_file_strerror (byval as zip_file ptr) as zstring ptr
declare function zip_fopen (byval as zip ptr, byval as zstring ptr, byval as integer) as zip_file ptr
declare function zip_fopen_encrypted (byval as zip ptr, byval as zstring ptr, byval as integer, byval as zstring ptr) as zip_file ptr
declare function zip_fopen_index (byval as zip ptr, byval as zip_uint64_t, byval as integer) as zip_file ptr
declare function zip_fopen_index_encrypted (byval as zip ptr, byval as zip_uint64_t, byval as integer, byval as zstring ptr) as zip_file ptr
declare function zip_fread (byval as zip_file ptr, byval as any ptr, byval as zip_uint64_t) as zip_int64_t
declare function zip_get_archive_comment (byval as zip ptr, byval as integer ptr, byval as integer) as zstring ptr
declare function zip_get_archive_flag (byval as zip ptr, byval as integer, byval as integer) as integer
declare function zip_get_compression_implementation (byval as zip_uint16_t) as zip_compression_implementation
declare function zip_get_encryption_implementation (byval as zip_uint16_t) as zip_encryption_implementation
declare function zip_get_file_comment (byval as zip ptr, byval as zip_uint64_t, byval as integer ptr, byval as integer) as zstring ptr
declare function zip_get_name (byval as zip ptr, byval as zip_uint64_t, byval as integer) as zstring ptr
declare function zip_get_num_files (byval as zip ptr) as integer
declare function zip_name_locate (byval as zip ptr, byval as zstring ptr, byval as integer) as integer
declare function zip_open (byval as zstring ptr, byval as integer, byval as integer ptr) as zip ptr
declare function zip_rename (byval as zip ptr, byval as zip_uint64_t, byval as zstring ptr) as integer
declare function zip_replace (byval as zip ptr, byval as zip_uint64_t, byval as zip_source ptr) as integer
declare function zip_set_archive_comment (byval as zip ptr, byval as zstring ptr, byval as integer) as integer
declare function zip_set_archive_flag (byval as zip ptr, byval as integer, byval as integer) as integer
declare function zip_set_default_password (byval as zip ptr, byval as zstring ptr) as integer
declare function zip_set_file_comment (byval as zip ptr, byval as zip_uint64_t, byval as zstring ptr, byval as integer) as integer
declare function zip_source_buffer (byval as zip ptr, byval as any ptr, byval as zip_uint64_t, byval as integer) as zip_source ptr
declare sub zip_source_close (byval as zip_source ptr)
declare function zip_source_crc (byval as zip ptr, byval as zip_source ptr, byval as integer) as zip_source ptr
declare function zip_source_deflate (byval as zip ptr, byval as zip_source ptr, byval as zip_uint16_t, byval as integer) as zip_source ptr
declare sub zip_source_error (byval as zip_source ptr, byval as integer ptr, byval as integer ptr)
declare function zip_source_file (byval as zip ptr, byval as zstring ptr, byval as zip_uint64_t, byval as zip_int64_t) as zip_source ptr
declare function zip_source_filep (byval as zip ptr, byval as FILE ptr, byval as zip_uint64_t, byval as zip_int64_t) as zip_source ptr
declare sub zip_source_free (byval as zip_source ptr)
declare function zip_source_function (byval as zip ptr, byval as zip_source_callback, byval as any ptr) as zip_source ptr
declare function zip_source_layered (byval as zip ptr, byval as zip_source ptr, byval as zip_source_layered_callback, byval as any ptr) as zip_source ptr
declare function zip_source_open (byval as zip_source ptr) as integer
declare function zip_source_pkware (byval as zip ptr, byval as zip_source ptr, byval as zip_uint16_t, byval as integer, byval as zstring ptr) as zip_source ptr
declare function zip_source_pop (byval as zip_source ptr) as zip_source ptr
declare function zip_source_read (byval as zip_source ptr, byval as any ptr, byval as zip_uint64_t) as zip_int64_t
declare function zip_source_stat (byval as zip_source ptr, byval as zip_stat_ ptr) as integer
declare function zip_source_zip (byval as zip ptr, byval as zip ptr, byval as zip_uint64_t, byval as integer, byval as zip_uint64_t, byval as zip_int64_t) as zip_source ptr
declare function zip_stat (byval as zip ptr, byval as zstring ptr, byval as integer, byval as zip_stat_ ptr) as integer
declare function zip_stat_index (byval as any ptr, byval as ulongint, byval as integer, byval as zip_stat_ ptr) as integer
declare sub zip_stat_init (byval as zip_stat_ ptr)
declare function zip_strerror (byval as zip ptr) as zstring ptr
declare function zip_unchange (byval as zip ptr, byval as zip_uint64_t) as integer
declare function zip_unchange_all (byval as zip ptr) as integer
declare function zip_unchange_archive (byval as zip ptr) as integer


end extern
#endif

