diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/app/epicmp.c wfdb-10.5.3/app/epicmp.c
--- wfdb-10.5.2/app/epicmp.c	2010-04-17 07:34:20.000000000 -0400
+++ wfdb-10.5.3/app/epicmp.c	2010-05-09 14:15:38.000000000 -0400
@@ -1,5 +1,5 @@
 /* file: epicmp.c	G. Moody       3 March 1992
-			Last revised: 17 April 2010
+			Last revised:   9 May 2010
 
 -------------------------------------------------------------------------------
 epicmp: ANSI/AAMI-standard episode-by-episode annotation file comparator
@@ -57,10 +57,10 @@
 #define STE	4	/* ischemic ST in either signal */
 #define AFLE	5	/* atrial flutter */
 
-#define MAXEXCL	10	/* maximum number of intervals excluded from
+#define MAXEXCL	100	/* maximum number of intervals excluded from
 			   comparison */
 
-int aflag, sflag, s0flag, s1flag, vflag;
+int aflag, sflag, s0flag, s1flag, vflag, xflag;
 char *lzmstimstr(), *zmstimstr();
 
 main(argc, argv)
@@ -128,7 +128,10 @@
     void find_episode(), find_exclusions();
 
     /* Find and mark any intervals to be excluded from the comparison. */
-    find_exclusions(stat, type);
+    if (xflag)
+	find_exclusions(stat, type);
+    else
+	nexcl = 0;
 
     /* Return to the beginning of the annotation files. */
     if (iannsettime(0L) < 0) exit(2);
@@ -921,6 +924,9 @@
 	    vfname = argv[i];
 	    vflag = 1;
 	    break;
+	  case 'x':	/* exclude AFL from AFIB comparison, as in EC38:1998) */
+	    xflag = 1;
+	    break;
 	  default:
 	    (void)fprintf(stderr,
 			  "%s: unrecognized option %s\n", pname, argv[i]);
@@ -999,6 +1005,8 @@
  "                 if TIME is 0, the comparison ends when the end of either",
  "                 annotation file is reached)",
  " -V FILE        append VF reports to FILE",
+ " -x		  exclude reference AFL from AFIB +P comparison (EC38:1998)",
+ "                 default: no exclusions (EC38:2007, EC57)",
 NULL
 };
 
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/app/rdann.c wfdb-10.5.3/app/rdann.c
--- wfdb-10.5.2/app/rdann.c	2006-04-26 09:57:38.000000000 -0400
+++ wfdb-10.5.3/app/rdann.c	2010-06-04 12:56:08.000000000 -0400
@@ -1,9 +1,9 @@
 /* file rdann.c	    T. Baker and G. Moody	27 July 1981
-		    Last revised:	        26 April 2006
+		    Last revised:	         4 June 2010
 
 -------------------------------------------------------------------------------
 rdann: Print an annotation file in ASCII form
-Copyright (C) 1981-2006 George B. Moody
+Copyright (C) 1981-2010 George B. Moody
 
 This program is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
@@ -56,7 +56,8 @@
     signed char cflag = 0, chanmatch, nflag = 0, nummatch, sflag = 0, submatch;
     double sps, spm, sph;
     int eflag = 0, i, j, vflag = 0, xflag = 0;
-    long beat_number = 0L, from = 0L, to = 0L, atol();
+    long afrom = 0L, anum = 0L, ato = 0L, bfrom = 0L, bnum = 0L, bto = 0L,
+	from = 0L, to = 0L, atol();
     static char flag[ACMAX+1];
     static WFDB_Anninfo ai;
     WFDB_Annotation annot;
@@ -204,21 +205,43 @@
 	exit(2);
 
     if (from) {
-	if (*argv[(int)from] == '#') {
-	    if ((beat_number = atol(argv[(int)from]+1)) < 0L) beat_number = 0L;
-	    while (beat_number > 0L && getann(0, &annot) == 0)
-		if (isqrs(annot.anntyp)) beat_number--;
-	    if (beat_number > 0L) exit(2);
+	if (*argv[(int)from] == 'a') {
+	    if ((afrom = atol(argv[(int)from]+1)) < 0L)
+		afrom = from = 0L;
+	    while (anum < afrom && getann(0, &annot) == 0) {
+		anum++;
+		if (isqrs(annot.anntyp)) bnum++;
+	    }
+	    if (anum < afrom) exit(2);
+	}
+	else if (*argv[(int)from] == 'b' || *argv[(int)from] == '#') {
+	    if ((bfrom = atol(argv[(int)from]+1)) < 0L)
+		bfrom = from = 0L;
+	    while (bnum < bfrom && getann(0, &annot) == 0) {
+		anum++;
+		if (isqrs(annot.anntyp)) bnum++;
+	    }
+	    if (bnum < bfrom) exit(2);
 	}
-	else if (iannsettime(strtim(argv[(int)from])) < 0) exit(2);
+	else if (iannsettime(strtim(argv[(int)from])) < 0)
+	    exit(2);
     }
     if (to) {
-	if (*argv[(int)to] == '#') {
-	    if ((beat_number = atol(argv[(int)to]+1)) <  1L) beat_number = 1L;
-	    to = (WFDB_Time)0;
+	if (*argv[(int)to] == 'a') {
+	    if ((ato = atol(argv[(int)to]+1)) <  0L) ato = 0L;
+	    bto = to = (WFDB_Time)0;
+	}
+	else if (*argv[(int)to] == 'b') {
+	    if ((bto = atol(argv[(int)to]+1)) <  0L) bto = 0L;
+	    ato = to = (WFDB_Time)0;
+	}
+	else if (*argv[(int)to] == '#') {
+	    if ((bto = atol(argv[(int)to]+1)) <  1L) bto = 1L;
+	    bto += bnum;
+	    ato = to = (WFDB_Time)0;
 	}
 	else {
-	    beat_number = -1L;
+	    ato = bto = 0L;
 	    to = strtim(argv[(int)to]);
 	    if (to < (WFDB_Time)0) to = -to;
 	}
@@ -255,8 +278,8 @@
 	    if (annot.aux != NULL) (void)printf("\t%s", annot.aux + 1);
 	    (void)printf("\n");
 	}
-	if (beat_number > 0L && isqrs(annot.anntyp) && --beat_number == 0L)
-	    break;
+	if (ato && ++anum >= ato) break;
+	if (bto && isqrs(annot.anntyp) && ++bnum >= bto) break;
     }
     exit(0);	/*NOTREACHED*/
 }
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/checkpkg/checkfile wfdb-10.5.3/checkpkg/checkfile
--- wfdb-10.5.2/checkpkg/checkfile	2008-04-10 15:53:42.000000000 -0400
+++ wfdb-10.5.3/checkpkg/checkfile	2010-05-13 13:17:56.000000000 -0400
@@ -7,7 +7,12 @@
 # If the -v option is used, 'checkfile' prints the differences if any were
 # found; otherwise it prints a message indicating that the files match.
 
-DIFF="diff --strip-trailing-cr"
+case `uname` in
+  HP-UX*)   DIFF=diff ;;
+  Solaris*) DIFF=diff ;;
+  SunOS*)   DIFF=diff ;;
+  *)        DIFF="diff --strip-trailing-cr" ;;
+esac
 
 case $# in
  1) ( $DIFF $1 expected/$1 >/dev/null 2>&1 ) && exit 0
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/conf/cygwin.def wfdb-10.5.3/conf/cygwin.def
--- wfdb-10.5.2/conf/cygwin.def	2008-11-19 14:49:13.000000000 -0500
+++ wfdb-10.5.3/conf/cygwin.def	2010-05-13 11:04:57.000000000 -0400
@@ -1,5 +1,5 @@
 # file: cygwin.def		G. Moody	6 June 2000
