comp.lang.ada
 help / color / mirror / Atom feed
From: William Starner <billeug@worldnet.att.net>
Subject: Interfacing to void *
Date: 1999/07/18
Date: 1999-07-19T03:18:37+00:00	[thread overview]
Message-ID: <37929901.649C0955@worldnet.att.net> (raw)

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*?

I have
private
	type voidpointer is access character;
	type BigNum is record 
		ptr: voidpointer;
		size: Interfaces.C.unsigned;
		allocated: Interfaces.C.unsigned;
	end record;
	type RealBigNum is access BigNum;
	type UnboundedInt is new Linear with record
		Value: RealBigNum;
	end record;
end nla23.linear.bnlib;
but char* = void* is a C rule, not an Ada rule. It probably works, but it's not
right. (I don't need to access anything through that pointer.)




             reply	other threads:[~1999-07-18  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-18  0:00 William Starner [this message]
1999-07-18  0:00 ` Interfacing to void * Keith Thompson
1999-07-19  0:00 ` jerry
1999-07-19  0:00   ` William Starner
1999-07-20  0:00     ` jerry
replies disabled

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