comp.lang.ada
 help / color / mirror / Atom feed
* importing a C header into Ada
@ 2004-10-19 14:10 Adrien Plisson
  2004-10-19 16:46 ` Simon Clubley
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Adrien Plisson @ 2004-10-19 14:10 UTC (permalink / raw)


hello,

maybe this topic has already been discussed here, but i can't find any 
information about that.

i have a specific hardware (an i/o board) that i have to use in a system i am 
developing. unfortunately, the manufacturer of this hardware knows nothing 
about Ada and so gives only a C header file and the corresponding .lib file to 
interface with the driver.

i know it is possible to import C functions into Ada through Pragma Import, but 
the header file is somehow big and i don't want to make any mistake while 
writing the functions definitions.

so, is there any piece of software which would automagically convert my C 
header into a valid Ada package specification ?

(i am using GNAT 3.15p on windows)

thanks in advance.

-- 
rien



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: importing a C header into Ada
  2004-10-19 14:10 importing a C header into Ada Adrien Plisson
@ 2004-10-19 16:46 ` Simon Clubley
  2004-10-20  2:54   ` Steve
  2004-10-19 17:14 ` Jean-Pierre Rosen
  2004-10-20  7:06 ` Michael Paus
  2 siblings, 1 reply; 7+ messages in thread
From: Simon Clubley @ 2004-10-19 16:46 UTC (permalink / raw)


In article <417521b7$0$1427$ba620e4c@news.skynet.be>, Adrien Plisson <aplisson-news@stochastique.net> writes:
> 
> so, is there any piece of software which would automagically convert my C 
> header into a valid Ada package specification ?
> 

Have you looked at c2ada (search Google for the URL) ?

I've never tried it, so I don't know how good or otherwise it is.

Simon.

-- 
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP       
Microsoft: The Standard Oil Company of the 21st century



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: importing a C header into Ada
  2004-10-19 14:10 importing a C header into Ada Adrien Plisson
  2004-10-19 16:46 ` Simon Clubley
@ 2004-10-19 17:14 ` Jean-Pierre Rosen
  2004-10-20  7:06 ` Michael Paus
  2 siblings, 0 replies; 7+ messages in thread
From: Jean-Pierre Rosen @ 2004-10-19 17:14 UTC (permalink / raw)


Adrien Plisson a écrit :

> so, is there any piece of software which would automagically convert my 
> C header into a valid Ada package specification ?
There is c2ada, of which I happen to have a copy.
If you want it, just ask by private e-mail
> 
> (i am using GNAT 3.15p on windows)
> 
The version I have is prebuilt for Linux, but it can be compiled for 
windows provided you install Python and a few other things.

-- 
---------------------------------------------------------
            J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: importing a C header into Ada
  2004-10-19 16:46 ` Simon Clubley
@ 2004-10-20  2:54   ` Steve
  0 siblings, 0 replies; 7+ messages in thread
From: Steve @ 2004-10-20  2:54 UTC (permalink / raw)


Also look at cbind.

Steve
(The Duck)

"Simon Clubley" <clubley@remove_me.eisner.decus.org-Earth.UFP> wrote in
message news:jTRnKljgNCkv@eisner.encompasserve.org...
> In article <417521b7$0$1427$ba620e4c@news.skynet.be>, Adrien Plisson
<aplisson-news@stochastique.net> writes:
> >
> > so, is there any piece of software which would automagically convert my
C
> > header into a valid Ada package specification ?
> >
>
> Have you looked at c2ada (search Google for the URL) ?
>
> I've never tried it, so I don't know how good or otherwise it is.
>
> Simon.
>
> -- 
> Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
> Microsoft: The Standard Oil Company of the 21st century





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: importing a C header into Ada
  2004-10-19 14:10 importing a C header into Ada Adrien Plisson
  2004-10-19 16:46 ` Simon Clubley
  2004-10-19 17:14 ` Jean-Pierre Rosen
@ 2004-10-20  7:06 ` Michael Paus
  2004-10-21 15:52   ` Adrien Plisson
  2 siblings, 1 reply; 7+ messages in thread
From: Michael Paus @ 2004-10-20  7:06 UTC (permalink / raw)


Adrien Plisson wrote:

> so, is there any piece of software which would automagically convert my 
> C header into a valid Ada package specification ?

You can also give cbind a try which is readily available for Windows at:
   <http://members.tripod.com/vagul/cbind4win32.zip>

Michael




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: importing a C header into Ada
  2004-10-20  7:06 ` Michael Paus
@ 2004-10-21 15:52   ` Adrien Plisson
  2004-10-21 17:03     ` Jean-Pierre Rosen
  0 siblings, 1 reply; 7+ messages in thread
From: Adrien Plisson @ 2004-10-21 15:52 UTC (permalink / raw)


Michael Paus wrote:
> You can also give cbind a try which is readily available for Windows at:
>   <http://members.tripod.com/vagul/cbind4win32.zip>

c2ada does not come with source and i wasn't able to find a windows binary for it.

cbind went ok as far as i removed the #include <windows.h> line. i just need to 
tweak the generated code to get everything running.

thanks a lot !

-- 
rien



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: importing a C header into Ada
  2004-10-21 15:52   ` Adrien Plisson
@ 2004-10-21 17:03     ` Jean-Pierre Rosen
  0 siblings, 0 replies; 7+ messages in thread
From: Jean-Pierre Rosen @ 2004-10-21 17:03 UTC (permalink / raw)


Adrien Plisson a écrit :

> c2ada does not come with source and i wasn't able to find a windows 
> binary for it.
> 
??? I have the latest version with source. Just ask me if you want it.

-- 
---------------------------------------------------------
            J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-10-21 17:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-19 14:10 importing a C header into Ada Adrien Plisson
2004-10-19 16:46 ` Simon Clubley
2004-10-20  2:54   ` Steve
2004-10-19 17:14 ` Jean-Pierre Rosen
2004-10-20  7:06 ` Michael Paus
2004-10-21 15:52   ` Adrien Plisson
2004-10-21 17:03     ` Jean-Pierre Rosen

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