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

Home » Public Forums » archive » Re: CALL_EXTERNAL and memory allocation
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 and memory allocation [message #29680] Mon, 11 March 2002 10:03 Go to previous message
Michael Zingale is currently offline  Michael Zingale
Messages: 4
Registered: March 2002
Junior Member
yes, I forgot to mention that the string that I initialize in IDL is of
length greater than or equal to the length of the string that I am
reading in in the C program. This way I know the memory is allocated.
The example on the website that I pointed to does this.

Mike

James Kuyper wrote:

> Michael Zingale wrote:
>
>> I typically do something like the following:
>>
>>
>> in IDL:
>>
>> string = ' '
>>
>> ierr = call_external('lib.so', 'read_string', string)
>>
>>
>> and in C:
>>
>> IDL_STRING* string = (IDL_STRING *) argv[0];
>>
>> then fill string.s with the string.
>
>
> Are you referring to the 'argv' that appears as a parameter in a C
> main()? That's not necessarily legal. You need to first make sure that:
>
> strlen(argv[0]) > sizeof(IDL_STRING)
>
> Otherwise, you many be overwriting memory that you don't have permission
> to access.
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Grayscale AND Binary Image
Next Topic: MODIS L1B - 250m

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

Current Time: Sat Oct 11 01:32:46 PDT 2025

Total time taken to generate the page: 0.79754 seconds