comp.lang.ada
 help / color / mirror / Atom feed
From: wojtek@power.com.pl (Wojtek Narczynski)
Subject: Access to array slices?
Date: 14 Jan 2003 17:17:09 -0800
Date: 2003-01-15T01:17:09+00:00	[thread overview]
Message-ID: <5ad0dd8a.0301141717.2f1a9685@posting.google.com> (raw)

Hello,

I am trying to develop a library that reads C structures from socket
and interpret them.

At some point I have a structure (stream?) on stack that contains
multiple strings inside. It's something like [name_length,
value_length, name, value]* mean an unknown number of such name-value
pairs. I am able to access it as String using the 'Address clause, but
now I either have to copy the strings out, or obtain (deadly unsafe,
not portable, nobody knows why) Access'es to slices of this array.

I am using GNAT, and I don't mind that much being bound to it, because
what I try to write is noncommercial stuff.

What I was able to figure out so far is that a fat pointer is two
pointers - one to the dope another to the data. Not sure what's next
tho...

Is it common for C interfacing code to copy data in and out like
crazy? Without the ability to obtain an Access to array slice this
must be the case, right?

Could somebody help me go on with this, or alternatively wave his
finger?

---

My alternative idea is to redefine 'Input for a Name_Value_Pair_Type,
but this way I will loose control over buffering of the input stream,
I think.

Thanks,
Wojtek



             reply	other threads:[~2003-01-15  1:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-15  1:17 Wojtek Narczynski [this message]
2003-01-15  3:13 ` Access to array slices? tmoran
2003-01-15 16:31   ` sk
2003-01-15 20:48     ` tmoran
2003-01-16  1:00       ` sk
2003-01-16  1:43         ` tmoran
2003-01-19  4:06     ` David Thompson
2003-01-15 14:44 ` Steve
2003-01-16  2:18   ` Wojtek Narczynski
2003-01-16  3:52     ` tmoran
2003-01-17 18:04     ` Warren W. Gay VE3WWG
2003-01-15 15:06 ` Stephen Leake
2003-01-16  2:02   ` Wojtek Narczynski
2003-01-16 16:18     ` Stephen Leake
2003-01-16 16:48 ` Victor Porton
2003-01-19  4:32 ` sk
2003-01-27  2:59   ` David Thompson
2003-01-24 19:02 ` Wojtek Narczynski
replies disabled

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