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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6a1865ea6d613695 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.204.0.73 with SMTP id 9mr7004136bka.4.1322498138232; Mon, 28 Nov 2011 08:35:38 -0800 (PST) Path: dq5ni64436bkb.0!nntp.google.com!news1.google.com!postnews.google.com!s6g2000vbc.googlegroups.com!not-for-mail From: awdorrin Newsgroups: comp.lang.ada Subject: Re: Interfaces.C.String.Update Date: Mon, 28 Nov 2011 08:35:37 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <83380fe1-c4c4-4b32-8f2e-f9cc4a862644@n35g2000yqf.googlegroups.com> NNTP-Posting-Host: 192.35.35.34 Mime-Version: 1.0 X-Trace: posting.google.com 1322498137 22031 127.0.0.1 (28 Nov 2011 16:35:37 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 28 Nov 2011 16:35:37 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s6g2000vbc.googlegroups.com; posting-host=192.35.35.34; posting-account=YkFdLgoAAADpWnfCBA6ZXMWTz2zHNd0j User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESRCNK X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20100101 Firefox/8.0,gzip(gfe) Xref: news1.google.com comp.lang.ada:19216 Content-Type: text/plain; charset=ISO-8859-1 Date: 2011-11-28T08:35:37-08:00 List-Id: Thanks for the confirmation and the suggestions. One followup question about Update and the use of Check=>True... If I'm understanding things properly, given the following scenario: Character array defined in C, initialized with a memset of nulls. Passing a char* to Ada, using the Chars_Ptr - Any attempt to use Update with Check=>True will raise an Update_Error, because Ada will see the string pointed to as zero length, right? So this requires us to disable the check and do some checking on both sides to make sure that we don't blow the char buffers. I think, updating these functions to pass in the buffer length (or 'cheating' by initializing the char arrays with spaces instead of nulls) would be safer, and allow me to take advantage of the Check=>True functionality.