Fix the last change. The variable still has to end in _data.
[glibc.git] / mach / errsystems.awk
blobb01c1bd0eb1d24b913d537aae88edf044867651a
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 print "\n\
20 const int __mach_error_system_count = errlib_count (__mach_error_systems);";