blob: b014a7ba256513d50ae2e04fc3f26a93403a3079 [file] [log] [blame]
Thomas Klausner0001d262018-04-14 22:34:06 +02001.\" Automatically generated from an mdoc input file. Do not edit.
2.\" zip_source_handle.mdoc -- create data source from a Windows file handle
Thomas Klausner8c8c26f2021-06-18 11:33:49 +02003.\" Copyright (C) 2015-2021 Dieter Baron and Thomas Klausner
Thomas Klausner0001d262018-04-14 22:34:06 +02004.\"
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 Klausner7da02272017-12-18 21:50:15 +010033.TH "ZIP_SOURCE_WIN32HANDLE" "3" "December 18, 2017" "NiH" "Library Functions Manual"
Thomas Klausner4edcedc2017-12-06 12:43:04 +010034.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"
41libzip (-lzip)
42.SH "SYNOPSIS"
43\fB#include <zip.h>\fR
44.sp
45\fIzip_source_t *\fR
Thomas Klausner7da02272017-12-18 21:50:15 +010046.br
Thomas Klausner4edcedc2017-12-06 12:43:04 +010047.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 Klausner7da02272017-12-18 21:50:15 +010053.br
Thomas Klausner4edcedc2017-12-06 12:43:04 +010054.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"
59The functions
60\fBzip_source_win32handle\fR()
61and
62\fBzip_source_win32handle_create\fR()
63create a zip source from a Windows file handle.
64They open
65\fIfname\fR
66and read
67\fIlen\fR
68bytes from offset
69\fIstart\fR
70from it.
71If
72\fIlen\fR
73is 0 or \-1, the whole file (starting from
74\fIstart\fR)
75is used.
76.PP
77If the file supports seek, the source can be used to open a zip archive from.
78.PP
79The file is opened and read when the data from the source is used, usually by
80\fBzip_close\fR()
81or
82\fBzip_open_from_source\fR().
83.SH "RETURN VALUES"
84Upon successful completion, the created source is returned.
85Otherwise,
86\fRNULL\fR
87is returned and the error code in
88\fIarchive\fR
89or
90\fIerror\fR
91is set to indicate the error.
92.SH "ERRORS"
93\fBzip_source_w32handle\fR()
94and
95\fBzip_source_w32handle_create\fR()
96fail if:
97.TP 19n
98[\fRZIP_ER_INVAL\fR]
99\fIfname\fR,
100\fIstart\fR,
101or
102\fIlen\fR
103are invalid.
104.TP 19n
105[\fRZIP_ER_MEMORY\fR]
106Required memory could not be allocated.
107.TP 19n
108[\fRZIP_ER_OPEN\fR]
109Opening
110\fIfname\fR
111failed.
112.SH "SEE ALSO"
113libzip(3),
Thomas Klausner4c612cb2018-06-28 08:12:54 +0200114zip_file_add(3),
115zip_file_replace(3),
Thomas Klausner4edcedc2017-12-06 12:43:04 +0100116zip_source(3),
117zip_source_win32a(3),
118zip_source_win32w(3)
Thomas Klausner7da02272017-12-18 21:50:15 +0100119.SH "HISTORY"
120\fBzip_source_win32handle\fR()
121and
122\fBzip_source_win32handle_create\fR()
123were added in libzip 1.0.
Thomas Klausner4edcedc2017-12-06 12:43:04 +0100124.SH "AUTHORS"
125Dieter Baron <\fIdillo@nih.at\fR>
126and
127Thomas Klausner <\fItk@giga.or.at\fR>