1ZZIP_OPEN(3)                 zziplib Function List                ZZIP_OPEN(3)
2
3
4

NAME

6       zzip_open, zzip_open_ext_io, zzip_open_shared_io -
7

SYNOPSIS

9       #include <zzip/lib.h>
10
11       ZZIP_FILE* zzip_open((zzip_char_t* filename, int o_flags));
12
13       ZZIP_FILE*
14                                   zzip_open_ext_io((zzip_char_t* filename, int o_flags, int o_modes, zzip_strings_t* ext, zzip_plugin_io_t io));
15
16       ZZIP_FILE*
17                                      zzip_open_shared_io((ZZIP_FILE* stream, zzip_char_t* filename, int o_flags, int o_modes, zzip_strings_t* ext, zzip_plugin_io_t io));
18

DESCRIPTION

20       The zzip_open function will open(2) a real/zipped file
21
22       It has some magic functionality builtin - it will first try to open the
23       given filename as a normal file. If it does not exist, the given path
24       to the filename (if any) is split into its directory-part and the
25       file-part. A ".zip" extension is then added to the directory-part to
26       create the name of a zip-archive. That zip-archive (if it exists) is
27       being searched for the file-part, and if found a zzip-handle is
28       returned.
29
30       Note that if the file is found in the normal fs-directory the returned
31       structure is mostly empty and the zzip_read call will use the libc read
32       to obtain data. Otherwise a zzip_file_open is performed and any error
33       mapped to errno(3).
34
35       There was a possibility to transfer zziplib-specific openmodes through
36       o_flags but you should please not use them anymore and look into
37       zzip_open_ext_io to submit them down. The zzip_open function is shallow
38       in that it just extracts the zzipflags and calls
39       ·    zzip_open_ext_io(filename, o_flags, zzipflags|0664, 0, 0)
40
41       you must stop using this extra functionality (not well known anyway)
42       since zzip_open might be later usable to open files for writing in
43       which case the _EXTRAFLAGS will get in conflict.
44
45       compare with open(2) and zzip_fopen
46
47       The zzip_open_ext_io function uses explicit ext and io instead of the
48       internal defaults, setting them to zero is equivalent to zzip_open
49
50       note that the two flag types have been split into an o_flags (for
51       fcntl-like openflags) and o_modes where the latter shall carry the
52       zzip_flags and possibly accessmodes for unix filesystems. Since this
53       version of zziplib can not write zipfiles, it is not yet used for
54       anything else than zzip-specific modeflags.
55
56       The zzip_open_ext_io function returns a new zzip-handle (use zzip_close
57       to return it). On error the zzip_open_ext_io function will return null
58       setting errno(3).
59
60       The zzip_open_shared_io function takes an extra stream argument - if a
61       handle has been then ext/io can be left null and the new stream handle
62       will pick up the ext/io. This should be used only in specific
63       environment however since zzip_file_real does not store any
64       ext-sequence.
65
66       The benefit for the zzip_open_shared_io function comes in when the old
67       file handle was openened from a file within a zip archive. When the new
68       file is in the same zip archive then the internal zzip_dir structures
69       will be shared. It is even quicker, as no check needs to be done
70       anymore trying to guess the zip archive place in the filesystem, here
71       we just check whether the zip archive's filepath is a prefix part of
72       the filename to be opened.
73
74       Note that the zzip_open_shared_io function is also used by zzip_freopen
75       that will unshare the old handle, thereby possibly closing the handle.
76
77       The zzip_open_shared_io function returns a new zzip-handle (use
78       zzip_close to return it). On error the zzip_open_shared_io function
79       will return null setting errno(3).
80

AUTHOR

82       ·   Guido Draheim <guidod@gmx.de> Tomi Ollila <Tomi.Ollila@iki.fi>
83
85       Copyright (c) 1999,2000,2001,2002,2003 Guido Draheim All rights
86       reserved, use under the restrictions of the Lesser GNU General Public
87       License or alternatively the restrictions of the Mozilla Public License
88       1.1
89
90
91
92zziplib                             0.13.49                       ZZIP_OPEN(3)
Impressum