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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c370342fe303517b,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!p10g2000cwp.googlegroups.com!not-for-mail From: artifact.one@googlemail.com Newsgroups: comp.lang.ada Subject: C Interface example Date: 3 Feb 2007 07:20:37 -0800 Organization: http://groups.google.com Message-ID: <1170516037.435847.326440@p10g2000cwp.googlegroups.com> NNTP-Posting-Host: 81.179.242.178 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1170516043 28968 127.0.0.1 (3 Feb 2007 15:20:43 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 3 Feb 2007 15:20:43 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20060601 Firefox/2.0 (Ubuntu-edgy),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: p10g2000cwp.googlegroups.com; posting-host=81.179.242.178; posting-account=3t6ROQ0AAABpbovmj4Qol-vmGur4qb-2 Xref: g2news2.google.com comp.lang.ada:8876 Date: 2007-02-03T07:20:37-08:00 List-Id: 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