blob: 4754f4b6acb98a0acf89957d76a09a2befc172dd [file] [log] [blame]
Thomas Klausner39b5f9e2005-06-09 21:14:54 +00001.\" $NiH: zip_error_to_str.mdoc,v 1.7 2005/06/09 21:13:12 wiz Exp $
Thomas Klausnercbbac882003-12-27 22:25:58 +00002.\"
Thomas Klausner2e874fb2004-11-24 16:18:03 +00003.\" zip_error_to_str.mdoc -- get string representation of zip error code
Thomas Klausnerbe31d742005-06-09 19:51:23 +00004.\" Copyright (C) 2003, 2004, 2005 Dieter Baron and Thomas Klausner
Thomas Klausnercbbac882003-12-27 22:25:58 +00005.\"
6.\" This file is part of libzip, a library to manipulate ZIP archives.
7.\" The authors can be contacted at <nih@giga.or.at>
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\" 3. The names of the authors may not be used to endorse or promote
19.\" products derived from this software without specific prior
20.\" written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
23.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
26.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
28.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
30.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
31.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
32.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33.\"
Thomas Klausner2e874fb2004-11-24 16:18:03 +000034.Dd November 24, 2004
Dieter Baronc1ef2592004-12-03 15:23:10 +000035.Dt ZIP_ERROR_TO_STR 3
Thomas Klausnercbbac882003-12-27 22:25:58 +000036.Os
37.Sh NAME
Thomas Klausner2e874fb2004-11-24 16:18:03 +000038.Nm zip_error_to_str
Thomas Klausnercbbac882003-12-27 22:25:58 +000039.Nd get string representation of zip error
40.Sh LIBRARY
41libzip (-lzip)
42.Sh SYNOPSIS
43.In zip.h
44.Ft int
Thomas Klausner2e874fb2004-11-24 16:18:03 +000045.Fn zip_error_to_str "char *buf" "int len" "int ze" "int se"
Thomas Klausnercbbac882003-12-27 22:25:58 +000046.Sh DESCRIPTION
47The
Thomas Klausner2e874fb2004-11-24 16:18:03 +000048.Fn zip_error_to_str
Dieter Baronc1ef2592004-12-03 15:23:10 +000049function stores a string describing the libzip error code
Thomas Klausnercbbac882003-12-27 22:25:58 +000050.Ar ze
Thomas Klausner10ba5012004-11-17 22:26:09 +000051in the user-provided buffer
Thomas Klausnere9f5c292004-12-22 16:37:48 +000052.Ar buf
Thomas Klausnercbbac882003-12-27 22:25:58 +000053which has size
54.Ar len .
Dieter Baronc1ef2592004-12-03 15:23:10 +000055The buffer is always NUL-terminated.
Thomas Klausnercbbac882003-12-27 22:25:58 +000056.Ar se
57should be the value of the global variable
58.Ar errno
Dieter Baronc1ef2592004-12-03 15:23:10 +000059at the time of the error or the zlib error code, depending on
60.Ar ze .
61.Pp
Thomas Klausner2e874fb2004-11-24 16:18:03 +000062.Fn zip_error_to_str
Thomas Klausnercbbac882003-12-27 22:25:58 +000063is especially useful if
64.Fn zip_open
Dieter Baronc1ef2592004-12-03 15:23:10 +000065failed, since then there is no
Thomas Klausnercbbac882003-12-27 22:25:58 +000066.Vt struct zip
Dieter Baronc1ef2592004-12-03 15:23:10 +000067is available to store the error code; otherwise
Thomas Klausnercbbac882003-12-27 22:25:58 +000068.Fn zip_strerror
Dieter Baronc1ef2592004-12-03 15:23:10 +000069or
70.Fn zip_file_strerror
71are more convenient.
Thomas Klausnercbbac882003-12-27 22:25:58 +000072.Sh RETURN VALUES
Thomas Klausner2e874fb2004-11-24 16:18:03 +000073.Fn zip_error_to_str
Thomas Klausnercbbac882003-12-27 22:25:58 +000074returns the number of characters that would have been written to a
75sufficiently sized
76.Ar buf ,
77excluding the terminating NUL character.
78.Sh SEE ALSO
Thomas Klausnerbec1cfe2005-06-09 18:50:27 +000079.Xr libzip 3 ,
Dieter Baronc1ef2592004-12-03 15:23:10 +000080.Xr zip_error_get 3 ,
Thomas Klausnereb239572004-12-22 15:49:20 +000081.Xr zip_error_get_sys_type 3 ,
Dieter Baronc1ef2592004-12-03 15:23:10 +000082.Xr zip_file_error_get 3 ,
83.Xr zip_file_strerror 3 ,
Thomas Klausnercbbac882003-12-27 22:25:58 +000084.Xr zip_open 3 ,
Thomas Klausnere9f5c292004-12-22 16:37:48 +000085.Xr zip_strerror 3
Thomas Klausnera456cf52005-06-09 21:13:13 +000086.Sh AUTHORS
87.An -nosplit
88.An Dieter Baron Aq dillo@giga.or.at
Thomas Klausner39b5f9e2005-06-09 21:14:54 +000089and
Thomas Klausnera456cf52005-06-09 21:13:13 +000090.An Thomas Klausner Aq tk@giga.or.at