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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,814bd9dd1692da42 X-Google-Attributes: gid103376,public From: Markus Kuhn Subject: Re: Calling C time function from ADA-95 Date: 1998/06/07 Message-ID: <357A6297.24954982@cl.cam.ac.uk>#1/1 X-Deja-AN: 360349139 Content-Transfer-Encoding: 7bit References: <3579da75.13533758@enews.newsguy.com> Content-Type: text/plain; charset=us-ascii Organization: Cambridge University, Computer Laboratory Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-06-07T00:00:00+00:00 List-Id: Faust! wrote: > Looking for a way to call out to time.h for system clock information > from Ada-95..... For easy POSIX and C API access, you should install a POSIX.5 binding. A freely available one is FLORIST on http://www.cs.fsu.edu/~baker/florist.html Without such a binding, portable access to C/POSIX libs is rather messy in Ada, because Ada doesn't allow you to access the preprocessor constants in *.h files and you have to copy them manually or write an install skript that transforms .h files into .ads files. Bindings such as FLORIST have all these constants converted for you into Ada constants and you can then use them in a portable way. In addition, reading the FLORIST source code is a good way of learning how to write mixed Ada/C programms. Have a look at it. I don't use Florist at the moment, because it does not run on new Linux systems with glibc2 (e.g., Red Hat 5.0). What I do is to cut and paste from Florist my own POSIX binding together with only the functionality that I need in my application. This works very nicely, and since I use the same API, I can easily throw away my own binding and replace it by the full Florist package once it runs on Red Hat 5. Even if Florist does not yet run on your OS, the posix.ads and posix-c.ads files that it installs are *very* valuable sources of cut-and-paste material for your own quick-n-dirty bindings. Markus -- Markus G. Kuhn, Security Group, Computer Lab, Cambridge University, UK email: mkuhn at acm.org, home page: