|
Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.atnf.csiro.au/computing/software/gipsy/pguide/clanguage.html
Дата изменения: Unknown Дата индексирования: Sat Jan 17 00:30:27 2009 Кодировка: Поисковые слова: asteroid |
Programming in C
Fortran C
----------------- ------
CHARACTER fchar
COMPLEX complex
DOUBLE PRECISION double
INTEGER fint
LOGICAL bool
REAL float
The non-C types in this table are all defined in include file
gipsyc.h, so
each C program or function must include this file (after the standard
C include files but before the definition files).
fint will be one of the following, depending on the operating system:
typedef short fint;
typedef int fint;
typedef long fint;
typedef struct { float r; float i; } complex;
typedef struct { char *a; fint l; } fchar;
Fortran C
----------------------- -------------------------
SUBROUTINE SS(..) void ss_c(..)
CHARACTER*(*) CC(..) void cc_c(fchar r,..)
COMPLEX CX(..) complex cx_c(..)
DOUBLE PRECISION DD(..) double dd_c(..)
INTEGER II(..) fint ii_c(..)
LOGICAL LL(..) bool ll_c(..)
REAL RR(..) float rr_c(..)
Note that Fortran character functions become voids in C with an extra
argument being the destination of the character function.
We have tried to supply the C programmer with the most interesting of those functions. These functions are defined in the following ANSI C include files.
Note that these include files reside in $gip_inc, and that they must be included using the "" notation instead of <>.