diff -Naur --exclude Makefile --exclude info wfdb-10.4.8/app/wqrs.c wfdb-10.4.9/app/wqrs.c
--- wfdb-10.4.8/app/wqrs.c	2008-05-15 17:44:58.000000000 -0400
+++ wfdb-10.4.9/app/wqrs.c	2008-08-12 15:48:51.000000000 -0400
@@ -1,5 +1,5 @@
 /* file: wqrs.c		Wei Zong      23 October 1998
-			Last revised:   15 May 2008 (by G. Moody)
+			Last revised:  12 August 2008 (by G. Moody)
 -----------------------------------------------------------------------------
 wqrs: Single-lead QRS detector based on length transform
 Copyright (C) 1998-2008 Wei Zong
@@ -49,9 +49,7 @@
 RECORD is replaced by the name of the input record).  Within the output
 annotation file, the time of each NORMAL annotation marks a QRS onset;  if
 the '-j' option is used, additional JPT annotations mark the J points (the
-ends of the QRS complexes).  During the learning period (the first LPERIOD
-samples), LEARN annotations are used instead of NORMAL annotations, and there
-are no JPT annotations.
+ends of the QRS complexes).
 
 For example, to mark QRS complexes in record 100 beginning 5 minutes from the
 start, ending 10 minutes and 35 seconds from the start, and using signal 1, use
@@ -73,7 +71,6 @@
 
 #define BUFLN  16384	/* must be a power of 2, see ltsamp() */
 #define EYE_CLS 0.25    /* eye-closing period is set to 0.25 sec (250 ms) */ 
-#define LPERIOD 1000	/* learning period is the first LPERIOD samples */
 #define MaxQRSw 0.13    /* maximum QRS width (130ms) */                        
 #define NDP	 2.5    /* adjust threshold if no QRS found in NDP seconds */
 #define PWFreqDEF 60    /* power line (mains) frequency, in Hz (default) */
@@ -162,9 +159,8 @@
     WFDB_Anninfo a;
     WFDB_Annotation annot;
     WFDB_Gain gain;
-    WFDB_Sample *v;
     WFDB_Siginfo *s;
-    WFDB_Time from = 0L, next_minute, now, spm, t, tj, tpq, to = 0L, tt, t1;
+    WFDB_Time from = 0L, next_minute, spm, t, tj, tpq, to = 0L, tt, t1;
     static int gvmode = WFDB_GVPAD | WFDB_LOWRES;
     char *prog_name();
     void help();
diff -Naur --exclude Makefile --exclude info wfdb-10.4.8/conf/rpm.mc wfdb-10.4.9/conf/rpm.mc
--- wfdb-10.4.8/conf/rpm.mc	1969-12-31 19:00:00.000000000 -0500
+++ wfdb-10.4.9/conf/rpm.mc	2008-10-10 13:53:34.000000000 -0400
@@ -0,0 +1 @@
+%_topdir %(echo $HOME)/rpmbuild
diff -Naur --exclude Makefile --exclude info wfdb-10.4.8/conf/version.def wfdb-10.4.9/conf/version.def
--- wfdb-10.4.8/conf/version.def	2008-07-23 16:16:15.000000000 -0400
+++ wfdb-10.4.9/conf/version.def	2008-08-12 16:13:23.000000000 -0400
@@ -1,11 +1,11 @@
 # file: version.def		G. Moody	24 May 2000
-#				Last revised:	23 July 2008
+#				Last revised:	12 August 2008
 # Each release of the WFDB Software Package is identified by a three-part
 # version number, defined below.  Be sure to leave a single space before
 # and after the "=" in each of the next three lines!
 MAJOR = 10
 MINOR = 4
-RELEASE = 8
+RELEASE = 9
 VERSION = $(MAJOR).$(MINOR).$(RELEASE)
 
 # RPMRELEASE can be incremented if changes are made between official
diff -Naur --exclude Makefile --exclude info wfdb-10.4.8/configure wfdb-10.4.9/configure
--- wfdb-10.4.8/configure	2008-04-15 12:14:35.000000000 -0400
+++ wfdb-10.4.9/configure	2008-10-07 16:07:33.000000000 -0400
@@ -1,6 +1,6 @@
 #! /bin/sh
 # file: configure             G. Moody         24 May 2000
-#                             Last revised:   15 April 2008
+#                             Last revised:   7 October 2008
 # Configuration script for the WFDB Software Package
 
 # This script was not generated using 'autoconf'.  If you can implement
@@ -12,11 +12,24 @@
 # except on x86_64 Linux, where they are prefixed to CFLAGS.  The help
 # text below documents only -m32;  see the gcc manual for other -m options.
 
+# Defaults (overridden by --interactive):
+INTERACTIVE=no
+LIBTYPE=dynamic
+DIR=/usr
+MANDIR=unknown
+
 NETLIB=unknown
+WAVE=unknown
+
+# Read and process command-line arguments
 for i in $*
 do
   case $i in
     --dynamic)          LIBTYPE=dynamic ;;
+    -i|--interactive)   INTERACTIVE=yes
+    			LIBTYPE=
+			DIR=
+			MANDIR= ;;
     -m*)                if [ "x$MFLAGS" = x ]
                         then
 		            MFLAGS=$i
@@ -36,9 +49,10 @@
     *)                  cat <<EOF
 usage: $0 [options]
 Options:
-   --dynamic           make a shared (dynamically linkable) WFDB library
+    --dynamic           make a shared (dynamically linkable) WFDB library
                          if possible [default]
     --help              print this message
+    --interactive       ask about library type and installation directories
     -m32                on 64-bit Linux, force compilation in 32-bit mode
     --mandir=MANDIR     install man pages in MANDIR
     --prefix=PREFIX     install files in PREFIX [default: $DIR]
@@ -60,7 +74,25 @@
 done
 
 echo "Checking the operating system type ..."
-OS=`uname`
+case `uname` in
+  Linux*)    case `uname -m` in
+	        x86_64) OS=Linux-64 ;;
+                *) OS=Linux ;;
+             esac ;;
+  FreeBSD*)  OS=FreeBSD ;;
+  Solaris*)  OS=Solaris ;;
+  SunOS*)    OS=Solaris ;;
+  HP-UX*)    OS=HPUX ;;
+  CYGWIN*)   if [ "x$NOCYGWIN" = "xyes" ]
+             then
+	         OS=mingw-compat
+             else
+	         OS=cygwin
+             fi ;;
+  MINGW*)    OS=mingw ;;
+  Darwin*)   OS=Darwin ;;
+  *)         OS=generic ;;
+esac
 echo "Configuring the WFDB software package for $OS."
 
 SRCDIR="`pwd`"
@@ -90,61 +122,62 @@
 
 rm -f site-slib.def
 touch site-slib.def
-case `uname` in
-  Linux*) OS=Linux
-    case `arch` in
-      x86_64)
-	if [ "x$MFLAGS" = x ]
+
+case $OS in
+  Linux)
+	cat site.def linux-slib.def >site-slib.def
+	cat linux.def >>site.def ;;
+  Linux-64)
+	if [ "x$MFLAGS" = "x-m32" ]
 	then
-	    LIB=lib64
-	    cat site.def linux-slib.def | sed s+/lib\$+/lib64+g >site-slib.def
-	    cat linux.def | sed s+/lib\$+/lib64+g >>site.def
-	else
+	    OS=Linux
 	    cat site.def linux-slib.def | \
 		sed "s+MFLAGS =+MFLAGS = $MFLAGS+" >site-slib.def
 	    cat linux.def | \
 		sed "s+MFLAGS =+MFLAGS = $MFLAGS+" >>site.def
+	else
+	    LIB=lib64
+            WAVE=0
+	    cat site.def linux-slib.def | sed s+/lib\$+/lib64+g >site-slib.def
+	    cat linux.def | sed s+/lib\$+/lib64+g >>site.def
 	fi ;;
