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-Thread: a07f3367d7,65b902127ca8a604 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!feeder.news-service.com!de-l.enfer-du-nord.net!usenet-fr.net!proxad.net!feeder1-2.proxad.net!cleanfeed1-a.proxad.net!nnrp3-1.free.fr!not-for-mail Date: Fri, 26 Jun 2009 21:27:04 +0200 From: Damien Carbonne User-Agent: Thunderbird 2.0.0.22 (X11/20090605) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Issue with GNAT GPL 2009 and GtkAda References: <4A414EBB.8060204@free.fr> <1avd65rn49abv$.krcxo2gdzb16$.dlg@40tude.net> <4a43c9ce$0$420$426a74cc@news.free.fr> <4a44ae4e$0$6295$4f793bc4@news.tdc.fi> <4a44f758$0$1538$426a74cc@news.free.fr> <3d07k0r3scol$.l2mvcomfxk1c$.dlg@40tude.net> In-Reply-To: <3d07k0r3scol$.l2mvcomfxk1c$.dlg@40tude.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: <4a452109$0$31437$426a34cc@news.free.fr> Organization: Guest of ProXad - France NNTP-Posting-Date: 26 Jun 2009 21:27:05 MEST NNTP-Posting-Host: 82.247.219.63 X-Trace: 1246044425 news-4.free.fr 31437 82.247.219.63:53800 X-Complaints-To: abuse@proxad.net Xref: g2news2.google.com comp.lang.ada:6647 Date: 2009-06-26T21:27:05+02:00 List-Id: Dmitry A. Kazakov a �crit : >> If this is true, it means that using in/out/in out modes is almost >> impossible in the code I write if this code must be mixed with code from >> third party libraries (like GtkAda) that use access almost everywhere. sad. > > No, GtkAda does not use controlled or tagged types when it talks to Gtk. > Such types should not have C convention. Instead of that GtkAda associates > a C type with each tagged Ada one, which serves as a proxy. The address of > this C object can be obtained using the Get_Object call. You will often > find it in the implementation of GtkAda subroutines. > Of course, but I did not meant use of access types to interface C API. Just some examples from Gtk.Tree_Model: function Get_Iter_First (Tree_Model : access Gtk_Tree_Model_Record) return Gtk_Tree_Iter; function Get_Path (Tree_Model : access Gtk_Tree_Model_Record; Iter : Gtk_Tree_Iter) return Gtk_Tree_Path; procedure Next (Tree_Model : access Gtk_Tree_Model_Record; Iter : in out Gtk_Tree_Iter); Why use access everywhere ? In the case of functions, one could argue that "in out" is not possible. But aren't there any cases where in is sufficient for functions ? And for procedures ? Why not write what this: procedure Next (Tree_Model : in [out] Gtk_Tree_Model_Record; Iter : in out Gtk_Tree_Iter); One obvious issue is that modes must be guessed from comments in original C code, or from the C code itself. Thys may be hard to find automatically. Damien