comp.lang.ada
 help / color / mirror / Atom feed
From: Mats Karlssohn <mats@mida.se>
Subject: Re: records containing variable length arrays [long]
Date: Tue, 19 Jun 2001 13:43:11 +0200
Date: 2001-06-19T11:41:20+00:00	[thread overview]
Message-ID: <3B2F3ACF.11BFC706@mida.se> (raw)
In-Reply-To: 3B210083.BD164849@boeing.com

Jeffrey Carter wrote:
%<
> You can probably avoid the conversion of the pointer. Given
%<
> type Message_Ptr is access all Message;
> pragma Convention (C, Message_Ptr);
> 
> procedure Get (Ptr : out Message_Ptr; Length : out Interfaces.C.Int);
> pragma Import (C, Get, "get");

Hmmm, I feel I really need to do some reading on and experimenting with
the import/export and convention pragmas. If it's possible to convert
the C pointer in this way the solution of the problem will become wery
nice and uncluttered...

%<
> > Is there a way to explicitly put at least the CRC element into the
> > representation clause ? My experiments haven't gotten me anywhere
> > on this part.
> 
> Only if it comes before the variable-length part of the record. The
> values used in a record representation clause have to be static, which
> means known at compile time.

Oh... that's too bad. Well, I'll have to see what I might do about it.
I guess that I could split the record declaration into three or four
pieces and also declaring a few constants along with them. But it I
worry about the execution times for this piece so I'll probably just
omit the representation for the last part and add a few testcases that
will show if the assumptions is correct.


Thanks anyway, my vacation was nice (and well earned).

-- 
Mats Karlssohn, developer                         mailto:mats@mida.se  
Mida Systemutveckling AB                          http://www.mida.se
Box 64, S-732 22 ARBOGA, SWEDEN
Phone: +46-(0)589-89808   Fax: +46-(0)589-89809



      parent reply	other threads:[~2001-06-19 11:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-06 19:59 records containing variable length arrays [long] Mats Karlssohn
2001-06-06 23:06 ` Jeffrey Carter
2001-06-07 11:44   ` Mats Karlssohn
2001-06-08  2:10     ` Jeffrey Carter
2001-06-07 21:38 ` Stephen Leake
2001-06-08 12:32 ` Mats Karlssohn
2001-06-08 16:42   ` Jeffrey Carter
2001-06-08 22:28     ` Jeffrey Carter
2001-06-19 11:43     ` Mats Karlssohn [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