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 18:27:11 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn14feed!wn12feed!worldnet.att.net!207.217.77.102!newsfeed2.earthlink.net!newsfeed1.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3E2CAFED.4080705@acm.org> From: Jeffrey Carter User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: C code to Ada References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 21 Jan 2003 02:27:11 GMT NNTP-Posting-Host: 63.184.17.66 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 1043116031 63.184.17.66 (Mon, 20 Jan 2003 18:27:11 PST) NNTP-Posting-Date: Mon, 20 Jan 2003 18:27:11 PST Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:33265 Date: 2003-01-21T02:27:11+00:00 List-Id: sk wrote: > > 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" ... > > > #include > > void *dlopen(const char *filename, int flag); > const char *dlerror(void); > void *dlsym(void *handle, char *symbol); > int dlclose(void *handle); > > So ... > > ICS => Interfaces.C.Strings; > IC => Interfaces.C; > > procedure Dlopen ( > Name : ICS.Chars_Ptr; -- <= Assign with ICS.New_String > Mode : IC.Int > ); Looks more like type Handle is private; function Dlopen (Name : IC.Char_Array; Mode : IC.Int) return Handle; > > function DlError return ICS.Chars_Ptr; > -- Need to check man for the return parameter ... > -- ... this also seems to be an example of the > -- message being allocated in called function address > -- space (havn't time to double check for now). This looks OK. > > procedure Dlsym (Handle : System.Address; Symbol : IC.Char_Array) Is Symbol an output from this function? Maybe function Dlsym (File : Handle; Symbol : ICS.Chars_Ptr) return Handle; Not sure what the return value is. > > function Dlclose return IC.Int; function Dlclose (File : Handle) return IC.Int; private type Handle is access all Integer; pragma Convention (C, Handle); -- pragma Import (C ... for all the operations. -- Jeff Carter "Nobody expects the Spanish Inquisition!" Monty Python's Flying Circus