comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » CALL_EXTERNAL and structures
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
CALL_EXTERNAL and structures [message #9333] Mon, 23 June 1997 00:00
Hubert Rehrauer is currently offline  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' */
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Integer overflows crashes IDL 4.0.1 on HP-UX 10.20
Next Topic: Web-ROM

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:02:47 PDT 2025

Total time taken to generate the page: 0.00427 seconds