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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,93621d2e1565f597 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-23 01:21:06 PST From: "Ken Thomas" Newsgroups: comp.lang.ada References: Subject: Re: Providing C function With Argv Date: Tue, 23 Jul 2002 09:14:21 +0100 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 NNTP-Posting-Host: akela.ecs.soton.ac.uk Message-ID: <3d3d0fdd@news.ecs.soton.ac.uk> X-Trace: 23 Jul 2002 09:12:13 GMT, akela.ecs.soton.ac.uk Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!news.mailgate.org!newsfeed.wirehub.nl!news-hub.cableinet.net!blueyonder!peer.news.eu-x.com!server2.netnews.ja.net!news-spool.soton.ac.uk!news.ecs.soton.ac.uk!akela.ecs.soton.ac.uk Xref: archiver1.google.com comp.lang.ada:27328 Date: 2002-07-23T09:14:21+01:00 List-Id: 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" 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.