My posting of this problem at comp.lang.ada has produced some rather arcane discussion.

There is one school of thought that says that my example, being all Ada, is different than the real code (in PLplot) because plmap in my posted example is in Ada where in the real situation it is in C. The discussion revolves around how Ada handles calls to Ada subprograms while enforcing C calling conventions versus calls to C subprograms while enforcing C conventions.

So, I'm trying to modify the simple example so that plmap is written in C, more closely emulating the PLplot situation. Unfortunately, my C skills are very poor and I can't get a simplified plmap to compile. My goal is to get it to compile then link to it from Ada.

Here is my feeble attempt at C:


====== In a file called plot.h, there is this: ======

void plmap( void (*mapform)(PLINT, PLFLT *));



====== In a file called plmap.c, there is this: ======

#include "plplot.h"
void plmap( void (*mapform)(PLINT, PLFLT *) )
{
    int n;
    double xx[10];
    n = 10;
    (*mapform)(n, xx);
}

======================================================

Could someone tell me how to get this to compile? I'm just typing

gcc plmap.c

I've attached a zip file (sans ".zip" as usual).

Thanks,
Jerry

Attachment: bad_c
Description: Binary data

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to