cpython-withatomic / Tools / bgen /

The branch 'legacy-trunk' does not exist.
Filename Size Date modified Message
2.1 KB
BGEN -- An Experiment: Automatic Generation of Extension Modules

This directory contains BGEN -- a package that helps in generating
complete source code for Python extension module.  It currently also
contains a set of examples that were generated with BGEN.  These
examples are mostly interfaces to a number of important managers in
the Macintosh toolbox.

Overview of Subdirectories

Main subdirectories:

bgen	the code generator package

Example subdirectories:

ae	AppleEvents
ctl	Controls
dlg	Dialogs
evt	Events
menu	Menus
qd	QuickDraw
res	Resources
snd	Sound
win	Windows

Contents of Subdirectories

The contents of each example subdirectory is similar (<Foobar> is
for instance AppleEvents, while <foo> is ae):

<foo>	Scan the <Foobar>.h header, generating <foo>
<foo>	Output of <foo>, input for <foo>
<foo>	Manually written complement of <foo>, sometimes
<foo>	Generate <Foo>module.c from <foo> and <foo>
<Foo>module.c	The interface module, ready to be compiled
<Foobar>.py	Symbolic constants extracted from <Foobar.h>

Tests and Examples

Other files in these subdirectories are usually examples using the
extension.  If there's a file t<foo>.py, it usually is a really
boring test program.

Some test programs contain pathnames that should be edited before
trying them.

Some of the less boring tests and examples:

At the top level:		Application mainloop, uses most Mac extensions

In ae:	Conversions between AE and Python data type		Dummy AE server, echoes all data back		Primitive AE client		Decode 'aete' and 'aeut' resources (incomplete)

In res:	List *all* resources in current and in all res files	Copy a resource file	Read "errors.txt" and create a set of "Estr" resources

In snd:	Play an AIFF file	Turn text into Morse code	The standard extended with Mac support	The Mac support for