comp.lang.ada
 help / color / mirror / Atom feed
* Providing C function With Argv
@ 2002-07-22 15:26 Jeff
  2002-07-23  8:14 ` Ken Thomas
  2002-07-23 13:43 ` Robert Dewar
  0 siblings, 2 replies; 4+ messages in thread
From: Jeff @ 2002-07-22 15:26 UTC (permalink / 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.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-07-24  6:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-22 15:26 Providing C function With Argv Jeff
2002-07-23  8:14 ` Ken Thomas
2002-07-24  6:18   ` Jeff
2002-07-23 13:43 ` Robert Dewar

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