From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dcfafdc50abb8ce4 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-19 04:46:02 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!194.213.69.151!news.algonet.se!algonet!pepsi.tninet.se!not-for-mail From: Mats Karlssohn Newsgroups: comp.lang.ada Subject: Re: records containing variable length arrays [long] Date: Tue, 19 Jun 2001 13:43:11 +0200 Organization: MIDA Systemutveckling AB Message-ID: <3B2F3ACF.11BFC706@mida.se> References: <3B1E8BB9.42BF95D2@mida.se> <3B20C5F7.94DC72A1@mida.se> <3B210083.BD164849@boeing.com> NNTP-Posting-Host: du89-155.ppp.algonet.se Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: cubacola.tninet.se 992950880 8452 195.100.155.89 (19 Jun 2001 11:41:20 GMT) X-Complaints-To: abuse@algo.net NNTP-Posting-Date: 19 Jun 2001 11:41:20 GMT X-Mailer: Mozilla 4.77 [en] (WinNT; U) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:8885 Date: 2001-06-19T11:41:20+00:00 List-Id: 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