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,bc334b8912d9286c X-Google-Attributes: gid103376,public From: Stephen Leake Subject: Re: import a C function returning char * Date: 1999/02/04 Message-ID: #1/1 X-Deja-AN: 440655453 References: <877ltzckn4.fsf@zaphod.enst.fr> Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Newsgroups: comp.lang.ada Date: 1999-02-04T00:00:00+00:00 List-Id: Samuel Tardieu writes: > >>>>> "Stephen" == Stephen Leake 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