misc/quazip/ioapi.h
author nemo
Sun, 11 Mar 2012 20:36:50 -0400
changeset 6771 87a947097d00
parent 5752 ea95ee97c805
child 7889 57b117d441b9
permissions -rw-r--r--
Teach AI to drown with shotgun too
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5752
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
     1
/* ioapi.h -- IO base function header for compress/uncompress .zip
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
     2
   files using zlib + zip or unzip API
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
     3
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
     4
   Version 1.01e, February 12th, 2005
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
     5
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
     6
   Copyright (C) 1998-2005 Gilles Vollant
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
     7
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
     8
   Modified by Sergey A. Tachenov to integrate with Qt.
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
     9
*/
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    10
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    11
#ifndef _ZLIBIOAPI_H
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    12
#define _ZLIBIOAPI_H
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    13
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    14
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    15
#define ZLIB_FILEFUNC_SEEK_CUR (1)
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    16
#define ZLIB_FILEFUNC_SEEK_END (2)
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    17
#define ZLIB_FILEFUNC_SEEK_SET (0)
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    18
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    19
#define ZLIB_FILEFUNC_MODE_READ      (1)
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    20
#define ZLIB_FILEFUNC_MODE_WRITE     (2)
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    21
#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    22
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    23
#define ZLIB_FILEFUNC_MODE_EXISTING (4)
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    24
#define ZLIB_FILEFUNC_MODE_CREATE   (8)
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    25
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    26
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    27
#ifndef ZCALLBACK
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    28
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    29
#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    30
#define ZCALLBACK CALLBACK
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    31
#else
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    32
#define ZCALLBACK
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    33
#endif
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    34
#endif
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    35
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    36
#ifdef __cplusplus
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    37
extern "C" {
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    38
#endif
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    39
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    40
typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, voidpf file, int mode));
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    41
typedef uLong  (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    42
typedef uLong  (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    43
typedef uLong   (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream));
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    44
typedef int   (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin));
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    45
typedef int    (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream));
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    46
typedef int    (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream));
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    47
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    48
typedef struct zlib_filefunc_def_s
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    49
{
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    50
    open_file_func      zopen_file;
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    51
    read_file_func      zread_file;
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    52
    write_file_func     zwrite_file;
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    53
    tell_file_func      ztell_file;
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    54
    seek_file_func      zseek_file;
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    55
    close_file_func     zclose_file;
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    56
    testerror_file_func zerror_file;
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    57
    voidpf              opaque;
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    58
} zlib_filefunc_def;
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    59
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    60
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    61
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    62
void fill_qiodevice_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    63
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    64
#define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size))
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    65
#define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size))
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    66
#define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream))
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    67
#define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode))
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    68
#define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream))
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    69
#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream))
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    70
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    71
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    72
#ifdef __cplusplus
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    73
}
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    74
#endif
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    75
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    76
#endif
ea95ee97c805 Add QuaZIP library to build system
unc0rr
parents:
diff changeset
    77