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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,3a7da1d9b7f5ba84 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!news.in2p3.fr!in2p3.fr!not-for-mail From: xavier grave Newsgroups: comp.lang.ada Subject: Re: Loadable module in Ada. Date: Thu, 03 Dec 2009 11:00:44 +0100 Organization: In2p3 Message-ID: <4B178C4C.1030608@ipno.in2p3.fr> References: <2009120301362116807-stevenshack@stevenshackcom> NNTP-Posting-Host: ipnnarval.in2p3.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ccpntc8.in2p3.fr 1259834444 15854 134.158.92.7 (3 Dec 2009 10:00:44 GMT) X-Complaints-To: newsmaster@cc.in2p3.fr NNTP-Posting-Date: Thu, 3 Dec 2009 10:00:44 +0000 (UTC) To: Steven Shack User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707) In-Reply-To: <2009120301362116807-stevenshack@stevenshackcom> X-Enigmail-Version: 0.95.0 Xref: g2news1.google.com comp.lang.ada:8296 Date: 2009-12-03T11:00:44+01:00 List-Id: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Steven Shack a �crit : > I'd like to create a loadable module in an Ada program. I've searched > around, but can't > seem to find any examples of this. Say I've got some calculation or a > driver and I'd like to have > multiple different versions of it with the same interface. I'd like to > be able to load and replace > these modules at runtime. > > In C I'd do this with pic code, dlsym and function pointers. I can't > seem to find the equivalent > in Ada. Can anyone help me out? > > Thanks > > Hi, I have done something that seems to fit with your need. Here is a link where you will find a tgz file compiling/running under Linux using dlsym. It is based on an abstract class that your plugin should inherit of. http://dl.free.fr/pWQwqMpVK Be very careful about the elaboration code when you do some "with" of other package. One on the "best" policy is to be the more restrictive that you can with the packages you "with" (pragma Pure and so on...) Hope it will help... xavier -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAksXjEwACgkQVIZi0A5BZF4LwQCfVGP1MA2sfQRRzvLoiCN8s1Oc dQkAoKwEqm+RGqPc6UmhAMu2d2tqwnEG =cLPw -----END PGP SIGNATURE-----