6.3. C¶
C does not support object-oriented-programming. However, an object based
approach is applied. All functions apply the prefix naming convention swd_api_*
.
The API is defined in the header file spectral_wave_data.h.
The data types
real_swd
, vector_swd
, vector_2nd_phi_swd
and vector_2nd_elev_swd
are also defined in the C-header file.
If your application apply float (not double) for the SWD-API you need to:
Set the macro
SWD_API_FLOAT
before the header file is included.The fortran library should be compiled with kind_swd_c = c_float in the file
kind_values.f90
.
By default it is assumed that the C-interface apply double. Hence kind_swd_c = c_double in
the file kind_values.f90
and the macro SWD_API_FLOAT
should be unset.
6.3.2. Implementation¶
In the current version the implementation of these functions are obtained from the fortran implementation using the standard ISO_C_BINDINGS defined in spectral_wave_data_c.f90.