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: 103376,575dfcf6488662de X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news1.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Thomas Lotze Newsgroups: comp.lang.ada Subject: Re: Libraries written in Ada Date: Mon, 22 Nov 2004 17:28:49 +0100 Message-ID: References: <18687975.p80OmDsB1I@linux1.krischik.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de WyRboaFSeZ1vW031bHf4YgD7wwWcn5aGaUvjIKIt8ruyQDp9tC User-Agent: Pan/0.14.2.91 (As She Crawled Across the Table (Debian GNU/Linux)) Xref: g2news1.google.com comp.lang.ada:6330 Date: 2004-11-22T17:28:49+01:00 List-Id: 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