merge
diff --git a/TODO b/TODO
index 606543c..774514f 100644
--- a/TODO
+++ b/TODO
@@ -251,14 +251,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_error_t *zip_get_error(zip_t *);
-** int zip_error_code_zip(const zip_error_t *);
-** int zip_error_code_system(const zip_error_t *);
-** void zip_error_fini(zip_error_t *);
-** void zip_error_init(zip_error_t *);
-** void zip_error_set(zip_error_t *, int, int);
-** const char *zip_error_strerror(zip_error_t *);
-** int zip_error_system_type(const zip_error_t *);
** 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 *);
diff --git a/man/Makefile.am b/man/Makefile.am
index 4541545..c2ced0f 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -14,8 +14,15 @@
zip_dir_add.mdoc \
zip_discard.mdoc \
zip_error_clear.mdoc \
+ zip_error_code_system.mdoc \
+ zip_error_code_zip.mdoc \
+ zip_error_fini.mdoc \
zip_error_get.mdoc \
zip_error_get_sys_type.mdoc \
+ zip_error_init.mdoc \
+ zip_error_set.mdoc \
+ zip_error_strerror.mdoc \
+ zip_error_system_type.mdoc \
zip_error_to_str.mdoc \
zip_errors.mdoc \
zip_fclose.mdoc \
@@ -37,6 +44,7 @@
zip_fread.mdoc \
zip_get_archive_comment.mdoc \
zip_get_archive_flag.mdoc \
+ zip_get_error.mdoc \
zip_get_file_comment.mdoc \
zip_get_name.mdoc \
zip_get_num_entries.mdoc \
diff --git a/man/zip_error_clear.mdoc b/man/zip_error_clear.mdoc
index 0a808ce..fe1d79c 100644
--- a/man/zip_error_clear.mdoc
+++ b/man/zip_error_clear.mdoc
@@ -1,5 +1,5 @@
-.\" zip_clear_error.mdoc -- clear error state for archive or file
-.\" Copyright (C) 2006 Dieter Baron and Thomas Klausner
+.\" zip_error_clear.mdoc -- clear error state for archive or file
+.\" Copyright (C) 2006-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>
@@ -29,8 +29,8 @@
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd October 4, 2006
-.Dt ZIP_CLEAR_ERROR 3
+.Dd October 30, 2014
+.Dt ZIP_ERROR_CLEAR 3
.Os
.Sh NAME
.Nm zip_error_clear ,
diff --git a/man/zip_error_code_system.mdoc b/man/zip_error_code_system.mdoc
new file mode 100644
index 0000000..6b9b3a4
--- /dev/null
+++ b/man/zip_error_code_system.mdoc
@@ -0,0 +1,60 @@
+.\" zip_error_code_system.mdoc -- get system error part of zip_error
+.\" 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 October 30, 2014
+.Dt ZIP_ERROR_CODE_SYSTEM 3
+.Os
+.Sh NAME
+.Nm zip_error_code_system
+.Nd get operating system error part of zip_error
+.Sh LIBRARY
+libzip (-lzip)
+.Sh SYNOPSIS
+.In zip.h
+.Ft int
+.Fn zip_error_code_system "const zip_error_t *ze"
+.Sh DESCRIPTION
+The
+.Fn zip_error_code_system
+function returns the system specific part of the error from the
+zip_error error
+.Ar ze .
+For finding out what system reported the error, use
+.Xr zip_error_system_type 3 .
+.Sh SEE ALSO
+.Xr libzip 3 ,
+.Xr zip_error_code_zip 3 ,
+.Xr zip_error_system_type 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_error_code_zip.mdoc b/man/zip_error_code_zip.mdoc
new file mode 100644
index 0000000..2875d64
--- /dev/null
+++ b/man/zip_error_code_zip.mdoc
@@ -0,0 +1,57 @@
+.\" zip_error_code_zip.mdoc -- get libzip error part of zip_error
+.\" 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 October 30, 2014
+.Dt ZIP_ERROR_CODE_ZIP 3
+.Os
+.Sh NAME
+.Nm zip_error_code_zip
+.Nd get libzip error part of zip_error
+.Sh LIBRARY
+libzip (-lzip)
+.Sh SYNOPSIS
+.In zip.h
+.Ft int
+.Fn zip_error_code_zip "const zip_error_t *ze"
+.Sh DESCRIPTION
+The
+.Fn zip_error_code_zip
+function returns the libzip specific part of the error from the
+zip_error error
+.Ar ze .
+.Sh SEE ALSO
+.Xr libzip 3 ,
+.Xr zip_error_code_system 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_error_fini.mdoc b/man/zip_error_fini.mdoc
new file mode 100644
index 0000000..6f7dffa
--- /dev/null
+++ b/man/zip_error_fini.mdoc
@@ -0,0 +1,57 @@
+.\" zip_error_fini.mdoc -- clean up zip_error
+.\" 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 October 30, 2014
+.Dt ZIP_ERROR_FINI 3
+.Os
+.Sh NAME
+.Nm zip_error_fini
+.Nd clean up zip_error structure
+.Sh LIBRARY
+libzip (-lzip)
+.Sh SYNOPSIS
+.In zip.h
+.Ft void
+.Fn zip_error_fini "zip_error_t *ze"
+.Sh DESCRIPTION
+The
+.Fn zip_error_fini
+function cleans up and frees internally allocated memory of the
+zip_error pointed to by
+.Ar ze .
+.Sh SEE ALSO
+.Xr libzip 3 ,
+.Xr zip_error_init 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_error_get_sys_type.mdoc b/man/zip_error_get_sys_type.mdoc
index fd15876..b26cac4 100644
--- a/man/zip_error_get_sys_type.mdoc
+++ b/man/zip_error_get_sys_type.mdoc
@@ -1,5 +1,5 @@
.\" zip_error_get_sys_type.mdoc -- get type of error
-.\" Copyright (C) 2004, 2005 Dieter Baron and Thomas Klausner
+.\" Copyright (C) 2004-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>
@@ -29,8 +29,8 @@
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd November 30, 2004
-.Dt ZIP_ERROR_SYS_TYPE 3
+.Dd October 30, 2014
+.Dt ZIP_ERROR_GET_SYS_TYPE 3
.Os
.Sh NAME
.Nm zip_error_get_sys_type
diff --git a/man/zip_error_init.mdoc b/man/zip_error_init.mdoc
new file mode 100644
index 0000000..25f006c
--- /dev/null
+++ b/man/zip_error_init.mdoc
@@ -0,0 +1,60 @@
+.\" zip_error_init.mdoc -- initialize zip_error
+.\" 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 October 30, 2014
+.Dt ZIP_ERROR_INIT 3
+.Os
+.Sh NAME
+.Nm zip_error_init
+.Nd initialize zip_error structure
+.Sh LIBRARY
+libzip (-lzip)
+.Sh SYNOPSIS
+.In zip.h
+.Ft void
+.Fn zip_error_init "zip_error_t *ze"
+.Sh DESCRIPTION
+The
+.Fn zip_error_init
+function initializes the zip_error pointed to by
+.Ar ze .
+.Ar *ze
+must be allocated before calling
+.Fn zip_error_init .
+.\" TODO: describe when you would need to call this at all
+.Sh SEE ALSO
+.Xr libzip 3 ,
+.Xr zip_error_fini 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_error_set.mdoc b/man/zip_error_set.mdoc
new file mode 100644
index 0000000..4cb82ff
--- /dev/null
+++ b/man/zip_error_set.mdoc
@@ -0,0 +1,66 @@
+.\" zip_error_set.mdoc -- set zip_error
+.\" 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 October 30, 2014
+.Dt ZIP_ERROR_SET 3
+.Os
+.Sh NAME
+.Nm zip_error_set
+.Nd fill in zip_error structure
+.Sh LIBRARY
+libzip (-lzip)
+.Sh SYNOPSIS
+.In zip.h
+.Ft void
+.Fn zip_error_set "zip_error_t *ze" "int le" "int se"
+.Sh DESCRIPTION
+The
+.Fn zip_error_set
+function sets the zip_error pointed to by
+.Ar ze
+to the libzip error code
+.Ar le
+and the system error code
+.Ar se .
+.Pp
+.Ar ze
+must be allocated and initialized with
+.Xr zip_error_fini 3
+before calling
+.Fn zip_error set .
+.Sh SEE ALSO
+.Xr libzip 3 ,
+.Xr zip_error_init 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_error_strerror.mdoc b/man/zip_error_strerror.mdoc
new file mode 100644
index 0000000..6e8b27b
--- /dev/null
+++ b/man/zip_error_strerror.mdoc
@@ -0,0 +1,64 @@
+.\" zip_error_strerror.mdoc -- create human-readable version of zip_error
+.\" 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 October 30, 2014
+.Dt ZIP_ERROR_STRERROR 3
+.Os
+.Sh NAME
+.Nm zip_error_strerror
+.Nd create human-readable string for zip_error
+.Sh LIBRARY
+libzip (-lzip)
+.Sh SYNOPSIS
+.In zip.h
+.Ft const char *
+.Fn zip_error_strerror "zip_error_t *ze"
+.Sh DESCRIPTION
+The
+.Fn zip_error_strerror
+function returns an error message string corresponding to
+.Ar ze
+like
+.Xr strerror 3 .
+This string will stay valid until the next call to
+.Fn zip_error_strerror
+or until
+.Xr zip_error_fini 3
+is called.
+.Sh SEE ALSO
+.Xr libzip 3 ,
+.Xr strerror 3 ,
+.Xr zip_error_fini 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_error_system_type.mdoc b/man/zip_error_system_type.mdoc
new file mode 100644
index 0000000..41dde1b
--- /dev/null
+++ b/man/zip_error_system_type.mdoc
@@ -0,0 +1,74 @@
+.\" zip_error_system_type.mdoc -- return system type for error
+.\" 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 October 30, 2014
+.Dt ZIP_ERROR_SYSTEM_TYPE 3
+.Os
+.Sh NAME
+.Nm zip_error_system_type
+.Nd return type of system error
+.Sh LIBRARY
+libzip (-lzip)
+.Sh SYNOPSIS
+.In zip.h
+.Ft int
+.Fn zip_error_system_type "const zip_error_t *"
+.Sh DESCRIPTION
+The
+.Fn zip_error_system_type
+function returns the system type for the zip_error
+.Ar ze .
+Currently, the following system types are defined:
+.Bl -tag -width ZIP_ET_NONE
+.It Dv ZIP_ET_NONE
+System error part of
+.Ar ze
+is unused.
+.It Dv ZIP_ET_SYS
+System error part of
+.Ar ze
+is an
+.Xr errno 3 .
+.It Dv ZIP_ET_ZLIB
+.System error part of
+.Ar ze
+is a
+.Xr zlib 3
+error.
+.El
+.Sh SEE ALSO
+.Xr libzip 3 ,
+.Xr zip_error_code_system 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_get_error.mdoc b/man/zip_get_error.mdoc
new file mode 100644
index 0000000..6dd56e3
--- /dev/null
+++ b/man/zip_get_error.mdoc
@@ -0,0 +1,57 @@
+.\" zip_get_error.mdoc -- get zip_error for archive
+.\" 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 October 30, 2014
+.Dt ZIP_GET_ERROR 3
+.Os
+.Sh NAME
+.Nm zip_get_error
+.Nd get zip error for archive
+.Sh LIBRARY
+libzip (-lzip)
+.Sh SYNOPSIS
+.In zip.h
+.Ft zip_error_t *
+.Fn zip_get_error "zip_t *archive"
+.Sh DESCRIPTION
+The
+.Fn zip_get_error
+function returns the zip error for the zip archive
+.Ar archive .
+.Sh SEE ALSO
+.Xr libzip 3 ,
+.Xr zip_error_code_system 3 ,
+.Xr zip_error_code_zip 3
+.Sh AUTHORS
+.An -nosplit
+.An Dieter Baron Aq Mt dillo@nih.at
+and
+.An Thomas Klausner Aq Mt tk@giga.or.at