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,e55ee29fd922b5bc X-Google-Attributes: gid103376,public From: jerry@jvdsys.stuyts.nl Subject: Re: Interfacing to void * Date: 1999/07/19 Message-ID: #1/1 X-Deja-AN: 502875209 Sender: jerry@stuyts.nl (Jerry van Dijk) References: <37929901.649C0955@worldnet.att.net> Organization: * JerryWare HQ *, Leiden, Holland User-Agent: tin/pre-1.4-980226 (UNIX) (Linux/2.2.10 (i586)) Newsgroups: comp.lang.ada Date: 1999-07-19T00:00:00+00:00 List-Id: William Starner wrote: : If I'm trying to interface to a C library that uses this struct : struct BigNum { : void *ptr; : unsigned int size; : unsigned int allocated; : }; : how should I interface to void*? Depends on what you need to do with the result. In the most basic case you could do something like: type BigNum is record ptr : System.Address; size : Interfaces.C.unsigned; allocated : Interfaces.C.unsigned; end record; pragma Convention (C, BigNum); as a void * basically is a memory address and use System.Address_To_Access_Conversions to get an access type to whatever ptr is pointing at. -- -- Jerry van Dijk | Leiden, Holland -- Team Ada | jdijk@acm.org -- see http://stad.dsl.nl/~jvandyk