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