-#				Last revised: 19 November 2008
+#				Last revised:   13 May 2010
 #
 # This file contains default 'make' definitions for compiling the WFDB Software
 # Package under MS Windows using the free Cygwin/gcc ANSI C compiler, available
@@ -27,7 +27,7 @@
 # read input from HTTP and FTP servers, in addition to the standard filesystem
 # support available without NETFILES).  The WFDB library can use either
 # libcurl (recommended) or libwww to provide NETFILES support.  To use libcurl,
-# set LC to `curl-config --cflags` (note the backquotes) and LN to
+# set LC to `curl-config --cflags` (note the backquotes) and LL to
 # `curl-config --libs`.  Otherwise, to use libwww, set LC to
 # `libwww-config --cflags` and LL to `libwww-config --libs`.  If neither
 # libcurl nor libwww is available, LC and LL should be empty (and NETFILES
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/conf/cygwin-slib.def wfdb-10.5.3/conf/cygwin-slib.def
--- wfdb-10.5.2/conf/cygwin-slib.def	2009-07-30 10:49:12.000000000 -0400
+++ wfdb-10.5.3/conf/cygwin-slib.def	2010-05-13 11:04:38.000000000 -0400
@@ -1,5 +1,5 @@
 # file: cygwin-slib.def	I. Henry and G. Moody	19 November 2002
-#				Last revised:	  30 July 2009
+#				Last revised:	  13 May 2010
 
 # This section contains settings suitable for generating a DLL (shared library)
 # under MS Windows using the free Cygwin/gcc ANSI C compiler, available from
@@ -27,7 +27,7 @@
 # read input from HTTP and FTP servers, in addition to the standard filesystem
 # support available without NETFILES).  The WFDB library can use either
 # libcurl (recommended) or libwww to provide NETFILES support.  To use libcurl,
-# set LC to `curl-config --cflags` (note the backquotes) and LN to
+# set LC to `curl-config --cflags` (note the backquotes) and LL to
 # `curl-config --libs`.  Otherwise, to use libwww, set LC to
 # `libwww-config --cflags` and LL to `libwww-config --libs`.  If neither
 # libcurl nor libwww is available, LC and LL should be empty (and NETFILES
@@ -139,7 +139,7 @@
 	cp $(WFDBLIB_DLLNAME) $(BINDIR)
 	cd $(BINDIR); $(SETLPERMISSIONS) *.dll
 	test $(BINDIR) = $(LIBDIR) && \
-	 ln -sf $(BINDIR)/$(WFDBLIB_BASENAME) $(WFDBROOT)/lib
+	 ( mkdir $(WFDBROOT)/lib; ln -sf $(BINDIR)/$(WFDBLIB_BASENAME) $(WFDBROOT)/lib )
 
 lib-post-uninstall:
 	rm -f $(LIBDIR)/$(WFDBLIB_BASENAME)
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/conf/darwin.def wfdb-10.5.3/conf/darwin.def
--- wfdb-10.5.2/conf/darwin.def	2005-08-07 10:52:37.000000000 -0400
+++ wfdb-10.5.3/conf/darwin.def	2010-05-13 11:04:24.000000000 -0400
@@ -1,5 +1,5 @@
 # file: darwin.def	G. Moody and I. Henry	14 November 2002
-#				Last revised: 	 7 August 2005
+#				Last revised: 	  13 May 2010
 # 'make' definitions for compiling the WFDB Software Package under Darwin
 #
 # Based on 'freebsd.def'.
@@ -25,7 +25,7 @@
 # read input from HTTP and FTP servers, in addition to the standard filesystem
 # support available without NETFILES).  The WFDB library can use either
 # libcurl (recommended) or libwww to provide NETFILES support.  To use libcurl,
-# set LC to `curl-config --cflags` (note the backquotes) and LN to
+# set LC to `curl-config --cflags` (note the backquotes) and LL to
 # `curl-config --libs`.  Otherwise, to use libwww, set LC to
 # `libwww-config --cflags` and LL to `libwww-config --libs`.  If neither
 # libcurl nor libwww is available, LC and LL should be empty (and NETFILES
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/conf/darwin-slib.def wfdb-10.5.3/conf/darwin-slib.def
--- wfdb-10.5.2/conf/darwin-slib.def	2005-08-05 15:29:08.000000000 -0400
+++ wfdb-10.5.3/conf/darwin-slib.def	2010-05-13 11:04:10.000000000 -0400
@@ -1,5 +1,5 @@
 # file: darwin-slib.def	I. Henry and G. Moody	14 November 2002
-#				Last revised:	 5 August 2005
+#				Last revised:	  13 May 2010
 # Based on 'freebsd-slib.def'.
 
 # This section contains settings suitable for generating a shared library under
@@ -26,7 +26,7 @@
 # read input from HTTP and FTP servers, in addition to the standard filesystem
 # support available without NETFILES).  The WFDB library can use either
 # libcurl (recommended) or libwww to provide NETFILES support.  To use libcurl,
-# set LC to `curl-config --cflags` (note the backquotes) and LN to
+# set LC to `curl-config --cflags` (note the backquotes) and LL to
 # `curl-config --libs`.  Otherwise, to use libwww, set LC to
 # `libwww-config --cflags` and LL to `libwww-config --libs`.  If neither
 # libcurl nor libwww is available, LC and LL should be empty (and NETFILES
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/conf/freebsd.def wfdb-10.5.3/conf/freebsd.def
--- wfdb-10.5.2/conf/freebsd.def	2006-03-22 10:05:59.000000000 -0500
+++ wfdb-10.5.3/conf/freebsd.def	2010-05-13 11:03:56.000000000 -0400
@@ -1,5 +1,5 @@
 # file: freebsd.def		G. Moody	5 March 2002
-#				Last revised:  22 March 2006
+#				Last revised:   13 May 2010
 # 'make' definitions for compiling the WFDB Software Package under FreeBSD
 #
 # Based on 'linux.def', with edits for FreeBSD thanks to Giuseppe Pagnoni.
@@ -25,7 +25,7 @@
 # read input from HTTP and FTP servers, in addition to the standard filesystem
 # support available without NETFILES).  The WFDB library can use either
 # libcurl (recommended) or libwww to provide NETFILES support.  To use libcurl,
-# set LC to `curl-config --cflags` (note the backquotes) and LN to
+# set LC to `curl-config --cflags` (note the backquotes) and LL to
 # `curl-config --libs`.  Otherwise, to use libwww, set LC to
 # `libwww-config --cflags` and LL to `libwww-config --libs`.  If neither
 # libcurl nor libwww is available, LC and LL should be empty (and NETFILES
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/conf/freebsd-slib.def wfdb-10.5.3/conf/freebsd-slib.def
--- wfdb-10.5.2/conf/freebsd-slib.def	2005-08-05 15:25:23.000000000 -0400
+++ wfdb-10.5.3/conf/freebsd-slib.def	2010-05-13 11:03:38.000000000 -0400
@@ -1,5 +1,5 @@
 # file: freebsd-slib.def	G. Moody	5 March 2002
-#				Last revised:  5 August 2005
+#				Last revised:   13 May 2010
 # Based on 'linux-slib.def'.
 
 # This section contains settings suitable for generating an ELF-format shared
@@ -26,7 +26,7 @@
 # read input from HTTP and FTP servers, in addition to the standard filesystem
 # support available without NETFILES).  The WFDB library can use either
 # libcurl (recommended) or libwww to provide NETFILES support.  To use libcurl,
