From b2c4f1527f2d8a6731424ce009d8e604700e1043 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sat, 22 Jan 2000 18:10:43 +0000 Subject: 2000-01-05 Roland McGrath * sysdeps/mach/hurd/errnos.awk: Rediddle to collect lines and print them all at the end, eliding the final comma. * sysdeps/mach/hurd/bits/errno.h: Regenerated. --- sysdeps/mach/hurd/errnos.awk | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'sysdeps/mach/hurd/errnos.awk') diff --git a/sysdeps/mach/hurd/errnos.awk b/sysdeps/mach/hurd/errnos.awk index d40c369477..9ec02ca7a0 100644 --- a/sysdeps/mach/hurd/errnos.awk +++ b/sysdeps/mach/hurd/errnos.awk @@ -1,4 +1,4 @@ -# Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc. +# Copyright (C) 1991,92,93,94,95,96,97,2000 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -38,6 +38,7 @@ BEGIN { in_math = 0; edom = erange = ""; print "#undef EDOM\n#undef ERANGE"; + lno = 0; } $1 == "@comment" && $2 == "errno.h" { errnoh=1; next } @@ -56,7 +57,7 @@ errnoh == 2 && $1 == "@deftypevr" && $2 == "Macro" && $3 == "int" \ errnoh == 3 && $1 == "@comment" && $2 == "errno" { if (e == "EWOULDBLOCK") { - print "#define EWOULDBLOCK EAGAIN /* Operation would block */"; + lines[lno++]="#define EWOULDBLOCK EAGAIN /* Operation would block */"; next; } errno = $3 + 0; @@ -70,8 +71,9 @@ errnoh == 3 && $1 == "@comment" && $2 == "errno" { edom = x; else if (e == "ERANGE") erange = x; - printf "\t%-16s= _HURD_ERRNO (%d),\n", e, errno; - print x; + comma[lno] = 1; + lines[lno++] = sprintf("\t%-16s= _HURD_ERRNO (%d)", e, errno); + lines[lno++] = x; next; } { errnoh=0 } @@ -79,12 +81,12 @@ errnoh == 3 && $1 == "@comment" && $2 == "errno" { NF == 3 && $1 == "#define" && $2 == "MACH_SEND_IN_PROGRESS" \ { in_mach_errors = FILENAME; - print "\n\t/* Errors from . */"; + lines[lno++] = "\n\t/* Errors from . */"; } NF == 3 && $1 == "#define" && $2 == "KERN_SUCCESS" \ { in_mach_errors = FILENAME; - print "\n\t/* Errors from . */"; + lines[lno++] = "\n\t/* Errors from . */"; next; } @@ -95,13 +97,14 @@ in_mach_errors != "" && $2 == "MACH_IPC_COMPAT" \ in_mach_errors == FILENAME && NF == 3 && $1 == "#define" \ { - printf "\t%-32s= %s,\n", "E" $2, $3; + comma[lno] = 1; + lines[lno++] = sprintf("\t%-32s= %s", "E" $2, $3); } $1 == "#define" && $2 == "_MACH_MIG_ERRORS_H_" \ { in_mig_errors = 1; - print "\n\t/* Errors from . */"; + lines[lno++] = "\n\t/* Errors from . */"; next; } in_mig_errors && $1 == "#endif" && $3 == "_MACH_MIG_ERRORS_H_" \ @@ -112,16 +115,17 @@ in_mig_errors && $1 == "#endif" && $3 == "_MACH_MIG_ERRORS_H_" \ (in_mig_errors && $1 == "#define" && $3 <= -300) || \ (in_device_errors && $1 == "#define") \ { - printf "%-32s", sprintf ("\t%-24s= %s,", "E" $2, $3); + comment = ""; for (i = 4; i <= NF; ++i) - printf " %s", $i; - printf "\n"; + comment = comment " " $i; + comma[lno] = 1; + lines[lno++] = sprintf("%-32s", sprintf ("\t%-24s= %s", "E" $2, $3)) comment; } $1 == "#define" && $2 == "D_SUCCESS" \ { in_device_errors = 1; - print "\n\t/* Errors from . */"; + lines[lno++] = "\n\t/* Errors from . */"; next; } in_device_errors && $1 == "#endif" \ @@ -132,6 +136,9 @@ in_device_errors && $1 == "#endif" \ END \ { + for (i = 0; i < lno - 1; ++i) + printf "%s%s\n", lines[i], (comma[i] ? "," : ""); + print lines[i]; print ""; print "};"; print ""; -- cgit 1.4.1