diff -Naur --exclude Makefile --exclude info wfdb-10.4.19/app/Makefile.tpl wfdb-10.4.20/app/Makefile.tpl
--- wfdb-10.4.19/app/Makefile.tpl	2009-02-26 22:39:22.000000000 -0500
+++ wfdb-10.4.20/app/Makefile.tpl	2009-05-04 00:57:32.000000000 -0400
@@ -6,13 +6,13 @@
  mrgann.c mxm.c nguess.c nst.c plotstm.c pscgen.c pschart.c psfd.c rdann.c \
  rdsamp.c rr2ann.c rxr.c sampfreq.c sigamp.c sigavg.c signame.c signum.c \
  skewedit.c snip.c sortann.c sqrs.c sqrs125.c sumann.c sumstats.c tach.c \
- time2sec.c wabp.c wfdbcat.c wfdbcollate.c wfdbdesc.c \
+ time2sec.c wabp.c wfdb-config.c wfdbcat.c wfdbcollate.c wfdbdesc.c \
  wfdbtime.c wfdbwhich.c wqrs.c wrann.c wrsamp.c xform.c
 XFILES = ann2rr bxb calsig ecgeval epicmp fir ihr mfilt \
  mrgann mxm nguess nst plotstm pscgen pschart psfd rdann \
  rdsamp rr2ann rxr sampfreq sigamp sigavg signame signum \
  skewedit snip sortann sqrs sqrs125 sumann sumstats tach \
- time2sec wabp wfdbcat wfdbcollate wfdbdesc \
+ time2sec wabp wfdb-config wfdbcat wfdbcollate wfdbdesc \
  wfdbtime wfdbwhich wqrs wrann wrsamp xform
 SCRIPTS = cshsetwfdb setwfdb
 PSFILES = pschart.pro psfd.pro 12lead.pro
diff -Naur --exclude Makefile --exclude info wfdb-10.4.19/app/pschart.c wfdb-10.4.20/app/pschart.c
--- wfdb-10.4.19/app/pschart.c	2009-03-18 12:23:27.000000000 -0400
+++ wfdb-10.4.20/app/pschart.c	2009-04-09 22:12:33.000000000 -0400
@@ -1,5 +1,5 @@
 /* file: pschart.c	G. Moody       15 March 1988
-			Last revised:  18 March 2009
+			Last revised:   9 April 2009
 
 -------------------------------------------------------------------------------
 pschart: Produce annotated `chart recordings' on a PostScript device
@@ -730,9 +730,10 @@
     }
 }
 
+static double __mt;	/* temporary variable for adu macro */
+#define adu(A)	((__mt=(A)*dpadu), (int)(__mt>=0 ? __mt+0.5 : __mt-0.5))
 #define mm(A)	((int)((A)*dpmm))    /* convert millimeters to pixels */
 #define si(A)	((int)((A)*dpsi))    /* convert sample intervals to pixels */
