[fpc-devel] Dynamically Loading Libraries

Luiz Americo Pereira Camara luizmed at oi.com.br
Mon Nov 2 21:13:13 CET 2009


Ivo Steinmann escreveu:
> Vincent Snijders schrieb:
>> Maybe it is better to generate a foobar_dyn.inc based on the
>> foobar.inc or generate both foobar.inc and foobar_dyn.inc from a
>> common file format (maybe even the original header file)
>
>   
[..]
> Most libraries are translated by a tool like h2pas from the original
> headers and then rehashed manually. The best solution would be, if
> there's a tool that generates the var procedures directly from all
> external procedures.

I think that creating a tool to translate a static header to a dyn 
header should be easy to create (i'm not talking to convert c header 
directly ;-)).

Should do the following right? Correct me if i'm wrong:

Static function:

function foobar_dosomething(a:cint; b:cdouble): cint; extdecl;external 
foobarlib;

Becomes a dyn function:

var foobar_dosomething: function(a:cint; b:cdouble): cint; extdecl;

I can write such tool.

Luiz




More information about the fpc-devel mailing list