direct-io.hg

view xen/tools/compat-build-header.py @ 15534:da4c76340184

NativeDom 1:1 support for x86_64, 32bitbios reloc bug fix
author Guy Zana <guy@neocleus.com>
date Wed Sep 19 10:51:46 2007 +0200 (2007-09-19)
parents 78b7ec4e7b86
children
line source
1 #!/usr/bin/python
3 import re,sys
5 pats = [
6 [ r"__InClUdE__(.*)", r"#include\1\n#pragma pack(4)" ],
7 [ r"\"xen-compat.h\"", r"<public/xen-compat.h>" ],
8 [ r"(struct|union|enum)\s+(xen_?)?(\w)", r"\1 compat_\3" ],
9 [ r"@KeeP@", r"" ],
10 [ r"_t([^\w]|$)", r"_compat_t\1" ],
11 [ r"(8|16|32|64)_compat_t([^\w]|$)", r"\1_t\2" ],
12 [ r"(^|[^\w])xen_?(\w*)_compat_t([^\w]|$$)", r"\1compat_\2_t\3" ],
13 [ r"(^|[^\w])XEN_?", r"\1COMPAT_" ],
14 [ r"(^|[^\w])Xen_?", r"\1Compat_" ],
15 [ r"(^|[^\w])long([^\w]|$$)", r"\1int\2" ]
16 ];
18 for line in sys.stdin.readlines():
19 for pat in pats:
20 line = re.subn(pat[0], pat[1], line)[0]
21 print line.rstrip()