[comp.lang.ada] C functions calling {C++/Ada/...} functions

crocker@motcid.UUCP (Ronald T. Crocker) (03/27/91)

I'm looking at building a software system where (generated) C
functions must call some library functions.  The library functions are
currently in both C++ and Ada; they don't have too many problems
calling C functions.  The major problem that I'm having is having the
C functions call the C++ and Ada code.  Is there something that I can
do mechanically to set up interfaces between C functions and C++ or
Ada functions.  In particular:

	+ Do I have to worry about stack frame argument positions.  I
	  know that C++ uses C function calling conventions because it
	  generates C code.  Does Ada use the same calling conventions?  
	  Is this a compiler-dependent problem?

	+ Are there run-time type-conversion problems that I might run
	  into? Again, C++ == C in this regard, but what about Ada?

	+ How do I know what the name of the (C++/Ada) function that I
	  want to call is?  The C++ function A::f can't be called like
	  that from a C program; it simply doesn't know what that is.
	  The same problem exists for Ada.  Is there a simple approach
	  to this problem? Is this compiler dependent?

Please respond via email to crocker@mot.com. I'll summarize and post
if there is enough interest.



-- 
Ron Crocker
Motorola Radio-Telephone Systems Group, Cellular Infrastructure Group
(708) 632-4752 [FAX: (708) 632-4430]
crocker@mot.com or uunet!motcid!crocker