Dieter Baron | 6360c00 | 2004-12-22 17:01:27 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Dieter Baron | cd55f27 | 2005-01-20 21:03:36 +0000 | [diff] [blame] | 3 | # $NiH: make_zip_errors.sh,v 1.2 2004/12/26 14:21:06 dillo Exp $ |
Dieter Baron | 6360c00 | 2004-12-22 17:01:27 +0000 | [diff] [blame] | 4 | # |
| 5 | # make_zip_errrors.sh: create zip_errors.mdoc from zip.h |
Dieter Baron | cd55f27 | 2005-01-20 21:03:36 +0000 | [diff] [blame] | 6 | # Copyright (C) 1999, 2003, 2004, 2005 Dieter Baron and Thomas Klausner |
Dieter Baron | 6360c00 | 2004-12-22 17:01:27 +0000 | [diff] [blame] | 7 | # |
| 8 | # This file is part of libzip, a library to manipulate ZIP archives. |
| 9 | # The authors can be contacted at <nih@giga.or.at> |
| 10 | # |
| 11 | # Redistribution and use in source and binary forms, with or without |
| 12 | # modification, are permitted provided that the following conditions |
| 13 | # are met: |
| 14 | # 1. Redistributions of source code must retain the above copyright |
| 15 | # notice, this list of conditions and the following disclaimer. |
| 16 | # 2. Redistributions in binary form must reproduce the above copyright |
| 17 | # notice, this list of conditions and the following disclaimer in |
| 18 | # the documentation and/or other materials provided with the |
| 19 | # distribution. |
| 20 | # 3. The names of the authors may not be used to endorse or promote |
| 21 | # products derived from this software without specific prior |
| 22 | # written permission. |
| 23 | # |
| 24 | # THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS |
| 25 | # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 26 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 27 | # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY |
| 28 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 29 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE |
| 30 | # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 31 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER |
| 32 | # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| 33 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| 34 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 35 | |
| 36 | |
| 37 | if [ "$#" -ne 2 ] |
| 38 | then |
| 39 | echo "Usage: $0 in_file out_file" >&2 |
| 40 | echo " e.g. $0 zip.h zip_err_str.c" >&2 |
| 41 | exit 1 |
| 42 | fi |
| 43 | |
| 44 | if [ "$1" = "$2" ] |
| 45 | then |
| 46 | echo "$0: error: output file = input file" >&2 |
| 47 | exit 1 |
| 48 | fi |
| 49 | |
Dieter Baron | cd55f27 | 2005-01-20 21:03:36 +0000 | [diff] [blame] | 50 | rcsid=`echo '$NiH: make_zip_errors.sh,v 1.2 2004/12/26 14:21:06 dillo Exp $' | tr -d '$'` |
Dieter Baron | 6360c00 | 2004-12-22 17:01:27 +0000 | [diff] [blame] | 51 | inrcsid=`sed -n 's/^ \$\([^$]*[^ ]\) *\$$/\1/p' "$1"` |
| 52 | date=`date '+%B %e, %Y' | sed 's/ / /'` |
| 53 | |
| 54 | cat <<EOF >> "$2.$$" || exit 1 |
| 55 | .\" \$NiH\$ |
| 56 | .\" |
| 57 | .\" zip_errors.mdoc -- list of all libzip error codes |
Dieter Baron | cd55f27 | 2005-01-20 21:03:36 +0000 | [diff] [blame] | 58 | .\" Copyright (C) 2004, 2005 Dieter Baron and Thomas Klausner |
Dieter Baron | 6360c00 | 2004-12-22 17:01:27 +0000 | [diff] [blame] | 59 | .\" |
| 60 | .\" This file is part of libzip, a library to manipulate ZIP archives. |
| 61 | .\" The authors can be contacted at <nih@giga.or.at> |
| 62 | .\" |
| 63 | .\" Redistribution and use in source and binary forms, with or without |
| 64 | .\" modification, are permitted provided that the following conditions |
| 65 | .\" are met: |
| 66 | .\" 1. Redistributions of source code must retain the above copyright |
| 67 | .\" notice, this list of conditions and the following disclaimer. |
| 68 | .\" 2. Redistributions in binary form must reproduce the above copyright |
| 69 | .\" notice, this list of conditions and the following disclaimer in |
| 70 | .\" the documentation and/or other materials provided with the |
| 71 | .\" distribution. |
| 72 | .\" 3. The names of the authors may not be used to endorse or promote |
| 73 | .\" products derived from this software without specific prior |
| 74 | .\" written permission. |
| 75 | .\" |
Dieter Baron | 5892293 | 2004-12-26 14:21:06 +0000 | [diff] [blame] | 76 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS \`\`AS IS'' AND ANY EXPRESS |
Dieter Baron | 6360c00 | 2004-12-22 17:01:27 +0000 | [diff] [blame] | 77 | .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 78 | .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 79 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY |
| 80 | .\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 81 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE |
| 82 | .\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 83 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER |
| 84 | .\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| 85 | .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| 86 | .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 87 | .\" |
| 88 | .\" This file was generated automatically by $0 |
| 89 | .\" from $1; make changes there. |
| 90 | .\" $rcsid |
| 91 | .\" $inrcsid |
| 92 | .\" |
| 93 | .Dd $date |
| 94 | .Dt ZIP_ERRORS 3 |
| 95 | .Os |
| 96 | .Sh NAME |
| 97 | .Nm zip_errors |
| 98 | .Nd list of all libzip error codes |
| 99 | .Sh LIBRARY |
| 100 | libzip (-lzip) |
| 101 | .Sh SYNOPSIS |
| 102 | .In zip.h |
| 103 | .Sh DESCRIPTION |
| 104 | The following error codes are used by libzip: |
| 105 | .Bl -tag -width XZIPXERXCOMPNOTSUPPXX |
| 106 | EOF |
| 107 | |
| 108 | sed -n 's/^#define \(ZIP_ER_[A-Z_0-9]*\).*\/\* \(.\) \([^*]*\) \*\//.It Bq Er \1@\3./p' "$1" \ |
| 109 | | tr @ '\012' \ |
| 110 | >> "$2.$$" || exit 1 |
| 111 | |
| 112 | cat <<EOF >> "$2.$$" || exit 1 |
| 113 | .El |
| 114 | EOF |
| 115 | |
| 116 | mv "$2.$$" "$2" || exit 1 |