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.3 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6551851a97ba5421 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-30 00:58:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.ems.psu.edu!news.cis.ohio-state.edu!news.maxwell.syr.edu!newsfeed.stueberl.de!teaser.fr!enst!enst.fr!not-for-mail From: sk Newsgroups: comp.lang.ada Subject: Re: C lib returns char** - How in ADA? Date: Thu, 30 May 2002 02:56:37 -0500 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: References: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1022745482 94243 137.194.161.2 (30 May 2002 07:58:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Thu, 30 May 2002 07:58:02 +0000 (UTC) Return-Path: X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.19-4.3mdk i686) X-Accept-Language: en Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.8 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:24990 Date: 2002-05-30T02:56:37-05:00 Hi, I mistakenly hit the send before finishing ... Have a look at package Interfaces.C.Strings in the references manual. The package provides : type char_array_access is access all char_array; type chars_ptr is private; type chars_ptr_array is array (size_t range <>) of chars_ptr; which appears to be what you are looking for. +++ Then look at Interfaces.C.Pointers. It gets tricky since you are importing a non-Ada object, but package IC renames Interfaces.C; package ICS renames Interfaces.C.Strings; package ICP is new Interfaces.C.Pointers ( Index => IC.Size_t, Element => ICS.Chars_Ptr, Element_Array => ICS.Chars_Ptr_Array, Default_Terminator => ??????? ); Cannot remember what should be, ICP.Copy_Terminated_Array (...) should get the foreign data structure into your application. Its been a while since I played with this, so details are fuzzy .. except that I quickly found a hack to replace the way you are supposed to do it described above :-) -- ------------------------------------- -- Merge vertically for real address ------------------------------------- s n p @ t . o k i e k c c m -------------------------------------