1 |
|
2 |
missing = file('missing.txt').read().strip().split('\n') |
3 |
print "FIXING",len(missing),"SYMBOL DECLARATIONS" |
4 |
|
5 |
import re |
6 |
pattern = '^extern (.*)\\b('+"|".join(missing)+')\\b' |
7 |
#pattern = '^extern (.*) (BitListEmpty)\(' |
8 |
patt = re.compile(pattern, re.M) |
9 |
|
10 |
|
11 |
print "PATTERN =",pattern |
12 |
|
13 |
import glob |
14 |
import os.path |
15 |
|
16 |
files = [os.path.normpath(p) for p in glob.glob("../../../base/generic/*/*.h")] |
17 |
#files = ['testfile.h'] |
18 |
|
19 |
import fileinput |
20 |
|
21 |
n=0 |
22 |
for f in files: |
23 |
s = file(f).read() |
24 |
if patt.search(s): |
25 |
print "MATCHED IN",f |
26 |
s = patt.sub('ASC_DLLSPEC(\\1) \\2',s) |
27 |
n += 1 |
28 |
fp = open(f,'w') |
29 |
fp.write(s) |
30 |
fp.close() |
31 |
|
32 |
print "MATCHED",n,"FILES" |