-      *) cat site.def linux-slib.def >site-slib.def
-	 cat linux.def >>site.def ;;
-    esac ;;
-  FreeBSD*) OS=FreeBSD
-    cat site.def freebsd-slib.def >site-slib.def
-    cat freebsd.def >>site.def ;;
-  SunOS*) OS=Solaris
-    cat site.def solaris-slib.def >site-slib.def
-    cat solaris.def >>site.def
-    echo "It is normal, and harmless, for Solaris to be recognized as"
-    echo "SunOS." ;;
-  HP-UX*) OS=HPUX
-    cat site.def hpux-slib.def >site-slib.def
-    cat hpux.def >>site.def ;;
-  CYGWIN*)
-    if [ "x$NOCYGWIN" = "xyes" ]
-    then
+  FreeBSD)
+	cat site.def freebsd-slib.def >site-slib.def
+	cat freebsd.def >>site.def ;;
+  Solaris)
+	cat site.def solaris-slib.def >site-slib.def
+	cat solaris.def >>site.def ;;
+  HP-UX)
+	cat site.def hpux-slib.def >site-slib.def
+	cat hpux.def >>site.def ;;
+  cygwin)
+	cat site.def cygwin-slib.def >site-slib.def
+	cat cygwin.def >>site.def ;;
+  mingw)
+	WAVE=0
+	sed 's/NOCYGWIN//' site.def mingw-slib.def >site-slib.def
+	sed 's/NOCYGWIN//' mingw.def >>site.def ;;
+  mingw-compat)
 	OS=mingw
+	WAVE=0
 	sed 's/NOCYGWIN/-mno-cygwin/' site.def mingw-slib.def >site-slib.def
-	sed 's/NOCYGWIN/-mno-cygwin/' mingw.def >>site.def
-    else
-	OS=cygwin  
-	cat site.def cygwin-slib.def >site-slib.def
-	cat cygwin.def >>site.def
-    fi ;;
-  MINGW*) OS=mingw
-    sed 's/NOCYGWIN//' site.def mingw-slib.def >site-slib.def
-    sed 's/NOCYGWIN//' mingw.def >>site.def ;;
-  Darwin*) OS=Darwin
-    LIBTYPE=dynamic
-    cat site.def darwin-slib.def >site-slib.def
-    cat darwin.def >>site.def
-    echo "It is normal for Mac OS X to be recognized as Darwin."
-    echo "Building static libraries is not supported on Darwin." ;;
-  *)      OS=generic
-    cat site.def generic-slib.def >site-slib.def
-    cat generic.def >>site.def
-    echo "Using the generic configuration, which may need to be customized"
-    echo "for your operating system.  'configure' will offer suggestions for"
-    echo "customization after it completes the generic configuration." ;;
+	sed 's/NOCYGWIN/-mno-cygwin/' mingw.def >>site.def ;;
+  Darwin)
+	echo "It is normal for Mac OS X to be recognized as Darwin."
+	if [ x$LIBTYPE != xdynamic ]
+	then
+	    echo "Building static libraries is not supported on Darwin."
+	    LIBTYPE=dynamic
+	fi
+	cat site.def darwin-slib.def >site-slib.def
+	cat darwin.def >>site.def ;;
+  *)    OS=generic
+	cat site.def generic-slib.def >site-slib.def
+	cat generic.def >>site.def
+	echo "Using the generic configuration, which may need to be customized"
+	echo "for your operating system.  'configure' will offer suggestions"
+	echo "for customization after it completes the generic configuration."
+	;;
 esac
 
 if [ -s site-slib.def ]
@@ -276,6 +309,11 @@
 
 MANTMP=`grep "MANDIR =" site.def |sed 's+$(WFDBROOT)/++' |cut -d " " -f 3`
 MANDEF=$DIR/$MANTMP
+if [ x$MANDIR = xunknown ]
+then
+   MANDIR=$MANDEF
+fi
+
 if [ x$MANDIR = x ]
 then
     echo
@@ -420,7 +458,7 @@
 
 echo rm conf/site.def conf/site-slib.def
 
-if [ "$OS" = "mingw" ]
+if [ "x$WAVE" = "x0" ]
     then
     cp -p wave/nomake wave/Makefile
     cp -p wave/nomake waverc/Makefile
@@ -543,6 +581,12 @@
 Sample data files will be installed in '$DIR/database', which
  will be included in the default WFDB path.
 
+If you need to compile a different WFDB library type, or install into different
+directories, rerun this script with its "-i" (interactive) option:
+      ./configure -i
+Other options can be viewed by rerunning this script with its "-h" option:
+      ./configure -h
+
 WFDB software configuration is complete.
 Now run 'make' to compile and test, followed by 'make install' to recompile
 and install the software, man pages, and example data.  Finally, run
diff -Naur --exclude Makefile --exclude info wfdb-10.4.8/doc/wag-src/eval0.tex wfdb-10.4.9/doc/wag-src/eval0.tex
--- wfdb-10.4.8/doc/wag-src/eval0.tex	2002-11-22 14:56:46.000000000 -0500
+++ wfdb-10.4.9/doc/wag-src/eval0.tex	2008-10-07 20:36:45.000000000 -0400
@@ -2,7 +2,7 @@
 \usepackage{rawfonts}
 \IfFileExists{times.sty}{\usepackage{times}}{\@missingfileerror{times}{sty}}
 
-\usepackage{fancyheadings}
+\usepackage{fancyhdr}
 \oddsidemargin 0.1in
 \evensidemargin -0.1in
 \topmargin -0.5in
diff -Naur --exclude Makefile --exclude info wfdb-10.4.8/doc/wag-src/install0.tex wfdb-10.4.9/doc/wag-src/install0.tex
--- wfdb-10.4.8/doc/wag-src/install0.tex	2006-05-04 11:57:00.000000000 -0400
+++ wfdb-10.4.9/doc/wag-src/install0.tex	2008-10-07 20:36:55.000000000 -0400
@@ -2,7 +2,7 @@
 \usepackage{rawfonts}
 \IfFileExists{times.sty}{\usepackage{times}}{\@missingfileerror{times}{sty}}
 
-\usepackage{fancyheadings}
+\usepackage{fancyhdr}
 \oddsidemargin 0.1in
 \evensidemargin -0.1in
 \topmargin -0.5in
diff -Naur --exclude Makefile --exclude info wfdb-10.4.8/doc/wag-src/wag.tex wfdb-10.4.9/doc/wag-src/wag.tex
--- wfdb-10.4.8/doc/wag-src/wag.tex	2008-04-09 16:23:17.000000000 -0400
+++ wfdb-10.4.9/doc/wag-src/wag.tex	2008-10-07 20:36:29.000000000 -0400
@@ -3,7 +3,7 @@
 \usepackage{rawfonts}
 \IfFileExists{times.sty}{\usepackage{times}}{\@missingfileerror{times}{sty}}
 
-\usepackage{fancyheadings}
+\usepackage{fancyhdr}
 \oddsidemargin 0.1in
 \evensidemargin -0.1in
 \topmargin -0.5in
diff -Naur --exclude Makefile --exclude info wfdb-10.4.8/doc/wpg-src/wpg0.tex wfdb-10.4.9/doc/wpg-src/wpg0.tex
--- wfdb-10.4.8/doc/wpg-src/wpg0.tex	2008-07-14 12:24:13.000000000 -0400
+++ wfdb-10.4.9/doc/wpg-src/wpg0.tex	2008-09-26 15:25:01.000000000 -0400
@@ -510,6 +510,18 @@
 WFDB Software Package distribution, for information on any more recent
 changes that may not be described here.
 
+@unnumberedsubsec Changes in version 10.4.9
+
+The WFDB library once again correctly interprets a hyphen (@code{-})
+(used in place of a record name, annotator name, signal file name,
+or calibration file name) as a reference to the standard input or
+output, for platforms that support POSIX standard I/O (@pxref{Standard I/O}).
+This feature was broken in 10.4.5 as a side effect of changes
+in @code{wfdb_open} (an internal WFDB library function defined in
+@file{lib/wfdbio.c}).
+
+(WFDB library version 10.4.8 was identical to version 10.4.7.)
+
 @unnumberedsubsec Changes in version 10.4.7
 
 Yinqi Zhang reported and contributed a fix for a memory leak in
