[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: call external speed

In article <6soch3$5da$1@nnrp1.dejanews.com> 
rmlongfield@my-dejanews.com writes:

>I have a question though: Which chapters in the Advanced Development guide
>are related to LINKIMAGE?  There seems to be a mixture of topics.  Do you have
>a short example?   I can't find any in the IDL documentation. (I work with
>UNIX on an SGI workstation.)

Now I don't have the printed documentation, but the online help
does have some examples (IDLv5.1). Under the "Contents" in the
normal online help, double-click on the *book* "IDL External 
Development Guide", double-click on "Open IDL Ext....". Then 
press the Contents button, and double-click again on "External 
Development Guide" - a list of chapters should appear.

"Adding system routines" is crucial to LINKIMAGE. Most of the
other chapters are relevant, too, depending on what you want
to do in your routines.

The Caution under LINKIMAGE is appropriate, but only to a
certain extent. You do *not* have to have "intimate knowledge
of the internals of IDL" in the sense that you have to qualify
for work in RSI's development group - not by a long shot.
The very least you have to know about is how variables are
*stored*, *passed*, and returned. That's basically it (for
writing something simple that works - for the right reasons).

Using Callable IDL has nothing as such to do with LINKIMAGE
versus CALL_EXTERNAL, all permutations are possible. 

However, you *have* to use Callable IDL to install new system 
procedures from inside CALL_EXTERNAL routines (i.e., *not* 
using LINKIMAGE, but the IDL_AddSystemRoutine function).

On the other hand, if you're using LINKIMAGE, Callable
IDL provides some *very* useful routines/macros to do checks
on your input data etc. For example, IDL_ENSURE_ARRAY will 
issue standard "system" error messages and associated
behaviour (stopping etc), in exactly the same way that e.g.
MEDIAN does:

IDL> print,median(0)
% MEDIAN: Expression must be an array in this context: <INT      (       0)>.
% Execution halted at:  $MAIN$                 

Callable IDL also provides routines for keyword processing,
type conversion etc. *Very* handy.

One thing that I cannot find in the online help is a good
listing of "these routines and macros are available when 
linking your shareable objects with the idl library 
(i.e., using Callable IDL)". There is a list for RPC
function calls, but not Callable IDL. Thus, you have to
guess, and read through many chapters and a lot of text
to find what you need (or just drop the whole thing 
because you don't know what you're missing!).


Stein Vidar