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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.58.136.6 with SMTP id pw6mr2962720veb.32.1382015108086; Thu, 17 Oct 2013 06:05:08 -0700 (PDT) X-Received: by 10.50.39.78 with SMTP id n14mr196855igk.14.1382015108028; Thu, 17 Oct 2013 06:05:08 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!o2no9764906qas.0!news-out.google.com!9ni50474qaf.0!nntp.google.com!i2no17318570qav.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 17 Oct 2013 06:05:07 -0700 (PDT) In-Reply-To: <12b085dd-8e96-477e-bbf3-135330275b69@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=129.59.203.122; posting-account=7Oy7OQoAAABhVYFOo553Cn1-AaU-bSfl NNTP-Posting-Host: 129.59.203.122 References: <14357314-5521-4275-9949-9ea42c790147@googlegroups.com> <12b085dd-8e96-477e-bbf3-135330275b69@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <24ce5a1f-99e6-465c-b986-85fc09e84ee6@googlegroups.com> Subject: Re: Passing a String to a C/C++ Subprogram (Special Case) From: Eryndlia Mavourneen Injection-Date: Thu, 17 Oct 2013 13:05:08 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:17453 Date: 2013-10-17T06:05:07-07:00 List-Id: On Wednesday, October 16, 2013 3:48:11 PM UTC-5, Adam Beneschan wrote: > . . . > Hopefully we can presume that Eryndlia has already thought about this and= knows what values the C code she's interfacing to is expecting to be in th= ose bytes. >=20 > -- Adam Yes, indeed! The strings are either simple names or file paths. Some impo= rtant considerations are: 1) I am limited to Ada95 (so no aspects including type aspects) 2) The language of the underlying subprograms may or may not be C/C++. Thi= s means I need to keep things as simple as possible for the client develope= r. I am hoping that the "pragma Convention (C, ...)" will do what it sound= s as if it does (along with a "pragma Import") to set things up properly. 3) I believe that the client developer will need to be responsible for addi= ng any nul character, since the subprogram does not know whether there is j= unk at the end of the valid data. -- Eryndlia Mavourneen (KK1T)