comp.lang.ada
 help / color / mirror / Atom feed
From: Mark Johnson <mark_h_johnson@raytheon.com>
Subject: Re: List of C function usable in Ada
Date: Tue, 15 Oct 2002 12:20:28 -0500
Date: 2002-10-15T12:20:28-05:00	[thread overview]
Message-ID: <3DAC4E5C.84EE0A3A@raytheon.com> (raw)
In-Reply-To: f543abcaab0dee6d827c307fd414ddb7.110780@mygate.mailgate.org

Sim Con wrote:
> 
> Hello! where can i find a list of C functions (with parameters and what
> they do)usable in Ada? Thanx in advance ^_^
> 
Hmm. I don't quite think you received a direct answer to your query.
Just about any C function can be called from Ada with a suitable
compiler. To get a list of C functions (on Unix or Linux), I suggest
running xman, select Manual Page, and then select sections 2 or 3 to get
a list of system calls and functions. Depending on your set up, a few
other sections may also have callable functions - YMMV.

Of course, the next question is "how" to call them and the necessary
interfaces that are needed. As commented in other replies, you *could*
call strlen to determine the length of a null terminated string.
However, a string in Ada may or may not be terminated by nulls. You
would have to do the conversion between Ada and C strings before calling
strlen. You should use the features documented in Annex B (interface
pragmas, the package Interfaces) as well.

Having said all that, you might be better off using the capabilities
that Ada already provides before calling any C functions.

Good luck.
  --Mark



  parent reply	other threads:[~2002-10-15 17:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-15  9:43 List of C function usable in Ada Sim Con
2002-10-15 10:58 ` Dale Stanbrough
2002-10-15 17:20 ` Mark Johnson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-10-15  9:47 Grein, Christoph
2002-10-15 10:29 ` Sim Con
2002-10-15 10:34   ` Preben Randhol
2002-10-15 12:20     ` Sim Con
2002-10-15 13:09       ` Preben Randhol
2002-10-17  5:45   ` Gisle Sælensminde
2002-10-15 11:03 Grein, Christoph
2002-10-15 12:53 Grein, Christoph
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox