summaryrefslogtreecommitdiff
path: root/lib/errnolist.a
diff options
context:
space:
mode:
Diffstat (limited to 'lib/errnolist.a')
-rw-r--r--lib/errnolist.a52
1 files changed, 52 insertions, 0 deletions
diff --git a/lib/errnolist.a b/lib/errnolist.a
new file mode 100644
index 0000000..a548a11
--- /dev/null
+++ b/lib/errnolist.a
@@ -0,0 +1,52 @@
+# $Id: errnolist.a,v 3.0 1993/08/18 12:04:35 ram Exp $
+#
+# Copyright (c) 1991-1993, Raphael Manfredi
+#
+# You may redistribute only under the terms of the Artistic Licence,
+# as specified in the README file that comes with the distribution.
+# You may reuse parts of this distribution only within the terms of
+# that same Artistic Licence; a copy of which may be found at the root
+# of the source tree for dist 3.0.
+#
+# Original Author: Harlan Stenn <harlan@mumps.pfcs.com>
+#
+# $Log: errnolist.a,v $
+# Revision 3.0 1993/08/18 12:04:35 ram
+# Baseline for dist 3.0 netwide release.
+#
+#
+# This is a simple-minded awk script to generate an initialization for
+# sys_errnolist on systems that don't have it.
+# This file now depends only on sys/errno.h error numbers under maxerr being
+# in order. It will complain and die if not. NOTE: It will still produce
+# a compilable output file, even with errors, so you must check the output.
+
+
+BEGIN {
+ format = "\t\"%s\",\n"
+ printf("/*\n** This is a generated file. Do NOT edit it unless you really have to...\n*/\n\n")
+ printf("char *sys_errnolist[] = {\n")
+ maxerr = 89
+ }
+
+$1=="#define" {
+ if(count > maxerr || substr($2,1,1) != "E")
+ next # we're not interested
+ if($3 < count) { # this is bad
+ printf("Fatal error: %s out of order at %s\n",\
+ FILENAME, $2)>"/dev/tty"
+ exit 1
+ }
+ # fill in the blanks
+ while($3 > count) {
+ dummy=sprintf("EDUMMY%d",count)
+ printf(format,dummy)
+ count++
+ }
+ printf(format,$2)
+ count++
+ }
+
+END {
+ printf("\t0\n};\n")
+ }