1 1.1 joerg #!/bin/sh 2 1.1.1.4 joerg # $NetBSD: errlist.sh,v 1.1.1.4 2009/04/04 23:26:03 joerg Exp $ 3 1.1 joerg 4 1.1 joerg printf "static struct fetcherr $1[] = {\n" 5 1.1 joerg while read code type msg; do 6 1.1 joerg [ "${code}" = "#" ] && continue 7 1.1 joerg printf "\t{ ${code}, FETCH_${type}, \"${msg}\" },\n" 8 1.1 joerg done < $3 9 1.1 joerg 10 1.1 joerg printf "\t{ -1, FETCH_UNKNOWN, \"Unknown $2 error\" }\n" 11 1.1 joerg printf "};\n" 12