Re: passing idl structures in call_external ? [message #6047 is a reply to message #6043] |
Thu, 04 April 1996 00:00  |
rivers
Messages: 228 Registered: March 1991
|
Senior Member |
|
|
In article <CSOELLE.96Apr4151011@msfd12.gwdg.de>, csoelle@msfd12.gwdg.de (Christian Soelle ) writes:
>
> As the subject already says, does anybody know how to pass idl-structures
> to a C-function using CALL_EXTERNAL. I couldn't find anything in the help
> nor in the example programs supplied.
>
The last time I looked, the means by which structures are passed was
intentionally not documented, presumably so that RSI would be free to change it
in the future.
However, I know by experience that IDL presently passes structures just like
you would expect, i.e. it passes the address of the start of the structure. All
structure elements except strings are contained in the structure itself, i.e.
the structure contains the value, not a pointer. Strings are different:
the structure contains either the descriptor or the address of the descriptor
(I forget).
I routinely pass structures to CALL_EXTERNAL, but I do so at my own risk,
since it is not guaranteed to be done the same way in future versions of IDL.
I have found that the structures will contain padding to keep the members
aligned on natural boundaries. The C compiler will normally do this on the
structures in your CALL_EXTERNAL code as well, so it has not been a problem.
____________________________________________________________
Mark Rivers (312) 702-2279 (office)
CARS (312) 702-9951 (secretary)
Univ. of Chicago (312) 702-5454 (FAX)
5640 S. Ellis Ave. (708) 922-0499 (home)
Chicago, IL 60637 rivers@cars3.uchicago.edu (Internet)
|
|
|