Update.
[glibc.git] / mach / errsystems.awk
blobc5cc5302b4386271a9ade84b55e0723a150805ee
1 BEGIN {
2 print "#include <mach/error.h>\n#include <errorlib.h>";
3 print "#define static static const"
4 nsubs = split(subsys, subs);
5 while (nsubs > 0) printf "#include \"%s\"\n", subs[nsubs--];
6 print "\n\n\
7 const struct error_system __mach_error_systems[err_max_system + 1] =";
8 print " {";
10 /^static.*err_[a-z0-9A-Z_]+_sub *\[/ {
11 s = $0; sub(/^.*err_/, "", s); sub(/_sub.*$/, "", s);
12 printf " [err_get_system (err_%s)] = { errlib_count (err_%s_sub),",
13 s, s;
14 printf "\"(system %s) error with unknown subsystem\", err_%s_sub },\n",
15 s, s;
17 END {
18 print " };";
19 printf "\n\
20 const int __mach_error_system_count = errlib_count (__mach_error_systems);";