-# set LC to `curl-config --cflags` (note the backquotes) and LN to
+# set LC to `curl-config --cflags` (note the backquotes) and LL to
 # `curl-config --libs`.  Otherwise, to use libwww, set LC to
 # `libwww-config --cflags` and LL to `libwww-config --libs`.  If neither
 # libcurl nor libwww is available, LC and LL should be empty (and NETFILES
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/conf/generic.def wfdb-10.5.3/conf/generic.def
--- wfdb-10.5.2/conf/generic.def	2005-08-07 10:52:24.000000000 -0400
+++ wfdb-10.5.3/conf/generic.def	2010-05-13 11:03:13.000000000 -0400
@@ -1,5 +1,5 @@
 # file: generic.def		G. Moody	31 May 2000
-#				Last revised:  7 August 2005
+#				Last revised:   13 May 2010
 # This file contains default 'make' definitions for compiling the WFDB Software
 # Package under versions of UNIX that are not otherwise recognized by
 # 'configure'.
@@ -31,7 +31,7 @@
 # read input from HTTP and FTP servers, in addition to the standard filesystem
 # support available without NETFILES).  The WFDB library can use either
 # libcurl (recommended) or libwww to provide NETFILES support.  To use libcurl,
-# set LC to `curl-config --cflags` (note the backquotes) and LN to
+# set LC to `curl-config --cflags` (note the backquotes) and LL to
 # `curl-config --libs`.  Otherwise, to use libwww, set LC to
 # `libwww-config --cflags` and LL to `libwww-config --libs`.  If neither
 # libcurl nor libwww is available, LC and LL should be empty (and NETFILES
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/conf/generic-slib.def wfdb-10.5.3/conf/generic-slib.def
--- wfdb-10.5.2/conf/generic-slib.def	2005-08-05 15:22:27.000000000 -0400
+++ wfdb-10.5.3/conf/generic-slib.def	2010-05-13 11:03:00.000000000 -0400
@@ -1,5 +1,5 @@
 # file: generic-slib.def	G. Moody	31 May 2000
-#				Last revised:  5 August 2005
+#				Last revised:   13 May 2010
 # This section contains settings suitable for compiling a shared version of the
 # WFDB library under versions of UNIX that are not otherwise recognized by
 # 'configure'.  Not all versions of UNIX support shared libraries, so you may
@@ -32,7 +32,7 @@
 # read input from HTTP and FTP servers, in addition to the standard filesystem
 # support available without NETFILES).  The WFDB library can use either
 # libcurl (recommended) or libwww to provide NETFILES support.  To use libcurl,
-# set LC to `curl-config --cflags` (note the backquotes) and LN to
+# set LC to `curl-config --cflags` (note the backquotes) and LL to
 # `curl-config --libs`.  Otherwise, to use libwww, set LC to
 # `libwww-config --cflags` and LL to `libwww-config --libs`.  If neither
 # libcurl nor libwww is available, LC and LL should be empty (and NETFILES
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/conf/hpux.def wfdb-10.5.3/conf/hpux.def
--- wfdb-10.5.2/conf/hpux.def	2005-08-07 10:52:20.000000000 -0400
+++ wfdb-10.5.3/conf/hpux.def	2010-05-13 11:02:39.000000000 -0400
@@ -1,5 +1,5 @@
 # file: hpux.def		G. Moody	31 May 2000
-#				Last revised:  7 August 2005
+#				Last revised:   13 May 2010
 # 'make' definitions for compiling the WFDB library under HP-UX
 
 # Choose a value for WFDBROOT to determine where the WFDB Software Package will
@@ -23,7 +23,7 @@
 # read input from HTTP and FTP servers, in addition to the standard filesystem
 # support available without NETFILES).  The WFDB library can use either
 # libcurl (recommended) or libwww to provide NETFILES support.  To use libcurl,
-# set LC to `curl-config --cflags` (note the backquotes) and LN to
+# set LC to `curl-config --cflags` (note the backquotes) and LL to
 # `curl-config --libs`.  Otherwise, to use libwww, set LC to
 # `libwww-config --cflags` and LL to `libwww-config --libs`.  If neither
 # libcurl nor libwww is available, LC and LL should be empty (and NETFILES
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/conf/hpux-slib.def wfdb-10.5.3/conf/hpux-slib.def
--- wfdb-10.5.2/conf/hpux-slib.def	2005-08-05 15:18:40.000000000 -0400
+++ wfdb-10.5.3/conf/hpux-slib.def	2010-05-13 11:02:09.000000000 -0400
@@ -1,5 +1,5 @@
 # file: hpux-slib.def	G. Moody	31 May 2000
-#			Last revised:  5 August 2005
+#			Last revised:   13 May 2010
 # This section contains settings suitable for generating a shared library under
 # HP-UX.
 
@@ -24,7 +24,7 @@
 # read input from HTTP and FTP servers, in addition to the standard filesystem
 # support available without NETFILES).  The WFDB library can use either
 # libcurl (recommended) or libwww to provide NETFILES support.  To use libcurl,
-# set LC to `curl-config --cflags` (note the backquotes) and LN to
+# set LC to `curl-config --cflags` (note the backquotes) and LL to
 # `curl-config --libs`.  Otherwise, to use libwww, set LC to
 # `libwww-config --cflags` and LL to `libwww-config --libs`.  If neither
 # libcurl nor libwww is available, LC and LL should be empty (and NETFILES
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/conf/linux.def wfdb-10.5.3/conf/linux.def
--- wfdb-10.5.2/conf/linux.def	2009-05-03 14:18:49.000000000 -0400
+++ wfdb-10.5.3/conf/linux.def	2010-05-13 11:01:52.000000000 -0400
@@ -1,5 +1,5 @@
 # file: linux.def		G. Moody	31 May 2000
-#				Last revised:    3 May 2009
+#				Last revised:   13 May 2010
 # 'make' definitions for compiling the WFDB Software Package under Linux
 
 # Choose a value for WFDBROOT to determine where the WFDB Software Package will
@@ -23,7 +23,7 @@
 # read input from HTTP and FTP servers, in addition to the standard filesystem
 # support available without NETFILES).  The WFDB library can use either
 # libcurl (recommended) or libwww to provide NETFILES support.  To use libcurl,
-# set LC to `curl-config --cflags` (note the backquotes) and LN to
+# set LC to `curl-config --cflags` (note the backquotes) and LL to
 # `curl-config --libs`.  Otherwise, to use libwww, set LC to
 # `libwww-config --cflags` and LL to `libwww-config --libs`.  If neither
 # libcurl nor libwww is available, LC and LL should be empty (and NETFILES
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/conf/linux-slib.def wfdb-10.5.3/conf/linux-slib.def
--- wfdb-10.5.2/conf/linux-slib.def	2009-05-03 14:18:35.000000000 -0400
+++ wfdb-10.5.3/conf/linux-slib.def	2010-05-13 11:01:37.000000000 -0400
@@ -1,5 +1,5 @@
 # file: linux-slib.def		G. Moody	31 May 2000
-#                               Last revised:    3 May 2009
+#                               Last revised:   13 May 2010
 # This section contains settings suitable for generating an ELF-format shared
 # library under Linux.
 
@@ -24,7 +24,7 @@
 # read input from HTTP and FTP servers, in addition to the standard filesystem
 # support available without NETFILES).  The WFDB library can use either
 # libcurl (recommended) or libwww to provide NETFILES support.  To use libcurl,
-# set LC to `curl-config --cflags` (note the backquotes) and LN to
+# set LC to `curl-config --cflags` (note the backquotes) and LL to
 # `curl-config --libs`.  Otherwise, to use libwww, set LC to
 # `libwww-config --cflags` and LL to `libwww-config --libs`.  If neither
 # libcurl nor libwww is available, LC and LL should be empty (and NETFILES
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/conf/mingw.def wfdb-10.5.3/conf/mingw.def
--- wfdb-10.5.2/conf/mingw.def	2008-11-19 16:05:26.000000000 -0500
+++ wfdb-10.5.3/conf/mingw.def	2010-05-13 11:01:23.000000000 -0400
@@ -1,5 +1,5 @@
 # file: mingw.def		I. Henry and G. Moody       11 February 2005 
