From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,476311ae1fc1d6fc,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-03 16:47:32 PST Path: archiver1.google.com!news2.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!freenix!proxad.net!newsfeed.tpinternet.pl!newsfeed.gazeta.pl!news.onet.pl!not-for-mail From: "kat-Zygfryd" <6667@wp.pl> Newsgroups: comp.lang.ada Subject: DLLs / shared objects Date: Sat, 4 Oct 2003 01:47:43 +0200 Organization: news.onet.pl Sender: samael_@op.pl@sc70.internetdsl.tpnet.pl Message-ID: NNTP-Posting-Host: sc70.internetdsl.tpnet.pl X-Trace: news.onet.pl 1065224853 14905 80.55.80.70 (3 Oct 2003 23:47:33 GMT) X-Complaints-To: abuse@onet.pl NNTP-Posting-Date: 3 Oct 2003 23:47:33 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Xref: archiver1.google.com comp.lang.ada:183 Date: 2003-10-03T23:47:33+00:00 List-Id: 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: 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(... 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;