comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephen.Leake@gsfc.nasa.gov>
Subject: Re: import a C function returning char *
Date: 1999/02/04
Date: 1999-02-04T00:00:00+00:00	[thread overview]
Message-ID: <uaeyu3x7d.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: 877ltzckn4.fsf@zaphod.enst.fr

Samuel Tardieu <sam@ada.eu.org> writes:

> >>>>> "Stephen" == Stephen Leake <Stephen.Leake@gsfc.nasa.gov> writes:
> 
> Stephen> Is this going to work (I'll get around to compiling this
> Stephen> soon)? I'm using GNAT 3.11p and ObjectAda 7.12 on Windows NT;
> Stephen> what about other Ada compilers?
> 
> What do you think "Sbs_Read_Error'Length" would contain? You can't tell?
> Neither can the compiler :-)

Yes, this was why I was wondering if it would work.

> Use Interfaces.C.Strings.chars_ptr, since what you get from this C
> function is only a pointer onto the beginning of the string (char *),
> don't expect to get more just by writing it in Ada :-)

Yes, that's the solution. I thought I remembered a chars_ptr
somewhere, and I'd have found it if I'd just looked in the LRM index.
I guess I was just having a bad day ...

-- Stephe




      reply	other threads:[~1999-02-04  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-03  0:00 import a C function returning char * Stephen Leake
1999-02-03  0:00 ` Tucker Taft
1999-02-03  0:00 ` Samuel Tardieu
1999-02-04  0:00   ` Stephen Leake [this message]
replies disabled

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