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,57a1144bacb793b9 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-10 15:46:28 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.algonet.se!algonet!news-stob.telia.net!telia.net!217.209.241.173.MISMATCH!masternews.telia.net.!newsc.telia.net.POSTED!not-for-mail From: David Holm Newsgroups: comp.lang.ada Subject: Re: C binding issue Message-ID: <20030511004621.63e7fbd9.david@realityrift.com> References: X-Newsreader: Sylpheed version 0.8.10claws (GTK+ 1.2.10; i386-portbld-freebsd4.8) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Sat, 10 May 2003 22:46:27 GMT NNTP-Posting-Host: 217.208.105.88 X-Complaints-To: abuse@telia.com X-Trace: newsc.telia.net 1052606787 217.208.105.88 (Sun, 11 May 2003 00:46:27 CEST) NNTP-Posting-Date: Sun, 11 May 2003 00:46:27 CEST Organization: Telia Internet Xref: archiver1.google.com comp.lang.ada:37162 Date: 2003-05-10T22:46:27+00:00 List-Id: Something like this if I'm not mistaken (been a while since I used callbacks in Ada): type size_t_ptr is access all Interfaces.C.size_t; type Lua_Chunkreader_Proc is access function (L : Lua_State_Type; Ptr : System.Address; Sz : size_t_ptr) return Interfaces.C.Strings.chars_ptr; //David Holm On Sat, 10 May 2003 22:30:40 +0200 "kat-Zygfryd" <6667@wp.pl> wrote: > I want to write a binding for Lua 5.0 > but I encountered a problem: > > in lua.h we have this definition: > > typedef const char * (*lua_Chunkreader) (lua_State *L, void *ud, size_t > *sz); > > question: > how do I define such a callback in Ada, so that I could set > the value of *sz from within it. > > Zygfryd > >