]> git.ipfire.org Git - thirdparty/glibc.git/blame - mach/errsystems.awk
time/tst-strftime2.c: Make the file easier to maintain
[thirdparty/glibc.git] / mach / errsystems.awk
CommitLineData
28f540f4 1BEGIN {
b0104b6f
RM
2 print "#include <errno.h>";
3 print "#include <mach/error.h>";
4 print "#include <errorlib.h>";
5 print "#define static static const";
28f540f4
RM
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 " };";
8a0746ae 21 print "\n\
28f540f4
RM
22const int __mach_error_system_count = errlib_count (__mach_error_systems);";
23}