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-Thread: 103376,575dfcf6488662de X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Libraries written in Ada Date: Mon, 22 Nov 2004 17:46:01 +0100 Message-ID: <41A217C9.9030005@mailinator.com> References: <18687975.p80OmDsB1I@linux1.krischik.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de peDzZPBskbXwI3gK7UrYdwUPsFNaGcjRp0/Woxc8BvVOZo65M= User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en In-Reply-To: Xref: g2news1.google.com comp.lang.ada:6331 Date: 2004-11-22T17:46:01+01:00 List-Id: Thomas Lotze wrote: > 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? At least in the DLL case, each one has its own 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. >