blob: 0bad7c264b4514adba6d05b723028d30cc0b0a7d [file] [log] [blame]
Jack Jansenda6a9711996-04-12 16:25:30 +00001# Scan an Apple header file, generating a Python file of generator calls.
2#
3# Note that the scrap-manager include file is so weird that this
4# generates a boilerplate to be edited by hand.
5
6import addpack
7addpack.addpack(':tools:bgen:bgen')
8from scantools import Scanner
9from bgenlocations import TOOLBOXDIR
10
11LONG = "Scrap"
12SHORT = "Scrap"
13
14def main():
15 input = "Scrap.h"
16 output = SHORT + "gen.py"
17 defsoutput = "@Scrap.py"
18 scanner = MyScanner(input, output, defsoutput)
19 scanner.scan()
20 scanner.close()
21 print "=== Done scanning and generating, now importing the generated code... ==="
22 exec "import " + SHORT + "support"
23 print "=== Done. It's up to you to compile it now! ==="
24
25class MyScanner(Scanner):
26
27 def destination(self, type, name, arglist):
28 classname = "Function"
29 listname = "functions"
30 return classname, listname
31
32 def makeblacklistnames(self):
33 return [
34 ]
35
36 def makeblacklisttypes(self):
37 return [
38 ]
39
40 def makerepairinstructions(self):
41 return [
42 ([('void', '*', 'OutMode')], [('putscrapbuffer', '*', 'InMode')]),
43 ]
44
45if __name__ == "__main__":
46 main()