lanceboyle@qwest.net wrote:
[snip]
I have not been able to solve the problem when calling _p_initialize from Ada. I still get the Ada compiler telling me, "too many arguments in call." I suspect that I might be passing the wrong _kinds_ of arguments but not the wrong number.
Does GNAT support the Interfaces.C package as described in the Ada 95 LRM "B.3 Interfacing with C" http://www.adahome.com/LRM/95/rm95html/rm9x-B-03.html? If GNAT does support it, that seems to me to be the easiest way to get your Pascal interfacing going. It looks like all the necessary C types and conversions going to and from C are pre-canned for relatively easy Ada usage. (At the bottom of the reference web page, there's also an example of interfacing to C's "strcpy" function which might give a few tips on getting p_initialize working.)
procedure p_initialize; pragma Import(Convention => C, Entity => p_initialize,
External_Name => "_p_initialize");
I think you need to declare p_initialize with Ada to C equivalents of the four parameters for p_initialize that Adriaan has already discussed.
Ada isn't assembly language you know. Ada was designed so that "shot your foot off" errors like passing more (or fewer) parameters to external routines would be caught at compile time instead of at "really embarrassing" times like aircraft in flight. With that declaration, you've told the compiler p_initialize doesn't take any parameters. So, the compiler isn't going to let you "shot your foot off" by passing parameters to an external routine that you've declared takes no parameters.
Gale Paeper gpaeper@empirenet.com