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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c1bdceb867926fdb X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!goblin3!goblin1!goblin.stu.neva.ru!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Interfacing Ada with C Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: Date: Sat, 24 Jul 2010 18:44:42 +0200 Message-ID: <8my12mw8eviw$.q38bp6e79qfh.dlg@40tude.net> NNTP-Posting-Date: 24 Jul 2010 18:44:43 CEST NNTP-Posting-Host: 4d79ef6e.newsspool1.arcor-online.net X-Trace: DXC=;B_mnCe0^9mj5k5aEF7ISmic==]BZ:afn4Fo<]lROoRa<`=YMgDjhgb^GM=LloHJF`[6LHn;2LCVn[0l7``nD919[HYVEPk X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:12528 Date: 2010-07-24T18:44:43+02:00 List-Id: On Sat, 24 Jul 2010 04:57:53 -0700 (PDT), Ada novice wrote: > So in essence I'm looking for examples which illustrate how to pass > some data (e.g a matrix) from Ada to C, Since C does not have arrays, especially 2D ones, you will have some custom representation on the C side. It means that examples of bindings (there are plenty of) won't help you unless you understand how you describe a C-compatible object in Ada. > do some computations on the > matrix and return the results to the Ada environment. Even more so, because C cannot return a compound object. Different C libraries use different tricks to work around this. I would propose reading RM B.3 and B.3.2. Another thing you have to understand is the issue of flat arrays vs. arrays with a dope. The latter cannot be used with C. Provided you know C well, the rest is simple. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de