diff -Naur --exclude Makefile --exclude info wfdb-10.4.8/install-wave32 wfdb-10.4.9/install-wave32
--- wfdb-10.4.8/install-wave32	1969-12-31 19:00:00.000000000 -0500
+++ wfdb-10.4.9/install-wave32	2008-10-07 16:31:26.000000000 -0400
@@ -0,0 +1,60 @@
+#! /bin/sh
+# file: install-wave32		G. Moody		7 October 2008
+#
+# Build and install WAVE on 64-bit Linux
+#
+# This script has been tested on 64-bit Fedora 9 running on an Intel Core2
+# CPU.  The methods used here (but not this script itself) have also been
+# tested on 64-bit Fedora 7 and 8 running on both AMD and Intel 64-bit CPUs.
+# It requires root (superuser) permissions and must be run from within the
+# top-level WFDB source directory (the directory that also contains the
+# 'configure' script).
+#
+# WAVE must be compiled as a 32-bit application, because it depends on the
+# XView toolkit, which does not support 64-bit mode (and most likely, never
+# will), and 64-bit applications cannot use 32-bit libraries.  Furthermore,
+# 32-bit applications cannot use 64-bit libraries, so it is necessary to
+# install 32-bit versions of all of the libraries needed by WAVE, as well as
+# the .h ("include") files associated with these libraries.  These components
+# fall into three categories:
+#
+#  1. 32-bit libraries an available from Fedora repositories
+#     These include the standard C library, the X11 client libraries, the X11
+#     pixmap libraries, the libcurl (HTTP client) libraries, and their
+#     respective developer's toolkits.  The easiest way to install these on
+#     Fedora is using the yum commands below.  These packages may have different
+#     names in other Linux distributions, and "yum" itself may not be available
+#     as a package manager in some distributions.  These commands are safe to run
+#     even if any or all of these packages are already installed.
+
+yum -y update glibc-devel.i386 libX11-devel.i386 libXpm-devel.i386 libcurl-devel.i386
+yum -y install glibc-devel.i386 libX11-devel.i386 libXpm-devel.i386 libcurl-devel.i386
+
+#  2. XView libraries available from PhysioNet
+#     These are available as RPMs for Fedora and other RPM-based distributions,
+#     and in binary and source tarballs for other distributions.  By far the
+#     easiest way to install them on Fedora is using the RPM command below.
+#     Again, this command is safe even if any or all of these are already
+#     installed.
+
+rpm -ivh http://physionet.org/physiotools/xview/i386-Fedora/xview-3.2p1.4-21.1.fc8.i386.rpm \
+ http://physionet.org/physiotools/xview/i386-Fedora/xview-clients-3.2p1.4-21.1.fc8.i386.rpm \
+ http://physionet.org/physiotools/xview/i386-Fedora/xview-devel-3.2p1.4-21.1.fc8.i386.rpm
+
+#  3. the 32-bit version of the WFDB library
+#     This is easily compiled and installed by the following commands:
+
+make clean
+./configure -m32
+cd lib
+make install
+
+# Now all of the prerequisites are in place, and we can compile and install
+# WAVE itself:
+
+cd ../wave
+make install
+
+# Compile and install applications for remote control of WAVE.
+cd ../waverc
+make install
diff -Naur --exclude Makefile --exclude info wfdb-10.4.8/lib/Makefile.tpl wfdb-10.4.9/lib/Makefile.tpl
--- wfdb-10.4.8/lib/Makefile.tpl	2006-05-11 13:24:30.000000000 -0400
+++ wfdb-10.4.9/lib/Makefile.tpl	2008-09-26 11:30:24.000000000 -0400
@@ -1,5 +1,5 @@
 # file: Makefile.tpl		G. Moody	  24 May 2000
-#				Last revised:     11 May 2006
+#				Last revised:     26 September 2008
 # This section of the Makefile should not need to be changed.
 
 INCLUDES = $(INCDIR)/wfdb/wfdb.h $(INCDIR)/wfdb/ecgcodes.h \
@@ -42,11 +42,11 @@
 
 wfdb-config:
 	$(CC) $(CFLAGS) -DVERSION='"$(VERSION)"' -DCFLAGS='"-I$(INCDIR)"' \
-	  -DLDFLAGS='"-L$(LIBDIR) -lwfdb"' -I$(INCDIR) -o $@ wfdb-config.c
+	  -DLDFLAGS='"-lwfdb"' -I$(INCDIR) -o $@ wfdb-config.c
 
-# `make clean':  also remove previously compiled versions of the library
+# `make clean': remove binaries and backup files
 clean:
-	rm -f $(OFILES) libwfdb.* *.dll *~ wfdb.h wfdblib.h wfdb-config
+	rm -f $(OFILES) libwfdb.* *.dll *~ wfdb-config
 
 # `make TAGS':  make an `emacs' TAGS file
 TAGS:		$(HFILES) $(CFILES)
diff -Naur --exclude Makefile --exclude info wfdb-10.4.8/lib/signal.c wfdb-10.4.9/lib/signal.c
--- wfdb-10.4.8/lib/signal.c	2008-04-15 11:43:46.000000000 -0400
+++ wfdb-10.4.9/lib/signal.c	2008-08-14 17:48:58.000000000 -0400
@@ -1,5 +1,5 @@
 /* file: signal.c	G. Moody	13 April 1989
-			Last revised:   15 April 2008		wfdblib 10.4.7
+			Last revised:   14 August 2008		wfdblib 10.4.9
 WFDB library functions for signals
 
 _______________________________________________________________________________
@@ -1464,6 +1464,9 @@
     WFDB_Signal s;
     unsigned int b, d = 1, n, nn;
 
+    /* Do nothing if the input pointer is correct already. */
+    if (istime == (in_msrec ? t + segp->samp0 : t))
+	return (0);
 
     /* Find the first signal that belongs to group g. */
     for (s = 0; s < nisig && g != isd[s]->info.group; s++)
