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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d0fcd3db00d6036 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-09-27 20:13:01 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.telusplanet.net!ps01-chi1!news.webusenet.com!cyclone1.gnilink.net!wn11feed!wn7feed!worldnet.att.net!204.127.198.204!attbi_feed4!attbi.com!rwcrnsc51.ops.asp.att.net.POSTED!not-for-mail From: "SteveD" Newsgroups: comp.lang.ada References: Subject: Re: "extern" procedure in ada X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: <179l9.472846$_91.689442@rwcrnsc51.ops.asp.att.net> NNTP-Posting-Host: 12.225.227.101 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc51.ops.asp.att.net 1033182781 12.225.227.101 (Sat, 28 Sep 2002 03:13:01 GMT) NNTP-Posting-Date: Sat, 28 Sep 2002 03:13:01 GMT Organization: AT&T Broadband Date: Sat, 28 Sep 2002 03:13:01 GMT Xref: archiver1.google.com comp.lang.ada:29397 Date: 2002-09-28T03:13:01+00:00 List-Id: "Bernard Azria" wrote in message news:an2c4e$52l$1@dns3.cae.ca... > I am looking for the equivallent of an "extern" definition procedure in > C for ADA. > > In other words, how could I define an external procedure to my program > without "withing" the package where it is defined ( I have only the "obj' > and the "ali" file of this procedure in a library) > I am still not sure I understand your question, but here is "sort of" an answer... but I'm not sure it is to your question. I can declare a variable in an Ada source file and "export" that variable: package sharer is pragma Elaborate_Body; end sharer; package body sharer is x : integer := 42; pragma export( Ada, x ); end sharer; I can then "import" that variable into another Ada source file: with Ada.Text_io; with Sharer; pragma Elaborate( Sharer ); procedure shared is x : Integer; pragma import( Ada, x ); begin Ada.Text_Io.Put_Line( "x is " & Integer'IMAGE( x ) ); end shared; In my example I have still With'd the "Sharer" package in so that the "x" variable will get initialized during elaboration. But you'll note that "Sharer" does not explicitly make anything visible in the package spec. I hope this helps, SteveD > Would it be an kind of : pragma import ( ADA, procedure_name ) > > Thanks in advance > > B.A. > > >