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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fc7fc1b95198137d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-30 01:59:07 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!fr.usenet-edu.net!usenet-edu.net!enst!enst.fr!not-for-mail From: "M. A. Alves" Newsgroups: comp.lang.ada Subject: Re: Ada Address = C pointer ? Date: Tue, 30 Oct 2001 09:58:12 +0000 (GMT) Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: avanie.enst.fr 1004435946 84477 137.194.161.2 (30 Oct 2001 09:59:06 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Tue, 30 Oct 2001 09:59:06 +0000 (UTC) To: Return-Path: X-X-Sender: In-Reply-To: Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.6 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , List-Archive: Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:15397 Date: 2001-10-30T09:58:12+00:00 On Mon, 29 Oct 2001, Matthew Heaney wrote: > "M. A. Alves" wrote in message > news:mailman.1004357020.21840.comp.lang.ada@ada.eu.org... > > You mean use Address_To_Access conversion? Because what I have is C > > pointers I need to interface with. I am using Chars_Ptr because it has a > > Null_Ptr value and I need to test for, and pass, NULL. (And in C char * > > is assuredly able to point to anything.) But I am indeed considering > > using Address et al., and Address to Access conversion. > > . . . > > I do NOT think you need to use System.Address and Addr_To_Acc_Conv. The > types declared in C.Strings should be adequate. I am in fact using Address and Access_To_Address_Conversions(*) because I simply did not find out how to do the trick otherwise. For example, the C function is returning an array of unsigned long. I want to access that array without copying it. How can you do that with Interfaces.C.Strings or even Interfaces.C.Pointers ? Also, I did not found the equivalence Null_Ptr = NULL stated in the RM. > That being said, I would be very surprised if System.Address had a > different representation from char* or void*. Yes, and for now my implementation is bound to that assumption. _____ (*) I am using a technique similar to the one referenced as 2c in "Accessing Memory as a String" by Robert Dewar, available at adapower.com/lang/accessmem.html . -- , M A R I O data miner, LIACC, room 221 tel 351+226078830, ext 121 A M A D O Rua Campo Alegre, 823 fax 351+226003654 A L V E S P-4150 PORTO, Portugal mob 351+939354002