comp.lang.ada
 help / color / mirror / Atom feed
From: Thomas Lotze <thomas@thomas-lotze.de>
Subject: Re: Libraries written in Ada
Date: Mon, 22 Nov 2004 17:28:49 +0100
Date: 2004-11-22T17:28:49+01:00	[thread overview]
Message-ID: <pan.2004.11.22.16.28.48.665871@ID-174572.user.uni-berlin.de> (raw)
In-Reply-To: 18687975.p80OmDsB1I@linux1.krischik.com

On Mon, 22 Nov 2004 16:58:59 +0100, Martin Krischik wrote:

> No, Ada packages allow for initialization code to included. Ada itself
> makes shure all initialisation code is executed - even when several
> libraries are combined. This happens automaticly when the main procedure
> is written in Ada.

Does this mean every package contains its own runtime environment, or does
every package do some initialization on a common runtime?

> When main is written in another language then the standard demands that
> "some form of initialisation" is provided. In GNAT this is done be:
> 
> void adainit (void);
> 
> You can request another name if you like or need.

This would make it possible to initialize several Ada libraries separately
in a C main program.

> The GNAT binder will generate this procedure for you and it will init all
> libraries involved.

And this seems to make it necessary, at least if I don't want to expose
the implementation details of the libraries to the extent that all used
Ada libraries have to be bound together by GNAT before they can be bound
to a C main as a whole (or do I get something completely wrong here?).

That is, if I have libraries libfoo and libbar written in Ada and
installed in binary form along with appropriate C include files, can I get
away without using GNAT if I call both adainit_foo() and adainit_bar() in
the C main? I think it's much better for library users if they don't have
to do a separate GNAT binding step but can ignore the fact that there's
Ada behind the scenes except for the initialization calls.

-- 
Viele Gr��e,
Thomas




  reply	other threads:[~2004-11-22 16:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-22 11:32 Libraries written in Ada Thomas Lotze
2004-11-22 15:58 ` Martin Krischik
2004-11-22 16:28   ` Thomas Lotze [this message]
2004-11-22 16:46     ` Alex R. Mosteo
2004-11-22 19:09       ` Pascal Obry
2004-11-23 11:12         ` Alex R. Mosteo
2004-11-22 17:59     ` Martin Krischik
2004-11-22 20:36       ` Thomas Lotze
2004-11-22 21:25         ` Georg Bauhaus
2004-11-22 21:45           ` Thomas Lotze
2004-11-22 22:07             ` Georg Bauhaus
2004-11-22 22:27               ` Thomas Lotze
2004-11-23  9:54                 ` Adrien Plisson
2004-11-23  9:55                 ` Martin Krischik
2004-11-23  9:55               ` Martin Krischik
2004-11-23  9:48         ` Martin Krischik
2004-11-23 11:03           ` Thomas Lotze
2004-11-23 11:38             ` Alex R. Mosteo
2004-11-23 12:22               ` Georg Bauhaus
2004-11-23 13:20                 ` Alex R. Mosteo
2004-11-23 13:40                   ` Alex R. Mosteo
2004-11-23 12:36             ` Martin Krischik
2004-11-23 13:53               ` Thomas Lotze
2004-11-23 18:39                 ` Jeffrey Carter
2004-11-22 20:45       ` Georg Bauhaus
replies disabled

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