comp.lang.ada
 help / color / mirror / Atom feed
From: Jacob Sparre Andersen <sparre@nbi.dk>
Subject: Re: Writing Data to a file
Date: Fri, 16 Dec 2011 14:30:43 +0100
Date: 2011-12-16T14:30:43+01:00	[thread overview]
Message-ID: <87sjkkod8c.fsf@hugsarin.sparre-andersen.dk> (raw)
In-Reply-To: 530c4f5e-3c00-4ad5-92de-a4faefad468d@p16g2000yqd.googlegroups.com

awdorrin <awdorrin@gmail.com> writes:

> The buffer is a block of memory that contains data, it could be text,
> integers, bytes, floating point numbers, whatever.

   type Whatever is ...;
   Buffer_Size : constant Natural := ...;
   type Buffer is array (1 .. Buffer_Size);

> The AREA_PTR is the starting address of the memory block.

   Area_Ptr : constant System.Address := ...;
   Data     : Buffer;
   for Data'Address use Area_Ptr;

> So since all I have is a System.Address and offsets, I believe I have
> to cast/convert this a Stream_Element_Array.

No need.  Just make sure your Ada data structure is located at the right
address (and has the right layout).

Jacob
-- 
�Great minds discuss ideas,
 Average minds discuss events,
 Small minds discuss people.�



      parent reply	other threads:[~2011-12-16 13:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-15 18:13 Writing Data to a file awdorrin
2011-12-15 18:32 ` Ludovic Brenta
2011-12-15 19:23   ` awdorrin
2011-12-16  0:55     ` Randy Brukardt
2011-12-16 13:30     ` Jacob Sparre Andersen [this message]
replies disabled

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