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