comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Interfacing to C library...
Date: Fri, 1 Nov 2002 17:11:06 GMT
Date: 2002-11-01T17:11:06+00:00	[thread overview]
Message-ID: <wccpttp2p1x.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: pan.2002.11.01.15.38.12.168069@jps-nospam.net

"Eric G. Miller" <egm2@jps-nospam.net> writes:

> I'm working on building an interface to a C library where most of the
> functions are defined as returning a long integer containing the various
> error codes returned by each function and data is passed back from the
> "functions" via pointer arguments to [usually] structures.  Below is
> something of a demonstration of what I've come up with, but I'd appreciate
> pointers to better approaches.  Eventually, I'd like to hide the access
> type and handle the error codes another way (exceptions maybe...).

First write a "thin" interface, which is as close to the C code as
possible.  E.g., use a modular type for your error codes, as you did.

Then write another package that is "thicker", and takes advantage
of Ada features like exceptions.

- Bob



  reply	other threads:[~2002-11-01 17:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-01 15:38 Interfacing to C library Eric G. Miller
2002-11-01 17:11 ` Robert A Duff [this message]
2002-11-01 17:40   ` tmoran
2002-11-02  5:10     ` Eric G. Miller
2002-11-02  6:02       ` tmoran
2002-11-02 16:10       ` Robert A Duff
2002-11-02 18:35         ` Eric G. Miller
2002-11-02 18:55           ` Robert A Duff
2002-11-02 23:59             ` Eric G. Miller
2002-11-03 16:47               ` Robert A Duff
2002-11-03 18:55                 ` Eric G. Miller
2002-11-03  9:28             ` Dale Stanbrough
replies disabled

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