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=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca1.giganews.com!nntp.giganews.com!newspeer1.nac.net!feeder.erje.net!eu.feeder.erje.net!news.etla.org!aioe.org!.POSTED!not-for-mail From: Victor Porton Newsgroups: comp.lang.ada Subject: Re: Binding a C function wit FILE* object Date: Sun, 27 Jul 2014 19:51:56 +0300 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: rFX7cZOSaeuGGZI2vwQTaQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@aioe.org User-Agent: KNode/4.12.4 X-Notice: Filtered by postfilter v. 0.8.2 Xref: number.nntp.dca.giganews.com comp.lang.ada:187943 Date: 2014-07-27T19:51:56+03:00 List-Id: Dan'l Miller wrote: > On Sunday, July 27, 2014 10:45:20 AM UTC-5, Victor Porton wrote: >> I am writing thick bindings for Raptor C library. > > No, as multiple people keep implying or keep telling you overtly: you are > writing a thin binding. If you are asking how to represent a pointer to > FILE almost directly in Ada, then clearly you are writing a thin binding. > Perhaps a thin binding is best for what you envision, but be clear in your > thinking what you are and what you are not doing. > >> What should I do regarding the following function? >> int raptor_uri_print (const raptor_uri *uri, FILE *stream); >> The trouble is that Ada probably has no interface with FILE* objects. > > In a thick binding, Ada would have its own first-class-citizen > representation roughly analogous to FILE (not pointer to FILE), such as a > tagged record for byte-streams in general from which each format of file > is derived into subclasses. Most of my bindings are thick enough, but for this particular function I've made a thin binding (however it throws an exception instead of returning error value). -- Victor Porton - http://portonvictor.org