ZIP_SOURCE
Section: File Formats (5)
Index
Return to Main Contents
BSD mandoc
NAME
zip_source
- zip data source structure
LIBRARY
libzip -lzip)
SYNOPSIS
In zip.h
Vt zip_source_t *source ;
DESCRIPTION
A
Vt zip_source_t
represents a data source (or destination when used for writing).
libzip(3)
uses it for adding or replacing file contents for a file in a zip archive.
If the source supports seeking, it can also be used to open zip archives from.
Data can come from a file on disk
(zip_source_file3,
zip_source_file_create3,
zip_source_filep3,
or
zip_source_filep_create3),
memory
(zip_source_buffer3,
zip_source_buffer_create3,
zip_source_buffer_fragment3,
or
zip_source_buffer_fragment_create3),
a file inside an archive
(zip_source_zip3),
or provided via a callback function
(zip_source_function3
or
zip_source_function_create3).
zip_source_window3
or
zip_source_window_create3
can be used restrict access to a part of the contained data.
It can also be used as a filter to process the data provided by an underlying
Vt zip_source_t
(e.g., to compress it or compute a checksum), created with
zip_source_layered3
or
zip_source_layered_create3).
Sources are freed with
zip_source_free3.
Sources must support reading, and can optionally support seeking and
writing.
Vt zip_source_t
is reference counted, and created with a reference count of 1.
zip_open_from_source3,
zip_file_add3,
and
zip_file_replace3
will take ownership of the passed source (decrement the reference count when they are done using it), so
zip_source_free3
only needs to be called when these functions return an error.
The underlying data (file or buffer) must remain valid until the archive is closed.
Use
zip_source_keep3
to increase the reference count, for example if you need the source after
zip_close3.
SEE ALSO
libzip(3),
zip_source_buffer3,
zip_source_file3,
zip_source_filep3,
zip_source_free3,
zip_source_function3,
zip_source_keep3,
zip_source_window3,
zip_source_zip3
AUTHORS
An -nosplit
An Dieter Baron Aq Mt
dillo@nih.at
and
An Thomas Klausner Aq Mt
wiz@gatalith.at
Index
- NAME
-
- LIBRARY
-
- SYNOPSIS
-
- DESCRIPTION
-
- SEE ALSO
-
- AUTHORS
-