DEADSOFTWARE

synchronized with https://github.com/aixp/BlackBox
[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>
18 #include <string.h>
20 static void D (const char *s, int e)
21 {
22 printf("%%s, %%s\\n", s, strerror(e));
23 }
25 int main (int argc, const char *argv[])
26 {
27 %s;
29 return 0;
30 }""" % (';\n'.join(r),)
32 if __name__ == '__main__':
33 main()