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,60e2922351e0e780 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-21 20:26:02 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news-hub.siol.net!feed.cgocable.net!read2.cgocable.net.POSTED!53ab2750!not-for-mail Message-ID: <3FBEE54C.E599A704@nospam.cogeco.ca> From: Warren Gay X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Generic thinbinding toolkit for C References: <3FB0B57D.6070906@noplace.com> <3FB22125.1040807@noplace.com> <3FB3751D.5090809@noplace.com> <3FB8B9BC.5040505@noplace.com> <3FBA1118.4060105@noplace.com> <0fxub.48425$bQ3.12107@nwrdny03.gnilink.net> <3FBC2EEC.212A1B5@cogeco.ca> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 21 Nov 2003 23:25:48 -0500 NNTP-Posting-Host: 24.150.168.167 X-Complaints-To: abuse@cogeco.ca X-Trace: read2.cgocable.net 1069475166 24.150.168.167 (Fri, 21 Nov 2003 23:26:06 EST) NNTP-Posting-Date: Fri, 21 Nov 2003 23:26:06 EST Organization: Cogeco Cable Xref: archiver1.google.com comp.lang.ada:2838 Date: 2003-11-21T23:25:48-05:00 List-Id: I am correcting my last post from lunch time (foot in mouth time ;-) "Warren W. Gay VE3WWG" wrote: > Lutz Donnerhacke wrote: > > > * Warren W. Gay VE3WWG wrote: > > > >>Lutz Donnerhacke wrote: > >> > >>>* Warren Gay wrote: > >>> > >>>>What thinbind would be required to do, is to preprocess the header > >>>>file somewhat differently than the C's preprocessor. Instead of > >>> > >>>This destroys most of the original C API in a unusable way. > >> > >>Rubbish. > > > > I beg to differ. You have to write down an example C source using the > > API for the requested thinbinding. Then you preprocess this source code and > > now you can parse the result in order to find out what really happend. > > > > Example: Thinbinding to getc(3). > > #include > > return getc(stdin); > > Well, first of all, you're focusing on the program > that is _using_ getc, that was defined in stdio.h. Cancel that.. OK, the problem at hand is what to do with how the getc() macro code, and how to put that into Ada terms. I agree that this is actually too messy to put into Ada terms (this is a good example for illustration of a near worst case scenario). Probably the best thing that can be done for this is to turn that code into a "wrapped" C function, that is callable by Ada. If such an interface to such as getc() was required, then I think the best way to work with this is to generate a C wrapper module, that is then callable from the generated Ada spec. -- Warren W. Gay VE3WWG http://home.cogeco.ca/~ve3wwg [Remove the nospam from the email address: blame the worms]