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 
Return to the default flat view Create a new topic Submit Reply
Re: CALL_EXTERNAL [message #31523 is a reply to message #1268] Mon, 22 July 2002 01:44 Go to previous messageGo to previous message
Nigel Wade is currently offline  Nigel Wade
Messages: 286
Registered: March 1998
Senior Member
Ian Dean wrote:

> 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.

Unfortunately that won't be possible as IDL has no concept of void
pointers. Even the pointers it does have are pointers to IDL variables, not
raw memory addresses (at least I think that's correct).

What is that you are trying to achieve?

If you want to access the data in IDL then you'll have to create a variable
of the appropriate type and either use your data from C as its data, or
copy it, whichever you prefer.

If you want to pass on this structure to some other C function then you
will need to create an IDL variable which can hold the pointer.

The former requires a DLM (or LINK_IMAGE) whilst the latter could be
achieved via CALL_EXTERNAL provided you can be certain how much memory is
required to hold your void pointer.


--
-----------------------------------------------------------
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523568, Fax : +44 (0)116 2523555
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: problems accessing Ken Bowman's IDL page?
Next Topic: Re: From tvscale to cgImage, puzzling feature in the plot

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

Current Time: Wed Oct 08 12:25:21 PDT 2025

Total time taken to generate the page: 0.00860 seconds