ia64/xen-unstable

view xen/tools/compat-build-header.py @ 18842:9be2fe3de567

shadow: fix the fix for promotion/resync race.

Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Nov 28 12:02:43 2008 +0000 (2008-11-28)
parents 08295dc13166
children
line source
1 #!/usr/bin/env 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()