comp.lang.ada
 help / color / mirror / Atom feed
From: Vadim Godunko <vgodunko@gmail.com>
Subject: Re: Trouble writing Ada callback from C
Date: Sat, 12 Sep 2009 11:40:27 -0700 (PDT)
Date: 2009-09-12T11:40:27-07:00	[thread overview]
Message-ID: <241a6745-0848-4bd0-bb1b-1e826e084911@j19g2000yqk.googlegroups.com> (raw)
In-Reply-To: e54f9d08-3083-4c98-974f-9695005679b3@x6g2000prc.googlegroups.com

On Sep 11, 11:57 am, Jerry <lancebo...@qwest.net> wrote:
> I have a problem with writing an Ada procedure, used as a callback
> from C, in which one of the arguments is an output char * (in the C
> version). The actual length of the returned "string" isn't known at
> calling time, even though the caller apparently allocates 40
> characters (see below). However, the actual number of characters
> returned by the C version is less than 40.
>
> My problem is how to pass probably a char_array back out which is the
> correct length, but which length is not known at the time the Ada
> callback is called from C.
>

subtype constrained_char_array is Interfaces.C.char_array (1 .. 40);

procedure Y (X : out constrained_char_array);
pragma Convention (C, Y);



  parent reply	other threads:[~2009-09-12 18:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-11  7:57 Trouble writing Ada callback from C Jerry
2009-09-11  8:24 ` Ludovic Brenta
2009-09-11 20:38   ` sjw
2009-09-12  5:28   ` Jerry
2009-09-12  5:46     ` sjw
2009-09-16 23:06       ` Jerry
2009-09-12  8:44     ` Georg Bauhaus
2009-09-12 18:40 ` Vadim Godunko [this message]
2009-09-16 23:19   ` Jerry
replies disabled

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