blob: 95bf1bb1143dc17a456e6024b9c0197e12bacd61 [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
Jack Jansen0c4d9471998-04-17 14:07:56 +00006import sys
7import os
8BGENDIR=os.path.join(sys.prefix, ':Tools:bgen:bgen')
9sys.path.append(BGENDIR)
Jack Jansenda6a9711996-04-12 16:25:30 +000010from scantools import Scanner
11from bgenlocations import TOOLBOXDIR
12
13LONG = "Scrap"
14SHORT = "Scrap"
15
16def main():
17 input = "Scrap.h"
18 output = SHORT + "gen.py"
19 defsoutput = "@Scrap.py"
20 scanner = MyScanner(input, output, defsoutput)
21 scanner.scan()
22 scanner.close()
23 print "=== Done scanning and generating, now importing the generated code... ==="
24 exec "import " + SHORT + "support"
25 print "=== Done. It's up to you to compile it now! ==="
26
27class MyScanner(Scanner):
28
29 def destination(self, type, name, arglist):
30 classname = "Function"
31 listname = "functions"
32 return classname, listname
33
34 def makeblacklistnames(self):
35 return [
36 ]
37
38 def makeblacklisttypes(self):
39 return [
40 ]
41
42 def makerepairinstructions(self):
43 return [
44 ([('void', '*', 'OutMode')], [('putscrapbuffer', '*', 'InMode')]),
45 ]
46
47if __name__ == "__main__":
48 main()