aboutsummaryrefslogtreecommitdiffstats
path: root/src/mkerrnos.awk
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/mkerrnos.awk17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/mkerrnos.awk b/src/mkerrnos.awk
index 16c23b1..c4bbf81 100644
--- a/src/mkerrnos.awk
+++ b/src/mkerrnos.awk
@@ -1,5 +1,5 @@
# mkerrnos.awk
-# Copyright (C) 2003 g10 Code GmbH
+# Copyright (C) 2003, 2004 g10 Code GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -49,21 +49,26 @@
# error code in the table can be obtained after removing the system error
# code indication bit.
#
-# The input file is a list of possible system errors.
+# The input file is a list of possible system errors in the column errnoidx
+# (defaults to 2).
#
# Comments (starting with # and ending at the end of the line) are removed,
# as is trailing whitespace.
BEGIN {
+ FS="[\t]+";
+ header = 1;
+ if (errnoidx == 0)
+ errnoidx = 2;
+
print "/* Output of mkerrnos.awk. DO NOT EDIT. */";
print "";
- header = 1;
}
/^#/ { next; }
header {
- if ($1 ~ /^E/)
+ if ($1 ~ /^[0-9]/)
{
print "#include <errno.h>";
print "";
@@ -81,8 +86,8 @@ header {
if (/^$/)
next;
- print "#ifdef " $1;
- print " " $1 ",";
+ print "#ifdef " $errnoidx;
+ print " " $errnoidx ",";
print "#else";
print " 0,";
print "#endif";