comp.lang.ada
 help / color / mirror / Atom feed
From: Victor Porton <porton@narod.ru>
Subject: Re: Binding a C function wit FILE* object
Date: Sun, 27 Jul 2014 19:51:56 +0300
Date: 2014-07-27T19:51:56+03:00	[thread overview]
Message-ID: <lr3an8$s5r$1@speranza.aioe.org> (raw)
In-Reply-To: e449cec0-a92c-4dc1-a8e7-baf68f3263d8@googlegroups.com

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


      reply	other threads:[~2014-07-27 16:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-27 15:45 Binding a C function wit FILE* object Victor Porton
2014-07-27 16:34 ` Dan'l Miller
2014-07-27 16:51   ` Victor Porton [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox