summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2010-03-27 16:51:55 +0000
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2010-03-27 16:51:55 +0000
commit6924bffe2196b85e76cc8a2be378c84219839dd9 (patch)
tree5c1c657fe1eab7090732f4760f6abd71d9f0efe4 /tools
parent15a74effe6f9501092d1dbcf078deb9d8e5c8088 (diff)
downloadlasso-6924bffe2196b85e76cc8a2be378c84219839dd9.tar.gz
lasso-6924bffe2196b85e76cc8a2be378c84219839dd9.tar.xz
lasso-6924bffe2196b85e76cc8a2be378c84219839dd9.zip
Tools: add script to check for missing functions in lasso-sections.txt
Diffstat (limited to 'tools')
-rwxr-xr-xtools/check-lasso-sections.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/tools/check-lasso-sections.py b/tools/check-lasso-sections.py
new file mode 100755
index 00000000..85798826
--- /dev/null
+++ b/tools/check-lasso-sections.py
@@ -0,0 +1,39 @@
+#!/usr/bin/python
+
+import sys
+import os.path
+import re
+
+source=sys.argv[1]
+lasso_sections_txt=sys.argv[2]
+
+methods=[]
+
+for dirpath, dirnames, filenames in os.walk(source):
+ for filename in filenames:
+ _, ext = os.path.splitext(filename)
+ lines = list(file(os.path.join(dirpath, filename)))
+ while lines:
+ line, lines = lines[0], lines[1:]
+ line=line.strip()
+ if line.startswith('LASSO_EXPORT'):
+ while not ';' in line:
+ line=line.strip()
+ line, lines = line + lines[0], lines[1:]
+ line=line.strip()
+ m=re.match(r'LASSO_EXPORT[^(]*[ \t*](\w+)\s*\(', line)
+ if m:
+ methods.append(m.group(1))
+
+lasso_sections_txt=file(lasso_sections_txt).read()
+
+print ' = Methods missing from lasso-sections.txt =\n'
+for method in methods:
+ if not method in lasso_sections_txt:
+ print method
+
+print ' = Methods in lasso-sections.txt which does not exist anymore = \n'
+for line in lasso_sections_txt.splitlines():
+ if line.startswith('lasso_'):
+ if line not in methods:
+ print line