diff -Naur --exclude Makefile --exclude info wfdb-10.4.8/lib/wfdb.h wfdb-10.4.9/lib/wfdb.h
--- wfdb-10.4.8/lib/wfdb.h	1969-12-31 19:00:00.000000000 -0500
+++ wfdb-10.4.9/lib/wfdb.h	2008-10-10 13:44:07.000000000 -0400
@@ -0,0 +1,405 @@
+/* file: wfdb.h		G. Moody	13 June 1983
+			Last revised:   14 July 2008		wfdblib 10.4.7
+WFDB library type, constant, structure, and function interface definitions
+
+_______________________________________________________________________________
+wfdb: a library for reading and writing annotated waveforms (time series data)
+Copyright (C) 1983-2008 George B. Moody
+
+This library is free software; you can redistribute it and/or modify it under
+the terms of the GNU Library General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option) any
+later version.
+
+This library is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE.  See the GNU Library General Public License for more
+details.
+
+You should have received a copy of the GNU Library General Public License along
+with this library; if not, write to the Free Software Foundation, Inc., 59
+Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+You may contact the author by e-mail (george@mit.edu) or postal mail
+(MIT Room E25-505A, Cambridge, MA 02139 USA).  For updates to this software,
+please visit PhysioNet (http://www.physionet.org/).
+_______________________________________________________________________________
+
+*/
+
+#ifndef wfdb_WFDB_H	/* avoid multiple definitions */
+#define wfdb_WFDB_H
+
+/* WFDB library version. */
+#define WFDB_MAJOR   10
+#define WFDB_MINOR   4
+#define WFDB_RELEASE 9
+#define WFDB_NETFILES 1	/* if 1, library includes code for HTTP, FTP clients */
+#define WFDB_NETFILES_LIBCURL 1
+
+/* Determine what type of compiler is being used. */
+#ifdef __STDC__		/* true for ANSI C compilers only */
+#define wfdb_PROTO	/* function prototypes will be needed */
+#undef _WINDOWS		/* we don't want MS-Windows API in this case */
+#undef _WIN32		/* ... or 32-bit MS-Windows API either */
+#endif
+
+#ifdef __cplusplus	/* true for some C++ compilers */
+#define wfdb_CPP
+#define wfdb_PROTO
+#endif
+
+#ifdef c_plusplus	/* true for some other C++ compilers */
+#define wfdb_CPP
+#define wfdb_PROTO
+#endif
+
+#ifdef _WIN32		/* true when compiling for 32-bit MS Windows */
+#ifndef _WINDOWS
+#define _WINDOWS
+#endif
+#endif
+
+#ifdef _WINDOWS		/* true when compiling for MS Windows */
+#define wfdb_PROTO
+#endif
+
+#ifndef wfdb_PROTO	/* should be true for K&R C compilers only */
+#define wfdb_KRC
+#define signed
+#endif
+
+/* Simple data types */
+typedef int	     WFDB_Sample;   /* units are adus */
+typedef long 	     WFDB_Time;	    /* units are sample intervals */
+typedef long	     WFDB_Date;	    /* units are days */
+typedef double	     WFDB_Frequency;/* units are Hz (samples/second/signal) */
+typedef double	     WFDB_Gain;	    /* units are adus per physical unit */
+typedef unsigned int WFDB_Group;    /* signal group number */
+typedef unsigned int WFDB_Signal;   /* signal number */
+typedef unsigned int WFDB_Annotator;/* annotator number */
+
+#define WFDB_INVALID_SAMPLE (-32768) /* samples from getvec or getframe with
+				        this value are not valid */
+
+/* Array sizes
+   Many older applications use the values of WFDB_MAXANN, WFDB_MAXSIG, and
+   WFDB_MAXSPF to determine array sizes, but (since WFDB library version 10.2)
+   there are no longer any fixed limits imposed by the WFDB library.
+*/
+#define WFDB_MAXANN    2   /* maximum number of input or output annotators */
+#define	WFDB_MAXSIG   32   /* maximum number of input or output signals */
+#define WFDB_MAXSPF    4   /* maximum number of samples per signal per frame */
+#define WFDB_MAXRNL   20   /* maximum length of record name */
+#define WFDB_MAXUSL   20   /* maximum length of WFDB_siginfo `.units' string */
+#define WFDB_MAXDSL   60   /* maximum length of WFDB_siginfo `.desc' string */
+
+/* WFDB_anninfo '.stat' values */
+#define WFDB_READ      0   /* standard input annotation file */
+#define WFDB_WRITE     1   /* standard output annotation file */
+#define WFDB_AHA_READ  2   /* AHA-format input annotation file */
+#define WFDB_AHA_WRITE 3   /* AHA-format output annotation file */
+
+/* WFDB_siginfo '.fmt' values
+FMT_LIST is suitable as an initializer for a static array; it lists all of
+the legal values for the format field in a WFDB_siginfo structure.
+ fmt    meaning
+   0	null signal (nothing read or written)
+   8	8-bit first differences
+  16	16-bit 2's complement amplitudes, low byte first
+  61	16-bit 2's complement amplitudes, high byte first
+  80	8-bit offset binary amplitudes
+ 160	16-bit offset binary amplitudes
+ 212	2 12-bit amplitudes bit-packed in 3 bytes
+ 310	3 10-bit amplitudes bit-packed in 4 bytes
+ 311    3 10-bit amplitudes bit-packed in 4 bytes
+*/
+#define WFDB_FMT_LIST {0, 8, 16, 61, 80, 160, 212, 310, 311}
+#define WFDB_NFMTS	  9    /* number of items in FMT_LIST */
+
+/* Default signal specifications */
+#define WFDB_DEFFREQ	250.0  /* default sampling frequency (Hz) */
+#define WFDB_DEFGAIN	200.0  /* default value for gain (adu/physical unit) */
+#define WFDB_DEFRES	12     /* default value for ADC resolution (bits) */
+
+/* getvec operating modes */
+#define WFDB_LOWRES   	0	/* return one sample per signal per frame */
+#define WFDB_HIGHRES	1	/* return each sample of oversampled signals,
+				   duplicating samples of other signals */
+#define WFDB_GVPAD	2	/* replace invalid samples with previous valid
+				   samples */
+
+/* calinfo '.caltype' values
+WFDB_AC_COUPLED and WFDB_DC_COUPLED are used in combination with the pulse
+shape definitions below to characterize calibration pulses. */
+#define WFDB_AC_COUPLED	0	/* AC coupled signal */
+#define WFDB_DC_COUPLED	1	/* DC coupled signal */
+#define WFDB_CAL_SQUARE	2	/* square wave pulse */
+#define WFDB_CAL_SINE	4	/* sine wave pulse */
+#define WFDB_CAL_SAWTOOTH	6	/* sawtooth pulse */
+#define WFDB_CAL_UNDEF	8	/* undefined pulse shape */
+
+/* Structure definitions */
+struct WFDB_siginfo {	/* signal information structure */
+    char *fname;	/* filename of signal file */
+    char *desc;		/* signal description */
+    char *units;	/* physical units (mV unless otherwise specified) */
+    WFDB_Gain gain;	/* gain (ADC units/physical unit, 0: uncalibrated) */
+    WFDB_Sample initval; 	/* initial value (that of sample number 0) */
+    WFDB_Group group;	/* signal group number */
+    int fmt;		/* format (8, 16, etc.) */
+    int spf;		/* samples per frame (>1 for oversampled signals) */
+    int bsize;		/* block size (for character special files only) */
+    int adcres;		/* ADC resolution in bits */
+    int adczero;	/* ADC output given 0 VDC input */
+    int baseline;	/* ADC output given 0 physical units input */
+    long nsamp;		/* number of samples (0: unspecified) */
+    int cksum;		/* 16-bit checksum of all samples */
+};
+
+struct WFDB_calinfo {	/* calibration information structure */
+    double low;		/* low level of calibration pulse in physical units */
+    double high;	/* high level of calibration pulse in physical units */
+    double scale;	/* customary plotting scale (physical units per cm) */
+    char *sigtype;	/* signal type */
+    char *units;	/* physical units */
+    int caltype;	/* calibration pulse type (see definitions above) */
+};
+
+struct WFDB_anninfo {	/* annotator information structure */
+    char *name;		/* annotator name */
+    int stat;		/* file type/access code (READ, WRITE, etc.) */
+};
+
+struct WFDB_ann {	/* annotation structure */
+    WFDB_Time time;	/* annotation time, in sample intervals from
+			   the beginning of the record */
+    char anntyp;	/* annotation type (< ACMAX, see <wfdb/ecgcodes.h> */
+    signed char subtyp;	/* annotation subtype */
+    signed char chan;	/* channel number */
+    signed char num;	/* annotator number */
+    char *aux;		/* pointer to auxiliary information */ 
+};
+
+/* Composite data types */
+typedef struct WFDB_siginfo WFDB_Siginfo;
+typedef struct WFDB_calinfo WFDB_Calinfo;
+typedef struct WFDB_anninfo WFDB_Anninfo;
+typedef struct WFDB_ann WFDB_Annotation;
+
+/* Function types */
+#ifndef _WINDOWS	/* for everything *except* MS Windows applications */
+typedef char *FSTRING;
+typedef WFDB_Date FDATE;
+typedef double FDOUBLE;
+typedef WFDB_Frequency FFREQUENCY;
+typedef int FINT;
+typedef long FLONGINT;
+typedef WFDB_Sample FSAMPLE;
+typedef WFDB_Time FSITIME;
+typedef void FVOID;
+#else		
+#ifndef _WIN32	/* for 16-bit MS Windows applications using the WFDB DLL */
+  /* typedefs don't work properly with _far or _pascal -- must use #defines */
+#define FSTRING char _far * _pascal
+#define FDATE WFDB_Date _far _pascal
+#define FDOUBLE double _far _pascal
+#define FFREQUENCY WFDB_Frequency _far _pascal
+#define FINT int _far _pascal
+#define FLONGINT long _far _pascal
+#define FSAMPLE WFDB_Sample _far _pascal
+#define FSITIME WFDB_Time _far _pascal
+#define FVOID void _far _pascal
+#else		/* for 32-bit MS Windows applications using the WFDB DLL */
+#ifndef CALLBACK
+#define CALLBACK __stdcall	/* from windef.h */
+#endif
+#define FSTRING __declspec (dllexport) char * CALLBACK
+#define FDATE __declspec (dllexport) WFDB_Date CALLBACK
+#define FDOUBLE __declspec (dllexport) double CALLBACK
+#define FFREQUENCY __declspec (dllexport) WFDB_Frequency CALLBACK
+#define FINT __declspec (dllexport) int CALLBACK
+#define FLONGINT __declspec (dllexport) long CALLBACK
+#define FSAMPLE __declspec (dllexport) WFDB_Sample CALLBACK
+#define FSITIME __declspec (dllexport) WFDB_Time CALLBACK
+#define FVOID __declspec (dllexport) void CALLBACK
+#endif
+#endif
+
+/* Specify C linkage for C++ compilers. */
+#ifdef wfdb_CPP
+extern "C" {
+#endif
+
+/* Define function prototypes for ANSI C compilers and C++ compilers */
+#ifdef wfdb_PROTO
+extern FINT annopen(char *record, WFDB_Anninfo *aiarray,
+		    unsigned int nann);
+extern FINT isigopen(char *record, WFDB_Siginfo *siarray, int nsig);
+extern FINT osigopen(char *record, WFDB_Siginfo *siarray,
+		     unsigned int nsig);
+extern FINT osigfopen(WFDB_Siginfo *siarray, unsigned int nsig);
+extern FINT wfdbinit(char *record,
+		     WFDB_Anninfo *aiarray, unsigned int nann,
+		     WFDB_Siginfo *siarray, unsigned int nsig);
+extern FINT getspf(void);
+extern FVOID setgvmode(int mode);
+extern FINT setifreq(WFDB_Frequency freq);
+extern FFREQUENCY getifreq(void);
+extern FINT getvec(WFDB_Sample *vector);
+extern FINT getframe(WFDB_Sample *vector);
+extern FINT putvec(WFDB_Sample *vector);
+extern FINT getann(WFDB_Annotator a, WFDB_Annotation *annot);
+extern FINT ungetann(WFDB_Annotator a, WFDB_Annotation *annot);
+extern FINT putann(WFDB_Annotator a, WFDB_Annotation *annot);
+extern FINT isigsettime(WFDB_Time t);
+extern FINT isgsettime(WFDB_Group g, WFDB_Time t);
+extern FINT iannsettime(WFDB_Time t);
+extern FSTRING ecgstr(int annotation_code);
+extern FINT strecg(char *annotation_mnemonic_string);
+extern FINT setecgstr(int annotation_code, char *annotation_mnemonic_string);
+extern FSTRING annstr(int annotation_code);
+extern FINT strann(char *annotation_mnemonic_string);
+extern FINT setannstr(int annotation_code, char *annotation_mnemonic_string);
+extern FSTRING anndesc(int annotation_code);
+extern FINT setanndesc(int annotation_code, char *annotation_description);
+extern FVOID setafreq(WFDB_Frequency f);
+extern FFREQUENCY getafreq(void);
+extern FVOID iannclose(WFDB_Annotator a);
+extern FVOID oannclose(WFDB_Annotator a);
+extern FINT wfdb_isann(int code);
+extern FINT wfdb_isqrs(int code);
+extern FINT wfdb_setisqrs(int code, int newval);
+extern FINT wfdb_map1(int code);
+extern FINT wfdb_setmap1(int code, int newval);
+extern FINT wfdb_map2(int code);
+extern FINT wfdb_setmap2(int code, int newval);
+extern FINT wfdb_ammap(int code);
+extern FINT wfdb_mamap(int code, int subtype);
+extern FINT wfdb_annpos(int code);
+extern FINT wfdb_setannpos(int code, int newval);
+extern FSTRING timstr(WFDB_Time t);
+extern FSTRING mstimstr(WFDB_Time t);
+extern FSITIME strtim(char *time_string);
+extern FSTRING datstr(WFDB_Date d);
+extern FDATE strdat(char *date_string);
+extern FINT adumuv(WFDB_Signal s, WFDB_Sample a);
+extern FSAMPLE muvadu(WFDB_Signal s, int microvolts);
+extern FDOUBLE aduphys(WFDB_Signal s, WFDB_Sample a);
+extern FSAMPLE physadu(WFDB_Signal s, double v);
+extern FSAMPLE sample(WFDB_Signal s, WFDB_Time t);
+extern FINT sample_valid(void);
+extern FINT calopen(char *calibration_filename);
+extern FINT getcal(char *description, char *units, WFDB_Calinfo *cal);
+extern FINT putcal(WFDB_Calinfo *cal);
+extern FINT newcal(char *calibration_filename);
+extern FVOID flushcal(void);
+extern FSTRING getinfo(char *record);
+extern FINT putinfo(char *info);
+extern FINT newheader(char *record);
+extern FINT setheader(char *record, WFDB_Siginfo *siarray, unsigned int nsig);
+extern FINT setmsheader(char *record, char **segnames, unsigned int nsegments);
+extern FINT wfdbgetskew(WFDB_Signal s);
+extern FVOID wfdbsetiskew(WFDB_Signal s, int skew);
+extern FVOID wfdbsetskew(WFDB_Signal s, int skew);
+extern FLONGINT wfdbgetstart(WFDB_Signal s);
+extern FVOID wfdbsetstart(WFDB_Signal s, long bytes);
+extern FVOID wfdbquit(void);
+extern FFREQUENCY sampfreq(char *record);
+extern FINT setsampfreq(WFDB_Frequency sampling_frequency);
+extern FFREQUENCY getcfreq(void);
+extern FVOID setcfreq(WFDB_Frequency counter_frequency);
+extern FDOUBLE getbasecount(void);
+extern FVOID setbasecount(double count);
+extern FINT setbasetime(char *time_string);
+extern FVOID wfdbquiet(void);
+extern FVOID wfdbverbose(void);
+extern FSTRING wfdberror(void);
+extern FVOID setwfdb(char *database_path_string);
+extern FSTRING getwfdb(void);
+extern FINT setibsize(int input_buffer_size);
+extern FINT setobsize(int output_buffer_size);
+extern FSTRING wfdbfile(char *file_type, char *record);
+extern FVOID wfdbflush(void);
+extern FVOID wfdbmemerr(int exit_on_error);
+#endif
+
+#ifdef wfdb_CPP
+}
+#endif
+
+#ifdef wfdb_KRC	/* declare only function return types for K&R C compilers */
+extern FINT annopen(), isigopen(), osigopen(), wfdbinit(), getspf(),
+    setifreq(), getvec(), getframe(), putvec(), getann(), ungetann(), putann(),
+    isigsettime(), isgsettime(), iannsettime(), strecg(), setecgstr(),
+    strann(), setannstr(), setanndesc(), wfdb_isann(), wfdb_isqrs(),
+    wfdb_setisqrs(), wfdb_map1(), wfdb_setmap1(), wfdb_map2(), wfdb_setmap2(),
+    wfdb_ammap(), wfdb_mamap(), wfdb_annpos(), wfdb_setannpos(),
+    adumuv(), newheader(), setheader(),
+    setmsheader(), setsampfreq(), setbasetime(), putinfo(), setibsize(),
+    setobsize(), calopen(), getcal(), putcal(), newcal(), wfdbgetskew(),
+    sample_valid();
+extern FLONGINT wfdbgetstart();
+extern FSAMPLE muvadu(), physadu(), sample();
+extern FSTRING ecgstr(), annstr(), anndesc(), timstr(), mstimstr(),
+    datstr(), getwfdb(), getinfo(), wfdberror(), wfdbfile();
+extern FSITIME strtim();
+extern FDATE strdat();
+extern FVOID setafreq(), setgvmode(), wfdbquit(), wfdbquiet(), dbverbose(),
+    setdb(), wfdbflush(), setcfreq(), setbasecount(), flushcal(),
+    wfdbsetiskew(), wfdbsetskew(), wfdbsetstart(), wfdbmemerr();
+extern FFREQUENCY getafreq(), getifreq(), sampfreq(), getcfreq();
+extern FDOUBLE aduphys(), getbasecount();
+#endif
+
+/* Remove local preprocessor definitions. */
+#ifdef wfdb_PROTO
+#undef wfdb_PROTO
+#endif
+
+#ifdef wfdb_CPP
+#undef wfdb_CPP
+#endif
+
+#ifdef wfdb_KRC
+#undef wfdb_KRC
+#undef signed
+#endif
+
+/* Include some useful function declarations.  This section includes standard
+   header files if available and provides alternative declarations for those
+   platforms that need them.
+
+  The ANSI/ISO C standard requires conforming compilers to predefine __STDC__.
+  Non-conforming compilers for MS-Windows may or may not predefine _WINDOWS;
+  if you use such a compiler, you may need to define _WINDOWS manually. */
+#if defined(__STDC__) || defined(_WINDOWS)
+# include <stdlib.h>
+#else
+extern double atof();
+extern long atol();
+extern char *getenv();
+extern void exit();
+typedef long time_t;
+# ifdef HAVE_MALLOC_H
+# include <malloc.h>
+# else
+extern char *malloc(), *calloc(), *realloc();
+# endif
+# ifdef ISPRINTF
+extern int sprintf();
+# else
+#  ifndef MSDOS
+extern char *sprintf();
+#  endif
+# endif
+#endif
+
+#ifndef BSD
+# include <string.h>
+#else		/* for Berkeley UNIX only */
+# include <strings.h>
+# define strchr index
+#endif
+
+#endif
diff -Naur --exclude Makefile --exclude info wfdb-10.4.8/lib/wfdbio.c wfdb-10.4.9/lib/wfdbio.c
--- wfdb-10.4.8/lib/wfdbio.c	2008-04-08 16:56:36.000000000 -0400
+++ wfdb-10.4.9/lib/wfdbio.c	2008-08-12 17:45:27.000000000 -0400
@@ -1,5 +1,5 @@
 /* file: wfdbio.c	G. Moody	18 November 1988
-                        Last revised:	  8 April 2008       wfdblib 10.4.6
+                        Last revised:	 12 August 2008       wfdblib 10.4.9
 Low-level I/O functions for the WFDB library
 
 _______________________________________________________________________________
@@ -828,8 +828,7 @@
     }
 
     /* Check to see if standard input or output is requested. */
