about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/gnu/errlist.awk21
-rw-r--r--sysdeps/mach/hurd/errnos.awk22
2 files changed, 11 insertions, 32 deletions
diff --git a/sysdeps/gnu/errlist.awk b/sysdeps/gnu/errlist.awk
index c91da60694..d5a0555114 100644
--- a/sysdeps/gnu/errlist.awk
+++ b/sysdeps/gnu/errlist.awk
@@ -16,10 +16,8 @@
 # <http://www.gnu.org/licenses/>.
 
 # errno.texi contains lines like:
-# @comment errno.h
-# @comment POSIX.1: Function not implemented
 # @deftypevr Macro int ENOSYS
-# @comment errno 78
+# @errno{ENOSYS, 78, Function not implemented}
 # Descriptive paragraph...
 # @end deftypevr
 
@@ -61,22 +59,14 @@ BEGIN {
     print "    [0] = N_(\"Success\"),"
   }
 
-$1 == "@comment" && $2 == "errno.h" { errnoh=1; next }
-errnoh == 1 && $1 == "@comment" \
+/^@errno\{/ \
   {
-    ++errnoh;
     etext = $3;
     for (i = 4; i <= NF; ++i)
       etext = etext " " $i;
-    next;
-  }
-errnoh == 2 && $1 == "@deftypevr" && $2 == "Macro" && $3 == "int" \
-  {
-    e = $4; errnoh++; next;
-  }
-errnoh == 3 && $1 == "@comment" && $2 == "errno" \
-  {
-    errno = $3 + 0;
+    etext = substr(etext, 1, length(etext)-1)
+    e = substr($1, 8, length($1)-8)
+    errno = substr($2, 1, length($2)-1) + 0
     if (alias[e])
       printf "#if defined (%s) && %s != %s\n", e, e, alias[e];
     else
@@ -102,7 +92,6 @@ errnoh == 4 \
     # This magic tag in C comments gets them copied into libc.pot.
     desc = desc "\nTRANS" ($0 != "" ? " " : "") $0; next
   }
-{ errnoh=0 }
 END {
   print "  };";
   print "";
diff --git a/sysdeps/mach/hurd/errnos.awk b/sysdeps/mach/hurd/errnos.awk
index a20815fa17..1cd2a0ac96 100644
--- a/sysdeps/mach/hurd/errnos.awk
+++ b/sysdeps/mach/hurd/errnos.awk
@@ -16,10 +16,7 @@
 # <http://www.gnu.org/licenses/>.
 
 # errno.texinfo contains lines like:
-# @comment errno.h
-# @comment POSIX.1: Function not implemented
-# @deftypevr Macro int ENOSYS
-# @comment errno 123
+# @errno{ENOSYS, 123, Function not implemented}
 
 BEGIN {
     print "/* This file generated by errnos.awk.  */";
@@ -39,7 +36,6 @@ BEGIN {
     print "\t   value.  */";
     print "\tESUCCESS = 0,"
     print "";
-    errnoh = 0;
     maxerrno = 0;
     in_mach_errors = "";
     in_math = 0;
@@ -48,26 +44,21 @@ BEGIN {
     lno = 0;
   }
 
-$1 == "@comment" && $2 == "errno.h" { errnoh=1; next }
-$1 == "@comment" && errnoh == 1 \
+/^@errno\{/ \
   {
-    ++errnoh;
     etext = "";
     for (i = 3; i <= NF; ++i)
       etext = etext " " $i;
-    next;
-  }
+    etext = substr(etext, 1, length(etext)-1)
 
-errnoh == 2 && $1 == "@deftypevr"  && $2 == "Macro" && $3 == "int" \
-  { ++errnoh; e = $4; next; }
-
-errnoh == 3 && $1 == "@comment" && $2 == "errno" {
+    e = substr($1, 8, length($1)-8)
     if (e == "EWOULDBLOCK")
       {
 	lines[lno++]="#define EWOULDBLOCK EAGAIN /* Operation would block */";
 	next;
       }
-    errno = $3 + 0;
+
+    errno = substr($2, 1, length($2)-1) + 0
     if (errno == 0)
       next;
     if (errno > maxerrno) maxerrno = errno;
@@ -83,7 +74,6 @@ errnoh == 3 && $1 == "@comment" && $2 == "errno" {
     lines[lno++] = x;
     next;
   }
-{ errnoh=0 }
 
 NF == 3 && $1 == "#define" && $2 == "MACH_SEND_IN_PROGRESS" \
   {