jsapigen generates glue code for embedding SpiderMonkey in C applications.
The following code is a snippet of an IDL file. Running jsapigen on this example generates glue code for integration with SpiderMonkey.
function void js_function : c_function (int=2);
This simple example only shows some of jsapigen's features. By now, the program covers roughly 90% of all possible scenarios and often it is possible to create the complete glue code automatically. jsapigen is intended to be used as a preprocessor for C source files and integrates perfectly with make.
jsapigen also saves you a lot of typing. Generated glue code in C is larger in size then its corresponding IDL description by an estimated factor of 20-50. For example, the one-liner above generates 37 lines of C code, plus another 32 lines with declarations and data structures.
With jsapigen, it is possible to generate most glue code automatically. The software can
The latest release is jsapigen 0.5.1. Some highlights are
The latest snapshot of jsapigen is available from Git. You can checkout the repository with the following command.
git clone git://jsapigen.git.sourceforge.net/gitroot/jsapigen/jsapigen
This creates the directory jsapigen in your current working directory which contains a copy of the latest master branch from the public Git repository.
A manual for jsapigen 0.5.1 is available in the download section on SourceForge.net. A single-page version is available for online reading.
jsapigen is written and maintained by Thomas Zimmermann <firstname.lastname@example.org>. It is free software under the terms of the GNU General Public License, Version 3 or later. Of course, the generated source code is not covered by the GNU GPL, but a license of your choice.
Your are most welcome to contribute to this project. Patches, feature requests, etc. should be submitted via the project's page on SourceForge.net, or the mailing list <email@example.com>. This is also the preferred place for jsapigen-related discussions. If you are only interested in new releases please subscribe to <firstname.lastname@example.org>. If you need near-term help or just have a simple question, please join the IRC channel #jsapigen on irc.freenode.org.
Copyright © 2008-2010 Thomas Zimmermann