Thomas Klausner | 0001d26 | 2018-04-14 22:34:06 +0200 | [diff] [blame] | 1 | .\" Automatically generated from an mdoc input file. Do not edit. |
| 2 | .\" zip_source_handle.mdoc -- create data source from a Windows file handle |
Thomas Klausner | 8c8c26f | 2021-06-18 11:33:49 +0200 | [diff] [blame] | 3 | .\" Copyright (C) 2015-2021 Dieter Baron and Thomas Klausner |
Thomas Klausner | 0001d26 | 2018-04-14 22:34:06 +0200 | [diff] [blame] | 4 | .\" |
| 5 | .\" This file is part of libzip, a library to manipulate ZIP archives. |
| 6 | .\" The authors can be contacted at <libzip@nih.at> |
| 7 | .\" |
| 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 | .\" |
| 21 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS |
| 22 | .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 23 | .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 24 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY |
| 25 | .\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 26 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE |
| 27 | .\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 28 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER |
| 29 | .\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| 30 | .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| 31 | .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 32 | .\" |
Thomas Klausner | 7da0227 | 2017-12-18 21:50:15 +0100 | [diff] [blame] | 33 | .TH "ZIP_SOURCE_WIN32HANDLE" "3" "December 18, 2017" "NiH" "Library Functions Manual" |
Thomas Klausner | 4edcedc | 2017-12-06 12:43:04 +0100 | [diff] [blame] | 34 | .nh |
| 35 | .if n .ad l |
| 36 | .SH "NAME" |
| 37 | \fBzip_source_win32handle\fR, |
| 38 | \fBzip_source_win32handle_create\fR |
| 39 | \- create data source from a Windows file handle |
| 40 | .SH "LIBRARY" |
| 41 | libzip (-lzip) |
| 42 | .SH "SYNOPSIS" |
| 43 | \fB#include <zip.h>\fR |
| 44 | .sp |
| 45 | \fIzip_source_t *\fR |
Thomas Klausner | 7da0227 | 2017-12-18 21:50:15 +0100 | [diff] [blame] | 46 | .br |
Thomas Klausner | 4edcedc | 2017-12-06 12:43:04 +0100 | [diff] [blame] | 47 | .PD 0 |
| 48 | .HP 4n |
| 49 | \fBzip_source_win32handle\fR(\fIzip_t\ *archive\fR, \fIHANDLE\ h\fR, \fIzip_uint64_t\ start\fR, \fIzip_int64_t\ len\fR); |
| 50 | .PD |
| 51 | .PP |
| 52 | \fIzip_source_t *\fR |
Thomas Klausner | 7da0227 | 2017-12-18 21:50:15 +0100 | [diff] [blame] | 53 | .br |
Thomas Klausner | 4edcedc | 2017-12-06 12:43:04 +0100 | [diff] [blame] | 54 | .PD 0 |
| 55 | .HP 4n |
| 56 | \fBzip_source_win32handle_create\fR(\fIHANDLE\ h\fR, \fIzip_uint64_t\ start\fR, \fIzip_int64_t\ len\fR, \fIzip_error_t\ *error\fR); |
| 57 | .PD |
| 58 | .SH "DESCRIPTION" |
| 59 | The functions |
| 60 | \fBzip_source_win32handle\fR() |
| 61 | and |
| 62 | \fBzip_source_win32handle_create\fR() |
| 63 | create a zip source from a Windows file handle. |
| 64 | They open |
| 65 | \fIfname\fR |
| 66 | and read |
| 67 | \fIlen\fR |
| 68 | bytes from offset |
| 69 | \fIstart\fR |
| 70 | from it. |
| 71 | If |
| 72 | \fIlen\fR |
| 73 | is 0 or \-1, the whole file (starting from |
| 74 | \fIstart\fR) |
| 75 | is used. |
| 76 | .PP |
| 77 | If the file supports seek, the source can be used to open a zip archive from. |
| 78 | .PP |
| 79 | The file is opened and read when the data from the source is used, usually by |
| 80 | \fBzip_close\fR() |
| 81 | or |
| 82 | \fBzip_open_from_source\fR(). |
| 83 | .SH "RETURN VALUES" |
| 84 | Upon successful completion, the created source is returned. |
| 85 | Otherwise, |
| 86 | \fRNULL\fR |
| 87 | is returned and the error code in |
| 88 | \fIarchive\fR |
| 89 | or |
| 90 | \fIerror\fR |
| 91 | is set to indicate the error. |
| 92 | .SH "ERRORS" |
| 93 | \fBzip_source_w32handle\fR() |
| 94 | and |
| 95 | \fBzip_source_w32handle_create\fR() |
| 96 | fail if: |
| 97 | .TP 19n |
| 98 | [\fRZIP_ER_INVAL\fR] |
| 99 | \fIfname\fR, |
| 100 | \fIstart\fR, |
| 101 | or |
| 102 | \fIlen\fR |
| 103 | are invalid. |
| 104 | .TP 19n |
| 105 | [\fRZIP_ER_MEMORY\fR] |
| 106 | Required memory could not be allocated. |
| 107 | .TP 19n |
| 108 | [\fRZIP_ER_OPEN\fR] |
| 109 | Opening |
| 110 | \fIfname\fR |
| 111 | failed. |
| 112 | .SH "SEE ALSO" |
| 113 | libzip(3), |
Thomas Klausner | 4c612cb | 2018-06-28 08:12:54 +0200 | [diff] [blame] | 114 | zip_file_add(3), |
| 115 | zip_file_replace(3), |
Thomas Klausner | 4edcedc | 2017-12-06 12:43:04 +0100 | [diff] [blame] | 116 | zip_source(3), |
| 117 | zip_source_win32a(3), |
| 118 | zip_source_win32w(3) |
Thomas Klausner | 7da0227 | 2017-12-18 21:50:15 +0100 | [diff] [blame] | 119 | .SH "HISTORY" |
| 120 | \fBzip_source_win32handle\fR() |
| 121 | and |
| 122 | \fBzip_source_win32handle_create\fR() |
| 123 | were added in libzip 1.0. |
Thomas Klausner | 4edcedc | 2017-12-06 12:43:04 +0100 | [diff] [blame] | 124 | .SH "AUTHORS" |
| 125 | Dieter Baron <\fIdillo@nih.at\fR> |
| 126 | and |
| 127 | Thomas Klausner <\fItk@giga.or.at\fR> |