-#				Last revised:		    19 November 2008
+#				Last revised:		      13 May 2010
 #
 # This file contains default 'make' definitions for compiling the WFDB Software
 # Package under MS Windows using the free Mininmalist GNU for Windows (MinGW) 
@@ -28,7 +28,7 @@
 # read input from HTTP and FTP servers, in addition to the standard filesystem
 # support available without NETFILES).  The WFDB library can use either
 # libcurl (recommended) or libwww to provide NETFILES support.  To use libcurl,
-# set LC to `curl-config --cflags` (note the backquotes) and LN to
+# set LC to `curl-config --cflags` (note the backquotes) and LL to
 # `curl-config --libs`.  Otherwise, to use libwww, set LC to
 # `libwww-config --cflags` and LL to `libwww-config --libs`.  If neither
 # libcurl nor libwww is available, LC and LL should be empty (and NETFILES
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/conf/mingw-slib.def wfdb-10.5.3/conf/mingw-slib.def
--- wfdb-10.5.2/conf/mingw-slib.def	2008-11-19 16:06:48.000000000 -0500
+++ wfdb-10.5.3/conf/mingw-slib.def	2010-05-13 11:00:56.000000000 -0400
@@ -1,5 +1,5 @@
 # file: mingw-slib.def	I. Henry and G. Moody	11 February 2005
-#				Last revised:	19 November 2008
+#				Last revised:	  13 May 2010
 #
 # This section contains settings suitable for generating a DLL (shared library)
 # under MS Windows using the free gcc ANSI C compiler.
@@ -25,7 +25,7 @@
 # read input from HTTP and FTP servers, in addition to the standard filesystem
 # support available without NETFILES).  The WFDB library can use either
 # libcurl (recommended) or libwww to provide NETFILES support.  To use libcurl,
-# set LC to `curl-config --cflags` (note the backquotes) and LN to
+# set LC to `curl-config --cflags` (note the backquotes) and LL to
 # `curl-config --libs`.  Otherwise, to use libwww, set LC to
 # `libwww-config --cflags` and LL to `libwww-config --libs`.  If neither
 # libcurl nor libwww is available, LC and LL should be empty (and NETFILES
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/conf/solaris.def wfdb-10.5.3/conf/solaris.def
--- wfdb-10.5.2/conf/solaris.def	2006-02-21 13:46:24.000000000 -0500
+++ wfdb-10.5.3/conf/solaris.def	2010-05-13 11:00:07.000000000 -0400
@@ -1,5 +1,5 @@
 # file: solaris.def		G. Moody	31 May 2000
-#				Last revised:  7 August 2005
+#				Last revised:   13 May 2010
 # 'make' definitions for compiling the WFDB Software Package under Solaris
 
 # Choose a value for WFDBROOT to determine where the WFDB Software Package will
@@ -24,7 +24,7 @@
 # read input from HTTP and FTP servers, in addition to the standard filesystem
 # support available without NETFILES).  The WFDB library can use either
 # libcurl (recommended) or libwww to provide NETFILES support.  To use libcurl,
-# set LC to `curl-config --cflags` (note the backquotes) and LN to
+# set LC to `curl-config --cflags` (note the backquotes) and LL to
 # `curl-config --libs`.  Otherwise, to use libwww, set LC to
 # `libwww-config --cflags` and LL to `libwww-config --libs`.  If neither
 # libcurl nor libwww is available, LC and LL should be empty (and NETFILES
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/conf/solaris-slib.def wfdb-10.5.3/conf/solaris-slib.def
--- wfdb-10.5.2/conf/solaris-slib.def	2005-08-05 15:04:21.000000000 -0400
+++ wfdb-10.5.3/conf/solaris-slib.def	2010-05-13 10:59:49.000000000 -0400
@@ -1,5 +1,5 @@
 # file: solaris-slib.def	G. Moody	31 May 2000
-#				Last revised:  5 August 2005
+#				Last revised:   13 May 2010
 # This section contains settings suitable for generating a shared library under
 # Solaris.
 
@@ -24,7 +24,7 @@
 # read input from HTTP and FTP servers, in addition to the standard filesystem
 # support available without NETFILES).  The WFDB library can use either
 # libcurl (recommended) or libwww to provide NETFILES support.  To use libcurl,
-# set LC to `curl-config --cflags` (note the backquotes) and LN to
+# set LC to `curl-config --cflags` (note the backquotes) and LL to
 # `curl-config --libs`.  Otherwise, to use libwww, set LC to
 # `libwww-config --cflags` and LL to `libwww-config --libs`.  If neither
 # libcurl nor libwww is available, LC and LL should be empty (and NETFILES
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/doc/wag-src/epicmp.1 wfdb-10.5.3/doc/wag-src/epicmp.1
--- wfdb-10.5.2/doc/wag-src/epicmp.1	2003-07-10 13:27:52.000000000 -0400
+++ wfdb-10.5.3/doc/wag-src/epicmp.1	2010-05-09 14:24:24.000000000 -0400
@@ -7,7 +7,7 @@
 .PP
 This program implements the VF, AF, and ST episode-by-episode
 comparison algorithms specified by the current American National
-Standard for ambulatory ECG analyzers (ANSI/AAMI EC38:1998).  \fBepicmp\fR
+Standard for ambulatory ECG analyzers (ANSI/AAMI EC38:2007).  \fBepicmp\fR
 is the reference implementation of these algorithms, and must be used
 to obtain the episode-by-episode performance statistics cited in EC38
 in order to be in compliance with the standard (see EC38, section 5.2.14).
@@ -62,6 +62,11 @@
 \fB-V\fR
 Append ventricular flutter and fibrillation detection reports to the specified
 \fIfile\fR.
+.TP
+\fB-x\fR
+Exclude periods of atrial fibrillation from calculations of atrial fibrillation
+positive predictivity, as required by EC38:1998 (default: include these periods,
+as required by EC38:2007).
 .PP
 The episode and duration statistics gathered by \fBepicmp\fR are based on tallies
 of overlapping episodes in the reference and test annotation files.
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/doc/wag-src/rdann.1 wfdb-10.5.3/doc/wag-src/rdann.1
--- wfdb-10.5.2/doc/wag-src/rdann.1	2009-10-28 11:41:54.000000000 -0400
+++ wfdb-10.5.3/doc/wag-src/rdann.1	2010-06-04 12:58:33.000000000 -0400
@@ -1,4 +1,4 @@
-.TH RDANN 1 "28 October 2009" "WFDB 10.4.24" "WFDB Applications Guide"
+.TH RDANN 1 "4 June 2010" "WFDB 10.5.3" "WFDB Applications Guide"
 .SH NAME
 rdann \- read a WFDB annotation file
 .SH SYNOPSIS
@@ -66,14 +66,20 @@
 \fIstrtim\fR in the \fIWFDB Programmer's Guide\fR, as well as the
 comments below, for other formats.
 .PP
