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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,2d7ec12dd7db366 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-28 00:39:22 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news-FFM2.ecrc.net!news.iks-jena.de!lutz From: lutz@iks-jena.de (Lutz Donnerhacke) Newsgroups: comp.lang.ada Subject: Re: How to rename a file? Date: Fri, 28 Sep 2001 07:39:08 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: NNTP-Posting-Host: taranis.iks-jena.de Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: branwen.iks-jena.de 1001662748 21357 217.17.192.37 (28 Sep 2001 07:39:08 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Fri, 28 Sep 2001 07:39:08 +0000 (UTC) User-Agent: slrn/0.9.6.3 (Linux) Xref: archiver1.google.com comp.lang.ada:13457 Date: 2001-09-28T07:39:08+00:00 List-Id: * David Botton wrote: >Ada arrays are passed as C arrays do to the import so the use of String is >valid, we just need to Zero terminate. Ada record types are also passed as >pointers, which makes life a lot easier. There is no guarantee AFAIK. Even GCC (not to mention Ada) has different ways to do this. Therefore I prefer passing Interfaces.C.Strings.char_p over Interfaces.C.char_array over Standard.String. Especially, if you look how Standard.String is implemented: As a small struct, passable in registers or as a pointer to this struct. In the latter case your C-function may assume the pointer to the memory area containing the string values and the bounds. -fpcc-struct-return Use the same convention for returning struct and union values that is used by the usual C compiler on your system. This convention is less efficient for small structures, and on many machines it fails to be reentrant; but it has the advantage of allow� ing intercallability between GCC-compiled code and PCC-compiled code. -freg-struct-return Use the convention that struct and union values are returned in registers when possible. This is more efficient for small structures than -fpcc-struct-return. If you specify neither -fpcc-struct-return nor -freg-struct-return, GNU CC defaults to whichever convention is standard for the target. If there is no standard convention, GNU CC defaults to -fpcc-struct-return.