[Kde-bindings] Using smoke with ffi to C

Paulo J. Matos pocm at soton.ac.uk
Fri Oct 13 19:55:37 UTC 2006


On 10/10/06, Richard Dale <Richard_Dale at tipitina.demon.co.uk> wrote:
> Ruby itself only has a C interface, and so there are C functions to interface
> directly with Ruby which contain C++ code that in turn interfaces with the
> Smoke lib.

This is the part where I just get lost. In fact, I've tried some
examples with smoke using C++ and everything is nice. So if my
language could interface with C++ I would be in heaven but that's not
the case, so I'm still lost. Let me see if I understand. You have to
create between your language and Smoke a C layer, this C layer is C++
with extern C. Something along the lines:

extern "C" int myFunction {

// C++ code which calls Smoke

}


and then in your language, you just call int myFunction which is C
(name-mangling-wise). Is this OK?

-- 
Paulo Jorge Matos - pocm at soton.ac.uk
http://www.personal.soton.ac.uk/pocm
PhD Student @ ECS
University of Southampton, UK



More information about the Kde-bindings mailing list