FOR_C
FC FAQs |
|||||||||||||||
Argument TranslationAutomatically generated C prototypes improve function translations, so appropriate arguments can be translated as pass by value for simpler C code, ANSI C style function definitions are also available.
Character TranslationsFORTRAN characters are translated to null terminated C strings to permit access by standard C functions. Where translations to standard C strcpy() or strcmp() are not possible, special functions are called to mimic FORTRAN's fixed length behavior. Optional translations to variable length strings are available.
Common TranslationsCommons translate to external C structures, declared prior to the function. These translations are optimized to take advantage of C scoping rules, so subsequent common translations in the file are not regenerated. Parameter translations to C macros are optimized similarly. Optional common translations to simple externals are available.
Data TranslationsWhenever possible, FOR_C generates the simplest and most obvious translations, as evidenced by these DATA statement and initialization translations. DATA statements with individual array elements or implied DO loops generate assigned initializations that are executed one time in C.
Read and Write TranslationsList directed WRITEs become fprintf( ). List directed READs become a special version of fscanf( ) to mimic FORTRAN behavior. Formatted READ and WRITE translate to function replicating FORTRAN, while optional translations to fscanf( ) and fprintf( ) (shown below) are also available.
|