about summary refs log tree commit diff
path: root/mach/errsystems.awk
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-02-18 01:27:10 +0000
committerRoland McGrath <roland@gnu.org>1995-02-18 01:27:10 +0000
commit28f540f45bbacd939bfd07f213bcad2bf730b1bf (patch)
tree15f07c4c43d635959c6afee96bde71fb1b3614ee /mach/errsystems.awk
downloadglibc-28f540f45bbacd939bfd07f213bcad2bf730b1bf.tar.gz
glibc-28f540f45bbacd939bfd07f213bcad2bf730b1bf.tar.xz
glibc-28f540f45bbacd939bfd07f213bcad2bf730b1bf.zip
initial import
Diffstat (limited to 'mach/errsystems.awk')
-rw-r--r--mach/errsystems.awk21
1 files changed, 21 insertions, 0 deletions
diff --git a/mach/errsystems.awk b/mach/errsystems.awk
new file mode 100644
index 0000000000..c5cc5302b4
--- /dev/null
+++ b/mach/errsystems.awk
@@ -0,0 +1,21 @@
+BEGIN {
+  print "#include <mach/error.h>\n#include <errorlib.h>";
+  print "#define static static const"
+  nsubs = split(subsys, subs);
+  while (nsubs > 0) printf "#include \"%s\"\n", subs[nsubs--];
+  print "\n\n\
+const struct error_system __mach_error_systems[err_max_system + 1] =";
+  print "  {";
+}
+/^static.*err_[a-z0-9A-Z_]+_sub *\[/ {
+  s = $0; sub(/^.*err_/, "", s); sub(/_sub.*$/, "", s);
+  printf "    [err_get_system (err_%s)] = { errlib_count (err_%s_sub),",
+	s, s;
+  printf "\"(system %s) error with unknown subsystem\", err_%s_sub },\n",
+	s, s;
+}
+END {
+  print "  };";
+  printf "\n\
+const int __mach_error_system_count = errlib_count (__mach_error_systems);";
+}