Re: IDL calling C [message #32780] |
Mon, 11 November 2002 02:30 |
Ralf Flicker
Messages: 19 Registered: October 2001
|
Junior Member |
|
|
Nidhi Kalra wrote:
>
> Hi,
>
> I was wondering if anybody could point me to some resources for
> calling C functions from IDL. I have never done this before myself and
> am quite unfamiliar with C. I have somebody else's .h and .c files and
> need to call their functions from IDL, but have little understanding
> of the internals of their stuff. Thanks!
If you have IDL you probably also have the External Development
Guide (or at least have access to), and it might be a good idea
to check this one out before you go and buy some other book. The
CALL_EXTERNAL routine is probably the simplest way to invoke
external codes from within an IDL session, and this is described
in some detail in chapter 7 of this book. There are explicit
examples of how to call C codes using the standard (argc, argv)
calling sequence, and also examples of the IDL wrapper routines.
I've been fiddling with exactly this myself lately, and not
being particularly well versed in C, I find it quite cumbersome
and confusing at the best of times - but the results can be
literally outstanding if your requirement is optimal
performance. Don't hesitate to post your qustions here; I'll
probably not be able to answer, but I too would learn a lot from
the answers. Good luck.
ralf
|
|
|
Re: IDL calling C [message #32781 is a reply to message #32780] |
Sun, 10 November 2002 14:11  |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
You may want to check out Stein Vidar's routines to automagically write
your .dlm wrappers for you. It is for F77 but he says you can write F77
dummy functions for your C code.
http://www.astro.uio.no/~steinhh/idl/dlmform.html
-Rick
"Nidhi Kalra" <nrk5@cornell.edu> wrote in message
news:6c4c9ef3.0211071158.2eea6820@posting.google.com...
> Hi,
>
> I was wondering if anybody could point me to some resources for
> calling C functions from IDL. I have never done this before myself and
> am quite unfamiliar with C. I have somebody else's .h and .c files and
> need to call their functions from IDL, but have little understanding
> of the internals of their stuff. Thanks!
>
> Nidhi
|
|
|
Re: IDL calling C [message #32813 is a reply to message #32781] |
Thu, 07 November 2002 12:09  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Nidhi Kalra (nrk5@cornell.edu) writes:
> I was wondering if anybody could point me to some resources for
> calling C functions from IDL. I have never done this before myself and
> am quite unfamiliar with C. I have somebody else's .h and .c files and
> need to call their functions from IDL, but have little understanding
> of the internals of their stuff. Thanks!
Calling C from IDL, by Ronn Kling. Available here:
http://www.dfanning.com/documents/books.html
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|