File: errsystems.awk

package info (click to toggle)
glibc 2.31-13%2Bdeb11u3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 278,368 kB
  • sloc: ansic: 1,025,361; asm: 256,790; makefile: 12,097; sh: 10,548; python: 9,618; cpp: 5,233; awk: 1,956; perl: 514; yacc: 290; pascal: 182; sed: 73
file content (23 lines) | stat: -rw-r--r-- 714 bytes parent folder | download | duplicates (43)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
BEGIN {
  print "#include <errno.h>";
  print "#include <mach/error.h>";
  print "#include <errorlib.h>";
  print "#define static static const";
  nsubs = split(subsys, subs);
  while (nsubs > 0) printf "#include \"%s\"\n", subs[nsubs--];
  print "\n\n\
const struct error_system __mach_error_systems[err_max_system + 1] =";
  print "  {";
}
/^static.*err_[a-z0-9A-Z_]+_sub *\[/ {
  s = $0; sub(/^.*err_/, "", s); sub(/_sub.*$/, "", s);
  printf "    [err_get_system (err_%s)] = { errlib_count (err_%s_sub),",
	s, s;
  printf "\"(system %s) error with unknown subsystem\", err_%s_sub },\n",
	s, s;
}
END {
  print "  };";
  print "\n\
const int __mach_error_system_count = errlib_count (__mach_error_systems);";
}