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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d1533431e7e9d2eb X-Google-Attributes: gid103376,public From: Julian Day Subject: Re: Nontrivial examples of C interface with Ada Date: 2000/05/26 Message-ID: <392E6C58.3926413F@trap.geocities.com>#1/1 X-Deja-AN: 627558439 Content-Transfer-Encoding: 7bit References: <392CC733.13BDDC84@quadruscorp.com> <8gjqpo$kjv$1@nnrp1.deja.com> <392E67F4.15275C1A@trap.geocities.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@cableinet.net X-Trace: news3.cableinet.net 959343438 213.48.188.135 (Fri, 26 May 2000 13:17:18 BST) Organization: Cable Internet (post doesn't reflect views of Cable Internet) MIME-Version: 1.0 NNTP-Posting-Date: Fri, 26 May 2000 13:17:18 BST Newsgroups: comp.lang.ada Date: 2000-05-26T00:00:00+00:00 List-Id: Julian Day wrote: > I hit on a similar issue a couple of years ago and 'dreamed' up what I > thought was quite a cute situation at the time. Oops, that should be solution, not situation... > > > pacakge Ada.Text_IO.C_Interface is > type File_Descriptor_Type is new Interfaces.C.Int; -- or similar > function Associate (FD : File_Descriptor_Type) return > Ada.Text_IO.File_Type; > end Ada.Text_IO.C_Interface; > > Since this is a child of Ada.Text_IO, it can fill out an appropriate > File_Type, and 'regular' Text_IO will then just work! > (Before I get torn apart) I think there were two fundemental problems as I remember. 1. On the compiler I was using, the implementation of File_Type had been hidden in Text_IO using private type XXX; -- I can't remember the name. type File_Type is access XXX; 2. I did not have the body of Ada.Text_IO, to have a look at the implementation of XXX on the compiler I was using. Julian