DEADSOFTWARE

fdefe880b45229122b564cee1ae0fcc591c8745d
[bbcp.git] / BlackBox / _OpenBSD_ / Lin / Mod / gen-Libc / mkdumpstrerrno.py
1 #! /usr/bin/env python2.7
3 import sys
5 def main ():
6 r = []
7 while True:
8 line = sys.stdin.readline()
9 if line == '':
10 break
11 s = line.split()[0][:-1]
12 r.append("\tD(\"%s\", %s)" % (s, s))
14 print """/* this file was generated automatically */
16 #include <errno.h>
17 #include <stdio.h>
19 static void D (const char *s, int e)
20 {
21 printf("%%s, %%s\\n", s, strerror(e));
22 }
24 int main (int argc, const char *argv[])
25 {
26 %s;
28 return 0;
29 }""" % (';\n'.join(r),)
31 if __name__ == '__main__':
32 main()