GDAL
cpl_minizip_ioapi.h
1 /* Modified version by Even Rouault. :
2  - change fill_fopen_filefunc to cpl_fill_fopen_filefunc
3  - Add support for ZIP64
4 
5  * Copyright (c) 2008-2012, Even Rouault <even dot rouault at mines-paris dot org>
6 
7  Original licence available in port/LICENCE_minizip
8 */
9 
10 /* ioapi.h -- IO base function header for compress/uncompress .zip
11  files using zlib + zip or unzip API
12 
13  Version 1.01e, February 12th, 2005
14 
15  Copyright (C) 1998-2005 Gilles Vollant
16 */
17 
18 #ifndef CPL_MINIZIP_IOAPI_H_INCLUDED
19 #define CPL_MINIZIP_IOAPI_H_INCLUDED
20 
21 #include "cpl_vsi.h"
22 #define uLong64 vsi_l_offset
23 
24 #define ZLIB_FILEFUNC_SEEK_CUR (1)
25 #define ZLIB_FILEFUNC_SEEK_END (2)
26 #define ZLIB_FILEFUNC_SEEK_SET (0)
27 
28 #define ZLIB_FILEFUNC_MODE_READ (1)
29 #define ZLIB_FILEFUNC_MODE_WRITE (2)
30 #define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
31 
32 #define ZLIB_FILEFUNC_MODE_EXISTING (4)
33 #define ZLIB_FILEFUNC_MODE_CREATE (8)
34 
35 #ifndef ZCALLBACK
36 
37 #if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
38 #define ZCALLBACK CALLBACK
39 #else
40 #define ZCALLBACK
41 #endif
42 #endif
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 typedef voidpf (ZCALLBACK *open_file_func) (voidpf opaque, const char* filename, int mode);
49 typedef uLong (ZCALLBACK *read_file_func) (voidpf opaque, voidpf stream, void* buf, uLong size);
50 typedef uLong (ZCALLBACK *write_file_func) (voidpf opaque, voidpf stream, const void* buf, uLong size);
51 typedef uLong64 (ZCALLBACK *tell_file_func) (voidpf opaque, voidpf stream);
52 typedef long (ZCALLBACK *seek_file_func) (voidpf opaque, voidpf stream, uLong64 offset, int origin);
53 typedef int (ZCALLBACK *close_file_func) (voidpf opaque, voidpf stream);
54 typedef int (ZCALLBACK *testerror_file_func) (voidpf opaque, voidpf stream);
55 
56 typedef struct zlib_filefunc_def_s
57 {
58  open_file_func zopen_file;
59  read_file_func zread_file;
60  write_file_func zwrite_file;
61  tell_file_func ztell_file;
62  seek_file_func zseek_file;
63  close_file_func zclose_file;
64  testerror_file_func zerror_file;
65  voidpf opaque;
67 
68 void cpl_fill_fopen_filefunc (zlib_filefunc_def* pzlib_filefunc_def);
69 
70 #define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size))
71 #define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size))
72 #define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream))
73 #define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode))
74 #define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream))
75 #define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream))
76 
77 
78 #ifdef __cplusplus
79 }
80 #endif
81 
82 #endif /* CPL_MINIZIP_IOAPI_H_INCLUDED */
Standard C Covers.
Definition: cpl_minizip_ioapi.h:56

Generated for GDAL by doxygen 1.8.13.