comp.lang.ada
 help / color / mirror / Atom feed
From: jeff.huter@bigfoot.com (Jeff)
Subject: Providing C function With Argv
Date: 22 Jul 2002 08:26:52 -0700
Date: 2002-07-22T15:26:52+00:00	[thread overview]
Message-ID: <fe4bb2c2.0207220726.7502e4bd@posting.google.com> (raw)

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-22 15:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-22 15:26 Jeff [this message]
2002-07-23  8:14 ` Providing C function With Argv Ken Thomas
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