comp.lang.ada
 help / color / mirror / Atom feed
* Ada address of operator?
@ 1999-02-09  0:00 Danny
  1999-02-09  0:00 ` Niklas Holsti
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Danny @ 1999-02-09  0:00 UTC (permalink / raw)


Hi,

I'm trying to use a C library in an Ada function and a typical prototype
from this library would be

struct AType;
struct  AnotherType;

int getObject( AType *pType, AnotherType **ppAnotherType );

I've imported the function okay and it is being called.  The purpose of
the function is to use AType as an IN parameter and return a pointer to
AnotherType, which will be pointed to by ppAnotherType if you get what I
mean.

In Ada I have corresponding records for AType & AnotherType and have
declared AnotherTypePtr and AnotherTypePtrPtr.  What I think I need to
do is

pAnotherType : AntherTypePtr;
ppAnotherType : AnotherTypePtrPtr;

but I need to assign ppAnotherType the address of pAnotherType, the
equivalent C code would be

AnotherType *pAnotherType;
AnotherType **ppAnotherType = &pAnotherType;

any suggestions?

-Danny





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1999-02-12  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-09  0:00 Ada address of operator? Danny
1999-02-09  0:00 ` Niklas Holsti
1999-02-10  0:00 ` Nick Roberts
1999-02-12  0:00   ` Nick Roberts
1999-02-11  0:00 ` Matthew Heaney

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