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=0.7 required=5.0 tests=BAYES_00,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f58edf3a3fc00db,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-12-19 14:40:06 PST Path: supernews.google.com!sn-xit-02!supernews.com!newsfeed.mesh.ad.jp!nntp1.njy.teleglobe.net!teleglobe.net!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Chris Newsgroups: comp.lang.ada Subject: Interface to C; Storage_Error Date: Tue, 19 Dec 2000 22:28:11 GMT Organization: Deja.com Message-ID: <91ondg$lpu$1@nnrp1.deja.com> NNTP-Posting-Host: 63.164.137.27 X-Article-Creation-Date: Tue Dec 19 22:28:11 2000 GMT X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) X-Http-Proxy: 1.1 x60.deja.com:80 (Squid/1.1.22) for client 63.164.137.27 X-MyDeja-Info: XMYDJUIDenderx12 Xref: supernews.google.com comp.lang.ada:3267 Date: 2000-12-19T22:28:11+00:00 List-Id: Hi, all... after a long hiatus in the C++ world, I'm finally getting a chance to do some more Ada work, at my own suggestion. The ability to write production-quality multithread code an order of magnitude faster in Ada might have something to do with it. Anyway, I'm having an irritating problem interfacing with a vendor C library. The relevant stuff: typedef void* SRV_HANDLE; typedef void* CTX_HANDLE; typedef void* RSLT_HANDLE; typedef void* FLT_HANDLE; int GetNextVal(SRV_HANDLE srv, RSLT_HANDLE rslt, CTX_HANDLE *ctx, char* name, double* dbl, FLT_HANDLE flt); My take on it in Ada (GNAT 3.13p) is: type Srv_Handle is new System.Address; -- same for the other handles procedure GetNextVal(Ret : out int; Srv : Srv_Handle; Rslt : Rslt_Handle; Ctx : access Ctx_Handle; Name : out chars_ptr; Dbl : access double; Flt : Flt_Handle); pragma Import(C, GetNextVal); pragma Import_Valued_Procedure(GetNextVal); Both Name and Dbl are supposedly set/alloc'd by the library. When I call this, it raises Storage_Error on the library call. I am totally stumped as to what to fix, or even where to look. Is my Ada declaration even remotely correct? Other suggestions? Many thanks. --chris Sent via Deja.com http://www.deja.com/