Thomas Klausner | 41f7750 | 2005-05-20 22:01:09 +0000 | [diff] [blame] | 1 | .\" Converted with mdoc2man 0.2 |
Thomas Klausner | c073556 | 2005-07-20 17:18:13 +0000 | [diff] [blame] | 2 | .\" from NiH: zip_source_zip.mdoc,v 1.7 2005/07/20 17:18:04 wiz Exp |
| 3 | .\" $NiH: zip_source_zip.mdoc,v 1.7 2005/07/20 17:18:04 wiz Exp $ |
Thomas Klausner | 41f7750 | 2005-05-20 22:01:09 +0000 | [diff] [blame] | 4 | .\" |
| 5 | .\" zip_source_zip.mdoc \-- create data source from zip file |
Thomas Klausner | e8b2694 | 2005-06-09 19:52:49 +0000 | [diff] [blame] | 6 | .\" Copyright (C) 2004, 2005 Dieter Baron and Thomas Klausner |
Thomas Klausner | 41f7750 | 2005-05-20 22:01:09 +0000 | [diff] [blame] | 7 | .\" |
| 8 | .\" This file is part of libzip, a library to manipulate ZIP archives. |
| 9 | .\" The authors can be contacted at <nih@giga.or.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 | .\" |
Thomas Klausner | c073556 | 2005-07-20 17:18:13 +0000 | [diff] [blame] | 36 | .TH ZIP_SOURCE_ZIP 3 "July 20, 2005" NiH |
Thomas Klausner | 41f7750 | 2005-05-20 22:01:09 +0000 | [diff] [blame] | 37 | .SH "NAME" |
| 38 | zip_source_zip \- create data source from zip file |
| 39 | .SH "LIBRARY" |
| 40 | libzip (-lzip) |
| 41 | .SH "SYNOPSIS" |
| 42 | .In zip.h |
Thomas Klausner | c073556 | 2005-07-20 17:18:13 +0000 | [diff] [blame] | 43 | .Ft struct zip_source * |
Thomas Klausner | 41f7750 | 2005-05-20 22:01:09 +0000 | [diff] [blame] | 44 | .Fn zip_source_zip "struct zip *archive" "struct zip *srcarchive" \ |
| 45 | "int srcidx" "int flags" "off_t start" "off_t len" |
| 46 | .SH "DESCRIPTION" |
| 47 | The function |
| 48 | .Fn zip_source_zip |
| 49 | creates a zip source from a file in a zip archive. |
| 50 | The |
| 51 | \fBsrcarchive\fR |
| 52 | argument is the (open) zip archive containing the source zip file |
| 53 | at index |
| 54 | \fBsrcidx.\fR |
| 55 | \fBlen\fR |
| 56 | bytes from offset |
| 57 | \fBstart\fR |
| 58 | will be used in the zip_source. |
| 59 | If |
| 60 | \fBlen\fR |
| 61 | is 0 or \-1, the whole file (starting from |
| 62 | \fBstart )\fR |
| 63 | is used. |
| 64 | If |
| 65 | \fBstart\fR |
| 66 | is zero and |
| 67 | \fBlen\fR |
| 68 | is \-1, the whole file will be copied without decompressing it. |
| 69 | If |
| 70 | \fBflags\fR |
| 71 | is |
| 72 | \fBZIP_FL_UNCHANGED,\fR |
| 73 | .Fn zip_source_zip |
| 74 | will try to get the original data without any changes that may |
| 75 | have been made to |
| 76 | \fBsrcarchive\fR |
| 77 | after opening it. |
| 78 | .SH "RETURN VALUES" |
| 79 | Upon successful completion, the created source is returned. |
| 80 | Otherwise, |
| 81 | \fBNULL\fR |
| 82 | is returned and the error code in |
| 83 | \fBarchive\fR |
| 84 | is set to indicate the error. |
| 85 | .SH "ERRORS" |
| 86 | .Fn zip_source_zip |
| 87 | fails if: |
| 88 | .RS |
| 89 | .TP 4 |
| 90 | Bq Er ZIP_ER_CHANGED |
| 91 | Unchanged data was requested, but it is not available. |
| 92 | .TP 4 |
| 93 | Bq Er ZIP_ER_INVAL |
| 94 | \fBsrcarchive,\fR |
| 95 | \fBsrcidx,\fR |
| 96 | \fBstart,\fR |
| 97 | or |
| 98 | \fBlen\fR |
| 99 | are invalid. |
| 100 | .TP 4 |
| 101 | Bq Er ZIP_ER_MEMORY |
| 102 | Required memory could not be allocated. |
| 103 | .RE |
| 104 | Additionally, it can return all error codes from |
| 105 | .Fn zip_stat_index |
| 106 | and |
| 107 | .Fn zip_fopen_index. |
| 108 | .SH "SEE ALSO" |
Thomas Klausner | 3dd81d8 | 2005-06-09 19:01:53 +0000 | [diff] [blame] | 109 | libzip(3), |
Thomas Klausner | 41f7750 | 2005-05-20 22:01:09 +0000 | [diff] [blame] | 110 | zip_add(3), |
| 111 | zip_replace(3), |
| 112 | zip_source_buffer(3), |
| 113 | zip_source_file(3), |
| 114 | zip_source_filep(3), |
| 115 | zip_source_free(3), |
| 116 | zip_source_function(3) |
Thomas Klausner | 7533013 | 2005-06-17 12:59:06 +0000 | [diff] [blame] | 117 | .SH "AUTHORS" |
| 118 | |
| 119 | Dieter Baron <dillo@giga.or.at> |
| 120 | and |
| 121 | Thomas Klausner <tk@giga.or.at> |