Differences between revisions 1 and 8 (spanning 7 versions)
Revision 1 as of 2007-09-05 20:53:19
Size: 423
Editor: MiriamRuiz
Comment:
Revision 8 as of 2008-01-22 17:49:17
Size: 1846
Editor: MiriamRuiz
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
 * [http://www.dsource.org/projects/bindings Bindings]: Bunch of C language bindings for the D Programming Language.
Line 4: Line 5:
 * [http://dronten.googlepages.com/fltk4d fltk4d]: binding to the gui library FLTK for the D programming language.
 * [http://shinh.skr.jp/d/porting.html D - porting]: SDL and OpenGL bindings.
Line 6: Line 9:
 * [http://www.dsource.org/projects/derelict Derelict]: Collection of D bindings to C shared (dynamic) libraries which are useful for multimedia applications.
 * [http://code.google.com/p/dlua/ dlua]: Lua bindings for the D programming language.

== HOWTO: generate a D binding from a C library ==

 * Install gdc: apt-get install gdc-4.1
 * Get dsss from mentors: dget -x http://mentors.debian.net/debian/pool/main/d/dsss/dsss_0.72.1-1.dsc
 * Build it with fakeroot debian/rules binary and install it
 * Get BCD: svn co http://svn.dsource.org/projects/bcd/trunk/bcd.gen
 * Build it with dsss build and put the bcdgen executable in your PATH

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 :-)

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 :-)