comp.lang.ada
 help / color / mirror / Atom feed
From: sbelmont700@gmail.com
Subject: Re: Passing a String to a C/C++ Subprogram (Special Case)
Date: Thu, 17 Oct 2013 06:58:51 -0700 (PDT)
Date: 2013-10-17T06:58:51-07:00	[thread overview]
Message-ID: <04933b93-d4e1-42b7-9389-5e00a81d13bf@googlegroups.com> (raw)
In-Reply-To: <24ce5a1f-99e6-465c-b986-85fc09e84ee6@googlegroups.com>

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

  reply	other threads:[~2013-10-17 13:58 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 [this message]
2013-10-17 16:28         ` Eryndlia Mavourneen
replies disabled

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