TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender:
"Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
Date:
Tue, 20 Feb 2001 16:37:09 -0800
Reply-To:
Tom Moran <[log in to unmask]>
Subject:
MIME-Version:
1.0
Content-Transfer-Encoding:
7bit
Content-Type:
text/plain; charset=us-ascii
Organization:
Decision Aids
From:
Tom Moran <[log in to unmask]>
Parts/Attachments:
text/plain (13 lines)
> Does anyone know how to call an Ada 95 function by address
> (if possible)? I
> know you can
> in C/C++.
    type Trig_Spec is access function(Theta : Radians) return Float;
    pragma Convention(StdCall, Trig_Spec); -- StdCall or whatever
    A_Function : Trig_Spec;
    ...
    A_Function := -- get a pointer from C program, "access
xyz",                                       --
System.Address_To_Access_Conversions, or whatever
    Y := A_Function(X);

ATOM RSS1 RSS2