Thomas Klausner | 39b5f9e | 2005-06-09 21:14:54 +0000 | [diff] [blame^] | 1 | .\" $NiH: zip_error_to_str.mdoc,v 1.7 2005/06/09 21:13:12 wiz Exp $ |
Thomas Klausner | cbbac88 | 2003-12-27 22:25:58 +0000 | [diff] [blame] | 2 | .\" |
Thomas Klausner | 2e874fb | 2004-11-24 16:18:03 +0000 | [diff] [blame] | 3 | .\" zip_error_to_str.mdoc -- get string representation of zip error code |
Thomas Klausner | be31d74 | 2005-06-09 19:51:23 +0000 | [diff] [blame] | 4 | .\" Copyright (C) 2003, 2004, 2005 Dieter Baron and Thomas Klausner |
Thomas Klausner | cbbac88 | 2003-12-27 22:25:58 +0000 | [diff] [blame] | 5 | .\" |
| 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 Klausner | 2e874fb | 2004-11-24 16:18:03 +0000 | [diff] [blame] | 34 | .Dd November 24, 2004 |
Dieter Baron | c1ef259 | 2004-12-03 15:23:10 +0000 | [diff] [blame] | 35 | .Dt ZIP_ERROR_TO_STR 3 |
Thomas Klausner | cbbac88 | 2003-12-27 22:25:58 +0000 | [diff] [blame] | 36 | .Os |
| 37 | .Sh NAME |
Thomas Klausner | 2e874fb | 2004-11-24 16:18:03 +0000 | [diff] [blame] | 38 | .Nm zip_error_to_str |
Thomas Klausner | cbbac88 | 2003-12-27 22:25:58 +0000 | [diff] [blame] | 39 | .Nd get string representation of zip error |
| 40 | .Sh LIBRARY |
| 41 | libzip (-lzip) |
| 42 | .Sh SYNOPSIS |
| 43 | .In zip.h |
| 44 | .Ft int |
Thomas Klausner | 2e874fb | 2004-11-24 16:18:03 +0000 | [diff] [blame] | 45 | .Fn zip_error_to_str "char *buf" "int len" "int ze" "int se" |
Thomas Klausner | cbbac88 | 2003-12-27 22:25:58 +0000 | [diff] [blame] | 46 | .Sh DESCRIPTION |
| 47 | The |
Thomas Klausner | 2e874fb | 2004-11-24 16:18:03 +0000 | [diff] [blame] | 48 | .Fn zip_error_to_str |
Dieter Baron | c1ef259 | 2004-12-03 15:23:10 +0000 | [diff] [blame] | 49 | function stores a string describing the libzip error code |
Thomas Klausner | cbbac88 | 2003-12-27 22:25:58 +0000 | [diff] [blame] | 50 | .Ar ze |
Thomas Klausner | 10ba501 | 2004-11-17 22:26:09 +0000 | [diff] [blame] | 51 | in the user-provided buffer |
Thomas Klausner | e9f5c29 | 2004-12-22 16:37:48 +0000 | [diff] [blame] | 52 | .Ar buf |
Thomas Klausner | cbbac88 | 2003-12-27 22:25:58 +0000 | [diff] [blame] | 53 | which has size |
| 54 | .Ar len . |
Dieter Baron | c1ef259 | 2004-12-03 15:23:10 +0000 | [diff] [blame] | 55 | The buffer is always NUL-terminated. |
Thomas Klausner | cbbac88 | 2003-12-27 22:25:58 +0000 | [diff] [blame] | 56 | .Ar se |
| 57 | should be the value of the global variable |
| 58 | .Ar errno |
Dieter Baron | c1ef259 | 2004-12-03 15:23:10 +0000 | [diff] [blame] | 59 | at the time of the error or the zlib error code, depending on |
| 60 | .Ar ze . |
| 61 | .Pp |
Thomas Klausner | 2e874fb | 2004-11-24 16:18:03 +0000 | [diff] [blame] | 62 | .Fn zip_error_to_str |
Thomas Klausner | cbbac88 | 2003-12-27 22:25:58 +0000 | [diff] [blame] | 63 | is especially useful if |
| 64 | .Fn zip_open |
Dieter Baron | c1ef259 | 2004-12-03 15:23:10 +0000 | [diff] [blame] | 65 | failed, since then there is no |
Thomas Klausner | cbbac88 | 2003-12-27 22:25:58 +0000 | [diff] [blame] | 66 | .Vt struct zip |
Dieter Baron | c1ef259 | 2004-12-03 15:23:10 +0000 | [diff] [blame] | 67 | is available to store the error code; otherwise |
Thomas Klausner | cbbac88 | 2003-12-27 22:25:58 +0000 | [diff] [blame] | 68 | .Fn zip_strerror |
Dieter Baron | c1ef259 | 2004-12-03 15:23:10 +0000 | [diff] [blame] | 69 | or |
| 70 | .Fn zip_file_strerror |
| 71 | are more convenient. |
Thomas Klausner | cbbac88 | 2003-12-27 22:25:58 +0000 | [diff] [blame] | 72 | .Sh RETURN VALUES |
Thomas Klausner | 2e874fb | 2004-11-24 16:18:03 +0000 | [diff] [blame] | 73 | .Fn zip_error_to_str |
Thomas Klausner | cbbac88 | 2003-12-27 22:25:58 +0000 | [diff] [blame] | 74 | returns the number of characters that would have been written to a |
| 75 | sufficiently sized |
| 76 | .Ar buf , |
| 77 | excluding the terminating NUL character. |
| 78 | .Sh SEE ALSO |
Thomas Klausner | bec1cfe | 2005-06-09 18:50:27 +0000 | [diff] [blame] | 79 | .Xr libzip 3 , |
Dieter Baron | c1ef259 | 2004-12-03 15:23:10 +0000 | [diff] [blame] | 80 | .Xr zip_error_get 3 , |
Thomas Klausner | eb23957 | 2004-12-22 15:49:20 +0000 | [diff] [blame] | 81 | .Xr zip_error_get_sys_type 3 , |
Dieter Baron | c1ef259 | 2004-12-03 15:23:10 +0000 | [diff] [blame] | 82 | .Xr zip_file_error_get 3 , |
| 83 | .Xr zip_file_strerror 3 , |
Thomas Klausner | cbbac88 | 2003-12-27 22:25:58 +0000 | [diff] [blame] | 84 | .Xr zip_open 3 , |
Thomas Klausner | e9f5c29 | 2004-12-22 16:37:48 +0000 | [diff] [blame] | 85 | .Xr zip_strerror 3 |
Thomas Klausner | a456cf5 | 2005-06-09 21:13:13 +0000 | [diff] [blame] | 86 | .Sh AUTHORS |
| 87 | .An -nosplit |
| 88 | .An Dieter Baron Aq dillo@giga.or.at |
Thomas Klausner | 39b5f9e | 2005-06-09 21:14:54 +0000 | [diff] [blame^] | 89 | and |
Thomas Klausner | a456cf5 | 2005-06-09 21:13:13 +0000 | [diff] [blame] | 90 | .An Thomas Klausner Aq tk@giga.or.at |