WFDB 10.3

Changes in version 10.3.17 (20 August 2005)

This version is the first to support reading variable-layout records
(multi-segment records in which the number, arrangement, gains, and baselines
of the signals may vary from one segment to the next; see section Multi-Segment Records).

Rounding errors in the WFDB library’s mstimstr function have been
reduced. Previous versions did not always round appropriately when the
sampling frequency was much less than 1 Hz.

The maximum length for a record name (WFDB_MAXRNL, defined in
‘wfdb.h’) has been increased from 11 to 20.

A new constant, WFDB_INVALID_SAMPLE, is now defined in ‘wfdb.h’.
It is used to identify padding inserted to fill in for missing data. When
writing in any format that uses fewer than 16 bits per sample, putvec
maps WFDB_INVALID_SAMPLE to the lowest (most negative) value expressible
in that format; when reading a signal file in such a format, getframe
performs the inverse mapping, so that missing data can be identified regardless
of the data format.

A side effect of this change is that (for example) any samples that had the
most negative value (for example, -2048 in a format 212 signal file) are now
flagged as invalid. To treat such samples as invalid is reasonable, however,
since these occur only when the input level falls below the working range of
the analog-to-digital converter.

Changes in version 10.3.16 (13 June 2005)

Benjamin Moody has added an interface between the WFDB library and
libcurl as an alternative to the existing libwww interface, and
has updated ‘configure’ and ‘conf/*.def’ to search for and use
libcurl if it is available. The primary advantages of libcurl
over libwww are that libcurl is smaller and faster, it supports
access to password-protected files, and it is actively maintained. Both
libraries are freely available on all popular platforms.

Isaac Henry has updated configure to support building a native
MS-Windows version of the WFDB library using either Cygwin gcc or MinGW
gcc.

A number of minor changes, mostly involving conditional use of
‘malloc.h’, ‘stdlib.h’, and ‘string.h’, were made to
eliminate warnings from gcc 4.x.

Changes in version 10.3.14 (29 December 2004)

Guido Muesch reported that getspf() did not always
return correct results if the frame frequency does not have an exact
representation as a double precision floating point number. This problem has
now been corrected.

Changes in version 10.3.13 (5 May 2004)

Using an indirect WFDB path (i.e., setting the WFDB environment
variable to a value such as ‘@FILE’, where ‘FILE’ contains the
desired path) was broken in WFDB library versions 10.3.9 through
10.3.12; it now works again, thanks to a patch contributed by
Fred Geheb.

Changes in version 10.3.12 (9 March 2004)

Okko Willeboordse pointed out an incompatibility between the native
MS-Windows API and the ANSI/ISO C library function mkdir, which is
used by the WFDB library. This does not present a problem when
compiling the WFDB library using the supported Cygwin/gcc compiler
under MS-Windows, nor does any related problem occur on any other
platform. It should now be a little easier to compile the WFDB library
using unsupported compilers, thanks to a new MKDIR macro that hides
the incompatibility (see ‘lib/wfdblib.h0’).

Piotr Wlodarek initiated a discussion about memory leaks in the WFDB
library, citing as an example the ’trivial example program in C’ from
this Guide, which does not free memory it allocates in isigopen()
when reading the signal specifications. This problem can be avoided by
invoking wfdbquit() in the example program, just before exiting.
Further discussion of this point has been added to this Guide following
the presentation of the ’trivial example’, and in the description of
wfdbquit.

Changes in version 10.3.11 (17 October 2003)

In ‘signal.c’, several bugs have been identified and fixed. Thanks
to Piotr Wlodarek, who found a buffer overrun in isigopen. Also,
isgsettime sometimes performed incorrect seeks on multifrequency
records that had been opened in high-resolution mode; this has been
fixed, together with a related bug that caused the value returned by
strtim("e") to be calculated incorrectly in some such cases.

Changes in version 10.3.10 (3 August 2003)

In version 10.3.9, the functions setannstr, setanndesc,
and setecgstr did not contain necessary checks to avoid invoking
strcmp with a NULL argument. These checks have been added in
version 10.3.10. Thanks to Thomas Heldt for reporting this problem.

Changes in version 10.3.9 (16 July 2003)

The WFDB library functions setwfdb, setannstr,
setanndesc, and setecgstr now copy their input string
arguments, so that it is no longer necessary for WFDB applications to
keep these strings valid. If you have created applications that rely on
being able to modify these strings, it will be necessary to invoke the
corresponding functions again before such changes will take effect
within the WFDB library.

Previous versions of the WFDB library function putinfo did not
flush their output until either a new header file was created (via
setheader or newheader) or the process exited. This has
now been corrected, and putinfo output is now flushed before
putinfo returns. Thanks to Jonas Carlson for reporting this
problem.

Changes in version 10.3.8 (12 July 2003)

The WFDB library function setbasetime() now properly
accepts arguments specifying midnight (e.g., ‘0:0:0’), which previous
versions rejected, and the function setheader()
records such times correctly in the ‘.hea’ files it creates.

Changes in version 10.3.6 (7 April 2003)

The fix applied in isigclose() in 10.3.5 was incomplete but is now
(really!) fixed. Applications that use sample() should call
wfdbquit() to be certain that sample’s buffer is freed before
exiting.

Some long-standing problems in the code (in ‘lib/wfdbio.c’) that handles
http range requests for NETFILES-enabled versions of the library have
been partially addressed. The underlying issue is that http servers
do not always return the range of bytes requested; when this happens,
it is not difficult to determine that there is a problem, but it is
tricky to figure out what to do about it. Based on experiments with
several different http servers, the strategy for handling such problems
within the WFDB NETFILES code has been improved substantially, but
there may be further room for improvement.

Changes in version 10.3.5 (31 March 2003)

Fixed a bug in WFDB library function isigclose() (in
‘lib/signal.c’) that had caused sample()’s buffer to be freed
inappropriately when switching segments in a multi-segment record.
Thanks to Dave Schaffer for the bug report and for a test case that
illustrated the bug.

Changes in version 10.3.2 (25 February 2003)

Fixed a WFDB library bug that caused annotation sorting to fail
if a new header file had been written. Thanks to Winton Baker for
reporting this problem and for providing an example that illustrated
the bug.

Changes in version 10.3.0 (26 November 2002)

Fixed bugs in ‘lib/signal.c’ that caused improper accounting of signal
group numbers when reading from two or more records at the same time (as in
‘nst’), a bug that caused a segfault in ‘nst’, and a bug that
referenced uninitialized memory in newheader if nsig = 0.

The WFDB Software Package has been ported to Mac OS X (Darwin),
version 10.2 (the port should also work under 10.1 but this
has not been tested and will not be supported).

It is now possible to generate a shared WFDB library (DLL)
under MS-Windows using Cygwin/gcc.

Added functions sample and sample_valid to the WFDB library
(in ‘lib/signal.c’). sample(s, t) returns the sample at
time (sample number) t from signal s, handling all
necessary buffering internally and allowing the caller to treat the
signal file as a virtual array of randomly accessible samples.
sample_valid can be invoked to check if the most recent value
returned by sample was valid (e.g., to see if the end of the
input was reached). For an example of the use of these functions, see
‘app/wqrs.c’.