1BEGIN { 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\ 9const struct error_system __mach_error_systems[err_max_system + 1] ="; 10 print " {"; 11} 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; 18} 19END { 20 print " };"; 21 print "\n\ 22const int __mach_error_system_count = errlib_count (__mach_error_systems);"; 23} 24