From b2c4f1527f2d8a6731424ce009d8e604700e1043 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sat, 22 Jan 2000 18:10:43 +0000 Subject: [PATCH] 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/bits/errno.h | 40 ++++++++++++++++++++-------------------- sysdeps/mach/hurd/errnos.awk | 31 +++++++++++++++++++------------ 2 files changed, 39 insertions(+), 32 deletions(-) diff --git a/sysdeps/mach/hurd/bits/errno.h b/sysdeps/mach/hurd/bits/errno.h index b8d6038..99d68b7 100644 --- a/sysdeps/mach/hurd/bits/errno.h +++ b/sysdeps/mach/hurd/bits/errno.h @@ -270,28 +270,28 @@ enum __error_t_codes EKERN_TERMINATED = 26, /* Errors from . */ - EMIG_TYPE_ERROR = -300, /* client type check failure */ - EMIG_REPLY_MISMATCH = -301, /* wrong reply message ID */ - EMIG_REMOTE_ERROR = -302, /* server detected error */ - EMIG_BAD_ID = -303, /* bad request message ID */ - EMIG_BAD_ARGUMENTS = -304, /* server type check failure */ - EMIG_NO_REPLY = -305, /* no reply should be sent */ - EMIG_EXCEPTION = -306, /* server raised exception */ - EMIG_ARRAY_TOO_LARGE = -307, /* array not large enough */ - EMIG_SERVER_DIED = -308, /* server died */ - EMIG_DESTROY_REQUEST = -309, /* destroy request with no reply */ + EMIG_TYPE_ERROR = -300 /* client type check failure */, + EMIG_REPLY_MISMATCH = -301 /* wrong reply message ID */, + EMIG_REMOTE_ERROR = -302 /* server detected error */, + EMIG_BAD_ID = -303 /* bad request message ID */, + EMIG_BAD_ARGUMENTS = -304 /* server type check failure */, + EMIG_NO_REPLY = -305 /* no reply should be sent */, + EMIG_EXCEPTION = -306 /* server raised exception */, + EMIG_ARRAY_TOO_LARGE = -307 /* array not large enough */, + EMIG_SERVER_DIED = -308 /* server died */, + EMIG_DESTROY_REQUEST = -309 /* destroy request with no reply */, /* Errors from . */ - ED_IO_ERROR = 2500, /* hardware IO error */ - ED_WOULD_BLOCK = 2501, /* would block, but D_NOWAIT set */ - ED_NO_SUCH_DEVICE = 2502, /* no such device */ - ED_ALREADY_OPEN = 2503, /* exclusive-use device already open */ - ED_DEVICE_DOWN = 2504, /* device has been shut down */ - ED_INVALID_OPERATION = 2505, /* bad operation for device */ - ED_INVALID_RECNUM = 2506, /* invalid record (block) number */ - ED_INVALID_SIZE = 2507, /* invalid IO size */ - ED_NO_MEMORY = 2508, /* memory allocation failure */ - ED_READ_ONLY = 2509, /* device cannot be written to */ + ED_IO_ERROR = 2500 /* hardware IO error */, + ED_WOULD_BLOCK = 2501 /* would block, but D_NOWAIT set */, + ED_NO_SUCH_DEVICE = 2502 /* no such device */, + ED_ALREADY_OPEN = 2503 /* exclusive-use device already open */, + ED_DEVICE_DOWN = 2504 /* device has been shut down */, + ED_INVALID_OPERATION = 2505 /* bad operation for device */, + ED_INVALID_RECNUM = 2506 /* invalid record (block) number */, + ED_INVALID_SIZE = 2507 /* invalid IO size */, + ED_NO_MEMORY = 2508 /* memory allocation failure */, + ED_READ_ONLY = 2509 /* device cannot be written to */ }; diff --git a/sysdeps/mach/hurd/errnos.awk b/sysdeps/mach/hurd/errnos.awk index d40c369..9ec02ca 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 ""; -- 2.7.4