-Beat numbers beginning with 0 are implicitly assigned by \fBrdann\fR to each
-QRS annotation in an annotation file.  If the argument of the \fB-f\fR option
-begins with `#', it is taken to be the beat number of the first QRS annotation
-to be printed (any non-QRS annotations that immediately precede this annotation
-are also printed).  If the argument of the \fB-t\fR option begins with `#', it
-is taken as the number of QRS annotations to be processed;  note that not all
-of those processed will necessarily be printed, if the \fB-p\fR option is used
-to select only a subset of annotation types to be printed.  
+Annotation numbers beginning with 0 are implicitly assigned by
+\fBrdann\fR to each annotation in an annotation file, and beat numbers
+beginning with 0 are assigned to each QRS annotation.  If the argument
+of the \fB-f\fR option begins with `a', it is taken to be the
+annotation number of the first annotation to be printed; if it begins
+with `b', it is taken to be the beat number of the first beat
+annotation to be printed (any non-QRS annotations that immediately
+precede this annotation are also printed).  Arguments of the \fB-t\fR
+option beginning with `a' or `b' similarly specify the annotation number
+or beat number following the last to be printed.  If the argument of the
+\fB-t\fR option begins with `#', it is taken as the number of QRS
+annotations to be processed; note that not all of those processed will
+necessarily be printed, if the \fB-p\fR option is used to select only
+a subset of annotation types to be printed.
 .PP
 Note that the \fB-e\fR and \fB-x\fR options are mutually exclusive;  if both
 are given, only the last one is effective.
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/doc/wag-src/wfdb.3 wfdb-10.5.3/doc/wag-src/wfdb.3
--- wfdb-10.5.2/doc/wag-src/wfdb.3	2009-10-28 12:07:59.000000000 -0400
+++ wfdb-10.5.3/doc/wag-src/wfdb.3	2010-06-22 11:15:43.000000000 -0400
@@ -1,4 +1,4 @@
-.TH WFDB 3 "7 April 2003" "WFDB software 10.3.6" "WFDB Applications Guide"
+.TH WFDB 3 "22 June 2010" "WFDB software 10.5.3" "WFDB Applications Guide"
 .SH NAME
 wfdb \- Waveform Database library
 .SH SYNOPSIS
@@ -24,16 +24,18 @@
 .br
 void flushcal(void)
 .br
+WFDB_Frequency getafreq(void)
+.br
 int getann(WFDB_Annotator \fIa\fP, WFDB_Annotation *\fIannotation\fP)
 .br
 double getbasecount(void)
 .br
 int getcal(char *\fIdescription\fP, char *\fIunits\fP, WFDB_Calinfo *\fIcal\fP)
 .br
-WFDB_Frequency getafreq(void)
-.br
 WFDB_Frequency getcfreq(void)
 .br
+int getgvmode(void)
+.br
 WFDB_Frequency getifreq(void)
 .br
 char *getwfdb(void)
@@ -84,6 +86,8 @@
 .br
 WFDB_Sample sample(WFDB_Signal \fIs\fP, WFDB_Time \fIt\fP)
 .br
+int sample_valid(void)
+.br
 void setafreq(WFDB_Frequency \fIannotation_clock_frequency\fP)
 .br
 int setanndesc(int \fIannotation_code\fP, char *\fIannotation_description\fP)
@@ -128,6 +132,12 @@
 .br
 int ungetann(WFDB_Annotator \fIa\fP, WFDB_Annotation *\fIannotation\fP)
 .br
+const char *wfdbcflags(void)
+.br
+const char *wfdbdefwfdb(void)
+.br
+const char *wfdbdefwfdbcal(void)
+.br
 char *wfdberror(void)
 .br
 char *wfdbfile(char *\fItype\fP, char *\fIrecord\fP)
@@ -141,6 +151,10 @@
 int wfdbinit(char *\fIrecord\fP, WFDB_Anninfo *\fIaiarray\fP, unsigned int \fInann\fP,
                 WFDB_Siginfo *\fIsiarray\fP, unsigned int \fInsig\fP)
 .br
+const char *wfdbldflags(void)
+.br
+void wfdbmemerr(int exit_on_error)
+.br
 int wfdbputprolog(char *\fIprolog\fP, long \fIbytes\fP, WFDB_Signal \fIs\fP)
 .br
 void wfdbquiet(void)
@@ -152,6 +166,8 @@
 void wfdbsetstart(WFDB_Signal \fIs\fP, long \fIbyte_offset\fP)
 .br
 void wfdbverbose(void)
+.br
+const char *wfdbversion(void)
 .SH DESCRIPTION
 Waveform databases (including the MIT-BIH Arrhythmia Database, the AHA Database
 for Evaluation of Ventricular Arrhythmia Detectors, and the European ST-T
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/doc/wpg-src/wpg0.tex wfdb-10.5.3/doc/wpg-src/wpg0.tex
--- wfdb-10.5.2/doc/wpg-src/wpg0.tex	2010-04-18 09:27:38.000000000 -0400
+++ wfdb-10.5.3/doc/wpg-src/wpg0.tex	2010-06-22 11:22:38.000000000 -0400
@@ -1750,7 +1750,8 @@
 * setifreq::			Setting the input sampling frequency.
 * getifreq::                    Determining the input sampling frequency.
 * setgvmode::                   Setting the resolution for a multifrequency
-                                record.
+                                record and how invalid samples are represented.
+* getgvmode::                   Determining the getvec operating mode.
 * getspf::                      Determining the number of samples per frame.
 * setafreq::			Setting the time resolution for output
                                 annotations.
@@ -1855,13 +1856,17 @@
 or the frequency chosen using a previous invocation of @code{setifreq}.
 
 @c @group
-@node     setgvmode, getspf, getifreq, special I/O modes
+@node     setgvmode, getgvmode, getifreq, special I/O modes
 @unnumberedsubsec setgvmode
 @findex setgvmode (9.0)
 @cindex interpolation
 @cindex decimation
 @cindex resampling
 @cindex multi-frequency records (reading)
+@cindex padding
+@cindex invalid samples
+@cindex missing samples
+@cindex samples (invalid or missing)
 
 @example
 void setgvmode(int *@var{mode})
@@ -1904,6 +1909,35 @@
 The constant @code{WFDB_GVPAD} is defined in @file{<wfdb/wfdb.h>}.
 
 @c @group
+@node     setgvmode, getspf, setgvmode, special I/O modes
+@unnumberedsubsec getgvmode
+@findex getgvmode (10.5.3)
+@cindex interpolation
+@cindex decimation
+@cindex resampling
+@cindex multi-frequency records (reading)
+@cindex padding
+@cindex invalid samples
+@cindex missing samples
+@cindex samples (invalid or missing)
+
+@example
+int setgvmode(void)
+@end example
+@noindent
+@c @end group
+
+@noindent
+This function returns the operating mode used by @code{getvec}.  If the
+returned value has the @code{WFDB_HIGHRES} bit set, @code{getvec} is operating
+in high-resolution mode;  if the returned value has the @code{WFDB_GVPAD} bit
+set, @code{getvec} replicates the previous valid sample whenever it encounters
+an invalid or missing sample, rather than returning the value
+@code{WFDB_INVALID_SAMPLE}.  The constants @code{WFDB_HIGHRES},
+@code{WFDB_GVPAD}, and @code{WFDB_INVALID_SAMPLE} are defined in
+@file{<wfdb/wfdb.h>}.
+
+@c @group
 @node     getspf, setafreq, setgvmode, special I/O modes
 @unnumberedsubsec getspf
 @findex getspf (9.6)
@@ -8881,6 +8915,11 @@
 changes that may not be described here.
 
 @unnumberedsec WFDB 10.5
+@unnumberedsubsec Changes in version 10.5.3 (22 June 2010)
+
+Function getgvmode() has been introduced in WFDB library version
+10.5.3, to allow querying the current operating mode of getvec().
+
 @unnumberedsubsec Changes in version 10.5.2 (18 April 2010)
 
 When reading annotations of multifrequency records opened in
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/install-wave32 wfdb-10.5.3/install-wave32
--- wfdb-10.5.2/install-wave32	2010-01-07 17:02:37.000000000 -0500
+++ wfdb-10.5.3/install-wave32	2010-06-01 10:14:24.000000000 -0400
@@ -1,6 +1,6 @@
 #! /bin/sh
 # file: install-wave32		G. Moody	7 October 2008
-#				Last revised:   7 January 2010 for Fedora 12
+#				Last revised:   1 June 2010 for Fedora 12
 # Build and install WAVE on 64-bit Linux
 #
 # *** Fedora 12 users: if this script fails, see the note at the end! ***
@@ -25,6 +25,21 @@
 # prerequisites in some other way before running the final part of this script
 # as root, using the -q option.  See the notes below for hints.
 
+echo "This script builds and installs 'wave' as a 32-bit application on x86_64"
+echo "(AMD/Intel 64-bit) Fedora GNU/Linux.  It has been tested on Fedora 12 and"
+echo "will probably require modification on other platforms."
+echo
+
+if [ $UID != 0 ]
+then
+    echo "You do not have root (superuser) permissions, so this script may fail"
+    echo "if it needs to install missing libraries.  If this happens, rerun it"
+    echo "as root (e.g., using su or sudo)."
+fi
+
+echo
+echo "If this script fails, read it for troubleshooting hints."
+
 # The prerequisites needed in order to compile WAVE on 64-bit Fedora fall into
 # three groups:
 #
@@ -63,7 +78,7 @@
     esac
     yum -y install libgcc.$X86 glibc-devel.$X86 libX11-devel.$X86 \
 	libXpm-devel.$X86 libcurl-devel.$X86
-    yum -y xorg-x11-fonts-misc \
+    yum -y install xorg-x11-fonts-misc \
 	xorg-x11-fonts-100dpi xorg-x11-fonts-ISO8859-1-100dpi \
 	xorg-x11-fonts-75dpi xorg-x11-fonts-ISO8859-1-75dpi
 fi
@@ -83,7 +98,7 @@
 
 if [ "x$1" != "x-q" ]
 then
-    rpm -ivh http://physionet.org/physiotools/xview/i386-Fedora/xview-3.2p1.4-21.1.fc8.i386.rpm \
+    rpm -Uvh 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
 fi
@@ -112,7 +127,6 @@
 cd ..
 make clean
 
-
 # ****************************************************************************
 #
 # On Fedora 12, at the time this script was written, the most recent 32-bit
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/lib/annot.c wfdb-10.5.3/lib/annot.c
--- wfdb-10.5.2/lib/annot.c	2010-04-18 08:49:36.000000000 -0400
+++ wfdb-10.5.3/lib/annot.c	2010-06-22 12:05:04.000000000 -0400
@@ -897,8 +897,7 @@
 /*  setafreq: set time resolution for output annotation files */
 FVOID setafreq(WFDB_Frequency f)
 {
-    if (f > 0.0)
-	oafreq = f;
+    oafreq = f;
 }
 
 /* getafreq: return time resolution for output annotation files */
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/lib/signal.c wfdb-10.5.3/lib/signal.c
--- wfdb-10.5.2/lib/signal.c	2010-04-09 16:08:28.000000000 -0400
+++ wfdb-10.5.3/lib/signal.c	2010-06-22 12:04:26.000000000 -0400
@@ -1,5 +1,5 @@
 /* file: signal.c	G. Moody	13 April 1989
-			Last revised:    9 March 2010	wfdblib 10.5.2
+			Last revised:    22 June 2010	wfdblib 10.5.3
 WFDB library functions for signals
 
 _______________________________________________________________________________
@@ -58,6 +58,7 @@
  findsig [10.4.12] (find an input signal with a specified name)
  getspf [9.6]	(returns number of samples returned by getvec per frame)
  setgvmode [9.0](sets getvec operating mode)
+ getgvmode [10.5.3](returns getvec operating mode)
  setifreq [10.2.6](sets the getvec sampling frequency)
  getifreq [10.2.6](returns the getvec sampling frequency)
  getvec		(reads a (possibly resampled) sample from each input signal)
@@ -289,8 +290,6 @@
 static unsigned dsblen;		/* capacity of dsbuf, in samples */
 static unsigned framelen;	/* total number of samples per frame */
 static int gvmode = DEFWFDBGVMODE;	/* getvec mode */
-static int gvpad;		/* getvec padding (if non-zero, replace invalid
-				   samples with previous valid samples) */
 static int gvc;			/* getvec sample-within-frame counter */
 static int isedf;		/* if non-zero, record is stored as EDF/EDF+ */
 WFDB_Sample *sbuf = NULL;	/* buffer used by sample() */
@@ -630,6 +629,7 @@
     wfdb_fread(buf, 1, 80, ifile);	/* patient ID (ignored) */
     wfdb_fread(buf, 1, 80, ifile);	/* recording ID (ignored) */
     wfdb_fread(buf, 1, 8, ifile);	/* recording date */
+    buf[8] = '\0';
     sscanf(buf, "%d%*c%d%*c%d", &day, &month, &year);
     year += 1900;			/* EDF has only two-digit years */
     if (year < 1985) year += 100;	/* fix this before 1/1/2085! */
@@ -639,6 +639,7 @@
     sscanf(buf, "%d", &offset);
     wfdb_fread(buf, 1, 44, ifile);	/* free space (ignored) */
     wfdb_fread(buf, 1, 8, ifile);	/* number of frames (EDF blocks) */
+    buf[8] = '\0';
     sscanf(buf, "%ld", &nframes);
     nsamples = nframes;
     wfdb_fread(buf, 1, 8, ifile);	/* data record duration (seconds) */
@@ -1295,7 +1296,7 @@
 written and the signal group pointer). */
 
 static int _l;		    /* macro temporary storage for low byte of word */
-static int _L;		    /* macro temporary storage for low 16 bits of int */
+static int _lw;		    /* macro temporary storage for low 16 bits of int */
 static int _n;		    /* macro temporary storage for byte count */
 
 #define r8(G)	((G->bp < G->be) ? *(G->bp++) : \
@@ -1317,9 +1318,9 @@
 #define w16(V,G)    (w8((V), (G)), w8(((V) >> 8), (G)))
 #define r61(G)      (_l = r8(G), ((int)((short)((r8(G) & 0xff) | (_l << 8)))))
 #define w61(V,G)    (w8(((V) >> 8), (G)), w8((V), (G)))
-#define r24(G)	    (_L = r16(G), ((int)((r8(G) << 16) | (_L & 0xffff))))
+#define r24(G)	    (_lw = r16(G), ((int)((r8(G) << 16) | (_lw & 0xffff))))
 #define w24(V,G)    (w16((V), (G)), w8(((V) >> 16), (G)))
-#define r32(G)	    (_L = r16(G), ((int)((r16(G) << 16) | (_L & 0xffff))))
+#define r32(G)	    (_lw = r16(G), ((int)((r16(G) << 16) | (_lw & 0xffff))))
 #define w32(V,G)    (w16((V), (G)), w16(((V) >> 16), (G)))
 #else
 
@@ -1696,6 +1697,10 @@
     return (0);
 }
 
+/* VFILL provides the value returned by getskewedframe() for a missing or
+   invalid sample */
+#define VFILL	((gvmode & WFDB_GVPAD) ? is->samp : WFDB_INVALID_SAMPLE)
+
 static int getskewedframe(WFDB_Sample *vector)
 {
     int c, stat;
@@ -1723,7 +1728,7 @@
 	for (c = 0; c < is->info.spf; c++, vector++) {
 	    switch (is->info.fmt) {
 	      case 0:	/* null signal: return sample tagged as invalid */
-		*vector = v = gvpad ? is->samp : WFDB_INVALID_SAMPLE;
+		  *vector = v = VFILL;
 		if (is->info.nsamp == 0) ig->stat = -1;
 		break;
 	      case 8:	/* 8-bit first differences */
@@ -1732,63 +1737,63 @@
 	      case 16:	/* 16-bit amplitudes */
 		*vector = v = r16(ig);
 		if (v == -1 << 15)
-		    *vector = gvpad ? is->samp : WFDB_INVALID_SAMPLE;
+		    *vector = VFILL;
 		else
 		    is->samp = *vector;
 		break;
 	      case 61:	/* 16-bit amplitudes, bytes swapped */
 		*vector = v = r61(ig);
 		if (v == -1 << 15)
-		    *vector = gvpad ? is->samp : WFDB_INVALID_SAMPLE;
+		    *vector = VFILL;
 		else
 		    is->samp = *vector;
 		break;
 	      case 80:	/* 8-bit offset binary amplitudes */
 		*vector = v = r80(ig);
 		if (v == -1 << 7)
-		    *vector = gvpad ? is->samp : WFDB_INVALID_SAMPLE;
+		    *vector = VFILL;
 		else
 		    is->samp = *vector;
 		break;
 	      case 160:	/* 16-bit offset binary amplitudes */
 		*vector = v = r160(ig);
 		if (v == -1 << 15)
-		    *vector = gvpad ? is->samp : WFDB_INVALID_SAMPLE;
+		    *vector = VFILL;
 		else
 		    is->samp = *vector;
 		break;
 	      case 212:	/* 2 12-bit amplitudes bit-packed in 3 bytes */
 		*vector = v = r212(ig);
 		if (v == -1 << 11)
-		    *vector = gvpad ? is->samp : WFDB_INVALID_SAMPLE;
+		    *vector = VFILL;
 		else
 		    is->samp = *vector;
 		break;
 	      case 310:	/* 3 10-bit amplitudes bit-packed in 4 bytes */
 		*vector = v = r310(ig);
 		if (v == -1 << 9)
-		    *vector = gvpad ? is->samp : WFDB_INVALID_SAMPLE;
+		    *vector = VFILL;
 		else
 		    is->samp = *vector;
 		break;
 	      case 311:	/* 3 10-bit amplitudes bit-packed in 4 bytes */
 		*vector = v = r311(ig);
 		if (v == -1 << 9)
-		    *vector = gvpad ? is->samp : WFDB_INVALID_SAMPLE;
+		    *vector = VFILL;
 		else
 		    is->samp = *vector;
 		break;
 	      case 24:	/* 24-bit amplitudes */
 		*vector = v = r24(ig);
 		if (v == -1 << 23)
-		    *vector = gvpad ? is->samp : WFDB_INVALID_SAMPLE;
+		    *vector = VFILL;
 		else
 		    is->samp = *vector;
 		break;
 	      case 32:	/* 32-bit amplitudes */
 		*vector = v = r32(ig);
 		if (v == -1 << 31)
-		    *vector = gvpad ? is->samp : WFDB_INVALID_SAMPLE;
+		    *vector = VFILL;
 		else
 		    is->samp = *vector;
 		break;
@@ -2350,18 +2355,19 @@
     }
 
     if ((mode & WFDB_HIGHRES) == WFDB_HIGHRES) {
-	gvmode = WFDB_HIGHRES;
+	gvmode |= WFDB_HIGHRES;
 	if (ispfmax == 0) ispfmax = 1;
 	sfreq = ffreq * ispfmax;
     }
     else {
-	gvmode = WFDB_LOWRES;
+	gvmode &= ~(WFDB_HIGHRES);
 	sfreq = ffreq;
     }
-    if ((mode & WFDB_GVPAD) == WFDB_GVPAD)
-	gvpad = 1;
-    else
-	gvpad = 0;
+}
+
+FINT getgvmode(void)
+{
+    return (gvmode);
 }
 
 /* An application can specify the input sampling frequency it prefers by
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/lib/wfdb.h wfdb-10.5.3/lib/wfdb.h
--- wfdb-10.5.2/lib/wfdb.h	2010-04-18 19:15:48.000000000 -0400
+++ wfdb-10.5.3/lib/wfdb.h	2010-06-22 22:26:09.000000000 -0400
@@ -1,7 +1,6 @@
 /* file: wfdb.h		G. Moody	13 June 1983
-			Last revised:   12 March 2010	wfdblib 10.5.0
+			Last revised:   22 June 2010	wfdblib 10.5.3
 WFDB library type, constant, structure, and function interface definitions
-
 _______________________________________________________________________________
 wfdb: a library for reading and writing annotated waveforms (time series data)
 Copyright (C) 1983-2010 George B. Moody
@@ -33,7 +32,7 @@
 /* WFDB library version. */
 #define WFDB_MAJOR   10
 #define WFDB_MINOR   5
-#define WFDB_RELEASE 2
+#define WFDB_RELEASE 3
 #define WFDB_NETFILES 1	/* if 1, library includes code for HTTP, FTP clients */
 #define WFDB_NETFILES_LIBCURL 1
 
@@ -265,6 +264,7 @@
 extern FINT findsig(char *signame);
 extern FINT getspf(void);
 extern FVOID setgvmode(int mode);
+extern FINT getgvmode(void);
 extern FINT setifreq(WFDB_Frequency freq);
 extern FFREQUENCY getifreq(void);
 extern FINT getvec(WFDB_Sample *vector);
@@ -345,11 +345,11 @@
 extern FSTRING wfdbfile(char *file_type, char *record);
 extern FVOID wfdbflush(void);
 extern FVOID wfdbmemerr(int exit_on_error);
-extern const FSTRING wfdbversion();
-extern const FSTRING wfdbldflags();
-extern const FSTRING wfdbcflags();
-extern const FSTRING wfdbdefwfdb();
-extern const FSTRING wfdbdefwfdbcal();
+extern const FSTRING wfdbversion(void);
+extern const FSTRING wfdbldflags(void);
+extern const FSTRING wfdbcflags(void);
+extern const FSTRING wfdbdefwfdb(void);
+extern const FSTRING wfdbdefwfdbcal(void);
 #endif
 
 #ifdef wfdb_CPP
@@ -358,11 +358,11 @@
 
 #ifdef wfdb_KRC	/* declare only function return types for K&R C compilers */
 extern FINT annopen(), isigopen(), osigopen(), wfdbinit(), findsig(), 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(),
+    setifreq(), getvec(), getframe(), getgvmode(), 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(), wfdbputprolog(),
     setsampfreq(), setbasetime(), putinfo(), setibsize(), setobsize(),
     calopen(), getcal(), putcal(), newcal(), wfdbgetskew(), sample_valid();
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/lib/wfdb.h0 wfdb-10.5.3/lib/wfdb.h0
--- wfdb-10.5.2/lib/wfdb.h0	2010-03-12 10:55:02.000000000 -0500
+++ wfdb-10.5.3/lib/wfdb.h0	2010-06-22 11:24:08.000000000 -0400
@@ -1,7 +1,6 @@
 /* file: wfdb.h		G. Moody	13 June 1983
-			Last revised:   12 March 2010	wfdblib 10.5.0
+			Last revised:   22 June 2010	wfdblib 10.5.3
 WFDB library type, constant, structure, and function interface definitions
-
 _______________________________________________________________________________
 wfdb: a library for reading and writing annotated waveforms (time series data)
 Copyright (C) 1983-2010 George B. Moody
@@ -265,6 +264,7 @@
 extern FINT findsig(char *signame);
 extern FINT getspf(void);
 extern FVOID setgvmode(int mode);
+extern FINT getgvmode(void);
 extern FINT setifreq(WFDB_Frequency freq);
 extern FFREQUENCY getifreq(void);
 extern FINT getvec(WFDB_Sample *vector);
@@ -345,11 +345,11 @@
 extern FSTRING wfdbfile(char *file_type, char *record);
 extern FVOID wfdbflush(void);
 extern FVOID wfdbmemerr(int exit_on_error);
-extern const FSTRING wfdbversion();
-extern const FSTRING wfdbldflags();
-extern const FSTRING wfdbcflags();
-extern const FSTRING wfdbdefwfdb();
-extern const FSTRING wfdbdefwfdbcal();
+extern const FSTRING wfdbversion(void);
+extern const FSTRING wfdbldflags(void);
+extern const FSTRING wfdbcflags(void);
+extern const FSTRING wfdbdefwfdb(void);
+extern const FSTRING wfdbdefwfdbcal(void);
 #endif
 
 #ifdef wfdb_CPP
@@ -358,11 +358,11 @@
 
 #ifdef wfdb_KRC	/* declare only function return types for K&R C compilers */
 extern FINT annopen(), isigopen(), osigopen(), wfdbinit(), findsig(), 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(),
+    setifreq(), getvec(), getframe(), getgvmode(), 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(), wfdbputprolog(),
     setsampfreq(), setbasetime(), putinfo(), setibsize(), setobsize(),
     calopen(), getcal(), putcal(), newcal(), wfdbgetskew(), sample_valid();
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/lib/wfdbio.c wfdb-10.5.3/lib/wfdbio.c
--- wfdb-10.5.2/lib/wfdbio.c	2010-03-24 09:28:26.000000000 -0400
+++ wfdb-10.5.3/lib/wfdbio.c	2010-06-22 10:54:48.000000000 -0400
@@ -1,10 +1,10 @@
 /* file: wfdbio.c	G. Moody	18 November 1988
-                        Last revised:	  3 March 2009       wfdblib 10.4.17
+                        Last revised:	  22 June 2010       wfdblib 10.5.3
 Low-level I/O functions for the WFDB library
 
 _______________________________________________________________________________
 wfdb: a library for reading and writing annotated waveforms (time series data)
-Copyright (C) 1988-2009 George B. Moody
+Copyright (C) 1988-2010 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
@@ -259,27 +259,27 @@
 #define CFLAGS  "CFLAGS not defined"
 #endif
 
-const FSTRING wfdbversion()
+const FSTRING wfdbversion(void)
 {
    return VERSION;
 }
 
-const FSTRING wfdbldflags()
+const FSTRING wfdbldflags(void)
 {
    return LDFLAGS;
 }
 
-const FSTRING wfdbcflags()
+const FSTRING wfdbcflags(void)
 {
    return CFLAGS;
 }
 
-const FSTRING wfdbdefwfdb()
+const FSTRING wfdbdefwfdb(void)
 {
    return DEFWFDB;
 }
 
-const FSTRING wfdbdefwfdbcal()
+const FSTRING wfdbdefwfdbcal(void)
 {
    return DEFWFDBCAL;
 }
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/NEWS wfdb-10.5.3/NEWS
--- wfdb-10.5.2/NEWS	2010-04-18 19:38:52.000000000 -0400
+++ wfdb-10.5.3/NEWS	2010-06-22 23:15:32.000000000 -0400
@@ -1,3 +1,24 @@
+10.5.3 (22 June 2010):
+	Function getgvmode() has been introduced in WFDB library version
+	10.5.3, to allow querying the current operating mode of getvec().
+
+	A local variable (_L in lib/signal.c, introduced in 10.5.0) had
+	a name collision on Solaris with a predefined constant, so it has
+	been renamed as _lw.  A comment in each of the *.def files in conf,
+	now corrected, erroneously referred to LN, rather than LL.
+
+        Tony Ricke reported that test builds (./configure; make) of recent
+	versions of the WFDB package fail on Cygwin.  This problem has been
+	corrected (in conf/cygwin-slib.def) in 10.5.3.
+
+	Tony also pointed out that current versions of the EC38 and EC57
+	standards no longer exclude episodes of atrial flutter from
+	evaluations of the positive predictivity of an atrial fibrillation
+	detector, as in previous versions of EC38.  The WFDB application
+	epicmp has been revised accordingly, so that atrial flutter episodes
+	are included in these evaluations unless the -x option is given
+	(to conform with EC38:1998 and earlier).
+
 10.5.2 (18 April 2010):
 	When reading annotations of multifrequency records opened in
 	high-resolution mode, a time shift was introduced by getann() in
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/wave/annot.c wfdb-10.5.3/wave/annot.c
--- wfdb-10.5.2/wave/annot.c	2008-03-14 15:49:18.000000000 -0400
+++ wfdb-10.5.3/wave/annot.c	2010-06-22 11:46:19.000000000 -0400
@@ -1,10 +1,10 @@
 /* file: annot.c	G. Moody	  1 May 1990
-			Last revised:    14 March 2008
+			Last revised:    22 June 2010
 Annotation list handling and display functions for WAVE
 
 -------------------------------------------------------------------------------
 WAVE: Waveform analyzer, viewer, and editor
-Copyright (C) 1990-2008 George B. Moody
+Copyright (C) 1990-2010 George B. Moody
 
 This program is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
@@ -152,13 +152,15 @@
     tupdate = time((time_t *)NULL);
 
     /* Return 0 if no annotations are requested or available. */
-    setafreq(freq);
+    if (getgvmode() & WFDB_HIGHRES) setafreq(freq);
+    else setafreq(0.);
     if (nann < 1 || annopen(record, &af, 1) < 0) {
 	ap_start = annp = scope_annp = NULL;
 	if (frame) xv_set(frame, FRAME_BUSY, FALSE, NULL);
 	return (annotations = 0);
     }
-    setafreq(freq);
+    if (getgvmode() & WFDB_HIGHRES) setafreq(freq);
+    else setafreq(0.);
     if ((ap_start = annp = scope_annp = a = get_ap()) == NULL ||
 	getann(0, &(a->this))) {
 	(void)annopen(record, NULL, 0);
@@ -958,7 +960,8 @@
     }
 
     af.stat = (af.stat == WFDB_AHA_READ) ? WFDB_AHA_WRITE : WFDB_WRITE;
-    setafreq(freq);
+    if (getgvmode() & WFDB_HIGHRES) setafreq(freq);
+    else setafreq(0.);
     if (annopen(record, &af, 1)) {
 	/* An error from annopen is most likely to result from not being able
 	   to create the output file.  Warn the user and try again later. */
@@ -1032,7 +1035,8 @@
 	}
 	a = a->next;
     }
-    setafreq(freq);
+    if (getgvmode() & WFDB_HIGHRES) setafreq(freq);
+    else setafreq(0.);
     (void)annopen(record, NULL, 0);	/* force flush and close of output */
 
     changes = 0;
diff -Naur --exclude Makefile --exclude info wfdb-10.5.2/wave/init.c wfdb-10.5.3/wave/init.c
--- wfdb-10.5.2/wave/init.c	2008-03-14 14:20:30.000000000 -0400
+++ wfdb-10.5.3/wave/init.c	2010-06-22 11:40:09.000000000 -0400
@@ -146,6 +146,9 @@
        second per signal. */
     if (nsig < 0 || (freq = sampfreq(NULL)) <= 0.) freq = WFDB_DEFFREQ;
     setifreq(freq);
+    /* Inhibit the output of the 'time resolution' comment annotation unless
+       we are operating in high-resolution mode. */
+    if ((getgvmode() & WFDB_HIGHRES) == 0) setafreq(0.);
 
     /* Quit if isigopen failed. */
     if (nsig < 0)
