comp.lang.ada
 help / color / mirror / Atom feed
From: jeff.huter@bigfoot.com (Jeff)
Subject: Re: Providing C function With Argv
Date: 23 Jul 2002 23:18:49 -0700
Date: 2002-07-24T06:18:49+00:00	[thread overview]
Message-ID: <fe4bb2c2.0207232218.564cd85@posting.google.com> (raw)
In-Reply-To: 3d3d0fdd@news.ecs.soton.ac.uk

Thanks Ken,

The CArgv and CHelper packages of TASH did the trick.  I only wish I
found them sooner.  It would have saved many hours of hacking in my
feeble attempt to accomplish what I thought should be an "easy" task.
Oh well.  Live and learn.

One bright spot is that I wasn't too far off.  While CArgv and CHelper
are much more elegant, my approach was similar and probably would have
worked with some minor corrections.  However, I decided to use the
CArgv and CHelper packages because they provide functions which should
be helpful in accomplishing my thin port.

Thanks again,

Jeff

"Ken Thomas" <kst@ecs.soton.ac.uk> wrote in message news:<3d3d0fdd@news.ecs.soton.ac.uk>...
> 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-24  6:18 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
2002-07-24  6:18   ` Jeff [this message]
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