C Interface example
- From: artifact.one@xxxxxxxxxxxxxx
- Date: 3 Feb 2007 07:20:37 -0800
Hi.
I'm having a bit of trouble getting my head around calling C code
in Ada. I'll spare you my failed attempts, basically I have this code:
(vector.h)
#ifndef VECTOR_H
#define VECTOR_H
float *vec_addNf(float *, float *, unsigned int);
#endif
(vec_add.c)
#include "vector.h"
float *vec_add(float *va, float *vb, unsigned int ne)
{
unsigned int ind;
for (ind = 0; ind < ne; ++ind)
va[ind] += vb[ind];
return va;
}
Now what would be the most simple and portable way to write
a vector,ads and vector.adb file? (Specification and body, in case
those are compiler-specific filenames, I'm not intimate with the
Ada language spec yet!). I just don't have a good enough
understanding of the language to see how it all fits together
yet and I usually learn by example.
MC
.
- Follow-Ups:
- Re: C Interface example
- From: Stephen Leake
- Re: C Interface example
- From: Jeffrey R. Carter
- Re: C Interface example
- From: Gautier
- Re: C Interface example
- From: Cesar Rabak
- Re: C Interface example
- From: Ludovic Brenta
- Re: C Interface example
- Prev by Date: Re: Reading Float Data from a binary file into ada
- Next by Date: Re: Wasteful internationalization
- Previous by thread: SETP-07 call for papers
- Next by thread: Re: C Interface example
- Index(es):
Relevant Pages
|