comp.lang.ada
 help / color / mirror / Atom feed
* Access to array slices?
@ 2003-01-15  1:17 Wojtek Narczynski
  2003-01-15  3:13 ` tmoran
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Wojtek Narczynski @ 2003-01-15  1:17 UTC (permalink / 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



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

end of thread, other threads:[~2003-01-27  2:59 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-15  1:17 Access to array slices? Wojtek Narczynski
2003-01-15  3:13 ` 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

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