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

Home » Public Forums » archive » [call_external] how to use it ?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
[call_external] how to use it ? [message #28479] Wed, 12 December 2001 06:51
Richard Hitier is currently offline  Richard Hitier
Messages: 2
Registered: December 2001
Junior Member
Hi there,

I've been trying to use this fonctionality for hours now,
but... couldn't succeed :(

1st: the manual example doesn't work for me
the array pointer doesn't point to the good values.
(getting very high values ...)

2nd: in my own example it seems that I have to use long
interger in idle to be able to use (int) in the C code.

I'm trying to modify an array throug C routine, but
couldn't:
working with the array pointer doesn't seem to alter the
idl array at all.

I'm working on a Solaris station,
using gcc compiler.

There are the files:


---------------test.c-----------------------------
int function(int argc, void *argv[])
{
int s=0,*ip;
int i;
for (i=0, ip=(int*)argv[0]; i<*(int*)argv[1]; i++, ip++)
{
s+=*ip;
printf("i:%d ip:%f \n",i,*ip);
}
return(s);
}
--------------------------------------------------

---------------test.pro---------------------------
pro none, zize
tab = indgen(zize)
machin=10
print, "d'abord"
print, tab
i=call_external('none.so', 'function', tab, n_elements(tab))
print, "ensuite", i
print, tab
end
--------------------------------------------------

----------------Makefile--------------------------
.SUFFIXES:
.SUFFIXES: .c .so

.c.so:
gcc -g -fPIC $< -shared -o $@

--------------------------------------------------




By the way, does any one knows about calling an idl
procedure on unix command line as any other unix exe ?

I mean gently passing the args via command line ?

Thanks
--
richard Hitier
[Message index]
 
Read Message
Previous Topic: Figuring out axis range?
Next Topic: Re: Figuring out axis range?

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

Current Time: Fri Oct 10 10:16:45 PDT 2025

Total time taken to generate the page: 1.51881 seconds