CALL_EXTERNAL and structures [message #9333] |
Mon, 23 June 1997 00:00 |
Hubert Rehrauer
Messages: 2 Registered: June 1997
|
Junior Member |
|
|
Hello,
I got the following problem. I want to call a C function that modifies a
IDL structure. This works pretty well, except for structure tags that
have an array-type.
In the following example the values of the tag 'second' can not be
modified and I can't see why!
By the way, I'm working on a SOLARIS system.
Would be nice if somebody could help me.
Bye,
hubi
/*
IDL input:
$ cc -G -Kpic -c -lm -v idltest.c
$ ld -G -o idltest.so idltest.o
a= 5L
b = DBLARR(4)
data ={ first: a, second: b }
print,data
check = CALL_EXTERNAL('idltest.so','idltest', $
datastruct)
print,data
*/
/* content of the file 'idltest.c' */
typedef struct {
long first;
double * second;
} data;
long idltest( int argc, void * argv[])
{
data * d;
d = (data * ) argv[0];
d->first = 25;
*(d->second) = 1.4;
*(d->second +2) =3.8;
return(0L);
}
/* end of file 'idltest.c' */
|
|
|