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,dbaf05888e191cb6,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-14 17:17:09 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: wojtek@power.com.pl (Wojtek Narczynski) Newsgroups: comp.lang.ada Subject: Access to array slices? Date: 14 Jan 2003 17:17:09 -0800 Organization: http://groups.google.com/ Message-ID: <5ad0dd8a.0301141717.2f1a9685@posting.google.com> NNTP-Posting-Host: 212.160.20.107 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1042593429 23173 127.0.0.1 (15 Jan 2003 01:17:09 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 15 Jan 2003 01:17:09 GMT Xref: archiver1.google.com comp.lang.ada:33024 Date: 2003-01-15T01:17:09+00:00 List-Id: 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