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