comp.lang.ada
 help / color / mirror / Atom feed
From: Shark8 <OneWingedShark@gmail.com>
Subject: Re: How to import C pointers to structures?
Date: Mon, 19 May 2014 18:10:14 -0600
Date: 2014-05-19T18:10:14-06:00	[thread overview]
Message-ID: <H3xev.1013245$ka5.998482@fx06.iad> (raw)
In-Reply-To: <0f62af38-2a08-4d5c-bc74-c0dde56eb8f4@googlegroups.com>

On 19-May-14 16:44, Adam Beneschan wrote:
>> You generally *can't*  do a real/meaningful import w/o knowing the
>> layout.
>
> I'm not sure that's quite true ... there are lots of situations
> where you simply want to "pass through" a pointer, e.g. in
> callback situations, where a function sets up a callback and says
> "when you do the callback, please pass this pointer to it"; and
> whoever registers the callback will take the pointer, store it
> somewhere, and use it when it's needed, without ever trying to
> look at what it points to.

While those are /common/ cases, I would be hesitant to call them 
/general/ cases.

> Unfortunately, I don't see the equivalent of "void *" anywhere in
> Interfaces.C, which is what the sort of thing you'd want.  You
> could probably use Interfaces.C.Strings.chars_ptr (the equivalent
> of "char *").

Instantiate Interfaces.C.Pointers on a null-record or, perhaps, 
System.Address?

  reply	other threads:[~2014-05-20  0:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-19 22:26 How to import C pointers to structures? Victor Porton
2014-05-19 22:33 ` Shark8
2014-05-19 22:44   ` Adam Beneschan
2014-05-20  0:10     ` Shark8 [this message]
2014-05-20  0:22       ` Adam Beneschan
2014-05-20  6:36         ` Simon Wright
2014-05-20  8:29 ` björn lundin
2014-05-20 19:07 ` Per Sandberg
2014-05-22 13:37   ` Stephen Leake
replies disabled

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