From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bbbeae4ed07e9626 X-Google-Attributes: gid103376,public From: Samuel Mize Subject: Re: Address to function pointer conversion Date: 1997/06/17 Message-ID: <33A6EF3D.505EEF54@link.com>#1/1 X-Deja-AN: 249155822 References: <5nrq5h$13cm@info4.rus.uni-stuttgart.de> <5o39sm$2fl6@info4.rus.uni-stuttgart.de> <33A5B0B3.7EA663D3@link.com> Organization: PSI Public Usenet Link Newsgroups: comp.lang.ada Date: 1997-06-17T00:00:00+00:00 List-Id: Robert Dewar wrote: > > Sam says > > < so you can't use pragma Import. You still have the problem, how > do you call this address from Ada?>> > > No, on the Ada side the function which of course you Import (I don't > understand your comment about not being able to use Import), returns > an access to procedure value NOT an address. I think I have put it together from several messages: - You specify one or more access-to-function types, with Convention(C). This way, whatever C uses as a pointer to a function -- in this case, an address -- can be called by Ada. This is what I didn't see how to do, but someone else pointed it out. - You import dlsym, which returns a pointer-to-function (an address). You possibly do this several times if you expect it to return functions with different profiles. Then you can call dlsym, and call what it returns. Sam Mize -- -- Samuel Mize (817) 619-8622 smize@link.com "Team Ada" -- Hughes Training Inc. PO Box 6171 m/s 400, Arlington TX 76005