Differences between revisions 8 and 9
Revision 8 as of 2008-01-22 17:49:17
Size: 1846
Editor: MiriamRuiz
Revision 9 as of 2008-01-22 17:54:28
Size: 1959
Editor: MiriamRuiz
Deletions are marked like this. Additions are marked like this.
Line 11: Line 11:
 * [http://www.dsource.org/projects/tioport tioport]: Java to D convertion of whole libraries and applications.

Bindings for the D programming language

HOWTO: generate a D binding from a C library

Now, let's generate a binding for libalsaplayer (for example):

  • mkdir tmp; cd tmp
  • for i /usr/include/alsaplayer/*.h ; do echo $i && bcdgen $i alsaplayer -C -b ; done

bcdgen $1 $2 will generate a binding for $1 header file in a $2 module, so all alsaplayer D headers will have to be included from alsaplayer.*;

-C option tell bcdgen this is a C header, and -b avoid 'bcd.' prefix for modules name.

You'll find your binding in ./bcd/$2 :-)