Additions to C Bindings

Robin Stocker robin at nibor.org
Wed Mar 16 00:15:12 CET 2011


Scott Wheeler wrote:
> On Mar 7, 2011, at 5:11 AM, Christopher O'Neill wrote:
> 
> > Hi all,
> >
> > 	I have been working here and there on a project which uses taglib
> > with the C bindings. I noticed that much of the functionality of
> > the C++ is not accessible through the C bindings (particularly,
> > access to many of the common tags, and to album artwork). I have
> > added some code to tag_c.h and tag_c.cpp to allow access to these
> > items (including album artwork) from the C bindings. I was
> > wondering if it is possible/desirable to submit my additions, and if
> > so how to go about doing it.
> 
> One nice side effect of the move to github is that it should be
> relatively easy to track these sorts of things as a fork at first that
> can be pulled at will either the project proper or other people
> looking through the list of taglib forks.
> 
> I'm kind of on the fence personally about whether or not it makes
> sense to extend the canonical C bindings beyond the most basic stuff
> without going the whole way and having complete bindings. Might be
> useful for some of the other folks actually using the C bindings to
> chime in...

Hi there,

Complete C bindings would be very appreciated to make writing bindings
for other languages easier. It's kind of ironic, but writing Ruby
bindings for a C library is actually easier than for a C++ one.

As an example, take Ruby FFI [1], a library allowing to easily create
bindings to a C library. It doesn't require the binding to be compiled,
as it just loads the library dynamically. And it even works for
alternative Ruby implementation such as JRuby (Ruby on the JVM).
Unfortunately, it doesn't support C++, because of its non-standardized
name mangling.

By the way, I'm the author of id3lib-ruby [2]. I started writing a
complete Ruby binding for taglib using SWIG. It works, but it's pretty
painful.

So, I think having complete C bindings would also enable complete Ruby
bindings (and possibly other languages) increasing taglib adoption in
the end.

Regards,
  Robin

PS: Nice to see taglib on github, by the way :).

[1] https://github.com/ffi/ffi/wiki
[2] https://github.com/robinst/id3lib-ruby


More information about the taglib-devel mailing list