ia64/xen-unstable

view xen/tools/compat-build-header.py @ 13647:057c4c2991fa

32-on-64: Fix an one-off error in compat_addr_ok().
Signed-off-by: Jan Beulich <jbeulich@novell.com>
author kaf24@localhost.localdomain
date Fri Jan 26 13:36:52 2007 +0000 (2007-01-26)
parents b61be7771104
children 78b7ec4e7b86
line source
1 #!/usr/bin/python
3 import re,sys
5 pats = [
6 [ r"__InClUdE__", r"#include" ],
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()