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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,32d4b7099c3e0137 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-20 22:19:23 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!kibo.news.demon.net!demon!news.demon.co.uk!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: C code to Ada Date: 21 Jan 2003 06:18:33 +0000 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: <3E2CAFED.4080705@acm.org> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1043129962 8390 62.49.19.209 (21 Jan 2003 06:19:22 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Tue, 21 Jan 2003 06:19:22 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: archiver1.google.com comp.lang.ada:33276 Date: 2003-01-21T06:18:33+00:00 List-Id: Jeffrey Carter writes: > function Dlsym (File : Handle; Symbol : ICS.Chars_Ptr) return Handle; The function return corresponding to a subprogram is an access-to-subprogram (probably with convention C -- certainly a thin pointer). I would have thought you'd need several overloadings, which would probably have to be supplied by the user: type p is procedure (x : integer); pragma convention (c, p); type f is function return integer; pragma convention (c, f); type ip is access all integer; pragma convention (c, ip); -- OTT for plain integers, I guess function dlsym (in_library : handle; named : ics.chars_ptr) return p; function dlsym (in_library : handle; named : ics.chars_ptr) return f; function dlsym (in_library : handle; named : ics.chars_ptr) return ip; pragma import (c, dlsym, "dlsym");