-#define adu(A)	((int)((A)*dpadu))   /* convert adus to pixels */
 #define pt(A)	((int)((A)*dppt))    /* convert PostScript points to pixels */
 
 double dpadu;	/* pixels per adu.  This quantity must be recalculated for each
diff -Naur --exclude Makefile --exclude info wfdb-10.4.19/app/rdsamp.c wfdb-10.4.20/app/rdsamp.c
--- wfdb-10.4.19/app/rdsamp.c	2009-02-18 22:44:00.000000000 -0500
+++ wfdb-10.4.20/app/rdsamp.c	2009-04-30 15:30:35.000000000 -0400
@@ -1,5 +1,5 @@
 /* file: rdsamp.c	G. Moody	 23 June 1983
-			Last revised:   18 February 2009
+			Last revised:   20 April 2009
 
 -------------------------------------------------------------------------------
 rdsamp: Print an arbitrary number of samples from each signal
@@ -290,17 +290,17 @@
 	    }
 	    for (i = 0; i < nsig; i++) {
 		char ustring[16];
+		int len;
 	
 		p = si[sig[i]].units;
 		if (p == NULL) p = "mV";
-		if (pflag > 1)
-		    sprintf(ustring, "%14s", p);
-		else
-		    sprintf(ustring, "%6s", p);
-		for (p = ustring+2; *p == ' '; p++)
-		    ;
-		*(p-1) = '(';
-		(void)printf("\t%s)", ustring);
+		len = strlen(p);
+		if (pflag > 1) { if (len > 13) len = 13; }
+		else if (len > 5) len = 5;
+		ustring[0] = '(';
+		strncpy(ustring+1, p, len);
+		ustring[len+1] = '\0';
+		(void)printf(pflag > 1 ? "\t%14s)" : "\t%6s)", ustring);    
 	    }
 	    (void)printf("\n");
 	}
diff -Naur --exclude Makefile --exclude info wfdb-10.4.19/app/snip.c wfdb-10.4.20/app/snip.c
--- wfdb-10.4.19/app/snip.c	2003-02-07 18:04:34.000000000 -0500
+++ wfdb-10.4.20/app/snip.c	2009-04-17 01:50:17.000000000 -0400
@@ -1,8 +1,8 @@
 /* file: snip.c		G. Moody	30 July 1989
-			Last revised:  7 February 2003
+			Last revised:	17 April 2009
 -------------------------------------------------------------------------------
 snip: Copy an excerpt of a database record
-Copyright (C) 2003 George B. Moody
+Copyright (C) 1989-2009 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
@@ -26,21 +26,25 @@
 
 #include <stdio.h>
 #include <wfdb/wfdb.h>
+#include <wfdb/wfdblib.h>
 
 char *pname;
+int mflag = 0;	/* try to preserve segments if non-zero */
+int sflag = 0;	/* suppress copying info if non-zero */
 
 main(argc, argv)
 int argc;
 char *argv[];
 {
-    char *info, *irec = NULL, *nrec = NULL, *ofname, *orec, *startp = "0:0",
-         *xinfo, *prog_name();
-    int a, i, nann = 0, nsig;
-    long from = 0L, to = 0L, nsamp;
-    WFDB_Anninfo *ai;
-    WFDB_Annotation annot;
-    WFDB_Sample *v;
-    WFDB_Siginfo *si;
+    char *nrec = NULL, *irec = NULL, *startp = NULL, *endp = NULL;
+    char **annotators, *length = NULL, *prog_name();
+    int i, nann = 0, nsig = 0;
+    WFDB_Time from = 0L, to = 0L, endt = 0L;
+    void copy_ann(char *nrec, char *irec, WFDB_Time from, WFDB_Time to,
+		  char **annotators, int nann);
+    void copy_sig(char *nrec, char *irec, WFDB_Time from, WFDB_Time to,
+		  int mflag);
+    void copy_info(char *irec, char *startp);
     void help();
 
     pname = prog_name(argv[0]);
@@ -56,9 +60,9 @@
 	    /* Accept the next argument unconditionally as an annotator name;
 	       accept additional arguments until we find one beginning with
 	       `-', or the end of the argument list. */
-	    a = i;
+	    annotators = &argv[i];
 	    do {
-	        nann++;
+	        ++nann;
 	    } while (++i < argc && *argv[i] != '-');
 	    if (i < argc) i--;
 	    break;
@@ -74,6 +78,7 @@
 	    exit(0);
 	    break;
 	  case 'i':	/* input record name */
+	  case 'r':	/* accept as equivalent to -i */
 	    if (++i >= argc) {
 		(void)fprintf(stderr, "%s: input record name must follow -i\n",
 			      pname);
@@ -81,6 +86,12 @@
 	    }
 	    irec = argv[i];
 	    break;
+	  case 'l':	/* length of snip */
+	    length = argv[i];
+	    break;
+	  case 'm':  /* preserve segments of multisegment input, if possible */
+	    mflag = 1;
+	    break;
 	  case 'n':	/* new record name */
 	    if (++i >= argc) {
 		(void)fprintf(stderr, "%s: new record name must follow -n\n",
@@ -89,12 +100,15 @@
 	    }
 	    nrec = argv[i];
 	    break;
+	  case 's':	/* suppress copying of info */
+	    sflag = 1;
+	    break;
 	  case 't':	/* end time */
 	    if (++i >= argc) {
 		(void)fprintf(stderr, "%s: time must follow -t\n",pname);
 		exit(1);
 	    }
-	    to = i;
+	    endp = argv[i];
 	    break;
 	  default:
 	    (void)fprintf(stderr, "%s: unrecognized option %s\n", pname,
@@ -111,113 +125,317 @@
 	help();
 	exit(1);
     }
-
+    if (startp == NULL) startp = "0";
+    if (endp == NULL) endp = "e";
+    
     /* Verify that the output record can be written. */
-    if (newheader(nrec) < 0) exit(2);
+    if (newheader(nrec) < 0) {
+	fprintf(stderr, "%s: can't create output header\n", pname);
+	exit(2);
+    }
 
     /* Determine the number of signals. */
-    if ((nsig = isigopen(irec, NULL, 0)) < 0) exit(2);
+    if ((nsig = isigopen(irec, NULL, 0)) < 0) {
+	fprintf(stderr, "%s: error reading input header\n", pname);
+	exit(2);
+    }
 
     /* Evaluate the time limits. */
     if ((from = strtim(startp)) < 0L)
 	from = -from;
-    if (to > 0L) {
-	if ((to = strtim(argv[to])) < 0L)
-	    to = -to;
+    if (length)
+	to = from + strtim(length);
+    else if ((to = strtim(endp)) < 0L)
+	to = -to;
+    endt = strtim("e");
+    if ((endt > 0L && endt < from) || (to > 0L && to < from)) {
+	fprintf(stderr, "%s: improper interval selected\n", pname);
+	wfdbquit();
+	exit(1);
     }
 
+    /* Copy the annotations, if any. */
+    if (nann > 0)
+	copy_ann(nrec, irec, from, to, annotators, nann);
+
     /* Copy the signals, if any. */
-    if (nsig > 0) {
-	/* Allocate data structures for nsig signals. */
-        if ((v = malloc(nsig * sizeof(WFDB_Sample))) == NULL ||
-	    (si = malloc(nsig * sizeof(WFDB_Siginfo))) == NULL ||
-	    (ofname = malloc((strlen(nrec)+5) * sizeof(char))) == NULL) {
-	    (void)fprintf(stderr, "%s: insufficient memory\n", pname);
-	    exit(2);
-	}
+    if (nsig > 0)
+	copy_sig(nrec, irec, from, to, mflag);
+
+    /* Copy info strings from the input header file into the new one, unless
+       suppressed with -s. */
+    if (!sflag)
+	copy_info(irec, startp);
+
+    wfdbquit();
+    exit(0);	/*NOTREACHED*/
+}
 
-	/* Open the input signals. */
-	if (isigopen(irec, si, (unsigned)nsig) != nsig) exit(2);
+void copy_ann(char *nrec, char *irec, WFDB_Time from, WFDB_Time to,
+	      char **annotators, int nann)
+{
+    char *orec;
+    int i;
+    WFDB_Anninfo *ai, *ao;
+    WFDB_Annotation annot;
 
-	/* Open the output signals. */
-	(void)sprintf(ofname, "%s.dat", nrec);
-	for (i = 0; i < nsig; i++) {
-	    si[i].fname = ofname;
-	    si[i].group = 0;
-	    if (i > 0) si[i].fmt = si[0].fmt;
+    /* Allocate data structures for nann annotators. */
+    if ((ai = malloc((nann) * sizeof(WFDB_Anninfo))) == NULL ||
+	(ao = malloc((nann) * sizeof(WFDB_Anninfo))) == NULL ||
+	(orec = malloc((strlen(nrec)+2) * sizeof(char))) == NULL) {
+	(void)fprintf(stderr, "%s: insufficient memory\n", pname);
+	exit(2);
+    }
+    for (i = 0; i < nann; i++) {
+	ai[i].name = malloc((strlen(annotators[i]) + 1) * sizeof(char));
+	strcpy(ai[i].name, annotators[i]);
+	ai[i].stat = WFDB_READ;
+	ao[i].name = malloc((strlen(annotators[i]) + 1) * sizeof(char));
+	strcpy(ao[i].name, annotators[i]);
+	ao[i].stat = WFDB_WRITE;
+    }
+
+    /* Open the input annotators. */
+    if (annopen(irec, ai, nann) < 0) {
+	fprintf(stderr, "%s: error opening input annotators\n", pname);
+	exit(2);
+    }
+
+    /* Open the output annotators. */
+    (void)sprintf(orec, "+%s", nrec);
+    if (annopen(orec, ao, nann) < 0) {
+	fprintf(stderr, "%s: error opening output annotators\n", pname);
+	exit(2);
+    }
+
+    /* Copy the selected segment. */
+    for (i = 0; i < nann; i++) {
+	while (getann((unsigned)i, &annot) == 0) {
+	    if (annot.time >= from && (to == 0L || annot.time < to)) {
+		annot.time -= from;
+		if (putann((unsigned)i, &annot) < 0) break;
+	    }
 	}
-	if (osigfopen(si, (unsigned)nsig) != nsig) exit(2);
+    }
+    wfdbquit();
+    free(orec);
+    free(ai);
+}
 
-	/* Copy the selected segment. */
-	if (isigsettime(from) < 0) exit(2);
-	nsamp = (to == 0L) ? -1L : to - from;
-	while ((nsamp == -1L || nsamp-- > 0L) &&
-	    getvec(v) == nsig && putvec(v) == nsig)
-	    ;
-	free(ofname);
-	free(si);
-	free(v);
+void copy_sig(char *nrec, char *irec, WFDB_Time from, WFDB_Time to, int recurse)
+{
+    char *ofname, *p, tstring[24];
+    int i, nsig;
+    long nsamp;
+    WFDB_Sample *v;
+    WFDB_Siginfo *si;
+    WFDB_Time t, tf;
+
+    wfdbquit();
+    if ((nsig = isigopen(irec, NULL, 0)) < 0) {
+	fprintf(stderr, "%s: error opening header for %s\n", pname, irec);
+	exit(2);
     }
 
-    /* Copy the annotations, if any. */
-    if (nann > 0) {
-        /* Allocate data structures for nann annotators. */
-	if ((ai = malloc(nann * sizeof(ai))) == NULL ||
-	    (orec = malloc((strlen(nrec)+2) * sizeof(char))) == NULL) {
-	    (void)fprintf(stderr, "%s: insufficient memory\n", pname);
+    /* Allocate data structures for nsig signals. */
+    if ((v = malloc(nsig * sizeof(WFDB_Sample))) == NULL ||
+	(si = malloc(nsig * sizeof(WFDB_Siginfo))) == NULL ||
+	(ofname = malloc((strlen(nrec)+5) * sizeof(char))) == NULL) {
+	(void)fprintf(stderr, "%s: insufficient memory\n", pname);
+	exit(2);
+    }
+
+    /* Open the input signals. */
+    if (isigopen(irec, si, (unsigned)nsig) != nsig) {
+	fprintf(stderr, "%s: error opening signals for %s\n", pname, irec);
+	exit(2);
+    }
+
+    p = mstimstr(-from);
+    if (*p == '[') strncpy(tstring, mstimstr(-from)+1, 23);
+    else tstring[0] = '\0';
+
+    if (recurse && (si[0].fmt == 0 || si[0].nsamp != 0) &&
+	si[0].nsamp != strtim("e")) {
+	/* irec has multiple segments */
+	static char buf[256], *p, *ihfname, *ohfname;
+	static char *ihlfname, *olhfname, *orseg;
+	int i, first_seg, last_seg, maxseg, nseg;
+	WFDB_Frequency sfreq = sampfreq(NULL);
+	WFDB_FILE *ihfile;
+	FILE *ohfile;
+	
+	p = wfdbfile("hea", irec);
+	ihfname = malloc(strlen(p)+1);
+	strcpy(ihfname, p);
+	ihfile = wfdb_fopen(ihfname, "rb");
+	ohfname = malloc((strlen(nrec)+5) * sizeof(char));
+	sprintf(ohfname, "%s.hea", nrec);
+	ohfile = fopen(ohfname, "wb");
+	
+	/* read and parse the first line of the multi-segment header */
+	if (wfdb_fgets(buf, sizeof(buf), ihfile) == NULL) {
+	    fprintf(stderr, "%s: error reading %s\n", pname, ihfname);
 	    exit(2);
 	}
-	for (i = 0; i < nann; i++) {
-	    ai[i].name = argv[a++];
-	    ai[i].stat = WFDB_READ;
-	}
+	for (p = buf; *p != '/'; p++)
+	    ;
+	maxseg = atoi(p+1);	/* number of segments in irec */
+	if (si[0].nsamp == 0) {	/* irec has variable layout */
+	    char *ilhfname, *olhfname;
+	    WFDB_FILE *ilhfile;
+	    FILE *olhfile;
+	    
+	    maxseg--;	/* don't count layout segment */
+	    wfdb_fgets(buf, sizeof(buf), ihfile); /* 2nd line of irec.hea */
+	    for (p = buf; *p != ' '; p++)
+		;
+	    *p = '\0';
+	    p = wfdbfile("hea", buf); /* irec_layout.hea */
+	    ilhfname = malloc(strlen(p) + 1);
+	    strcpy(ilhfname, p);
+	    ilhfile = wfdb_fopen(ilhfname, "rb");
+	    olhfname = malloc((strlen(nrec)+12) * sizeof(char));
+	    sprintf(olhfname, "%s_layout.hea", nrec);
+	    olhfile = fopen(olhfname, "wb");
+	    fprintf(olhfile, "%s_layout %d %.12g 0", nrec, nsig, sfreq);
+	    if (tstring[0]) fprintf(olhfile, " %s", tstring);
+	    fprintf(olhfile, "\r\n");
+	    wfdb_fgets(buf, sizeof(buf), ilhfile);
+	    for (i = 0; i < nsig; i++) {
+		wfdb_fgets(buf, sizeof(buf), ilhfile);
+		fputs(buf, olhfile);
+	    }
+	    if (sflag == 0) {
+		char *info;
 
-	/* Open the input annotators. */
-	if (annopen(irec, ai, nann) < 0) exit(2);
+		wfdbquiet();  /* Suppress errors from the WFDB library. */
+		if (info = getinfo(irec))
+		    do {
+			fprintf(olhfile, "# %s\r\n", info);
+		    } while (info = getinfo((char *)NULL));
+		wfdbverbose();
+		sflag = 1;
+	    }
+	    fclose(olhfile);
+	    wfdb_fclose(ilhfile);
+	}		
+
+	/* Figure out which input segments contain data to be copied */
+	for (i = first_seg = 0, last_seg=maxseg, tf = 0L; i < maxseg; i++) {
+	    wfdb_fgets(buf, sizeof(buf), ihfile); /* read a segment def */
+	    for (p = buf; *p != ' '; p++)
+		;
+	    t = tf;
+	    tf = t + atol(p+1) + 1; /* first sample of next segment */
+	    if (t <= from && from < tf) first_seg = i;
+	    if (t <= to && to < tf) { last_seg = i; break; }
+	}
+	nseg = last_seg - first_seg + 1;
+	if (si[0].nsamp == 0) nseg++;
+	orseg = malloc((strlen(nrec)+6) * sizeof(char));
+	
+	/* Close and reopen the input header. */
+	wfdb_fclose(ihfile);
+	ihfile = wfdb_fopen(ihfname, "rb");
+	wfdb_fgets(buf, sizeof(buf), ihfile);
+
+	/* Start writing the master output header. */
+	fprintf(ohfile, "%s/%d %d %.12g %d", nrec, nseg, nsig, sfreq, to-from);
+	if (tstring[0]) fprintf(ohfile, " %s", tstring);
+	fprintf(ohfile, "\r\n");
+
+	if (si[0].nsamp == 0) {
+	    wfdb_fgets(buf, sizeof(buf), ihfile);
+	    fprintf(ohfile, "%s_layout 0\r\n", nrec); 
+	    nseg--;
+	}
 
-	/* Open the output annotators. */
-	(void)sprintf(orec, "+%s", nrec);
-	for (i = 0; i < nann; i++)
-	    ai[i].stat = WFDB_WRITE;
-	if (annopen(orec, ai, nann) < 0) exit(2);
-
-        /* Copy the selected segment. */
-        for (i = 0; i < nann; i++) {
-	    while (getann((unsigned)i, &annot) == 0) {
-	        if (annot.time >= from && (to == 0L || annot.time < to)) {
-		    annot.time -= from;
-		    if (putann((unsigned)i, &annot) < 0) break;
-		}
+	for (i = 0, t = 0; t < to; ) {
+	    long len;
+	    WFDB_Time start;
+	    
+	    wfdb_fgets(buf, sizeof(buf), ihfile);
+	    for (p = buf; *p != ' '; p++)
+		;
+	    *p = '\0';
+	    tf = t + atol(p+1); /* time of first sample of next segment */
+	    if (to < tf) /* this is the last segment with data to copy */
+		tf = to;
+	    if (from >= tf) {
+		t = tf;
+		continue;
+	    }
+	    if (from > t) {
+		start = from - t; len = tf - from;
 	    }
+	    else {
+		start = 0L; len = tf - t;
+	    }
+	    if (*buf == '~')
+		sprintf(orseg, "~");
+	    else {
+		sprintf(orseg, "%s_%04d", nrec, ++i);
+		copy_sig(orseg, buf, start, start + len, 0);
+	    }
+	    fprintf(ohfile, "%s %ld\r\n", orseg, len);
+	    t = tf;
 	}
-	free(orec);
-	free(ai);
+	fclose(ohfile);
+	return;
+    }
+    
+    /* Open the output signals. */
+    (void)sprintf(ofname, "%s.dat", nrec);
+    for (i = 0; i < nsig; i++) {
+	si[i].fname = ofname;
+	si[i].group = 0;
+	if (i > 0) si[i].fmt = si[0].fmt;
+    }
+    if (osigfopen(si, (unsigned)nsig) != nsig) exit(2);
+
+    /* Copy the selected segment. */
+    if (isigsettime(from) < 0) exit(2);
+    wfdbquiet();
+    nsamp = (to == 0L) ? -1L : to - from;
+    while (nsamp == -1L || nsamp-- > 0L) {
+	int stat = getvec(v);
+
+	if (stat > 0 || nsamp == 0L) putvec(v);
+	else break;
     }
 
     /* Clean up. */
+    wfdbverbose();
+    free(ofname);
+    free(si);
+    free(v);
+    if (tstring[0]) setbasetime(tstring);
     (void)newheader(nrec);
+}
 
-    /* Copy info strings from the input header file into the new one.
-       Suppress error messages from the WFDB library. */
-    wfdbquiet();
+void copy_info(char *irec, char *startp)
+{
+    char *info, *xinfo;
+
+    wfdbquiet();	/* Suppress error messages from the WFDB library. */
     if (info = getinfo(irec))
-        do {
+	do {
 	    (void)putinfo(info);
 	} while (info = getinfo((char *)NULL));
-
     /* Append additional info summarizing what snip has done. */
     if (xinfo =
 	malloc((strlen(pname)+strlen(irec)+strlen(startp)+50)* sizeof(char))) {
-        (void)sprintf(xinfo, "Produced by %s from record %s, beginning at %s",
+	(void)sprintf(xinfo,
+		      "Produced by %s from record %s, beginning at %s",
 		      pname, irec, startp);
 	(void)putinfo(xinfo);
 	free(xinfo);
     }
     wfdbverbose();
-    wfdbquit();
-    exit(0);	/*NOTREACHED*/
 }
 
+
 char *prog_name(s)
 char *s;
 {
@@ -246,6 +464,9 @@
  "              from IREC;  two or more ANNOTATORs may follow -a",
  " -f TIME     begin at specified time",
  " -h          print this usage summary",
+ " -l DURATION snip only DURATION (hh:mm:ss or sNNNN; overrides -t)",    
+ " -m          preserve segments of multsegment input, if possible",
+ " -s          suppress output of info strings in header",
  " -t TIME     stop at specified time",
  "To change the sampling frequency, gain, or storage format, to select a",
  "subset of signals, or to re-order signals, use `xform'.",
diff -Naur --exclude Makefile --exclude info wfdb-10.4.19/app/wfdb-config.c wfdb-10.4.20/app/wfdb-config.c
--- wfdb-10.4.19/app/wfdb-config.c	1969-12-31 19:00:00.000000000 -0500
+++ wfdb-10.4.20/app/wfdb-config.c	2009-05-03 15:08:07.000000000 -0400
@@ -0,0 +1,93 @@
+/* file: wfdb-config.c	G. Moody	27 April 2002
+			Last revised:	 3 May 2009	wfdblib 10.4.20
+
+-------------------------------------------------------------------------------
+wfdb-config: Print WFDB library version and linking information
+Copyright (C) 2002-2009 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
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; 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/).
+_______________________________________________________________________________
+
+*/
+
+#include <stdio.h>
+#ifndef __STDC__
+extern void exit();
+#endif
+
+#include <wfdb/wfdb.h>
+
+char *pname;
+
+main(int argc, char **argv)
+{
+    char *filename, *prog_name(char *s);
+    int i;
+    void help(void);
+
+    pname = prog_name(argv[0]);
+    if (argc == 1) {
+	help();
+	exit(1);
+    }
+
+    for (i = 1; i < argc; i++) {
+	if (strcmp(argv[i], "--version") == 0)
+	    printf("%s\n", wfdbversion());
+	else if (strcmp(argv[i], "--libs") == 0)
+	    printf("%s\n", wfdbldflags());
+	else if (strcmp(argv[i], "--cflags") == 0)
+	    printf("%s\n", wfdbcflags());
+	else
+	    help();
+    }
+    exit(0);
+}
+
+char *prog_name(char *s)
+{
+    char *p = s + strlen(s);
+
+#ifdef MSDOS
+    while (p >= s && *p != '\\' && *p != ':') {
+	if (*p == '.')
+	    *p = '\0';		/* strip off extension */
+	if ('A' <= *p && *p <= 'Z')
+	    *p += 'a' - 'A';	/* convert to lower case */
+	p--;
+    }
+#else
+    while (p >= s && *p != '/')
+	p--;
+#endif
+    return (p+1);
+}
+
+static char *help_strings[] = {
+    "usage: %s [--version] [--libs] [--cflags]\n",
+    NULL
+};
+
+void help(void)
+{
+    int i;
+
+    (void)fprintf(stderr, help_strings[0], pname);
+    for (i = 1; help_strings[i] != NULL; i++)
+	(void)fprintf(stderr, "%s\n", help_strings[i]);
+}
diff -Naur --exclude Makefile --exclude info wfdb-10.4.19/app/wrann.c wfdb-10.4.20/app/wrann.c
--- wfdb-10.4.19/app/wrann.c	2009-02-27 09:45:08.000000000 -0500
+++ wfdb-10.4.20/app/wrann.c	2009-04-09 21:26:24.000000000 -0400
@@ -1,5 +1,5 @@
 /* file wrann.c		G. Moody	 6 July 1983
-			Last revised:  27 February 2009
+			Last revised:   9 April 2009
 
 -------------------------------------------------------------------------------
 wrann: Translate an ASCII file in 'rdann' output format to an annotation file
@@ -49,17 +49,8 @@
 
     pname = prog_name(argv[0]);
 
-    /* Accept old syntax. */
-    if (argc >= 3 && argv[1][0] != '-') {
-	ai.name = argv[1];
-	record = argv[2];
-	i = 3;
-    }
-    else
-	i = 1;
-
     /* Interpret command-line options. */
-    for ( ; i < argc; i++) {
+    for (i = 1; i < argc; i++) {
 	if (*argv[i] == '-') switch (*(argv[i]+1)) {
 	  case 'a':	/* annotator follows */
 	    if (++i >= argc) {
@@ -113,7 +104,13 @@
 	*(a+1) = '\0';
 	(void)sscanf(p+1, "%ld%s%d%d%d\t%s", &tm, annstr, &sub, &ch, &nm, a+1);
 	annot.anntyp = strann(annstr);
-	annot.time = tm; annot.subtyp = sub; annot.chan = ch; annot.num = nm;
+	if (line[0] == '[') {
+	    annot.time = -strtim(line);
+	    if (annot.time < 0L) continue;
+	}
+	else
+	    annot.time = tm;
+	annot.subtyp = sub; annot.chan = ch; annot.num = nm;
 	if (*(a+1)) {
 	    *a = strlen(a+1);
 	    annot.aux = a;
diff -Naur --exclude Makefile --exclude info wfdb-10.4.19/checkpkg/expected/pschart.ps wfdb-10.4.20/checkpkg/expected/pschart.ps
--- wfdb-10.4.19/checkpkg/expected/pschart.ps	2009-01-16 13:11:01.000000000 -0500
+++ wfdb-10.4.20/checkpkg/expected/pschart.ps	2009-04-09 22:04:29.000000000 -0400
@@ -93,41 +93,41 @@
 1612 2782 m
 (MLII)t
 862 2790 m
-(~O~O}N~O}O~Q~N}O~O}O~O~O}O~N}O~O~P}O~O}O~N}O~O~P}O~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O~O~O}Q~P}O~P~P}O~Q}P~O}P~O~P}P~P}O~N~O}O~O}P~O~O}O~O}O~P}O~N~N}P~O}P~N~N}O~O}P~O~O}O~N}O~O~P}N~O}N~O}P~P~N}O~N}O~P~P}O~N}N~O~O}O~O}O~N}P~O) z
+(~O}P~N}O~O~O}O~O}O~O~N}P~O}O~N~O}O~P}P~N}O~N~O}P~P}O~O~N}O~O}P~N~O}O~P}O~N}P~O~N}O~P}O~O~O}N~O}P~P~O}N~O}O~P~P}N~O}O~P}O~P~N}O~O}O~O~Q}O~N}O~O~O}P~M}O~N~O}P~O}O~N}N~O~O}Q~N}N~O~N}O~Q}N~N~P}N~P}O~O}O~O~O}O~O}N~M~M}N~N}N~O~R}T~W}V~V~U}V~U}U~P}E~;~>}H~Q) z
+(}P~P~O}O~O}O~O~P}N~O}O~N}P~O~O}N~O}O~P~O}O~N}O~O~P}P~O}N~N~O}O~Q}N~O}N~O~P}P~O}N~O~P}N~P}O~N~O}O~O) z
 10 R
 12 R
 2651 Ay
