comp.lang.ada
 help / color / mirror / Atom feed
* Interfacing to void *
@ 1999-07-18  0:00 William Starner
  1999-07-18  0:00 ` Keith Thompson
  1999-07-19  0:00 ` jerry
  0 siblings, 2 replies; 5+ messages in thread
From: William Starner @ 1999-07-18  0:00 UTC (permalink / 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.)




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1999-07-20  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-18  0:00 Interfacing to void * William Starner
1999-07-18  0:00 ` Keith Thompson
1999-07-19  0:00 ` jerry
1999-07-19  0:00   ` William Starner
1999-07-20  0:00     ` jerry

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