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

Home » Public Forums » archive » CALL_EXTERNAL
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 [message #31535] Fri, 19 July 2002 03:15
Ian Dean is currently offline  Ian Dean
Messages: 26
Registered: January 2000
Junior Member
Hi,
I'm running IDL 5.4 under VMS (!!!), and would like some help using
CALL_EXTERNAL to a C routine.

The C routine has a sinle parameter passed to it, but it is a structure
(similar to that below)
The routine returns to the caller a variable sized array starting at the
address of item buffer and the number of elements in buff_size. (Other
control fields are also used but I won't cloudy the water with these).

typedef struct
{
void *buffer;
int buff_size;
}ACCESS

This routine and structure are already in use between several other C
routines. I just want to use the same idea in IDL.

I have created a similar structure in IDL

ACCESS = {buffer: ????, buff_size:0L, ident:0L}

The question is - what should the buffer tag be defined as?

I have tried it as a scalar (0L - Addresses are long ints) but I get an
access violation
I have tried a pointer - but this causes an access violation (it passes
address 1,2,3... etc.)
I have tried an array - this didn't crash, but overwrote the other fields
I have tried setting it to array[0] - this also failed dramatically

Since CALL_EXTERNAL passes individual parameters by reference, is it
possible for me to get the reference of a variable internally (similar to
%LOC in Fortran)?

I hope I've explained this sensibly - I am not really a C programmer.

Any help would be gladly received

Regards,
Ian
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Meaning of outer product
Next Topic: Re: Redhat 7.2/IDL 5.5a oddity (long)

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

Current Time: Wed Oct 08 19:25:03 PDT 2025

Total time taken to generate the page: 0.00474 seconds