summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2d657d6)
raw | patch | inline | side by side (parent: 2d657d6)
author | Alexander Shiryaev <aixp@mail.ru> | |
Wed, 14 Nov 2012 11:16:32 +0000 (15:16 +0400) | ||
committer | Alexander Shiryaev <aixp@mail.ru> | |
Wed, 14 Nov 2012 11:16:32 +0000 (15:16 +0400) |
Trurl-based/_OpenBSD_/Lin/Mod/gen-Libc/Makefile | patch | blob | history | |
Trurl-based/_OpenBSD_/Lin/Mod/gen-Libc/mkdumpstrerrno.py | [new file with mode: 0755] | patch | blob |
Trurl-based/_OpenBSD_/Lin/Mod/gen-Libc/mkstrerrnocase.py | [new file with mode: 0755] | patch | blob |
diff --git a/Trurl-based/_OpenBSD_/Lin/Mod/gen-Libc/Makefile b/Trurl-based/_OpenBSD_/Lin/Mod/gen-Libc/Makefile
index eb2d2450bee2ad43473e6f06c6156784a753c822..38d5ba86388ea69015e4acd6eeb4bcab1864264a 100644 (file)
DEFS = defs-errno defs-signal defs-sc defs-madv defs-siginfo defs-siginfo1 defs-sa defs-mman defs-fcntl defs-sig
-all: Libc.txt ${DEFS}
+all: Libc.txt ${DEFS} strerrnocase.txt
Libc.txt: Libc.txt.templ ${DEFS} sizeofs
${PY} ./untempl.py Libc.txt.templ ${.TARGET}
./dumpdefs.py 2 2 i /usr/include/sys/siginfo.h | grep SEGV_ >> ${.TARGET}
./dumpdefs.py 2 2 i /usr/include/sys/siginfo.h | grep BUS_ >> ${.TARGET}
+dumpstrerrno.c: defs-errno
+ grep -v ERESTART ${.ALLSRC} | grep -v EJUSTRETURN | ./mkdumpstrerrno.py > ${.TARGET}
+
+strerrnocase.txt: dumpstrerrno
+ ./dumpstrerrno | ./mkstrerrnocase.py > ${.TARGET}
+
clean:
- rm -f sizeofs ${DEFS} Libc.txt
+ rm -f sizeofs ${DEFS} Libc.txt dumpstrerrno dumpstrerrno.c strerrnocase.txt
diff --git a/Trurl-based/_OpenBSD_/Lin/Mod/gen-Libc/mkdumpstrerrno.py b/Trurl-based/_OpenBSD_/Lin/Mod/gen-Libc/mkdumpstrerrno.py
--- /dev/null
@@ -0,0 +1,32 @@
+#! /usr/bin/env python2.7
+
+import sys
+
+def main ():
+ r = []
+ while True:
+ line = sys.stdin.readline()
+ if line == '':
+ break
+ s = line.split()[0][:-1]
+ r.append("\tD(\"%s\", %s)" % (s, s))
+
+ print """/* this file was generated automatically */
+
+#include <errno.h>
+#include <stdio.h>
+
+static void D (const char *s, int e)
+{
+ printf("%%s, %%s\\n", s, strerror(e));
+}
+
+int main (int argc, const char *argv[])
+{
+%s;
+
+ return 0;
+}""" % (';\n'.join(r),)
+
+if __name__ == '__main__':
+ main()
diff --git a/Trurl-based/_OpenBSD_/Lin/Mod/gen-Libc/mkstrerrnocase.py b/Trurl-based/_OpenBSD_/Lin/Mod/gen-Libc/mkstrerrnocase.py
--- /dev/null
@@ -0,0 +1,17 @@
+#! /usr/bin/env python2.7
+
+import sys, string
+
+MOD = 'Libc'
+
+def main ():
+ while True:
+ line = sys.stdin.readline()
+ if line == '':
+ break
+ code, s = string.split(line.rstrip(), ', ', maxsplit=1)
+ s1 = s[0].lower() + s[1:]
+ print '| %s.%s: s := "%s, %s"' % (MOD, code, code, s1)
+
+if __name__ == '__main__':
+ main()