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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable 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:30:30 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!fr.clara.net!heighliner.fr.clara.net!freenix!enst.fr!not-for-mail From: sk Newsgroups: comp.lang.ada Subject: Re: C code to Ada Date: Mon, 20 Jan 2003 15:33:31 -0600 Organization: ENST, France Message-ID: References: Reply-To: "comp.lang.ada mail to news gateway" NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1043098229 70115 137.194.161.2 (20 Jan 2003 21:30:29 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Mon, 20 Jan 2003 21:30:29 +0000 (UTC) To: "comp.lang.ada mail to news gateway" Return-Path: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020828 X-Accept-Language: en-us, en X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.1 Precedence: list List-Id: comp.lang.ada mail to news gateway List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:33251 Date: 2003-01-20T15:33:31-06:00 Hi, I had a binding (lost due to a misplaced "mkfs /dev/...") but I am not sure where you are getting the "__THROW" from. 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 ); 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). 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 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 :-) -- -- -- Merge vertically for real address -- ------------------------------------ -- s n p @ t . o -- k i e k c c m ------------------------------------