diff -Naur --exclude Makefile --exclude info wfdb-10.4.19/conf/linux.def wfdb-10.4.20/conf/linux.def
--- wfdb-10.4.19/conf/linux.def	2005-08-04 15:42:49.000000000 -0400
+++ wfdb-10.4.20/conf/linux.def	2009-05-03 14:18:49.000000000 -0400
@@ -1,5 +1,5 @@
 # file: linux.def		G. Moody	31 May 2000
-#				Last revised:  4 August 2005
+#				Last revised:    3 May 2009
 # 'make' definitions for compiling the WFDB Software Package under Linux
 
 # Choose a value for WFDBROOT to determine where the WFDB Software Package will
@@ -63,8 +63,9 @@
 
 # CCDEFS is the set of C compiler options needed to set preprocessor variables
 # while compiling the WFDB Software Package.  CCDEFS should always include
-# VDEFS.
-CCDEFS = $(VDEFS)
+# VDEFS (the version definitions).  Under Linux, -fno-stack-protector is needed
+# when compiling the WFDB Toolkit for Matlab;  it's harmless otherwise.
+CCDEFS = $(VDEFS) -fno-stack-protector
 
 # MFLAGS is the set of architecture-dependent (-m*) compiler options, which
 # is usually empty.  See the gcc manual for information about gcc's -m options.
