comp.lang.ada
 help / color / mirror / Atom feed
From: Eryndlia Mavourneen <eryndlia@gmail.com>
Subject: Re: Passing a String to a C/C++ Subprogram (Special Case)
Date: Thu, 17 Oct 2013 09:28:36 -0700 (PDT)
Date: 2013-10-17T09:28:36-07:00	[thread overview]
Message-ID: <9f4e7024-ca71-4d6a-8969-a9c643c5ad55@googlegroups.com> (raw)
In-Reply-To: <04933b93-d4e1-42b7-9389-5e00a81d13bf@googlegroups.com>

On Thursday, October 17, 2013 8:58:51 AM UTC-5, sbelm...@gmail.com wrote:
> If the client might not be in C anyway, I would put the onus on other units to sort it all out.  Even if a non-C client can be written to figure out a C string, who says the client language can be exported as C convention?  Better to isolate it entirely for when they inevitably change their minds.
> 
> generic
>    type Client_String_Type is private;
>    with function Convert_To_Client(x : String) return Client_String_Type;
>    with procedure External_Prog (y : in Client_String_Type);
> ...
> begin 
>    ...
>    External_Prog (Convert_To_Client("Hello World!"));
>    ...
> 
> -sb

Interesting approach.

I am assuming that the pragmas Convention and Import will do their jobs properly, and anyway, forcing a generic on the clients is almost certain to be rejected.

-- Eryndlia Mavourneen (KK1T)

      reply	other threads:[~2013-10-17 16:28 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-15 19:54 Passing a String to a C/C++ Subprogram (Special Case) Eryndlia Mavourneen
2013-10-15 20:11 ` Adam Beneschan
2013-10-15 21:02   ` Eryndlia Mavourneen
2013-10-16  7:17     ` Dmitry A. Kazakov
2013-10-16 15:14       ` Jeffrey Carter
2013-10-16 17:32     ` Martin
2013-10-16 17:42       ` Eryndlia Mavourneen
2013-10-16 17:54         ` Martin
2013-10-16 18:13           ` Eryndlia Mavourneen
2013-10-16 19:40             ` Simon Wright
2013-10-16 20:02               ` Eryndlia Mavourneen
2013-10-19  2:11           ` Randy Brukardt
2013-10-16 19:11       ` Adam Beneschan
2013-10-16 21:31         ` Martin
2013-10-16 21:41           ` Adam Beneschan
2013-10-16 23:15             ` Martin
2013-10-15 20:59 ` Jeffrey Carter
2013-10-15 21:13   ` Eryndlia Mavourneen
2013-10-15 22:19     ` Shark8
2013-10-16  0:00     ` Jeffrey Carter
2013-10-17  9:55     ` Georg Bauhaus
2013-10-16 20:17 ` sbelmont700
2013-10-16 20:48   ` Adam Beneschan
2013-10-17 13:05     ` Eryndlia Mavourneen
2013-10-17 13:58       ` sbelmont700
2013-10-17 16:28         ` Eryndlia Mavourneen [this message]
replies disabled

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