From: tmoran@bix.com
Subject: Re: Nontrivial examples of C interface with Ada
Date: 2000/05/25
Date: 2000-05-25T00:00:00+00:00 [thread overview]
Message-ID: <oGfX4.319$yf2.148794@news.pacbell.net> (raw)
In-Reply-To: 8gjjeb$eng$1@nnrp1.deja.com
>For me, the really tricky ones are the routines that return a pointer to
>an object whose type is specified by the return value of another
>parameter. As near as I can tell, you have to either make a separate
>subprogram for each type and force the user to know what type he's
>receiving when he makes the call, or you just throw up your hands and
>return an address.
Usually the kinds of objects the returned pointer points to, are
fairly highly related, in which case a return X'class may do the
job nicely. In Claw, for instance, the different Device Independent
Bitmaps (different color resolution, palette use) are descendants of
a single type, so you can read an unknown .bmp file with
function Read (Filename : in String)
return Claw.Bitmaps.Root_DIBitmap_Type'class;
Even more commonly, of course, an *input* parameter defines what
kind of entity the output pointer points to. In that case, two different
Ada procedures fills the bill quite nicely.
next prev parent reply other threads:[~2000-05-25 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 ` 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 ` Ted Dennison
2000-05-25 0:00 ` tmoran [this message]
2000-05-29 0:00 ` Geoff Bull
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
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-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 ` 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