@@ -144,7 +145,7 @@
 XLIBDIR = $(XHOME)/lib
 
 # WCFLAGS is the set of C compiler options to use when compiling WAVE.
-WCFLAGS = $(CFLAGS) -I$(OWINCDIR) -I$(XINCDIR)
+WCFLAGS = $(CFLAGS) -I$(OWINCDIR) -I$(XINCDIR) -fno-stack-protector
 
 # HELPOBJ can be set to "help.o" if you wish to recompile the XView spot help
 # functions in "wave/help.c" (recommended under Linux).
diff -Naur --exclude Makefile --exclude info wfdb-10.4.19/conf/linux-slib.def wfdb-10.4.20/conf/linux-slib.def
--- wfdb-10.4.19/conf/linux-slib.def	2005-08-04 21:31:11.000000000 -0400
+++ wfdb-10.4.20/conf/linux-slib.def	2009-05-03 14:18:35.000000000 -0400
@@ -1,5 +1,5 @@
 # file: linux-slib.def		G. Moody	31 May 2000
-#                               Last revised:  4 August 2005
+#                               Last revised:    3 May 2009
 # This section contains settings suitable for generating an ELF-format shared
 # library under Linux.
 
@@ -57,8 +57,9 @@
 
 # CCDEFS is the set of C compiler options needed to set preprocessor variables
 # while compiling the WFDB Software Package.  CCDEFS should always include
