1 # Scan an Apple header file, generating a Python file of generator calls.
3 # Note that the scrap-manager include file is so weird that this
4 # generates a boilerplate to be edited by hand.
8 BGENDIR
=os
.path
.join(sys
.prefix
, ':Tools:bgen:bgen')
9 sys
.path
.append(BGENDIR
)
10 from scantools
import Scanner
11 from bgenlocations
import TOOLBOXDIR
18 output
= SHORT
+ "gen.py"
19 defsoutput
= "@Scrap.py"
20 scanner
= MyScanner(input, output
, defsoutput
)
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! ==="
27 class MyScanner(Scanner
):
29 def destination(self
, type, name
, arglist
):
30 classname
= "Function"
31 listname
= "functions"
32 return classname
, listname
34 def makeblacklistnames(self
):
38 def makeblacklisttypes(self
):
42 def makerepairinstructions(self
):
44 ([('void', '*', 'OutMode')], [('putscrapbuffer', '*', 'InMode')]),
47 if __name__
== "__main__":