Describe two more functions.
diff --git a/TODO b/TODO index 1a901bc..888ac8c 100644 --- a/TODO +++ b/TODO
@@ -262,8 +262,6 @@ - keep error codes in man pages in sync - document ZIP_SOURCE_GET_ARGS(type, data, len, error) ((len) < sizeof(type) ? zip_error_set((error), ZIP_ER_INVAL, 0), NULL : (type *)(data)) - document new functions -** zip_int64_t zip_error_to_data(const zip_error_t *, void *, zip_uint64_t); -** zip_error_t *zip_file_get_error(zip_file_t *); ** zip_t *zip_open_from_source(zip_source_t *, int, zip_error_t *); ** zip_source_t *zip_source_buffer_create(const void *, zip_uint64_t, int, zip_error_t *); ** int zip_source_close(zip_source_t *);
diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt index e285a3d..84264fe 100644 --- a/man/CMakeLists.txt +++ b/man/CMakeLists.txt
@@ -26,7 +26,8 @@ zip_file_extra_field_get.mdoc zip_file_extra_field_set.mdoc zip_file_extra_fields_count.mdoc - zip_file_get_comment.mdoc + zip_file_get_comment.mdoc + zip_file_get_error.mdoc zip_file_rename.mdoc zip_file_set_comment.mdoc zip_file_strerror.mdoc @@ -109,6 +110,8 @@ RENAME zip_replace.3) INSTALL(FILES zip_stat.${MANFMT} DESTINATION ${MAN_PATH}/man3 RENAME zip_stat_index.3) +INSTALL(FILES zip_open.${MANFMT} DESTINATION ${MAN_PATH}/man3 + RENAME zip_open_from_source.3) INSTALL(FILES zip_file_strerror.${MANFMT} DESTINATION ${MAN_PATH}/man3 RENAME zip_strerror.3)
diff --git a/man/Makefile.am b/man/Makefile.am index b0f5ca3..94ce934 100644 --- a/man/Makefile.am +++ b/man/Makefile.am
@@ -33,6 +33,7 @@ zip_file_extra_field_get.mdoc \ zip_file_extra_field_set.mdoc \ zip_file_extra_fields_count.mdoc \ + zip_file_get_error.mdoc \ zip_file_get_comment.mdoc \ zip_file_get_external_attributes.mdoc \ zip_file_rename.mdoc \ @@ -94,6 +95,8 @@ ${DESTDIR}${man3dir}/zip_fopen_index_encrypted.3 ${LN} ${DESTDIR}${man3dir}/zip_add.3 \ ${DESTDIR}${man3dir}/zip_replace.3 + ${LN} ${DESTDIR}${man3dir}/zip_open.3 \ + ${DESTDIR}${man3dir}/zip_open_from_source.3 ${LN} ${DESTDIR}${man3dir}/zip_stat.3 \ ${DESTDIR}${man3dir}/zip_stat_index.3 ${LN} ${DESTDIR}${man3dir}/zip_file_strerror.3 \
diff --git a/man/zip_file_get_error.mdoc b/man/zip_file_get_error.mdoc new file mode 100644 index 0000000..f56693f --- /dev/null +++ b/man/zip_file_get_error.mdoc
@@ -0,0 +1,54 @@ +.\" zip_file_get_error.mdoc -- extract zip_error from zip_file +.\" Copyright (C) 2014 Dieter Baron and Thomas Klausner +.\" +.\" This file is part of libzip, a library to manipulate ZIP archives. +.\" The authors can be contacted at <libzip@nih.at> +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in +.\" the documentation and/or other materials provided with the +.\" distribution. +.\" 3. The names of the authors may not be used to endorse or promote +.\" products derived from this software without specific prior +.\" written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS +.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY +.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd November 9, 2014 +.Dt ZIP_FILE_GET_ERROR 3 +.Os +.Sh NAME +.Nm zip_file_get_error +.Nd extract zip_error from zip_file +.Sh LIBRARY +libzip (-lzip) +.Sh SYNOPSIS +.In zip.h +.Ft zip_error_t * +.Fn zip_file_get_error "zip_file_t *zf" +.Sh DESCRIPTION +.Fn zip_file_get_error +function returns the zip_error associated with the zip_file +.Ar zf . +.Sh SEE ALSO +.Xr libzip 3 +.Sh AUTHORS +.An -nosplit +.An Dieter Baron Aq Mt dillo@nih.at +and +.An Thomas Klausner Aq Mt tk@giga.or.at
diff --git a/man/zip_open.mdoc b/man/zip_open.mdoc index 740be21..c7df355 100644 --- a/man/zip_open.mdoc +++ b/man/zip_open.mdoc
@@ -29,11 +29,12 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 17, 2014 +.Dd November 9, 2014 .Dt ZIP_OPEN 3 .Os .Sh NAME -.Nm zip_open +.Nm zip_open , +.Nm zip_open_from_source .Nd open zip archive .Sh LIBRARY libzip (-lzip) @@ -41,12 +42,16 @@ .In zip.h .Ft zip_t * .Fn zip_open "const char *path" "int flags" "int *errorp" +.Ft zip_t * +.Fn zip_open_from_source "zip_source_t *zs" "int flags" "zip_error_t *ze" .Sh DESCRIPTION -The zip archive specified by +The +.Fn zip_open +function opens the zip archive specified by .Ar path -is opened and a pointer to a +and returns a pointer to a .Ft struct zip , -used to manipulate the archive, is returned. +used to manipulate the archive. The .Fa flags are specified by @@ -69,18 +74,38 @@ .Pp If an error occurs and .Ar errorp -is non-NULL, it will be set to the corresponding error code. +is +.Pf non- Dv NULL , +it will be set to the corresponding error code. +.Pp +The +.Fn zip_open_from_source +function opens a zip archive encapsulated by the zip_source +.Fa zs +using the provided +.Fa flags . +In case of error, the zip_error +.Fa ze +is filled in. .Sh RETURN VALUES Upon successful completion .Fn zip_open -returns a +and +.Fn zip_open_from_source +return a .Ft struct zip pointer. Otherwise, .Dv NULL is returned and +.Fn zip_open +sets .Ar *errorp -is set to indicate the error. +to indicate the error, while +.Fn zip_open_from source +sets +.Ar ze +to indicate the error. .Sh ERRORS The archive specified by .Ar path