-# VDEFS.
-CCDEFS = $(VDEFS)
+# VDEFS (the version definitions).  Under Linux, -fno-stack-protector is needed
+# when compiling the WFDB Toolkit for Matlab;  it's harmless otherwise.
+CCDEFS = $(VDEFS) -fno-stack-protector
 
 # MFLAGS is the set of architecture-dependent (-m*) compiler options, which
 # is usually empty.  See the gcc manual for information about gcc's -m options.
@@ -66,7 +67,7 @@
 
 # CFLAGS is the set of C compiler options used when compiling the shared
 # library.  CFLAGS should always include CCDEFS.
-CFLAGS = $(MFLAGS) -fpic -g -O $(CCDEFS) $(LC) -I$(INCDIR)
+CFLAGS = $(MFLAGS) -fpic -g -O $(CCDEFS) $(LC) -I$(INCDIR) -fno-stack-protector
 
 # WFDBLIB_BASENAME is the name, without version numbers, of the alternate
 # library.  WFDBLIB_SONAME is the shared object name ("soname") of the
diff -Naur --exclude Makefile --exclude info wfdb-10.4.19/doc/wag-src/rdsamp.1 wfdb-10.4.20/doc/wag-src/rdsamp.1
--- wfdb-10.4.19/doc/wag-src/rdsamp.1	2009-02-18 17:37:39.000000000 -0500
+++ wfdb-10.4.20/doc/wag-src/rdsamp.1	2009-04-30 12:55:09.000000000 -0400
@@ -1,4 +1,4 @@
-.TH RDSAMP 1 "18 February 2009" "WFDB 10.4.14" "WFDB Applications Guide"
+.TH RDSAMP 1 "30 April 2009" "WFDB 10.4.20" "WFDB Applications Guide"
 .SH NAME
 rdsamp \- read WFDB signal files
 .SH SYNOPSIS
