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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e289b5ceae0f39c3 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-08-09 04:26:18 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!kibo.news.demon.net!demon!proxad.net!feeder2-1.proxad.net!news1-2.free.fr!not-for-mail From: "Patrice Freydiere" Subject: Re: Binding to C Date: Sat, 09 Aug 2003 13:29:03 +0200 User-Agent: Pan/0.13.0 (The whole remains beautiful) Message-ID: Newsgroups: comp.lang.ada References: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Organization: Guest of ProXad - France NNTP-Posting-Date: 09 Aug 2003 13:26:17 MEST NNTP-Posting-Host: 62.147.22.110 X-Trace: 1060428377 news1-2.free.fr 223 62.147.22.110:33014 X-Complaints-To: abuse@proxad.net Xref: archiver1.google.com comp.lang.ada:41274 Date: 2003-08-09T13:26:17+02:00 List-Id: Chris, if you are looking for building a complete full Jpeg binding, your can browse the AGP project (ada game programming) it contains a jpeg binding, and a PNG binding. so it can gives you some ideas for C binding from ADA. hope this help. Patrice ps: when i started writing the simplejpeglib binding for ADA. i had a lot of interfacing problems du to the portability macros of the jpeglib. (it's surely possible, but when i've started my binding, my C interfacing Skills from ADA was poor). So i decided in my design to build a simple C interface to make Ada binding easier. This permit me to be "C structure independent" and provide a more easy upgrade of the jpeglib. On Mon, 21 Jul 2003 20:59:30 +0200, chris wrote: > Hi, > > I came across the following in libjpeg... what should I map it to? > > const char* const* jpeg_message_table > > Also does anyone have any advice in general mapping to C. 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? > > > Chris > > package Low_Jpg.Error is > > package C renames Interfaces.C; > > type Jpeg_Error_Mgr is record > Error_Exit : System.Address; -- addr of a handler > Emit_Message : System.Address; > Output_Message : System.Address; > Format_Message : System.Address; > Reset_Error_Mgr : System.Address; > Msg_Code : C.Int; > Msg_Parm : System.Address; > Trace_Level : C.Int; > Num_Warnings : C.Long; > end record; > pragma Convention (C, Jpeg_Error_Mgr); > > end Low_Jpg.Error;