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,e289b5ceae0f39c3 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-21 15:52:28 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!newspeer1-gui.server.ntli.net!ntli.net!newsfep4-glfd.server.ntli.net.POSTED!53ab2750!not-for-mail From: chris User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Binding to C References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Mon, 21 Jul 2003 23:57:36 +0200 NNTP-Posting-Host: 81.98.236.164 X-Complaints-To: abuse@ntlworld.com X-Trace: newsfep4-glfd.server.ntli.net 1058827945 81.98.236.164 (Mon, 21 Jul 2003 23:52:25 BST) NNTP-Posting-Date: Mon, 21 Jul 2003 23:52:25 BST Organization: ntl Cablemodem News Service Xref: archiver1.google.com comp.lang.ada:40590 Date: 2003-07-21T23:57:36+02:00 List-Id: tmoran@acm.org wrote: >>Also does anyone have any advice in general mapping to C. > > Look at some of the Windows binding source code at www.adapower.com > >>For the jpeg_error_mgr struct, I mapped ptrs to functions to System.Address >>and made the struct a record. Will this work, or will the corresponding >>type of the struct have to be a System.Address? > > You almost never need a System.Address. Use access types. Thanks, I've converted the small amount done so far to use access types. What about unions? I don't really care what's in the union, it's under the control of the lib, should I put a char_array of size JMSG_STR_PARM_MAX in there? struct jpeg_error_msg { ... union { int i[8]; char s[JMSG_STR_PARM_MAX]; } msg_parm; } chris -- to reply change 'spamoff' to 'chris'