@@ -79,7 +79,14 @@
 of the record.
 .TP
 \fB-v\fR
-Print column headings.
+Print column headings (signal names on the first line, units on the second).
+The names of some signals are too wide to fit in the columns; such
+names are shortened by omitting the initial characters (since names of
+related signals often differ only at the end, this helps to make the
+columns identifiable).  Names of units are shortened when necessary by
+omitting the final characters, since the initial characters are
+usually most important for distinguishing different units.
+
 .SH ENVIRONMENT
 .PP
 It may be necessary to set and export the shell variable \fBWFDB\fR (see
diff -Naur --exclude Makefile --exclude info wfdb-10.4.19/doc/wag-src/snip.1 wfdb-10.4.20/doc/wag-src/snip.1
--- wfdb-10.4.19/doc/wag-src/snip.1	2002-07-31 22:56:32.000000000 -0400
+++ wfdb-10.4.20/doc/wag-src/snip.1	2009-04-17 01:16:23.000000000 -0400
@@ -1,4 +1,4 @@
-.TH SNIP 1 "31 July 2002" "WFDB 10.2.7" "WFDB Applications Guide"
+.TH SNIP 1 "17 Aril 2009" "WFDB 10.4.20" "WFDB Applications Guide"
 .SH NAME
 snip \- copy an excerpt of a WFDB record
 .SH SYNOPSIS
@@ -31,6 +31,16 @@
 \fB-h\fR
 Print a usage summary.
 .TP
+\fB-l\fR \fIduration\fR
+Snip a segment of the specified \fIduration\fR (hh:mm:ss or s\fInnnn\fR;
+overrides \fB-t\fR if given).
+.TP
+\fB-m\fR
+Preserve segments of multi-segment input, if possible.
+.TP
+\fB-s\fR
+Suppress output of info strings in the output header file.
+.TP
 \fB-t\fR \fItime\fR
 Process until the specified \fItime\fR in the input record (default: continue
 to the end of the record).
diff -Naur --exclude Makefile --exclude info wfdb-10.4.19/doc/wag-src/wfdb2mat.1 wfdb-10.4.20/doc/wag-src/wfdb2mat.1
--- wfdb-10.4.19/doc/wag-src/wfdb2mat.1	2009-02-26 22:17:43.000000000 -0500
+++ wfdb-10.4.20/doc/wag-src/wfdb2mat.1	2009-03-26 02:36:35.000000000 -0400
@@ -30,8 +30,9 @@
 number in the input record.  If this seems odd, transpose your matrix
 after reading it!
 .PP
-This program writes version 4 MAT-file format output files, as documented in
-http://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/matfile_format.pdf.
+This program writes version 4 MAT-file format output files (see
+http://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/matfile_format.pdf
+for details).
 The samples are written as 16-bit signed integers in little-endian format, or
 as 8-bit unsigned integers for records that contain only 8-bit unsigned samples.
 Although version 5 and newer versions of Matlab normally use a different (less
diff -Naur --exclude Makefile --exclude info wfdb-10.4.19/doc/wag-src/wrann.1 wfdb-10.4.20/doc/wag-src/wrann.1
--- wfdb-10.4.19/doc/wag-src/wrann.1	2008-03-27 10:22:07.000000000 -0400
+++ wfdb-10.4.20/doc/wag-src/wrann.1	2009-04-09 21:51:22.000000000 -0400
@@ -1,4 +1,4 @@
-.TH WRANN 1 "1 August 2002" "WFDB 10.2.7" "WFDB Applications Guide"
+.TH WRANN 1 "9 April 2009" "WFDB 10.4.20" "WFDB Applications Guide"
 .SH NAME
 wrann \- write a WFDB annotation file
 .SH SYNOPSIS
@@ -21,6 +21,15 @@
 .PP
 Note the alternate format selected by \fBrdann\fR's \fB-x\fR option is
 incompatible with \fBwrann\fR.
+.PP
+Versions of \fBwrann\fR included in version 10.4.20 (and later versions)
+of the WFDB Software Package set the time fields of output annotations
+to match the times in the first column of input if those times appear to
+be absolute times (beginning with '[').  Otherwise, as in previous versions,
+\fBwrann\fR matches the sample numbers given in the second column of input.
+This capability can be used in a pipeline with \fBrdann\fR to copy a set of
+annotations between two records that overlap in time, even if their starting
+times or sampling frequencies are different.
 .SH ENVIRONMENT
 .PP
 It may be necessary to set and export the shell variable \fBWFDB\fR (see
diff -Naur --exclude Makefile --exclude info wfdb-10.4.19/lib/Makefile.tpl wfdb-10.4.20/lib/Makefile.tpl
--- wfdb-10.4.19/lib/Makefile.tpl	2009-02-03 16:04:59.000000000 -0500
+++ wfdb-10.4.20/lib/Makefile.tpl	2009-05-03 15:22:24.000000000 -0400
@@ -1,5 +1,5 @@
 # file: Makefile.tpl		G. Moody	  24 May 2000
-#				Last revised:   3 February 2009
+#				Last revised:      3 May 2009
 # This section of the Makefile should not need to be changed.
 
 INCLUDES = $(INCDIR)/wfdb/wfdb.h $(INCDIR)/wfdb/wfdblib.h \
@@ -9,28 +9,24 @@
 OFILES = wfdbinit.o annot.o signal.o calib.o wfdbio.o
 MFILES = Makefile Makefile.dos
 
-# `make' or `make all':  build the WFDB library and wfdb-config
+# `make' or `make all':  build the WFDB library
 all:	setup $(OFILES)
-	rm -f wfdb-config wfdb-config.exe
-	$(MAKE) wfdb-config	# be sure that compiled-in paths are up-to-date
 	$(BUILDLIB) $(OFILES) $(BUILDLIB_LDFLAGS)
 
 # `make install':  install the WFDB library and headers
-install:	$(INCLUDES) $(LIBDIR) $(BINDIR) all
+install:	$(INCLUDES) $(LIBDIR)
+	$(MAKE) clean	    # force recompilation since config may have changed
+	$(MAKE) all
 	cp $(WFDBLIB) $(LIBDIR) 
 	$(SETLPERMISSIONS) $(LIBDIR)/$(WFDBLIB)
 	$(MAKE) lib-post-install
-	../install.sh $(BINDIR) wfdb-config
 
 # 'make collect':  retrieve the installed WFDB library and headers
 collect:
 	../conf/collect.sh $(INCDIR)/wfdb wfdb.h ecgcodes.h ecgmap.h
 	../conf/collect.sh $(LIBDIR) $(WFDBLIB) $(WFDBLIB_DLLNAME)
-	../conf/collect.sh $(BINDIR) wfdb-config
 
 uninstall:
-	../uninstall.sh $(BINDIR) wfdb-config
-	../uninstall.sh $(BINDIR)
 	../uninstall.sh $(INCDIR)/wfdb $(HFILES)
 	../uninstall.sh $(INCDIR)
 	../uninstall.sh $(LIBDIR) $(WFDBLIB)
@@ -40,13 +36,9 @@
 setup:
 	sed "s+DBDIR+$(DBDIR)+" <wfdblib.h0 >wfdblib.h
 
-wfdb-config:
-	$(CC) $(CFLAGS) -DVERSION='"$(VERSION)"' -DCFLAGS='"-I$(INCDIR)"' \
-	  -DLDFLAGS='"-lwfdb"' -I$(INCDIR) -o $@ wfdb-config.c
-
 # `make clean': remove binaries and backup files
 clean:
-	rm -f $(OFILES) libwfdb.* *.dll *~ wfdb-config
+	rm -f $(OFILES) libwfdb.* *.dll *~
 
 # `make TAGS':  make an `emacs' TAGS file
 TAGS:		$(HFILES) $(CFILES)
@@ -54,10 +46,10 @@
 
 # `make listing':  print a listing of WFDB library sources
 listing:
-	$(PRINT) README $(MFILES) $(HFILES) $(CFILES) wfdb-config.c
+	$(PRINT) README $(MFILES) $(HFILES) $(CFILES)
 
 # Rule for creating installation directories
-$(BINDIR) $(INCDIR) $(INCDIR)/wfdb $(INCDIR)/ecg $(LIBDIR):
+$(INCDIR) $(INCDIR)/wfdb $(INCDIR)/ecg $(LIBDIR):
 	mkdir -p $@; $(SETDPERMISSIONS) $@
 
 # Rules for installing the include files
diff -Naur --exclude Makefile --exclude info wfdb-10.4.19/lib/wfdb-config.c wfdb-10.4.20/lib/wfdb-config.c
--- wfdb-10.4.19/lib/wfdb-config.c	2006-02-23 17:48:10.000000000 -0500
+++ wfdb-10.4.20/lib/wfdb-config.c	1969-12-31 19:00:00.000000000 -0500
@@ -1,105 +0,0 @@
-/* file: wfdb-config.c	G. Moody	27 April 2002
-			Last revised:	23 February 2006	wfdblib 10.4.0
-
--------------------------------------------------------------------------------
-wfdb-config: Print WFDB library version and linking information
-Copyright (C) 2002-2006 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
-Foundation; either version 2 of the License, or (at your option) any later
-version.
-
-This program 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 General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; 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/).
-_______________________________________________________________________________
-
-*/
-
-#include <stdio.h>
-#ifndef __STDC__
-extern void exit();
-#endif
-
-#include <wfdb/wfdb.h>
-
-#ifndef VERSION
-#define VERSION	"VERSION not defined"
-#endif
-
-#ifndef LDFLAGS
-#define LDFLAGS "LDFLAGS not defined"
-#endif
-
-#ifndef CFLAGS
-#define CFLAGS	"CFLAGS not defined"
-#endif
-
-char *pname;
-
-main(int argc, char **argv)
-{
-    char *filename, *prog_name(char *s);
-    int i;
-    void help(void);
-
-    pname = prog_name(argv[0]);
-    if (argc == 1) {
-	help();
-	exit(1);
-    }
-
-    for (i = 1; i < argc; i++) {
-	if (strcmp(argv[i], "--version") == 0)
-	    printf("%s\n", VERSION);
-	else if (strcmp(argv[i], "--libs") == 0)
-	    printf("%s\n", LDFLAGS);
-	else if (strcmp(argv[i], "--cflags") == 0)
-	    printf("%s\n", CFLAGS);
-	else
-	    help();
-    }
-    exit(0);
-}
-
-char *prog_name(char *s)
-{
-    char *p = s + strlen(s);
-
-#ifdef MSDOS
-    while (p >= s && *p != '\\' && *p != ':') {
-	if (*p == '.')
-	    *p = '\0';		/* strip off extension */
-	if ('A' <= *p && *p <= 'Z')
-	    *p += 'a' - 'A';	/* convert to lower case */
-	p--;
-    }
-#else
-    while (p >= s && *p != '/')
-	p--;
-#endif
-    return (p+1);
-}
-
-static char *help_strings[] = {
-    "usage: %s [--version] [--libs] [--cflags]\n",
-    NULL
-};
-
-void help(void)
-{
-    int i;
-
-    (void)fprintf(stderr, help_strings[0], pname);
-    for (i = 1; help_strings[i] != NULL; i++)
-	(void)fprintf(stderr, "%s\n", help_strings[i]);
-}
diff -Naur --exclude Makefile --exclude info wfdb-10.4.19/lib/wfdb.h wfdb-10.4.20/lib/wfdb.h
--- wfdb-10.4.19/lib/wfdb.h	2009-03-26 01:25:02.000000000 -0400
+++ wfdb-10.4.20/lib/wfdb.h	2009-05-04 01:01:16.000000000 -0400
@@ -33,7 +33,7 @@
 /* WFDB library version. */
 #define WFDB_MAJOR   10
 #define WFDB_MINOR   4
-#define WFDB_RELEASE 19
+#define WFDB_RELEASE 20
 #define WFDB_NETFILES 1	/* if 1, library includes code for HTTP, FTP clients */
 #define WFDB_NETFILES_LIBCURL 1
 
@@ -324,6 +324,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();
 #endif
 
 #ifdef wfdb_CPP
diff -Naur --exclude Makefile --exclude info wfdb-10.4.19/lib/wfdb.h0 wfdb-10.4.20/lib/wfdb.h0
--- wfdb-10.4.19/lib/wfdb.h0	2009-02-26 18:05:24.000000000 -0500
+++ wfdb-10.4.20/lib/wfdb.h0	2009-04-16 14:57:58.000000000 -0400
@@ -324,6 +324,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();
 #endif
 
 #ifdef wfdb_CPP
diff -Naur --exclude Makefile --exclude info wfdb-10.4.19/lib/wfdbio.c wfdb-10.4.20/lib/wfdbio.c
--- wfdb-10.4.19/lib/wfdbio.c	2009-03-03 12:49:16.000000000 -0500
+++ wfdb-10.4.20/lib/wfdbio.c	2009-05-03 15:08:20.000000000 -0400
@@ -39,6 +39,13 @@
  wfdbfile [4.3]		(returns the complete pathname of a WFDB file)
  wfdbmemerr [10.4.6]    (set behavior on memory errors)
 
+These functions expose config strings needed by the WFDB Toolkit for Matlab:
+ wfdbversion [10.4.20]  (return the string defined by VERSION)
+ wfdbldflags [10.4.20]  (return the string defined by LDFLAGS)
+ wfdbcflags [10.4.20]   (return the string defined by CFLAGS)
+ wfdbdefwfdb [10.4.20]  (return the string defined by DEFWFDB)
+ wfdbdefwfdbcal [10.4.20] (return the string defined by DEFWFDBCAL)
+
 These functions, also defined here, are intended only for the use of WFDB
 library functions defined elsewhere:
 
@@ -237,6 +244,46 @@
     wfdb_mem_behavior = behavior;
 }
 
+/* Functions that expose configuration constants used by the WFDB Toolkit for
+   Matlab. */
+
+#ifndef VERSION
+#define VERSION "VERSION not defined"
+#endif
+
+#ifndef LDFLAGS
+#define LDFLAGS "LDFLAGS not defined"
+#endif
+
+#ifndef CFLAGS
+#define CFLAGS  "CFLAGS not defined"
+#endif
+
+const FSTRING wfdbversion()
+{
+   return VERSION;
+}
+
+const FSTRING wfdbldflags()
+{
+   return LDFLAGS;
+}
+
+const FSTRING wfdbcflags()
+{
+   return CFLAGS;
+}
+
+const FSTRING wfdbdefwfdb()
+{
+   return DEFWFDB;
+}
+
+const FSTRING wfdbdefwfdbcal()
+{
+   return DEFWFDBCAL;
+}
+
 /* Private functions (for the use of other WFDB library functions only). */
 
 int wfdb_me_fatal()	/* used by the MEMERR macro defined in wfdblib.h */
diff -Naur --exclude Makefile --exclude info wfdb-10.4.19/MANIFEST wfdb-10.4.20/MANIFEST
--- wfdb-10.4.19/MANIFEST	2009-02-26 22:18:59.000000000 -0500
+++ wfdb-10.4.20/MANIFEST	2009-05-03 15:22:59.000000000 -0400
@@ -46,6 +46,7 @@
 app/wabp.c
 app/wfdbcat.c
 app/wfdbcollate.c
+app/wfdb-config.c
 app/wfdbdesc.c
 app/wfdbtime.c
 app/wfdbwhich.c
@@ -492,7 +493,6 @@
 lib/Makefile.tpl
 lib/README
 lib/signal.c
-lib/wfdb-config.c
 lib/wfdb.h
 lib/wfdb.h0
 lib/wfdbinit.c
diff -Naur --exclude Makefile --exclude info wfdb-10.4.19/NEWS wfdb-10.4.20/NEWS
--- wfdb-10.4.19/NEWS	2009-03-26 02:13:34.000000000 -0400
+++ wfdb-10.4.20/NEWS	2009-05-04 01:23:53.000000000 -0400
@@ -1,3 +1,19 @@
+10.4.20:
+	WFDB application 'snip' can now create excerpts of multi-segment
+	records that preserve the segmentation of the original records.
+
+	WFDB application 'wrann' now determines output annotation times using
+	the first column of input, if the first column appears to contain
+	absolute times rather than elapsed times; otherwise, it uses the sample
+	numbers in the second column, as in previous versions.
+
+	WFDB application 'rdsamp' now handles long units strings more cleanly.
+	
+	Several new functions have been added to lib/wfdbio.c, to make
+	configuration constants accessible at run time;  these are needed
+	by the WFDB Toolkit for Matlab.  wfdb-config.c has been rewritten to
+	use several of these functions, and has been moved from lib to app.
+
 10.4.19:
 	pschart and psfd now handle signal names in their command-line argument
 	lists (following the '-s' option).
diff -Naur --exclude Makefile --exclude info wfdb-10.4.19/wfdb.spec wfdb-10.4.20/wfdb.spec
--- wfdb-10.4.19/wfdb.spec	2009-02-26 22:21:14.000000000 -0500
+++ wfdb-10.4.20/wfdb.spec	2009-05-03 23:39:12.000000000 -0400
@@ -15,6 +15,9 @@
 BuildRoot: /var/tmp/%{name}-root
 
 %changelog
+* Sun May 3 2009 George B Moody <george@mit.edu>
+- moved wfdb-config from devel to apps
+
 * Thu Feb 29 2009 George B Moody <george@mit.edu>
 - added wfdb2mat
 
@@ -111,7 +114,6 @@
 
 %files devel
 %defattr(-,root,root)
-%{_bindir}/wfdb-config
 %{_prefix}/database
 %{_prefix}/include/wfdb
 %doc checkpkg examples fortran lib/COPYING.LIB COPYING INSTALL MANIFEST NEWS README README.NETFILES
@@ -195,6 +197,7 @@
 %{_bindir}/url_view
 %{_bindir}/wabp
 %{_bindir}/wav2mit
+%{_bindir}/wfdb-config
 %{_bindir}/wfdb2mat
 %{_bindir}/wfdbcat
 %{_bindir}/wfdbcollate
