comp.lang.ada
 help / color / mirror / Atom feed
From: john@assen.demon.co.uk.nospam (John McCabe)
Subject: Re: Calling C function in Ada
Date: 2000/10/09
Date: 2000-10-09T00:00:00+00:00	[thread overview]
Message-ID: <39e255b3.20834416@news.demon.co.uk> (raw)
In-Reply-To: 8qgon0$469$1@nnrp1.deja.com

ebresie@usa.net wrote:

> I am currently working on trying to have access to some of the protocol
>and service functions which are part of C and I think I am having some
>problems.  I am still very new to using C functions in Ada..so it may
>just be a usage issue.
>
>How is the best way to handle the passing in of the char * type variabls
>and the char ** type variables?

Use Interfaces.C.Strings.chars_ptr and its associated operations for
char * stuff. You mention To_Ada, but you need to use function Value
to return a string, and function New_String to return a chars_ptr from
a string.

As for char **, I used an instantiation of Interfaces.C.Pointers.

Hope this helps.


Best Regards
John McCabe <john@assen.demon.co.uk>




           reply	other threads:[~2000-10-09  0:00 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <8qgon0$469$1@nnrp1.deja.com>]
replies disabled

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