-    if (strcmp(s, "-") == 0 ||
-	(strcmp(s, "hea") == 0 && strcmp(record, "-") == 0))
+    if (strcmp(record, "-") == 0)
 	if (mode == WFDB_READ) {
 	    static WFDB_FILE wfdb_stdin;
 
diff -Naur --exclude Makefile --exclude info wfdb-10.4.8/lib/wfdblib.h wfdb-10.4.9/lib/wfdblib.h
--- wfdb-10.4.8/lib/wfdblib.h	1969-12-31 19:00:00.000000000 -0500
+++ wfdb-10.4.9/lib/wfdblib.h	2008-10-10 12:11:48.000000000 -0400
@@ -0,0 +1,391 @@
+/* file: wfdblib.h	G. Moody	13 April 1989
+                        Last revised:	 8 April 2008       wfdblib 10.4.6
+External definitions for WFDB library private functions
+
+_______________________________________________________________________________
+wfdb: a library for reading and writing annotated waveforms (time series data)
+Copyright (C) 1989-2008 George B. Moody
+
+This library is free software; you can redistribute it and/or modify it under
+the terms of the GNU Library General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option) any
+later version.
+
+This library is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE.  See the GNU Library General Public License for more
+details.
+
+You should have received a copy of the GNU Library General Public License along
+with this library; if not, write to the Free Software Foundation, Inc., 59
+Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+You may contact the author by e-mail (george@mit.edu) or postal mail
+(MIT Room E25-505A, Cambridge, MA 02139 USA).  For updates to this software,
+please visit PhysioNet (http://www.physionet.org/).
+_______________________________________________________________________________
+
+These definitions may be included in WFDB library source files to permit them
+to share information about library private functions, which are not intended
+to be invoked directly by user programs.  By convention, all externally defined
+symbols reserved to the library begin with the characters "wfdb_".
+*/
+
+#include "wfdb.h"
+
+/* MS-Windows users are strongly advised to compile the WFDB library using the
+   free Cygwin tools (www.cygwin.com).  Use of other compilers may be possible
+   but is not supported.
+
+   Cygwin users:  Note that the symbols _WINDOWS, _WINDLL, WIN32, etc. are
+   not defined and should not be defined when compiling the WFDB software
+   package using gcc.  Cygwin's POSIX emulation layer avoids the need for
+   the various workarounds required when using other compilers under
+   MS-Windows.
+
+   If you are using another MS-Windows compiler, you will need these
+   workarounds, and you should be careful to define _WINDOWS, _WINDLL, and
+   _WIN32 as appropriate.  Older versions of the WFDB library were successfully
+   compiled under MS-DOS and under 16-bit versions of MS-Windows, but the
+   conditionally compiled code written to support these platforms has not been
+   tested recently.
+
+   Define the symbol _WINDLL if this library is to be compiled as a Microsoft
+   Windows DLL.  Note that a DLL's private functions (such as those listed
+   below) *cannot* be called by Windows user programs, which can call only DLL
+   functions that use the Pascal calling interface (see wfdb.h).  To compile
+   this library for use in a Microsoft Windows application, but *not* as a DLL,
+   define the symbol _WINDOWS instead of _WINDLL. */
+/* #define _WINDLL */
+
+#if defined(_WINDLL) && !defined(_WINDOWS)
+#define _WINDOWS
+#endif
+
+#if defined(_WIN16) && !defined(_WINDOWS)
+#define _WINDOWS
+#endif
+
+#if defined(_WIN32) && !defined(_WINDOWS)
+#define _WINDOWS
+#endif
+
+#if defined(_WINDOWS) && !defined (_WIN16) && !defined(_WIN32)
+#define _WIN16
+#endif
+
+/* Define the symbol MSDOS if this library is to be used under MS-DOS or MS
+   Windows.  Note: MSDOS is predefined by some MS-DOS and MS Windows compilers.
+*/
+#if defined(_WINDOWS)
+# if !defined(MSDOS)
+#  define MSDOS
+# endif
+#endif
+
+/* Macintosh users are strongly advised to use Mac OS X or later.  If you are
+   doing so, no special configuration is needed, and you may ignore this
+   section.
+
+   If you are running Mac OS 9 or earlier, you may be able to use the WFDB
+   software package, but this configuration has not been tested for many years,
+   and is not supported!  If you would like to try it, define MAC. */
+/* #define MAC */
+
+/* DEFWFDB is the default value of the WFDB path if the WFDB environment
+   variable is not set.  This value is edited by the configuration script
+   (../configure), which also edits this block of comments to match.
+
+   If WFDB_NETFILES support is disabled, the string ". /usr/database" is
+   usually sufficient for a default WFDB path, thus restricting the search for
+   WFDB files to the current directory ("."), followed by /usr/database).
+   
+   If WFDB_NETFILES support is enabled, the first setting below adds the
+   web-accessible PhysioBank databases to the default path; you may wish to
+   change this to use a nearby PhysioNet mirror (for a list of mirrors, see
+   http://physionet.org/mirrors/).  DEFWFDB must not be NULL, however.
+*/
+
+#ifndef WFDB_NETFILES
+# define DEFWFDB	". /usr/database"
+#else
+# define DEFWFDB ". /usr/database http://physionet.org/physiobank/database"
+#endif
+
+/* Mac OS 9 and earlier, only:  The value of DEFWFDB given below specifies
+   that the WFDB path is to be read from the file udb/dbpath.mac on the third
+   edition of the MIT-BIH Arrhythmia Database CD-ROM (which has a volume name
+   of `MITADB3');  you may prefer to use a file on a writable disk for this
+   purpose, to make reconfiguration possible.  See getwfdb() in wfdbio.c for
+   further information.
+  
+   If the version of "ISO 9660 File Access" in the "System:Extensions" folder
+   is earlier than 5.0, either update your system software (recommended) or
+   define FIXISOCD. */
+
+#ifdef MAC
+/* #define FIXISOCD */
+# ifdef FIXISOCD
+#  define DEFWFDB	"@MITADB3:UDB:DBPATH.MAC;1"
+# else
+#  define DEFWFDB	"@MITADB3:UDB:DBPATH.MAC"
+#  define __STDC__
+# endif
+#endif
+
+/* DEFWFDBCAL is the name of the default WFDB calibration file, used if the
+   WFDBCAL environment variable is not set.  This name need not include path
+   information if the calibration file is located in a directory included in
+   the WFDB path.  The value given below is the name of the standard
+   calibration file supplied on the various CD-ROM databases.  DEFWFDBCAL may
+   be NULL if you prefer not to have a default calibration file.  See calopen()
+   in calib.c for further information. */
+#define DEFWFDBCAL "wfdbcal"
+
+/* WFDB applications may write annotations out-of-order, but in almost all
+   cases, they expect that annotations they read must be in order.  The
+   environment variable WFDBANNSORT specifies if wfdbquit() should attempt to
+   sort annotations in any output annotation files before closing them (it
+   does this if WFDBANNSORT is non-zero, or if WFDBANNSORT is not set, and
+   DEFWFDBANNSORT is non-zero).  Sorting is done by invoking 'sortann' (see
+   ../app/sortann.c) as a separate process;  since this cannot be done from
+   an MS-Windows DLL, sorting is disabled by default in this case. */
+#if defined(_WINDLL)
+#define DEFWFDBANNSORT 0
+#else
+#define DEFWFDBANNSORT 1
+#endif
+
+/* When reading multifrequency records, getvec() can operate in two modes:
+   WFDB_LOWRES (returning one sample per signal per frame), or WFDB_HIGHRES
+   (returning each sample of any oversampled signals, and duplicating samples
+   of other signals as necessary).  If the operating mode is not selected by
+   invoking setgvmode(), the value of the environment variable WFDBGVMODE
+   determines the mode (0: WFDB_LOWRES, 1: WFDB_HIGHRES);  if WFDBGVMODE
+   is not set, the value of DEFWFDBMODE determines the mode. */
+#define DEFWFDBGVMODE WFDB_LOWRES
+
+/* putenv() is available in POSIX, SVID, and BSD Unices and in MS-DOS and
+   32-bit MS Windows, but not under 16-bit MS Windows or under MacOS.  If it is
+   available, getwfdb() (in wfdbio.c) detects when the environment variables
+   WFDB, WFDBCAL, WFDBANNSORT, and WFDBGVMODE are not set, and sets them
+   according to DEFWFDB, DEFWFDBCAL, DEFWFDBANNSORT, and DEFWFDBGVMODE as
+   needed using putenv().  This feature is useful mainly for programs such as
+   WAVE, where these variables are set interactively and it is useful to show
+   their default values to the user; setwfdb() and getwfdb() do not depend on
+   it.
+*/
+#if !defined(_WIN16) && !defined(MAC)
+#define HAS_PUTENV
+#endif
+
+#ifndef FILE
+#include <stdio.h>
+/* stdin/stdout may not be defined in some environments (e.g., for MS Windows
+   DLLs).  Defining them as NULL here allows the WFDB library to be compiled in
+   such environments (it does not allow use of stdin/stdout when the operating
+   environment does not provide them, however). */
+#ifndef stdin
+#define stdin NULL
+#endif
+#ifndef stdout
+#define stdout NULL
+#endif
+#endif
+
+#ifndef TRUE
+#define TRUE 1 
+#endif 
+#ifndef FALSE
+#define FALSE 0
+#endif 
+
+/* Dynamic memory allocation macros for the WFDB library. */
+#define MEMERR(P, N, S) \
+    { wfdb_error("WFDB: can't allocate (%ld*%ld) bytes for %s\n", \
+	     (size_t)N, (size_t)S, #P);			      \
+      if (wfdb_me_fatal()) exit(1); }
+#define SFREE(P) { if (P) { free (P); P = 0; } }
+#define SUALLOC(P, N, S) { if (!(P = calloc((N), (S)))) MEMERR(P, (N), (S)); }
+#define SALLOC(P, N, S) { SFREE(P); SUALLOC(P, (N), (S)) }
+#define SREALLOC(P, N, S) { if (!(P = realloc(P, (N)*(S)))) MEMERR(P,(N),(S)); }
+#define SSTRCPY(P, Q) { if (Q) { \
+	 SALLOC(P, (size_t)strlen(Q)+1,1); strcpy(P, Q); } }
+
+/* Structures used by internal WFDB library functions only */
+struct netfile {
+  char *url;
+  char *data;
+  int mode;
+  long base_addr;
+  long cont_len;
+  long pos;
+  long err;
+  int fd;
+};
+
+struct WFDB_FILE {
+  FILE *fp;
+  struct netfile *netfp;
+  int type;
+};
+
+/* Values for WFDB_FILE 'type' field */
+#define WFDB_LOCAL	0	/* a local file, read via C standard I/O */
+#define WFDB_NET	1	/* a remote file, read via libwww */
+
+/* Composite data types */
+typedef struct netfile netfile;
+typedef struct WFDB_FILE WFDB_FILE;
+
+/* To enable http and ftp access as well as standard (local file) I/O via the
+   WFDB library, define WFDB_NETFILES=1 and link with libwww (see 'Makefile').
+   Otherwise, the WFDB library uses only the ANSI/ISO standard I/O library. */
+#if WFDB_NETFILES
+#if WFDB_NETFILES_LIBCURL
+# include <curl/curl.h>
+#else
+# include <WWWLib.h>
+# include <WWWInit.h>
+#endif
+#include <errno.h>
+#ifndef EROFS	 /* errno value: attempt to write to a read-only file system */
+# ifdef EINVAL
+#  define EROFS EINVAL
+# else
+#  define EROFS 1
+# endif
+#endif
+
+/* Constants */
+/* #define USEHTCACHE */	/* uncomment to enable caching by libwww */
+
+/* http cache parameters (effective only if USEHTCACHE is defined) */
+#define CACHEDIR	"/tmp"	/* should be world-writable */
+#define CACHESIZE	100	/* max size of the entire http cache in MB */
+#define ENTRYSIZE	20	/* max size of a single cache entry in MB */
+
+#define NF_PAGE_SIZE	32768 	/* default bytes per http range request */
+
+/* values for netfile 'err' field */
+#define NF_NO_ERR	0	/* no errors */
+#define NF_EOF_ERR	1	/* file pointer at EOF */
+#define NF_REAL_ERR	2	/* read request failed */
+
+/* values for netfile 'mode' field */
+#define NF_CHUNK_MODE	0	/* http range requests supported */
+#define NF_FULL_MODE	1	/* http range requests not supported */
+
+#else	    /* WFDB_NETFILES = 0 -- use standard I/O functions only */
+
+#define wfdb_feof(wp)			feof(wp->fp)
+#define wfdb_ferror(wp)			ferror(wp->fp)
+#define wfdb_fflush(wp)		((wp == NULL) ? fflush(NULL) : fflush(wp->fp))
+#define wfdb_fgets(s, n, wp)		fgets(s, n, wp->fp)
+#define wfdb_fread(p, s, n, wp)		fread(p, s, n, wp->fp)
+#define wfdb_fseek(wp, o, w)		fseek(wp->fp, o, w)
+#define wfdb_ftell(wp)			ftell(wp->fp)
+#define wfdb_fwrite(p, s, n, wp)	fwrite(p, s, n, wp->fp)
+#define wfdb_getc(wp)			getc(wp->fp)
+#define wfdb_putc(c, wp)		putc(c, wp->fp)
+
+#endif
+
+#ifdef _WINDOWS
+#ifndef _WIN32	/* these definitions are needed for 16-bit MS Windows only */
+#define strcat _fstrcat
+#define strchr _fstrchr
+#define strcmp _fstrcmp
+#define strcpy _fstrcpy
+#define strlen _fstrlen
+#define strncmp _fstrncmp
+#define strtok _fstrtok
+#endif
+#endif
+
+/* Define MKDIR as either the one-argument mkdir() (for the native MSDOS and
+   MS-Windows API) or the standard two-argument mkdir() (everywhere else). */
+#ifndef MKDIR
+#ifdef MSDOS
+#include <direct.h>
+#define MKDIR(D,P)	mkdir((D))
+#else
+#define MKDIR(D,P)	mkdir((D),(P))
+#endif
+#endif
+
+/* Define function prototypes for ANSI C, MS Windows C, and C++ compilers */
+#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) || defined(_WINDOWS)
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+/* These functions are defined in wfdbio.c */
+extern int wfdb_fclose(WFDB_FILE *fp);
+extern WFDB_FILE *wfdb_open(const char *file_type, const char *record, int mode);
+extern int wfdb_checkname(char *name, char *description);
+extern void wfdb_striphea(char *record);
+extern int wfdb_g16(WFDB_FILE *fp);
+extern long wfdb_g32(WFDB_FILE *fp);
+extern void wfdb_p16(unsigned int x, WFDB_FILE *fp);
+extern void wfdb_p32(long x, WFDB_FILE *fp);
+extern int wfdb_parse_path(char *wfdb_path);
+extern void wfdb_addtopath(char *pathname);
+extern void wfdb_error(char *format_string, ...);
+extern WFDB_FILE *wfdb_fopen(char *fname, const char *mode);
+extern int wfdb_fprintf(WFDB_FILE *fp, const char *format, ...);
+extern void wfdb_setirec(const char *record_name);
+
+#if WFDB_NETFILES
+extern void wfdb_clearerr(WFDB_FILE *fp);
+extern int wfdb_feof(WFDB_FILE *fp);
+extern int wfdb_ferror(WFDB_FILE *fp);
+extern int wfdb_fflush(WFDB_FILE *fp);
+extern char *wfdb_fgets(char *s, int size, WFDB_FILE *fp);
+extern size_t wfdb_fread(void *ptr, size_t size, size_t nmemb, WFDB_FILE *fp);
+extern int wfdb_fseek(WFDB_FILE *fp, long offset, int whence);
+extern long wfdb_ftell(WFDB_FILE *fp);
+extern size_t wfdb_fwrite(void *ptr, size_t size, size_t nmemb, WFDB_FILE *fp);
+extern int wfdb_getc(WFDB_FILE *fp);
+extern int wfdb_putc(int c, WFDB_FILE *fp);
+extern void wfdb_wwwquit(void);
+#endif
+
+/* These functions are defined in signal.c */
+extern void wfdb_sampquit(void);
+extern void wfdb_sigclose(void);
+extern void wfdb_osflush(void);
+
+/* These functions are defined in annot.c */
+extern void wfdb_anclose(void);
+extern void wfdb_oaflush(void);
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#else        /* declare only function return types for non-ANSI C compilers */
+
+extern WFDB_FILE *wfdb_open(), *wfdb_fopen();
+extern int wfdb_checkname(), wfdb_g16(), wfdb_parse_path();
+extern long wfdb_g32();
+extern void wfdb_striphea(), wfdb_p16(), wfdb_p32(), wfdb_addtopath(),
+    wfdb_error(), wfdb_setirec(), wfdb_sampquit(), wfdb_sigclose(),
+    wfdb_anclose(), wfdb_osflush(), wfdb_oaflush();
+
+# if WFDB_NETFILES
+extern char *wfdb_fgets();
+extern int wfdb_feof(), wfdb_ferror(), wfdb_fflush(), wfdb_fseek(),
+    wfdb_getc(), wfdb_putc();
+extern long wfdb_ftell();
+extern size_t wfdb_fread(), wfdb_fwrite();
+extern void wfdb_clearerr(), wfdb_wwwquit();
+# endif
+
+/* Some non-ANSI C libraries (e.g., version 7, BSD 4.2) lack an implementation
+   of strtok(); define NOSTRTOK to compile the portable version in wfdbio.c. */
+# ifdef NOSTRTOK
+extern char *strtok();
+# endif
+
+#endif
diff -Naur --exclude Makefile --exclude info wfdb-10.4.8/Makefile.tpl wfdb-10.4.9/Makefile.tpl
--- wfdb-10.4.8/Makefile.tpl	2008-07-15 06:27:51.000000000 -0400
+++ wfdb-10.4.9/Makefile.tpl	2008-10-10 11:06:05.000000000 -0400
@@ -1,5 +1,5 @@
 # file: Makefile.tpl		G. Moody	 24 May 2000
