comp.lang.ada
 help / color / mirror / Atom feed
From: sk <sk@noname.com>
To: "comp.lang.ada mail to news gateway" <comp.lang.ada@ada.eu.org>
Subject: Re: C code to Ada
Date: Sat, 25 Jan 2003 21:04:13 -0600
Date: 2003-01-25T21:04:13-06:00	[thread overview]
Message-ID: <mailman.27.1043553060.4961.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: giDY9.3794$RZ.37344@newsfep4-win.server.ntli.net

(I don't think the first message got to cla, so
sorry if this repeats)

 > I am waiting to finish the adainit & adafinal calls and
 > write an example before I email you sk).  Now I'm in the
 > process of writing nice tidy calls to adainit & adafinal

adainit and final are part of the Gnat building process
and are automatically bound and linked by gnatmake (or
gcc -> gnatbind -> gnatlink).

The "-n" option tells the gnat binder to make them
available to the "outside" world.

They are still only accessible as "system addresses"
from the "dlsym" call (I suppose you could wrap
that but I am not sure of the necessity).

The thing that you need to look at for adainit
and adafinal is closely associating them with
the "init" and "fini" functions which the
dynamic/linker/loader automatically calls upon
the loading and unloading of a dynamic library.

See the library howto. I have not gone this far,
but I was planning to explore the possibilities

 > system.address_to_access_conversion?
Looks like a good idea but I haven't explored it.
The name itself suggests that it is ideal.

 > Unchecked_Conversion, which works *here* even
 > if it's a bit risky.

There are times when the use of Unchecked_Conversion
is dubious, there are times when it isn't.

Others will probably tell you differently, but
if the "dlsym" returns system.addresses (or void *)
to everything that is available (variables, functions
or procedures), then Unchecked_Conversion is probably
one of the better (at least cleaner) solutions.

If you look at a "Simon Wright" post in this thread,
you will see that the permutations of trying to
provide a binding for every possiblity is unmanageable.

-- 
--
-- Merge vertically for real address
--
------------------------------------
-- s n p @ t . o
--  k i e k c c m
------------------------------------




  parent reply	other threads:[~2003-01-26  3:04 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-20 18:44 C code to Ada chris.danx
2003-01-20 21:33 ` sk
2003-01-20 21:43   ` chris.danx
2003-01-20 22:56     ` James S. Rogers
2003-01-20 23:05       ` chris.danx
2003-01-21  2:17       ` Jeffrey Carter
2003-01-20 23:32     ` sk
2003-01-21  0:56       ` chris.danx
2003-01-21  1:26         ` sk
2003-01-21 15:49           ` Frank J. Lhota
2003-01-22  1:05           ` chris.danx
2003-01-21  2:27   ` Jeffrey Carter
2003-01-21  2:55     ` sk
2003-01-21 19:33       ` Jeffrey Carter
2003-01-21  6:18     ` Simon Wright
     [not found] ` <3E2C6B2B.5090600@noname.com>
2003-01-20 21:39   ` sk
2003-01-21  1:23 ` sk
2003-01-25 21:28   ` chris.danx
2003-01-26  2:16     ` sk
2003-01-26  3:04     ` sk [this message]
     [not found]     ` <3E33502D.7030503@noname.com>
2003-01-26  5:37       ` sk
2003-01-23  8:00 ` sk
2003-01-24 18:03   ` chris.danx
replies disabled

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