comp.lang.ada
 help / color / mirror / Atom feed
From: Julian Day <julianday.spam@trap.geocities.com>
Subject: Re: Nontrivial examples of C interface with Ada
Date: 2000/05/26
Date: 2000-05-26T00:00:00+00:00	[thread overview]
Message-ID: <392E67F4.15275C1A@trap.geocities.com> (raw)
In-Reply-To: 8gjqpo$kjv$1@nnrp1.deja.com

> Ted Dennison wrote:
>
> Sockets are a very good example. Sure, I could give it a Text_IO
> interface. But then how do I set my sockets to non-blocking? How do I
> adjust the mbufs? How do I send a message to multiple recepients? How do
> I write a server that detects TCP/IP timeouts from clients? I could go
> on and on here.

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.

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!

Julian





  parent reply	other threads:[~2000-05-26  0:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-23  0:00 Nontrivial examples of C interface with Ada gressett
2000-05-24  0:00 ` Marin D. Condic
2000-05-24  0:00   ` Scott Ingram
2000-05-24  0:00     ` Marin D. Condic
2000-05-24  0:00 ` tmoran
2000-05-24  0:00 ` Terry Westley
2000-05-24  0:00 ` Ted Dennison
2000-05-24  0:00   ` Marin D. Condic
2000-05-25  0:00     ` tmoran
2000-05-25  0:00       ` Geoff Bull
2000-05-25  0:00         ` tmoran
2000-05-25  0:00       ` Ted Dennison
2000-05-25  0:00         ` tmoran
2000-05-25  0:00           ` Ted Dennison
2000-05-25  0:00             ` tmoran
2000-05-26  0:00         ` Julian Day [this message]
2000-05-26  0:00           ` Julian Day
2000-05-26  0:00       ` Marin D. Condic
2000-05-27  0:00         ` tmoran
2000-05-27  0:00           ` Marin D. Condic
2000-05-28  0:00             ` tmoran
2000-05-28  0:00               ` Marin D. Condic
2000-05-28  0:00                 ` tmoran
2000-05-28  0:00               ` Robert Dewar
2000-05-25  0:00     ` Ted Dennison
2000-05-25  0:00       ` tmoran
2000-05-29  0:00       ` Geoff Bull
2000-05-24  0:00 ` David Emery
replies disabled

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