"Fossies" - the Fresh Open Source Software Archive

Member "src/Common/libzip/zipwin32.h" (10 Oct 2018, 3482 Bytes) of package /windows/misc/VeraCrypt_1.23-Hotfix-2_Source.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "zipwin32.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 1.21_Source_vs_1.22_Source.

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