comp.lang.ada
 help / color / mirror / Atom feed
From: "Ken Thomas" <kst@ecs.soton.ac.uk>
Subject: Re: Providing C function With Argv
Date: Tue, 23 Jul 2002 09:14:21 +0100
Date: 2002-07-23T09:14:21+01:00	[thread overview]
Message-ID: <3d3d0fdd@news.ecs.soton.ac.uk> (raw)
In-Reply-To: fe4bb2c2.0207220726.7502e4bd@posting.google.com

Take a look at the interface to TCL (tash802), there is a package "Cargv"
that does the job.
http://unicoi.kennesaw.edu/ase/ase02_02/bindings/tash/

Ken Thomas

"Jeff" <jeff.huter@bigfoot.com> wrote in message
news:fe4bb2c2.0207220726.7502e4bd@posting.google.com...
> I'm in the process of extending/porting a C program to Ada.  I have an
> Ada main program that needs to call a C function with the parameters
> int argc, char **argv.  With Ada.Command_Line, I've been able to pass
> the C function with int argc.  Using Interfaces.C.Strings, I have even
> been successful supplying a modified version of the C function with a
> Interfaces.C.Strings.chars_ptr to provide the function with a single
> string Argument.  However, I can't seem to figure out how to construct
> and pass the equivalent of a C char ** in order to pass all the
> arguments at once.  My guess is that I need to use
> Interfaces.C.Pointers to construct a Pointer to chars_ptr.  But I've
> had no luck with this approach.
>
> How does one pass a C function the eqivalent of char **?  Is there any
> easier way to accomplish this than to construct the char **argv from
> Ada.Command_Line.Argument?  Working code would be much appreciated
> since I'm rather new to Ada.





  reply	other threads:[~2002-07-23  8:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-22 15:26 Providing C function With Argv Jeff
2002-07-23  8:14 ` Ken Thomas [this message]
2002-07-24  6:18   ` Jeff
2002-07-23 13:43 ` Robert Dewar
replies disabled

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