comp.lang.ada
 help / color / mirror / Atom feed
From: Marin David Condic <diespammer@flinet.com>
Subject: Re: win32ada design question/problem
Date: 1998/11/23
Date: 1998-11-23T00:00:00+00:00	[thread overview]
Message-ID: <36598228.699CBD1@flinet.com> (raw)
In-Reply-To: 36547645.736EF28F@elca-matrix.ch



Mats Weber wrote:

> David Botton wrote:
>
> > Why wouldn't you use:
> >
> > function C_Function ( X : C.char_array ) returns C.Int;
> > -- int c_function ( char* x);
> >
> > pragma Import (C, C_Function);
> >
> > From my understanding it will be passed by_referrence, ie. as a char *
> > [...]
>
> That is, of course, a good idea (using Ada 95's C interface stuff),
> which its guaranteed to be portable. But that is not the approach taken
> for the win32ada binding, which tried its own, IMO bad, way.
>
> The problem with Interfaces.C.Char is that it is not the same as
> Standard.Character, and Char_Array is not String, so you will have to
> convert all the time, despite the fact that Char = Character on 99.99%
> of all platforms. A pity IMO.

I'll agree that the Win32Ada binding is pretty messy and needlessly complex.
(Why, for example, does it have one type of access to a string and another
type of access to a constant string? Does anything down in the bowels of
Win32api actually check far enought to care?)

However, it its defense, it was supposed to have been largely automatically
generated from the original Win32api C code. That at least has the advantage
that when Micro$oft changes the interface, you can more easily regenerate
the binding.

It would have been nice to get a slightly thicker binding to the interface
which simply allows one to pass the parameters as one would expect to in
Ada, then the underlying code does whatever translation is needed to get it
to work with the actual binding.

MDC
--
Marin David Condic
===========================================================
    "A government that is big enough to give you all you want is big
    enough to take it all away."

        --  Barry Goldwater
===========================================================






  reply	other threads:[~1998-11-23  0:00 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-13  0:00 win32ada design question/problem Mats Weber
1998-11-13  0:00 ` Tom Moran
1998-11-16  0:00   ` Mats Weber
1998-11-18  0:00     ` Tom Moran
1998-11-18  0:00       ` dennison
1998-11-19  0:00       ` Mats Weber
1998-11-19  0:00         ` David Botton
1998-11-19  0:00           ` Mats Weber
1998-11-23  0:00             ` Marin David Condic [this message]
1998-11-19  0:00         ` dennison
1998-11-19  0:00           ` David Botton
1998-11-19  0:00       ` Mats Weber
1998-11-27  0:00     ` Roga Danar
1998-11-13  0:00 ` dennison
1998-11-16  0:00   ` Stephen Leake
1998-11-16  0:00     ` Tucker Taft
1998-11-17  0:00     ` dennison
1998-11-17  0:00       ` Mats Weber
1998-11-17  0:00         ` dennison
1998-11-17  0:00           ` Mats Weber
1998-11-17  0:00           ` Tucker Taft
1998-11-18  0:00             ` Tom Moran
1998-11-18  0:00               ` dennison
  -- strict thread matches above, loose matches on Subject: below --
1998-11-19  0:00 tmoran
1998-11-19  0:00 ` dennison
1998-11-19  0:00   ` Tom Moran
1998-11-20  0:00     ` dennison
1998-11-20  0:00       ` Tom Moran
1998-11-23  0:00     ` Marin David Condic
1998-11-23  0:00       ` Mats Weber
1998-11-24  0:00         ` dennison
replies disabled

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