gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
3.2KB

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