comp.lang.ada
 help / color / mirror / Atom feed
From: "Eric G. Miller" <egm2@jps-nospam.net>
Subject: Re: Interfacing to C library...
Date: Sat, 02 Nov 2002 05:10:37 GMT
Date: 2002-11-02T05:10:37+00:00	[thread overview]
Message-ID: <pan.2002.11.02.05.14.57.594236@jps-nospam.net> (raw)
In-Reply-To: n0zw9.2139$bG.200@rwcrnsc53

In <n0zw9.2139$bG.200@rwcrnsc53>, tmora wrote:

>> > I'm working on building an interface to a C library where most of the
>   The Windows bindings available at www.adapower.com do a lot of this.
> 
>> Then write another package that is "thicker", and takes advantage
>> of Ada features like exceptions.
>   For an example of a thick binding, may I modestly suggest you look
> at the source code for Claw available at www.adapower.com
>   The TriAda paper available at
> www.rrsoftware.com/html/prodinf/triadapaper/triada.html
> has a discussion of some the decisions to be made for a thick, Ada-style,
> binding.  Also, IEEE Std 1003.5-1992, on the Ada binding to POSIX,
> also discusses many of these issues.

Okay, how to handle:

/* C header */
struct foo { ... }

long pass_by_value (struct foo); 


-- Ada Spec
type foo is record ... end record;
pragma Convention (C, foo);

function Pass_By_Value (bar : foo) return Long_Integer;
pragma Import (C, Pass_By_Value, "pass_by_value");


Seems Ada always passes records via C pointers. So, the above
doesn't work. Surely, there's a way!  Or do I need a C wrapper for
my Ada wrapper ;-(





  reply	other threads:[~2002-11-02  5:10 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
2002-11-01 17:40   ` tmoran
2002-11-02  5:10     ` Eric G. Miller [this message]
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