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 13:41:31 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!newspeer1-gui.server.ntli.net!ntli.net!newsfep4-win.server.ntli.net.POSTED!53ab2750!not-for-mail From: "chris.danx" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212 X-Accept-Language: en, en-us MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: C code to Ada References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Mon, 20 Jan 2003 21:43:09 +0000 NNTP-Posting-Host: 80.4.69.150 X-Complaints-To: abuse@ntlworld.com X-Trace: newsfep4-win.server.ntli.net 1043098890 80.4.69.150 (Mon, 20 Jan 2003 21:41:30 GMT) NNTP-Posting-Date: Mon, 20 Jan 2003 21:41:30 GMT Organization: ntl Cablemodem News Service Xref: archiver1.google.com comp.lang.ada:33253 Date: 2003-01-20T21:43:09+00:00 List-Id: sk wrote: > Hi, > > I had a binding (lost due to a misplaced "mkfs /dev/...") oops! > but I am not sure where you are getting the "__THROW" > from. from /usr/include/dlfcn.h > When I was playing with shared-libraries etc (based on the > Linux-Documentation-Project Program-Library-HOWTO), I did > "man dlopen" and bound to the functions specified > > From "man dlopen" ... Cheers will look at that! > #include > > void *dlopen(const char *filename, int flag); > > So ... > > ICS => Interfaces.C.Strings; > IC => Interfaces.C; > > procedure Dlopen ( > Name : ICS.Chars_Ptr; -- <= Assign with ICS.New_String > Mode : IC.Int > ); I don't understand this. Why procedure? The return type of dlopen is not void (a procedure), but void* (a pointer to an unknown object - unknown to the client because dereferencing directly on void* isn't allowed; you have to cast it before you can dereference it). It's where you get the handle from and what's causing me the most problems. > procedure Dlsym (Handle : System.Address; Symbol : IC.Char_Array) > > function Dlclose return IC.Int; > > Translating > "(void)" typically translates to parameterless function/procedure > "void function-name" typically translates to an Ada procedure See above. > The best source I found dealing with dl* is in the above mentioned > howto. With some care, the special library functions "init" > and "fini" can be nicely related to "adainit" and "adafinal" > needed to make a stand-alone shared/dynamic library all using > Ada and GNAT :-) I don't understand but I'll look at this a little later. Thanks, Chris -- for personal replies change spamoff to chris