zipwin32.h 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #ifndef _HAD_ZIPWIN32_H
  2. #define _HAD_ZIPWIN32_H
  3. /*
  4. zipwin32.h -- internal declarations for Windows.
  5. Copyright (C) 1999-2015 Dieter Baron and Thomas Klausner
  6. This file is part of libzip, a library to manipulate ZIP archives.
  7. The authors can be contacted at <libzip@nih.at>
  8. Redistribution and use in source and binary forms, with or without
  9. modification, are permitted provided that the following conditions
  10. are met:
  11. 1. Redistributions of source code must retain the above copyright
  12. notice, this list of conditions and the following disclaimer.
  13. 2. Redistributions in binary form must reproduce the above copyright
  14. notice, this list of conditions and the following disclaimer in
  15. the documentation and/or other materials provided with the
  16. distribution.
  17. 3. The names of the authors may not be used to endorse or promote
  18. products derived from this software without specific prior
  19. written permission.
  20. THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
  21. OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  22. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  23. ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
  24. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  25. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  26. GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  27. INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
  28. IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  29. OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  30. IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. */
  32. #include <windows.h>
  33. /* context for Win32 source */
  34. struct _zip_source_win32_file_ops;
  35. struct _zip_source_win32_read_file {
  36. zip_error_t error; /* last error information */
  37. zip_int64_t supports;
  38. /* operations */
  39. struct _zip_source_win32_file_ops *ops;
  40. /* reading */
  41. void *fname; /* name of file to read from - ANSI (char *) or Unicode (wchar_t *) */
  42. void *h; /* HANDLE for file to read from */
  43. int closep; /* whether to close f on ZIP_CMD_FREE */
  44. struct zip_stat st; /* stat information passed in */
  45. zip_uint64_t start; /* start offset of data to read */
  46. zip_uint64_t end; /* end offset of data to read, 0 for up to EOF */
  47. zip_uint64_t current; /* current offset */
  48. /* writing */
  49. void *tmpname; /* name of temp file - ANSI (char *) or Unicode (wchar_t *) */
  50. void *hout; /* HANDLE for output file */
  51. };
  52. typedef struct _zip_source_win32_read_file _zip_source_win32_read_file_t;
  53. /* internal operations for Win32 source */
  54. struct _zip_source_win32_file_ops {
  55. void *(*op_strdup)(const void *);
  56. void *(*op_open)(_zip_source_win32_read_file_t *);
  57. void *(*op_create_temp)(_zip_source_win32_read_file_t *, void **, zip_uint32_t, PSECURITY_ATTRIBUTES);
  58. int (*op_rename_temp)(_zip_source_win32_read_file_t *);
  59. int (*op_remove)(const void *);
  60. };
  61. typedef struct _zip_source_win32_file_ops _zip_source_win32_file_ops_t;
  62. zip_source_t *_zip_source_win32_handle_or_name(const void *, void *, zip_uint64_t, zip_int64_t, int, const zip_stat_t *, _zip_source_win32_file_ops_t *, zip_error_t *);
  63. #endif /* zipwin32.h */