comp.lang.ada
 help / color / mirror / Atom feed
* DLLs / shared objects
@ 2003-10-03 23:47 kat-Zygfryd
  2003-10-04  7:58 ` Patrice Freydiere
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: kat-Zygfryd @ 2003-10-03 23:47 UTC (permalink / raw)


I'd like to have a plugin system in my Ada program -
loading functions/procedures from dll's/so's unknown at compiletime,
but found by the app at runtime. All information I found concerned
only Windows DLLs and involved statically linking parts of the dynamic libs,
which is unacceptable.
Is there any way in Ada to do so? (GNAT 3.14p, x86 Windows/Linux)

kZ

A schematical example of what I mean:

<DLL>
type PluginFunc is access function (someparam) return someresult;
type Callback is access procedure (FuncName: String; FuncCode: PluginFunc);
procedure Init(proc: Callback) is
begin
  proc("SomePluginFunc",MyFunc'Access);
end Init;
function MyFunc(...

<Program>
type PluginFunc is access function (someparam) return someresult;
type Callback is access procedure (FuncName: String; FuncCode: PluginFunc);
procedure SetFunc(FuncName: String; FuncCode: PluginFunc) is
begin
    Add(FuncHashTable,FuncName,FuncCode);
end SetFunc;
...
loop
  SomeDLL := FindDLL(...);
  exit when ...;
  InitProc := ObtainInitProc(SomeDLL); <--- ???
  InitProc(SetFunc);
end loop;





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-10-04 11:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-03 23:47 DLLs / shared objects kat-Zygfryd
2003-10-04  7:58 ` Patrice Freydiere
     [not found] ` <m2r81tn9mv.fsf@jvdsys.demon.nl>
2003-10-04 10:10   ` chris
2003-10-04 11:03 ` chris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox