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,551b8a667cca72bd,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-08-02 14:38:09 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!wn14feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!sccrnsc01.POSTED!not-for-mail From: Freejack Subject: How to simplify writing C bindings with GNAT. Newsgroups: comp.lang.ada Message-ID: User-Agent: Pan/0.11.4 (Unix) Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Comment-To: ALL NNTP-Posting-Host: 12.245.85.50 X-Complaints-To: abuse@comcast.net X-Trace: sccrnsc01 1059860289 12.245.85.50 (Sat, 02 Aug 2003 21:38:09 GMT) NNTP-Posting-Date: Sat, 02 Aug 2003 21:38:09 GMT Organization: Comcast Online Date: Sat, 02 Aug 2003 21:38:09 GMT Xref: archiver1.google.com comp.lang.ada:41145 Date: 2003-08-02T21:38:09+00:00 List-Id: I'm finding that most of the C types I'm using already have an Ada mapping set up in the GNAT compiler and runtime.The only thing one really needs to dick with are strings and sometimes access/pointer types. The runtime is doing a lot of the tedious work for me. I'm assuming that's because the GNAT environment binds to the native glibc that I have installed on my machine. So, for anyone writing bindings, if the datatype in the C package your writing a binding for corresponds to a type defined on the native platform, try using the GNAT type, you may be pleasantly surprised. GNAT may already have the type imported. Examples include such things as file descriptors, mode flags, etc... However, if you want to go beyond that, such as using Posix permissions, getting process IDs, etc... You'll have to define those yourself. I'm not sure if this works for other compilers though.( GreenHills, Aonix, etc...). Is it the same on the Win32 platform? Anyways..just a tip. Freejack.