comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam@spam.com>
Subject: Re: Interfacing to C and void*
Date: Mon, 20 Feb 2006 18:54:54 GMT
Date: 2006-02-20T18:54:54+00:00	[thread overview]
Message-ID: <2goKf.3760$JR6.1501@newsread3.news.pas.earthlink.net> (raw)
In-Reply-To: <43fa0960$0$505$9b4e6d93@newsread4.arcor-online.net>

Georg Bauhaus wrote:

> Maciej Sobczak wrote:
> 
>>Suppose I have the following two C functions:
>>
>>void * factory();
> 
> I have seen System.Address used for this.

Not good practice, since System.Address need not correspond to a C pointer.

Generally, void* is never dereferenced, so any C-convention access type is 
suitable. I usually use

type Void_Ptr is access all Integer;
pragma Convention (C, Void_Ptr);

function Factory return Void_Ptr;
pragma Import (C, Factory, "factory");

-- 
Jeff Carter
"Alms for an ex-leper!"
Monty Python's Life of Brian
75



  reply	other threads:[~2006-02-20 18:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-20 15:19 Interfacing to C and void* Maciej Sobczak
2006-02-20 18:24 ` Georg Bauhaus
2006-02-20 18:54   ` Jeffrey R. Carter [this message]
2006-02-20 19:01 ` Martin Krischik
2006-02-20 19:41   ` Martin Dowie
2006-02-21  8:09     ` Alex R. Mosteo
2006-02-21 18:47     ` Martin Krischik
replies disabled

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