[fpc-devel] Dynamically Loading Libraries

Vincent Snijders vsnijders at vodafonevast.nl
Mon Nov 2 21:23:03 CET 2009


Luiz Americo Pereira Camara schreef:
> 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;
> 
And a statement to initialize the variable.

Vincent



More information about the fpc-devel mailing list