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

Home » Public Forums » archive » Re: LINKIMAGE problem (beginner)
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: LINKIMAGE problem (beginner) [message #11112] Thu, 12 March 1998 00:00 Go to previous message
rivers is currently offline  rivers
Messages: 228
Registered: March 1991
Senior Member
In article <35016939.EFC1ED89@gmx.net>, Reinhold Schaaf <Kakadu42@gmx.net> writes:
>
> --------------352DBFD156070D302A7B8B9C
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> Hi there,
>
> I want an IDL program call C subroutines. Since the CALL_EXTERNAL
> mechanism seems to provide no possiblities for typechecking (?) I want
> to use LINKIMAGE, where typechecking can (and must) be done. Everything
> is pretty nasty (I really don't like pointers on pointers on pointers
> ...), but anyway.

While it is true that CALL_EXTERNAL does not provide typechecking, I don't
think this is really a problem. Every function which you call via
CALL_EXTERNAL should be called through an IDL "wrapper" routine. That wrapper
routine, and ONLY THAT WRAPPER ROUTINE, is what does the CALL_EXTERNAL to your
C code. The wrapper routine converts all arguments passed to it to the correct
data type for the C function. Example:

pro my_test, input, output

; Assume your C code wants its input as a 32 bit int and returns a single
; precision float. The following code will ensure that input is converted to
; long (if required) and that the output is a float.

output = 0.0
status = call_external('my_lib', 'my_func', long(input), output)
end

____________________________________________________________
Mark Rivers (773) 702-2279 (office)
CARS (773) 702-9951 (secretary)
Univ. of Chicago (773) 702-5454 (FAX)
5640 S. Ellis Ave. (708) 922-0499 (home)
Chicago, IL 60637 rivers@cars.uchicago.edu (e-mail)

or:
Argonne National Laboratory (630) 252-0422 (office)
Building 434A (630) 252-0405 (lab)
9700 South Cass Avenue (630) 252-1713 (beamline)
Argonne, IL 60439 (630) 252-0443 (FAX)
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: rewriting from IDL to PVwave
Next Topic: Re: David Fanning's rubberband box

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

Current Time: Fri Oct 10 11:01:31 PDT 2025

Total time taken to generate the page: 0.96236 seconds