-#				Last revised:    11 May 2006
+#				Last revised:    10 October 2008
 # This section of the Makefile should not need to be changed.
 
 # 'make' or 'make all': compile the WFDB applications without installing them
@@ -144,20 +144,25 @@
 	cd doc; $(MAKE) tarball
 
 # 'make rpms': make source and binary RPMs
-RPMROOT=/usr/src/redhat
+RPMROOT=$(HOME)/rpmbuild
 
 rpms:		tarballs
+	mkdir -p $(RPMROOT)/BUILD $(RPMROOT)/RPMS $(RPMROOT)/SOURCES \
+	 $(RPMROOT)/SPECS $(RPMROOT)/SRPMS
 	cp -p ../$(PACKAGE).tar.gz $(RPMROOT)/SOURCES
 	sed s/VERSION/$(VERSION)/g <wfdb.spec | \
 	 sed s/MAJOR/$(MAJOR)/g | sed s/MINOR/$(MINOR)/g | \
 	 sed s/RPMRELEASE/$(RPMRELEASE)/ >$(PACKAGE)-$(RPMRELEASE).spec
 	cp -p $(PACKAGE)-$(RPMRELEASE).spec $(RPMROOT)/SPECS
+	cd; if [ -e .rpmmacros ]; then cp -p .rpmmacros ..rpmmacros; fi
+	cp conf/rpm.mc $(HOME)/.rpmmacros
 	if [ -x /usr/bin/rpmbuild ]; \
 	 then rpmbuild -ba $(PACKAGE)-$(RPMRELEASE).spec; \
 	 else echo "rpmbuild not found in /usr/bin; attempting to use rpm"; \
 	  rpm -ba $(PACKAGE)-$(RPMRELEASE).spec; fi
 	mv $(RPMROOT)/RPMS/*/wfdb*-$(VERSION)-$(RPMRELEASE).*.rpm ..
 	mv $(RPMROOT)/SRPMS/$(PACKAGE)-$(RPMRELEASE).src.rpm ..
-	rm -f $(PACKAGE)-$(RPMRELEASE).spec
+	rm -f $(PACKAGE)-$(RPMRELEASE).spec $(HOME)/.rpmmacros
+	cd; if [ -e ..rpmmacros ]; then mv ..rpmmacros .rpmmacros; fi
 	echo "Remember to sign the RPMs by"
-	echo "   cd ..; rpm --addsign wfdb*$(VERSION)*rpm"
\ No newline at end of file
+	echo "   cd ..; rpm --addsign wfdb*$(VERSION)*rpm"
diff -Naur --exclude Makefile --exclude info wfdb-10.4.8/MANIFEST wfdb-10.4.9/MANIFEST
--- wfdb-10.4.8/MANIFEST	2008-07-23 16:19:04.000000000 -0400
+++ wfdb-10.4.9/MANIFEST	2008-10-10 10:10:37.000000000 -0400
@@ -144,6 +144,7 @@
 conf/mingw-slib.def
 conf/prompt-c
 conf/prompt-n
+conf/rpm.mc
 conf/solaris.def
 conf/solaris-slib.def
 conf/version.def
@@ -475,6 +476,7 @@
 fortran/wfdbf.c
 INSTALL
 install.sh
+install-wave32
 lib/
 lib/annot.c
 lib/calib.c
@@ -487,9 +489,11 @@
 lib/README
 lib/signal.c
 lib/wfdb-config.c
+lib/wfdb.h
 lib/wfdb.h0
 lib/wfdbinit.c
 lib/wfdbio.c
+lib/wfdblib.h
 lib/wfdblib.h0
 Makefile
 Makefile.top
diff -Naur --exclude Makefile --exclude info wfdb-10.4.8/NEWS wfdb-10.4.9/NEWS
--- wfdb-10.4.8/NEWS	2008-07-31 14:50:43.000000000 -0400
+++ wfdb-10.4.9/NEWS	2008-10-10 15:00:23.000000000 -0400
@@ -1,3 +1,19 @@
+10.4.9:
+	The "configure" script is now non-interactive by default.  A new
+	"-i" option selects interactive mode.
+
+	The new "install-wave32" script simplifies installation of WAVE on
+	64-bit Linux.
+
+	The WFDB library once again correctly interprets a hyphen ('-')
+	(used in place of a record name, annotator name, signal file name,
+	or calibration file name) as a reference to the standard input or
+        output, for platforms that support POSIX standard I/O;  see section
+        5.2, "Using Standard I/O for Database Files", in the WFDB Programmer's
+	Guide.  This feature was broken in 10.4.5 as a side effect of changes
+	in wfdb_open (an internal WFDB library function defined in
+	lib/wfdbio.c).
+
 10.4.8:
 	New application convert/ahaecg2mit.c converts files from the AHA DB
 	DVD into WFDB records.  (ECRI, distributors of the AHA DB, recently
