Equivalent functions written entirely in C are available for the following subset of the CHR routines. These are provided mainly for use when porting Fortran application code to C.
The C and Fortran implementations are completely independent of each other - no “wrapper” layer is involved. This is done to avoid efficiency problems caused by the continual copying of strings between Fortran and C that would be required if the C interface was provided by a wrapper layer on top of the Fortran coide (or vice versa). The behaviour of C functions is slightly different to that of the Fortran routines because the two languages index strings in different ways (C is zero-based, Fortran is one-based). Also C has no equivalent to the Fortran intrinsic function LEN, and so each C function that returns a string has an extra argument specifying the length of the buffer reserved for the output string.