annotate modules/zip/libzip/lib/zip_fopen_index.c @ 527:8f8c32f102f1

Zip: resurrection
author David Demelier <markand@malikania.fr>
date Wed, 01 Jun 2016 17:36:52 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
527
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
1 /*
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
2 zip_fopen_index.c -- open file in zip archive for reading by index
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
3 Copyright (C) 1999-2015 Dieter Baron and Thomas Klausner
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
4
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
5 This file is part of libzip, a library to manipulate ZIP archives.
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
6 The authors can be contacted at <libzip@nih.at>
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
7
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
8 Redistribution and use in source and binary forms, with or without
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
9 modification, are permitted provided that the following conditions
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
10 are met:
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
11 1. Redistributions of source code must retain the above copyright
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
12 notice, this list of conditions and the following disclaimer.
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
13 2. Redistributions in binary form must reproduce the above copyright
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
14 notice, this list of conditions and the following disclaimer in
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
15 the documentation and/or other materials provided with the
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
16 distribution.
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
17 3. The names of the authors may not be used to endorse or promote
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
18 products derived from this software without specific prior
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
19 written permission.
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
20
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
21 THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
22 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
23 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
24 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
25 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
27 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
28 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
29 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
30 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
31 IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
32 */
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
33
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
34
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
35 #include <stdio.h>
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
36 #include <stdlib.h>
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
37
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
38 #include "zipint.h"
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
39
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
40
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
41 ZIP_EXTERN zip_file_t *
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
42 zip_fopen_index(zip_t *za, zip_uint64_t index, zip_flags_t flags)
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
43 {
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
44 return zip_fopen_index_encrypted(za, index, flags, za->default_password);
8f8c32f102f1 Zip: resurrection
David Demelier <markand@malikania.fr>
parents:
diff changeset
45 }