[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Fortran wrappers

A set of wrapper functions is also available for those who wish to use the WFDB library together with applications written in Fortran. These functions, defined in `wfdbf.c', provide a thin `wrapper' around the WFDB library functions, by accepting Fortran-compatible arguments (there are no structures, and all arguments are passed by reference rather than by value). For example, here is the Fortran equivalent of the example program in the previous section:

 
        integer i, v(2), g

        i = isigopen("100s", 2)
        do i = 1, 10
         g = getvec(v)
         write (6,3) v(1), v(2)
 3      format("v(1) = ", i4, "    v(2) = ", i4)
        end do
        end

(See http://www.physionet.org/physiotools/wfdb/fortran/fsamples.f for a copy of this program; an extensively commented version of this program is also available, at http://www.physionet.org/physiotools/wfdb/fortran/example.f.)

To compile this program using g77 (the GNU Fortran compiler), save it as `fsamples.f' in the current directory, copy `wfdbf.c' (which can be found in the same directory as `wfdb.h', usually `/usr/include/wfdb') to the current directory, then type:

 
g77 -o fsamples -DFIXSTRINGS fsamples.f wfdbf.c -lwfdb

The Fortran wrapper functions are not discussed in this guide; for further information, refer to fortran/README in the WFDB Software Package.



George B. Moody (george@mit.edu)