Operating System - OpenVMS
1748170 Members
4282 Online
108758 Solutions
New Discussion юеВ

Calling ADA Functions with a C Program

 
SOLVED
Go to solution
Jefferson Humber
Honored Contributor

Calling ADA Functions with a C Program

Can anybody give me an example of how to call ADA functions within a C program ?

We have some old ADA functions which we would like to call in some new C code we are writing.

Can anybody give me any pointers on how to do code this, and ideally how to compile & link the two together.

Thanks in advance,

Jeff
I like a clean bowl & Never go with the zero
4 REPLIES 4
Bojan Nemec
Honored Contributor

Re: Calling ADA Functions with a C Program

Hi,

Look at
http://h71000.www7.hp.com/commercial/ada/documentation.html

In the Run-Time Reference look at Appendix B and in the Developing Ada Products on OpenVMS look at 6.2 Linking Mixed-Language Programs.

http://h71000.www7.hp.com/commercial/c/docs/5492P.html
will help you for C users guide.

Bojan
Wim Van den Wyngaert
Honored Contributor
Solution

Re: Calling ADA Functions with a C Program

Antoniov.
Honored Contributor

Re: Calling ADA Functions with a C Program

Hi Jeff,
differently from other platform, in VMS all passing parameter has managed by OS. This means it isn't important what language you are using but the corresponding of language type and VMS type.
For example I call C routine from COBOL program simply declaring the parameters.
Read carefully the Wim's link because it can help you very much.
I guess you could call ADA function by reference where in parameters point to a copy of value and out parameters point directlu to value.

Antonio Vigliotti

Antonio Maria Vigliotti
Jefferson Humber
Honored Contributor

Re: Calling ADA Functions with a C Program

Thank you all for you help.

That should do the trick I hope.

Cheers,

J
I like a clean bowl & Never go with the zero