From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,93621d2e1565f597,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-22 08:26:56 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: jeff.huter@bigfoot.com (Jeff) Newsgroups: comp.lang.ada Subject: Providing C function With Argv Date: 22 Jul 2002 08:26:52 -0700 Organization: http://groups.google.com/ Message-ID: NNTP-Posting-Host: 143.182.124.4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1027351612 10212 127.0.0.1 (22 Jul 2002 15:26:52 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 22 Jul 2002 15:26:52 GMT Xref: archiver1.google.com comp.lang.ada:27300 Date: 2002-07-22T15:26:52+00:00 List-Id: 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.