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: a07f3367d7,f0256820d7b60c30 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.glorb.com!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Ada to C interfacing with access on unconstrained array 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: <2ec52d54-31f6-4289-9a9a-d947be65758c@o21g2000vbl.googlegroups.com> Date: Tue, 20 Oct 2009 18:11:15 +0200 Message-ID: <1pe7su4hhh3ul.t10o4zs4n5i2.dlg@40tude.net> NNTP-Posting-Date: 20 Oct 2009 18:11:11 CEST NNTP-Posting-Host: 7404fd50.newsspool4.arcor-online.net X-Trace: DXC=CU0H:`^56Dh9kIfcjg:0fd4IUK On Tue, 20 Oct 2009 06:07:18 -0700 (PDT), dhenry wrote: > I am trying to interface C with Ada: I want to call an Ada procedure > from C. When you pass a pointer to a C array to Ada you have to copy all elements of the array when the types are not compatible, as they are according to what you wrote. Therefore your interface must copy/marshal the parameters, sorry. The best thing you could do is to avoid pool memory allocation. BTW, why type Coco_Type is record X : Integer; Y : Integer; Nuts : Nut_Array_Access; end record; and not type Coco_Type (Size : Natural) is record X : Integer; Y : Integer; Nuts : Nut_Array_Type (1..Size); end record; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de