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-Thread: 103376,5526cbaedf4542a4 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.235.4 with SMTP id ui4mr3607209pbc.3.1330963687310; Mon, 05 Mar 2012 08:08:07 -0800 (PST) Path: h9ni42552pbe.0!nntp.google.com!news1.google.com!goblin2!goblin.stu.neva.ru!aioe.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: ADTs C to Ada Date: Mon, 05 Mar 2012 16:08:05 +0000 Organization: A noiseless patient Spider Message-ID: References: <28640131.3602.1330956581432.JavaMail.geo-discussion-forums@vbw15> Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="20729"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/uVxS5W3GZKzo1dAbeHm3r8q+x9Ii8rZs=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (darwin) Cancel-Lock: sha1:C/7L9BX+goYnSUawUe1GatE4dVQ= sha1:hUp/+KFtQFAOFfUOjzGcZ5O6Gkk= Content-Type: text/plain; charset=us-ascii Date: 2012-03-05T16:08:05+00:00 List-Id: Patrick writes: > I am studying Ada and making progress. The C interface seems straight > forward enough for functions, strings pointers and such but I am > having trouble finding any information on how to interface with stucts > that contain functions. The thing to be careful of here is what the library does to the pointer-to-subprogram. It's most likely to store it away somwehere and call it in a different context, which would mean that the subprogram might get called without the Ada environment it expects. See my response in this thread: https://groups.google.com/forum/?fromgroups#!searchin/comp.lang.ada/.threads/comp.lang.ada/Kl9hmcPMDos/-H_XoJYQvDkJ