diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/app/cshsetwfdb wfdb-10.3.16/app/cshsetwfdb --- wfdb-10.3.15/app/cshsetwfdb 2002-11-22 22:19:12.000000000 -0500 +++ wfdb-10.3.16/app/cshsetwfdb 2005-06-08 16:53:32.000000000 -0400 @@ -1,7 +1,3 @@ setenv WFDB ". ${HOME}/database /usr/local/database /cdrom http://www.physionet.org/physiobank/database" # Change www.physionet.org above to your favorite mirror if you wish -setenv WFDBCAL wfdbcalx - -# For compatibility with older applications only -setenv DB "$WFDB" -setenv DBCAL $WFDBCAL +setenv WFDBCAL wfdbcal diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/app/Makefile.dos wfdb-10.3.16/app/Makefile.dos --- wfdb-10.3.15/app/Makefile.dos 2004-11-28 15:24:17.000000000 -0500 +++ wfdb-10.3.16/app/Makefile.dos 1969-12-31 19:00:00.000000000 -0500 @@ -1,153 +0,0 @@ -# file: Makefile.dos G. Moody 2 November 1989 -# Last revised: 28 November 2004 wfdblib 10.3.14 -# MSDOS/Windows `make' description file template for WFDB applications -# -# ----------------------------------------------------------------------------- -# WFDB applications: programs for working with annotated signals -# Copyright (C) 1989-2004 George B. Moody -# -# These programs are free software; you can redistribute them and/or modify -# them 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. -# -# These programs are distributed in the hope that they 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 -# these programs; 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/). -# _____________________________________________________________________________ -# -# WARNING: NO SUPPORT FOR PROPRIETARY COMPILERS. Previous versions of the WFDB -# software package have been compiled successfully by other users using various -# proprietary compilers including those mentioned below. You may find this -# file helpful if you wish to use one of these compilers, but no support can be -# provided in this case. If you cannot successfully compile this software -# using a proprietary compiler, please try using Cygwin/gcc or MinGW/gcc under -# MS-Windows, or DJGPP under MS-DOS (free from http://www.cygwin.com/, -# http://www.mingw.org/, or http://www.delorie.com/ respectively). -# -# Before using this file, define these variables as appropriate for your -# installation: -# -# BINDIR The directory in which the applications will be installed. -# CC The name of the command-line C compiler. -# CDFLAGS Optional arguments to be supplied to CC to produce object files -# with debugging symbols. -# COFLAGS Optional arguments to be supplied to CC to produce optimized -# object files (or normal object files if no optimization is -# available). -# WFDBDIR The directory in which WFDB data files are to be installed. -# (More than one directory may be used for this purpose; -# WFDBDIR names the primary writable directory. See the -# discussion of the WFDB path in the WFDB Programmer's Guide -# for details.) -# LDFLAGS CC options to link with the WFDB library. -# PSPDIR The directory in which PostScript prolog files will be -# installed. -# PSPDST The same as PSPDIR, except that any `\' characters should be -# quoted (i.e., represented as `\\'; Borland (Turbo) `make' -# requires *four* `\' characters to pass one in a string). -# PSPDST should end with a quoted `\'. -# Q The string necessary to insert a `"' character into a macro -# definition. -# XXFILES Optional executables to be built; these may include any of: -# sample.exe -# view.exe -# vsetup.exe -# The program `sample' requires hardware and software from -# Microstar Laboratories; see `sample.c' for details. The -# Microstar headers ioutil.h, clock.h, and c_lib.c should be -# installed in INCDIR, and the Microstar large-model library -# should be installed in LIBDIR. Microstar supplies libraries -# for use with Microsoft C and Turbo C; copy the appropriate one -# to LIBDIR and name it `cdapl.lib'. Do this before attempting -# to compile `sample'. -# LSAMPLE CC options to link with the WFDB and cdapl libraries. -# -# The programs `view' and `vsetup' are written to use the -# Microsoft C graphics library (`graphics.lib'). Precompiled -# versions of `view' and `vsetup' are provided in the `bin' -# directory. - -# Commands needed to build and install the WFDB applications are given below -# for several versions of `make'. -# -# Borland (Turbo) `make': -# make install -# Microsoft `make' (supplied with Microsoft C before version 6.0): -# make makefile -# Microsoft `nmake' (supplied with Microsoft C 6.0 and later versions): -# nmake install - -# Most versions of `make' allow you to override the settings of make variables -# from the command line, so that it may not be necessary to edit this file to -# test the effects of small modifications to it. - -# For optimized code, uncomment the next line. -CFLAGS = $(COFLAGS) -# Otherwise, if you modify the sources and need to debug them, uncomment the -# next line. -# CFLAGS = $(CDFLAGS) - -# Except as noted at the end of this file, it should not be necessary to modify -# anything below this line. -# ----------------------------------------------------------------------------- - -XFILES = ann2rr.exe bxb.exe calsig.exe ecgeval.exe epicmp.exe fir.exe ihr.exe \ - mfilt.exe mrgann.exe mxm.exe nst.exe plotstm.exe pscgen.exe pschart.exe \ - psfd.exe rdann.exe rdsamp.exe rr2ann.exe rxr.exe sampfreq.exe sigamp.exe \ - skewedit.exe snip.exe sortann.exe sqrs.exe sqrs125.exe sumann.exe \ - sumstats.exe tach.exe wfdbcat.exe wfdbcollate.exe \ - wfdbdesc.exe wfdbwhich.exe wqrs.exe wrann.exe wrsamp.exe wvscript.exe \ - xform.exe \ - $(XXFILES) - -# General rule for compiling C sources into executable files -.c.exe: - $(CC) $(CFLAGS) $*.c $(LDFLAGS) - -# Rules for compiling programs that require non-standard options - -plotstm.exe: plotstm.c - $(CC) $(CFLAGS) $*.c - -pschart.exe: pschart.c - $(CC) $(CFLAGS) -DPROLOG=$(Q)$(PSPDST)pschart.pro$(Q) $*.c $(LDFLAGS) - -psfd.exe: psfd.c - $(CC) $(CFLAGS) -DPROLOG=$(Q)$(PSPDST)psfd.pro$(Q) $*.c $(LDFLAGS) - -sample.exe: sample.c - -$(CC) $(CFLAGS) $*.c $(LSAMPLE) - -view.exe: view.c - cl -Ox view.c -link wfdb graphics - -vsetup.exe: vsetup.c - cl -Ox vsetup.c -link graphics - - -$(BINDIR): - -mkdir $(BINDIR) - -$(PSPDIR): - -mkdir $(PSPDIR) - -install: $(XFILES) $(BINDIR) $(PSPDIR) - copy *.exe $(BINDIR) - copy setwfdb.bat $(BINDIR) - copy *.pro $(PSPDIR) - -# If you are using Microsoft `make', you may wish to comment out the next -# three lines to avoid having `make' clean up automatically. -clean: - del *.obj - del *.exe diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/app/Makefile.tpl wfdb-10.3.16/app/Makefile.tpl --- wfdb-10.3.15/app/Makefile.tpl 2004-11-28 16:28:06.000000000 -0500 +++ wfdb-10.3.16/app/Makefile.tpl 2005-06-08 17:03:51.000000000 -0400 @@ -1,13 +1,13 @@ # file: Makefile.tpl G. Moody 23 May 2000 -# Last revised: 28 November 2004 +# Last revised: 8 June 2005 # This section of the Makefile should not need to be changed. CFILES = ann2rr.c bxb.c calsig.c ecgeval.c epicmp.c fir.c ihr.c mfilt.c \ 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 sample.c sigamp.c sigavg.c skewedit.c \ snip.c sortann.c sqrs.c sqrs125.c sumann.c sumstats.c tach.c time2sec.c \ - view.c vsetup.c wabp.c wfdbcat.c wfdbcollate.c wfdbdesc.c \ - wfdbwhich.c wqrs.c wrann.c wrsamp.c wvscript.c xform.c + wabp.c wfdbcat.c wfdbcollate.c wfdbdesc.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 skewedit \ @@ -16,8 +16,7 @@ wrann wrsamp xform SCRIPTS = cshsetwfdb setwfdb PSFILES = pschart.pro psfd.pro 12lead.pro -OTHERFILES = cshsetwfdb setwfdb setwfdb.bat sample8.hea -MFILES = Makefile Makefile.dos +MFILES = Makefile # General rule for compiling C sources into executable files. This is # redundant for most versions of `make', but at least one System V version @@ -60,7 +59,7 @@ # `make listing': print a listing of WFDB applications sources listing: - $(PRINT) README $(MFILES) $(CFILES) $(PSFILES) $(OTHERFILES) + $(PRINT) README $(MFILES) $(CFILES) $(PSFILES) # Rules for compiling applications that require non-standard options diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/app/plotstm.c wfdb-10.3.16/app/plotstm.c --- wfdb-10.3.15/app/plotstm.c 2000-01-30 04:13:16.000000000 -0500 +++ wfdb-10.3.16/app/plotstm.c 2005-06-10 09:50:23.000000000 -0400 @@ -1,9 +1,9 @@ /* file: plotstm.c G. Moody 24 March 1992 - Last revised: 3 May 1999 + Last revised: 10 June 2005 ------------------------------------------------------------------------------- plotstm: Make a PostScript scatter plot of ST measurements from `epic' output -Copyright (C) 1999 George B. Moody +Copyright (C) 1992-2005 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 @@ -27,10 +27,20 @@ #include #include -#ifndef __STDC__ + +#ifdef __STDC__ +#include +#else extern void exit(); #endif +#ifndef BSD +# include +#else /* for Berkeley UNIX only */ +# include +# define strchr index +#endif + /* The PostScript code below is the prolog for the scatter plot. Portions of this code were extracted from the output of `plt', a 2-D plotting package written by Paul Albrecht at MIT. */ diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/app/README wfdb-10.3.16/app/README --- wfdb-10.3.15/app/README 2002-10-26 12:00:45.000000000 -0400 +++ wfdb-10.3.16/app/README 2005-06-08 17:27:10.000000000 -0400 @@ -1,9 +1,9 @@ file: README G. Moody 1 June 1989 - Last revised: 26 October 2002 + Last revised: 8 June 2005 ------------------------------------------------------------------------------- WFDB applications: programs for working with annotated signals -Copyright (C) 2002 George B. Moody +Copyright (C) 1989-2005 George B. Moody These programs are free software; you can redistribute them and/or modify them under the terms of the GNU General Public License as published by the @@ -25,17 +25,16 @@ _______________________________________________________________________________ This directory contains sources for the standard applications which come -with the ECG WFDB software package. Before attempting to compile these +with the WFDB software package. Before attempting to compile these programs, build and install the WFDB library (look in the `lib' directory on the same level as this one). -If a `make' utility is available, follow the instructions in the appropriate -`make' description file (see the list below) to compile and install these -applications on your system. If you do not have a `make' utility, you will -have to perform the installation manually; the comments in the `make' files -may be helpful in determining how to proceed. +If a `make' utility is available, follow the instructions in 'Makefile' to +compile and install these applications on your system. If you do not have a +`make' utility, you will have to perform the installation manually; the +comments in 'Makefile' may be helpful in determining how to proceed. -Note that you must set the WFDB environment variable (the database path) before +You may wish to set the WFDB environment variable (the database path) before using these applications. Select and customize the appropriate script for doing so from among the templates listed below. @@ -51,8 +50,6 @@ Makefile `make' description file for compiling these applications using ANSI/ISO standard C compilers on supported platforms -Makefile.dos `make' description file for compiling these applications using - unsupported compilers from Borland, Microsoft, etc. Makefile.top Used by ../configure to construct Makefile (comments only) Makefile.tpl Used by ../configure to construct Makefile (portable section) README this file @@ -81,10 +78,7 @@ rr2ann.c Converts an RR interval series into an annotation file rxr.c AAMI-standard run-by-run annotation comparator sampfreq.c Prints the sampling frequency of a record -sample.c Digitizes and replays analog signals (MS-DOS only) -sample8.hea Example header file with DAP program for use with `sample' setwfdb Template for Bourne/bash shell WFDB path initialization script -setwfdb.bat Template for MS-DOS WFDB path initialization sigamp.c Measures signal amplitudes skewedit.c Rewrites header files to correct for measured inter-signal skew snip.c Copies an excerpt of a database record @@ -95,15 +89,12 @@ sumstats.c Derives aggregate statistics from `bxb', `rxr', etc. output tach.c Generates a uniformly sampled heart rate signal from an annotation file -view.c ECG database browser for MS-DOS (using Microsoft C graphics) -vsetup.c CRT calibration program for use with `view' (MS-DOS only) wfdbcat.c Copies a WFDB file to standard output wfdbcollate.c Collates multiple WFDB records into a multi-segment record wfdbdesc.c Describes signals based on header file contents wfdbwhich.c Finds a WFDB file and prints its pathname wrann.c Creates an annotation file from `rdann' output wrsamp.c Creates signal and header files by converting text input -wvscript.c Starts wview using specifications in a .xws file (Windows only) xform.c Sampling frequency, amplitude, and format converter What next? @@ -121,8 +112,8 @@ level as this one. Finally, you may also wish to compile the example programs from chapter 6 of -the ECG Database Programmer's Guide, which can be found in the `examples' -directory on the same level as this one. +the WFDB Programmer's Guide, which can be found in the `examples' directory on +the same level as this one. See the `README' files in the `psd', `convert', and `examples' directories for further information. diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/app/sample8.hea wfdb-10.3.16/app/sample8.hea --- wfdb-10.3.15/app/sample8.hea 2000-01-30 04:13:16.000000000 -0500 +++ wfdb-10.3.16/app/sample8.hea 1969-12-31 19:00:00.000000000 -0500 @@ -1,86 +0,0 @@ -# file: sample8.hea G. Moody 15 February 1991 -# Last revised: 3 May 1999 - -# ----------------------------------------------------------------------------- -# sample8.hea: Example header file with DAP program for use with `sample' -# Copyright (C) 1999 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/). -# _____________________________________________________________________________ - -# This file is provided as an example of a moderately complex DAP program for -# use with the program `sample'. The DAP program is embedded in the `info' -# strings at the end of this header file. - -# Use this file with `sample' to digitize 8 signals (from the differential -# inputs) played back at twice real time. The signals are sampled at twice -# the desired rate and decimated within the DAP's on-board DSP. - -# This version uses the external clock and samples at 360 Hz per signal (1/32 -# of the external clock frequency). The external clock must be set to 11520 -# Hz. To use the internal clock, remove the line containing the statement -# #>clock external -# If you do so, sampling will be at 86.8 microsecond intervals, yielding a -# sampling frequency of 360.023 Hz per signal, relative to real time. - -# Sample using this file by: -# sample -o sample8 -n NEW -t TIME -x 2 -# where NEW is the name for the record to be created, and TIME is the length -# of the new record (e.g., "2:0:0"). - -sample8 8 360 -test.dat 212 1000 12 0 0 0 0 zero -test.dat 212 1000 12 0 0 0 0 one -test.dat 212 1000 12 0 0 0 0 two -test.dat 212 1000 12 0 0 0 0 three -test.dat 212 1000 12 0 0 0 0 four -test.dat 212 1000 12 0 0 0 0 five -test.dat 212 1000 12 0 0 0 0 six -test.dat 212 1000 12 0 0 0 0 seven -#>; start a,b -#>reset -#>pipes p0,p1,p2,p3,p4,p5,p6,p7 -#>; lowpass taps=63 cutoff=15.3% window=Blackman -#>vector lp = (0,0,1,3,4,-2,-14,-20,-3,34,58,27,-58,-130,-94,70,246,239,-33 -#> -401,-508,-118,579,976,511,-746,-1869,-1566,866,4819,8508,10012,8508,4819 -#> 866,-1566,-1869,-746,511,976,579,-118,-508,-401,-33,239,246,70,-94,-130 -#> -58,27,58,34,-3,-20,-14,-2,4,3,1,0,0) -#>idef a 8 -#>clock external -#>set 0 d0 -#>set 1 d1 -#>set 2 d2 -#>set 3 d3 -#>set 4 d4 -#>set 5 d5 -#>set 6 d6 -#>set 7 d7 -#>time 86.8 -#>filter(0,lp,p0,2) -#>filter(1,lp,p1,2) -#>filter(2,lp,p2,2) -#>filter(3,lp,p3,2) -#>filter(4,lp,p4,2) -#>filter(5,lp,p5,2) -#>filter(6,lp,p6,2) -#>filter(7,lp,p7,2) -#>end -#>pdef b -#>merge(p0,p1,p2,p3,p4,p5,p6,p7,$binout) -#>end diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/app/sample.c wfdb-10.3.16/app/sample.c --- wfdb-10.3.15/app/sample.c 2002-11-30 12:59:56.000000000 -0500 +++ wfdb-10.3.16/app/sample.c 1969-12-31 19:00:00.000000000 -0500 @@ -1,1386 +0,0 @@ -/* file: sample.c G. Moody 10 January 1991 - Last revised: 30 November 2002 - -------------------------------------------------------------------------------- -sample: digitize or play back signals on a PC using a Microstar DAP board -Copyright (C) 1999 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/). -_______________________________________________________________________________ - -`sample' generates database records from analog signals, and generates -analog signals from database records. - -`sample' runs under MS-DOS on an ISA-bus (AT-bus) system that contains a -Microstar DAP 1200 or 2400 series board (available from Microstar -Laboratories, http://www.mstarlabs.com/). - -To compile `sample' successfully, you will need Microsoft C, version 5.0 or -later, or Turbo C/C++, and four files supplied by Microstar with all versions -of the DAP 1200 and 2400 (Microstar's Advanced Development Toolkit is *not* -required in order to compile or use this program). These files are `c_lib.c', -`clock.h', and `ioutil.h', which should be installed in a directory searched -by your compiler for `#include <...>' files such as `stdio.h'; and -`cdapl.lib', which should be installed in a directory searched by your -compiler's linker for libraries such as `wfdb.lib'. (If you are using Microsoft -C, copy `cdapl5.lib' from the Microstar distribution diskettes into your -library directory and rename it `cdapl.lib'.) - -If you have not already done so, you must also compile and install a -large memory model version of the WFDB library (see `makefile.dos' in the -`lib' directory). Although the program compiles and links successfully using -the small memory model and Microstar's `cdaps5.lib', there is apparently a bug -in `cdaps5.lib' that wedges the DAP (a condition that can be remedied only -by power-cycling the system). - -Compile this program using Microsoft C with the command: - cl -Ox -Ml sample.c -link wfdbl cdapl -or using Turbo C/C++ with the command: - tcc -O -A -ml sample.c wfdbl.lib cdapl.lib -or using Borland C/C++ with the command: - bcc -O -A -ml sample.c wfdbl.lib cdapl.lib - -Note that you may need to use `-I' and `-L' options to instruct your compiler -where to find `#include' files and libraries; see your compiler manual for -further information. The symbols DAPINPUTS, DAPOUTPUTS, and DBUFSIZE -may be redefined using command-line `-D' options with any of these compilers. -If you compile using Microsoft C/C++ 7.0 (or later) with the `-Za' (ANSI C) -option, add `oldnames' as a final command-line argument, to link a library -containing aliases for functions such as open(), which have been renamed in -the standard MSC 7.0 library to conform with ANSI namespace rules. - -Refer to `../doc/wag-src/sample.1' for further information. */ - -#include -#include - -#ifdef __STDC__ -/* True for ANSI C. Definitions in this section work around gratuitous -deletions of universally available functions and macros that have not been -blessed by the ANSI C standard. */ - -#if _MSC_VER >= 700 -/* For Microsoft C/C++ version 7.0 with the -Za option. */ -#define O_BINARY _O_BINARY -#define O_RDONLY _O_RDONLY -#define O_WRONLY _O_WRONLY -#endif - -#ifdef __TURBOC__ -/* For Turbo C/C++ with the -A option. The definition below is equivalent to -the one in stdio.h that is censored in ANSI C mode. */ -#ifndef fileno -#define fileno(file) ((file)->fd) -#endif -#endif -#endif - -#include -/* `c_lib.c' is supplied by Microstar; it contains nested `#include's of - `clock.h' and `ioutil.h', also supplied by Microstar. */ -#include - -/* Constants. Any of these definitions may be overridden by command-line -definitions (using the `-D' option) if desired. */ -#ifndef DAPINPUTS -# define DAPINPUTS (16) /* number of single-ended analog inputs */ -#endif - -#ifndef DAPOUTPUTS -# define DAPOUTPUTS (2) /* number of analog outputs */ -#endif - -#ifndef DBUFSIZE -# define DBUFSIZE (10240) /* default size for sample buffer, in bytes */ -#endif - -static char answer[32]; /* buffer for user's typed responses */ -static char chanspec[WFDB_MAXSIG][5];/* DAP channel specifications for each - signal */ -static double clockfreq; /* DAP basic clock frequency in Hz */ -static int dap2400; /* 0: using DAP 1200, 1: using DAP 2400 */ -static char *daptype = "check"; /* DAP model (see set_params(), below) */ -static double daplversion = 3.3;/* DAPL version number (can be determined by - set_params(); the default is given here) */ -static double freq = 0.0; /* sampling frequency for record to be - digitized or played back, in samples per - signal per second of the original analog - signal */ -static char *from; /* if not NULL, string representing starting - time for playback operation */ -static double maxfreq, minfreq; /* maximum and minimum aggregate sampling - frequencies obtainable */ -static long nsamp; /* number of samples (per signal) to be - digitized or played back; if zero, I/O - continues until stopped by key command */ -static int nsig; /* number of signals to be digitized */ -static int nosig = DAPOUTPUTS; /* number of signals to be played back */ -static char nrec[8]; /* name to be used for output record */ -static int pflag; /* 1: play back, -1: generate DAPL code for - playback, 0: do neither of the above */ -static char *pname; /* name of this program, extracted from - argv[0] */ -static double rate = -1.0; /* presentation rate relative to the original - analog signal */ -static char record[WFDB_MAXRNL+1];/* record name of header file to be read */ -static int rflag; /* if non-zero, use `raw' format I/O */ -static WFDB_Siginfo s[WFDB_MAXSIG];/* WFDB information structures for signals - to be read or written */ -static int sflag = 1; /* 1: digitize, -1: generate DAPL code for - digitizing, 0: do neither of the above */ -static long ticks; /* number of DAP clock ticks per sampling - interval */ -static int vmax[WFDB_MAXSIG]; /* highest sample values expected/observed */ -static int vmin[WFDB_MAXSIG]; /* lowest sample values expected/observed */ -static int xclock; /* if non-zero, use external clock */ -static char *timecmd; /* printf format string for printing the - argument of the DAP `time' command */ -static char *to; /* if not NULL, string representing the ending - time for digitization or playback */ - -void adinit(), adget(), adbget(), adquit(), dainit(), daput(), daquit(), - playback(), sample(), finish_sample(), get_dapl_program(); - -main(argc, argv) -int argc; -char *argv[]; -{ - char chantype, *p; - int channel, i; - double fmin, fmax, ofreq; - static char directory[32]; /* signal file name prefix */ - static char filename[WFDB_MAXSIG][32]; /* signal file names */ - static char description[WFDB_MAXSIG][32];/* signal descriptions */ - static char units[WFDB_MAXSIG][22]; /* signal units */ - - /* Read the command line. */ - init(argc, argv); - - /* Set buffer sizes. */ - setibsize(DBUFSIZE); - setobsize(DBUFSIZE); - - /* Initialize sample value limit arrays. */ - for (i = 0; i < WFDB_MAXSIG; i++) { - vmax[i] = 2040; - vmin[i] = -2040; - } - - /* Get and validate the output record name. */ - while (sflag && (nrec[0] == '\0' || newheader(nrec) < 0)) { - fprintf(stderr, "Choose a record name (up to 6 characters): "); - fgets(nrec, 8, stdin); nrec[strlen(nrec)-1] = '\0'; - } - - /* Get and validate the presentation rate. */ - if (rate < 0.) { - if (sflag) { - fprintf(stderr, - "\nThe presentation rate for live (not previously recorded)\n"); - fprintf(stderr, - "signals is 1. For recorded signals, the presentation rate\n"); - fprintf(stderr, - "is the quotient of the playback speed and the recording\n"); - fprintf(stderr, "speed (often greater than 1).\n"); - } - else { - fprintf(stderr, - "The presentation rate specifies the playback speed relative\n"); - fprintf(stderr, - "to real time for the original analog signals.\n"); - } - do { - fprintf(stderr, "Presentation rate (> 0) [1]: "); - fgets(answer, 32, stdin); - if (answer[0] == '\n') rate = 1.0; - else sscanf(answer, "%lf", &rate); - } while (rate <= 0.0); - fprintf(stderr, "\n"); - } - - /* If a prototype header was supplied with -o, read its signal - specifications. */ - if (sflag && record[0] != '\0') { - char *fmt, *dp; - - nsig = (DAPINPUTS < WFDB_MAXSIG) ? DAPINPUTS : WFDB_MAXSIG; - if ((nsig = isigopen(record, s, -nsig)) < 0) exit(1); - if (nsig == 0) { - fprintf(stderr, - "%s: header for record %s contains no signal specifications\n", - pname, record); - exit(1); - } - freq = sampfreq(record); - ticks = (long)(clockfreq/(freq*rate*nsig) + 0.5); - if (to) nsamp = strtim(to); - else nsamp = s[0].nsamp; - fmt = (nsig <= DAPINPUTS/2) ? "D%d" : "S%d"; - for (dp = s[0].fname + strlen(s[0].fname) - 1; dp > s[0].fname; dp--) - if (*dp == '/' || *dp == ':' || *dp == '\\') - break; - if (s[0].fname < dp && dp <= s[0].fname + 30) - strncpy(directory, s[0].fname, dp - s[0].fname + 1); - if (s[0].fmt == 16 && s[0].adcres == 16) - rflag = 1; - if (rflag || nsig < 2 || s[1].group == 0) - sprintf(filename[0], "%s%s.dat", directory, nrec); - for (i = 0; i < nsig; i++) { - sprintf(chanspec[i], fmt, i); - if (rflag || nsig < 2 || s[1].group == 0) { - s[i].fname = filename[0]; - s[i].group = 0; - s[i].fmt = s[0].fmt; - s[i].bsize = s[0].bsize; - } - else { - sprintf(filename[i], "%s%s.d%02d", directory, nrec, i); - s[i].fname = filename[i]; - s[i].group = i; - } - } - } - - /* Otherwise, if a header of an existing record was supplied with -i, read - its signal specifications. */ - else if (pflag && record[0] != '\0') { - long t0 = 0L, t1 = 0L; - - if ((nsig = isigopen(record, s, WFDB_MAXSIG)) < 0) exit(1); - if (nsig == 0) { - fprintf(stderr, - "%s: header for record %s contains no signal specifications\n", - pname, record); - exit(1); - } - if (nosig > nsig) nosig = nsig; - - freq = sampfreq(record); - ticks = (long)(clockfreq/(freq*rate*nosig) + 0.5); - if (from) { - t0 = strtim(from); - if (t0 < 0L) t0 = -t0; - if (isigsettime(t0) < 0) exit(1); - } - if (to) { - t1 = strtim(to); - if (t1 < 0L) t1 = -t1; - else if (t1 == 0L) t1 = s[0].nsamp; - } - if (t1 > 0L) { - if (t1 <= t0) { - fprintf(stderr, - "%s: `to' time must be later than `from' time\n", - pname); - exit(1); - } - nsamp = t1 - t0; - } - else { - nsamp = s[0].nsamp; - if (nsamp > t0) nsamp -= t0; - else if (nsamp > 0L && t0 >= nsamp) { - fprintf(stderr, - "%s: `from' time must precede the end of the record\n", - pname); - exit(1); - } - } - if (s[0].fmt == 16 && s[0].adcres == 16 && - s[nosig-1].group == s[0].group) - rflag = 1; - - for (i = 0; i < nosig; i++) - sprintf(chanspec[i], "A%d", i); - } - - /* Otherwise, get sampling specifications interactively. */ - else { - do { - fprintf(stderr, "Number of signals to be recorded (1-%d) [1]: ", - WFDB_MAXSIG); - fgets(answer, 32, stdin); - if (answer[0] == '\n') nsig = 1; - else sscanf(answer, "%d", &nsig); - } while (nsig < 1 || nsig > WFDB_MAXSIG); - fprintf(stderr, "\n"); - - fmin = minfreq/(rate*nsig); - fmax = maxfreq/(rate*nsig); - freq = (WFDB_DEFFREQ < fmax) ? WFDB_DEFFREQ : fmax; - - if (rate != 1.0) { - fprintf(stderr, - "The sampling frequency is defined relative to real\n"); - fprintf(stderr, - "time for the original signal%s signal will be\n", - nsig > 1 ? "s. Each" : ". The"); - fprintf(stderr, - "sampled at %g (the presentation rate) times the\n", rate); - fprintf(stderr, "sampling frequency that you specify.\n"); - } - do { - fprintf(stderr, - "Sampling frequency (Hz per signal, %g - %g) [%g]: ", - fmin, fmax, freq); - fgets(answer, 32, stdin); - if (answer[0] != '\n') sscanf(answer, "%lf", &freq); - if (fmin <= freq && freq <= fmax) { - ticks = (long)(clockfreq/(freq*rate*nsig) + 0.5); - fprintf(stderr, - "Using the on-board timer, %s signal can be sampled at", - nsig > 1 ? "each" : "the"); - fprintf(stderr, " %g Hz.\n", - ofreq = clockfreq/(rate*nsig*ticks)); - if (dap2400) { - fprintf(stderr, - "Alternatively, %s signal can be sampled at %g Hz\n", - nsig > 1 ? "each" : "the", freq); - fprintf(stderr, - "using an external clock at %g * %g * %d (= %g) Hz.\n", - freq, rate, nsig, freq*rate*nsig); - fprintf(stderr, - "Do you prefer to use an external clock at %g Hz (y/n)? [n]: ", - freq*rate*nsig); - fgets(answer, 32, stdin); - if (answer[0] == 'y' || answer[0] == 'Y') { - xclock = 1; - continue; - } - } - if (!xclock && freq != ofreq) { - fprintf(stderr, - "Is the frequency of %g Hz acceptable (y/n)? [y]: ", - ofreq); - fgets(answer, 32, stdin); - if (answer[0] != 'n' && answer[0] != 'N') - freq = ofreq; - else - freq = -1.0; - } - } - } while (freq < fmin || freq > fmax || setsampfreq(freq) < 0); - fprintf(stderr, "\n"); - - fprintf(stderr, "Specify the length of the record to be sampled\n"); - if (rate != 1.0) - fprintf(stderr, - "(in terms of real time for the original signals)\n"); - fprintf(stderr, - "or press ENTER if sampling is to be stopped by keyboard\n"); - fprintf(stderr, - "input after an indefinite period.\n"); - do { - fprintf(stderr, "Length of record (H:M:S): "); - fgets(answer, 32, stdin); - } while (answer[0] != '\n' && (nsamp = strtim(answer)) < 1L); - if (answer[0] == '\n') nsamp = 0L; - fprintf(stderr, "\n"); - - fprintf(stderr, "These signal file formats are supported:\n"); - fprintf(stderr, " 8 (8-bit first differences)\n"); - fprintf(stderr, "212 (12-bit amplitudes, bit-packed in pairs)\n"); - fprintf(stderr," 16 (12-bit amplitudes, sign-extended to 16 bits)\n"); - fprintf(stderr, "raw (12-bit samples in DAP format 16-bit words)\n"); - rflag = (freq*rate*nsig > 20000.0) ? 1 : 0; - do { - fprintf(stderr, "Select a format (8/212/16/raw) [%s]: ", - rflag ? "raw" : "16"); - fgets(answer, 32, stdin); - if (answer[0] == '\n') s[0].fmt = 16; - else if (strncmp(answer, "raw", 3) == 0) { - s[0].fmt = 16; - rflag = 1; - } - else s[0].fmt = atoi(answer); - } while (s[0].fmt != 16 && s[0].fmt != 212 && s[0].fmt != 8); - fprintf(stderr, "\n"); - - if (nsamp > 0L) { - long nb; - - switch (s[0].fmt) { - case 8: nb = nsamp * (long)nsig; break; - case 212: nb = nsamp * (long)nsig * 1.5 + 0.5; break; - case 16: nb = nsamp * (long)nsig * 2L; break; - } - fprintf(stderr, - "The sampled signal%s will require %ld bytes.\n", - nsig > 1 ? "s" : "", nb); - } - fprintf(stderr, - "To specify the directory in which signal files are\n"); - fprintf(stderr, - "to be written, type its name (with drive specification\n"); - fprintf(stderr, - "if necessary, up to 30 characters), or press ENTER to\n"); - fprintf(stderr, - "use the current directory.\n"); - fprintf(stderr, - "Directory for signal files: "); - fgets(directory, 31, stdin); - fprintf(stderr, "\n"); - - /* Stamp out ugly MS-DOS `\' separators! (Actually, this *does* serve - a purpose: since the UNIX `/' separators are understandable to both - MS-DOS and UNIX versions of the WFDB library, this permits the - header file to be used on UNIX without modification, provided that - the directory structure is maintained.) */ - for (p = directory; *p != '\n'; p++) - if (*p =='\\') *p = '/'; - if (p > directory && *(p-1) != '/' && *(p-1) != ':') - *p++ = '/'; - *p = '\0'; - - if (nsig > 1 && !rflag) { - fprintf(stderr, "Save all signals in one file (y/n)? [y]: "); - fgets(answer, 32, stdin); - fprintf(stderr, "\n"); - } - if (nsig < 2 || rflag || (answer[0] != 'n' && answer[0] != 'N')) { - sprintf(filename[0], "%s%s.dat", directory, nrec); - for (i = 0; i < nsig; i++) { - s[i].fname = filename[0]; - s[i].group = 0; - } - } - else { - for (i = 0; i < nsig; i++) { - sprintf(filename[i], "%s%s.d%02d", directory, nrec, i); - s[i].fname = filename[i]; - s[i].group = i; - } - } - - fprintf(stderr, "For each signal to be digitized, specify:\n"); - fprintf(stderr, " - the input channel (one of `D0' through `D%d',\n", - DAPINPUTS/2 - 1); - fprintf(stderr," `S0' through `S%d', `B', or `G')\n", DAPINPUTS - 1); - fprintf(stderr, " - a description (up to 30 characters)\n"); - fprintf(stderr, " - the physical units (up to 20 characters)\n"); - fprintf(stderr, " - the gain in adu/physical unit (0 if the signal\n"); - fprintf(stderr, " is uncalibrated)\n"); - chantype = (nsig > DAPINPUTS/2) ? 'S' : 'D'; - s[0].gain = 0.0; - for (i = 0; i < nsig; i++) { - s[i].fmt = s[0].fmt; - s[i].adcres = rflag ? 16: 12; - s[i].adczero = s[i].bsize = 0; - do { - fprintf(stderr, "Signal %d input channel [%c%d]: ", - i, chantype, channel = i); - fgets(answer, 32, stdin); - if (answer[0] != '\n') - sscanf(answer, "%c%d", &chantype, &channel); - switch (chantype) { - case 'b': /* binary (digital) inputs */ - case 'B': - sprintf(chanspec[i], "B"); - /* This doesn't allow for the possibility that a digital - expansion board has been installed; if so, it would - be necessary to add a digit (0-3) to specify which - set of 16 digital inputs are to be read. */ - chantype = 'D'; /* assume next input is differential */ - break; - case 'd': - chantype = 'D'; - case 'D': /* differential input */ - if (0 <= channel && channel <= DAPINPUTS/2 - 1) - sprintf(chanspec[i], "D%d", channel); - else - channel = -1; - break; - case 'g': - case 'G': /* ground */ - sprintf(chanspec[i], "G"); - chantype = 'S'; /* assume next signal single-ended */ - break; - case 's': /* single-ended input */ - chantype = 'S'; - case 'S': - if (0 <= channel && channel <= DAPINPUTS - 1) - sprintf(chanspec[i], "S%d", channel); - else - channel = -1; - break; - default: - chantype = 'D'; - channel = -1; - break; - } - } while (channel < 0); - fprintf(stderr, "Signal %d description [none]: ",i); - fgets(description[i], 32, stdin); - description[i][strlen(description[i])-1] = '\0'; - s[i].desc = description[i]; - fprintf(stderr, "Signal %d units [%s]: ", i, - (i > 0) ? s[i-1].units : "mV"); - fgets(units[i], 20, stdin); - if (units[i][0] == '\n') s[i].units = "mV"; - else - for (p = s[i].units = units[i]; *p; p++) { - if (*p == ' ' || *p == '\t') *p = '_'; - else if (*p == '\n') { *p = '\0'; break; } - } - if (i > 0) s[i].gain = s[i-1].gain; - fprintf(stderr, "Signal %d gain (adu/%s) [%g]: ", - i, s[i].units, s[i].gain); - fgets(answer, 32, stdin); - if (answer[0] != '\n') - sscanf(answer, "%lf", &s[i].gain); - } - fprintf(stderr, "\n"); - } - - get_dapl_program(); - - /* Adjust number of samples and frequency to account for finite resolution - of internal clock. Note that the adjustment of nsamp is appropriate - if the duration was specified in time units, but may not be so if the - the duration was specified directly as a number of samples. */ - if (!pflag && !xclock && freq != clockfreq/(rate*nsig*ticks)) { - char ttime[20]; - - strcpy(ttime, mstimstr(nsamp)); - freq = clockfreq/(rate*nsig*ticks); - setsampfreq(0.0); /* avoid error message from next setsampfreq */ - setsampfreq(freq); - nsamp = strtim(ttime); - } - - if (pflag == 1) - playback(); - else if (sflag == 1) - sample(); - else - finish_sample(); - exit(0); -} - -static int cpr = 1; /* compression ratio (number of samples - read/number of samples written) */ -static FILE *dapfile; /* if not NULL, DAPL program file pointer */ -static char *dapfname; /* if not NULL, name of DAPL program file */ -static int iflag = 1; /* if non-zero, prompt to begin digitization - or playback */ - -init(argc, argv) -int argc; -char *argv[]; -{ - int i; - - /* Extract the name of this program from argv[0]. */ - for (pname = argv[0] + strlen(argv[0]) - 1; pname > argv[0]; pname--) { - if (*pname == '.') *pname = '\0'; - else if ('A' <= *pname && *pname <= 'Z') *pname += 'a' - 'A'; - else if (*pname == '\\' || *pname == ':') { - pname++; - break; - } - } - - /* Read and interpret command-line arguments. */ - for (i = 1; i < argc; i++) { - if (*argv[i] == '-') switch (*(argv[i]+1)) { - case '1': /* single-channel playback */ - nosig = 1; - break; - case 'b': /* batch mode */ - iflag = 0; - break; - case 'd': /* device type follows */ - if (++i >= argc) { - fprintf(stderr, "%s: device type must follow -d\n", pname); - exit(1); - } - daptype = argv[i]; - break; - case 'f': /* start time follows */ - if (++i >= argc) { - fprintf(stderr, "%s: start time must follow -f\n", pname); - exit(1); - } - from = argv[i]; - break; - case 'h': /* help requested */ - fprintf(stderr, "usage: %s [ options ]\n", pname); - fprintf(stderr, "options:\n"); - fprintf(stderr, " -b\t\tbatch mode\n"); - fprintf(stderr, - " -d TYPE\tspecify device type (-d help for list)\n"); - fprintf(stderr, " -f TIME\tbegin at TIME (only with -i)\n"); - fprintf(stderr, " -h\t\tprint (this) help\n"); - fprintf(stderr, - " -i RECORD\tplay back RECORD (not with -n, -N, -o)\n"); - fprintf(stderr, - " -n RECORD\tcreate RECORD (signals and header)\n"); - fprintf(stderr, " -N RECORD\tcreate header (only) for RECORD\n"); - fprintf(stderr, - " -o RECORD\tdigitize using specs from existing RECORD header\n"); - fprintf(stderr, " -p FILE\tuse the DAPL program in FILE\n"); - fprintf(stderr, - " -s N\t\trecord or play back 1 of every N samples\n"); - fprintf(stderr, " -t TIME\tstop at TIME\n"); - fprintf(stderr, - " -x N\t\toperate at N times real time (not with -p)\n"); - fprintf(stderr, " -1\t\tsingle-channel playback mode (with -i)\n"); - fprintf(stderr, - "Type `%s' without any options to enter specifications\n", - pname); - fprintf(stderr, - "interactively.\n"); - exit(1); - case 'i': /* name of record to be played back follows */ - if (++i >= argc) { - fprintf(stderr, "%s: record name must follow -i\n", pname); - exit(1); - } - strncpy(record, argv[i], 7); - pflag = 1; sflag = 0; - break; - case 'n': /* name of record to be created follows */ - if (++i >= argc) { - fprintf(stderr, "%s: record name must follow -n\n", pname); - exit(1); - } - strncpy(nrec, argv[i], 7); - break; - case 'N': /* name of prototype header to be written follows */ - if (++i >= argc) { - fprintf(stderr, "%s: record name must follow -N\n", pname); - exit(1); - } - strncpy(nrec, argv[i], 7); - sflag = -1; - break; - case 'o': /* name of prototype header to be read follows */ - if (++i >= argc) { - fprintf(stderr, "%s: record name must follow -o\n", pname); - exit(1); - } - strncpy(record, argv[i], 7); - break; - case 'p': /* name of DAPL program file follows */ - if (++i >= argc) { - fprintf(stderr, "%s: name of DAPL file must follow -p\n", - pname); - exit(1); - } - dapfname = argv[i]; - break; - case 's': /* compression ratio follows */ - if (++i >= argc) { - fprintf(stderr, "%s: compression ratio must follow -s\n", - pname); - exit(1); - } - cpr = atoi(argv[i]); - if (cpr < 1) cpr = 1; - break; - case 't': /* stop time follows */ - if (++i >= argc) { - fprintf(stderr, "%s: stop time must follow -t\n", pname); - exit(1); - } - to = argv[i]; - break; - case 'x': /* presentation rate follows */ - if (++i >= argc) { - fprintf(stderr, "%s: presentation rate must follow -x\n", - pname); - exit(1); - } - rate = (double)atof(argv[i]); - break; - default: - fprintf(stderr, "%s: unrecognized option %s\n", pname, argv[i]); - exit(1); - } - else { - fprintf(stderr, "%s: unrecognized argument %s\n", pname, argv[i]); - exit(1); - } - } - - /* Set device-dependent parameters. */ - if (set_params() == 0) - exit(1); - - if (dapfname && (dapfile = fopen(dapfname, "rt")) == NULL) { - fprintf(stderr, "%s: can't open DAPL program file %s\n", pname, - dapfname); - exit(1); - } -} - -/* Root and pointer to singly-linked list of DAPL instructions. */ -struct dapline { - char *pline; - struct dapline *next; -} dapl0, *dp = &dapl0; - -/* Add a DAPL line to the instruction list. */ -save_dapl_line(s) -char *s; -{ - if (dp->pline = malloc(strlen(s)+1)) { - strcpy(dp->pline, s); - if (dp->next = malloc(sizeof(struct dapline))) { - dp = dp->next; - dp->pline = NULL; - dp->next = NULL; - } - } -} - -/* Construct the DAPL instruction list, either from a DAPL program file, - the info strings of the header, or from scratch. */ -void get_dapl_program() -{ - static char buf[80], *p; - int i; - - if (dapfile) { - if (fgets(buf, 80, dapfile)) { - if (strncmp("; start ", buf, 8)) - save_dapl_line("; start a"); - } - do { - buf[strlen(buf)-1] = '\0'; /* strip off newline */ - if (strcmp(buf, "clock external") == 0) xclock = 1; - save_dapl_line(buf); - } while (fgets(buf, 80, dapfile)); - fclose(dapfile); - } - if (dp == &dapl0 && record[0] != '\0') { - setsampfreq(0.0); - if (sflag) { - if (p = getinfo(record)) - do { - if (*p == '>') { - if (dp == &dapl0 && strncmp("; start ", p+1, 8)) - save_dapl_line("; start a"); - if (strcmp(p+1, "clock external") == 0) xclock = 1; - save_dapl_line(p+1); - } - } while (getinfo(NULL)); - } - else { - if (p = getinfo(record)) - do { - if (*p == '<') { - if (dp == &dapl0 && strncmp("; start ", p+1, 8)) - save_dapl_line("; start a"); - if (strcmp(p+1, "clock external") == 0) xclock = 1; - save_dapl_line(p+1); - } - } while (getinfo(NULL)); - } - setsampfreq(freq); - } - if (dp == &dapl0) { - if (sflag) { - save_dapl_line("; start a"); - save_dapl_line("reset"); - sprintf(buf, "idef a %d", nsig); - save_dapl_line(buf); - if (xclock) - save_dapl_line("clock external"); - for (i = 0; i < nsig; i++) { - sprintf(buf, "set %d %s", i, chanspec[i]); - save_dapl_line(buf); - } - sprintf(buf, timecmd, ticks*1.0e6/clockfreq); - save_dapl_line(buf); - save_dapl_line("bprint"); - save_dapl_line("end"); - } - else { /* generate DAPL for playback */ - if (!dap2400) { - fprintf(stderr, - "%s: can't generate playback program for DAP 1200\n", - pname); - exit(1); - } - if (nosig > 1 && daplversion < 3.3) { - fprintf(stderr, - "%s: can't generate multichannel playback program for DAPL version %g\n", - pname, daplversion); - fprintf(stderr, "(DAPL version 3.3 or later needed)\n"); - exit(1); - } - if (nosig == 1) - save_dapl_line("; start a"); - else - save_dapl_line("; start a,b"); - save_dapl_line("reset"); - if (nosig == 1) { - save_dapl_line("odef a 1"); - save_dapl_line("set 0 A0"); - } - else { - for (i = 0; i < nosig; i++) { - sprintf(buf, "pipe p%d", i); - save_dapl_line(buf); - } - save_dapl_line("pdef a"); - sprintf(buf, "separate($binin,p0,p1"); - for (i = 2; i < nosig; i++) { - char buf2[6]; - sprintf(buf2, ",p%d", i); - strcat(buf, buf2); - } - strcat(buf, ")"); - save_dapl_line(buf); - save_dapl_line("end"); - sprintf(buf, "odef b %d", nosig); - save_dapl_line(buf); - if (xclock) save_dapl_line("clock external"); - for (i = 0; i < nosig; i++) { - sprintf(buf, "set %d A%d", i, i); - save_dapl_line(buf); - } - } - sprintf(buf, timecmd, ticks*1.0e6/clockfreq); - save_dapl_line(buf); - if (nosig == 1) - save_dapl_line("direct($binin,0)"); - else { - for (i = 0; i < nosig; i++) { - sprintf(buf, "direct(p%d,%d)", i, i); - save_dapl_line(buf); - } - } - save_dapl_line("end"); - } - } -} - -/* Save the current DAPL program as info strings in the new header file. */ -void put_dapl_program() -{ - char buf[81]; - - if (sflag) buf[0] = '>'; - else buf[0] = '<'; - for (dp = &dapl0; dp->pline; dp = dp->next) { - strncpy(buf+1, dp->pline, 80); - putinfo(buf); - } -} - -int dapofile; - -void playback() -{ - char *p, *vbuf, *ve; - int ifile, n, v[WFDB_MAXSIG]; - long t = 0L, tt = 0L, start_time, end_time; - unsigned r_interval; - - /* Arrange for progress reports about once per second of elapsed time. */ - r_interval = rflag ? DBUFSIZE : (unsigned)strtim("1"); - if (nsamp > 0L && r_interval > nsamp) r_interval = (unsigned)nsamp; - - if ((dapofile = open("ACCEL1", O_WRONLY | O_BINARY)) == -1) { - fprintf(stderr, "%s: can't open ACCEL1\n", pname); - exit(1); - } - binary(dapofile); - - /* If using raw mode, close and reopen the signal file. */ - if (rflag) { - wfdbquit(); - setsampfreq(freq*nosig); - if ((vbuf = (char *)malloc(2*r_interval)) == NULL) { - fprintf(stderr, "%s: insufficient memory\n", pname); - exit(1); - } - if ((ifile = open(s[0].fname, O_RDONLY | O_BINARY)) == -1) { - fprintf(stderr, "%s: can't read `%s'\n", pname, s[0].fname); - exit(1); - } - } - - if (iflag) { - fprintf(stderr, "To begin playback, press ENTER: "); - fgets(answer, 32, stdin); - } - - if (nsamp) { - dainit(); - time(&start_time); - if (rflag) { - ve = vbuf + 2*r_interval; - while (t < nsamp) { - /* Fill the buffer with samples from the signal file. */ - for (p = vbuf; p < ve && (n = read(ifile,p,ve-p)) > 0; p += n) - ; - if (n < 0) { - fprintf(stderr, "\n%s: end of file in `%s'\n", pname, - s[0].fname); - p -= n; - nsamp = t; /* arrange for exit at end of this iteration */ - } - if (write(dapofile, vbuf, (int)(p-vbuf)) < 0) { - fprintf(stderr, "\n%s: error writing samples to DAP\n", - pname); - daquit(); - exit(1); - } - t += r_interval; - fprintf(stderr, "%s\r", timstr(t)); - if (nsamp - t < r_interval) { - r_interval = (unsigned)(nsamp - t); - ve = vbuf + 2*r_interval; - } - } - } - else { - while (t < nsamp) { - if (getvec(v) < nosig) break; - daput(v); - if (++tt >= r_interval) { - t += tt; - fprintf(stderr, "%s\r", timstr(t)); - tt = 0; - if (nsamp - t < r_interval) - r_interval = (unsigned)(nsamp - t); - } - } - } - } - else { - fprintf(stderr, "Press any key to stop playback\n"); - dainit(); - time(&start_time); - if (rflag) { - ve = vbuf + 2*r_interval; - do { - /* Fill the buffer with samples from the signal file. */ - for (p = vbuf; p < ve && (n = read(ifile,p,ve-p)) > 0; p += n) - ; - if (n < 0) { - fprintf(stderr, "\n%s: end of file in `%s'\n", pname, - s[0].fname); - p -= n; - } - if (write(dapofile, vbuf, (int)(p-vbuf)) < 0) { - fprintf(stderr, "\n%s: error writing samples to DAP\n", - pname); - daquit(); - exit(1); - } - t += r_interval; - fprintf(stderr, "%s\r", timstr(t)); - } while (n > 0 && !kbhit()); - } - else { - while (getvec(v) >= nosig) { - daput(v); - if (++tt >= r_interval) { - t += tt; - fprintf(stderr, "%s\r", timstr(t)); - if (kbhit()) break; - tt = 0; - } - } - } - } - /* Under a multitasking OS, it would be better to use something akin - to the UNIX sleep() system call to wait, rather than the busy-waiting - loop below. Under MS-DOS, this doesn't matter; under MS Windows or - DesqView, you may want to try an alternative. Don't just remove the - loop below, however; it's needed to allow the DAP time to finish - its output before turning it off. */ - do { - time(&end_time); - } while ((long)(end_time - start_time) < (long)(t/(freq*rate) + 1)); - daquit(); - - printf("\nElapsed time: %ld seconds\n", (long)(end_time - start_time)); - if (!rflag) - wfdbquit(); -} - -static int bflag; /* if non-zero, use `adbget' to read bipolar - input from DAP 1200 */ - -void sample() -{ - char *p, *vbuf, *ve; - int ifile, n, ofile, v[WFDB_MAXSIG]; - long t = 0L, tt = 0L, start_time, end_time; - unsigned r_interval; - - if (osigfopen(s, nsig) < nsig) exit(1); - - /* Arrange for progress reports about once per second (or once per buffer - if using raw mode). */ - r_interval = rflag ? DBUFSIZE : (unsigned)strtim("1"); - if (nsamp > 0L && r_interval > nsamp) r_interval = (unsigned)nsamp; - - /* If using raw mode, write the header now, then close and reopen the - signal file. */ - if (rflag) { - finish_sample(); - setsampfreq(freq*nsig); - if ((vbuf = (char *)malloc(2*r_interval)) == NULL) { - fprintf(stderr, "%s: insufficient memory\n", pname); - exit(1); - } - if ((ifile = open("ACCEL1", O_RDONLY | O_BINARY)) == -1) { - fprintf(stderr, "%s: can't open ACCEL1\n", pname); - exit(1); - } - binary(ifile); - if ((ofile = open(s[0].fname, O_WRONLY | O_BINARY)) == -1) { - fprintf(stderr, "%s: can't create `%s'\n", pname, s[0].fname); - exit(1); - } - } - - if (iflag) { - fprintf(stderr, "To begin sampling, press ENTER; to specify a\n"); - fprintf(stderr, " start time other than the current time, enter\n"); - fprintf(stderr, " it in H:M:S format before pressing ENTER: "); - fgets(answer, 32, stdin); answer[strlen(answer)-1] = '\0'; - fprintf(stderr, "\n"); - setbasetime(answer); - } - else - setbasetime(""); - - if (nsamp) { - adinit(); - time(&start_time); - if (rflag) { - ve = vbuf + 2*r_interval; - while (t < nsamp) { - /* Fill the buffer with samples from the DAP. */ - for (p = vbuf; p < ve && (n = read(ifile,p,ve-p)) > 0; p += n) - ; - if (n < 0) { - fprintf(stderr, "\n%s: error reading samples from DAP\n", - pname); - adquit(); - exit(1); - } - if (write(ofile, vbuf, (int)(p-vbuf)) < 0) { - fprintf(stderr, "\n%s: write error\n", pname); - adquit(); - exit(1); - } - t += r_interval; - fprintf(stderr, "%s\r", timstr(t)); - if (nsamp - t < r_interval) { - r_interval = (unsigned)(nsamp - t); - ve = vbuf + 2*r_interval; - } - } - } - else if (bflag) { - while (t < nsamp) { - adbget(v); - if (putvec(v) < 0) break; - if (++tt >= r_interval) { - t += tt; - fprintf(stderr, "%s\r", timstr(t)); - tt = 0; - if (nsamp - t < r_interval) - r_interval = (unsigned)(nsamp - t); - } - } - } - else { - while (t < nsamp) { - adget(v); - if (putvec(v) < 0) break; - if (++tt >= r_interval) { - t += tt; - fprintf(stderr, "%s\r", timstr(t)); - tt = 0; - if (nsamp - t < r_interval) - r_interval = (unsigned)(nsamp - t); - } - } - } - } - else { - fprintf(stderr, "Press any key to stop sampling\n"); - adinit(); - time(&start_time); - if (rflag) { - ve = vbuf + 2*r_interval; - do { - /* Fill the buffer with samples from the DAP. */ - for (p = vbuf; p < ve && (n = read(ifile,p,ve-p)) > 0; p += n) - ; - if (n < 0) { - fprintf(stderr, "%s: error reading samples from DAP\n", - pname); - adquit(); - exit(1); - } - if (write(ofile, vbuf, (int)(p-vbuf)) < 0) { - fprintf(stderr, "\n%s: write error\n", pname); - adquit(); - exit(1); - } - t += r_interval; - fprintf(stderr, "%s\r", timstr(t)); - } while (!kbhit()); - } - else if (bflag) { - do { - adbget(v); - if (++tt >= r_interval) { - t += tt; - fprintf(stderr, "%s\r", timstr(t)); - if (kbhit()) break; - tt = 0; - } - } while (putvec(v) >= 0); - } - else { - do { - adget(v); - if (++tt >= r_interval) { - t += tt; - fprintf(stderr, "%s\r", timstr(t)); - if (kbhit()) break; - tt = 0; - } - } while (putvec(v) >= 0); - } - } - time(&end_time); - adquit(); - - printf("\nElapsed time: %ld seconds\n", (long)(end_time - start_time)); - if (rflag) - close(ofile); - else - finish_sample(); -} - -void finish_sample() -{ - if (sflag == -1) - (void)setheader(nrec, s, nsig); - else - (void)newheader(nrec); - put_dapl_program(); - wfdbquit(); -} - -int set_params() -{ - if (strcmp(daptype, "check") == 0) { - char m; - int i, j; - - fprintf(stderr, "Testing DAP ... "); - InitDap(); - fprintf(DapOut, "hello\n"); - fflush(DapOut); - if (fscanf(DapIn, " *** DAPL Interpreter [%lf %c%d/%d]", - &daplversion, &m, &i, &j) < 4) { - fprintf(stderr, "\n%s: DAP does not respond.\n", pname); - exit(1); - } - LeaveDap(); - switch (100*i + j) { - case 102: daptype = "1200/2"; break; - case 103: daptype = "1200/3"; break; - case 104: daptype = "1200/4"; break; - case 204: daptype = "2400/4"; break; - case 205: daptype = "2400/5"; break; - case 206: daptype = "2400/6"; break; - default: fprintf(stderr, "\n%s: unrecognized DAP type %c%d/%d\n", - m, i, j); - exit(1); - } - fprintf(stderr, "\rDAP model %s, DAPL version %g\n", - daptype, daplversion); - } - if (strncmp(daptype, "1200/2", 6) == 0 || - strncmp(daptype, "1200/3", 6) == 0) { - minfreq = 31.25; - maxfreq = 50000.0; - clockfreq = 2.0e6; - timecmd = "time %.1lf"; - if (*(daptype + 6) == 'B') bflag = 1; - } - else if (strncmp(daptype, "1200/4", 6) == 0 || - strcmp(daptype, "2400/4") == 0) { - minfreq = 38.462; - maxfreq = 156250.0; - clockfreq = 2.5e6; - timecmd = "time %.1lf"; - if (*daptype == '2') dap2400 = 1; - else if (*(daptype + 6) == 'B') bflag = 1; - } - else if (strcmp(daptype, "2400/5") == 0 || - strcmp(daptype, "2400/6") == 0) { - minfreq = 62.5; - maxfreq = 235295.0; - clockfreq = 4.0e6; - timecmd = "time %.2lf"; - dap2400 = 1; - } - else { - if (strcmp(daptype, "help")) - fprintf(stderr, - "%s: unrecognized device type %s\n", pname, daptype); - fprintf(stderr, " Recognized types are:\n"); - fprintf(stderr, " 1200/2 1200/2B 2400/4\n"); - fprintf(stderr, " 1200/3 1200/3B 2400/5\n"); - fprintf(stderr, " 1200/4 1200/4B 2400/6\n"); - fprintf(stderr, - " If no `-d' option is given, `sample' determines the"); - fprintf(stderr, " type using the DAPL\n `hello' command.\n"); - return (0); - } - return (1); -} - -void adinit() -{ - InitDap(); - SetInput(DapIn, 1); - FinFlush(DapIn); - SetInput(DapIn, 0); - StartCommands(); - - /* Download the DAPL program. */ - for (dp = dapl0.next; dp->pline; dp = dp->next) { - fputs(dp->pline, DapOut); - fputs("\n", DapOut); - } - CheckErrors(); - FinFlush(DapIn); - - /* Send the `start' command (skipping the initial `; '). */ - fputs(dapl0.pline+2, DapOut); - fputs("\n", DapOut); - fflush(DapOut); - if (!rflag) - SetInput(DapIn, 1); -} - -void dainit() -{ - adinit(); - SetOutput(DapOut, 1); -} - -void adget(v) -int *v; -{ - int i; - - /* DAP 2400 series boards, and DAP 1200 series boards sampling unipolar - inputs, return 12-bit samples left-justified in 16-bit words (the four - low bits are all zero). The `>> 4' operation within the loop below - produces right-justified samples in the range of -2048 to +2047 - inclusive. */ - - for (i = 0; i < nsig; i++) { - *v = getw(DapIn) >> 4; - if (*v < vmin[i]) - fprintf(stderr, "\nsignal %d too low (%d)\n", i, vmin[i] = *v); - else if (*v > vmax[i]) - fprintf(stderr, "\nsignal %d too high (%d)\n", i, vmax[i] = *v); - v++; - } - - /* Get and discard additional samples as specified. */ - if (cpr > 1) { - int c; - - for (c = 1; c < cpr; c++) - for (i = 0; i < nsig; i++) - getw(DapIn); - } -} - -void adbget(v) -int *v; -{ - int i; - - /* This variant of `adget' is intended for use with the DAP 1200 if it - has been configured for sampling bipolar inputs (see `Analog Signal - Path Selection, DAP 1200' in Microstar's Hardware Manual, and `BPRINT' - in Microstar's DAPL Manual). This function has not been tested. */ - - for (i = 0; i < nsig; i++) { - *v = ((getw(DapIn) << 1) - 32768) >> 4; - if (*v < vmin[i]) - fprintf(stderr, "\nsignal %d too low (%d)\n", i, vmin[i] = *v); - else if (*v > vmax[i]) - fprintf(stderr, "\nsignal %d too high (%d)\n", i, vmax[i] = *v); - v++; - } - - if (cpr > 1) { - int c; - - for (c = 1; c < cpr; c++) - for (i = 0; i < nsig; i++) - getw(DapIn); - } -} - -void daput(v) -int *v; -{ - int i, vout; - - for (i = 0; i < nosig; i++, v++) { - vout = (*v) << 4; - write(dapofile, &vout, 2); - /* You would think that - putw((*v) << 4, DapOut); - would work here. (I did.) It doesn't -- at least not if v < 0. */ - } - if (cpr > 1) { - int c, v[WFDB_MAXSIG]; - - for (c = 1; c < cpr && getvec(v) >= nosig; c++) - ; - } -} - -void adquit() -{ - if (!rflag) - SetInput(DapIn, 0); - fputs("stop system \n", DapOut); - fflush(DapOut); - LeaveDap(); -} - -void daquit() -{ - fflush(DapOut); - SetOutput(DapOut, 0); - adquit(); -} diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/app/setwfdb wfdb-10.3.16/app/setwfdb --- wfdb-10.3.15/app/setwfdb 2002-11-22 21:58:19.000000000 -0500 +++ wfdb-10.3.16/app/setwfdb 2005-06-08 16:53:54.000000000 -0400 @@ -1,7 +1,3 @@ WFDB=". ${HOME}/database /usr/local/database /cdrom http://www.physionet.org/physiobank/database"; export WFDB : Change www.physionet.org above to your favorite mirror if you wish WFDBCAL=wfdbcal; export WFDBCAL - -: For compatibility with older applications only -DB=$WFDB; export DB -DBCAL=$WFDBCAL; export DBCAL diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/app/setwfdb.bat wfdb-10.3.16/app/setwfdb.bat --- wfdb-10.3.15/app/setwfdb.bat 2002-11-22 21:54:06.000000000 -0500 +++ wfdb-10.3.16/app/setwfdb.bat 1969-12-31 19:00:00.000000000 -0500 @@ -1,80 +0,0 @@ -@echo off -: file: setwfdb.bat G. Moody 11 September 1989 -: Last revised: 22 November 2002 - -: This script sets environment variables used by WFDB applications. - -: If you are already near the limit of your available environment space, you -: may not be able to set these variables successfully. You may get an error -: while executing this script, or you may find that environment variables -: needed for other applications cannot be set. In this case, you will need to -: expand your environment. This can best be done by adding a command such as: -: shell=c:\command.com /p /e:512 -: in your config.sys file. The number that follows the /e: is the size of -: the environment in bytes. See your MS-DOS manual for further information. - -: If you use the WFDB Software Package regularly, you will find it easiest to -: invoke this batch file from your autoexec.bat, so that the WFDB environment -: is set automatically whenever you reboot your PC. In modern versions of -: MS-DOS, and under any version of MS-Windows, do this by adding -: call c:\bin\setwfdb -: to your autoexec.bat. Do not omit the _call_ from this command, or any -: commands that follow setwfdb in your autoexec.bat will not be executed. -: Replace c:\bin\ above by the correct path to this file if you install it -: somewhere else. - -: The WFDB path, by analogy to the MS-DOS PATH variable, is a list of -: directories in which WFDB applications search for their input files. You may -: define it directly, as the value of the WFDB environment variable, or -: indirectly, within a file named by the WFDB environment variable. If you -: do none of these, the WFDB path is given by the value of DEFWFDB, which is -: defined in wfdblib.h at the time the WFDB library is compiled. For most -: users, the default value may not need to be changed. - -: Here is a simple example of a direct definition of the WFDB path: -:set WFDB=;c:\database -: This statement defines the WFDB path as consisting of the current directory -: -- this is represented by the empty string before the semicolon -- followed -: by the \database directory on the c: drive. It is strongly recommended that -: you retain the initial null component, since any WFDB files that you create, -: such as annotation files, normally are written in the current directory and -: will be accessible for reading only if there is a null component in the WFDB -: path. You may wish to create c:\database for long-term storage of database -: records that you create. If you wish, add more directories to the list. - -: Here is an example of an indirect definition of the WFDB path: -:set WFDB=@c:\database\wfdbpath.dos@ -: This statement indicates that the WFDB path is specified by the contents of -: the file named between the @ characters -- c:\database\wfdbpath.dos. This -: file should contain a list of all of the directories to be searched, -: separated by semicolons, in the same format as in the first example above. -: All of the directories should be listed on a single line, which may be -: arbitrarily long. An indirect definition is useful for reducing the amount -: of environment space needed for the WFDB variable, and is necessary if the -: list of directories is so long that a direct definition would exceed the -: 127-character maximum length of an MS-DOS command. - -: Within the WFDB path, any string of the form %Nr, where N is a digit between -: 1 and 8, is replaced by up to the first N characters of the current record -: name when a WFDB application searches for its input files. The string %r is -: replaced by the entire record name. Use this feature to set WFDB path -: components for the MIMIC Database, in which files associated with each record -: are kept in a directory named by the first 3 digits of the record name. For -: example: -:set WFDB=;c:\database;d:\mimicdb;d:\mimicdb\%%3r -: In this example, the MIMIC Database records are assumed to be located on a -: CD-ROM in the d: drive. Both the main MIMIC Database directory -- mimicdb -- -: and the per-record subdirectories, represented by d:\mimicdb\%%3r above, are -: included in the WFDB path. If you use a batch file such as this one to set -: the WFDB path directly, note that the % character must be doubled in order to -: prevent COMMAND.COM from attempting to perform its own variable substitution. -: COMMAND.COM does not interpret % characters typed at its prompt, however, so -: you should not double the % characters if you set WFDB without using a batch -: file. If you set the WFDB path indirectly, again only a single % is -: necessary, since COMMAND.COM is not involved at all in this case. - -: The WFDBCAL environment variable names a file that must be found somewhere in -: the WFDB path. The file specifies the relative sizes of different types of -: signals, and is needed by applications such as view and wview so that signals -: of different types can be scaled appropriately for display. -set WFDBCAL=wfdbcal diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/app/view.c wfdb-10.3.16/app/view.c --- wfdb-10.3.15/app/view.c 2000-01-30 04:13:17.000000000 -0500 +++ wfdb-10.3.16/app/view.c 1969-12-31 19:00:00.000000000 -0500 @@ -1,917 +0,0 @@ -/* file: view.c G. Moody July 1989 - Last revised: 4 May 1999 - -------------------------------------------------------------------------------- -view: DB browser for MS-DOS (using Microsoft C graphics library) -Copyright (C) 1999 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 -#include -#include -#include -#include -#include -#include -#include - -#define VERSION 5.1 - -/* This function returns 1 if the mouse and driver are installed, 0 if the - driver is installed but not the mouse, and -1 otherwise. See Microsoft - Mouse Programmer's Reference (2nd ed.), p. 105. */ -int findmouse() -{ - union REGS iReg, oReg; - void (interrupt far *int_handler)(); - long vector; - unsigned char first_byte; - - /* Determine the mouse driver interrupt address. */ - int_handler = _dos_getvect(0x33); - - /* Get the interrupt vector and the first instruction of the interrupt - service routine. The vector should not be 0, and the first - instruction should not be `iret' (0xcf). */ - if ((vector = (long)int_handler) == 0L || - (first_byte = *(unsigned char far *)int_handler) == 0xcf) - return (-1); /* driver not loaded */ - - /* Reset the mouse driver and get the mouse status. */ - iReg.x.ax = 0; - int86(0x33, &iReg, &oReg); - - /* Was the mouse found? */ - if (oReg.x.ax == -1) - return (1); /* yes */ - else - return (0); /* no */ -} - -showmousecursor() -{ - union REGS iReg, oReg; - - iReg.x.ax = 1; - int86(0x33, &iReg, &oReg); -} - -hidemousecursor() -{ - union REGS iReg, oReg; - - iReg.x.ax = 2; - int86(0x33, &iReg, &oReg); -} - -struct mousestate { - int x, y, b; -} ms; -int mpp = 1; /* mouse pixels per display pixel */ - -getmousestate(struct mousestate *msp) -{ - union REGS iReg, oReg; - - iReg.x.ax = 3; - int86(0x33, &iReg, &oReg); - msp->x = oReg.x.cx/mpp; - msp->y = oReg.x.dx; - msp->b = oReg.x.bx; /* 1: left button down, 2: right button down, 4: - center button down */ -} - -setmousecursor(x, y) -int x, y; -{ - union REGS iReg, oReg; - - iReg.x.ax = 4; - iReg.x.cx = x*mpp; - iReg.x.dx = y; - int86(0x33, &iReg, &oReg); -} - -unsigned getclicks(button) -int button; /* 0: left, 1: right, 2: center (?) */ -{ - union REGS iReg, oReg; - - iReg.x.ax = 5; - iReg.x.bx = button; - int86(0x33, &iReg, &oReg); - return ((unsigned)oReg.x.bx); -} - -int left, top, right, bottom, use_gtext, use_mouse, xs, ys, yb, xppcol, - ypprow; -double x, y; -double sps; -double xppmm, yppmm; -double xppsi, yppadu[MAXSIG], ysc; - -#define xtr(A) ((int)((A)*xppmm + left)) -#define ytr(A) ((int)(bottom - (A)*yppmm)) -#define xt(A) ((int)((A)*xppsi + left)) -#define yt(A) ((int)(yb - (A)*ysc)) -#define tx(A) (xt(A)/xppcol + 1) -#define ty(A) (yt(A)/ypprow + 1) - -#define move(T,V) (_moveto(xt(T), yt(V))) -#define cont(T,V) (_lineto(xt(T), yt(V))) -#define contix(I, V) (_lineto((I)+left, yt(V))) - -#if _MSC_VER < 600 -#define _outgtext(A) _outtext(A) -#endif - -#if _MSC_VER < 700 -#define _getch getch -#define _rccoord rccoord -#endif - -void line(double ax, double ay, double bx, double by) -{ - _moveto(xtr(ax), ytr(ay)); - _lineto(xtr(bx), ytr(by)); -} - -char *ltimstr(t) -long t; -{ - char *p = timstr(t); - - while (*p == ' ') - p++; - return (p); -} - -int mflag = 1; /* show annotation marker bars if non-zero */ -long background_color; /* _setbkcolor needs long, _setcolor needs int */ -int annotation_color, button_text_color, button_color, cursor_color, - grid_color, signal_color; -int grid_linestyle, marker_linestyle, signal_linestyle; - -void grid() -{ - double yl, yh; - - _setlinestyle(grid_linestyle); - _setcolor(grid_color); - for (x = 0.; x <= xs; x += 5.) - line(x, 0., x, (double)ys); - for (x -= 5., yl = yh = ys/2.; yl >= 0.; yl -= 5., yh += 5.) { - line(0., yl, x, yl); - if (yl != yh) line(0., yh, x, yh); - } - if (mflag) _setlinestyle(marker_linestyle); - else _setlinestyle(signal_linestyle); -} - -char record[10], frametitle[80]; -int nsig, trlen, *v, vmax[MAXSIG], vmin[MAXSIG]; -int base[MAXSIG], v0, gflag = 0, prow, tby, tbmid, yppcm; -long tstart = 0L; -WFDB_Annotation annot; -WFDB_Siginfo si[MAXSIG]; -struct videoconfig vc; -struct view_button { - int left, right; - char *label; -} back2, back1, forw1, forw2; -int tx0; - -void draw_button(vb) -struct view_button vb; -{ - _settextcolor(button_text_color); - _settextposition(prow, - (vb.left+vb.right)/(2*xppcol) + (3-strlen(vb.label))/2); - _outtext(vb.label); - _setcolor(button_text_color); - _arc(vb.left, bottom-ypprow+1, vb.left+2*xppcol, bottom-1, - vb.left+xppcol, bottom-ypprow+1, vb.left+xppcol, bottom-1); - _moveto(vb.left+xppcol, bottom-1); - _lineto(vb.right-xppcol, bottom-1); - _arc(vb.right-2*xppcol, bottom-ypprow+1, vb.right, bottom-1, - vb.right-xppcol, bottom-1, vb.right-xppcol, bottom-ypprow+1); - _moveto(vb.right-xppcol, bottom-ypprow+1); - _lineto(vb.left+xppcol, bottom-ypprow+1); - _setcolor(button_color); - if (button_text_color) - _floodfill(vb.left+xppcol, bottom-ypprow/2, button_text_color); -} - -int compress = 0; - -void do_disp() -{ - char *p, str[5]; - int i, j, s, *vp; - - if (use_mouse) hidemousecursor(); - _clearscreen(_GCLEARSCREEN); - _displaycursor(_GCURSOROFF); - if (use_mouse) { - _setcliprgn(left, top, right, bottom); - draw_button(back2); - draw_button(back1); - draw_button(forw1); - draw_button(forw2); - } - _settextcolor(grid_color); - _settextposition(1, tx0); - _outtext(frametitle); - _setcliprgn(left, top+ypprow, right, bottom-ypprow); - if (gflag) grid(); - else if (mflag) _setlinestyle(marker_linestyle); - if (use_gtext) { - _setcolor(signal_color); - _moveto(left, bottom - 3*ypprow); - _outgtext(ltimstr(tstart)); - _moveto(right - 8*xppcol, bottom - 3*ypprow); - _outgtext(timstr(tstart+trlen)); - } - else { - _settextcolor(signal_color); - _settextposition(prow-1, 1); - _outtext(ltimstr(tstart)); - _settextposition(prow-1, vc.numtextcols - 8); - _outtext(timstr(tstart+trlen)); - _settextcolor(annotation_color); - } - _setcolor(annotation_color); - while (annot.time < tstart && getann(0, &annot) == 0) - ; - while (annot.time < tstart + trlen) { - switch (annot.anntyp) { - case RHYTHM: - tby = tbmid+1; p = annot.aux+1; break; - case STCH: - case TCH: - case NOTE: - tby = tbmid-1; - if (annot.aux) p = annot.aux+1; - else p = annstr(annot.anntyp); break; - case LINK: - tby = tbmid-1; - if (annot.aux) { - char *p1 = annot.aux+1, *p2 = p1 + *(p1-1); - p = p1; - while (p1 < p2) { - if (*p1 == ' ' || *p1 == '\t') { - p = p1 + 1; - break; - } - p1++; - } - _setcolor(signal_color); - _settextcolor(signal_color); - } - break; - case NOISE: - tby = tbmid-1; - if (annot.subtyp == -1) { p = "U"; break; } - /* The existing scheme is good for up to 4 signals; it can be - easily extended to 8 or 12 signals using the chan and num - fields, or to an arbitrary number of signals using `aux'. */ - for (s = 0; s < nsig && s < 4; s++) { - if (annot.subtyp & (0x10 << s)) - str[s] = 'u'; /* signal s is unreadable */ - else if (annot.subtyp & (0x01 << s)) - str[s] = 'n'; /* signal s is noisy */ - else - str[s] = 'c'; /* signal s is clean */ - } - str[s] = '\0'; - p = str; break; - default: - tby = tbmid; p = annstr(annot.anntyp); break; - } - if (use_gtext) { - _moveto((int)((annot.time-tstart)*xppsi + left), tby*ypprow); - _outgtext(p); - } - else { - _settextposition(tby, tx(annot.time-tstart)); - _outtext(p); - } - if (annot.anntyp == LINK) { - _setcolor(annotation_color); - _settextcolor(annotation_color); - } - if (mflag) { - int xx = (int)((annot.time-tstart)*xppsi) + left; - - _moveto(xx, top); - _lineto(xx, (tby-1)*ypprow); - _moveto(xx, (tby+1)*ypprow); - _lineto(xx, bottom); - } - if (getann(0, &annot) != 0) break; - } - if (mflag) _setlinestyle(signal_linestyle); - _setcolor(signal_color); - if (!use_gtext) - _settextcolor(signal_color); -/* - for (i = 0, vp = v; i < trlen; i++, vp += nsig) { - if (getvec(vp) < nsig) break; - for (s = 0; s < nsig; s++) { - if (vp[s] < vmin[s]) vmin[s] = vp[s]; - else if (vp[s] > vmax[s]) vmax[s] = vp[s]; - } - } -*/ - /* If there at least two samples per displayed column, compress the - data. */ - if (compress) { - static int x0, vv0[MAXSIG], vmn[MAXSIG], vmx[MAXSIG], vv[MAXSIG]; - getvec(vp = v); - for (s = 0; s < nsig; s++) - vmax[s] = vmin[s] = vmn[s] = vmx[s] = vv0[s] = vp[s]; - for (i = 1, x0 = 0; i < trlen && getvec(vv) > 0; i++) { - int xx; - if ((xx = i*xppsi) > x0) { - x0 = xx; - vp += nsig; - for (s = 0; s < nsig; s++) { - if (vv[s] > vmx[s]) vmx[s] = vv[s]; - else if (vv[s] < vmn[s]) vmn[s] = vv[s]; - if (vmx[s] - vv0[s] > vv0[s] - vmn[s]) - vv0[s] = vmn[s] = vmx[s]; - else - vv0[s] = vmx[s] = vmn[s]; - if ((vp[s] = vv0[s]) > vmax[s]) vmax[s] = vp[s]; - else if (vp[s] < vmin[s]) vmin[s] = vp[s]; - } - } - else { - for (s = 0; s < nsig; s++) { - if (vv[s] > vmx[s]) vmx[s] = vv[s]; - else if (vv[s] < vmn[s]) vmn[s] = vv[s]; - } - } - } - i = (vp - v)/nsig; - } - else { - for (i = 0, vp = v; i < trlen; i++, vp += nsig) { - if (getvec(vp) < nsig) break; - for (s = 0; s < nsig; s++) { - if (vp[s] < vmin[s]) vmin[s] = vp[s]; - else if (vp[s] > vmax[s]) vmax[s] = vp[s]; - } - } - } - for (s = 0; s < nsig; s++) { - int row; - yb = base[s]; - v0 = (vmax[s] + vmin[s])/2; - ysc = yppadu[s]; - if ((row = (yb - yppcm)/ypprow) < 1) row = 1; - if (use_gtext) { - _moveto(left, row*ypprow); - _outgtext(si[s].desc); - } - else { - _settextposition(row, 1); - _outtext(si[s].desc); - } - vp = v+s; - move(0, (*vp - v0)); - vp += nsig; - if (compress) - for (j = 1; j < i; j++, vp += nsig) - contix(j, (*vp - v0)); - else - for (j = 1; j < i; j++, vp += nsig) - cont(j, (*vp - v0)); - vmax[s] = -9999; vmin[s] = 9999; - } - if (use_mouse) { - _setcolor(cursor_color); - showmousecursor(); - } - _settextcolor(cursor_color); - _settextposition(prow, 1); - _outtext("> "); - _displaycursor(_GCURSORON); -} - -long save_background_color = -1L; -short save_text_color = -1; - -void catch_signal(int sig) -{ - if (use_mouse) - hidemousecursor(); - if (save_background_color >= 0L) - _setbkcolor(save_background_color); - if (save_text_color >= 0) - _settextcolor(save_text_color); - if (vc.numcolors >= 16) - _remappalette(15, _BRIGHTWHITE); - _setvideomode(_DEFAULTMODE); -} - -void restore_mode(void) -{ - catch_signal(0); -} - -char command[21]; -int asrch = 0, nann = 0; - -void do_command(i) -int i; -{ - _settextposition(prow, 1); - _outtext("> "); - _outtext(command); - switch (command[0]) { - case 'x': - case 'X': - wfdbquit(); - restore_mode(); - exit(0); - case 'g': - gflag = 1-gflag; - break; - case 'm': - mflag = 1-mflag; - break; - case '\0': /* repeat previous search, or advance one screenful */ - if (asrch) strcpy(command, annstr(asrch)); - else strcpy(command, timstr(tstart + trlen)); - /* drop through to default case */ - default: /* annotation mnemonic or time string */ - if (nann > 0 && (asrch = strann(command)) != NOTQRS) { - while (getann(0, &annot) == 0 && annot.anntyp != asrch) - ; - if (annot.anntyp == asrch) - tstart = strtim(timstr(annot.time - trlen/2)); - } - else { - tstart = strtim(command); - asrch = NOTQRS; - } - break; - } - if (isigsettime(tstart) < 0) { - _settextposition(prow, 1); - _outtext("> "); - _settextposition(prow, 3); - return; - } - if (nann > 0) { - if (tstart == 0L) iannsettime(1L); - else iannsettime(tstart); - getann(0, &annot); - } - do_disp(); -} - -main(argc, argv) -int argc; -char *argv[]; -{ - char *viewf, *viewp, *p; - static char *cfname; - static char *evp = "The value of VIEWP, `%s', appears garbled.\n%s"; - static char *evs = "Find and run `vsetup' before continuing.\n"; - int c, i, j, s; - int vmode; - static WFDB_Anninfo an; - static WFDB_Calinfo ci; - void help(); - -#ifdef MITCDROM - char *wfdbp = getwfdb(); - if (*wfdbp == '\0') - setwfdb(";\\mitdb;\\nstdb;\\stdb;\\vfdb;\\afdb;\\cdb;\\svdb;\\ltdb"); -#endif -#ifdef STTCDROM - char *wfdbp = getwfdb(); - if (*wfdbp == '\0') - setwfdb(";\\edb;\\valedb"); -#endif -#ifdef SLPCDROM - char *wfdbp = getwfdb(); - if (*wfdbp == '\0') - setwfdb(";\\slpdb"); -#endif -#ifdef MGHCDROM - char *wfdbp = getwfdb(); - if (*wfdbp == '\0') - setwfdb(";\\mghdb"); -#endif - if ((viewp = getenv("VIEWP")) == NULL) { - execlp("vsetup.exe", "vsetup", NULL); - printf(evs); - exit(1); - } - if ((p = strtok(viewp, ",")) == NULL) { - printf(evp, viewp, evs); - exit(1); - } - vmode = atoi(p); - if ((p = strtok(NULL, ",")) == NULL) { - printf(evp, viewp, evs); - exit(1); - } - left = atoi(p); - if (left < 0 || (p = strtok(NULL, ",")) == NULL) { - printf(evp, viewp, evs); - exit(1); - } - right = atoi(p); - if (right <= left || (p = strtok(NULL, ",")) == NULL) { - printf(evp, viewp, evs); - exit(1); - } - top = atoi(p); - if (top < 0 || (p = strtok(NULL, ",")) == NULL) { - printf(evp, viewp, evs); - exit(1); - } - bottom = atoi(p); - if (bottom <= top || (p = strtok(NULL, ",")) == NULL) { - printf(evp, viewp, evs); - exit(1); - } - xs = atoi(p); - p += strlen(p)+1; - if (xs <= 0 || *p == '\0' || (ys = atoi(p)) <= 0) { - printf(evp, viewp, evs); - exit(1); - } - - if (argc < 2) { - printf("Enter the name of the record to view (or `?' for help): "); - fgets(record, 10, stdin); - record[strlen(record)-1] = '\0'; - if (strcmp(record, "?") == 0) { - help(); - exit(1); - } - } - else if (strcmp(argv[1], "-h") == '\0') { - help(); - exit(1); - } - else - strncpy(record, argv[1], 8); - - wfdbquiet(); - if ((nsig = isigopen(record, si, MAXSIG)) < 1) { - switch (nsig) { - case 0: - printf("Sorry, record `%s' has no signals.\n", record); - break; - case -1: - default: - printf("Record `%s' can't be found.\n", record); - break; - case -2: - printf("The header file for record `%s' is garbled.\n", record); - break; - } - exit(2); - } - for (i = 0; i < nsig; i++) - if (si[i].gain == 0.0) si[i].gain = WFDB_DEFGAIN; - - an.name = (argc > 2) ? argv[2] : "atr"; an.stat = WFDB_READ; - if (nann = (annopen(record, &an, 1) == 0)) - getann(0, &annot); - - if (right-left >= 400) - sprintf(frametitle, - "Record: %s Annotator: %s VIEW %.1f", - record, (nann > 0) ? an.name : "(none)", VERSION); - else - sprintf(frametitle, - "Rec %s %s VIEW %.1f", record, - (nann > 0) ? an.name : "", VERSION); - - if ((sps = sampfreq(NULL)) <= 0.) sps = WFDB_DEFFREQ; - xppmm = (double)(right - left)/(double)xs; - yppmm = (double)(bottom - top)/(double)ys; - i = xs/5; /* determine the number of 5 mm blocks we can display */ - j = xs - 5*i; /* millimeters left over */ - left += j/2.*xppmm; - xppsi = (xppmm * 25.) / sps; - yppcm = yppmm * 10.; - - /* If specified, read the calibration file to get standard scales. */ - if (cfname == (char *)NULL && (cfname = getenv("WFDBCAL"))) - calopen(cfname); - - for (s = 0; s < nsig; s++) { - yppadu[s] = (yppmm * 10.) / si[s].gain; - if (getcal(si[s].desc, si[s].units, &ci) == 0 && ci.scale != 0.0) - yppadu[s] /= ci.scale; - } - if (sps >= 10.) - trlen = i * (int)(sps/5.); - else - trlen = (int)(i * sps/5.); - - if (xppsi < 0.75) { - compress = 1; - - if ((v = malloc((unsigned)(1.5*(right - left)*nsig*sizeof(int)))) == - NULL) { - printf("Sorry, there is not enough memory available.\n"); - exit(2); - } - } - - else while ((v = malloc((unsigned)(trlen*nsig*sizeof(int)))) == NULL) - trlen = (--i) * (int)(sps/5.); - - atexit(restore_mode); - signal(SIGABRT, catch_signal); - signal(SIGFPE, catch_signal); - signal(SIGINT, catch_signal); - - if (!_setvideomode(vmode)) { - printf("Video mode %d cannot be set as requested by VIEWP.\n%s", - vmode, evs); - exit(2); - } -#if _MSC_VER >= 600 - if ((viewf = getenv("VIEWF")) == NULL) { - char *path = getenv("PATH"), *p, *q; - static char s[80]; - - if (path) { - for (p = path; *p; p++) { - if (*p == 'W' && strncmp(p+1, "INDOWS", 6) == 0) { - q = p+7; - while (p > path && *(p-1) != ';') - p--; - strncpy(s, p, q-p); - strcat(s, "\\system\\modern.fon"); - viewf = s; - break; - } - } - } - if (viewf == NULL) viewf = "modern.fon"; - } - if (_registerfonts(viewf) < 0 || - _setfont("t'modern'h12w8b") < 0) - use_gtext = 0; - else - use_gtext = 1; -#endif - _getvideoconfig(&vc); - xppcol = vc.numxpixels/vc.numtextcols; - ypprow = vc.numypixels/vc.numtextrows; - tbmid = (nsig == 1) ? vc.numtextrows - 3 : vc.numtextrows/nsig; - prow = vc.numtextrows; - tx0 = (vc.numtextcols - strlen(frametitle))/2 + 1; - if (tx0 < 1) tx0 = 1; - back2.label = " <<"; - back2.left = (left + right)/2; - back2.right = back2.left + xppcol*4; - back1.label = "<"; - back1.left = back2.right + xppcol; - back1.right = back1.left + xppcol*3; - forw1.label = ">"; - forw1.left = back1.right + xppcol; - forw1.right = forw1.left + xppcol*3; - forw2.label = " >>"; - forw2.left = forw1.right + xppcol; - forw2.right = forw2.left + xppcol*4; - - if (vc.numcolors >= 16) { - background_color = _BRIGHTWHITE; - _remappalette(15, _RED); - signal_color = 1; /* blue */ - annotation_color = 2; /* green */ - button_text_color = cursor_color = 4; /* red */ - button_color = grid_color = 7; /* grey */ - grid_linestyle = signal_linestyle = 0xffff; /* solid */ - marker_linestyle = 0x5555; /* dotted */ - } - else if (vc.numcolors >= 4 && vmode != _ERESNOCOLOR) { - background_color = _BLACK; - annotation_color = 1; - grid_color = 2; - button_text_color = signal_color = cursor_color = 3; - grid_linestyle = 0xffff; /* solid */ - marker_linestyle = 0x5555; /* dotted */ - signal_linestyle = 0xffff; /* solid */ - } - else { - signal_color = button_text_color = annotation_color = grid_color = - cursor_color = 1; - grid_linestyle = 0x1111; /* sparse dotted */ - marker_linestyle = 0x5555; /* dotted */ - signal_linestyle = 0xffff; /* solid */ - } - - save_background_color = _getbkcolor(); - save_text_color = _gettextcolor(); - if (vc.numcolors >= 4 && vmode != _ERESNOCOLOR) - _setbkcolor(background_color); - if (vc.numxpixels < 640) mpp = 2; - - if (findmouse() == 1) { - use_mouse = 1; - _setcolor(cursor_color); - showmousecursor(); - } - _setcolor(signal_color); - - for (s = 0; s < nsig; s++) { - base[s] = ((2*s+1)*bottom)/(2*nsig); - vmin[s] = 9999; vmax[s] = -9999; - } - - if (argc > 3) { - strncpy(command, argv[3], 20); - do_command(); - } - else - do_disp(); - - i = 0; - while (1) { - int nc; - - if (kbhit()) { - c = _getch(); - if (c == '\b' || c == '\177') { - if (i > 0) { - struct _rccoord tp = _gettextposition(); - - _settextposition(tp.row, tp.col-1); - _outtext(" "); - _settextposition(tp.row, tp.col-1); - command[--i] = '\0'; - } - } - else if (c == '\r') { - do_command(); - command[i = 0] = '\0'; - } - else { - command[i] = c; - command[i+1] = '\0'; - _outtext(command+i); - if (++i >= 20) { - do_command(); - command[i = 0] = '\0'; - } - } - } - if (nann > 0 && use_mouse) { - long t0, t1; - - if ((nc = getclicks(0)) > 0) { - getmousestate(&ms); - if (ms.y >= bottom - ypprow) { - /* check for button press */ - if (back2.left <= ms.x && ms.x <= back2.right) - tstart -= trlen; - else if (back1.left <= ms.x && ms.x <= back1.right) - tstart -= trlen/2; - else if (forw1.left <= ms.x && ms.x <= forw1.right) - tstart += trlen/2; - else if (forw2.left <= ms.x && ms.x <= forw2.right) - tstart += trlen; - else - continue; /* ignore click if not on a button */ - if (tstart < 0L) tstart = 0L; - else tstart = strtim(timstr(tstart)); - isigsettime(tstart); - if (tstart == 0L) iannsettime(1L); - else iannsettime(tstart); - getann(0, &annot); - do_disp(); - continue; - } - /* move left by nc annotations */ - t0 = t1 = tstart + (ms.x - left - 5)/xppsi; - if (t0 < 0L) t0 = t1 = 0L; - do { - if (iannsettime(1L) < 0 || getann(0, &annot) < 0) - break; - do { - t1 = annot.time; - } while (getann(0, &annot) == 0 && annot.time < t0); - /* t1 is the time of the annotation immediately before t0, - if any */ - if (t0 <= t1) break; - t0 = t1; - } while (--nc > 0); - } - else if ((nc = getclicks(1)) > 0) { - /* move right by nc annotations */ - getmousestate(&ms); - t0 = tstart + (ms.x - left + 5)/xppsi; - if (iannsettime(t0) < 0) continue; - while (nc > 0 && getann(0, &annot) == 0) { - nc--; - t0 = annot.time; - } - } - else - continue; /* no mouse clicks */ - if (t0 < tstart || t0 >= tstart + trlen) { - if (t0 < trlen/2) t0 = trlen/2; - tstart = strtim(timstr(t0 - trlen/2)); - isigsettime(tstart); - if (tstart == 0L) iannsettime(1L); - else iannsettime(tstart); - getann(0, &annot); - do_disp(); - } - setmousecursor((int)((t0-tstart)*xppsi + left), - (tby+1)*ypprow); - } - else if (use_mouse) { - if ((nc = getclicks(0)) > 0) { - getmousestate(&ms); - if (ms.y >= bottom - ypprow) { - /* check for button press */ - if (back2.left <= ms.x && ms.x <= back2.right) - tstart -= trlen; - else if (back1.left <= ms.x && ms.x <= back1.right) - tstart -= trlen/2; - else if (forw1.left <= ms.x && ms.x <= forw1.right) - tstart += trlen/2; - else if (forw2.left <= ms.x && ms.x <= forw2.right) - tstart += trlen; - else - continue; /* ignore click if not on a button */ - if (tstart < 0L) tstart = 0L; - else tstart = strtim(timstr(tstart)); - isigsettime(tstart); - do_disp(); - continue; - } - } - } - } - wfdbquit(); - restore_mode(); - exit(0); -} - -static char *help_strings[] = { - "usage: view [ RECORD ANNOTATOR START ]", - "where RECORD and ANNOTATOR specify the record and the set of annotations", - "to be viewed, and START specifies either:", - " - the elapsed time (in HH:MM:SS format) from the beginning of RECORD", - " to the left edge of the first screenful to be viewed, or", - " - an annotation type (such as `V' or `F'; `view' finds the first example", - " and shows it centered in the first screenful)", - "If START is omitted, `view' shows the beginning of RECORD. If ANNOTATOR", - "is omitted, `view' shows `atr' (reference) annotations if available. If", - "RECORD is omitted, `view' asks for the record name.", - "", - "Once `view' is running, use these commands to control it:", - " show the next screenful", - " `g' toggle grid display (0.2s x 0.5 mV)", - " `m' toggle annotation marker bar display", - " `x' to exit to MS-DOS", - "or type a time or annotation type as above.", - "", - "If a mouse is available, click its left button on any of the controls", - "at the bottom of the screen to move forward or backward by whole or", - "half screenfuls, or click its left or right button in the display area", - "to move left or right one annotation at a time.", -NULL -}; - -void help() -{ - int i; - - for (i = 0; help_strings[i] != NULL; i++) - (void)fprintf(stderr, "%s\n", help_strings[i]); -} diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/app/vsetup.c wfdb-10.3.16/app/vsetup.c --- wfdb-10.3.15/app/vsetup.c 2000-01-30 04:13:17.000000000 -0500 +++ wfdb-10.3.16/app/vsetup.c 1969-12-31 19:00:00.000000000 -0500 @@ -1,254 +0,0 @@ -/* file: vsetup.c G. Moody July 1989 - Last revised: 4 May 1999 - -------------------------------------------------------------------------------- -vsetup: Initialization for `view' -Copyright (C) 1999 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 -#include -#include -#include -#include - -/* Keyboard scan codes */ -#define UP 72 -#define DOWN 80 -#define LEFT 75 -#define RIGHT 77 -#define ENTER 28 - -/* Abbreviate incredibly long Microsoft function names. */ -#define st(A,B) _settextposition(A,B) -#define sv(A) _setvideomode(A) -#define dotted _setlinestyle(0x5555) -#define solid _setlinestyle(0xffff) -#define li(A,B) _putimage(A,B,b,_GXOR) - -main(argc, argv) -int argc; -char *argv[]; -{ - struct videoconfig vc; - char far *b; - FILE *ofile = NULL; - int done, mode = 0, r0, left, right, top, bottom, width, height; - unsigned int s1, s2; - char buf[10]; - - /* Take a command-line argument as a video mode number to be tried - first; if the argument is `-s', however, append the derived command - for setting VIEWP to the file named in the next argument. */ - if (argc > 1) { - if (strcmp(argv[1], "-s") == 0 && argc > 2) { - if ((ofile = fopen(argv[2], "a")) == NULL) { - fprintf(stderr, "can't append to `%s'\n", argv[2]); - exit(1); - } - } - else switch (mode = atoi(argv[1])) { - case _MRES256COLOR: - case _VRES16COLOR: - case _VRES2COLOR: - case _ERESCOLOR: - case _HERCMONO: - case _ERESNOCOLOR: - case _HRES16COLOR: - case _MRES16COLOR: - case _MRES4COLOR: - case _HRESBW: - case _MRESNOCOLOR: -#if (_MSC_VER >= 700) - case _ORESCOLOR: - case _ORES256COLOR: - case _VRES256COLOR: - case _SRES16COLOR: - case _SRES256COLOR: - case _XRES16COLOR: - case _XRES256COLOR: - case _ZRES16COLOR: - case _ZRES256COLOR: -#endif - if (sv(mode)) break; - /* If unsucessful, fall through to the default case. */ - default: - printf("Sorry, video mode %d cannot be used.\n", mode); - printf("Press ENTER and this program will try to find\n"); - printf("a usable video mode: "); - fgets(buf, 10, stdin); - mode = 0; - } - } - else mode = 0; - - /* Try to find a mode that works. */ - if (mode == 0 && !(mode = set_mode())) { - printf("Your current video mode is not supported.\n"); - printf("Try typing `mode co80' before continuing.\n"); - exit(1); - } - - /* Read the selected video mode configuration. */ - _getvideoconfig(&vc); - - /* Set the assumed display area based on the configuration structure. - Note that the origin is at *top* left, and the coordinates increase - going right or down. Note also that the largest legal coordinates - are one less than the number of pixels in each direction (since row - and column 0 are legal). */ - left = top = 0; - right = vc.numxpixels-1; - bottom = vc.numypixels-1; - - /* Allocate a buffer for storage of the dotted lines which will be moved - about when finding the displayable area. */ - s1 = _imagesize(left, top, left, bottom); - s2 = _imagesize(left, top, right, top); - b = (char far *)malloc((s1 > s2) ? s1 : s2); - - /* Messages will be placed near the middle of the screen. We must be - careful not to go beyond 40 columns per line, or we'll have problems - with CGA displays. It also seems as if we have to set the row and - column at the beginning of each line, or we get double-spaced text - in 320x200 CGA mode and single-spaced text in 640x200 CGA mode, and - who knows what else. Arghhh! */ - r0 = vc.numtextrows/2-2; - - /* Find the leftmost displayable abscissa. */ - st(r0, 1); printf("<- A vertical line should be visible \n"); - st(r0+1, 1); printf(" to the left; if not, press the \n"); - st(r0+2, 1); printf(" right arrow key until it is visible.\n"); - st(r0+3, 1); printf(" To continue, press ENTER."); - dotted; _moveto(left, top); _lineto(left, bottom); solid; - _getimage(0, 0, 0, bottom, b); - for (done = 0; !done; ) { - switch ((_bios_keybrd(_KEYBRD_READ) & 0xff00) >> 8) { - case LEFT: - if (0 < left) { li(left--, top); li(left, top); } break; - case RIGHT: - if (left < right) { li(left++, top); li(left, top); } break; - case ENTER: - _moveto(left,top); _lineto(left,bottom); done = 1; break; - } - } - - /* Find the rightmost displayable abscissa. */ - st(r0, 1); printf(" A vertical line should be visible ->\n"); - st(r0+1, 1); printf(" to the right; if not, press the \n"); - st(r0+2, 1); printf(" left arrow key until it is visible. \n"); - st(r0+3, 1); printf(" To continue, press ENTER."); - _moveto(left, top); _lineto(left, bottom); li(right, top); - for (done = 0; !done; ) { - switch ((_bios_keybrd(_KEYBRD_READ) & 0xff00) >> 8) { - case LEFT: - if (left < right) { li(right--, top); li(right, top); } break; - case RIGHT: - if (right < vc.numxpixels-1) { - li(right++, top); li(right, top); } break; - case ENTER: - _moveto(right, top); _lineto(right, bottom); done = 1; break; - } - } - - /* Find the top displayable ordinate. */ - st(r0, 1); printf(" A horizontal line should be visible \n"); - st(r0+1, 1); printf(" above; if not, press the \n"); - st(r0+2, 1); printf(" down arrow key until it is visible. \n"); - st(r0+3, 1); printf(" To continue, press ENTER."); - _moveto(left, top); _lineto(left, bottom); - dotted; _moveto(left, top); _lineto(right, top); solid; - _getimage(left, 0, right, 0, b); - for (done = 0; !done; ) { - switch ((_bios_keybrd(_KEYBRD_READ) & 0xff00) >> 8) { - case UP: - if (0 < top) { li(left, top--); li(left, top); } break; - case DOWN: - if (top < bottom) { li(left, top++); li(left, top); } break; - case ENTER: - _moveto(left, top); _lineto(right, top); done = 1; break; - } - } - - /* Find the bottom displayable ordinate. */ - st(r0, 1); printf(" A horizontal line should be visible \n"); - st(r0+1, 1); printf(" below; if not, press the \n"); - st(r0+2, 1); printf(" up arrow key until it is visible. \n"); - st(r0+3, 1); printf(" To continue, press ENTER."); - _moveto(left, top); _lineto(left, bottom); li(left, bottom); - for (done = 0; !done; ) { - switch ((_bios_keybrd(_KEYBRD_READ) & 0xff00) >> 8) { - case UP: - if (0 < bottom) { li(left, bottom--); li(left, bottom); } break; - case DOWN: - if (bottom < vc.numypixels-1) { - li(left, bottom++); li(left, bottom); } break; - case ENTER: - _moveto(left, bottom); _lineto(right, bottom); done = 1; break; - } - } - - st(r0, 1); printf(" Please measure the length of one of \n"); - st(r0+1, 1); printf(" the horizontal lines in millimeters \n"); - st(r0+2, 1); printf(" and enter it here: ___ \n"); - st(r0+3, 1); printf(" To continue, press ENTER.\n"); - _moveto(left, top); _lineto(left, bottom); - st(r0+2, 23); scanf("%d", &width); - - st(r0, 1); printf(" Please measure the length of one of \n"); - st(r0+1, 1); printf(" the vertical lines in millimeters \n"); - st(r0+2, 1); printf(" and enter it here: ___ \n"); - st(r0+3, 1); printf(" To continue, press ENTER.\n"); - _moveto(left, top); _lineto(left, bottom); - st(r0+2, 23); scanf("%d", &height); - - sv(_DEFAULTMODE); - - if (ofile == NULL) { - printf("To use `view', either type the command below or put it in\n"); - printf("your `autoexec.bat' file (if you do the latter, it will be\n"); - printf("effective only after a reboot):\n\n"); - printf(" set VIEWP=%d,%d,%d,%d,%d,%d,%d\n", - mode, left, right, top, bottom, width, height); - } - else { - fprintf(ofile, "set VIEWP=%d,%d,%d,%d,%d,%d,%d\n", - mode, left, right, top, bottom, width, height); - fclose(ofile); - } - exit(0); -} - -int set_mode() -{ - if (sv(_VRES16COLOR)) return (_VRES16COLOR); /* 640x480x4 */ - if (sv(_VRES2COLOR)) return (_VRES2COLOR); /* 640x480x1 */ - if (sv(_ERESCOLOR)) return (_ERESCOLOR); /* 640x350x2/4 */ - if (sv(_HERCMONO)) return (_HERCMONO); /* 720x348x1 */ - if (sv(_ERESNOCOLOR)) return (_ERESNOCOLOR); /* 640x350x1 */ - if (sv(_HRES16COLOR)) return (_HRES16COLOR); /* 640x200x4 */ - if (sv(_HRESBW)) return (_HRESBW); /* 640x200x1 */ - if (sv(_MRES16COLOR)) return (_MRES16COLOR); /* 320x200x4 */ - if (sv(_MRES4COLOR)) return (_MRES4COLOR); /* 320x200x2 */ - if (sv(_MRESNOCOLOR)) return (_MRESNOCOLOR); /* 320x200x2 */ - return (0); -} diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/app/wabp.c wfdb-10.3.16/app/wabp.c --- wfdb-10.3.15/app/wabp.c 2002-12-05 02:51:45.000000000 -0500 +++ wfdb-10.3.16/app/wabp.c 2005-05-11 12:40:31.000000000 -0400 @@ -1,8 +1,8 @@ /* file wabp.c Wei Zong 23 October 1998 - Last revised: 5 December 2002 (by W. Zong and G. Moody) + Last revised: 11 May 2005 (by G. Moody) ----------------------------------------------------------------------------- wabp: beat detector for arterial blood presure (ABP) signal -Copyright (C) 2002 Wei Zong +Copyright (C) 2002-2005 Wei Zong 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 @@ -68,7 +68,7 @@ int *ebuf; int nsig; /* number of input signals */ int SLPwindow; /* Slope window size */ -int signal = -1; /* signal number of signal to be analyzed (initial +int sig = -1; /* signal number of signal to be analyzed (initial value forces search for ABP, ART, or BP signal) */ int Tm = TmDEF; /* minimum threshold value */ WFDB_Sample *lbuf = NULL; @@ -99,7 +99,7 @@ } while (t > tt) { static int aet = 0, et; - dy = sample(signal, tt) - sample(signal, tt-1); + dy = sample(sig, tt) - sample(sig, tt-1); if (dy < 0) dy = 0; et = ebuf[(++tt)&(BUFLN-1)] = dy; lbuf[(tt)&(BUFLN-1)] = aet += et - ebuf[(tt-SLPwindow)&(BUFLN-1)]; @@ -172,7 +172,7 @@ pname); exit(1); } - signal = atoi(argv[i]); + sig = atoi(argv[i]); break; case 't': /* end time */ if (++i >= argc) { @@ -207,7 +207,7 @@ } a.name = "wabp"; a.stat = WFDB_WRITE; if ((nsig = wfdbinit(record, &a, 1, s, nsig)) < 1) exit(2); - if (signal < 0 || signal >= nsig) { + if (sig < 0 || sig >= nsig) { /* Identify the lowest-numbered ABP, ART, or BP signal */ for (i = 0; i < nsig; i++) if (strcmp(s[i].desc, "ABP") == 0 || @@ -220,11 +220,11 @@ help(); exit(3); } - signal = i; + sig = i; } if (vflag) fprintf(stderr, "%s: analyzing signal %d (%s)\n", - pname, signal, s[signal].desc); + pname, sig, s[sig].desc); sps = sampfreq((char *)NULL); if (Rflag) setifreq(sps = 125.); @@ -238,9 +238,9 @@ } annot.subtyp = annot.num = 0; - annot.chan = signal; + annot.chan = sig; annot.aux = NULL; - Tm = physadu((unsigned)signal, Tm); + Tm = physadu((unsigned)sig, Tm); samplingInterval = 1000.0/sps; spm = 60 * sps; next_minute = from + spm; @@ -258,7 +258,7 @@ printf("%d)\n", nsig - 1); printf("Sampling Frequency: %.1f Hz\n", sps); printf("Sampling Interval: %.3f ms\n", samplingInterval); - printf("Signal channel used for detection: %d\n", signal); + printf("Signal channel used for detection: %d\n", sig); printf("Eye-closing period: %d samples (%.0f ms)\n", EyeClosing, EyeClosing*samplingInterval); printf("Minimum threshold: %d\n", Tm); @@ -266,10 +266,10 @@ printf("Processing:\n"); } - (void)sample(signal, 0L); + (void)sample(sig, 0L); if (dflag) { for (t = from; (to == 0L || t < to) && sample_valid(); t++) - printf("%6d\t%6d\n", sample(signal, t), slpsamp(t)); + printf("%6d\t%6d\n", sample(sig, t), slpsamp(t)); exit(0); } @@ -314,7 +314,7 @@ if (!learning) { /* Check that we haven't reached the end of the record. */ - (void)sample(signal, tpq); + (void)sample(sig, tpq); if (sample_valid() == 0) break; /* Record an annotation at the ABP pulse onset */ annot.time = tpq; diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/app/wqrs.c wfdb-10.3.16/app/wqrs.c --- wfdb-10.3.15/app/wqrs.c 2004-12-08 15:41:21.000000000 -0500 +++ wfdb-10.3.16/app/wqrs.c 2005-05-11 12:40:46.000000000 -0400 @@ -1,8 +1,8 @@ /* file: wqrs.c Wei Zong 23 October 1998 - Last revised: 8 December 2004 (by W.Zong and G. Moody) + Last revised: 11 May 2005 (by G. Moody) ----------------------------------------------------------------------------- wqrs: Single-lead QRS detector based on length transform -Copyright (C) 1998-2004 Wei Zong +Copyright (C) 1998-2005 Wei Zong 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 @@ -86,7 +86,7 @@ int LPn, LP2n; /* filter parameters (dependent on sampling rate) */ int LTwindow; /* LT window size */ int PWFreq = PWFreqDEF; /* power line (mains) frequency, in Hz */ -int signal = 0; /* signal number of signal to be analyzed */ +int sig = 0; /* signal number of signal to be analyzed */ int Tm = TmDEF; /* minimum threshold value */ WFDB_Sample *lbuf = NULL; @@ -127,8 +127,8 @@ Yn2 = Yn1; Yn1 = Yn; - Yn = 2*Yn1 - Yn2 + sample(signal, tt) - - 2*sample(signal, tt-LPn) + sample(signal, tt-LP2n); + Yn = 2*Yn1 - Yn2 + sample(sig, tt) - + 2*sample(sig, tt-LPn) + sample(sig, tt-LP2n); dy = (Yn - Yn1) / LP2n; /* lowpass derivative of input */ et = ebuf[(++tt)&(BUFLN-1)] = sqrt(lfsc +dy*dy); /* length transform */ lbuf[(tt)&(BUFLN-1)] = aet += et - ebuf[(tt-LTwindow)&(BUFLN-1)]; @@ -217,7 +217,7 @@ pname); exit(1); } - signal = atoi(argv[i]); + sig = atoi(argv[i]); break; case 't': /* end time */ if (++i >= argc) { @@ -252,8 +252,8 @@ } a.name = "wqrs"; a.stat = WFDB_WRITE; if ((nsig = wfdbinit(record, &a, 1, s, nsig)) < 1) exit(2); - if (signal < 0 || signal >= nsig) signal = 0; - if ((gain = s[signal].gain) == 0.0) gain = WFDB_DEFGAIN; + if (sig < 0 || sig >= nsig) sig = 0; + if ((gain = s[sig].gain) == 0.0) gain = WFDB_DEFGAIN; sps = sampfreq((char *)NULL); if (Rflag) { if (PWFreq == 60.0) setifreq(sps = 120.); @@ -269,9 +269,9 @@ } annot.subtyp = annot.num = 0; - annot.chan = signal; + annot.chan = sig; annot.aux = NULL; - Tm = muvadu((unsigned)signal, Tm); + Tm = muvadu((unsigned)sig, Tm); samplingInterval = 1000.0/sps; lfsc = 1.25*gain*gain/sps; /* length function scale constant */ spm = 60 * sps; @@ -284,10 +284,10 @@ ExpectPeriod = sps * NDP; /* maximum expected RR interval */ LTwindow = sps * MaxQRSw; /* length transform window size */ - (void)sample(signal, 0L); + (void)sample(sig, 0L); if (dflag) { for (t = from; (to == 0L || t < to) && sample_valid(); t++) - printf("%6d\t%6d\n", sample(signal, t), ltsamp(t)); + printf("%6d\t%6d\n", sample(sig, t), ltsamp(t)); exit(0); } @@ -300,11 +300,11 @@ printf("%d)\n", nsig - 1); printf("Sampling Frequency: %.1f Hz\n", sps); printf("Sampling Interval: %.3f ms\n", samplingInterval); - printf("Signal channel used for detection: %d\n", signal); + printf("Signal channel used for detection: %d\n", sig); printf("Eye-closing period: %d samples (%.0f ms)\n", EyeClosing, EyeClosing*samplingInterval); printf("Minimum threshold: %d A/D units (%d microvolts)\n", - Tm, adumuv(signal, Tm)); + Tm, adumuv(sig, Tm)); printf("Power line frequency: %d Hz\n", PWFreq); printf("\n------------------------------------------------------\n\n"); printf("Processing:\n"); @@ -356,7 +356,7 @@ if (!learning) { /* Check that we haven't reached the end of the record. */ - (void)sample(signal, tpq); + (void)sample(sig, tpq); if (sample_valid() == 0) break; /* Record an annotation at the QRS onset */ annot.time = tpq; @@ -373,7 +373,7 @@ break; } } - (void)sample(signal, tj); + (void)sample(sig, tj); if (sample_valid() == 0) break; /* Record an annotation at the J-point */ annot.time = tj; diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/app/wvscript.c wfdb-10.3.16/app/wvscript.c --- wfdb-10.3.15/app/wvscript.c 2000-01-30 04:13:17.000000000 -0500 +++ wfdb-10.3.16/app/wvscript.c 1969-12-31 19:00:00.000000000 -0500 @@ -1,72 +0,0 @@ -/* file: wvscript.c G. Moody 21 May 1997 - Last revised: 30 April 1999 - -------------------------------------------------------------------------------- -wvscript: start wview from a wavescript-compatible script -Copyright (C) 1999 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/). -_______________________________________________________________________________ - -This program can be installed as a helper application for a web browser such -as Netscape, to handle application/x-wavescript (.xws) files under Windows. -(Under Linux or UNIX, use wavescript for this purpose.) -*/ - -#include - -main(argc, argv) -int argc; -char **argv; -{ - FILE *script; - static char record[20], annot[20] = "-", pstart[40]; - static char script_line[128], command_line[128]; - - if (argc < 2) { - fprintf(stderr, "usage: wvscript script-file\n"); - exit(1); - } - if ((script = fopen(argv[1], "rb")) == NULL) { - fprintf(stderr, "wvscript: can't open %s\n", argv[1]); - exit(2); - } - while (fgets(script_line, sizeof(script_line), script)) { - char *p, *q; - - if (strncmp(script_line, "-r", 2) == 0) { - for (p = script_line+3, q = record; *p != '+' && *p != '\n'; ) - *q++ = *p++; - *q = '\0'; - } - else if (strncmp(script_line, "-a", 2) == 0) { - for (p = script_line+3, q = annot; *p != '\n'; ) - *q++ = *p++; - *q = '\0'; - } - else if (strncmp(script_line, "-f", 2) == 0) { - for (p = script_line+3, q = pstart; *p != '\n'; ) - *q++ = *p++; - *q = '\0'; - } - } - sprintf(command_line, "wview %s %s %s\n", record, annot, pstart); - system(command_line); - return (0); -} - diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/conf/archname wfdb-10.3.16/conf/archname --- wfdb-10.3.15/conf/archname 1969-12-31 19:00:00.000000000 -0500 +++ wfdb-10.3.16/conf/archname 2005-06-13 04:05:34.000000000 -0400 @@ -0,0 +1,5 @@ +#!/bin/sh + +CPUOS=`uname -m`-`uname -s` +ARCH=`echo $CPUOS | tr -d " "` +echo $ARCH diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/conf/cygwin.def wfdb-10.3.16/conf/cygwin.def --- wfdb-10.3.15/conf/cygwin.def 2003-03-30 14:17:07.000000000 -0500 +++ wfdb-10.3.16/conf/cygwin.def 2005-06-10 09:42:40.000000000 -0400 @@ -1,5 +1,5 @@ # file: cygwin.def G. Moody 6 June 2000 -# Last revised: 30 March 2003 +# Last revised: 10 June 2005 # # This file contains default 'make' definitions for compiling the WFDB Software # Package under MS Windows using the free Cygwin/gcc ANSI C compiler, available @@ -28,6 +28,11 @@ # (a program that does nothing, successfully). LWC = libwww-config +# Similarly, to use the libcurl library instead of libwww, set LCC to +# 'curl-config'. Otherwise set LCC to ':'. Only one of libwww or +# libcurl should be enabled. +LCC = curl-config + # LDLIBWWW, which is appended to LDFLAGS below, is the set of options needed # to link with libwww. If libwww is not installed, or if libwfdb is a shared # library, LDLIBWWW can be empty (if there is a '#' immediately after the '=' @@ -37,6 +42,9 @@ # dependencies when linking to the static libwww libraries. LDLIBWWW = # `$(LWC) --libs` `$(LWC) --libs` `$(LWC) --libs` +# LDLIBCURL is the set of options needed to link with libcurl. +LDLIBCURL = # `$(LCC) --libs` `$(LCC) --libs` `$(LCC) --libs` + # BINDIR specifies the directory in which the applications will be installed; # it should be a directory in the PATH of those who will use the applications. BINDIR = $(WFDBROOT)/bin @@ -79,7 +87,6 @@ # int (see wfdblib.h) # -DNETFILES if you have libwww and want to be able to access WFDB files # remotely via http or ftp (as well as local files) -# -DNOMALLOC_H if you have neither `stdlib.h' nor `malloc.h' (see wfdblib.h) # -DNOSTRTOK if your standard C library does not include function `strtok' # (see wfdbio.c) # -DNOTIME if you do not have `time.h' (see signal.c) @@ -96,13 +103,13 @@ # -O if you trust your C compiler's optimizer # With the exception of `gcc', most C compilers do not allow you to use -g and # -O simultaneously. -CFLAGS = -g $(CCDEFS) `$(LWC) --cflags` -I$(INCDIR) +CFLAGS = -g $(CCDEFS) `$(LWC) --cflags` `$(LCC) --cflags` -I$(INCDIR) # `gcc' users may comment out the previous line, and uncomment the next one. -# CFLAGS = -g -O $(CCDEFS) `$(LWC) --cflags` -I$(INCDIR) +# CFLAGS = -g -O $(CCDEFS) `$(LWC) --cflags` `$(LCC) --cflags` -I$(INCDIR) # LDFLAGS is appended to the C compiler command line to specify loading the # WFDB library. -LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) +LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) $(LDLIBCURL) # WFDBLIB is the name of the standard WFDB library. In order to access it via # `-lwfdb', WFDBLIB should be `libwfdb.a'. diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/conf/cygwin-slib.def wfdb-10.3.16/conf/cygwin-slib.def --- wfdb-10.3.15/conf/cygwin-slib.def 2005-01-26 00:36:04.000000000 -0500 +++ wfdb-10.3.16/conf/cygwin-slib.def 2005-05-18 16:20:28.000000000 -0400 @@ -1,5 +1,5 @@ # file: cygwin-slib.def I. Henry and G. Moody 19 November 2002 -# Last revised: 26 January 2005 +# Last revised: 18 May 2005 # This section contains settings suitable for generating a DLL (shared library) # under MS Windows using the free Cygwin/gcc ANSI C compiler, available from @@ -22,12 +22,6 @@ # name of your home directory, as in the example below (change as needed). # WFDBROOT = /home/frodo -# If the W3C's libwww library of HTTP and FTP client code is available, and -# you wish to compile a WFDB library with NETFILES support, set LWC -# to 'libwww-config' (a utility supplied with libwww). Otherwise set -# LWC to ':' (a program that does nothing, successfully). -LWC = libwww-config - # BINDIR specifies the name of a directory in which to install the WFDB # DLL and the WFDB applications. BINDIR = $(WFDBROOT)/bin @@ -40,6 +34,17 @@ # library. LIBDIR = $(WFDBROOT)/lib +# If the W3C's libwww library of HTTP and FTP client code is available, and +# you wish to compile a WFDB library with NETFILES support, set LWC +# to 'libwww-config' (a utility supplied with libwww). Otherwise set +# LWC to ':' (a program that does nothing, successfully). +LWC = libwww-config + +# Similarly, to use the libcurl library instead of libwww, set LCC to +# 'curl-config'. Otherwise set LCC to ':'. Only one of libwww or +# libcurl should be enabled. +LCC = curl-config + # LDLIBWWW, which is appended to LDFLAGS below, is the set of options needed # to link with libwww. If libwww is not installed, or if libwfdb is a shared # library, LDLIBWWW can be empty (if there is a '#' immediately after the '=' @@ -49,9 +54,12 @@ # dependencies when linking to the static libwww libraries. LDLIBWWW = # `$(LWC) --libs` `$(LWC) --libs` `$(LWC) --libs` +# LDLIBCURL is the set of options needed to link with libcurl. +LDLIBCURL = # `$(LCC) --libs` `$(LCC) --libs` `$(LCC) --libs` + # LDFLAGS is appended to the C compiler command line to specify loading the # WFDB library. -LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) +LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) $(LDLIBCURL) # CC is the name of your C compiler. CC = gcc @@ -63,7 +71,7 @@ # CFLAGS is the set of C compiler options used when compiling the shared # library. CFLAGS should always include CCDEFS. -CFLAGS = -g -O $(CCDEFS) `$(LWC) --cflags` -I$(INCDIR) +CFLAGS = -g -O $(CCDEFS) `$(LWC) --cflags` `$(LCC) --cflags` -I$(INCDIR) # WFDBLIB_BASENAME is the name, without version numbers, of the alternate # library. WFDBLIB_SONAME is the shared object name ("soname") of the @@ -72,7 +80,7 @@ # version number. Symbolic links from WFDBLIB to WFDBLIB_BASENAME and # WFDBLIB_SONAME will be created as the final step in building the alternate # library. -WFDBLIB_DLLNAME = wfdb-cyg-$(MAJOR)-$(MINOR).dll +WFDBLIB_DLLNAME = cygwfdb-$(MAJOR)-$(MINOR).dll WFDBLIB_BASENAME = libwfdb.dll.a WFDBLIB_SONAME = $(WFDBLIB_BASENAME).$(MAJOR) WFDBLIB = $(WFDBLIB_SONAME).$(MINOR) @@ -94,7 +102,8 @@ # BUILDLIB_LDFLAGS is a list of arguments appended to BUILDLIB following # the list of *.o files. -BUILDLIB_LDFLAGS = `$(LWC) --libs` `$(LWC) --libs` `$(LWC) --libs` +BUILDLIB_LDFLAGS = `$(LWC) --libs` `$(LWC) --libs` `$(LWC) --libs` \ + `$(LCC) --libs` `$(LCC) --libs` `$(LCC) --libs` # LDCONFIG is the name of the program needed to refresh the system's cached # index of shared libraries. @@ -131,7 +140,6 @@ ( cp -p /usr/bin/cygwin1.dll $(BINDIR); \ cp -p /usr/bin/cygz.dll $(BINDIR) ) cp $(WFDBLIB_DLLNAME) $(BINDIR) - cd $(BINDIR); $(SETLPERMISSIONS) *.dll lib-post-uninstall: rm -f $(LIBDIR)/$(WFDBLIB_BASENAME) diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/conf/darwin.def wfdb-10.3.16/conf/darwin.def --- wfdb-10.3.15/conf/darwin.def 2003-03-04 15:33:14.000000000 -0500 +++ wfdb-10.3.16/conf/darwin.def 2005-05-13 16:36:35.000000000 -0400 @@ -26,6 +26,11 @@ # (a program that does nothing, successfully). LWC = libwww-config +# Similarly, to use the libcurl library instead of libwww, set LCC to +# 'curl-config'. Otherwise set LCC to ':'. Only one of libwww or +# libcurl should be enabled. +LCC = curl-config + # LDLIBWWW, which is appended to LDFLAGS below, is the set of options needed # to link with libwww. If libwww is not installed, or if libwfdb is a shared # library, LDLIBWWW can be empty (if there is a '#' immediately after the '=' @@ -35,6 +40,9 @@ # dependencies when linking to the static libwww libraries. LDLIBWWW = # `$(LWC) --libs` `$(LWC) --libs` `$(LWC) --libs` +# LDLIBCURL is the set of options needed to link with libcurl. +LDLIBCURL = # `$(LCC) --libs` `$(LCC) --libs` `$(LCC) --libs` + # BINDIR specifies the directory in which the applications will be installed; # it should be a directory in the PATH of those who will use the applications. BINDIR = $(WFDBROOT)/bin @@ -72,11 +80,11 @@ # CFLAGS is the set of C compiler options. CFLAGS should always include # CCDEFS. -CFLAGS = -g -O $(CCDEFS) `$(LWC) --cflags` -I$(INCDIR) +CFLAGS = -g -O $(CCDEFS) `$(LWC) --cflags` `$(LCC) --cflags` -I$(INCDIR) # LDFLAGS is appended to the C compiler command line to specify loading the # WFDB library. -LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) +LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) $(LDLIBCURL) # WFDBLIB is the name of the standard WFDB library. In order to access it via # `-lwfdb', WFDBLIB should be `libwfdb.a'. diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/conf/darwin-slib.def wfdb-10.3.16/conf/darwin-slib.def --- wfdb-10.3.15/conf/darwin-slib.def 2004-11-28 22:26:48.000000000 -0500 +++ wfdb-10.3.16/conf/darwin-slib.def 2005-05-13 16:36:35.000000000 -0400 @@ -27,6 +27,11 @@ # LWC to ':' (a program that does nothing, successfully). LWC = libwww-config +# Similarly, to use the libcurl library instead of libwww, set LCC to +# 'curl-config'. Otherwise set LCC to ':'. Only one of libwww or +# libcurl should be enabled. +LCC = curl-config + # BINDIR specifies the directory in which the applications will be installed; # it should be a directory in the PATH of those who will use the applications. BINDIR = $(WFDBROOT)/bin @@ -48,9 +53,12 @@ # dependencies when linking to the static libwww libraries. LDLIBWWW = # `$(LWC) --libs` `$(LWC) --libs` `$(LWC) --libs` +# LDLIBCURL is the set of options needed to link with libcurl. +LDLIBCURL = # `$(LCC) --libs` `$(LCC) --libs` `$(LCC) --libs` + # LDFLAGS is appended to the C compiler command line to specify loading the # WFDB library. -LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) +LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) $(LDLIBCURL) # CC is the name of your C compiler. CC = gcc @@ -62,7 +70,7 @@ # CFLAGS is the set of C compiler options used when compiling the shared # library. CFLAGS should always include CCDEFS. -CFLAGS = -fPIC -fno-common -g -O $(CCDEFS) `$(LWC) --cflags` -I$(INCDIR) +CFLAGS = -fPIC -fno-common -g -O $(CCDEFS) `$(LWC) --cflags` `$(LCC) --cflags` -I$(INCDIR) # WFDBLIB_BASENAME is the name, without version numbers, of the alternate # library. WFDBLIB_SONAME is the shared object name ("soname") of the @@ -89,7 +97,7 @@ BUILDLIB = gcc -dynamiclib -install_name $(LIBDIR)/$(WFDBLIB_SONAME) \ -compatibility_version $(MAJOR).$(MINOR) \ -current_version $(MAJOR).$(MINOR).$(RELEASE) \ - `$(LWC) --libs` -o $(WFDBLIB) + `$(LWC) --libs` `$(LCC) --libs` -o $(WFDBLIB) # BUILDLIB_LDFLAGS is a list of arguments appended to BUILDLIB following # the list of *.o files (for most platforms, BUILDLIB_LDFLAGS is empty). diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/conf/freebsd.def wfdb-10.3.16/conf/freebsd.def --- wfdb-10.3.15/conf/freebsd.def 2003-03-04 15:37:31.000000000 -0500 +++ wfdb-10.3.16/conf/freebsd.def 2005-05-13 16:36:35.000000000 -0400 @@ -26,6 +26,11 @@ # (a program that does nothing, successfully). LWC = libwww-config +# Similarly, to use the libcurl library instead of libwww, set LCC to +# 'curl-config'. Otherwise set LCC to ':'. Only one of libwww or +# libcurl should be enabled. +LCC = curl-config + # LDLIBWWW, which is appended to LDFLAGS below, is the set of options needed # to link with libwww. If libwww is not installed, or if libwfdb is a shared # library, LDLIBWWW can be empty (if there is a '#' immediately after the '=' @@ -35,6 +40,9 @@ # dependencies when linking to the static libwww libraries. LDLIBWWW = # `$(LWC) --libs` `$(LWC) --libs` `$(LWC) --libs` +# LDLIBCURL is the set of options needed to link with libcurl. +LDLIBCURL = # `$(LCC) --libs` `$(LCC) --libs` `$(LCC) --libs` + # BINDIR specifies the directory in which the applications will be installed; # it should be a directory in the PATH of those who will use the applications. BINDIR = $(WFDBROOT)/bin @@ -72,11 +80,11 @@ # CFLAGS is the set of C compiler options. CFLAGS should always include # CCDEFS. -CFLAGS = -g -O $(CCDEFS) `$(LWC) --cflags` -I$(INCDIR) +CFLAGS = -g -O $(CCDEFS) `$(LWC) --cflags` `$(LCC) --cflags` -I$(INCDIR) # LDFLAGS is appended to the C compiler command line to specify loading the # WFDB library. -LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) +LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) $(LDLIBCURL) # WFDBLIB is the name of the standard WFDB library. In order to access it via # `-lwfdb', WFDBLIB should be `libwfdb.a'. diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/conf/freebsd-slib.def wfdb-10.3.16/conf/freebsd-slib.def --- wfdb-10.3.15/conf/freebsd-slib.def 2004-11-28 22:27:08.000000000 -0500 +++ wfdb-10.3.16/conf/freebsd-slib.def 2005-05-13 16:36:35.000000000 -0400 @@ -27,6 +27,11 @@ # LWC to ':' (a program that does nothing, successfully). LWC = libwww-config +# Similarly, to use the libcurl library instead of libwww, set LCC to +# 'curl-config'. Otherwise set LCC to ':'. Only one of libwww or +# libcurl should be enabled. +LCC = curl-config + # BINDIR specifies the directory in which the applications will be installed; # it should be a directory in the PATH of those who will use the applications. BINDIR = $(WFDBROOT)/bin @@ -48,9 +53,12 @@ # dependencies when linking to the static libwww libraries. LDLIBWWW = # `$(LWC) --libs` `$(LWC) --libs` `$(LWC) --libs` +# LDLIBCURL is the set of options needed to link with libcurl. +LDLIBCURL = # `$(LCC) --libs` `$(LCC) --libs` `$(LCC) --libs` + # LDFLAGS is appended to the C compiler command line to specify loading the # WFDB library. -LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) +LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) $(LDLIBCURL) # CC is the name of your C compiler. CC = gcc @@ -62,7 +70,7 @@ # CFLAGS is the set of C compiler options used when compiling the shared # library. CFLAGS should always include CCDEFS. -CFLAGS = -fpic -g -O $(CCDEFS) `$(LWC) --cflags` -I$(INCDIR) +CFLAGS = -fpic -g -O $(CCDEFS) `$(LWC) --cflags` `$(LCC) --cflags` -I$(INCDIR) # WFDBLIB_BASENAME is the name, without version numbers, of the alternate # library. WFDBLIB_SONAME is the shared object name ("soname") of the @@ -86,7 +94,7 @@ # components have been compiled separately; the list of *.o files that # make up the library will be appended to BUILDLIB. BUILDLIB = gcc -shared -Wl,-soname,$(WFDBLIB_SONAME) `$(LWC) --libs` \ - -o $(WFDBLIB) + `$(LCC) --libs` -o $(WFDBLIB) # BUILDLIB_LDFLAGS is a list of arguments appended to BUILDLIB following # the list of *.o files (for most platforms, BUILDLIB_LDFLAGS is empty). diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/conf/generic.def wfdb-10.3.16/conf/generic.def --- wfdb-10.3.15/conf/generic.def 2003-03-04 15:34:53.000000000 -0500 +++ wfdb-10.3.16/conf/generic.def 2005-06-10 06:47:04.000000000 -0400 @@ -1,5 +1,5 @@ # file: generic.def G. Moody 31 May 2000 -# Last revised: 4 March 2003 +# Last revised: 10 June 2005 # This file contains default 'make' definitions for compiling the WFDB Software # Package under versions of UNIX that are not otherwise recognized by # 'configure'. @@ -32,6 +32,10 @@ # (a program that does nothing, successfully). LWC = libwww-config +# 'curl-config'. Otherwise set LCC to ':'. Only one of libwww or +# libcurl should be enabled. +LCC = curl-config + # LDLIBWWW, which is appended to LDFLAGS below, is the set of options needed # to link with libwww. If libwww is not installed, or if libwfdb is a shared # library, LDLIBWWW can be empty (if there is a '#' immediately after the '=' @@ -41,6 +45,9 @@ # dependencies when linking to the static libwww libraries. LDLIBWWW = # `$(LWC) --libs` `$(LWC) --libs` `$(LWC) --libs` +# LDLIBCURL is the set of options needed to link with libcurl. +LDLIBCURL = # `$(LCC) --libs` `$(LCC) --libs` `$(LCC) --libs` + # BINDIR specifies the directory in which the applications will be installed; # it should be a directory in the PATH of those who will use the applications. BINDIR = $(WFDBROOT)/bin @@ -91,7 +98,7 @@ # int (see wfdblib.h) # -DNETFILES if you have libwww and want to be able to access WFDB files # remotely via http or ftp (as well as local files) -# -DNOMALLOC_H if you have neither `stdlib.h' nor `malloc.h' (see wfdblib.h) +# -DHAVE_MALLOC_H if you have `malloc.h' but not `stdlib.h' (see wfdblib.h) # -DNOSTRTOK if your standard C library does not include function `strtok' # (see wfdbio.c) # -DNOTIME if you do not have `time.h' (see signal.c) @@ -108,13 +115,13 @@ # -O if you trust your C compiler's optimizer # With the exception of `gcc', most C compilers do not allow you to use -g and # -O simultaneously. -CFLAGS = -g $(CCDEFS) `$(LWC) --cflags` -I$(INCDIR) +CFLAGS = -g $(CCDEFS) `$(LWC) --cflags` `$(LCC) --cflags` -I$(INCDIR) # `gcc' users may comment out the previous line, and uncomment the next one. -# CFLAGS = -g -O $(CCDEFS) `$(LWC) --cflags` -I$(INCDIR) +# CFLAGS = -g -O $(CCDEFS) `$(LWC) --cflags` `$(LCC) --cflags` -I$(INCDIR) # LDFLAGS is appended to the C compiler command line to specify loading the # WFDB library. -LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) +LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) $(LDLIBCURL) # WFDBLIB is the name of the standard WFDB library. In order to access it via # `-lwfdb', WFDBLIB should be `libwfdb.a'. diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/conf/generic-slib.def wfdb-10.3.16/conf/generic-slib.def --- wfdb-10.3.15/conf/generic-slib.def 2004-11-28 22:28:12.000000000 -0500 +++ wfdb-10.3.16/conf/generic-slib.def 2005-06-10 06:47:54.000000000 -0400 @@ -1,5 +1,5 @@ # file: generic-slib.def G. Moody 31 May 2000 -# Last revised: 28 November 2004 +# Last revised: 10 June 2005 # 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 @@ -33,6 +33,11 @@ # LWC to ':' (a program that does nothing, successfully). LWC = libwww-config +# Similarly, to use the libcurl library instead of libwww, set LCC to +# 'curl-config'. Otherwise set LCC to ':'. Only one of libwww or +# libcurl should be enabled. +LCC = curl-config + # BINDIR specifies the directory in which the applications will be installed; # it should be a directory in the PATH of those who will use the applications. BINDIR = $(WFDBROOT)/bin @@ -54,9 +59,12 @@ # dependencies when linking to the static libwww libraries. LDLIBWWW = # `$(LWC) --libs` `$(LWC) --libs` `$(LWC) --libs` +# LDLIBCURL is the set of options needed to link with libcurl. +LDLIBCURL = # `$(LCC) --libs` `$(LCC) --libs` `$(LCC) --libs` + # LDFLAGS is appended to the C compiler command line to specify loading the # WFDB library. -LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) +LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) $(LDLIBCURL) # CC is the name of your C compiler. CC = gcc @@ -69,7 +77,7 @@ # int (see wfdblib.h) # -DNETFILES if you have libwww and want to be able to access WFDB files # remotely via http or ftp (as well as local files) -# -DNOMALLOC_H if you have neither `stdlib.h' nor `malloc.h' (see wfdblib.h) +# -DHAVE_MALLOC_H if you have `malloc.h' but not `stdlib.h' (see wfdblib.h) # -DNOSTRTOK if your standard C library does not include function `strtok' # (see wfdbio.c) # -DNOTIME if you do not have `time.h' (see signal.c) @@ -81,7 +89,7 @@ # CFLAGS is the set of C compiler options used when compiling the shared # library. CFLAGS should always include CCDEFS. -CFLAGS = -fpic -g -O $(CCDEFS) `$(LWC) --cflags` -I$(INCDIR) +CFLAGS = -fpic -g -O $(CCDEFS) `$(LWC) --cflags` `$(LCC) --cflags` -I$(INCDIR) # WFDBLIB_BASENAME is the name, without version numbers, of the alternate # library. WFDBLIB_SONAME is the shared object name ("soname") of the @@ -107,7 +115,7 @@ # considerably depending on the operating system; the setting here works # if gcc and the GNU binutils are installed. BUILDLIB = gcc -shared -Wl,-soname,$(SWFDBLIB_SONAME) \ - `$(LWC) --libs` -o $(SWFDBLIB) + `$(LWC) --libs` `$(LCC) --libs` -o $(SWFDBLIB) # BUILDLIB_LDFLAGS is a list of arguments appended to BUILDLIB following # the list of *.o files (for most platforms, BUILDLIB_LDFLAGS is empty). diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/conf/hpux.def wfdb-10.3.16/conf/hpux.def --- wfdb-10.3.15/conf/hpux.def 2003-03-04 15:34:11.000000000 -0500 +++ wfdb-10.3.16/conf/hpux.def 2005-05-13 16:36:35.000000000 -0400 @@ -24,6 +24,11 @@ # (a program that does nothing, successfully). LWC = libwww-config +# Similarly, to use the libcurl library instead of libwww, set LCC to +# 'curl-config'. Otherwise set LCC to ':'. Only one of libwww or +# libcurl should be enabled. +LCC = curl-config + # LDLIBWWW, which is appended to LDFLAGS below, is the set of options needed # to link with libwww. If libwww is not installed, or if libwfdb is a shared # library, LDLIBWWW can be empty (if there is a '#' immediately after the '=' @@ -33,6 +38,9 @@ # dependencies when linking to the static libwww libraries. LDLIBWWW = # `$(LWC) --libs` `$(LWC) --libs` `$(LWC) --libs` +# LDLIBCURL is the set of options needed to link with libcurl. +LDLIBCURL = # `$(LCC) --libs` `$(LCC) --libs` `$(LCC) --libs` + # BINDIR specifies the directory in which the applications will be installed; # it should be a directory in the PATH of those who will use the applications. BINDIR = $(WFDBROOT)/bin @@ -83,13 +91,13 @@ # -O if you trust your C compiler's optimizer # With the exception of `gcc', most C compilers do not allow you to use -g and # -O simultaneously. -CFLAGS = -g $(CCDEFS) `$(LWC) --cflags` -I$(INCDIR) +CFLAGS = -g $(CCDEFS) `$(LWC) --cflags` `$(LCC) --cflags` -I$(INCDIR) # `gcc' users may comment out the previous line, and uncomment the next one. -# CFLAGS = -g -O $(CCDEFS) `$(LWC) --cflags` -I$(INCDIR) +# CFLAGS = -g -O $(CCDEFS) `$(LWC) --cflags` `$(LCC) --cflags` -I$(INCDIR) # LDFLAGS is appended to the C compiler command line to specify loading the # WFDB library. -LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) +LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) $(LDLIBCURL) # WFDBLIB is the name of the standard WFDB library. In order to access it via # `-lwfdb', WFDBLIB should be `libwfdb.a'. diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/conf/hpux-slib.def wfdb-10.3.16/conf/hpux-slib.def --- wfdb-10.3.15/conf/hpux-slib.def 2004-11-28 22:29:25.000000000 -0500 +++ wfdb-10.3.16/conf/hpux-slib.def 2005-05-13 16:36:35.000000000 -0400 @@ -25,6 +25,11 @@ # LWC to ':' (a program that does nothing, successfully). LWC = libwww-config +# Similarly, to use the libcurl library instead of libwww, set LCC to +# 'curl-config'. Otherwise set LCC to ':'. Only one of libwww or +# libcurl should be enabled. +LCC = curl-config + # BINDIR specifies the directory in which the applications will be installed; # it should be a directory in the PATH of those who will use the applications. BINDIR = $(WFDBROOT)/bin @@ -50,9 +55,12 @@ # dependencies when linking to the static libwww libraries. LDLIBWWW = # `$(LWC) --libs` `$(LWC) --libs` `$(LWC) --libs` +# LDLIBCURL is the set of options needed to link with libcurl. +LDLIBCURL = # `$(LCC) --libs` `$(LCC) --libs` `$(LCC) --libs` + # LDFLAGS is appended to the C compiler command line to specify loading the # WFDB library. -LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) +LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) $(LDLIBCURL) # CC is the name of your C compiler. CC = gcc @@ -64,7 +72,7 @@ # CFLAGS is the set of C compiler options used when compiling the shared # library. CFLAGS should always include CCDEFS. -CFLAGS = -fpic -g -O $(CCDEFS) `$(LWC) --cflags` -I$(INCDIR) +CFLAGS = -fpic -g -O $(CCDEFS) `$(LWC) --cflags` `$(LCC) --cflags` -I$(INCDIR) # WFDBLIB_BASENAME is the name, without version numbers, of the alternate # library. WFDBLIB_SONAME is the shared object name ("soname") of the @@ -87,7 +95,7 @@ # BUILDLIB is the command that creates the shared WFDB library once its # components have been compiled separately; the list of *.o files that # make up the library will be appended to BUILDLIB. -BUILDLIB = ld -b `$(LWC) --libs` -o $(WFDBLIB) +BUILDLIB = ld -b `$(LWC) --libs` `$(LCC) --libs` -o $(WFDBLIB) # BUILDLIB_LDFLAGS is a list of arguments appended to BUILDLIB following # the list of *.o files (for most platforms, BUILDLIB_LDFLAGS is empty). diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/conf/linux.def wfdb-10.3.16/conf/linux.def --- wfdb-10.3.15/conf/linux.def 2003-03-04 15:32:57.000000000 -0500 +++ wfdb-10.3.16/conf/linux.def 2005-05-13 16:36:35.000000000 -0400 @@ -24,6 +24,11 @@ # (a program that does nothing, successfully). LWC = libwww-config +# Similarly, to use the libcurl library instead of libwww, set LCC to +# 'curl-config'. Otherwise set LCC to ':'. Only one of libwww or +# libcurl should be enabled. +LCC = curl-config + # LDLIBWWW, which is appended to LDFLAGS below, is the set of options needed # to link with libwww. If libwww is not installed, or if libwfdb is a shared # library, LDLIBWWW can be empty (if there is a '#' immediately after the '=' @@ -33,6 +38,9 @@ # dependencies when linking to the static libwww libraries. LDLIBWWW = # `$(LWC) --libs` `$(LWC) --libs` `$(LWC) --libs` +# LDLIBCURL is the set of options needed to link with libcurl. +LDLIBCURL = # `$(LCC) --libs` `$(LCC) --libs` `$(LCC) --libs` + # BINDIR specifies the directory in which the applications will be installed; # it should be a directory in the PATH of those who will use the applications. BINDIR = $(WFDBROOT)/bin @@ -70,11 +78,11 @@ # CFLAGS is the set of C compiler options. CFLAGS should always include # CCDEFS. -CFLAGS = -g -O $(CCDEFS) `$(LWC) --cflags` -I$(INCDIR) +CFLAGS = -g -O $(CCDEFS) `$(LWC) --cflags` `$(LCC) --cflags` -I$(INCDIR) # LDFLAGS is appended to the C compiler command line to specify loading the # WFDB library. -LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) +LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) $(LDLIBCURL) # WFDBLIB is the name of the standard WFDB library. In order to access it via # `-lwfdb', WFDBLIB should be `libwfdb.a'. diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/conf/linux-slib.def wfdb-10.3.16/conf/linux-slib.def --- wfdb-10.3.15/conf/linux-slib.def 2005-01-01 21:02:34.000000000 -0500 +++ wfdb-10.3.16/conf/linux-slib.def 2005-06-08 16:16:59.000000000 -0400 @@ -1,5 +1,5 @@ # file: linux-slib.def G. Moody 31 May 2000 -# Last revised: 28 November 2004 +# Last revised: 8 June 2005 # This section contains settings suitable for generating an ELF-format shared # library under Linux. @@ -25,6 +25,11 @@ # LWC to ':' (a program that does nothing, successfully). LWC = libwww-config +# Similarly, to use the libcurl library instead of libwww, set LCC to +# 'curl-config'. Otherwise set LCC to ':'. Only one of libwww or +# libcurl should be enabled. +LCC = curl-config + # BINDIR specifies the directory in which the applications will be installed; # it should be a directory in the PATH of those who will use the applications. BINDIR = $(WFDBROOT)/bin @@ -46,9 +51,12 @@ # dependencies when linking to the static libwww libraries. LDLIBWWW = # `$(LWC) --libs` `$(LWC) --libs` `$(LWC) --libs` +# LDLIBCURL is the set of options needed to link with libcurl. +LDLIBCURL = # `$(LCC) --libs` `$(LCC) --libs` `$(LCC) --libs` + # LDFLAGS is appended to the C compiler command line to specify loading the # WFDB library. -LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) +LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) $(LDLIBCURL) # CC is the name of your C compiler. CC = gcc @@ -60,7 +68,7 @@ # CFLAGS is the set of C compiler options used when compiling the shared # library. CFLAGS should always include CCDEFS. -CFLAGS = -fpic -g -O $(CCDEFS) `$(LWC) --cflags` -I$(INCDIR) +CFLAGS = -fpic -g -O $(CCDEFS) `$(LWC) --cflags` `$(LCC) --cflags` -I$(INCDIR) # WFDBLIB_BASENAME is the name, without version numbers, of the alternate # library. WFDBLIB_SONAME is the shared object name ("soname") of the @@ -84,7 +92,7 @@ # components have been compiled separately; the list of *.o files that # make up the library will be appended to BUILDLIB. BUILDLIB = gcc -shared -Wl,-soname,$(WFDBLIB_SONAME) `$(LWC) --libs` \ - -o $(WFDBLIB) + `$(LCC) --libs` -o $(WFDBLIB) # BUILDLIB_LDFLAGS is a list of arguments appended to BUILDLIB following # the list of *.o files (for most platforms, BUILDLIB_LDFLAGS is empty). diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/conf/mingw.def wfdb-10.3.16/conf/mingw.def --- wfdb-10.3.15/conf/mingw.def 1969-12-31 19:00:00.000000000 -0500 +++ wfdb-10.3.16/conf/mingw.def 2005-06-10 09:42:23.000000000 -0400 @@ -0,0 +1,209 @@ +# file: mingw.def I. Henry and G. Moody 11 February 2005 +# Last revised: 10 June 2005 +# +# This file contains default 'make' definitions for compiling the WFDB Software +# Package under MS Windows using the free Mininmalist GNU for Windows (MinGW) +# gcc ANSI C compiler, availble from http://www.mingw.org/ and from +# http://www.cygwin.com/. To use this successfully, you need to have installed +# MinGW +# +# Choose a value for WFDBROOT to determine where the WFDB Software Package will +# be installed. One of the following is usually a reasonable choice. +# Installing in /usr generally requires root permissions, but will be easiest +# for future software development (no special -I or -L options will be needed +# to compile software with the WFDB library, since the *.h files and the +# library will be installed in the standard directories). +WFDBROOT = /usr +# Installing in /usr/local usually requires root permissions. On a multi-user +# system where it is desirable to keep the OS vendor's software separate from +# other software, this is a good choice. Another common choice in such cases +# is /opt . +# WFDBROOT = /usr/local +# To install without root permissions, a good choice is to set WFDBROOT to the +# name of your home directory, as in the example below (change as needed). +# WFDBROOT = /home/frodo + +# If the W3C's libwww library of HTTP and FTP client code is available, and +# you wish to compile a WFDB library with NETFILES support, set LWC to +# 'libwww-config' (a utility supplied with libwww). Otherwise set LWC to ':' +# (a program that does nothing, successfully). +LWC = libwww-config + +# Similarly, to use the libcurl library instead of libwww, set LCC to +# 'curl-config'. Otherwise set LCC to ':'. Only one of libwww or +# libcurl should be enabled. +LCC = curl-config + +# LDLIBWWW, which is appended to LDFLAGS below, is the set of options needed +# to link with libwww. If libwww is not installed, or if libwfdb is a shared +# library, LDLIBWWW can be empty (if there is a '#' immediately after the '=' +# below, the remainder of the line is ignored, so LDLIBWWW is empty in this +# case). Otherwise, it is generated from the output of LWC. Note that up to +# three passes through the option list are necessary to satisfy all +# dependencies when linking to the static libwww libraries. +LDLIBWWW = # `$(LWC) --libs` `$(LWC) --libs` `$(LWC) --libs` + +# LDLIBCURL is the set of options needed to link with libcurl. +LDLIBCURL = # `$(LCC) --libs` `$(LCC) --libs` `$(LCC) --libs` + +# BINDIR specifies the directory in which the applications will be installed; +# it should be a directory in the PATH of those who will use the applications. +BINDIR = $(WFDBROOT)/bin + +# DBDIR specifies the name of a directory in which to install the contents +# of the `data' directory. +DBDIR = $(WFDBROOT)/database + +# INCDIR specifies the name of a directory in which to install the WFDB +# library's #include <...> files. +INCDIR = $(WFDBROOT)/include + +# INFODIR is the GNU info directory (optional, needed to `make info'). +INFODIR = $(WFDBROOT)/info + +# LIBDIR specifies the name of a directory in which to install the WFDB +# library. +LIBDIR = $(WFDBROOT)/lib + +# MANDIR is the root of the man page directory tree. On most systems, this is +# something like /usr/man or /usr/local/man (type 'man man' to find out). +MANDIR = $(WFDBROOT)/man + +# PSPDIR specifies the name of a directory in which to install the PostScript +# prolog (*.pro) files from the 'app' directory. +PSPDIR = $(WFDBROOT)/lib/ps + +# CC is the name of your C compiler. The WFDB library can be compiled with K&R +# C compilers (`cc' on most if not all UNIX systems) as well as with ANSI C +# compilers such as GNU C (`gcc'). +CC = gcc NOCYGWIN +# On systems where `gcc' is the standard C compiler, `gcc' may also be known as +# `cc'; in such cases, it doesn't matter if CC is cc or gcc. + +# CCDEFS is the set of C compiler options needed to set preprocessor variables +# while compiling the WFDB Software Package. CCDEFS should always include +# VDEFS. Add the following options to CCDEFS as appropriate (separating them +# by spaces if you use more than one): +# -DISPRINTF if you do not have `stdlib.h' and your `sprintf' returns an +# int (see wfdblib.h) +# -DNETFILES if you have libwww and want to be able to access WFDB files +# remotely via http or ftp (as well as local files) +# -DNOSTRTOK if your standard C library does not include function `strtok' +# (see wfdbio.c) +# -DNOTIME if you do not have `time.h' (see signal.c) +# -DNOVALUES_H if you do not have `values.h' (see psd/log10.c) +# -DOLDC if you have neither `stdarg.h' nor `varargs.h' (see wfdbio.c) +# If your C compiler fails to compile `signal.c', add -DBROKEN_CC to CCDEFS +# and try again (see signal.c). +CCDEFS = $(VDEFS) -DNOVALUES_H -DNOMKSTEMP + +# CFLAGS is the set of C compiler options. CFLAGS should always include +# CCDEFS. Add the following options to CFLAGS as appropriate (separating them +# by spaces if you use more than one): +# -g to save symbols for debugging +# -O if you trust your C compiler's optimizer +# With the exception of `gcc', most C compilers do not allow you to use -g and +# -O simultaneously. +CFLAGS = -g $(CCDEFS) `$(LWC) --cflags` `$(LCC) --cflags` -I$(INCDIR) +# `gcc' users may comment out the previous line, and uncomment the next one. +# CFLAGS = -g -O $(CCDEFS) `$(LWC) --cflags` `$(LCC) --cflags` -I$(INCDIR) + +# LDFLAGS is appended to the C compiler command line to specify loading the +# WFDB library. +LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) $(LDLIBCURL) + +# WFDBLIB is the name of the standard WFDB library. In order to access it via +# `-lwfdb', WFDBLIB should be `libwfdb.a'. +WFDBLIB = libwfdb.a + +# If your system requires indexed libraries, uncomment the next line. +RANLIB = ranlib +# Otherwise, uncomment the next line. +# RANLIB = : + +# AR is the name of the command used to build a standard library from `.o' +# files, and ARFLAGS is the set of options used when doing so. AR and ARFLAGS +# are usually `make' builtins and need not be defined here; under HP UX, and +# perhaps other versions of UNIX, however, you will need to define these +# variables by uncommenting the next two lines. +# AR = ar +# ARFLAGS = rv + +# BUILDLIB is the command that creates the static WFDB library once its +# components have been compiled separately; the list of *.o files that +# make up the library will be appended to BUILDLIB. +BUILDLIB = $(AR) $(ARFLAGS) $(WFDBLIB) + +# PRINT is the name of the program used to produce listings (including any +# options for the desired formatting). +PRINT = lpr + +# SETPERMISSIONS is the command needed to make the installed files accessible +# to those who will use them. The value given below makes them readable by +# everyone, and writeable by the owner only. (If you perform the installation +# as `root', `root' is the owner of the installed files.) +SETPERMISSIONS = chmod 644 + +# SETDPERMISSIONS is similarly used to make directories created during the +# installation accessible. +SETDPERMISSIONS = chmod 755 + +# SETLPERMISSIONS is the command needed to make the WFDB library usable by +# programs linked to it. +SETLPERMISSIONS = chmod 644 + +# SETXPERMISSIONS is the command needed to make the applications accessible. +SETXPERMISSIONS = $(SRCDIR)/conf/exechmod 755 + +# STRIP is the command used to compact the compiled binaries by removing their +# symbol tables. 'exestrip' is a script that appends the '.exe' suffix to the +# files in its argument list before passing their names to 'strip' itself. +STRIP = $(SRCDIR)/conf/exestrip +# To retain the symbol tables for debugging, comment out the previous line, and +# uncomment the next line. +# STRIP = : + +# RM is the command used to delete binaries. 'exerm' is a script that appends +# the '.exe' suffix to the files in its argument list before deleting. +RM = $(SRCDIR)/conf/exerm + +# ........................................................................... +# This section of definitions is used only when compiling WAVE, which is +# possible only if the XView and Xlib libraries and include files have been +# installed. + +# OPENWINHOME specifies the root directory of the OpenWindows hierarchy. +# This is usually /usr/openwin. +OPENWINHOME = /usr/openwin + +# OWINCDIR is the directory in which the `xview' directory containing XView +# *.h files is found. +OWINCDIR = $(OPENWINHOME)/include + +# OWLIBDIR is the directory in which the XView library is found. +OWLIBDIR = $(OPENWINHOME)/lib + +# WCFLAGS is the set of C compiler options to use when compiling WAVE. +WCFLAGS = $(CFLAGS) -I$(OWINCDIR) + +# HELPOBJ can be set to "help.o" if you wish to recompile the XView spot help +# functions in "wave/help.c" (recommended under Linux). +# HELPOBJ = help.o +# Otherwise, use the version in libxview by uncommenting the next line: +HELPOBJ = + +# WLDFLAGS is the set of loader options appended to the C compiler command line +# to specify loading the WFDB, XView, and Xlib libraries. +WLDFLAGS = $(LDFLAGS) -L$(OWLIBDIR) -L/usr/X11R6/lib -lxview -lolgx -lX11 +# ........................................................................... + +# `make' (with no target specified) will be equivalent to `make all'. +make-all: all + +# `make lib-post-install' should be run after installing the WFDB library. +lib-post-install: + echo "Nothing to be done for lib-post-install" + +lib-post-uninstall: + echo "Nothing to be done for lib-post-uninstall" +# _____________________________________________________________________________ diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/conf/mingw-slib.def wfdb-10.3.16/conf/mingw-slib.def --- wfdb-10.3.15/conf/mingw-slib.def 1969-12-31 19:00:00.000000000 -0500 +++ wfdb-10.3.16/conf/mingw-slib.def 2005-06-08 16:05:32.000000000 -0400 @@ -0,0 +1,151 @@ +# file: mingw-slib.def I. Henry and G. Moody 11 February 2005 +# Last revised: 8 June 2005 +# +# This section contains settings suitable for generating a DLL (shared library) +# under MS Windows using the free gcc ANSI C compiler. +# +# Choose a value for WFDBROOT to determine where the WFDB Software Package will +# be installed. One of the following is usually a reasonable choice. +# Installing in /usr generally requires root permissions, but will be easiest +# for future software development (no special -I or -L options will be needed +# to compile software with the WFDB library, since the *.h files and the +# library will be installed in the standard directories). +WFDBROOT = /usr +# Installing in /usr/local usually requires root permissions. On a multi-user +# system where it is desirable to keep the OS vendor's software separate from +# other software, this is a good choice. Another common choice in such cases +# is /opt . +# WFDBROOT = /usr/local +# To install without root permissions, a good choice is to set WFDBROOT to the +# name of your home directory, as in the example below (change as needed). +# WFDBROOT = /home/frodo + +# If the W3C's libwww library of HTTP and FTP client code is available, and +# you wish to compile a WFDB library with NETFILES support, set LWC +# to 'libwww-config' (a utility supplied with libwww). Otherwise set +# LWC to ':' (a program that does nothing, successfully). +LWC = libwww-config + +# Similarly, to use the libcurl library instead of libwww, set LCC to +# 'curl-config'. Otherwise set LCC to ':'. Only one of libwww or +# libcurl should be enabled. +LCC = curl-config + +# INCDIR specifies the name of a directory in which to install the WFDB +# library's #include <...> files. +INCDIR = $(WFDBROOT)/include + +# LIBDIR specifies the name of a directory in which to install the WFDB +# library. +LIBDIR = $(WFDBROOT)/lib + +# BINDIR specifies the name of a directory in which to install the WFDB +# DLL. +BINDIR = $(WFDBROOT)/bin + +# CC is the name of your C compiler. +CC = gcc NOCYGWIN + +# 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) -DNOVALUES_H -DNOMKSTEMP + +# CFLAGS is the set of C compiler options used when compiling the shared +# library. CFLAGS should always include CCDEFS. +CFLAGS = -g -O $(CCDEFS) `$(LWC) --cflags` `$(LCC) --cflags` -I$(INCDIR) + +# WFDBLIB_BASENAME is the name, without version numbers, of the alternate +# library. WFDBLIB_SONAME is the shared object name ("soname") of the +# alternate library; normally, this includes the base name and the major +# version number only. WFDBLIB is the complete name, including the minor +# version number. Symbolic links from WFDBLIB to WFDBLIB_BASENAME and +# WFDBLIB_SONAME will be created as the final step in building the alternate +# library. +WFDBLIB_DLLNAME = wfdb-$(MAJOR).$(MINOR).dll +WFDBLIB_BASENAME = libwfdb.dll.a +WFDBLIB_SONAME = $(WFDBLIB_BASENAME).$(MAJOR) +WFDBLIB = $(WFDBLIB_SONAME).$(MINOR) +# For a shared library, the soname is significant for proper run-time binding. +# If you change function interfaces in the library, change its soname by +# incrementing the major version number; when you do this, set the minor +# version number to zero. If you change the library without changing the +# function interfaces, increment the minor version number; this allows existing +# binaries to use the new version without recompilation, since the soname is +# unchanged in this case. + +# BUILDLIB is the command that creates the shared WFDB library once its +# components have been compiled separately; the list of *.o files that +# make up the library will be appended to BUILDLIB. +BUILDLIB = gcc NOCYGWIN -shared -o $(WFDBLIB_DLLNAME) \ + -Wl,--out-implib=$(WFDBLIB) \ + -Wl,--export-all-symbols \ + -Wl,--enable-auto-import + +# BUILDLIB_LDFLAGS is a list of arguments appended to BUILDLIB following +# the list of *.o files. +BUILDLIB_LDFLAGS = `$(LWC) --libs` `$(LWC) --libs` `$(LWC) --libs` \ + `$(LCC) --libs` `$(LCC) --libs` `$(LCC) --libs` + +# LDCONFIG is the name of the program needed to refresh the system's cached +# index of shared libraries. +LDCONFIG = /sbin/ldconfig + +# PRINT is the name of the program used to produce listings (including any +# options for the desired formatting). +PRINT = lpr + +# SETPERMISSIONS is the command needed to make the installed files accessible +# to those who will use them. The value given below makes them readable by +# everyone, and writeable by the owner only. (If you perform the installation +# as `root', `root' is the owner of the installed files.) +SETPERMISSIONS = chmod 644 + +# SETDPERMISSIONS is similarly used to make directories created during the +# installation accessible. +SETDPERMISSIONS = chmod 755 + +# SETLPERMISSIONS is the command needed to make the WFDB library usable by +# programs linked to it. +SETLPERMISSIONS = chmod 755 + +# STRIP is the command used to compact the compiled binaries by removing their +# symbol tables. 'exestrip' is a script that appends the '.exe' suffix to the +# files in its argument list before passing their names to 'strip' itself. +STRIP = $(SRCDIR)/conf/exestrip +# To retain the symbol tables for debugging, comment out the previous line, and +# uncomment the next line. +# STRIP = : + +# RM is the command used to delete binaries. 'exerm' is a script that appends +# the '.exe' suffix to the files in its argument list before deleting. +RM = $(SRCDIR)/conf/exerm + +OTHER_CLEAN_FILES = $(WFDBLIB_DLLNAME) + +# `make' (with no target specified) will be equivalent to `make all'. +make-all: all + +# `make lib-post-install' should be run after installing the WFDB library. +lib-post-install: + cd $(LIBDIR); ln -sf $(WFDBLIB) $(WFDBLIB_BASENAME) + cd $(LIBDIR); ln -sf $(WFDBLIB) $(WFDBLIB_SONAME) + cp $(WFDBLIB_DLLNAME) $(BINDIR) + +lib-post-uninstall: + rm -f $(LIBDIR)/$(WFDBLIB_BASENAME) + rm -f $(LIBDIR)/$(WFDBLIB_SONAME) + rm -f $(BINDIR)/$(WFDBLIB_DLLNAME) + + +#______________________________________________________________________________ + + + + + + + + + + diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/conf/solaris.def wfdb-10.3.16/conf/solaris.def --- wfdb-10.3.15/conf/solaris.def 2003-03-04 15:39:59.000000000 -0500 +++ wfdb-10.3.16/conf/solaris.def 2005-05-13 16:36:35.000000000 -0400 @@ -25,6 +25,11 @@ # (a program that does nothing, successfully). LWC = libwww-config +# Similarly, to use the libcurl library instead of libwww, set LCC to +# 'curl-config'. Otherwise set LCC to ':'. Only one of libwww or +# libcurl should be enabled. +LCC = curl-config + # LDLIBWWW, which is appended to LDFLAGS below, is the set of options needed # to link with libwww. If libwww is not installed, or if libwfdb is a shared # library, LDLIBWWW can be empty (if there is a '#' immediately after the '=' @@ -34,6 +39,9 @@ # dependencies when linking to the static libwww libraries. LDLIBWWW = # `$(LWC) --libs` `$(LWC) --libs` `$(LWC) --libs` +# LDLIBCURL is the set of options needed to link with libcurl. +LDLIBCURL = # `$(LCC) --libs` `$(LCC) --libs` `$(LCC) --libs` + # BINDIR specifies the directory in which the applications will be installed; # it should be a directory in the PATH of those who will use the applications. BINDIR = $(WFDBROOT)/bin @@ -76,13 +84,13 @@ # CFLAGS is the set of C compiler options. CFLAGS should always include # CCDEFS. With the exception of `gcc', most C compilers do not allow you to # use -g and -O simultaneously. -CFLAGS = -O $(CCDEFS) `$(LWC) --cflags` -I$(INCDIR) +CFLAGS = -O $(CCDEFS) `$(LWC) --cflags` `$(LCC) --cflags` -I$(INCDIR) # `gcc' users may comment out the previous line, and uncomment the next one. -# CFLAGS = -g -O $(CCDEFS) `$(LWC) --cflags` -I$(INCDIR) +# CFLAGS = -g -O $(CCDEFS) `$(LWC) --cflags` `$(LCC) --cflags` -I$(INCDIR) # LDFLAGS is appended to the C compiler command line to specify loading the # WFDB library. -LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) +LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) $(LDLIBCURL) # WFDBLIB is the name of the standard WFDB library. In order to access it via # `-lwfdb', WFDBLIB should be `libwfdb.a'. diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/conf/solaris-slib.def wfdb-10.3.16/conf/solaris-slib.def --- wfdb-10.3.15/conf/solaris-slib.def 2004-11-28 22:29:46.000000000 -0500 +++ wfdb-10.3.16/conf/solaris-slib.def 2005-05-13 16:36:36.000000000 -0400 @@ -25,6 +25,11 @@ # LWC to ':' (a program that does nothing, successfully). LWC = libwww-config +# Similarly, to use the libcurl library instead of libwww, set LCC to +# 'curl-config'. Otherwise set LCC to ':'. Only one of libwww or +# libcurl should be enabled. +LCC = curl-config + # BINDIR specifies the directory in which the applications will be installed; # it should be a directory in the PATH of those who will use the applications. BINDIR = $(WFDBROOT)/bin @@ -46,9 +51,12 @@ # dependencies when linking to the static libwww libraries. LDLIBWWW = # `$(LWC) --libs` `$(LWC) --libs` `$(LWC) --libs` +# LDLIBCURL is the set of options needed to link with libcurl. +LDLIBCURL = # `$(LCC) --libs` `$(LCC) --libs` `$(LCC) --libs` + # LDFLAGS is appended to the C compiler command line to specify loading the # WFDB library. -LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) +LDFLAGS = -L$(LIBDIR) -lwfdb $(LDLIBWWW) $(LDLIBCURL) # CC is the name of your C compiler. CC = gcc @@ -61,11 +69,11 @@ # CFLAGS is the set of C compiler options used when compiling the shared # library. CFLAGS should always include CCDEFS. These settings are for use # with gcc: -CFLAGS = -fpic -g -O $(CCDEFS) `$(LWC) --cflags` -I$(INCDIR) +CFLAGS = -fpic -g -O $(CCDEFS) `$(LWC) --cflags` `$(LCC) --cflags` -I$(INCDIR) # For SunOS `cc', uncomment the next line. -# CFLAGS = -pic -O $(CCDEFS) `$(LWC) --cflags` -I$(INCDIR) +# CFLAGS = -pic -O $(CCDEFS) `$(LWC) --cflags` `$(LCC) --cflags` -I$(INCDIR) # For Solaris or SVR4 `cc', uncomment the next line. -# CFLAGS = -K PIC -O $(CCDEFS) `$(LWC) --cflags` -I$(INCDIR) +# CFLAGS = -K PIC -O $(CCDEFS) `$(LWC) --cflags` `$(LCC) --cflags` -I$(INCDIR) # WFDBLIB_BASENAME is the name, without version numbers, of the alternate # library. WFDBLIB_SONAME is the shared object name ("soname") of the @@ -88,7 +96,7 @@ # BUILDLIB is the command that creates the shared WFDB library once its # components have been compiled separately; the list of *.o files that # make up the library will be appended to BUILDLIB. -BUILDLIB = ld -o $(WFDBLIB) -G -z text `$(LWC) --libs` +BUILDLIB = ld -o $(WFDBLIB) -G -z text `$(LWC) --libs` `$(LCC) --libs` # BUILDLIB_LDFLAGS is a list of arguments appended to BUILDLIB following # the list of *.o files (for most platforms, BUILDLIB_LDFLAGS is empty). diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/conf/version.def wfdb-10.3.16/conf/version.def --- wfdb-10.3.15/conf/version.def 2005-01-01 20:58:59.000000000 -0500 +++ wfdb-10.3.16/conf/version.def 2005-06-11 17:51:57.000000000 -0400 @@ -1,10 +1,10 @@ # file: version.def G. Moody 24 May 2000 -# Last revised: 1 January 2005 +# Last revised: 11 June 2005 # Each release of the WFDB Software Package is identified by a three-part # version number, defined here: MAJOR = 10 MINOR = 3 -RELEASE = 15 +RELEASE = 16 VERSION = $(MAJOR).$(MINOR).$(RELEASE) # RPMRELEASE can be incremented if changes are made between official @@ -16,6 +16,6 @@ VDEFS = -DWFDB_MAJOR=$(MAJOR) -DWFDB_MINOR=$(MINOR) -DWFDB_RELEASE=$(RELEASE) # WAVEVERSION is the WAVE version number. -WAVEVERSION = 6.7 +WAVEVERSION = 6.8 # _____________________________________________________________________________ diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/configure wfdb-10.3.16/configure --- wfdb-10.3.15/configure 2004-11-14 11:29:16.000000000 -0500 +++ wfdb-10.3.16/configure 2005-06-08 16:38:39.000000000 -0400 @@ -1,6 +1,6 @@ #! /bin/sh # file: configure G. Moody 24 May 2000 -# Last revised: 14 November 2004 +# Last revised: 8 June 2005 # Configuration script for the WFDB Software Package # This script was not generated using 'autoconf'. If you can implement @@ -18,13 +18,14 @@ for i in $* do case $i in - --dynamic) LIBTYPE=dynamic ;; - --mandir=*) MANDIR=`echo $i | sed 's/[-a-zA-Z0-9]*=//'` ;; - --prefix=*) DIR=`echo $i | sed 's/[-a-zA-Z0-9]*=//'` ;; - --shared) LIBTYPE=dynamic ;; - --static) LIBTYPE=static ;; - --static_only) LIBTYPE=static - SYSLIBS=static ;; + --dynamic) LIBTYPE=dynamic ;; + --mandir=*) MANDIR=`echo $i | sed 's/[-a-zA-Z0-9]*=//'` ;; + --prefix=*) DIR=`echo $i | sed 's/[-a-zA-Z0-9]*=//'` ;; + --shared) LIBTYPE=dynamic ;; + --static) LIBTYPE=static ;; + --static_only) LIBTYPE=static + SYSLIBS=static ;; + --no-cygwin) NOCYGWIN=yes ;; *) cat <site-slib.def cat hpux.def >>site.def ;; - CYGWIN*) OS=cygwin - cat site.def cygwin-slib.def >site-slib.def - cat cygwin.def >>site.def ;; + CYGWIN*) + if [ "x$NOCYGWIN" = "xyes" ] + then + OS=mingw + sed 's/NOCYGWIN/-mno-cygwin/' site.def mingw-slib.def >site-slib.def + sed 's/NOCYGWIN/-mno-cygwin/' mingw.def >>site.def + else + OS=cygwin + cat site.def cygwin-slib.def >site-slib.def + cat cygwin.def >>site.def + fi ;; + MINGW*) OS=mingw + sed 's/NOCYGWIN//' site.def mingw-slib.def >site-slib.def + sed 's/NOCYGWIN//' mingw.def >>site.def ;; Darwin*) OS=Darwin LIBTYPE=dynamic cat site.def darwin-slib.def >site-slib.def @@ -271,39 +285,82 @@ echo "The manual pages will be installed in '$MANDIR'." echo -./prompt "Looking for libwww ..." -WLC=`which libwww-config 2>&1` -if [ "x$WLC" = "x" ] +./prompt "Looking for libcurl ..." +WLCC=`which curl-config 2>&1` +if [ "x$WLCC" = "x" ] then - WLC="no libwww-config" + WLCC="no curl-config" fi -if ( echo $WLC | grep "no \|not " >/dev/null ) +if ( echo $WLCC | grep "no \|not " >/dev/null ) then echo "not found" - echo "The WFDB software will be compiled without NETFILES access, because" - echo "libwww does not appear to be installed on this system." - echo "To add NETFILES access, install libwww and run ./configure again." - echo "NETFILES=0" >../config.cache - sed "s/LWC = libwww-config/LWC = :/" site.tmp - mv site.tmp site.def - sed "s/LWC = libwww-config/LWC = :/" site.tmp - mv site.tmp site-slib.def - sed "s/WFDB_NETFILES 1/WFDB_NETFILES 0/" <../lib/wfdb.h0 >../lib/wfdb.h - WITHNF=without + ./prompt "Looking for libwww ..." + WLC=`which libwww-config 2>&1` + if [ "x$WLC" = "x" ] + then + WLC="no libwww-config" + fi + if ( echo $WLC | grep "no \|not " >/dev/null ) + then + echo "not found" + + echo "not found" + echo "The WFDB software will be compiled without NETFILES" + echo "access, because neither libcurl nor libwww appears to be" + echo "installed on this system. To add NETFILES access," + echo "install libcurl or libwww and run ./configure again." + + echo "NETFILES=0" >../config.cache + echo "NETFILES_LIBCURL=0" >../config.cache + sed "s/LWC = libwww-config/LWC = :/" site.tmp + sed "s/LCC = curl-config/LCC = :/" site.def + sed "s/LWC = libwww-config/LWC = :/" site.tmp + sed "s/LCC = curl-config/LCC = :/" site-slib.def + rm site.tmp + sed "s/WFDB_NETFILES 1/WFDB_NETFILES 0/" <../lib/wfdb.h0 | \ + sed "s/WFDB_NETFILES_LIBCURL 1/WFDB_NETFILES_LIBCURL 0/" >../lib/wfdb.h + VIANF="" + WITHNF=without + else + echo "found" + echo "The WFDB software will be compiled with NETFILES access" + echo "using libwww." + echo "NETFILES=1" >../config.cache + echo "NETFILES_LIBCURL=0" >../config.cache + sed "s/LWC = :/LWC = libwww-config/" site.tmp + sed "s/LCC = curl-config/LCC = :/" site.def + if [ $LIBTYPE = "static" ] + then + sed "s/LDLIBWWW = #/LDLIBWWW =/" site.tmp + mv site.tmp site.def + fi + sed "s/LWC = :/LWC = libwww-config/" site.tmp + sed "s/LCC = curl-config/LCC = :/" site-slib.def + rm site.tmp + sed "s/WFDB_NETFILES 0/WFDB_NETFILES 1/" <../lib/wfdb.h0 | \ + sed "s/WFDB_NETFILES_LIBCURL 1/WFDB_NETFILES_LIBCURL 0/" >../lib/wfdb.h + VIANF=" via libwww" + WITHNF=with + fi else echo "found" - echo "The WFDB software will be compiled with NETFILES access." + echo "The WFDB software will be compiled with NETFILES access" + echo "using libcurl." echo "NETFILES=1" >../config.cache - sed "s/LWC = :/LWC = libwww-config/" site.tmp - mv site.tmp site.def + echo "NETFILES_LIBCURL=1" >../config.cache + sed "s/LWC = libwww-config/LWC = :/" site.tmp + sed "s/LCC = :/LCC = curl-config/" site.def if [ $LIBTYPE = "static" ] then - sed "s/LDLIBWWW = #/LDLIBWWW =/" site.tmp + sed "s/LDLIBCURL = #/LDLIBCURL =/" site.tmp mv site.tmp site.def fi - sed "s/LWC = :/LWC = libwww-config/" site.tmp - mv site.tmp site-slib.def - sed "s/WFDB_NETFILES 0/WFDB_NETFILES 1/" <../lib/wfdb.h0 >../lib/wfdb.h + sed "s/LWC = libwww-config/LWC = :/" site.tmp + sed "s/LCC = :/LCC = curl-config/" site-slib.def + rm site.tmp + sed "s/WFDB_NETFILES 0/WFDB_NETFILES 1/" <../lib/wfdb.h0 | \ + sed "s/WFDB_NETFILES_LIBCURL 0/WFDB_NETFILES_LIBCURL 1/" >../lib/wfdb.h + VIANF=" via libcurl" WITHNF=with fi @@ -332,6 +389,14 @@ echo "Adding $DIR/database to the default WFDB path ..." sed "s+DBDIR+$DIR/database+" lib/wfdblib.h + +if [ "$OS" = "mingw" ] +then + cp -p wave/nomake wave/Makefile + cp -p wave/nomake waverc/Makefile + echo "WAVE=0" >>config.cache + WAVECOMP="WAVE will not be compiled." +else echo conf/prompt "Looking for the XView libraries ..." TEXTEDIT=`which textedit 2>&1` @@ -379,6 +444,8 @@ echo "WAVE=1" >>config.cache fi +fi + # Clean up old *.o files in lib, to avoid possibly using binaries intended # for a shared library in a static library or vice versa. rm -f lib/*.o @@ -425,7 +492,7 @@ $PACKAGE-$OS is now ready to be compiled using '$CC'. The WFDB library will be compiled as a $LIBTYPE library $WITHNF NETFILES - access, and it will be installed in '$DIR/lib'. + access${VIANF}, and it will be installed in '$DIR/lib'. The WFDB library .h files will be installed in '$DIR/include/wfdb'. The WFDB applications will be linked to $SYSLIBS system libraries, and they will be installed in '$DIR/bin'. diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/convert/Makefile.dos wfdb-10.3.16/convert/Makefile.dos --- wfdb-10.3.15/convert/Makefile.dos 2002-11-07 21:05:28.000000000 -0500 +++ wfdb-10.3.16/convert/Makefile.dos 1969-12-31 19:00:00.000000000 -0500 @@ -1,70 +0,0 @@ -# file: makefile.dos G. Moody 2 November 1989 -# Last revised: 7 November 2002 -# MSDOS `make' description file template for WFDB format converters -# -# WARNING: NO SUPPORT FOR PROPRIETARY COMPILERS. Previous versions of the WFDB -# software package have been compiled successfully by other users using various -# proprietary compilers including those mentioned below. You may find this -# file helpful if you wish to use one of these compilers, but no support can be -# provided in this case. If you cannot successfully compile this software -# using a proprietary compiler, please try using Cygwin/gcc or MinGW/gcc under -# MS-Windows, or DJGPP under MS-DOS (free from http://www.cygwin.com/, -# http://www.mingw.org/, or http://www.delorie.com/ respectively). -# -# Before using this file, define these variables as appropriate for your -# installation: -# -# BINDIR The directory in which the applications will be installed. -# CC The name of the command-line C compiler. -# CDFLAGS Optional arguments to be supplied to CC to produce object files -# with debugging symbols. -# COFLAGS Optional arguments to be supplied to CC to produce optimized -# object files (or normal object files if no optimization is -# available). -# LDFLAGS CC options to link with the standard WFDB library. - -# Commands needed to build and install the WFDB format-conversion applications -# are given below for several versions of `make'. -# -# Borland (Turbo) `make': -# make install -# Microsoft `make' (supplied with Microsoft C before version 6.0): -# make makefile -# Microsoft `nmake' (supplied with Microsoft C 6.0 and later versions): -# nmake install - -# Most versions of `make' allow you to override the settings of make variables -# from the command line, so that it may not be necessary to edit this file to -# test the effects of small modifications to it. - -# For optimized code, uncomment the next line. -CFLAGS = $(COFLAGS) -# Otherwise, if you modify the sources and need to debug them, uncomment the -# next line. -# CFLAGS = $(CDFLAGS) - -# Except as noted at the end of this file, it should not be necessary to modify -# anything below this line. -# ----------------------------------------------------------------------------- - -XFILES = a2m.exe ad2m.exe m2a.exe md2a.exe makeid.exe readid.exe \ - edf2mit.exe mit2edf.exe revise.exe - -# General rule for compiling C sources into executable files -.c.exe: - $(CC) $(CFLAGS) $*.c $(LDFLAGS) - -revise.exe: - $(CC) $(CFLAGS) -I..\lib $*.c $(LWFDB) - -$(BINDIR): - -mkdir $(BINDIR) - -install: $(XFILES) $(BINDIR) - copy *.exe $(BINDIR) - -# If you are using Microsoft `make', you may wish to comment out the next -# three lines to avoid having `make' clean up automatically. -clean: - del *.obj - del *.exe diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/convert/readid.c wfdb-10.3.16/convert/readid.c --- wfdb-10.3.15/convert/readid.c 2003-06-05 22:02:54.000000000 -0400 +++ wfdb-10.3.16/convert/readid.c 2005-06-09 08:35:15.000000000 -0400 @@ -1,9 +1,9 @@ /* file: readid.c G. Moody 8 August 1983 - Last revised: 5 June 2003 + Last revised: 9 June 2005 ------------------------------------------------------------------------------- readid: Read AHA-format ID block, write record name, file lengths on stdout -Copyright (C) 2003 George B. Moody +Copyright (C) 1983-2005 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,7 +26,9 @@ */ #include -#ifndef __STDC__ +#ifdef __STDC__ +#include +#else extern void exit(); #endif diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/convert/README wfdb-10.3.16/convert/README --- wfdb-10.3.15/convert/README 2002-11-07 21:11:07.000000000 -0500 +++ wfdb-10.3.16/convert/README 2005-06-08 17:29:20.000000000 -0400 @@ -1,7 +1,7 @@ file: README G. Moody 28 July 1989 - Last revised: 7 November 2002 + Last revised: 8 June 2005 -This directory contains sources for WFDB applications which convert database +This directory contains sources for WFDB applications that convert database files in various unsupported formats to and from MIT format (also known as WFDB or PhysioBank format), including to and from EDF and AHA DB formats. @@ -48,26 +48,25 @@ output; I need to see that I can compile your converter and generate the same output that you do.) -If a `make' utility is available, follow the instructions in the appropriate -`make' description file (see the list below) to compile and install these -applications on your system. If you do not have a `make' utility, you will -have to perform the installation manually; the comments in the `make' files -may be helpful in determining how to proceed. For information about using -these applications, look in the respective source files. You can also obtain a -brief usage summary for each application by running it without command-line -arguments. - -Note that you may need to set the WFDB environment variable (the database path) -before using these applications. Select and customize the appropriate script -for doing so from among the templates in the `app' directory on the same level -as this one. +If a `make' utility is available, follow the instructions in 'Makefile' to +compile and install these applications on your system. If you do not have a +`make' utility, you will have to perform the installation manually; the +comments in 'Makefile' may be helpful in determining how to proceed. + +For information about using these applications, see the WFDB Applications +Guide (in the 'doc' directory at the same level as this one), or look in the +respective source files. You can also obtain a brief usage summary for each +application by running it without command-line arguments. + +You may wish to set the WFDB environment variable (the database path) before +using these applications. Select and customize the appropriate script for +doing so from among the templates in the `app' directory on the same level as +this one. The following files will be found in this directory: Makefile `make' description file for compiling these applications using ANSI/ISO standard C compilers on supported platforms -Makefile.dos `make' description file for compiling these applications using - unsupported compilers from Borland, Microsoft, etc. Makefile.top Used by ../configure to construct Makefile (comments only) Makefile.tpl Used by ../configure to construct Makefile (portable section) README this file diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/doc/wag-src/ecgpuwave.1 wfdb-10.3.16/doc/wag-src/ecgpuwave.1 --- wfdb-10.3.15/doc/wag-src/ecgpuwave.1 2002-11-22 15:08:36.000000000 -0500 +++ wfdb-10.3.16/doc/wag-src/ecgpuwave.1 2005-06-13 00:57:10.000000000 -0400 @@ -65,14 +65,14 @@ Transactions on Biomedical Engineering\fB 32\fR(3):230-236, 1985. .br 2. Laguna P. \fINew Electrocardiographic Signal Processing Techniques: -Application to Long-term Records.\fR Ph. D. disertation, Science Faculty, +Application to Long-term Records.\fR Ph. D. dissertation, Science Faculty, University of Zaragoza, 1990. .br -3. Laguna P, Jan R, Caminal P. Automatic Detection of Wave Boundaries in +3. Laguna P, Jan\['e] R, Caminal P. Automatic Detection of Wave Boundaries in Multilead ECG Signals: Validation with the CSE Database. \fIComputers and Biomedical Research \fB 27\fR(1):45-60, 1994. .br -4. Jan R, Blasi A, Garca J, and Laguna P. Evaluation of an automatic +4. Jan\['e] R, Blasi A, Garc\['i]a J, and Laguna P. Evaluation of an automatic threshold based detector of waveform limits in Holter ECG with the QT database. \fIComputers in Cardiology \fB24\fR:295-298 (1997; available at http://www.physionet.org/physiobank/database/qtdb/eval/ ) @@ -80,7 +80,7 @@ \fBecgpuwave\fR is available as part of PhysioToolkit under the GPL (see \fBSOURCE\fR below). .SH AUTHORS -Pablo Laguna (laguna@posta.unizar.es), Raimon Jan, Eudald Bogatell, +Pablo Laguna (laguna@posta.unizar.es), Raimon Jan\['e], Eudald Bogatell, and David Vigo Anglada .SH SOURCE http://www.physionet.org/physiotools/ecgpuwave/src/ diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/doc/wag-src/edf2mit.1 wfdb-10.3.16/doc/wag-src/edf2mit.1 --- wfdb-10.3.15/doc/wag-src/edf2mit.1 2002-12-04 10:05:59.000000000 -0500 +++ wfdb-10.3.16/doc/wag-src/edf2mit.1 2005-06-13 00:58:45.000000000 -0400 @@ -85,7 +85,7 @@ .SH SEE ALSO \fBa2m\fR(1), \fBsnip\fR(1), \fBxform\fR(1), \fBwfdb\fR(3), \fBheader\fR(5) .HP -Bob Kemp, Alpo Vrri, Agostinho C. Rosa, Kim D. Nielsen and John Gade. +Bob Kemp, Alpo V\[:a]rri, Agostinho C. Rosa, Kim D. Nielsen and John Gade. A simple format for exchange of digitized polygraphic recordings. \fIElectroencephalography and Clinical Neurophysiology\fB 82\fR:391-393 (1992). .HP diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/doc/wag-src/fixag.sed wfdb-10.3.16/doc/wag-src/fixag.sed --- wfdb-10.3.15/doc/wag-src/fixag.sed 2003-07-09 07:34:06.000000000 -0400 +++ wfdb-10.3.16/doc/wag-src/fixag.sed 2005-06-12 01:09:57.000000000 -0400 @@ -2,7 +2,6 @@ s+ecgeval-1.htm+ecgeva-1.htm+g s+ecgpuwave-1.htm+ecgpuw-1.htm+g s+edf2mit-1.htm+edf2mi-1.htm+g -s+gtkwave-1.htm+gtkwav-1.htm+g s+imageplt-1.htm+imagep-1.htm+g s+pschart-1.htm+pschar-1.htm+g s+plotstm-1.htm+plotst-1.htm+g diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/doc/wag-src/Makefile.tpl wfdb-10.3.16/doc/wag-src/Makefile.tpl --- wfdb-10.3.15/doc/wag-src/Makefile.tpl 2003-04-09 12:06:36.000000000 -0400 +++ wfdb-10.3.16/doc/wag-src/Makefile.tpl 2005-06-12 01:09:31.000000000 -0400 @@ -94,7 +94,7 @@ uninstall: ../../uninstall.sh $(MAN1) *.1 ad2m.1 ann2rr.1 m2a.1 md2a.1 hrlomb.1 \ - hrmem.1 hrplot.1 plot3d.1 cshsetwfdb.1 vsetup.1 rr2ann.1 gtkwave.1 + hrmem.1 hrplot.1 plot3d.1 cshsetwfdb.1 rr2ann.1 ../../uninstall.sh $(MAN3) *.3 ../../uninstall.sh $(MAN5) *.5 ../../uninstall.sh $(MAN7) *.7 @@ -136,9 +136,7 @@ test -d $(MAN3) || ( mkdir -p $(MAN3); $(SETDPERMISSIONS) $(MAN3) ) test -d $(MAN5) || ( mkdir -p $(MAN5); $(SETDPERMISSIONS) $(MAN5) ) test -d $(MAN7) || ( mkdir -p $(MAN7); $(SETDPERMISSIONS) $(MAN7) ) - mv view.1 dview.1 # avoid conflict with vi's "view" ./maninst.sh $(MAN1) $(MAN3) $(MAN5) $(MAN7) "$(SETPERMISSIONS)" - mv dview.1 view.1 cd $(MAN1); $(LN) a2m.1 ad2m.1 cd $(MAN1); $(LN) a2m.1 ahaconvert.1 cd $(MAN1); $(LN) a2m.1 m2a.1 @@ -151,9 +149,7 @@ cd $(MAN1); $(LN) plot2d.1 plot3d.1 cd $(MAN1); $(LN) pnnlist.1 pNNx.1 cd $(MAN1); $(LN) setwfdb.1 cshsetwfdb.1 - cd $(MAN1); $(LN) dview.1 vsetup.1 cd $(MAN1); $(LN) wav2mit.1 mit2wav.1 - cd $(MAN1); $(LN) wave.1 gtkwave.1 # 'make wag.pdf': format the WFDB Applications Guide as PDF wag.pdf: wag0.ps diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/doc/wag-src/sample.1 wfdb-10.3.16/doc/wag-src/sample.1 --- wfdb-10.3.15/doc/wag-src/sample.1 2002-07-31 15:08:07.000000000 -0400 +++ wfdb-10.3.16/doc/wag-src/sample.1 1969-12-31 19:00:00.000000000 -0500 @@ -1,303 +0,0 @@ -.TH SAMPLE 1 "31 July 2002" "WFDB 10.2.7" "WFDB Applications Guide" -.SH NAME -sample \- digitize and replay analog signals (MS-DOS only) -.SH SYNOPSIS -\fBsample\fR [ \fIoptions\fR ... ] ] -.SH DESCRIPTION -.PP -\fBsample\fR generates database records from analog signals, and generates -analog signals from database records. -.PP -When used to digitize analog signals, the outputs of \fBsample\fR are one or -more signal files and a header file. The record name, the number of input -signals, the sampling frequency, the duration of the record, and the storage -format may be specified interactively or by command-line options and -configuration files. -.PP -When used to play back database records, the outputs of \fBsample\fR are one or -more analog signals. -.PP -\fIOptions\fR include: -.TP -\fB-b\fR -Batch mode (do not prompt to begin digitization or playback). -.TP -\fB-d\fR \fItype\fR -Set up for use with the specified device. -\fItype\fR must be one of `1200/2', `1200/2B', `1200/3', `1200/3B', `1200/4', -`1200/4B', `2400/4', `2400/5', or `2400/6' (corresponding to Microstar DAP -model numbers). Use a \fItype\fR ending with `B' only if you have a DAP 1200 -series board configured for bipolar inputs. Use the option \fB-d help\fR to -get a list of supported device types. If no \fB-d\fR option is given, -\fBsample\fR uses the DAPL `hello' command to determine the device type -automatically. -.TP -\fB-f\fR \fItime\fR -Begin playback at the specified \fItime\fR (effective only in combination with -the \fB-i\fR option). -.TP -\fB-h\fR -Print on-line help (a brief description of options). -.TP -\fB-i\fR \fIrecord\fR -Play back the specified \fIrecord\fR (may not be used with the \fB-n\fR, -\fB-N\fR, or \fB-o\fR options). Unless an analog output expansion board -has been installed, and \fBsample\fR has been compiled with a suitably -increased value of \fBDAPOUTPUTS\fR, or a DAPL program embedded in the header -file for \fIrecord\fR (see below) specifies otherwise, playback is restricted -to signals 0 and 1 only. Except when using `raw' format, the analog outputs -are determined by the 12 least significant bits of each sample. (\fBsample\fR -assumes that any record whose header file specifies format 16, ADC resolution -16, and all signals in the same signal file, is a `raw' format record.) -.TP -\fB-n\fR \fIrecord\fR -Create the specified \fIrecord\fR (both signal and header files). -.TP -\fB-N\fR \fIrecord\fR -Create a header file for the specified \fIrecord\fR, but do not digitize. -.TP -\fB-o\fR \fIrecord\fR -Digitize, using signal specifications in the existing header file for -\fIrecord\fR. -.TP -\fB-p\fR \fIfile\fR -Use the DAPL program in the specified file. -.TP -\fB-s\fR \fIn\fR -Record or play back 1 of every \fIn\fR samples in each signal (not effective -with `raw' format I/O, see below). -.TP -\fB-t\fR \fItime -Stop digitization or playback at the specified \fItime\fR. -.TP -\fB-x\fR \fIn\fR -Digitize or play back at \fIn\fR times real time (\fIn\fR > 0; default: 1). -This option is not effective with \fB-p\fR, or when the header file specified -by \fB-i\fR or \fB-o\fR contains a usable DAPL program (see below). -.TP -\fB-1\fR -Play back only one signal (signal 0; effective only with \fB-i\fR). -.SH ENVIRONMENT -.PP -It may be necessary to set and export the shell variable \fBWFDB\fR (see -\fBsetwfdb\fR(1)). -.SS HARDWARE REQUIREMENTS -.PP -\fBsample\fR runs under MS-DOS on an ISA-bus (AT-bus) system that -contains a Microstar DAP 1200 or 2400 series board (available from -Microstar Laboratories, http://www.mstarlabs.com/). All DAP 1200 and -2400 series boards listed below include 12-bit analog-to-digital and -digital-to-analog converters, analog multiplexers, programmable gain -amplifiers, timers, and an Intel 80186 CPU; DAP 2400 series boards -include a Motorola 56001 DSP and provisions for external triggering. -All models have 8 differential (16 single-ended) analog inputs and 2 -analog outputs, and 16 bits each of digital inputs and outputs. With -expansion boards, a single DAP can have up to 256 differential or 512 -single-ended analog inputs, 66 analog outputs, and 128 bits of digital -input and output; it is also possible to use up to seven DAP boards in -a single system. -.PP -The range of sampling frequencies available depends on the model. DAP 1200/2 -and 1200/3 boards can digitize at aggregate rates of 31.25 to 50,000 Hz; -for DAP 1200/4 and 2400/4 boards, the range is 38.46 to 156,000 Hz, and for -DAP 2400/5 and 2400/6 boards, the range is 62.5 to 235,000 Hz. -Although several hundred thousand samples can be acquired at the maximum input -sampling frequency, the maximum sustained throughput to disk is considerably -lower than the maximum sampling frequency specifications imply; using a 12 MHz -286-based system, a DAP 2400/5, a disk controller with 256K of cache, and a 16 -msec disk, for example, the maximum sustained throughput is about 25 KHz (100 -KHz using `raw' format, see below). The minimum sampling frequencies listed -above refer only to those obtainable using the on-board timer and the DAPL -program generated by \fBsample\fR (see below); if necessary, slower sampling -can be achieved using an external clock with DAP 2400 boards, or by writing a -special-purpose DAPL program. -.PP -The DAP 2400 is much better suited for playback than is the DAP 1200. Each of -the two analog outputs of the DAP 1200 can accept samples at 1, 2, 5, 10, 25, -50, 125, or 250 Hz, but not at any other rates. Note that \fBsample\fR -generates DAPL code for playback on DAP 2400 boards only, although DAP 1200 -playback code can be provided by the user at run time if necessary (see below). -\fBsample\fR can generate analog signals using a DAP 2400 at sustained rates -up to about 3 KHz; much faster output (up to 250 KHz with a DAP 2400/6) is -possible for short intervals (up to the amount that can be loaded into the -DAP's local memory). -.PP -Microstar Laboratories produces DAP boards that do not include -analog-to-digital or digital-to-analog converters; \fBsample\fR is not -intended for use with these boards, which have model designations ending in -`D'. DAP boards with protected analog inputs have model designations ending -in `P'; these boards have slightly lower maximum sampling rates than the -corresponding standard models. -.PP -Successful digitization always requires that the analog inputs be band-limited -so that there is essentially no power at frequencies in excess of half of the -sampling frequency. In almost all cases, this means that you must use -properly designed analog antialiasing filters between the signal source and -the DAP inputs. Before assuming that your inputs are band-limited because -of known characteristics of the signals, consider carefully if your \fInoise\fR -is also band-limited \- it's probably not! -.PP -During playback, you may wish to use similar low-pass filters to reduce the -`staircase' effect characteristic of signals generated by D/A converters. -.PP -\fBsample\fR has been tested using DAPL version 3.3; the digitization and -single-channel playback functions have also been tested using DAPL version 3.2 -(note that the multi-channel playback code generated by \fBsample\fR uses the -`separate' command, which is new in DAPL 3.3). -.SS PERFORMANCE HINTS -.PP -\fBsample\fR uses the WFDB library functions \fIgetvec\fR and \fIputvec\fR to -read and write signal files. When digitizing, the advantages of using -\fIputvec\fR are that it permits the use of a variety of standard, compact -storage formats, and that it calculates signal checksums that are used -subsequently by other WFDB applications to verify the integrity of the signal -files. During playback, the use of \fIgetvec\fR permits \fBsample\fR to read -any existing WFDB record without the need to reformat it. When digitizing or -playing back `raw' format records (compatible with Microstar's DAPview or DLOG -binary files), \fIgetvec\fR and \fIputvec\fR are bypassed with low-level -\fIread\fR and \fIwrite\fR calls for maximum speed. A side effect of using -`raw' format in digitization is that the generated header files for newly -created records lack sample counts and checksums, since these are produced -only by \fIputvec\fR. `Raw' format files can be converted to any standard -(`cooked'?) WFDB signal file format using \fBxform\fR, which will generate -sample counts and checksums. When using \fBxform\fR on `raw' format files, it -is advantageous to set its output signal gains to 1/16 of those specified in -the header file for the `raw' format record, in order to obtain right-justified -12-bit samples (DAP `raw' format consists of 12-bit samples left-justified in -16-bit words). If both \fBsample\fR and \fBxform\fR are allowed to use their -default gain settings, this scaling is performed automatically by \fBxform\fR. -.SS COMPILATION -.PP -Please read this \fIentire\fR section before trying to compile \fBsample\fR! -.PP -To compile \fBsample\fR successfully, you will need Microsoft C, version 5.0 -or later, or Turbo C/C++, and four files supplied by Microstar with all -versions of the DAP 1200 and 2400 (Microstar's Advanced Development Toolkit is -\fInot\fR required in order to compile or use this program). These files are -\fIc_lib.c\fR, \fIclock.h\fR, and \fIioutil.h\fR, which should be installed in -a directory searched by your C compiler for \fI#include <...>\fR files (for -Microsoft C, one of the directories specified by the \fBINCLUDE\fR environment -variable); and \fIcdapl.lib\fR, which should be installed in a directory -searched by your C compiler's link utility for libraries (for Microsoft C, -one of the directories specified by the \fBLIB\fR environment variable). If -you are using Microsoft C, copy \fIcdapl5.lib\fR from the Microstar -distribution diskettes into your library directory and rename it -\fIcdapl.lib\fR. -.PP -If you have not already done so, you must also compile and install a -large memory model version of the WFDB library (see \fIMakefile.dos\fR in the -\fIlib\fR directory). Although the program compiles and links successfully -using the small memory model and Microstar's \fIcdaps5.lib\fR, there is -apparently a bug in \fIcdaps5.lib\fR that wedges the DAP (a condition that -can be remedied only by power-cycling the system). -.PP -If you have installed one or more analog expansion boards, modify the -values of \fBDAPINPUTS\fR and \fBDAPOUTPUTS\fR as appropriate (see -\fIsample.c\fR). Note that these constants specify the number of -available inputs and outputs, \fInot\fR the number of signals that can -be digitized or played back at once using \fBsample\fR (which imposes -no fixed limits if compiled with WFDB library version 10.2 or later). -.PP -Efficiency, hence maximum output rate, is improved by using large I/O buffer -sizes. By default, \fBsample\fR uses 10K-byte buffers; depending on your -system's available memory and your disk controller, you may be able to improve -your throughput by adjusting this value. Do so by redefining the symbol -\fBDBUFSIZE\fR. Note that the default buffer size is overridden at run time -by explicit (non-zero) block size specifications in the header file, if -present (see \fBheader\fR(5)). -.PP -This program has been successfully compiled and tested using Microsoft C 5.1, -6.0, and 7.0, with the command -.br - \fBcl -Ox -Ml sample.c -link wfdbl cdapl\fR -.br -and using Turbo C 2.01, and Turbo C++ 1.01, with the command -.br - \fBtcc -O -A -ml sample.c wfdbl.lib cdapl.lib\fR -.br -Note that you may need to use \fB-I\fR and \fB-L\fR options to instruct your -compiler where to find \fI#include\fR files and libraries; see your compiler -manual for further information. The symbols \fBDAPINPUTS\fR, \fBDAPOUTPUTS\fR, -and \fBDBUFSIZE\fR may be redefined using command-line \fB-D\fR options with -any of these compilers. If you compile using Microsoft C/C++ 7.0 (or later) -with the \fB-Za\fR (ANSI C) option, add \fBoldnames\fR as a final command-line -argument, to link a library containing aliases for functions such as -\fIopen()\fR, which have been renamed in the standard MSC 7.0 library to -conform with ANSI namespace rules. -.SS "DAPL Programs" -.PP -DAP boards are controlled by programs written in Microstar's DAPL (DAP -language), which are downloaded to the on-board 80186 for execution. -\fBsample\fR follows this procedure for obtaining the DAPL program to be used: -.TP -\fB1.\fR -If you use the \fB-p\fR option to specify the name of a DAPL file, \fBsample\fR -downloads the contents of that file. The first line of the file should -contain a DAPL comment line of the form `\fI; start a,b\fR', -which specifies the DAPL command required to begin execution of the -program once it has been downloaded. If this line is missing, \fBsample\fR -uses the command `\fIstart a\fR'. Unless the DAPL file is unreadable or empty, -\fBsample\fR skips steps 2 and 3, and the \fB-x\fR option has no effect. -.TP -\fB2.\fR -If you use the \fB-i\fR or \fB-o\fR options to specify the record -name of an existing header file, \fBsample\fR will read \fIinfo\fR -strings from the header file. If \fI-i\fR has been specified, and any -of the \fIinfo\fR strings begin with `<', the initial `<' character in -each such string is discarded, and the remainder is treated in the -same manner as for a DAPL program specified using \fB-p\fR. -Similarly, if \fB-o\fR has been specified, \fBsample\fR compiles the -DAPL program from any \fIinfo\fR strings beginning with `>'. If -\fBsample\fR finds any DAPL code in this step, it does not execute -step 3, and the \fB-x\fR option has no effect. -.TP -\fB3.\fR -If \fBsample\fR has not obtained a DAPL program in steps 1 or 2, it generates -one based on the signal specifications obtained from the header file -read in step 2, if any, or interactively from the user. If specifications -for digitization are obtained from a header file without an embedded DAPL -program, \fBsample\fR assigns differential inputs D0, D1, ... to signals 0, -1, ..., provided that the number of signals does not exceed \fBDAPINPUTS\fR/2; -otherwise, \fBsample\fR assigns single-ended inputs S0, S1, ... to signals -0, 1, .... Digital inputs (input `B') may be specified in a DAPL program or -interactively. In playback mode, \fBsample\fR generates DAP 2400-compatible -code only; to play back a record using a DAP 1200, you must supply DAPL code -either in the header file or using \fB-p\fR. -.PP -When \fBsample\fR is used to create a record, it writes a copy of the DAPL -program that it uses into the newly-created header file, as a set of info -strings formatted as described in step 2 above. By using the \fB-N\fR option, -a DAPL program may be written into a prototype header file without actually -digitizing any signals. This is an easy way to bootstrap the design of a -custom DAPL program for use with \fBsample\fR. Custom DAPL programs may be -used for applications that perform operations such as digital filtering -on-the-fly, or for low frequency sampling. -.PP -An example of a header file with a moderately complex embedded DAPL program -is \fIsample8.hea\fR, in the \fIapp\fR directory of the WFDB software package. -.SS DISCLAIMER -.PP -Please note that the author has no connection with Microstar Laboratories -other than as a satisfied customer; specifically, neither MIT nor the author -assumes any responsibility whatsoever for the performance of Microstar -hardware or software. -.SH BUGS -If no \fB-d\fR option is given, \fBsample\fR displays the diagnostic message -``Testing DAP ...'' briefly before printing the DAP type. If \fBsample\fR -cannot establish communications with the DAP, however, it will stop after -displaying the ``Testing DAP ...'' message; in this case, it is usually -necessary to power-cycle the DAP (a system reset is usually not sufficient) -in order to restore communications. This behavior of \fBsample\fR is not a -bug in itself; the DAP board can be put into this uncommunicative (i.e., -wedged) state by \fBsample\fR and other programs, however. The most likely -reasons for the DAP to become wedged are attempting to use sampling frequencies -that are too high (especially for playback) or improperly constructed custom -DAPL programs in header files. It is also possible to run DAPL programs -that take a very long time to execute; in this case, it may be difficult to -know if the DAP is running or wedged. -.SH SEE ALSO -\fBsetwfdb\fR(1), \fBxform\fR(1), \fBheader\fR(5) -.SH AUTHOR -George B. Moody (george@mit.edu) -.SH SOURCE -http://www.physionet.org/physiotools/wfdb/app/sample.c diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/doc/wag-src/setwfdb.1 wfdb-10.3.16/doc/wag-src/setwfdb.1 --- wfdb-10.3.15/doc/wag-src/setwfdb.1 2002-08-06 15:00:46.000000000 -0400 +++ wfdb-10.3.16/doc/wag-src/setwfdb.1 2005-06-12 01:06:24.000000000 -0400 @@ -1,4 +1,4 @@ -.TH SETWFDB 1 "6 August 2002" "WFDB 10.2.7" "WFDB Applications Guide" +.TH SETWFDB 1 "12 June 2005" "WFDB 10.3.16" "WFDB Applications Guide" .SH NAME setwfdb, cshsetwfdb \- set WFDB environment variables .SH SYNOPSIS @@ -40,17 +40,6 @@ \fBcshsetwfdb\fR sets \fBWFDB\fR and \fBWFDBCAL\fR similarly for the C-shell. It must be executed using ``source'' as shown above. It may be convenient to include this command in your \fB.cshrc\fR file. -.SS MS-DOS/MS-Windows users: -If possible, use a Unix-compatible shell such as \fBbash\fR (included in the -freely available Cygwin package for MS-Windows), and use \fBsetwfdb\fR or -\fBcshsetwfdb\fR as appropriate for your shell. If you must use command.com, -\fBsetwfdb.bat\fR sets \fBWFDB\fR and \fBWFDBCAL\fR similarly for -MS-DOS or MS-Windows; it also sets \fBVIEWP\fR (see \fBview\fR(1)). It -may be convenient to include this command in the \fBautoexec.bat\fR -file (under MS-DOS 3.3 and later, include the command ``call setwfdb'' -within \fBautoexec.bat\fR; under earlier versions of MS-DOS, use -``command /c setwfdb'', or append the contents of \fBsetwfdb.bat\fR to -\fBautoexec.bat\fR). .PP .SH ENVIRONMENT .TP @@ -103,5 +92,3 @@ http://www.physionet.org/physiotools/wfdb/app/setwfdb .br http://www.physionet.org/physiotools/wfdb/app/cshsetwfdb -.br -http://www.physionet.org/physiotools/wfdb/app/setwfdb.bat diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/doc/wag-src/view.1 wfdb-10.3.16/doc/wag-src/view.1 --- wfdb-10.3.15/doc/wag-src/view.1 2002-07-31 23:52:21.000000000 -0400 +++ wfdb-10.3.16/doc/wag-src/view.1 1969-12-31 19:00:00.000000000 -0500 @@ -1,191 +0,0 @@ -'\" t -.TH VIEW 1 "31 July 2002" "WFDB 10.2.7" "WFDB Applications Guide" -.SH NAME -view, vsetup \- WFDB browser for MS-DOS -.SH SYNOPSIS -\fBview\fR -.br -\fBview\fR \fIrecord\fR -.br -\fBview\fR \fIrecord annotator\fR -.br -\fBview\fR \fIrecord annotator time\fR -.br -\fBview\fR \fIrecord annotator type\fR -.br -\fBvsetup\fR -.br -\fBvsetup -s\fR \fIfile \fR -.br -\fBvsetup\fR \fImode\fR -.SH DESCRIPTION -.PP -This program reads one or more signal files and an annotation file (if one is -available), and displays the signals with annotations at the standard -chart recorder scale of 25 mm/sec and 10 mm/mV on systems equipped with -a CGA, Hercules, EGA, VGA, or compatible graphics display adapter. Run -\fBvsetup\fR to determine a suitable display mode and scaling constants before -using \fBview\fR for the first time (see \fBvsetup\fR below). -.PP -If no \fIrecord\fR is specified on the command line, \fBview\fR asks for a -record name when it starts. If no \fIannotator\fR is specified on the command -line, \fBview\fR attempts to find an annotation file named \fIrecord\fB.atr\fR; -otherwise, it attempts to find one named \fIrecord\fB.\fIannotator\fR. -If the annotation file does not exist or cannot be read, \fBview\fR simply -displays the signals. A \fItime\fR argument, if present, causes \fBview\fR -to display its first screenful such that the left-hand edge of the screen -corresponds to the specified time. A \fItype\fR argument, if present, causes -\fBview\fR to search for the first occurrence of the specified annotation type -in the annotation file, and to center the first screenful on that annotation -if possible. -.PP -\fBview\fR is an interactive program. Once the first screenful has been -displayed, \fBview\fR waits for additional commands, which can be typed in the -prompt area near the bottom of the screen, and which are executed when you -press ENTER. These commands can be in any of the formats permissible for -\fItime\fR or \fItype\fR command-line arguments; such commands have the same -effect as if given on the command line. You may also merely press ENTER to see -the next screenful; if the previous action involved searching for an -annotation, this will cause \fBview\fR to search for the next occurrence of the -same annotation type that does not already appear on the screen. The \fBg\fR -command may be used to turn the grid display on or off; initially, the grid -display is off. When the grid is visible, it marks 0.2 second and 0.5 -millivolt intervals. The \fBm\fR command may be used to turn annotation -marker bars (dotted lines above and below each annotation showing the exact -location of the annotation fiducial mark) on or off; initially, annotation -marker bars are on. Finally, use the \fBx\fR command to exit from \fBview\fR -and return to the DOS prompt. -.PP -Current versions of \fBview\fR (4.0 and later) support the use of a mouse to -navigate through the record. If a mouse is available, \fBview\fR displays -buttons at the bottom of the screen; click left on these to move forward -or backward by whole or half screenfuls. If the mouse pointer is above the -level of the buttons, clicking left or right moves the pointer left or right -one annotation at a time, recentering the display if the pointer would -otherwise move out of the display region. -.PP -\fBvsetup\fR is used to calibrate your monitor for \fBview\fR. If \fBvsetup\fR -is able to identify a usable graphics mode, it will ask you to measure the -dimensions of a rectangle that it draws on your screen. When it finishes, it -will print instructions for setting an environment variable that is required -by \fBview\fR, unless you have used the \fB-s\fR option; in the latter case, -the MS-DOS command needed to set the variable is appended to the specified -\fIfile\fR. If your graphics adapter is capable of several display modes, -and you prefer to use a different mode from that selected by \fBvsetup\fR, you -can run \fBvsetup\fR with an integer argument that corresponds to your -preferred \fImode\fR, from among the following: -.br -.TS -center; -r l. -\fIArgument Display mode\fR -4 320 x 200, 4 colors -5 320 x 200, 4 grey levels -6 640 x 200, black and white -8 720 x 348, black and white [1] -13 320 x 200, 16 colors -14 640 x 200, 16 colors -15 640 x 350, black and white -16 640 x 350, 4 or 16 colors -17 640 x 480, black and white -18 640 x 480, 16 colors -19 320 x 200, 256 colors [2] -258 800 x 600, 16 colors [3] -259 800 x 600, 256 colors [2,3] -260 1024 x 768, 16 colors [3] -261 1024 x 768, 256 colors [2,3] -262 1280 x 1024, 16 colors [3] -263 1280 x 1024, 256 colors [2,3] -.TE -.PP -[1] Mode 8 can be used only with a Hercules Graphics Card, Graphics Card Plus, -Incolor Card, or a compatible. To use mode 8 with one of these cards, load -\fImsherc.com\fR (from the \fIbin\fR directory of your CD-ROM or software -distribution diskette, or from your Microsoft C, Pascal, or Fortran compiler -diskettes) before using \fBvsetup\fR or \fBview\fR. Do so by typing -\fImsherc\fR from within the directory where you find \fImsherc.com\fR (you -may wish to include this step in your \fIautoexec.bat\fR). If you have both a -Hercules monochrome card and a color video card in the same system, type -\fImsherc /h\fR instead. -.PP -[2] \fBview\fR uses at most 5 colors, so the 256-color modes offer no advantage -over the 16-color modes. In the 16- and 256-color modes, the background is -white; in the 4-color and black-and-white modes, the background is black. -.PP -[3] These modes can be used only with a VESA-compatible SVGA and a compatible -monitor. \fBvsetup\fR will not identify these modes automatically, because -of the potential for damage to your monitor if your SVGA card supports these -modes but your monitor does not. \fBDo not attempt to use these modes unless -your monitor supports them. Otherwise, you risk damaging your monitor.\fR -.SH ENVIRONMENT -.TP -\fBWFDB\fR -The database path: a list of directories that contain database files. An -empty component is taken to refer to the current directory. All applications -built with the \fBwfdb\fR(3) library search for their database input files in -the order specified by \fBWFDB\fR. If \fBWFDB\fR is not set, searches are limited to the builtin WFDB path (see \fBsetwfdb\fR(1). Under MS-DOS, directory -names are separated by semicolons (;), and the format of \fBWFDB\fR is that of -the MS-DOS \fBPATH\fR variable (colons may be used following drive specifiers -within \fBWFDB\fR in this case). -.TP -\fBWFDBCAL\fR -The name of the WFDB calibration file (see \fBwfdbcal\fR(5)), which -must be in a directory named by \fBWFDB\fR (see immediately above). -This file is used by \fBview\fR to determine standard scales for -signals other than ECGs. If \fBWFDBCAL\fR is not set, or if the file -named by \fBWFDBCAL\fR is not readable, these signals may be drawn at -incorrect scales. -.TP -\fBVIEWF\fR -The pathname for the font file containing characters to be drawn by \fBview\fR. -\fBVIEWF\fR should name a Microsoft Windows-compatible `\fI.fon\fR' file. By -default, if \fBVIEWF\fR is not set, \fBview\fR checks the \fBPATH\fR variable -to see if Microsoft Windows is available, and uses \fImodern.fon\fR in the -Windows \fIsystem\fR subdirectory if so, or a file of the same name in the -current directory if not; otherwise, \fBview\fR uses text mode to draw -characters. If you are using \fBview\fR in a DOS box under MS-Windows 95, you -will probably find \fImodern.fon\fR in the Windows \fIfonts\fR subdirectory, -and you should set \fBVIEWF\fR accordingly. Note that text mode character -placement is constrained to text mode character cells; annotations shown using -text mode will not be placed as precisely as those shown using graphics mode. -.TP -\fBVIEWP\fR -Instructions for setting this variable are printed by \fBvsetup\fR. The -format for the command to do so is -.br - \fBset VIEWP=\fR\fImode,left,right,top,bottom,width,height\fR -.br -where \fImode\fR is one of those specified in the table above, \fIleft\fR, -\fIright\fR, \fItop\fR, and \fIbottom\fR are the pixel column and row numbers -corresponding to the edges of the display area to be used by \fBview\fR, and -\fIwidth\fR and \fIheight\fR are the dimensions of the display area in -millimeters. -.PP -After determining appropriate values for these variables, you may wish to add -commands for setting them to your \fIautoexec.bat\fR file. The standard -installation procedure determines appropriate values interactively and inserts -the necessary commands into \fIsetwfdb.bat\fR (see \fBsetwfdb\fR(1)). -.SH CD-ROM VERSIONS -The first edition of the MIT-BIH Arrhythmia Database CD-ROM, the first and -second editions of the European ST-T Database CD-ROM, and the first edition of -the MIT-BIH Polysomnographic Database CD-ROM contain versions of \fBview\fR -that do not support color or greyscale output, SVGA display modes, -\fBVIEWF\fR, annotation marker bar display, or mouse interaction. -.PP -Later editions of the MIT-BIH Arrhythmia Database CD-ROM and of the MIT-BIH -Polysomnographic Database CD-ROM contain a version of \fBview\fR that supports -all of these features. Note that version 4.0, included on the second editions -of these CD-ROMs, requires that the record name be supplied on the command -line. (As described above, earlier and later versions of \fBview\fR obtain the -record name interactively if it is not supplied on the command line.) -.SH SEE ALSO -\fBpschart\fR(1) (for PostScript), \fBwave\fR(1) (for X11), \fBwview\fR(1) -(for MS-Windows) -.br -\fBsetwfdb\fR(1) -.SH AUTHOR -George B. Moody (george@mit.edu) -.SH SOURCE -http://www.physionet.org/physiotools/wfdb/app/view.c -.br -http://www.physionet.org/physiotools/wfdb/app/vsetup.c diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/doc/wag-src/wag.ht0 wfdb-10.3.16/doc/wag-src/wag.ht0 --- wfdb-10.3.15/doc/wag-src/wag.ht0 2004-03-05 13:15:14.000000000 -0500 +++ wfdb-10.3.16/doc/wag-src/wag.ht0 2005-06-13 03:09:37.000000000 -0400 @@ -20,7 +20,7 @@ George B. Moody
Harvard-MIT Division of Health Sciences and Technology

-Copyright ©1980-2004 George B. Moody +Copyright ©1980-2005 George B. Moody

The most recent versions of the programs described in this guide may be freely downloaded from PhysioNet. For diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/doc/wag-src/wag.ht1 wfdb-10.3.16/doc/wag-src/wag.ht1 --- wfdb-10.3.15/doc/wag-src/wag.ht1 2002-10-29 09:05:44.000000000 -0500 +++ wfdb-10.3.16/doc/wag-src/wag.ht1 2005-06-12 01:22:11.000000000 -0400 @@ -14,10 +14,6 @@ Research Resources of the National Institutes of Health. The most recent version of this guide, and of the software it describes, may be obtained from PhysioNet. -

  • The MIT-BIH Database Distribution -Home Page
    -Information about obtaining CD-ROMs containing many of the databases -available from PhysioNet can be found here.
  • WFDB Programmer's Guide
    Includes tutorial and reference material relating to the WFDB library, @@ -29,8 +25,9 @@ A comprehensive tutorial, with extensive reference material, for WAVE, an interactive waveform browser with facilities for annotation editing and control of external analysis programs. -WAVE runs on PCs under the free Linux operating system, and -on SPARC-based systems under SunOS or Solaris. +WAVE runs on PCs under the free GNU/Linux and FreeBSD +operating systems, and under MS-Windows with Cygwin/X, as well as on Mac OS X +and on SPARC-based systems under SunOS or Solaris.
    diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/doc/wag-src/wag.tex wfdb-10.3.16/doc/wag-src/wag.tex --- wfdb-10.3.15/doc/wag-src/wag.tex 2004-03-05 13:14:47.000000000 -0500 +++ wfdb-10.3.16/doc/wag-src/wag.tex 2005-06-13 01:05:53.000000000 -0400 @@ -36,7 +36,7 @@ \pagestyle{empty} \vspace*{\fill} \noindent -Copyright \copyright 1992 -- 2004 George B. Moody +Copyright \copyright 1992 -- 2005 George B. Moody \vspace{1 in} \noindent diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/doc/wag-src/wave.1 wfdb-10.3.16/doc/wag-src/wave.1 --- wfdb-10.3.15/doc/wag-src/wave.1 2002-08-06 15:10:31.000000000 -0400 +++ wfdb-10.3.16/doc/wag-src/wave.1 2005-06-13 02:35:24.000000000 -0400 @@ -1,17 +1,14 @@ '\" t -.TH WAVE 1 "6 August 2002" "WFDB 10.2.7" "WFDB Applications Guide" +.TH WAVE 1 "13 June 2005" "WFDB 10.3.16" "WFDB Applications Guide" .SH NAME -wave, gtkwave \- waveform analyzer, viewer, and editor +wave \- waveform analyzer, viewer, and editor .SH SYNOPSIS \fBwave -r\fR \fIrecord\fR[\fB+\fIrecord\fR ...] [ \fIoptions\fR ... ] -.br -\fBgtkwave -r\fR \fIrecord\fR[\fB+\fIrecord\fR ...] [ \fIoptions\fR ... ] .SH DESCRIPTION .PP \fBwave\fR can be used to view the specified WFDB \fIrecord\fR or -records on any display controlled by an X11 server. \fBgtkwave\fR provides -most of the same facilities with a newer GUI under either Unix or MS-Windows. -Both applications include facilities for interactive annotation editing. +records on any display controlled by an X11 server. It includes +facilities for interactive annotation editing. The keyboard and mouse are used to control the display interactively. First-time users should read the \fIWAVE User's Guide\fR. (One way to do this is by pointing your Web browser to \fBfile:///usr/help/html/wug/wug.htm\fR, @@ -658,7 +655,9 @@ XView library do not have this bug. .PP If \fBwave\fR opens with an empty signal window, this may mean that -the X server's backing store is disabled. If possible, enable backing +the X server's backing store is disabled. \fBwave\fR versions 6.8 and later +incorporate a workaround that avoids this problem. If you must use an earlier +version of \fBwave\fR, enable backing store and restart the X server. (Using XFree86 4.x, backing store can be enabled by inserting the line `Option "backingstore"' in the `Device' section(s) of the \fBXF86Config-4\fR file. If the X server is @@ -696,12 +695,12 @@ \fIWAVE User's Guide\fR .SH AVAILABILITY .PP -\fBwave\fR currently runs under Linux, Solaris, and SunOS. It should be +\fBwave\fR currently runs under FreeBSD, GNU/Linux, Mac OS X, MS-Windows with +Cygwin/X, Solaris, and SunOS. It should be easily portable to any POSIX-compliant OS that can support X11 and XView. If you would like to use \fBwave\fR on a system other than those listed above, you will need to port XView to your system first (or purchase a -commercial port if one is available). Sources for XView are supplied -on our CD-ROMs that include \fBwave\fR, and are also available from +commercial port if one is available). Sources for XView are available from PhysioNet (\fBwww.physionet.org\fR, where the sources for \fBwave\fR itself are also available), \fBmetalab.unc.edu\fR, \fBtsx-11.mit.edu\fR, and their mirrors. \fIWe cannot offer assistance in porting XView; if you wish to try @@ -709,18 +708,7 @@ terminal emulator application included in the XView sources, we will assist you in porting \fBwave\fR (this is much simpler than the XView port). -.PP -The second edition of the \fIMIT-BIH Arrhythmia Database CD-ROM\fR -contained an earlier version of \fBwave\fR (for Sparc SunOS only) that -lacked many of the features described here. Refer to the -documentation included on that CD-ROM for details. -.PP -Beta (test) versions of \fBgtkwave\fR are available for Linux and MS-Windows. -It should be straightforward to recompile \fBgtkwave\fR sources for any other -environment in which the GTK+ toolkit and the WFDB library are available. .SH AUTHOR George B. Moody (george@mit.edu) .SH SOURCES http://www.physionet.org/physiotools/wfdb/wave/ -.br -http://www.physionet.org/physiotools/beta/gtkwave/ diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/doc/wag-src/wview.1 wfdb-10.3.16/doc/wag-src/wview.1 --- wfdb-10.3.15/doc/wag-src/wview.1 2003-04-07 14:55:39.000000000 -0400 +++ wfdb-10.3.16/doc/wag-src/wview.1 1969-12-31 19:00:00.000000000 -0500 @@ -1,316 +0,0 @@ -'\" t -.TH WVIEW 1 "1 August 2002" "WFDB 10.2.7" "WFDB Applications Guide" -.SH NAME -wview \- WFDB browser for MS Windows -.SH SYNOPSIS -\fBwview\fR -.br -\fBwview\fR \fIrecord\fR -.br -\fBwview\fR \fIrecord annotator\fR -.br -\fBwview\fR \fIrecord annotator start-time\fR -.br -\fBwview\fR [\fIdrive:\fR][\fIpath\fR]\fIrecord\fB.hea\fR -.SH DESCRIPTION -.PP -Note: \fBwview\fR will soon be retired in favor of \fBgtkwave\fR(1). -.PP -This program reads one or more signal files and an annotation file (if -one is available), and displays the signals with annotations on a PC -running MS Windows 3.1 (or later). To run it, either select the -\fBwview\fR icon from the appropriate Start menu or Program Manager -group (usually `Applications'), select a WFDB `header' file (a file -named with the suffix `.hea') from Windows Explorer or File Manager, -or enter one of the \fBwview\fR command lines listed above (under -`Synopsis') in the \fBRun...\fR window of the Start menu or the -Program Manager's \fBFile\fR menu. The first two of these methods -work only if \fBwview\fR has been installed as described below, under -`Installation'; use the \fBRun...\fR method if you have not performed -the full installation procedure. If MS Windows is not running, you -may start it and launch \fBwview\fR from the MS-DOS prompt by -typing \fBwin wview\fR (this command may also include \fIrecord\fR, -\fIannotator\fR and \fIstart-time\fR options as shown above). Refer -to Microsoft's \fIWindows User's Guide\fR for general information -about starting and using MS Windows. -.PP -The current version of \fBwview\fR is an alpha release. A few of the -controls are not implemented, and appear as inactive (greyed) menu items. -In comparison with other available software for viewing annotated WFDB records, -\fBwview\fR's capabilities lie somewhere between those of \fBview\fR(1) -(for MS-DOS) and \fBwave\fR(1) (for the X Window System). \fBwview\fR can -do anything that \fBview\fR can do, and much more, but \fBview\fR is likely -to be substantially faster than \fBwview\fR on older PCs that do not have -32-bit CPUs with numeric coprocessors and MS Windows accelerated graphics -cards. \fBwview\fR has most of the display capabilities of \fBwave\fR with -the exception of `scope' windows, but it lacks \fBwave\fR's capabilities for -annotation editing and control of external analysis programs, as well as a -variety of less important features. -.SS Choosing Files to View -.PP -The \fBChoose Inputs\fR dialog usually appears when you start \fBwview\fR. -It allows you to select a database \fIrecord\fR to view. If you start -\fBwview\fR using a command line, or by selecting a WFDB `header' file from the -File Manager, \fBwview\fR opens the record immediately without showing the -\fBChoose Inputs\fR dialog. If you supply a record name but omit the annotator -name, \fBwview\fR attempts to find the reference (\fBatr\fR) annotations. -At any time, you may pop up the \fBChoose Inputs\fR dialog by selecting -\fBOpen...\fR from the \fBFile\fR menu, in order to change the record or -annotator names, or the \fIWFDB environment\fR (the \fIWFDB path\fR and the -\fIWFDB calibration file\fR). -.PP -To select sets of signals and annotations to view, fill in the \fBRecord -name:\fR field (up to 8 characters), and the \fBAnnotator name:\fR field (up to -3 characters). Leave the \fIAnnotator name:\fR field empty if the record is -unannotated, or if you do not wish to view annotations. Although the WFDB -environment may be changed within the \fBChoose Inputs\fR dialog, note that -the effects of any such changes are limited to the current session of the WFDB -(other WFDB applications and future \fBwview\fR sessions are unaffected). -.PP -The \fIWFDB path\fR is a list of directories that are searched when you specify -a record or annotator name. The WFDB path is usually initialized by setting -the MS-DOS environment variable \fBWFDB\fR before starting MS Windows, using -the MS-DOS batch file \fBsetwfdb.bat\fR (see \fIsetwfdb\fR(1)). If a WFDB -`header' file was selected (either from the File Manager or from the command -line), the optional \fIdrive:path\fR component of the file name, if present, -is inserted at the beginning of the WFDB path (but after the current directory, -if the WFDB path begins with the current directory or has not been -initialized). -.PP -The \fIWFDB calibration file\fR is a text file containing information about the -relative scales of many different types of signals (see \fBwfdbcal\fR(5)). The -WFDB calibration file is usually specified by setting the MS-DOS environment -variable \fBWFDBCAL\fR; as for the WFDB path, this is usually performed using -\fBsetwfdb.bat\fR before starting MS Windows. Do not include a drive -specification or path information in the name of the WFDB calibration file -unless the file cannot be found in any of the directories named in the WFDB -path. -.SS Browsing a Record -.PP -Use the scrollbar at the bottom of the window to move in either direction -through the record. If you click on the scrollbar arrows, the display scrolls -by 1 second at a time in the indicated direction. Clicking in the rectangles -beside the ``thumb'' of the scrollbar scrolls the display by the width of the -window. You may also drag the ``thumb'' to move to any desired location. -.PP -Keyboard commands can also perform these functions and others: -.br -.TS -center; -r l. - back 1 second - forward 1 second - back 1 screenful - forward 1 screenful - back to beginning - forward to end - search forward (see below) - search backward (see below) - zoom in (increase time scale) - zoom out (decrease time scale) -+ increase signal amplitude -- decrease signal amplitude -.TE -.PP -You may also enter a desired time in the \fBRecenter at\fR field of the -\fBFind\fR window (accessible from the \fBEdit\fR menu). \fBwview\fR -redraws the display centered on the specified time. -.PP -The times shown in the lower corners of the signal window usually indicate -elapsed time from the beginning of the record in hours, minutes, and seconds -(hours are omitted if the elapsed time is less than one hour). If the times -are shown enclosed in square brackets, they indicate the actual time of day -(and possibly the date) when the signals shown were recorded, determined by -reference to the base time and date recorded in the header file for the record. -.SS Options -.PP -Use the \fBOptions\fR menu to set display and printing options. The \fBView -Options...\fR dialog allows you to choose display scales, turn the grid on and -off, and select options for annotation and signal display. The \fBPrint -Options...\fR dialog is very similar, but its options apply to printed output -only. (The \fBPrint Options...\fR dialog may also be accessed via the -\fBOptions...\fR button in the \fBPrint...\fR dialog, which may be opened from -the \fBFile\fR menu.) -.PP -Select \fBUse default scales and options\fR from \fBView Options...\fR to reset -all display options to their initial values. In \fBPrint Options...\fR, select -\fBUse display scales and options\fR to set the printing options to match those -you have chosen for display. -.PP -If displayed or printed, the \fBgrid\fR marks 200 ms intervals horizontally, -and 0.5 mV intervals vertically. (For signals not dimensioned in units of mV, -the WFDB calibration file specifies the scaling factor between the physical -units of the signal and mV.) At the default scales, the grid intervals should -measure 5 mm on your screen or printed output, corresponding to the standard -ECG display scales of 25 mm/s and 10 mm/mV. (If this is not the case, click -on \fBCalibrate...\fR and follow the instructions on-screen to make appropriate -adjustments for your hardware.) -.PP -\fBMarker bars\fR, if displayed or printed, show the exact locations of each -annotation. Note that policies for placement of ECG annotations may vary -between records (for example, in the MIT-BIH Arrhythmia Database, QRS -annotations are placed at the R-wave peak, but in the AHA Database, these -annotations are placed at the PQ junction). -.PP -Normally, \fBwview\fR shows only the mnemonic corresponding to the primary -annotation type (the \fBanntyp\fR field) of each annotation. Exceptions -include \fBRHYTHM\fR annotations (for which the rhythm, encoded in the -\fBaux\fR field of the annotation, is shown); \fBNOISE\fR annotations, for -which signal quality data encoded in the \fBsubtyp\fR field are shown); and -\fBSTCH\fR, \fBTCH\fR, and \fBNOTE\fR annotations (for which the contents of -the \fBaux\fR field are shown). To make it easier to identify these -exceptions, \fBRHYTHM\fR annotations appear below the level of ordinary -annotations, and the others appear above the level of ordinary annotations. -The representation matches that used in the \fIMIT-BIH Arrhythmia Database -Directory\fR and other directories, which contain complete lists of the -mnemonics used in each database. -.PP -By selecting the appropriate items from \fBView Options...\fR or \fBPrint -Options...\fR, you can view or print the contents of the optional annotation -fields (\fBsubtyp\fR, \fBchan\fR, \fBnum\fR, and \fBaux\fR, shown from top to -bottom in that order if two or more are selected). See the \fIWFDB -Programmer's Guide\fR for further information about optional annotation fields. -.PP -\fBSignal baselines\fR, if selected, are displayed or printed only for signals -for which absolute levels are significant, such as blood pressure. Such -signals are referred to as DC-coupled signals, since they must be digitized -without being passed through high-pass filters in order to preserve absolute -levels. In signals such as ECGs, only variations in level, rather than -absolute levels are significant. These AC-coupled signals are high-pass -filtered before digitization, in order to remove any DC component, so that the -gain can be chosen optimally for the range of variation in the signal. By -default, \fBsignal names\fR appear at the left margin slightly above each -signal; deselect \fBSignal names\fR to suppress this output. The header file -for each record specifies signal names, and which signals are DC-coupled; see -the \fIWFDB Programmer's Guide\fR for further information. -.SS Searching for Annotations -.PP -Select \fBFind...\fR from the \fBEdit\fR menu to bring up the \fBFind\fR -dialog. Enter an annotation mnemonic (e.g., \fBV\fR) in the \fBSearch -forward\fR or \fBSearch backward\fR field. Click on the radio button to the -left of the chosen search direction, then click on \fBOK\fR. \fBwview\fR -redraws the signals, centered on the next annotation of the specified type -that was not visible in the previous screenful. If the search is unsuccessful, -the \fBFind\fR window remains visible, so that you can modify the search -criteria. -.PP -In addition to standard annotation mnemonics (listed in the \fIWFDB -Programmer's Guide\fR), you may enter signal quality strings (as displayed by -\fIwview\fR for \fBNOISE\fR annotations), or \fBaux\fR strings (as displayed -for \fBRHYTHM\fR, ST and T change, and \fBNOTE\fR annotations). In short, you -may search for any string that \fBwview\fR uses when drawing annotations. -When specifying \fBaux\fR strings, a prefix is sufficient as a search target -(for example, ``\fB(S\fR'' matches any annotation with an \fBaux\fR string -beginning with these characters, such as ``\fB(SVTA\fR'' or ``\fB(ST0+\fR''). -.PP -To repeat a search forward, press the key; to repeat a search -backward, press the key. If you use these keyboard shortcuts -without having defined a search target, behaves in the same way as -, and in the same way as (moving to the -adjacent screenful in the appropriate direction). -.SS Printing -.PP -You can print the current contents of the main \fBwview\fR window, or any -selected segment of the current record, by selecting \fBPrint...\fR from the -\fBFile\fR menu to bring up the \fBPrint\fR dialog. Choose the output device -from the \fBPrinter\fR list. Select the range (time interval) to be printed -by choosing either \fBEntire Record\fR, \fBCurrent Contents of Window\fR (the -default), or \fBSegment\fR. If you choose \fBSegment\fR, enter the times of -the beginning and end of the desired segment in the \fBFrom:\fR and \fBTo:\fR -fields. Press \fBOK\fR to begin printing, or \fBCancel\fR to return to -\fBwview\fR without printing. -.SS Help -.PP -On-line help is available by selecting a topic from the \fBHelp\fR menu, or by -selecting any control and pressing the \fBF1\fR key. The \fBHelp\fR menu -topics include most of the text of this \fBman\fR page. -.SH ENVIRONMENT -.TP -\fBWFDB\fR -The database path: a list of directories that contain database files. An -empty component is taken to refer to the current directory. All applications -built with the \fIwfdb\fR(3) library search for their database input files in -the order specified by \fBWFDB\fR. If \fBWFDB\fR is not set, searches are -limited to the builtin WFDB path (see \fBsetwfdb\fR(1)). Under -MS-DOS/MS-Windows, directory names are separated by semicolons (;), and the -format of \fBWFDB\fR is that of the MS-DOS \fBPATH\fR variable (colons may be -used following drive specifiers within \fBWFDB\fR in this case). -.TP -\fBWFDBCAL\fR -The name of the WFDB calibration file (see \fBwfdbcal\fR(5)), which must be in -a directory named by \fBWFDB\fR (see immediately above). This file is used by -\fBwview\fR to determine standard scales for signals other than ECGs. If -\fBWFDBCAL\fR is not set, the default WFDB calibration file is used (see -\fBsetwfdb\fR(1)). If the calibration file is not readable, signals may be -drawn at incorrect scales. -.PP -After determining appropriate values for these variables, you may wish to add -commands for setting them to your \fIautoexec.bat\fR file. -.SH INSTALLATION -.PP -The current version of \fBwview\fR requires manual installation of a few -files: -.br -.TS -center; -l l. -\fIwview.exe\fR \fBwview\fR itself, in Windows executable form -\fIwview.hlp\fR the compressed MS Windows Help file for \fBwview\fR -\fIwfdb.dll\fR the WFDB library, compiled as a large model MS Windows DLL -.TE -.br -All of these files should be installed in the same directory, which should be -somewhere in your \fBPATH\fR; the main MS Windows directory (usually -\fBc:\\windows\fR) seems to be the most popular choice for commercial MS -Windows applications, and is suitable for this purpose. Be certain that you do -not overwrite other files of the same names, however (I don't know of any -commercial applications that use these file names, but check your system to be -safe). At this point, it is possible to start \fBwview\fR using the -command-line interface. -.PP -To install a \fIwview\fR icon in the Program Manager workspace, select (click -once on) a program group (such as `Applications'). Select \fBNew...\fR from -the Program Manager's \fBFile\fR menu, choose \fBProgram item\fR from the -\fBNew Program Object\fR dialog that appears, and click on \fBOK\fR. The -\fBProgram Item Properties\fR dialog then appears. Enter ``\fBWFDB -Browser\fR'' in the \fBDescription:\fR field, and the full pathname of -\fIwview.exe\fR in the \fBCommand line:\fR field, then click on \fBOK\fR. It -is now possible to start \fBwview\fR by clicking on its icon. -.PP -Finally, open the MS Windows File Manager and choose \fBAssociate...\fR from -its \fBFile\fR menu. Enter ``\fBhea\fR'' in the \fBFiles with extension:\fR -field, and click on \fBBrowse\fR. Find and select \fIwview.exe\fR using the -\fBBrowse\fR dialog, and click on \fBOK\fR. This procedure makes it possible -to start \fBwview\fR simply by double-clicking on any WFDB header (\fB.hea\fR) -file. -.SH BUGS -.PP -Probably many. Please send your comments, suggestions, and bug reports to -the author: - -George B. Moody -.br -MIT Room E25-505A -.br -Cambridge, MA 02139 USA -.br -.br -Internet: george@mit.edu -.PP -A significant known bug is that only one instance of \fBwview\fR may be run -at any given time. This is a consequence of using a large memory model DLL -(in this case, \fBwfdb.dll\fR) under MS Windows 3.1. Fixing this bug is a very -low priority (i.e., not likely to happen soon unless it is fixed by a future -version of MS Windows). If you are careful, it is possible to have two or -more instances running simultaneously \fIprovided that the same record (and -annotator, if any) are open in all instances\fR. Exit cleanly by iconifying -(closing) all instances first, then quit each instance without reopening the -window. - -.SH SEE ALSO -\fBpschart\fR(1) (for PostScript), \fBview\fR(1) (for MS-DOS), \fBwave\fR(1) -(for X11), \fBgtkwave\fR(1) (for MS-Windows) -.SH AUTHOR -George B. Moody (george@mit.edu) -.SH SOURCES -http://www.physionet.org/physiotools/wfdb/wview/ diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/doc/wpg-src/Makefile.tpl wfdb-10.3.16/doc/wpg-src/Makefile.tpl --- wfdb-10.3.15/doc/wpg-src/Makefile.tpl 2002-10-26 23:40:42.000000000 -0400 +++ wfdb-10.3.16/doc/wpg-src/Makefile.tpl 2005-06-13 03:14:11.000000000 -0400 @@ -9,8 +9,8 @@ # T2DARGS is a list of options for texi2dvi. Uncomment one of these to set the # page size (the size of the printed area on the paper): -# T2DARGS = --t @afourpaper -T2DARGS = --t @letterpaper +# T2DARGS = -t @afourpaper +T2DARGS = -t @letterpaper # PDFTEXCFG is the name of a file containing parameter settings for pdftex # (used by texi2dvi). Choose the file corresponding to your paper size: diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/doc/wpg-src/wpg0.tex wfdb-10.3.16/doc/wpg-src/wpg0.tex --- wfdb-10.3.15/doc/wpg-src/wpg0.tex 2004-11-14 10:41:32.000000000 -0500 +++ wfdb-10.3.16/doc/wpg-src/wpg0.tex 2005-06-13 03:17:13.000000000 -0400 @@ -21,7 +21,7 @@ @center Harvard-MIT Division of Health Sciences and Technology @page @vskip 0pt plus 1filll -Copyright @copyright{} 1989 -- 2004 George B. Moody +Copyright @copyright{} 1989 -- 2005 George B. Moody @sp 2 The most recent versions of the software described in this guide may be downloaded from @uref{http://www.physionet.org/}. For further @@ -489,9 +489,37 @@ WFDB Software Package distribution, for information on any more recent changes that may not be described here. +@unnumberedsubsec Changes in version 10.3.16 + +Benjamin Moody has added an interface between the WFDB library and +@code{libcurl} as an alternative to the existing @code{libwww} interface, and +has updated @file{configure} and @file{conf/*.def} to search for and use +@code{libcurl} if it is available. The primary advantages of @code{libcurl} +over @code{libwww} are that @code{libcurl} is smaller and faster, it supports +access to password-protected files, and it is actively maintained. Both +libraries are freely available on all popular platforms. + +Isaac Henry has updated @code{configure} to support building a native +MS-Windows version of the WFDB library using either Cygwin gcc or MinGW +gcc. + +A number of minor changes, mostly involving conditional use of +@file{malloc.h}, @file{stdlib.h}, and @file{string.h}, were made to +eliminate warnings from gcc 4.x. + +@unnumberedsubsec Changes in version 10.3.15 + +Rules for generating the binary tarball for MS-Windows have been +fixed so that the Cygwin DLLs are now included with correct +permissions. + +Installation of shared libraries under GNU/Linux requires an extra +step if SELinux is enabled (as under Fedora Core 2 and later); this +has been incorporated into @file{conf/linux-slib.def}. + @unnumberedsubsec Changes in version 10.3.14 -Guido Muesch reported that the WFDB library function getspf() did not always +Guido Muesch reported that @code{getspf()} did not always return correct results if the frame frequency does not have an exact representation as a double precision floating point number. This problem has now been corrected. @@ -904,6 +932,7 @@ creating a source file called @file{psamples.c} that contains: @example +#include #include main() @@ -990,26 +1019,28 @@ additional libraries, and the corresponding @samp{-l} options can usually be given before or after the @samp{-lwfdb} option. +@cindex NETFILES +@cindex curl +@cindex libcurl @cindex libwww @cindex W3C libwww -If the WFDB library was installed with NETFILES support, it will make -use of functions contained in the @code{libwww} libraries. If you have -dynamically linkable versions of the @code{libwww} libraries, as under -GNU/Linux, these will be loaded automatically when you run -@code{psamples}. If you have only static versions of these libraries, -as under Solaris or MS-Windows, however, it is necessary to provide -additional arguments in the @code{cc} command line in order to compile -successfully. One way to do this is to follow the model used to compile -the standard WFDB applications supplied with the WFDB library; see -@file{Makefile} in the @file{app} directory of the WFDB software package -source tree. +If the WFDB library was installed with NETFILES support, it will make use of +functions contained in the @code{libcurl} or @code{libwww} libraries. If you +have dynamically linkable versions of the @code{libcurl} or @code{libwww} +libraries, as under GNU/Linux, these will be loaded automatically when you run +@code{psamples}. If you have only static versions of these libraries, as under +Solaris or MS-Windows, however, it is necessary to provide additional arguments +in the @code{cc} command line in order to compile successfully. One way to do +this is to follow the model used to compile the standard WFDB applications +supplied with the WFDB library; see @file{Makefile} in the @file{app} directory +of the WFDB software package source tree. If you are using WFDB version 10.2.6 or a later version and @file{gcc} or a compatible compiler, the @file{wfdb-config} utility is available to help construct commands for compiling programs that use the WFDB -library (and the @code{libwww} libraries, if available). Use it like -this: +library (and the @code{libcurl} or @code{libwww} libraries, if available). +Use it like this: @example gcc `wfdb-config --cflags` -o psamples psamples.c `wfdb-config --libs` @@ -1019,7 +1050,7 @@ Note that this command contains backticks (`), not apostrophes ('). @file{wfdb-config} is particularly useful if the WFDB library or its @file{*.h} files are installed in non-standard locations, or if -you have only static @code{libwww} libraries. +you have only static @code{libcurl} or @code{libwww} libraries. Under MS-Windows, it will be easiest to use @file{gcc}, the GNU C/C++ compiler, which is included in the freely available Cygwin software @@ -1345,15 +1376,17 @@ modified version rather than the original. @cindex NETFILES +@cindex curl +@cindex libcurl @cindex libwww @cindex W3C libwww -The WFDB path may contain @uref{http://} and @code{ftp://} URL prefixes -(other schema, such as @code{file://} and @code{https://}, may also be -supported if they are supported by your version of @code{libwww}). If -NETFILES support is not compiled into the WFDB library, any WFDB -path components containing @file{://} are ignored. (These features were -first introduced in WFDB library version 10.1.0.) +The WFDB path may contain @uref{http://} and @code{ftp://} URL prefixes (other +schema, such as @code{file://} and @code{https://}, may also be supported if +they are supported by your version of @code{libcurl} or @code{libwww}). If +NETFILES support is not compiled into the WFDB library, any WFDB path +components containing @file{://} are ignored. (These features were first +introduced in WFDB library version 10.1.0.) @cindex indirect WFDB path @cindex file containing WFDB path @@ -2019,6 +2052,7 @@ beginning of the record: @example +#include #include main(int argc, char **argv) @@ -2415,6 +2449,7 @@ (@file{atr}) annotation file for record @file{100s}: @example +#include #include main() @@ -5537,16 +5572,22 @@ @cindex http @cindex ftp @cindex WFDB path +@cindex curl +@cindex libcurl @cindex libwww @cindex W3C libwww If the symbol @code{WFDB_NETFILES} is defined at the time the WFDB library is compiled, then input files located on remote web (HTTP) and FTP servers can be -read directly. This capability is implemented using the World Wide Web -Consortium's @code{libwww} library (which is available on many of the platforms -supported by the WFDB library). NETFILES support, if available, is transparent -to WFDB applications. To make use of this feature, simply link to the -NETFILES-enabled WFDB library (the necessary @code{libwww} functions will be +read directly. This capability was originally implemented using the World Wide +Web Consortium's @code{libwww} library (which is available on many of the +platforms supported by the WFDB library). In WFDB library version 10.3.16 and +later, this capability can alternatively be provided by the @code{libcurl} +library, which is smaller, faster, and more robust than @code{libwww}, and is +actively supported and its creators on all of the popular platforms and many +others as well. NETFILES support, if available, is transparent to WFDB +applications. To make use of this feature, simply link to the NETFILES-enabled +WFDB library (the necessary @code{libcurl} or @code{libwww} functions will be loaded automatically), and incorporate one or more URL prefixes in the WFDB path. @@ -5566,16 +5607,17 @@ by passing @code{slpdb/slp37} as the @var{record} argument to @code{wfdbinit} (or @code{isigopen}, @code{annopen}, etc.). -Current implementations of @code{libwww} permit input from @uref{http://} URLs -in much the same way that local files are read, provided that the remote web -server supports HTTP 1.1 range requests (most, including PhysioNet's, do). -This means that it is not necessary to download an entire file in order to -examine part of it, and you may notice little or no speed difference between -local file and network file input for many applications. If the remote server -does not support range requests, however, or if input is from an @code{ftp://} -URL, the current implementation downloads the entire file to memory, so you may -notice a significant startup delay if the file is long and your network -connection is slow, or if the file does not fit into physical memory. +Current implementations of @code{libcurl} and @code{libwww} permit input from +@uref{http://} URLs in much the same way that local files are read, provided +that the remote web server supports HTTP 1.1 range requests (most, including +PhysioNet's, do). This means that it is not necessary to download an entire +file in order to examine part of it, and you may notice little or no speed +difference between local file and network file input for many applications. If +the remote server does not support range requests, however, or if input is from +an @code{ftp://} URL, the current implementations download the entire file to +memory, so you may notice a significant startup delay if the file is long and +your network connection is slow, or if the file does not fit into physical +memory. Currently, NETFILES support is limited to input files; as always, any output files created by the WFDB library are written into the current directory, @@ -7404,6 +7446,8 @@ @item NETFILES @cindex NETFILES (defined) +@cindex curl +@cindex libcurl @cindex libwww @cindex W3C libwww WFDB files made available by an FTP or HTTP (web) server; readable @@ -7412,7 +7456,8 @@ library sources with the symbol @code{WFDB_NETFILES} defined (to anything; its value is not important, only that it is defined) and then linking them with the @code{libwww} library available from the World Wide Web -Consortium (@uref{http://www.w3.org/Library/}). +Consortium (@uref{http://www.w3.org/Library/}) or the @code{libcurl} +library available from @uref{http://curl.haxx.se/}. @item 9-track tape @cindex nine-track tape (defined) @@ -7661,15 +7706,20 @@ @node Unix installation, Mac OS X installation, Distribution, Installation @unnumberedsec Unix, GNU/Linux, and similar operating systems +@cindex curl +@cindex libcurl @cindex libwww @cindex W3C libwww Before beginning the installation of the WFDB Software Package, obtain and -install the @code{libwww} package from @uref{http://www.w3.org/Library/} or -from @uref{http://@-www.physio@-net.org/physio@-tools/libwww/}. This package -is provided with most current versions of GNU/Linux. (If you have a program -called @code{libwww-config}, then @code{libwww} is installed already.) You may -omit this step if you do not wish to have NETFILES support. +install the @code{libcurl} package from @uref{http://curl.haxx.se/}, or else +the @code{libwww} package from @uref{http://www.w3.org/Library/} or from +@uref{http://@-www.physio@-net.org/physio@-tools/libwww/}. One or both of +these packages is provided with most current versions of GNU/Linux. (If you +have a program called @code{curl-config}, then @code{libcurl} is installed +already; if you have one named @code{libwww-config}, then @code{libwww} is +installed already.) You may omit this step if you do not wish to have NETFILES +support. @cindex XView toolkit @@ -7730,7 +7780,7 @@ @item Mac OS X Developer Tools (from @uref{http://developer.apple.com/tools/xcode/}) @item -libwww (from Fink, @uref{http://fink.sourceforge.net/}) +libcurl or libwww (from Fink, @uref{http://fink.sourceforge.net/}) @item an X11 package (from Fink, @uref{http://fink.sourceforge.net/}; XDarwin, @uref{http://www.xdarwin.org/}; or Apple, @@ -7753,8 +7803,9 @@ (freely available from @uref{http://www.cygwin.com}). This includes @code{gcc} (the GNU C/C++ compiler) as well as a comprehensive assortment of other Unix utilities ported to MS-Windows. Accept the defaults -suggested by the installer, but be sure to select and install the @code{gcc}, -@code{binutils}, and @code{make} packages from the @code{Devel} category +suggested by the installer, but be sure to select and install the @code{bc}, +@code{curl-devel}, @code{gcc}, @code{gcc-mingw}, @code{gv}, @code{ImageMagick}, +@code{make}, @code{sunrpc}, and @code{xorg-x11-devel} packages (these are not installed by default in a minimal Cygwin installation). @emph{Important:} Although you may be able to compile the WFDB software package @@ -7764,14 +7815,6 @@ commercial C compilers, although you will need to customize them for your compiler. Your feedback is appreciated. -@cindex libwww -@cindex W3C libwww - -Before beginning the installation of the WFDB Software Package, obtain and -install the @code{libwww} package from @uref{http://www.w3.org/Library/} or -from @uref{http://@-www.physio@-net.org/physio@-tools/libwww/}. You may -omit this step if you do not wish to have NETFILES support. - Open a Cygwin terminal window (the Cygwin installer will have added this to your MS-Windows start menu). Perform the remaining steps by typing the commands given below into the terminal window. @@ -7817,20 +7860,6 @@ make install @end example -If you have Microsoft or Turbo C or C++, and a Microstar Laboratories DAP 1200- -or 2400-series analog interface board, you can compile @file{sample} (a program -for creating database records from analog signals, and for replaying them in -analog form). To do so successfully, you must first have installed the -Microstar @file{#include} files and DAP interface library on your system. -Specifically, files @file{c_lib.c}, @file{clock.h}, and @file{ioutil.h} must be -installed in your @file{include} directory, and the version of the file -@file{cdapl.lib} that is compatible with your compiler must be installed in a -directory in which libraries are found by your linker. Read and customize -@code{lib/Makefile.dos} and @code{app/Makefile.dos} as appropriate for your -compiler, and use your compiler's @code{make} utility to generate -@code{wfdb.lib} and then @code{sample.exe}. - - @node Other installation, , MS-Windows installation, Installation @unnumberedsec Other systems @@ -8359,10 +8388,11 @@ @item WFDB Programmer's Guide (this guide) @itemx WFDB Applications Guide @itemx WAVE User's Guide -@itemx MIT-BIH Arrhythmia Database (selected records) +@itemx MIT-BIH Arrhythmia Database @itemx MIT-BIH Arrhythmia Database Directory @itemx MIT-BIH Polysomnographic Database @itemx MIMIC Database +@itemx MGH/Marquette Foundation Waveform Database CD-ROMs @itemx Other reference databases of physiologic signals @itemx WFDB Software Package @itemx W3C libwww sources @@ -8382,24 +8412,6 @@ the world (see @uref{http://@-www.@-physio@-net.@-org/@-mirrors/} for a list). @cindex CD-ROM -@cindex MIT DB -@cindex waveform editor -@itemx MIT-BIH Arrhythmia Database CD-ROM -@itemx MIT-BIH Polysomnographic Database CD-ROM -@itemx Software for Physiologic Databases with Samples CD-ROM -@sp 1 -@display -MIT-BIH Database Distribution -MIT Room E25-505A -77 Massachusetts Ave. -Cambridge, MA 02139 USA - -email: @email{george@@mit.edu} -WWW: http://ecg.mit.edu/ -telephone: +1 617 253 7424 -@end display - -@cindex CD-ROM @cindex ESC DB @item European ST-T Database CD-ROM @itemx European ST-T Database Directory @@ -8445,30 +8457,11 @@ 5200 Butler Pike Plymouth Meeting, PA 19462 USA -email: @email{hshupack@@shrsys.hslc.org} -WWW: @uref{http://www.healthcare.ecri.org/} +email: @email{bduffin@@ecri.org} +WWW: @uref{http://www.ecri.org/} telephone: +1 610 825 6000 @end display -@cindex CD-ROM -@cindex MGH DB -@item MGH/Marquette Foundation Waveform Database CD-ROMs -@sp 1 -@display -Anaesthesia/Bioengineering Unit -Massachusetts General Hospital -Fruit St. -Boston, MA 02114 USA - -email: @email{cooper@@etherdome.mgh.harvard.edu} -telephone: +1 617 726 8824 -@end display - -This is a large database of multi-channel recordings (3 ECG leads, radial -arterial, pulmonary arterial, and central venous pressure, respiration, -and CO2), which has been issued on 10 CD-ROMs. In 2003, this database was -contributed to PhysioNet (see above), from which it can be downloaded freely. - @item American National Standard ANSI/AAMI EC38:1998, Ambulatory Electrocardiographs @itemx American National Standard ANSI/AAMI EC57:1998 Testing and Reporting Performance @itemx @ @ @ Results of Cardiac Rhythm and ST Segment Measurement Algorithms @@ -8490,18 +8483,25 @@ @end display CinC is the major scientific meeting at which current research in ECG signal -processing and modelling is discussed; the proceedings of the conference are +processing and modelling is discussed; the proceedings of the conference are probably the single best source of information in print about these topics. -CinC conferences have taken place annually since 1974, usually in September; -in even-numbered years, they are convened in North America, and in Europe in -odd-numbered years. The deadline for submission of abstracts is 1 May each -year. Proceedings of the conferences are published by the IEEE, and -usually appear about 3 months after the date of the conference. CinC -will be in Chicago in 2004 and in Lyon in 2005. +CinC conferences have taken place annually since 1974, usually in September; in +even-numbered years, they are usually convened in North America, and in Europe +in odd-numbered years. The deadline for submission of abstracts is 1 May each +year. Proceedings of the conferences are published by the IEEE, and usually +appear about 3 months after the date of the conference. CinC will be in Lyon +in 2005 and (in a departure from the usual tradition) in Valencia in 2006. @item Proceedings of Computers in Cardiology (ISSN 0276-6574) @sp 1 +The Web of Science (@uref{http://isi1.isiknowledge.com/portal.cgi?DestApp=WOS}) +includes abstracts published in the Proceedings of CinC since 1996. IEEE +members can also find complete CinC proceedings from 1988 to the +present using IEEEXplore (@uref{http://ieeexplore.ieee.org/}). Many +universities provide access to these services for their students, faculty, and +staff. Printed volumes of CinC proceedings are available from: + @display IEEE Customer Service 445 Hoes Lane @@ -8573,6 +8573,19 @@ telefax: +1 503 223 9994 @end display +@cindex curl +@cindex libcurl +@item libcurl +@sp 1 +@display + +WWW: @uref{http://curl.haxx.se/} +@end display + +The @code{libcurl} library is a modern and enhanced replacement for the +@code{libwww} libraries (see below). Only one of @code{libcurl} and +@code{libwww} is needed for NETFILES support. + @cindex libwww @cindex W3C libwww @item W3C libwww libraries diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/doc/wpg-src/wpg.ht0 wfdb-10.3.16/doc/wpg-src/wpg.ht0 --- wfdb-10.3.15/doc/wpg-src/wpg.ht0 2004-03-05 13:15:45.000000000 -0500 +++ wfdb-10.3.16/doc/wpg-src/wpg.ht0 2005-06-12 01:22:13.000000000 -0400 @@ -19,7 +19,7 @@ George B. Moody
    Harvard-MIT Division of Health Sciences and Technology

    -Copyright ©1980-2004 George B. Moody. +Copyright ©1980-2005 George B. Moody.

    The most recent versions of the software described in this guide are freely downloadable from PhysioNet. For @@ -61,10 +61,7 @@ Research Resources of the National Institutes of Health. The most recent version of this guide, and of the software it describes, may be obtained from PhysioNet. -

  • The MIT-BIH Database Distribution -Home Page
    -Information about obtaining CD-ROMs containing many of the databases -available from PhysioNet can be found here. +
  • WFDB Applications Guide
    Includes man pages for the applications included in the WFDB Software @@ -77,8 +74,9 @@ A comprehensive tutorial, with extensive reference material, for WAVE, an interactive waveform browser with facilities for annotation editing and control of external analysis programs. -WAVE runs on PCs under the free Linux operating system, and -on SPARC-based systems under SunOS or Solaris. +WAVE runs on PCs under the free GNU/Linux and FreeBSD +operating systems, and under MS-Windows with Cygwin/X, as well as on Mac OS X +and on SPARC-based systems under SunOS or Solaris.

    diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/doc/wug-src/wug0.tex wfdb-10.3.16/doc/wug-src/wug0.tex --- wfdb-10.3.15/doc/wug-src/wug0.tex 2004-12-13 23:39:47.000000000 -0500 +++ wfdb-10.3.16/doc/wug-src/wug0.tex 2005-06-13 02:31:30.000000000 -0400 @@ -57,7 +57,7 @@ \pagestyle{empty} \vspace*{\fill} \noindent -Copyright \copyright 1992 -- 2004 George B. Moody +Copyright \copyright 1992 -- 2005 George B. Moody \vspace{1 in} \noindent @@ -305,59 +305,45 @@ \vfill -\section*{Notes on the fifth edition} +\section*{Notes on the fifth edition (revised)} This edition contains updated figures, additional tutorial material, and revisions to reflect recent changes in \WAVE{}. -\index{GTKWave} Since version 1, \WAVE{} has used the XView toolkit, -an open source implementation of the Open Look GUI. Open Look is an -elegant and easy-to-use GUI, but it is no longer being actively -developed or supported, and as a result, it is unfamiliar to many -first-time \WAVE{} users. Newer user interface toolkits, such as the -open source GTK+ toolkit, have converged on a common set of graphical -elements and behaviors resembling those of the Motif GUI. GTK+ has a -very active developer community and has been ported from Linux to many -other Unix variants, and to MS Windows. A version of \WAVE{} that -uses the GTK+ toolkit is now available from PhysioNet. Sources and -precompiled versions of GTKWave for Linux and for MS-Windows are -available at -\htmladdnormallink{http://www\-.physio\-net\-.org/physio\-tools/\-beta/\-gtkwave/} -{http://www.physionet.org/physiotools/beta/gtkwave/}. Although -GTKWave is still in development, it is quite usable and contains -nearly all of the functionality of the XView-based \WAVE{} described -in this Guide. -\index{Open Look} +The previous release of the \WAVE{} User's Guide announced the GTKWave +project, intended to replace the XView-based \WAVE{} with a new +implementation based on the GTK+ toolkit. We have redirected our +efforts to the original XView-based \WAVE{} since it is now +available for all of the popular platforms, while the GTK 1.x project +for MS-Windows that inspired development of GTKWave has been +abandoned. -\begin{figure}[h] -\centerline{\epsfig{file=GTKWave}} -\caption{GTKWave (beta).} -\index{GTKWave} -\label{fig:GTKWave} -\end{figure} - -This guide serves as the primary documentation for both \WAVE{} and -GTKWave, but the current edition does not contain any information -specific to GTKWave. - -If you find a difference between GTKWave and what is described in the -Wave User's Guide (other than a cosmetic difference in the user -interface elements), please check the GTKWave Beta Notes -page on PhysioNet -(\htmladdnormallink{http://www\-.physio\-net.org/\-physio\-tools/\-beta/\-gtkwave/\-notes\-.shtml} -{http://www.physionet.org/physiotools/beta/gtkwave/notes.shtml}) to see -if this difference has already been reported. If not, please send me a -note, citing the page number in the printed Wave User's Guide, or the -exact URL in the online version. Indicate what is different in -GTKWave, the name and version of the operating system you are using, -and suggest how the text should be changed. Your reports will help us -to prepare an accurate and up-to-date guide for GTKWave. +\index{Open Look} +A recent flurry of activity has given new life to the venerable +XView toolkit, an open source implementation of the Open Look GUI +that \WAVE{} has used since version 1. Notably, XView has been ported +to Mac OS X (by Logan Donaldson of York University in Toronto) and to +MS-Windows (by Isaac Henry of PhysioNet). As a result, \WAVE{} is now +available on these platforms in addition to GNU/Linux, FreeBSD, +and Solaris. Meanwhile, an outstanding source of XView documentation +has been made available by O'Reilly's Open Books Project +(\htmladdnormallink{http://www\-.oreilly\-.com/open\-book/open\-look/} +{http://www.oreilly.com/openbook/openlook/}), which provides free +on-line copies of the previously unpublished Open Look User's Guide (originally +planned as Volume 3 of O'Reilly's X Window System Series), the XView +Programming Manual (the out-of-print Volume 7A of the same series), +and the XView Reference Manual (Volume 7B, also long out of print). + +Isaac Henry has also provided hooks for using a mouse's scroll wheel +within XView, and future versions of \WAVE{} will take advantage of +this feature where available. \vspace{2em} \noindent GBM\\ Cambridge, Massachusetts\\ -June, 2002 +June, 2002\\ +revised June, 2005 \chapter{Introducing \WAVE{}} \pagenumbering{arabic} @@ -376,8 +362,9 @@ \index{X Window System!client}\index{window manager}\index{Macintosh} \index{Microsoft Windows}\index{SPARCstation}\index{PC} -\WAVE{} is an X Window System client application that runs on Sun -SPARCstations (under Solaris or SunOS), and on PCs running Linux. X +\WAVE{} is an X Window System client application that runs on PCs +running GNU/Linux, FreeBSD, or MS-Windows; on Macintoshes running OS +X; and on SPARCstations running Solaris or SunOS. X clients communicate with an X server and a window manager, programs that handle display output, and keyboard and mouse input, on behalf of the X clients, in much the same way that the Macintosh and @@ -387,8 +374,8 @@ If your computer can run an X server, and it is connected to a network, you can use it to interact with X clients running on any other computers (``hosts'') connected to the same network. Thus you -do not need to have your own SPARCstation or Linux PC in order to use -\WAVE{}, since X server software is available for almost all +do not even need to have \WAVE{} running on your own computer in order +to use it, since X server software is available for almost all currently manufactured computers (including Macintoshes and Windows PCs) and many older computers as well. @@ -397,9 +384,8 @@ with a copy of \WAVE{} running on another networked computer (the \WAVE{} host). (Since the window manager is also an X client, it can run on any computer in the network, although it is usually run on the same computer -as the X server.) If your own computer is a SPARCstation or a PC -running Linux, it can act as the \WAVE{} host, and no network connection -is required. +as the X server.) If your own computer is a Macintosh, PC, or Sparcstation, +it can act as the \WAVE{} host, and no network connection is required. If you don't yet have a \WAVE{} host, see \hyperref{System Requirements} @@ -4684,6 +4670,7 @@ \label{app:system-requirements} \index{Linux}\index{Solaris}\index{SunOS}\index{SPARCstation}\index{PC} +\index{Macintosh}\index{Microsoft Windows} This section includes a shopping list of hardware and software that you will need in order to run \WAVE{}, or that you may find useful in order to use \WAVE{} most effectively. @@ -4694,12 +4681,14 @@ \begin{description} \item [\WAVE{} software] This is freely available from PhysioNet in source form, and in binary form -for PCs running Linux. (Older binaries for SPARC-based systems -running Solaris 2.x or SunOS 4.1.x are also available on PhysioNet. See +for PCs running GNU/Linux or MS-Windows, or Macintoshes running OS X. +(Older binaries for SPARC-based systems running Solaris 2.x or SunOS +4.1.x are also available on PhysioNet. See \hyperref{how to obtain the current version of \WAVE{}} {section~} {, page~\pageref{sec:getting-wave} for details} -{sec:getting-wave}.) +{sec:getting-wave}.) If the XView toolkit can be installed on your +platform, it should be easy to build and use \WAVE{} on it. \index{WAVE host@\WAVE{} host} \index{resolution!of display} @@ -4714,12 +4703,9 @@ mm or less) capable of non-interlaced display at 65 Hz or faster with a resolution of at least 1024x768 with 256 colors. In most cases, you will also want the system to be equipped with a CD-ROM drive (for -loading software and digitized signals) and an Ethernet adapter or a -modem. Check the Linux Hardware-HOWTO to be sure that your chosen -hardware is supported. Most graphics cards, including the popular -accelerated cards, are fully supported by the standard XFree86 X -server, but a few high-end models are supported only in SVGA -compatibility mode. Most PCs manufactured since 1995 will easily meet +loading software and digitized signals) and an Internet connection +(for obtaining data from PhysioNet and compatible sources). +Most PCs manufactured since 1995 will easily meet these requirements; new PCs will exceed most of them by large factors. In mid-2002, it was possible to assemble a suitable Linux PC for about US\$300 (not including the monitor). It is not unreasonable to budget @@ -4735,7 +4721,11 @@ highly recommended if you do much annotation editing. Most are fully compatible with Microsoft two-button mice. Some users prefer trackballs for precision editing since there is no tendency for the -pointer to move when clicking the buttons, as with a mouse. +pointer to move when clicking the buttons, as with a mouse. Future +versions of \WAVE{} will make use of scroll wheels on mice when +available; if you choose a mouse equipped with a scroll wheel, try to +select one that allows you to use the middle button without generating +scroll wheel events. For those on a tight budget, suitable used PCs are often available for next to nothing. If you use an older PC and can afford to upgrade components, get a @@ -4750,8 +4740,14 @@ vendors if you prefer not to assemble your own; see the Linux Commercial-HOWTO for further information. -SPARC-based systems tend to be considerably more expensive than comparable -or faster Linux PCs. Used SPARCstations may be worth considering. +Although \WAVE{} now runs on MS-Windows, we still recommend using +GNU/Linux as the platform of choice because of its greater speed, capability, +configurability, security, and stability, and because of the wider +range of related software available for GNU/Linux. + +Macintoshes and SPARC-based systems may also be worth considering, although +they tend to be substantiallyly more expensive than comparable or +faster Linux PCs. \item [A source of digitized signals] \index{SPARCstation}\index{PC}\index{WFDB Software Package}\index{MS-DOS} @@ -4816,17 +4812,19 @@ as for MS-DOS and MS-Windows PCs, Macintoshes, Amigas, and DEC VAXen running VMS. -\index{Linux}\index{X Window System!XFree86 server} For many users seeking to -add an additional point of access to \WAVE{}, a networked PC may be attractive. -With current CPUs and graphics adapters, rendering speed is much faster than -was available on far more expensive workstations only a few years ago. X -server software for MS-Windows is available from many vendors, and may be a -good choice if you are heavily invested in Windows-based software. (For less -than the cost of a Windows X server, however, you can buy a 30 Gb disk drive -and install Linux, XFree86, and \WAVE{} on it with 29 Gb to spare. Consider -this before choosing a commercial X server for Windows.) If costs of -maintenance and system administration are a concern, an X terminal is probably -a better choice than a networked PC. +\index{Linux}\index{X Window System!XFree86 server} For many users +seeking to add an additional point of access to \WAVE{}, a networked +PC may be attractive. With current CPUs and graphics adapters, +rendering speed is much faster than was available on far more +expensive workstations only a few years ago. X server software for +MS-Windows is freely available as part of Cygwin, and may be a good +choice if you are heavily invested in Windows-based software. (For +less than the cost of a commercial Windows X server, however, you can +buy a 300 Gb disk drive and install Linux, X.org, and \WAVE{} on it +with 298 Gb to spare. Consider this before choosing a commercial X +server for Windows.) If costs of maintenance and system administration are a +concern, an X terminal is probably a better choice than a networked +PC. \section{X11 window managers} \index{window manager}\index{ICCCM} @@ -4850,7 +4848,10 @@ \index{X terminal} are using an MS-DOS PC or an X terminal to access \WAVE{}, the window manager must usually be run remotely, often on the same computer that runs -\WAVE{}. +\WAVE{}. (Note: these recommendations are several years old. Many +newer X11 window managers have appeared since then; \WAVE{} works +with any of them, although {\tt olwm} and {\tt olvwm} still have a +slight advantage over the others. \section{Data acquisition and digitization} \label{sec:adc-boards} @@ -4889,20 +4890,11 @@ signal files are usually very large, Ethernet \index{Ethernet} transmission is -recommended. To set up a minimal Ethernet including a Sun workstation -or Linux PC and an MS-DOS PC, you will need an Ethernet card for each -PC (usually around US\$100; Sun workstations have built-in Ethernet -adapters but may require external transceivers, usually around \$50), -TCP/IP software for the PC (such as Sun's PC-NFS, about \$300), and -miscellaneous cabling and terminators (\$20 or less). For a truly -minimal network of only two systems, see the Linux Ethernet-HOWTO for -details on how to connect two UTP interfaces without using a hub. You -will need a hub (US\$150 or more) to connect more than two systems, -unless you are able to use the older `thin' (10 Base 2) Ethernet. If +recommended. If \index{sample command@{\tt sample} command (for digitization under MS-DOS)} you use {\tt sample} for digitization, signal files can be written directly on the host system's drive at rates up to 80,000 samples per -second using PC-NFS (or up to 100,000 samples per second on local +second using NFS (or up to 100,000 samples per second on local disks). This configuration allows you to examine the signal files using \WAVE{} as the data are being acquired; although \WAVE{} does not currently support real-time, continuously updated display of @@ -4984,8 +4976,9 @@ \label{sec:other-software} \index{WFDB Software Package} -\WAVE{} makes extensive use of the \emph{WFDB Software Package}, available from -the same sources as \WAVE{} itself +\WAVE{} makes extensive use of other components of the \emph{WFDB +Software Package} of which it is a part. The most recent version of +this package is always freely available from PhysioNet (\htmladdnormallink{{\tt http://www.physionet.org/}} {http://www.physionet.org/}). The WFDB Software Package includes {\tt calsig}, {\tt mrgann}, {\tt plot2d}, {\tt pschart}, {\tt @@ -5001,7 +4994,7 @@ you will need a browser in order to follow the links to the external data. Even if you don't anticipate using link annotations, you can still use a web browser to view the on-line version of this guide. -Netscape is an attractive choice because of its simple remote-control +Mozilla is an attractive choice because of its simple remote-control interface, among other reasons. Mozilla may be obtained freely from \htmladdnormallink{{\tt http://\-www\-.mozilla\-.org}} {http://www.mozilla.org/}). @@ -5053,9 +5046,11 @@ the WFDB Software Package) and the XView libraries ({\tt libxview.so.3} and {\tt libolgx.so.3}) have been installed. It is strongly recommended that you install the complete WFDB Software Package, since \WAVE{} uses many of the -applications included in this package. The W3C's {\tt libwww} libraries -are optional but recommended; they are necessary if you wish to use \WAVE{} -to read data directly from web and FTP servers. +applications included in this package. The W3C's {\tt libwww} +libraries, or the newer and more capable {\tt libcurl} library, +are optional but recommended; either {\tt libwww} or {\tt libcurl} is +necessary if you wish to use \WAVE{} to read data directly from web +and FTP servers. \index{XView} \index{Linux} @@ -5063,14 +5058,13 @@ X11 client support (Xlib) is available, please obtain the XView source distribution and attempt to port `{\tt cmdtool}' (a simple terminal emulator included in the XView distribution) first. Compared to the original sources, -the Linux version of XView (freely available from +the Linux/Mac OS X/MS-Windows version of XView (freely available from \htmladdnormallink{PhysioNet}{http://www.physionet.org/physiotools/xview/}, \htmladdnormallink{{\tt metalab.unc.edu}} {ftp://metalab.unc.edu/pub/Linux/libs/X/xview/}, \htmladdnormallink{{\tt www.rpmfind.net}} {http://www.rpmfind.net/linux/RPM/}, and their mirrors, and also available on many low-cost Linux CD-ROM archives) is easier to port to another operating system, since many Sun-specific dependencies were removed. -Nevertheless, porting XView is likely to require significant effort. \section{Setting up a printer for \WAVE{}} @@ -5214,7 +5208,8 @@ \subsection{Can I use \WAVE{} if I don't run Linux or another Unix?} -Why would you not want to run Linux or Unix? Any version of Linux or Unix is a +Why would you not want to run Linux or Unix? Any version of Linux or Unix, +including Mac OS X, is a much better choice for research than any version of MS-Windows. See \htmladdnormallink{{\tt http://\-srom.zgp.org/}}{http://srom.zgp.org/} for an independent perspective on this issue. Linux can coexist on the same PC @@ -5224,25 +5219,14 @@ toolkit is needed for the user interface components of \WAVE{}. XView is free software and can be ported to other platforms, but this task is not trivial. -Another possibility is to reimplement \WAVE{}'s user interface with a different -toolkit. The {\sf GTKWave} project is doing just that, using the Gimp toolkit -(GTK+), which runs not only under Linux and Unix, but also under MS-Windows. -Beta-quality versions of {\sf GTKWave} for Linux and for MS-Windows are -currently available from PhysioNet (search for {\sf GTKWave} for further -information). +Since late 2004 it has been possible to run \WAVE{} on MS-Windows directly, +using the free Cygwin POSIX emulation library and X11 server. If you have any networked computer that can run X11R4 or a later version (this includes all current UNIX workstations, PCs, Macintoshes, and a variety of other systems), and access via network to another computer that can host \WAVE{} (see above), you can run \WAVE{} remotely (see the next question). -\index{PostScript} -Other WFDB applications ({\sf WVIEW} for MS-Windows, {\sf VIEW} for -MS-DOS, {\sf MacView} for the Macintosh, and {\tt pschart} and {\tt psfd} for -PostScript devices) offer many of the display features of \WAVE{} in other -environments; none of these currently support annotation editing or control -of external programs, however. - \subsection{How can I use \WAVE{} from an X terminal, PC, Mac, etc.?} \index{remote access}\index{network access} @@ -5468,7 +5452,8 @@ \item \index{signal!window} If \WAVE{}'s signal window appears, but is solid white or light grey, -your X server does not have backing store enabled. +and you are using a version of \WAVE{} older than 6.8, your X server +does not have backing store enabled. Click on any of the navigation controls (e.g., \button{\tt <<}, \button{\tt <}, \button{\tt >}, or \button{\tt >>}), or resize the window, to make the signals appear. To avoid this problem entirely (until @@ -5576,8 +5561,8 @@ \label{faq:cannot-see-signals} \index{signal!window} -If the signal window is solid white or light grey, your X server does not have -backing store enabled. +If the signal window is solid white or light grey, and your version of +\WAVE{} is older than 6.8, your X server does not have backing store enabled. Click on any of the navigation controls (e.g., \button{\tt <<}, \button{\tt <}, \button{\tt >}, or \button{\tt >>}), or resize the window, to make the signals appear. If this works, the problem is almost certainly that @@ -6540,21 +6525,17 @@ \index{Open Look} Motif and its lookalikes (notably GTK+, Qt, and LessTif) have clearly become the standard, however, and a consequence of this is that the Open Look user -interface presented by \WAVE{} is unfamiliar to many users. There is a -scarcity of introductory material for Open Look in print (but there is an -excellent and comprehensive set of documentation, including an Open Look User's -Guide, available from Darwin Open Systems, \htmladdnormallink{{\tt -http://www.darwinsys.com/}}{http://www.darwinsys.com/}). Unfortunately, the +interface presented by \WAVE{} is unfamiliar to many users. Until recently, +there has been a scarcity of introductory material for Open Look in +print (but O'Reilly's Open Books Project +(\htmladdnormallink{http://www\-.oreilly\-.com/open\-book/open\-look/} +{http://www.oreilly.com/openbook/openlook/}) now provides free +on-line copies of three relevant books (a user's guide and two +programmer's guides). Unfortunately, the Motif API, and those of its lookalikes, are vastly different from the XView API with which \WAVE{} is written, and a port to Motif would be decidedly non-trivial. -The {\sf GTKWave} project is reimplementing the user interface of WAVE using -the Gimp toolkit (GTK+). A beta-quality release of {\sf GTKWave} is now -available from PhysioNet. This offers a stable, object-oriented, and -non-proprietary Motif-like interface under any version of Linux or Unix, and -also under MS-Windows. - \subsection{How can I find out about ...?} There are several sources of information about \WAVE{}: diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/examples/exgetann.c wfdb-10.3.16/examples/exgetann.c --- wfdb-10.3.15/examples/exgetann.c 2002-10-27 00:02:21.000000000 -0400 +++ wfdb-10.3.16/examples/exgetann.c 2005-06-10 09:56:35.000000000 -0400 @@ -1,3 +1,4 @@ +#include #include main() diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/examples/Makefile.dos wfdb-10.3.16/examples/Makefile.dos --- wfdb-10.3.15/examples/Makefile.dos 2002-10-26 15:00:45.000000000 -0400 +++ wfdb-10.3.16/examples/Makefile.dos 1969-12-31 19:00:00.000000000 -0500 @@ -1,61 +0,0 @@ -# file: makefile.dos G. Moody 2 November 1989 -# Last revised: 26 October 2002 -# MS-DOS/Windows `make' description file template for WFDB example programs -# -# WARNING: NO SUPPORT FOR PROPRIETARY COMPILERS. Previous versions of the WFDB -# software package have been compiled successfully by other users using various -# proprietary compilers including those mentioned below. You may find this -# file helpful if you wish to use one of these compilers, but no support can be -# provided in this case. If you cannot successfully compile this software -# using a proprietary compiler, please try using Cygwin/gcc or MinGW/gcc under -# MS-Windows, or DJGPP under MS-DOS (free from http://www.cygwin.com/, -# http://www.mingw.org/, or http://www.delorie.com/ respectively). -# -# Before using this file, define these variables as appropriate for your -# compiler: -# -# CC The name of the command-line C compiler. -# CDFLAGS Optional arguments to be supplied to CC to produce object files -# with debugging symbols. -# COFLAGS Optional arguments to be supplied to CC to produce optimized -# object files (or normal object files if no optimization is -# available). -# LDFLAGS CC options to link with the WFDB library. - -# Commands needed to compile the WFDB example programs are given below for -# several versions of `make'. -# -# Borland (Turbo) `make': -# make install -# Microsoft `make' (supplied with Microsoft C before version 6.0): -# make makefile -# Microsoft `nmake' (supplied with Microsoft C 6.0 and later versions): -# nmake install - -# Most versions of `make' allow you to override the settings of make variables -# from the command line, so that it may not be necessary to edit this file to -# test the effects of small modifications to it. - -# For optimized code, uncomment the next line. -CFLAGS = $(COFLAGS) -# Otherwise, if you modify the sources and need to debug them, uncomment the -# next line. -# CFLAGS = $(CDFLAGS) - -# It should not be necessary to modify anything below this line. -# ----------------------------------------------------------------------------- - -XFILES = example1.exe example2.exe example3.exe example4.exe example5.exe \ - example6.exe example7.exe example8.exe example9.exe example10.exe \ - exannstr.exe exgetann.exe exgetvec.exe exputvec.exe psamples.exe \ - psamplex.exe refhr.exe stdev.exe wfdbversion.exe - -# General rule for compiling C sources into executable files -.c.exe: - $(CC) $(CFLAGS) $*.c $(LDFLAGS) - -clean: - del *.obj - del *.exe - -install: $(XFILES) diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/examples/pgain.c wfdb-10.3.16/examples/pgain.c --- wfdb-10.3.15/examples/pgain.c 2002-11-14 19:06:52.000000000 -0500 +++ wfdb-10.3.16/examples/pgain.c 2005-06-10 10:16:36.000000000 -0400 @@ -1,3 +1,4 @@ +#include #include main() diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/examples/psamples.c wfdb-10.3.16/examples/psamples.c --- wfdb-10.3.15/examples/psamples.c 1999-06-24 11:38:29.000000000 -0400 +++ wfdb-10.3.16/examples/psamples.c 2005-06-10 10:16:33.000000000 -0400 @@ -1,8 +1,10 @@ +#include #include main() { - int i, v[2]; + int i; + WFDB_Sample v[2]; WFDB_Siginfo s[2]; if (isigopen("100s", s, 2) < 1) diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/examples/psamplex.c wfdb-10.3.16/examples/psamplex.c --- wfdb-10.3.15/examples/psamplex.c 2002-05-30 11:57:14.000000000 -0400 +++ wfdb-10.3.16/examples/psamplex.c 2005-06-10 10:16:19.000000000 -0400 @@ -1,11 +1,11 @@ +#include #include main(int argc, char **argv) { - int i; + WFDB_Frequency f = (WFDB_Frequency)0; WFDB_Sample v[2]; WFDB_Siginfo s[2]; - WFDB_Frequency f; WFDB_Time t, t0, t1; if (argc > 1) sscanf(argv[1], "%lf", &f); diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/examples/wfdbversion.c wfdb-10.3.16/examples/wfdbversion.c --- wfdb-10.3.15/examples/wfdbversion.c 2002-10-26 08:41:11.000000000 -0400 +++ wfdb-10.3.16/examples/wfdbversion.c 2005-06-10 10:17:21.000000000 -0400 @@ -1,3 +1,4 @@ +#include #include main() diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/INSTALL wfdb-10.3.16/INSTALL --- wfdb-10.3.15/INSTALL 2003-03-19 12:08:33.000000000 -0500 +++ wfdb-10.3.16/INSTALL 2005-06-08 14:56:59.000000000 -0400 @@ -1,192 +1,115 @@ file: INSTALL G. Moody 30 January 2000 - Last revised: 19 March 2003 + Last revised: 8 June 2005 WFDB Software Package installation notes These notes are infrequently updated, but are included here for those who may not have ready access to the World Wide Web. For those who do, please visit PhysioNet, where up-to-date quick-start guides including installation notes -for popular operating systems are available (find a guide for your platform in -http://www.physionet.org/physiotools/wfdb.shtml). +for popular operating systems are available (find a guide for your platform at +http://physionet.org/physiotools/wfdb.shtml). -This file contains separate sets of notes for UNIX and GNU/Linux, Mac OS/X, -and MS-Windows, followed by brief notes on other ports. +Although ready-to-run binaries are available for several popular platforms, +we strongly recommend building the WFDB Software Package from sources. Doing +so is the best way to ensure that the components of the package will work +together properly on your system, and that your software is up-to-date. The +process of building the package is simple and quick. -Once you have successfully compiled and installed the WFDB Software Package, -you will find a great deal of information about using it on PhysioNet; begin -by looking in http://www.physionet.org/physiotools/manuals.shtml. -_______________________________________________________________________________ +The GNU C compiler (gcc) is available freely for all platforms, and it is +strongly recommended. We will help you to solve any problems you may encounter +in building the WFDB Software Package using gcc on your platform; our +experience has been that such builds are trouble-free if you follow the +instructions in our quick-start guides (see above). -Under UNIX or GNU/Linux: +Some users have reported success in compiling the WFDB Software Package, except +for WAVE, using various commercial compilers. We don't use or recommend these +compilers, and we offer no instructions or support for doing so whatsoever. If +you choose to use one of these unsupported compilers, you are on your own! -1. Install the World Wide Web Consortium's libwww library (you will need both - the library itself and the developer's package; download them from - http://www.physionet.org/physiotools/libwww/, or from the W3C's web site - at http://www.w3.org/Library). You may skip this step if you don't want - support for reading input files from remote web and FTP servers. See - README.NETFILES for further information about this option. - -2. WAVE is an optional part of the WFDB Software Package. If the XView - toolkit is available for your system, installing WAVE is highly recommended. - Otherwise, go on to step 3; after completing the WFDB Software Package - installation, you may wish to try GTKWave (an experimental version of WAVE - that uses the GTK+ GUI, which is available for many versions of Unix; see - http://www.physionet.org/physiotools/beta/gtkwave/ for more information.) - - Install the XView library (see http://www.physionet.org/physiotools/xview/) - if you want to use WAVE, and be sure that the directory that contains the - XView application 'textedit' (usually /usr/openwin/bin) is in your PATH. - For information about WAVE, see the WAVE User's Guide, - http://www.physionet.org/physiotools/wug/. - - Copy the contents of http://www.physionet.org/physiotools/wug/ into - /usr/local/help/html/wug if you wish to read the help from local files; - otherwise, edit wave/wave.info and change all occurrences of - '/usr/local/help/html/' into 'http://www.physionet.org/physiotools/wug/'. - (The utility 'wget' -- which you can find on PhysioNet -- can be helpful - if you wish to copy an entire directory of a web site, as suggested - here.) +PREPARATION -3. In this directory, type: - ./configure - make install - You will need root permissions to run 'make install', unless you change - WFDBROOT so that the files are installed in a directory that you own (you - will be given a chance to do this when running 'configure'). +There are three prerequisites for a complete build. All are free, open-source +software available for all popular platforms: -4. [Optional but recommended] In this directory, test the installation by - typing: - make check - If there are any errors, look in the checkpkg directory for details. + * Software development tools (make, gcc, X11 libraries and *.h files, etc.) - If libwww and XView are installed, you can also test WAVE with the command: - wave -r mitdb/200 -a atr - If WAVE opens with a blank (solid white) signal window, you may need to - enable backing store in your X server. If you use XFree86 as your X server, - you can insert the line - Option "backingstore" - in the Device section of your XF86Config (or XF86Config-4), or run the - server with the option "+bs" to obtain the same result. + + GNU/Linux, Unix, etc.: usually included -5. If for any reason you wish to uninstall the WFDB Software Package, type: - make uninstall - from this directory. You will need root permissions to uninstall unless - you changed WFDBROOT before installing the package. + + Mac OS X: install Mac OS X Developer Tools, X11 for Mac OS X, X11 SDK + (all included in current Mac OS X CD sets) -_______________________________________________________________________________ + + MS-Windows: Install Cygwin, including (at least) the following optional + packages: bc, curl-devel, gcc, gcc-mingw, gv, ImageMagick, make, + sunrpc, and xorg-x11-devel. (Other required packages will be installed + automatically if those listed are selected.) Detailed instructions + are available at + http://physionet.org/physiotools/cygwin/ -Under Mac OS/X (Darwin): + * An HTTP client library, either libcurl (preferred) or libwww -The WFDB Software Package has been successfully compiled under Mac OS/X 10.2 -(Darwin 6.0.1). It should also work under 10.1, but this has not been tested. + + GNU/Linux, Unix, etc.: usually included, or from http://curl.haxx.se/ + (libcurl) or http://www.w3.org/Library/ (libwww) -1. Install Mac OS/X Developer Tools (requires root permissions). This - software can be downloaded from http://developer.apple.com/macosx/). This - software is also available on a CD-ROM included with Mac OS/X. - -2. [Optional but recommended, requires root permissions] Install XDarwin. - This port of the X Window System (server, clients, and libraries) is needed - if you wish to use plt together with the WFDB Software Package, or if you - wish to compile WAVE or GTKWave (but see the next item below). XDarwin - binaries are available from Fink, http://fink.sourceforge.net/; sources are - available from http://www.xdarwin.org/. - -3. [Optional, requires root permissions] Install XView. At this time, an - incomplete port of XView to Darwin is available from the GNU-Darwin project - (http://gnu-darwin.sourceforge.net/). You may wish to see if a complete - XView port is available; if so, it should be possible to compile WAVE under - Mac OS/X as part of the installation of the WFDB Software Package. - * You will not be able to compile or use WAVE unless you have installed - XView, but none of the other applications require XView. - * Add /usr/X11R6/bin (or the directory containing textedit, if you have a - non-standard installation of XView) to your PATH before attempting to - compile WAVE. + + Mac OS X: install libcurl or libwww (both base and development packages) + from Fink (http://fink.sourceforge.net) -Once you have completed these steps, follow the instructions above for -installing the WFDB Software Package under UNIX or GNU/Linux. + + MS-Windows: install curl-devel from Cygwin (see above) -_______________________________________________________________________________ + One or both of these libraries may already be installed on your system; + to check, try running the commands + curl-config --version + libwww-config --version + + * The XView libraries and *.h files -Under MS-Windows: + All platforms: free from http://physionet.org/physiotools/xview/ -1. If you have not already done so, install the Cygwin development environment - (freely available from http://sources.redhat.com/cygwin/). This includes - gcc (the GNU C/C++ compiler) as well as a comprehensive assortment of other - Unix utilities ported to MS-Windows. Accept the defaults suggested by the - installer. - - See the notes near the end of this section for information contributed by - users about using proprietary compilers. - -2. Open a Cygwin terminal window (the Cygwin installer will have added this to - your MS-Windows start menu). Check that 'which' and 'gcc' are accessible by - typing the command: - which gcc - The output of this command should be: - /usr/bin/gcc - If you don't see this output, rerun the Cygwin installer and manually select - the necessary packages to correct the problem before continuing. - -3. Install the World Wide Web Consortium's libwww library (you will need both - the library itself and the developer's package; download them from - http://www.physionet.org/physiotools/libwww/, or from the W3C's web site - at http://www.w3.org/Library). You may skip this step if you don't want - support for reading input files from remote web and FTP servers. See - README.NETFILES for further information about this option. +Detailed instructions for obtaining and installing these prerequisites, all +of which are free, open-source software, are included in the WFDB quick-start +guides for the popular platforms (see above). Brief notes about other +platforms are at the end of this file. -4. In this directory (the top-level directory of the WFDB software package, - containing the file you are now reading), type: + +BUILDING AND INSTALLING + +Once you have installed the necessary prerequisites, the WFDB installation +process is the same on all platforms: + +1. Open a terminal emulator window and navigate to the top-level directory + of the WFDB sources (the directory that contains this file). + +2. In this directory, build and install the WFDB Software Package by typing: ./configure make install + Except under MS-Windows, you will normally need root permissions to run + 'make install'. If you don't have root permissions, set WFDBROOT to the + name of a directory in which you have permission to write (you will be + given a chance to do this when running 'configure'). -5. [Optional but recommended] In this directory, test the installation by - typing: +3. In this directory, test the installation by typing: make check If there are any errors, look in the checkpkg directory for details. -6. After completing these steps, you may wish to install GTKWave (an - experimental version of WAVE that uses the GTK+ GUI, which is available for - MS-Windows; see http://www.physionet.org/physiotools/beta/gtkwave/ for - more information.) -7. If for any reason you wish to uninstall the WFDB Software Package, type: - make uninstall - from this directory. +FURTHER READING + +Once you have successfully compiled and installed the WFDB Software Package, +you will find a great deal of information about using it on PhysioNet; begin +by looking in http://physionet.org/physiotools/manuals.shtml. + +Many frequently asked questions about this software are answered in the +PhysioNet FAQ (http://physionet.org/faq.shtml). -............................................................................... -Using proprietary compilers under MS-DOS/MS-Windows +UNINSTALLING + +If for any reason you wish to uninstall the WFDB Software Package, type: + make uninstall +from this directory. You will need root permissions to uninstall unless +you changed WFDBROOT before installing the package. + +This file contains separate sets of notes for GNU/Linux, Mac OS/X, +and MS-Windows, followed by brief notes on other ports. - IMPORTANT: Although you may be able to compile the WFDB software package - using a proprietary compiler, this is NOT SUPPORTED. Cygwin 'gcc' is free, - robust, and supported -- please give it a try! - - If, despite the above, you feel that you must use a proprietary compiler, - this section contains notes contributed by other users who have done so. - The developers of the WFDB Software Package do not use any of these - compilers, so you are on your own if you choose to use one of them. - - Between 1985 and 1995, previous versions of this software were compiled - using Borland C/C++, Microsoft C/C++, and Turbo C/C++. These compilers - came bundled with 'make'-like utilties (Microsoft's was called 'nmake'). - If you are using one of these compilers, you may be able to use the - 'Makefile.dos' files in several of the subdirectories of this one to - perform an automated compilation of the WFDB software package, although you - will need to customize these 'Makefile.dos' files for your compiler. Your - feedback is appreciated. - -Borland C++ Builder - - Thanks to Ion Gaztaaga for these notes. - -1. Edit lib/wfdb.h to define WFDB_NETFILES as 0 (do not compile with libwww - support). It's possible that libwww support will work, but this has not - been tested. - -2. Build a static library (wfdb.lib) from the sources in the 'lib' directory, - selecting: - C calling convention - Borland Language compliance - Others: Borland C++ Builder default settings _______________________________________________________________________________ @@ -207,7 +130,7 @@ library functions. This approach won't yield the benefits of reduced compilation time and reduced executable size available on platforms that support shared libraries, but it should allow you to compile and run the WFDB -software with a minimum of difficulty. +software (except for WAVE) with a minimum of difficulty. If you find that changes are necessary in order to compile this software successfully on your platform, please send details to the author diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/lib/db.h wfdb-10.3.16/lib/db.h --- wfdb-10.3.15/lib/db.h 2000-01-30 04:13:20.000000000 -0500 +++ wfdb-10.3.16/lib/db.h 1969-12-31 19:00:00.000000000 -0500 @@ -1,120 +0,0 @@ -/* file: db.h G. Moody 13 June 1983 - Last revised: 29 April 1999 wfdblib 10.0.0 -Compatibility definitions for (WF)DB library - -_______________________________________________________________________________ -wfdb: a library for reading and writing annotated waveforms (time series data) -Copyright (C) 1999 George B. Moody - -This library is free software; you can redistribute it and/or modify it under -the terms of the GNU Library General Public License as published by the Free -Software Foundation; either version 2 of the License, or (at your option) any -later version. - -This library is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -PARTICULAR PURPOSE. See the GNU Library General Public License for more -details. - -You should have received a copy of the GNU Library General Public License along -with this library; if not, write to the Free Software Foundation, Inc., 59 -Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -You may contact the author by e-mail (george@mit.edu) or postal mail -(MIT Room E25-505A, Cambridge, MA 02139 USA). For updates to this software, -please visit PhysioNet (http://www.physionet.org/). -_______________________________________________________________________________ - -The DB library has been renamed (in version 10.0.0 and later versions) as the -WFDB library. New applications should be written to use the definitions -contained in . Existing applications written for use with the -DB library may be compiled without change in almost all cases using this header -file and linking them with the WFDB library. Note that the WFDB library uses -the environment variables WFDB and WFDBCAL, rather than DB and DBCAL, so that -DB applications that manipulate these variables directly (rather than via -getdb/setdb) may need revision to accommodate these changes. -*/ - -#ifndef db_DB_H /* avoid multiple definitions */ -#define db_DB_H - -#include - -/* DB library version */ -#define DB_MAJOR WFDB_MAJOR -#define DB_MINOR WFDB_MINOR -#define DB_RELEASE WFDB_RELEASE - -/* Simple data types */ -#define DB_Sample WFDB_Sample -#define DB_Time WFDB_Time -#define DB_Date WFDB_Date -#define DB_Frequency WFDB_Frequency -#define DB_Gain WFDB_Gain -#define DB_Group WFDB_Group -#define DB_Signal WFDB_Signal -#define DB_Annotator WFDB_Annotator - -/* Array sizes */ -#define DB_MAXANN WFDB_MAXANN -#define DB_MAXSIG WFDB_MAXSIG -#define DB_MAXSPF WFDB_MAXSPF -#define DB_MAXRNL WFDB_MAXRNL -#define DB_MAXUSL WFDB_MAXUSL -#define DB_MAXDSL WFDB_MAXDSL - -/* DB_anninfo '.stat' values */ -#define READ WFDB_READ -#define WRITE WFDB_WRITE -#define AHA_READ WFDB_AHA_READ -#define AHA_WRITE WFDB_AHA_WRITE - -/* DB_siginfo '.fmt' values -#define FMT_LIST WFDB_FMT_LIST -#define NFMTS WFDB_NFMTS - -/* Default signal specifications */ -#define DEFFREQ WFDB_DEFFREQ -#define DEFGAIN WFDB_DEFGAIN -#define DEFRES WFDB_DEFRES - -/* getvec operating modes */ -#define DB_LOWRES WFDB_LOWRES -#define DB_HIGHRES WFDB_HIGHRES - -/* calinfo '.caltype' values -#define AC_COUPLED WFDB_AC_COUPLED -#define DC_COUPLED WFDB_DC_COUPLED -#define CAL_SQUARE WFDB_CAL_SQUARE -#define CAL_SINE WFDB_CAL_SINE -#define CAL_SAWTOOTH WFDB_CAL_SAWTOOTH -#define CAL_UNDEF WFDB_CAL_UNDEF - -/* Structure definitions */ -#define DB_siginfo WFDB_siginfo -#define DB_calinfo WFDB_calinfo -#define DB_anninfo WFDB_anninfo -#define DB_ann WFDB_ann - -/* Composite data types */ -#define DB_Siginfo WFDB_Siginfo -#define DB_Calinfo WFDB_Calinfo -#define DB_Anninfo WFDB_Anninfo -#define DB_Annotation WFDB_Annotation - -/* Renamed library functions (others not renamed) */ -#define dbinit wfdbinit -#define dbgetskew wfdbgetskew -#define dbsetskew wfdbsetskew -#define dbsetstart wfdbsetstart -#define dbquit wfdbquit -#define dbquiet wfdbquiet -#define dbverbose wfdbverbose -#define dberror wfdberror -#define setdb setwfdb -#define getdb getwfdb -#define dbfile wfdbfile -#define dbflush wfdbflush -#define db_error wfdb_error - -#endif diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/lib/Makefile.dos wfdb-10.3.16/lib/Makefile.dos --- wfdb-10.3.15/lib/Makefile.dos 2004-11-28 15:24:13.000000000 -0500 +++ wfdb-10.3.16/lib/Makefile.dos 1969-12-31 19:00:00.000000000 -0500 @@ -1,209 +0,0 @@ -# file: Makefile.dos G. Moody 2 November 1989 -# Last revised: 28 November 2004 wfdblib 10.3.14 -# MSDOS/Windows `make' description file template for compiling the WFDB library -# -# _____________________________________________________________________________ -# wfdb: a library for reading and writing annotated waveforms(time series data) -# Copyright (C) 1989-2004 George B. Moody -# -# This library is free software; you can redistribute it and/or modify it under -# the terms of the GNU Library General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) any -# later version. -# -# This library is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for -# more details. -# -# You should have received a copy of the GNU Library General Public License -# along with this library; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# You may contact the author by e-mail (george@mit.edu) or postal mail -# (MIT Room E25-505A, Cambridge, MA 02139 USA). For updates to this software, -# please visit PhysioNet (http://www.physionet.org/). -# _____________________________________________________________________________ -# -# WARNING: NO SUPPORT FOR PROPRIETARY COMPILERS. Previous versions of the WFDB -# software package have been compiled successfully by other users using various -# proprietary compilers including those mentioned below. You may find this -# file helpful if you wish to use one of these compilers, but no support can be -# provided in this case. If you cannot successfully compile this software -# using a proprietary compiler, please try using Cygwin/gcc or MinGW/gcc under -# MS-Windows, or DJGPP under MS-DOS (free from http://www.cygwin.com/, -# http://www.mingw.org/, or http://www.delorie.com/ respectively). -# -# Before using this file, define these variables as appropriate for your -# compiler (see below for suitable settings for several popular C/C++ -# compilers): -# -# BINDIR The directory in which the applications will be installed. -# CC The name of the command-line C compiler. -# CDFLAGS Optional arguments to be supplied to CC to produce object files -# with debugging symbols. -# CDLLFLAGS Optional arguments to be supplied to CC to produce object files -# for use in a Windows DLL. -# COFLAGS Optional arguments to be supplied to CC to produce optimized -# object files (or normal object files if no optimization is -# available). -# INCDIR One of the directories searched by CC for #include <...> -# files. For Microsoft C, use one of the directories specified -# by the INCLUDE environment variable. If you are using Turbo -# or Borland C, it may be most convenient to use the directory -# in which the standard headers reside (e.g., \tc\include or -# \bc4\include). The WFDB library *.h files will be installed -# in the `wfdb' subdirectory of INCDIR. -# LB The name by which the program that constructs libraries from -# object files is invoked from the command line. -# LBPUNCT The punctuation that is appended to the list of object files -# given as a command-line argument to LB. -# LIBDIR One of the directories searched by CC for *.lib files. For -# Microsoft C, it should be one of the directories specified by -# the LIB environment variable; for Turbo or Borland C, you may -# find it most convenient to use the directory in which the -# standard libraries reside (e.g., \tc\lib or \bc4\lib). -# The WFDB libraries will be installed in LIBDIR. -# WFDBLIB The name of the static (large memory model) WFDB library. -# WFDBDLL The name of the large memory model WFDB dynamic link library -# (DLL) for use with MS Windows applications. -# WFDBDLLDEF The name of the WFDB DLL export definition file. If you -# compile versions of the WFDB DLL using mutually incompatible -# compilers, make sure that the library name in the first line -# of this file is unique for each version. -# WFDBILIB The name of the import library corresponding to WFDBDLL. - -INCDIR = c:\include -LIBDIR = c:\lib - -# The value of CFILES is a list of sources used for all versions of the WFDB -# library. The value of LBARG is a list of modules, which should match the -# source file names in CFILES, for use by the library-building utility. These -# variables should not require modification; they are defined here so that -# system-dependent variables below may incorporate their values. -CFILES = wfdbinit.c annot.c signal.c calib.c wfdbio.c -LBARG = +wfdbinit+annot+signal+calib+wfdbio - -# The value of TARGETS specifies which versions of the WFDB library will be -# compiled. TARGETS may include one or more of `static', and `dll'. -# Successful compilation of the DLL version requires the MS Windows SDK or -# equivalent (supplied with MS C/C++ 7.0, MS Visual C++, Borland C/C++, Turbo -# C for Windows, and available separately for many other C compilers). -TARGETS = static dll - -# The next two sections illustrate settings suitable for use with several -# popular C/C++ compilers. Note that the particular names chosen for the -# compiled WFDB library have no special significance to any of these compilers. -# If you use compilers from more than one supplier, however, the libraries -# generated by each should be kept distinct to avoid confusion. Makefiles for -# the WFDB applications assume the use of this scheme for naming the libraries. - -# If you are using Microsoft C, uncomment the next 15 lines. -# CC = cl -# CDFLAGS = -Od -Za -Zi -DMSDOS -DUSE_FREAD -Ml -# CDLLFLAGS = -ALw -Gsw -Os -W3 -D_WINDLL -DUSE_FREAD -DUSE_FWRITE -# COFLAGS = -Ox -Za -DMSDOS -DUSE_FREAD -Ml -# WFDBLIB = wfdb.lib -# WFDBDLL = wfdb.dll -# WFDBDLLDEF = wfdbdll.def -# WFDBILIB = wfdbdll.lib -# LB = lib -# LBPUNCT = ,; -# LINKDLL = link libentry$(LBARG), $(WFDBDLL), wfdb.map/map, ldllcew.lib \ -# libw.lib/noe/nod,$(WFDBDLLDEF) -# Q = \" - -# If you are using Borland C, uncomment the next 15 lines. -CC = bcc -CDFLAGS = -Od -A -w- /V -DMSDOS -ml -CDLLFLAGS = -Os -w- -ml -WD -D_WINDLL -DUSE_FREAD -DUSE_FWRITE -COFLAGS = -Ox -A -w- -DMSDOS -ml -WFDBLIB = wfdb.lib -WFDBDLL = wfdb.dll -WFDBDLLDEF = wfdbdll.def -WFDBILIB = wfdbdll.lib -LB = tlib -LBPUNCT = -LINKDLL = tlink /c/x/P-/Twd c0dl$(LBARG), $(WFDBDLL), , import mathwl cwl,\ - $(WFDBDLLDEF) -Q = \" -# For Turbo C, uncomment the previous 14 lines and the next line. -# CC = tcc - -# Commands needed to build and install the WFDB library are given below for -# several versions of `make'. -# -# Borland (Turbo) `make': -# make install -# Microsoft `make' (supplied with Microsoft C before version 6.0): -# make makefile -# Microsoft `nmake' (supplied with Microsoft C 6.0 and later versions): -# nmake install - -# Most versions of `make' allow you to override the settings of make variables -# from the command line, so that it may not be necessary to edit this file to -# test the effects of small modifications to it. - -# For optimized code, uncomment the next line. -CFLAGS = $(COFLAGS) -# Otherwise, if you modify the sources and need to debug them, uncomment the -# next line. -# CFLAGS = $(CDFLAGS) - -# Except as noted at the end of this file, it should not be necessary to modify -# anything below this line. -# ----------------------------------------------------------------------------- - -$(LIBDIR): - -mkdir $(LIBDIR) - -$(BINDIR) - -mkdir $(BINDIR) - -# Build the static library -buildstatic: - del $(WFDBLIB) - $(CC) -c $(CFLAGS) $(ML) $(CFILES) - $(LB) $(WFDBLIB) $(LBARG)$(LBPUNCT) - -# Install the large-model library -static: buildstatic - copy $(WFDBLIB) $(LIBDIR) - -# Build the Windows DLL version of the library, and the import library -builddll: - del $(WFDBDLL) - $(CC) -c $(CDLLFLAGS) $(CFILES) - $(LINKDLL) - implib $(WFDBILIB) $(WFDBDLLDEF) - rc $(WFDBDLL) - -# Install the Windows DLL version of the library, and the import library -dll: builddll - copy $(WFDBDLL) $(LIBDIR) - copy $(WFDBILIB) $(LIBDIR) - -# Install the header files. (The copies in this directory are used when -# compiling the WFDB library; the installed copies are needed only when -# compiling WFDB applications that use the library.) -headers: - -mkdir $(INCDIR) - -mkdir $(INCDIR)\wfdb - copy wfdb.h $(INCDIR)\wfdb - copy ecgcodes.h $(INCDIR)\wfdb - copy ecgmap.h $(INCDIR)\wfdb - -wfdb-config.exe: headers wfdb-config.c - $(CC) $(CFLAGS) wfdb-config.c - -install: $(LIBDIR) $(BINDIR) $(TARGETS) headers wfdb-config.exe - copy wfdb-config.exe $(BINDIR) - -# If you are using Microsoft `make' (not `nmake'), you may wish to comment out -# the next six lines to avoid having `make' clean up automatically. -clean: - -del $(WFDBLIB) - -del $(WFDBDLL) - -del $(WFDBILIB) - -del *.obj - -del wfdb-config.exe diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/lib/makelib wfdb-10.3.16/lib/makelib --- wfdb-10.3.15/lib/makelib 2000-05-24 22:35:27.000000000 -0400 +++ wfdb-10.3.16/lib/makelib 1969-12-31 19:00:00.000000000 -0500 @@ -1,3 +0,0 @@ -# `make clean': also remove previously compiled versions of the library -clean: - rm -f libwfdb.* *.o *~ diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/lib/README wfdb-10.3.16/lib/README --- wfdb-10.3.15/lib/README 2002-10-26 12:00:17.000000000 -0400 +++ wfdb-10.3.16/lib/README 2005-06-08 17:20:56.000000000 -0400 @@ -1,9 +1,9 @@ file: README G. Moody 1 July 1989 - Last revised: 26 October 2002 wfdblib 10.2.9 + Last revised: 8 June 2005 wfdblib 10.3.15 _______________________________________________________________________________ wfdb: a library for reading and writing annotated waveforms (time series data) -Copyright (C) 2002 George B. Moody +Copyright (C) 1989-2005 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 @@ -27,37 +27,35 @@ This directory contains sources for the WFDB library. Please look at the README file in the directory above this one before installing the WFDB library. -If a `make' utility is available, follow the instructions in the appropriate -`make' description file (see the list below) to compile and install the WFDB -library on your system. If you do not have a `make' utility, you will have to -perform the installation manually; the comments in the `make' files may be -helpful in determining how to proceed. For information about using the -library, see the WFDB Programmer's Guide (TeX source in the `doc' directory at -the same level as this one). +If a `make' utility is available, follow the instructions in 'Makefile' to +compile and install the WFDB library on your system. If you do not have a +`make' utility, you will have to perform the installation manually; the +comments in 'Makefile' may be helpful in determining how to proceed. + +For information about using the library, see the WFDB Programmer's Guide (TeX +source in the `doc' directory at the same level as this one). The following files will be found in this directory: COPYING.LIB the GNU Library General Public License Makefile `make' description file for compiling the WFDB library using ANSI/ISO standard C compilers on supported platforms -Makefile.dos `make' description file for compiling the WFDB library using - unsupported compilers from Borland, Microsoft, etc. Makefile.top Used by ../configure to construct Makefile (comments only) Makefile.tpl Used by ../configure to construct Makefile (portable section) README this file annot.c WFDB library functions for annotations calib.c WFDB library functions for signal calibration -db.h compatibility definitions for old DB applications ecgcodes.h ECG annotation codes ecgmap.h ECG annotation code mapping macros signal.c WFDB library functions for signals +wfdb-config.c mini-app to print WFDB library version and linking information wfdb.h WFDB library constant, structure, and function interface - definitions -wfdbdll.def MS Windows DLL export definitions + definitions (created from wfdb.h0 by ../configure) +wfdb.h0 template for wfdb.h wfdbinit.c WFDB library functions wfdbinit, wfdbquit, and wfdbflush wfdbio.c Low-level I/O functions for the WFDB library -wfdblib.h External definitions for WFDB library functions (generated by - ../configure) +wfdblib.h External definitions for WFDB library functions (created from + wfdblib.h0 by ../configure) wfdblib.h0 template for wfdblib.h What next? diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/lib/wfdbdll.def wfdb-10.3.16/lib/wfdbdll.def --- wfdb-10.3.15/lib/wfdbdll.def 2002-11-27 15:58:25.000000000 -0500 +++ wfdb-10.3.16/lib/wfdbdll.def 1969-12-31 19:00:00.000000000 -0500 @@ -1,86 +0,0 @@ -LIBRARY WFDB - -DESCRIPTION 'WFDB library, version 10.3.1 Copyright (C) George B. Moody 2002.' - -EXETYPE WINDOWS - -STUB 'WINSTUB.EXE' - -CODE PRELOAD MOVEABLE DISCARDABLE - -DATA PRELOAD MOVEABLE SINGLE - -HEAPSIZE 0 - -EXPORTS - annopen @1 - isigopen @2 - osigopen @3 - osigfopen @4 - wfdbinit @5 - getvec @6 - putvec @7 - getann @8 - ungetann @9 - putann @10 - isigsettime @11 - isgsettime @12 - iannsettime @13 - ecgstr @14 - strecg @15 - setecgstr @16 - annstr @17 - strann @18 - setannstr @19 - anndesc @20 - setanndesc @21 - timstr @22 - mstimstr @23 - strtim @24 - datstr @25 - strdat @26 - adumuv @27 - muvadu @28 - aduphys @29 - physadu @30 - calopen @31 - getcal @32 - putcal @33 - newcal @34 - flushcal @35 - getinfo @36 - putinfo @37 - newheader @38 - setheader @39 - wfdbquit @40 - sampfreq @41 - setsampfreq @42 - getcfreq @43 - setcfreq @44 - getbasecount @45 - setbasecount @46 - setbasetime @47 - wfdbquiet @48 - wfdbverbose @49 - wfdberror @50 - setwfdb @51 - getwfdb @52 - setibsize @53 - setobsize @54 - wfdbfile @55 - wfdbflush @56 - setgvmode @57 - getframe @58 - wfdbgetskew @59 - wfdbsetskew @60 - wfdbgetstart @61 - wfdbsetstart @62 - getspf @63 - getifreq @64 - iannclose @65 - oannclose @66 - setifreq @67 - setmsheader @68 - sample @69 - sample_valid @70 - WEP @71 RESIDENTNAME diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/lib/wfdb.h0 wfdb-10.3.16/lib/wfdb.h0 --- wfdb-10.3.15/lib/wfdb.h0 2005-01-01 20:58:57.000000000 -0500 +++ wfdb-10.3.16/lib/wfdb.h0 2005-06-11 17:58:16.000000000 -0400 @@ -1,5 +1,5 @@ /* file: wfdb.h G. Moody 13 June 1983 - Last revised: 1 January 2005 wfdblib 10.3.15 + Last revised: 11 June 2005 wfdblib 10.3.16 WFDB library type, constant, structure, and function interface definitions _______________________________________________________________________________ @@ -33,8 +33,9 @@ /* WFDB library version. */ #define WFDB_MAJOR 10 #define WFDB_MINOR 3 -#define WFDB_RELEASE 15 +#define WFDB_RELEASE 16 #define WFDB_NETFILES 1 /* if 1, library includes code for HTTP, FTP clients */ +#define WFDB_NETFILES_LIBCURL 1 /* Determine what type of compiler is being used. */ #ifdef __STDC__ /* true for ANSI C compilers only */ @@ -353,7 +354,7 @@ extern char *getenv(); extern void exit(); typedef long time_t; -# ifndef NOMALLOC_H +# ifdef HAVE_MALLOC_H # include # else extern char *malloc(), *calloc(), *realloc(); diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/lib/wfdbio.c wfdb-10.3.16/lib/wfdbio.c --- wfdb-10.3.15/lib/wfdbio.c 2004-04-30 10:20:07.000000000 -0400 +++ wfdb-10.3.16/lib/wfdbio.c 2005-06-11 23:26:01.000000000 -0400 @@ -1,10 +1,10 @@ /* file: wfdbio.c G. Moody 18 November 1988 - Last revised: 30 April 2004 wfdblib 10.3.13 + Last revised: 11 June 2005 wfdblib 10.3.16 Low-level I/O functions for the WFDB library _______________________________________________________________________________ wfdb: a library for reading and writing annotated waveforms (time series data) -Copyright (C) 1988-2004 George B. Moody +Copyright (C) 1988-2005 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 @@ -613,15 +613,6 @@ return (error_message); } -#if WFDB_NETFILES -static int nf_vfprintf(netfile *nf, const char *format, va_list ap) -{ - /* no support yet for writing to remote files */ - errno = EROFS; - return (0); -} -#endif - /* First version: for ANSI C compilers and Microsoft Windows */ #if defined(__STDC__) || defined(_WINDOWS) #include @@ -649,6 +640,15 @@ va_end(arguments); } +#if WFDB_NETFILES +static int nf_vfprintf(netfile *nf, const char *format, va_list ap) +{ + /* no support yet for writing to remote files */ + errno = EROFS; + return (0); +} +#endif + int wfdb_fprintf(WFDB_FILE *wp, const char *format, ...) { int ret; @@ -1002,13 +1002,81 @@ range requests) */ static int www_done_init = FALSE; /* TRUE once libwww is initialized */ +#if WFDB_NETFILES_LIBCURL +static CURL *curl_ua = NULL; + +/* Construct the User-Agent string to be sent with HTTP requests. */ +static char *curl_get_ua_string() +{ + char *libcurl_ver; + static char *s = NULL; + if (s) { + free(s); + s = NULL; + } + libcurl_ver = curl_version(); + s = malloc(32 + strlen(libcurl_ver)); + if (s) { + sprintf(s, "libwfdb/%d.%d.%d (%s)", WFDB_MAJOR, WFDB_MINOR, + WFDB_RELEASE, libcurl_ver); + } + return (s); +} + +static char curl_error_buf[CURL_ERROR_SIZE]; + +/* This function will print out the curl error message if there was an + error. Zero means there was no error. */ +static int curl_try(CURLcode err) +{ + if (err) { + wfdb_error("curl error: %s\n", curl_error_buf); + } + return err; +} + +struct chunk { + long size, buffer_size; + char *data; +}; + +/* This is a dummy write callback, for when we don't care about the + data curl is receiving. */ + +static size_t curl_null_write(void *ptr, size_t size, size_t nmemb, + void *stream) +{ + return (size*nmemb); +} + +typedef struct chunk CHUNK; +#define chunk_size(x) ((x)->size) +#define chunk_data(x) ((x)->data) +#define chunk_new curl_chunk_new +#define chunk_delete curl_chunk_delete +#define chunk_putb curl_chunk_putb +#else +#define CHUNK HTChunk +#define chunk_size HTChunk_size +#define chunk_data HTChunk_data +#define chunk_new HTChunk_new +#define chunk_delete HTChunk_delete +#define chunk_putb HTChunk_putb +#endif + void wfdb_wwwquit() { if (www_done_init) { +#if WFDB_NETFILES_LIBCURL + curl_easy_cleanup(curl_ua); + curl_ua = NULL; + curl_global_cleanup(); +#else #ifdef USEHTCACHE HTCacheTerminate(); #endif HTProfile_delete(); +#endif www_done_init = FALSE; } } @@ -1016,9 +1084,28 @@ static void www_init() { if (!www_done_init) { +#if WFDB_NETFILES_LIBCURL + /* Initialize the curl "easy" handle. */ + curl_global_init(CURL_GLOBAL_ALL); + curl_ua = curl_easy_init(); + /* Buffer for error messages */ + curl_easy_setopt(curl_ua, CURLOPT_ERRORBUFFER, curl_error_buf); + /* Return an error code when the server replies with status >= 400 */ + curl_easy_setopt(curl_ua, CURLOPT_FAILONERROR, 1L); + /* String to send as a User-Agent header */ + curl_easy_setopt(curl_ua, CURLOPT_USERAGENT, curl_get_ua_string()); + /* Search $HOME/.netrc for passwords */ + curl_easy_setopt(curl_ua, CURLOPT_NETRC, CURL_NETRC_OPTIONAL); + /* Use any available authentication method */ + curl_easy_setopt(curl_ua, CURLOPT_HTTPAUTH, CURLAUTH_ANY); + + /* (Uncomment this line to enable tons of debugging + information from libcurl) */ + /* curl_easy_setopt(curl_ua, CURLOPT_VERBOSE, 1L); */ +#else char *p; char version[20]; - + #ifdef USEHTCACHE char *cachedir = CACHEDIR; /* root of the netfile data cache */ int cachesize = CACHESIZE; /* maximum size of the cache in MB */ @@ -1041,12 +1128,57 @@ HTEventInit(); /* added 19 July 2001 -- necessary for use with WINSOCK, seems to be harmless otherwise */ atexit(wfdb_wwwquit); +#endif www_done_init = TRUE; } } +#if WFDB_NETFILES_LIBCURL +/* This function is called when a header is received. ptr points to + the string received; size*nmemb is the number of bytes, and stream + is the pointer specified as CURLOPT_WRITEHEADER. */ +static size_t curl_header_length_write(void *ptr, size_t size, size_t nmemb, + void *stream) +{ + char *s = (char *) ptr; + double *d = (double *) stream; + + if (0 == strncasecmp(s, "Content-Length:", 15)) { + sscanf(s + 15, "%lf", d); + } + return size*nmemb; +} +#endif + static long www_get_cont_len(const char *url) { +#if WFDB_NETFILES_LIBCURL + static double length; + + length = 0; + if (/* We just want the content length; NOBODY means we want to + send a HEAD request rather than GET */ + curl_try(curl_easy_setopt(curl_ua, CURLOPT_NOBODY, 1L)) + /* Set the URL to retrieve */ + || curl_try(curl_easy_setopt(curl_ua, CURLOPT_URL, url)) + /* Don't send a range request */ + || curl_try(curl_easy_setopt(curl_ua, CURLOPT_RANGE, NULL)) + /* If any body data is received, ignore it */ + || curl_try(curl_easy_setopt(curl_ua, CURLOPT_WRITEFUNCTION, + curl_null_write)) + || curl_try(curl_easy_setopt(curl_ua, CURLOPT_WRITEDATA, NULL)) + /* Process received headers using curl_header_length_write */ + || curl_try(curl_easy_setopt(curl_ua, CURLOPT_HEADERFUNCTION, + curl_header_length_write)) + /* Set the user data for curl_header_length_write */ + || curl_try(curl_easy_setopt(curl_ua, CURLOPT_WRITEHEADER, + &length)) + /* Actually perform the request and wait for a response */ + || curl_easy_perform(curl_ua)) + return 0; + + return (long) length; +#else HTRequest *request = NULL; HTParentAnchor *a = NULL; HTAssocList *headers = NULL; @@ -1062,18 +1194,116 @@ HTRequest_delete(request); } return (length); +#endif +} + +#if WFDB_NETFILES_LIBCURL +/* Create a new, empty chunk. */ +static CHUNK *curl_chunk_new(long len) +{ + struct chunk *c = malloc(sizeof(struct chunk)); + if (!c) { + wfdb_error("curl_chunk_new: not enough memory\n"); + return NULL; + } + if (!(c->data = malloc(len))) { + wfdb_error("curl_chunk_new: not enough memory\n"); + free(c); + return NULL; + } + c->size = 0L; + c->buffer_size = len; + return c; +} + +/* Delete a chunk */ +static void curl_chunk_delete(struct chunk *c) +{ + if (c) { + if (c->data) + free(c->data); + free(c); + } +} + +/* Write data into a chunk. This function is called by curl and must + take the same arguments as fwrite(). ptr points to the data + received, size*nmemb is the number of bytes, and stream is the user + data specified by CURLOPT_WRITEDATA. */ +static size_t curl_chunk_write(void *ptr, size_t size, size_t nmemb, + void *stream) +{ + size_t count=0; + char *p; + + struct chunk *c = (struct chunk *) stream; + while (nmemb > 0) { + while ((c->size + size) > c->buffer_size) { + c->buffer_size += 1024; + if (p = realloc(c->data, c->buffer_size)) + c->data = p; + else { + wfdb_error("curl_chunk_write: insufficient memory\n"); + return (count); + } + } + + memcpy(c->data + c->size, ptr, size); + c->size += size; + count += size; + ptr += size; + nmemb--; + } + return (count); +} + +/* This function emulates the libwww function HTChunk_putb. */ +static void curl_chunk_putb(struct chunk *chunk, char *data, size_t len) +{ + curl_chunk_write(data, 1, len, chunk); } +#endif -static HTChunk *www_get_url_range_chunk(const char *url, long startb, long len) +static CHUNK *www_get_url_range_chunk(const char *url, long startb, long len) { +#if !WFDB_NETFILES_LIBCURL HTRequest *request = NULL; HTList *request_err = NULL; HTError *err = NULL; - HTChunk *chunk = NULL, *extra_chunk = NULL; +#endif + CHUNK *chunk = NULL, *extra_chunk = NULL; char range_req_str[6*sizeof(long) + 2]; if (url && *url) { sprintf(range_req_str, "%ld-%ld", startb, startb+len-1); +#if WFDB_NETFILES_LIBCURL + chunk = chunk_new(len); + + if (/* In this case we want to send a GET request rather than + a HEAD */ + curl_try(curl_easy_setopt(curl_ua, CURLOPT_NOBODY, 0L)) + || curl_try(curl_easy_setopt(curl_ua, CURLOPT_HTTPGET, 1L)) + /* URL to retrieve */ + || curl_try(curl_easy_setopt(curl_ua, CURLOPT_URL, url)) + /* Range request */ + || curl_try(curl_easy_setopt(curl_ua, CURLOPT_RANGE, + range_req_str)) + /* This function will be used to "write" data as it is received */ + || curl_try(curl_easy_setopt(curl_ua, CURLOPT_WRITEFUNCTION, + curl_chunk_write)) + /* The pointer to pass to the write function */ + || curl_try(curl_easy_setopt(curl_ua, CURLOPT_WRITEDATA, chunk)) + /* Don't bother writing the header data anywhere */ + || curl_try(curl_easy_setopt(curl_ua, CURLOPT_HEADERFUNCTION, + curl_null_write)) + /* Perform the request */ + || curl_try(curl_easy_perform(curl_ua))) { + + chunk_delete(chunk); + return NULL; + } + +#else request = HTRequest_new(); HTRequest_addRange(request, "bytes", range_req_str); HTRequest_setOutputFormat(request, WWW_SOURCE); @@ -1086,14 +1316,15 @@ "www_get_url_range_chunk: fatal error requesting %s (%s)\n", url, range_req_str); if (chunk) { - HTChunk_delete(chunk); + chunk_delete(chunk); chunk = NULL; } } } - if (chunk && (HTChunk_size(chunk) > len)) { +#endif + if (chunk && (chunk_size(chunk) > len)) { /* We received a larger chunk than requested. */ - if (HTChunk_size(chunk) >= startb + len) { + if (chunk_size(chunk) >= startb + len) { /* If the chunk is large enough to include the requested range and everything before it, assume that that's what we have (it may be the entire file). This might happen if the @@ -1101,15 +1332,16 @@ range request. Since the caller expects only a chunk of len bytes beginning with the data of interest, we need to create a new chunk of the proper length, fill it, and + return it to the caller. HTChunk_new makes a new chunk, which grows as needed in multiples of its argument (in bytes). */ - extra_chunk = HTChunk_new(len); + extra_chunk = chunk_new(len); /* Copy the desired range out of the chunk we received into the new chunk. */ - HTChunk_putb(extra_chunk, &HTChunk_data(chunk)[startb], len); + chunk_putb(extra_chunk, &chunk_data(chunk)[startb], len); /* Discard the chunk we received. */ - HTChunk_delete(chunk); + chunk_delete(chunk); /* Arrange for the new chunk to be returned. */ chunk = extra_chunk; } @@ -1121,7 +1353,9 @@ if (retry) { retry = 0; +#if !WFDB_NETFILES_LIBCURL HTRequest_delete(request); +#endif fflush(stderr); chunk = www_get_url_range_chunk(url, startb, len); retry = 1; @@ -1134,24 +1368,53 @@ "www_get_url_range_chunk: fatal error requesting %s (%s)\n", url, range_req_str); if (chunk) { - HTChunk_delete(chunk); + chunk_delete(chunk); chunk = NULL; } retry = 1; } } } +#if !WFDB_NETFILES_LIBCURL HTRequest_delete(request); +#endif } return (chunk); } -static HTChunk *www_get_url_chunk(const char *url) +static CHUNK *www_get_url_chunk(const char *url) { + CHUNK *chunk = NULL; + +#if WFDB_NETFILES_LIBCURL + chunk = chunk_new(1024); + + if (/* Send a GET request */ + curl_try(curl_easy_setopt(curl_ua, CURLOPT_NOBODY, 0L)) + || curl_try(curl_easy_setopt(curl_ua, CURLOPT_HTTPGET, 1L)) + /* URL to retrieve */ + || curl_try(curl_easy_setopt(curl_ua, CURLOPT_URL, url)) + /* No range request */ + || curl_try(curl_easy_setopt(curl_ua, CURLOPT_RANGE, NULL)) + /* Write to the chunk specified ... */ + || curl_try(curl_easy_setopt(curl_ua, CURLOPT_WRITEFUNCTION, + curl_chunk_write)) + /* ... by this pointer */ + || curl_try(curl_easy_setopt(curl_ua, CURLOPT_HEADERFUNCTION, + curl_null_write)) + /* and ignore the header data */ + || curl_try(curl_easy_setopt(curl_ua, CURLOPT_WRITEDATA, chunk)) + /* perform the request */ + || curl_easy_perform(curl_ua)) { + + chunk_delete(chunk); + return NULL; + } + +#else HTRequest *request = NULL; HTList *request_err = NULL; HTError *err = NULL; - HTChunk *chunk = NULL; if (url && *url) { request = HTRequest_new(); @@ -1165,13 +1428,14 @@ routinely while searching the WFDB path, so it's not flagged as a WFDB library error. */ if (chunk) { - HTChunk_delete(chunk); + chunk_delete(chunk); chunk = NULL; } } } HTRequest_delete(request); } +#endif return (chunk); } @@ -1204,7 +1468,7 @@ static netfile* nf_new(const char* url) { netfile* nf = NULL; - HTChunk* chunk = NULL; + CHUNK* chunk = NULL; long bytes_received = 0L; nf = malloc(sizeof(netfile)); @@ -1225,7 +1489,7 @@ long bytes_requested = nf->cont_len; if (bytes_requested > page_size) bytes_requested = page_size; if (chunk = www_get_url_range_chunk(nf->url,0L, bytes_requested)) { - bytes_received = HTChunk_size(chunk); + bytes_received = chunk_size(chunk); if (bytes_requested != bytes_received) wfdb_error( "nf_new: requested %ld, got %ld bytes from %s\n", @@ -1236,11 +1500,11 @@ } if (bytes_received == 0L && (chunk = www_get_url_chunk(nf->url))) { nf->mode = NF_FULL_MODE; - bytes_received = nf->cont_len = HTChunk_size(chunk); + bytes_received = nf->cont_len = chunk_size(chunk); } if (bytes_received > 0L && (nf->data = calloc(bytes_received, sizeof(char)))) - memcpy(nf->data, HTChunk_data(chunk), bytes_received); + memcpy(nf->data, chunk_data(chunk), bytes_received); if (nf->data == NULL) { if (bytes_received > 0L) wfdb_error("nf_new: insufficient memory (needed %ld bytes)\n", @@ -1255,14 +1519,14 @@ nf_delete(nf); nf = NULL; } - if (chunk) HTChunk_delete(chunk); + if (chunk) chunk_delete(chunk); } return(nf); } static long nf_get_range(netfile* nf, long startb, long len, char *rbuf) { - HTChunk *chunk = NULL; + CHUNK *chunk = NULL; char *rp; long avail = nf->cont_len - startb; @@ -1279,15 +1543,15 @@ ((startb + len) > (nf->base_addr + page_size))) { /* requested data not in cache -- update the cache */ if (chunk = www_get_url_range_chunk(nf->url, startb, rlen)) { - if (HTChunk_size(chunk) != rlen) { + if (chunk_size(chunk) != rlen) { wfdb_error( "nf_get_range: requested %ld bytes, received %ld bytes\n", - rlen, (long)HTChunk_size(chunk)); + rlen, (long)chunk_size(chunk)); len = 0L; } else { nf->base_addr = startb; - memcpy(nf->data, HTChunk_data(chunk), rlen); + memcpy(nf->data, chunk_data(chunk), rlen); } } else { /* attempt to update cache failed */ @@ -1304,12 +1568,12 @@ else if (chunk = www_get_url_range_chunk(nf->url, startb, len)) { /* long request (> page_size) */ - if (HTChunk_size(chunk) != len) { + if (chunk_size(chunk) != len) { wfdb_error( "nf_get_range: requested %d bytes, received %d bytes\n", - len, (long)HTChunk_size(chunk)); + len, (long)chunk_size(chunk)); } - rp = HTChunk_data(chunk); + rp = chunk_data(chunk); } } @@ -1317,7 +1581,7 @@ rp = nf->data + startb; memcpy(rbuf, rp, len); - if (chunk) HTChunk_delete(chunk); + if (chunk) chunk_delete(chunk); return (len); } diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/lib/wfdblib.h0 wfdb-10.3.16/lib/wfdblib.h0 --- wfdb-10.3.15/lib/wfdblib.h0 2004-03-05 12:08:34.000000000 -0500 +++ wfdb-10.3.16/lib/wfdblib.h0 2005-05-31 14:49:38.000000000 -0400 @@ -1,10 +1,10 @@ /* file: wfdblib.h G. Moody 13 April 1989 - Last revised: 5 March 2004 wfdblib 10.3.12 + Last revised: 31 May 2005 wfdblib 10.3.15 External definitions for WFDB library private functions _______________________________________________________________________________ wfdb: a library for reading and writing annotated waveforms (time series data) -Copyright (C) 1989-2004 George B. Moody +Copyright (C) 1989-2005 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 @@ -221,16 +221,19 @@ WFDB library, define WFDB_NETFILES=1 and link with libwww (see 'Makefile'). Otherwise, the WFDB library uses only the ANSI/ISO standard I/O library. */ #if WFDB_NETFILES -#include -#include -#include - -#ifndef EROFS /* errno value: attempt to write to a read-only file system */ -#ifdef EINVAL -#define EROFS EINVAL +#if WFDB_NETFILES_LIBCURL +# include #else -#define EROFS 1 +# include +# include #endif +#include +#ifndef EROFS /* errno value: attempt to write to a read-only file system */ +# ifdef EINVAL +# define EROFS EINVAL +# else +# define EROFS 1 +# endif #endif /* Constants */ diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/Makefile.tpl wfdb-10.3.16/Makefile.tpl --- wfdb-10.3.15/Makefile.tpl 2004-05-30 21:42:55.000000000 -0400 +++ wfdb-10.3.16/Makefile.tpl 2005-06-13 04:28:59.000000000 -0400 @@ -1,12 +1,7 @@ # file: Makefile.tpl G. Moody 24 May 2000 -# Last revised: 30 May 2004 +# Last revised: 13 June 2005 # This section of the Makefile should not need to be changed. -# ARCH specifies the type of CPU and the operating system (e.g., 'i686-Linux'). -# This symbol is used only to generate a name for the binary archive; it -# does not affect how the software is compiled. -ARCH=`uname -m`-`uname -s` - # 'make' or 'make all': compile the WFDB applications without installing them # (requires installation of the WFDB library and includes) all: config.cache @@ -52,7 +47,6 @@ cd psd; $(MAKE) clean cd wave; $(MAKE) clean cd waverc; $(MAKE) clean - cd wview; $(MAKE) -f clean test -d doc && ( cd doc; $(MAKE) clean ) rm -f *~ conf/*~ conf/prompt config.cache */*.exe $(PACKAGE)-*.spec @@ -125,8 +119,11 @@ # 'make bin-tarball': make a gzipped tar archive of the WFDB software package # binaries and other installed files bin-tarball: test-install - cd $(HOME); mv wfdb-test $(PACKAGE)-$(ARCH) - cd $(HOME); tar cfvz $(PACKAGE)-$(ARCH).tar.gz $(PACKAGE)-$(ARCH) + cp conf/archname /tmp; chmod +x /tmp/archname + cd $(HOME); mv wfdb-test $(PACKAGE)-`/tmp/archname` + cd $(HOME); tar cfvz $(PACKAGE)-`/tmp/archname`.tar.gz \ + $(PACKAGE)-`/tmp/archname` + rm -f /tmp/archname # 'make doc-tarball': make a gzipped tar archive of formatted documents # (requires many freely-available utilities that are not part of this diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/MANIFEST wfdb-10.3.16/MANIFEST --- wfdb-10.3.15/MANIFEST 2004-12-13 23:47:37.000000000 -0500 +++ wfdb-10.3.16/MANIFEST 2005-06-13 04:09:19.000000000 -0400 @@ -10,7 +10,6 @@ app/fir.c app/ihr.c app/Makefile -app/Makefile.dos app/Makefile.top app/Makefile.tpl app/mfilt.c @@ -30,10 +29,7 @@ app/rr2ann.c app/rxr.c app/sampfreq.c -app/sample8.hea -app/sample.c app/setwfdb -app/setwfdb.bat app/sigamp.c app/sigavg.c app/skewedit.c @@ -45,8 +41,6 @@ app/sumstats.c app/tach.c app/time2sec.c -app/view.c -app/vsetup.c app/wabp.c app/wfdbcat.c app/wfdbcollate.c @@ -55,7 +49,6 @@ app/wqrs.c app/wrann.c app/wrsamp.c -app/wvscript.c app/xform.c check-manifest checkpkg/ @@ -128,6 +121,7 @@ checkpkg/Makefile.tpl checkpkg/mitdb/ conf/ +conf/archname conf/cygwin.def conf/cygwin-slib.def conf/darwin.def @@ -143,6 +137,8 @@ configure conf/linux.def conf/linux-slib.def +conf/mingw.def +conf/mingw-slib.def conf/prompt-c conf/prompt-n conf/solaris.def @@ -155,7 +151,6 @@ convert/edf2mit.c convert/m2a.c convert/Makefile -convert/Makefile.dos convert/Makefile.top convert/Makefile.tpl convert/makeid.c @@ -311,7 +306,6 @@ doc/wag-src/README doc/wag-src/rxr.1 doc/wag-src/sampfreq.1 -doc/wag-src/sample.1 doc/wag-src/setwfdb.1 doc/wag-src/sigamp.1 doc/wag-src/sigavg.1 @@ -325,7 +319,6 @@ doc/wag-src/tach.1 doc/wag-src/time2sec.1 doc/wag-src/tmac.dif -doc/wag-src/view.1 doc/wag-src/wabp.1 doc/wag-src/wag.cover doc/wag-src/wag.ht0 @@ -344,7 +337,6 @@ doc/wag-src/wqrs.1 doc/wag-src/wrann.1 doc/wag-src/wrsamp.1 -doc/wag-src/wview.1 doc/wag-src/xform.1 doc/wag-src/xview.7 doc/wpg/ @@ -463,7 +455,6 @@ examples/exgetvec.c examples/exputvec.c examples/Makefile -examples/Makefile.dos examples/Makefile.top examples/Makefile.tpl examples/pgain.c @@ -487,18 +478,14 @@ lib/annot.c lib/calib.c lib/COPYING.LIB -lib/db.h lib/ecgcodes.h lib/ecgmap.h lib/Makefile -lib/Makefile.dos lib/Makefile.top lib/Makefile.tpl -lib/makelib lib/README lib/signal.c lib/wfdb-config.c -lib/wfdbdll.def lib/wfdb.h0 lib/wfdbinit.c lib/wfdbio.c @@ -518,7 +505,6 @@ psd/log10.c psd/lomb.c psd/Makefile -psd/Makefile.dos psd/Makefile.top psd/Makefile.tpl psd/memse.c @@ -527,6 +513,7 @@ psd/README README README.NETFILES +README.WINDOWS uninstall.sh wave/ wave/analysis.hlp @@ -581,25 +568,3 @@ wave/xvwave.c wave/xvwave.h wfdb.spec -wview/ -wview/clean -wview/ecg.ico -wview/html/ -wview/html/addnft1.png -wview/html/addnft2.png -wview/html/addnft3.png -wview/html/addnft4.png -wview/html/addnft5.png -wview/html/addnft6.png -wview/html/example.xws -wview/html/wave.png -wview/html/wvsetup.ht0 -wview/makefile -wview/wview.c -wview/wview.def -wview/wview.h -wview/wview.hlp -wview/wview.hpj -wview/wview.rc -wview/wview.rtf -wview/wvscript.c diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/NEWS wfdb-10.3.16/NEWS --- wfdb-10.3.15/NEWS 2004-12-14 00:07:22.000000000 -0500 +++ wfdb-10.3.16/NEWS 2005-06-12 00:13:43.000000000 -0400 @@ -1,3 +1,40 @@ +10.3.16: + Benjamin Moody has added an interface between the WFDB library and + libcurl as an alternative to the existing libwww interface, and has + updated 'configure' and conf/*.def to search for and use libcurl if + it is available. The primary advantages of libcurl over libwww are + that libcurl is smaller and faster, it supports access to + password-protected files, and it is actively maintained. Both + libraries are freely available on all popular platforms. + + Isaac Henry has provided changes to WAVE that improve the behavior of + the signal window if the X server does not provide backing store. + + Isaac has also updated 'configure' to support building a native + MS-Windows version of the WFDB library using either Cygwin gcc or MinGW + gcc. + + In wabp and wqrs, the variable 'signal' has been renamed (to 'sig') + to avoid redefining a symbol appearing in signal.h under Mac OS X 10.4 + (thanks to Richard Piper for reporting this problem). + + A number of minor changes, mostly involving conditional use of + malloc.h, stdlib.h, and string.h, were made to eliminate warnings + from gcc 4.x. + + A small number of files that are no longer supported, including several + MS-DOS utilities and makefiles, have been removed from this version of + the WFDB Software Package. + +10.3.15: + Rules for generating the binary tarball for MS-Windows have been + fixed so that the Cygwin DLLs are now included with correct + permissions. + + Installation of shared libraries under GNU/Linux requires an extra + step if SELinux is enabled (as under Fedora Core 2 and later); this + has been incorporated into conf/linux-slib.def. + 10.3.14: Use rdann's new -v option to add column headings to its standard output. diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/psd/coherence.c wfdb-10.3.16/psd/coherence.c --- wfdb-10.3.15/psd/coherence.c 2002-11-17 15:13:39.000000000 -0500 +++ wfdb-10.3.16/psd/coherence.c 2005-06-10 09:43:44.000000000 -0400 @@ -76,7 +76,7 @@ #if defined(__STDC__) || defined(_WINDOWS) # include #else -# ifndef NOMALLOC_H +# ifdef HAVE_MALLOC_H # include # else extern char *calloc(); diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/psd/fft.c wfdb-10.3.16/psd/fft.c --- wfdb-10.3.15/psd/fft.c 2000-01-30 04:13:20.000000000 -0500 +++ wfdb-10.3.16/psd/fft.c 2005-06-10 09:51:11.000000000 -0400 @@ -1,9 +1,9 @@ /* file: fft.c G. Moody 24 February 1988 - Last revised: 16 September 1999 + Last revised: 10 June 2005 ------------------------------------------------------------------------------- fft: Fast Fourier transform of real data -Copyright (C) 1999 George B. Moody +Copyright (C) 1988-2005 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 @@ -35,6 +35,19 @@ #include #include +#ifdef __STDC__ +#include +#else +extern void exit(); +#endif + +#ifndef BSD +# include +#else /* for Berkeley UNIX only */ +# include +# define strchr index +#endif + #define LEN 16384 /* maximum points in FFT */ #ifdef i386 #define strcasecmp strcmp diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/psd/log10.c wfdb-10.3.16/psd/log10.c --- wfdb-10.3.15/psd/log10.c 2000-06-07 00:06:58.000000000 -0400 +++ wfdb-10.3.16/psd/log10.c 2005-06-09 08:28:15.000000000 -0400 @@ -1,9 +1,9 @@ /* file: log10.c G. Moody 19 July 1995 - Last revised: 7 June 2000 + Last revised: 9 June 2005 ------------------------------------------------------------------------------- log10: common log transform of 2-column data -Copyright (C) 2000 George B. Moody +Copyright (C) 1995-2005 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 @@ -25,6 +25,7 @@ */ +#include #include #ifndef NOVALUES_H diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/psd/lomb.c wfdb-10.3.16/psd/lomb.c --- wfdb-10.3.15/psd/lomb.c 2003-06-16 14:22:23.000000000 -0400 +++ wfdb-10.3.16/psd/lomb.c 2005-06-10 09:52:21.000000000 -0400 @@ -1,9 +1,9 @@ /* file: lomb.c G. Moody 12 February 1992 - Last revised: 16 June 2003 + Last revised: 10 June 2005 ------------------------------------------------------------------------------- lomb: Lomb periodogram of real data -Copyright (C) 2003 George B. Moody +Copyright (C) 1992-2005 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 @@ -37,12 +37,24 @@ Recipes in C (Press, Teukolsky, Vetterling, and Flannery; Cambridge U. Press, 1992). -This version agrees with `fft' output (amplitude spectrum up to the Nyquist +This version agrees with 'fft' output (amplitude spectrum up to the Nyquist frequency with total power equal to the variance); thanks to Joe Mietus. */ #include #include +#ifdef __STDC__ +#include +#else +extern void exit(); +#endif + +#ifndef BSD +# include +#else /* for Berkeley UNIX only */ +# include +# define strchr index +#endif static long lmaxarg1, lmaxarg2; #define LMAX(a,b) (lmaxarg1 = (a),lmaxarg2 = (b), (lmaxarg1 > lmaxarg2 ? \ diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/psd/Makefile.dos wfdb-10.3.16/psd/Makefile.dos --- wfdb-10.3.15/psd/Makefile.dos 2002-10-26 15:29:09.000000000 -0400 +++ wfdb-10.3.16/psd/Makefile.dos 1969-12-31 19:00:00.000000000 -0500 @@ -1,58 +0,0 @@ -# file: makefile.dos G. Moody 14 November 1999 -# Last revised: 26 October 2002 -# MSDOS `make' description file template for PSD estimation programs -# -# WARNING: NO SUPPORT FOR PROPRIETARY COMPILERS. Previous versions of the WFDB -# software package have been compiled successfully by other users using various -# proprietary compilers including those mentioned below. You may find this -# file helpful if you wish to use one of these compilers, but no support can be -# provided in this case. If you cannot successfully compile this software -# using a proprietary compiler, please try using Cygwin/gcc or MinGW/gcc under -# MS-Windows, or DJGPP under MS-DOS (free from http://www.cygwin.com/, -# http://www.mingw.org/, or http://www.delorie.com/ respectively). -# -# Before using this file, define these variables as appropriate for your -# installation: -# -# CC The name of the command-line C compiler. -# CDFLAGS Optional arguments to be supplied to CC to produce object files -# with debugging symbols. -# COFLAGS Optional arguments to be supplied to CC to produce optimized -# object files (or normal object files if no optimization is -# available). - -# Commands needed to compile the PSD estimation programs are given below for -# several versions of `make'. -# -# Borland (Turbo) `make': -# make install -# Microsoft `make' (supplied with Microsoft C before version 6.0): -# make makefile -# Microsoft `nmake' (supplied with Microsoft C 6.0 and later versions): -# nmake install - -# Most versions of `make' allow you to override the settings of make variables -# from the command line, so that it may not be necessary to edit this file to -# test the effects of small modifications to it. - -# For optimized code, uncomment the next line. -CFLAGS = $(COFLAGS) -# Otherwise, if you modify the sources and need to debug them, uncomment the -# next line. -# CFLAGS = $(CDFLAGS) - -# Except as noted at the end of this file, it should not be necessary to modify -# anything below this line. -# ----------------------------------------------------------------------------- - -XFILES = coherence.exe fft.exe log10.exe lomb.exe memse.exe - -# General rule for compiling C sources into executable files -.c.exe: - $(CC) $(CFLAGS) $*.c - -clean: - del *.obj - del *.exe - -install: $(XFILES) diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/psd/memse.c wfdb-10.3.16/psd/memse.c --- wfdb-10.3.15/psd/memse.c 2003-06-16 15:02:33.000000000 -0400 +++ wfdb-10.3.16/psd/memse.c 2005-06-10 09:52:39.000000000 -0400 @@ -1,9 +1,9 @@ /* file: memse.c G. Moody 6 February 1992 - Last revised: 16 June 2003 + Last revised: 10 June 2005 ------------------------------------------------------------------------------- memse: Estimate power spectrum using maximum entropy (all poles) method -Copyright (C) 2003 George B. Moody +Copyright (C) 1992-2005 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 @@ -23,11 +23,11 @@ please visit PhysioNet (http://www.physionet.org/). _______________________________________________________________________________ -This program has been written to behave as much like `fft' as possible. The +This program has been written to behave as much like 'fft' as possible. The input and output formats and many of the options are the same. See the man page (memse.1) for details. -This version agrees with `fft' output (amplitude spectrum with total power +This version agrees with 'fft' output (amplitude spectrum with total power equal to the variance); thanks to Joe Mietus. */ @@ -39,6 +39,13 @@ #include #endif +#ifndef BSD +# include +#else /* for Berkeley UNIX only */ +# include +# define strchr index +#endif + #define PI M_PI /* pi to machine precision, defined in math.h */ #ifdef i386 diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/psd/README wfdb-10.3.16/psd/README --- wfdb-10.3.15/psd/README 2003-06-16 16:11:39.000000000 -0400 +++ wfdb-10.3.16/psd/README 2005-06-08 17:26:56.000000000 -0400 @@ -1,8 +1,9 @@ file: README G. Moody 14 June 1995 + Last revised: 8 June 2005 ------------------------------------------------------------------------------- Power spectral density estimation and related applications -Copyright (C) 1999 George B. Moody +Copyright (C) 1995-2005 George B. Moody These programs are free software; you can redistribute them and/or modify them under the terms of the GNU General Public License as published by the @@ -45,8 +46,6 @@ Makefile `make' description file for compiling these applications using ANSI/ISO standard C compilers on supported platforms -Makefile.dos `make' description file for compiling these applications using - unsupported compilers from Borland, Microsoft, etc. Makefile.top Used by ../configure to construct Makefile (comments only) Makefile.tpl Used by ../configure to construct Makefile (portable section) README this file diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/README.NETFILES wfdb-10.3.16/README.NETFILES --- wfdb-10.3.15/README.NETFILES 2003-03-30 14:25:30.000000000 -0500 +++ wfdb-10.3.16/README.NETFILES 2005-06-01 14:23:48.000000000 -0400 @@ -1,15 +1,14 @@ file: README.NETFILES G. Moody 14 September 1999 - Last revised: 21 June 2002 + Last revised: 27 May 2005 -This version of the WFDB software package contains NETFILES support in the -WFDB library, which is compiled if you have previously installed libwww -(see http://www.w3.org/Library/). +WFDB software reads its input from files that can be located on local +disks or (if NETFILES support is present) on remote web and FTP servers. -NETFILES support is known to work well under Linux, Solaris, and MS-Windows. -When compiling the WFDB library as a static library with NETFILES support, it -is necessary to allow ld to make three passes over the libwww libraries to -resolve all dependencies; this is handled automatically by the version of -lib/Makefile that is generated by `configure'. +This version of the WFDB software package contains NETFILES support in the +WFDB library, which is compiled if you have previously installed libcurl +(see http://curl.haxx.se/) or libwww (see http://www.w3.org/Library/). +NETFILES support is known to work well under FreeBSD, GNU/Linux, Mac OS X, +MS-Windows, and Solaris. To use NETFILES once this software has been compiled and installed, the WFDB path should contain one or more components that refer to remote files available @@ -39,23 +38,40 @@ of additional path information are necessary) -If you would like to experiment with NETFILES under Linux or Solaris, install -the libwww and xview packages (available from PhysioNet), then compile and -install WAVE and wavescript (in the waverc directory). This is done by default -if you build the package using './configure' followed by 'make' in the -top-level directory of the source tree. Follow the instructions given in the -'WAVE and the Web' section of the WAVE User's Guide (in 'wave-doc'; also -available on PhysioNet at http://www.physionet.org/physiotools/wug/) to install -wavescript as a helper application for your web browser. You should now be -able to follow the .xws links in the on-line version of the MIT-BIH Arrhythmia -Database Directory -(http://www.physionet.org/physiobank/database/html/mitdbdir/mitdbdir.htm) and -in the HTML files included in the MIMIC Database records available on -PhysioNet. (Once you have installed the software and configured your browser, -following these links causes your browser to display the specified signals and -annotations in a WAVE window; you do not need to set the WFDB path in any -special way in this case, since wavescript will do this automatically based on -information it receives from your browser.) +If you have built the WFDB library using libcurl, version 7.12.0 or later, +then WFDB applications can also read password-protected files. The simplest +way to use this feature is to create a text file named .netrc containing +entries such as + + machine www.physionet.org + login testuser + password PhysioNet + +If your .netrc contains the three lines as shown above, and your WFDB library +was compiled with libcurl 7.12.0 or later, you can test this feature with a +command such as: + + rdann -r access-demo/100s -a atr + +which will read 'atr' annotations from a password-protected copy of the +sample record (100s) on the master PhysioNet server. Your browser can read the +same files at http://physionet.org/physiobank/database/access-demo/ (enter +"testuser" and "PhysioNet" respectively when prompted for a user name and +a password). This demo uses digest authentication (the password is transmitted +in encrypted form, and compared against an encrypted copy on the server), but +basic authentication (in which the password is transmitted in cleartext) is +also supported. Note, however that the data retrieved from the server travel +across the net in cleartext. If you wish to provide restricted access to +protected health information on your server to WFDB applications, we recommend +seting up SSL on your server, and using the SSL-enabled version of libcurl; +using SSL, the data travel in encrypted form across the net. NETFILES support was originally implemented by Michael Dakin as part of his -summer 1999 UROP project at MIT. Thanks, Mike! +summer 1999 UROP project at MIT. Mike used the W3C's libwww in his original +implementation. The libwww maintainers last updated the library in June, 2002, +and in January, 2004, the W3C formally announced that it would not continue +development of libwww, although the library remains freely available. In May, +2005, Benjamin Moody reimplemented NETFILES using libcurl. The primary +advantages of libcurl over libwww are that libcurl is smaller and faster, it +supports access to password-protected files, and it is actively maintained. +Both libraries are freely available on all popular platforms. diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/README.WINDOWS wfdb-10.3.16/README.WINDOWS --- wfdb-10.3.15/README.WINDOWS 1969-12-31 19:00:00.000000000 -0500 +++ wfdb-10.3.16/README.WINDOWS 2005-06-08 14:51:19.000000000 -0400 @@ -0,0 +1,92 @@ +file: README.WINDOWS G. Moody 8 June 2005 + +This file contains additional notes about how to build the WFDB Software +Package under MS-Windows in various non-standard and unsupported ways. +We strongly recommend that all users follow the procedure described in +'INSTALL' in order to build a complete and compatible set of WFDB Software, +including WAVE, which is possible to build under MS-Windows only in this +way. + +There are two specific cases in which you might need another version of the +WFDB library binary under MS-Windows: + + * if you need to use the WFDB_tools wrappers with Matlab R14 (but not R13) + + * if you wish to link the WFDB library to other code that must also be linked + with Windows native libraries. + +In these cases, either of the two methods outlined below will allow you to +create a Windows native version of the WFDB library that does not depend on +Cygwin's POSIX emulation library. These methods also create a mostly complete +set of WFDB applications (except for WAVE) that are used to test the WFDB +library; use them at your own risk, since they may not behave in exactly the +same way as the standard versions of the same applications. + +Please note that these methods, and any others that do not use an ANSI/ISO +C compiler such as gcc, are UNSUPPORTED. Your feedback is welcome, but we +do not use any commercial compilers and cannot help you learn how to use them. + +............................................................................... + +Creating MinGW (Windows native) binaries + +The "Minimalist GNU for Windows" project (MinGW, http://www.mingw.org/) is "a +collection of freely available and freely distributable Windows specific header +files and import libraries combined with GNU toolsets that allow one to produce +native Windows programs that do not rely on any 3rd-party C runtime DLLs." You +can build the WFDB software with the MinGW gcc provided by Cygwin, or with the +minimal MSYS environment. + +Method A: (easy) + + 1. First perform a standard WFDB installation from sources using Cygwin, + following the instructions in 'INSTALL'. + + 2. Select a location to install the MingGW WFDB binaries. We recommend + keeping them separate from the standard Cygwin paths to avoid confusion. + A good choice is '/opt/wfdb'. + + 3. Install libcurl and its associated SDK within the directory you chose in + step 2 (e.g. /opt/wfdb). Set your PATH variable to include the 'bin' + directory in your install path by typing (in a Cygwin terminal window): + export PATH="/opt/wfdb/bin:$PATH" + replacing '/opt/wfdb' with your install path, if different. See + README.NETFILES for further information. + + 4. In this directory (the top-level directory of the WFDB Software Package, + containing the file you are now reading), type: + ./configure --no-cygwin --prefix=/opt/wfdb + make install + replacing '/opt/wfdb' with your install path, if different ('make install' + will create this directory if it does not exist). + + 5. In this directory, test the installation by typing: + make check + If there are any errors, look in the checkpkg directory for details. + + +Method B: (experts only) + + 1. If you have not already done so, install the MinGW compiler and the MSYS + shell environment (freely available from http://www.mingw.org/). These + include MinGW/gcc and an assortment of other GNU utilities ported + to MS-Windows. Accept the defaults suggested by the installer. + + 2. Open a MSYS terminal window (the MSYS installer will have added this to + your MS-Windows start menu). Check that 'which' and 'gcc' are accessible + by typing the command: + which gcc + The output of this command should be: + /mingw/bin/gcc + If you don't see this output, rerun the MinGW and MSYS installers. + + 3. Install libcurl and its associated SDK (see above). + + 4. In this directory (the top-level directory of the WFDB software package, + containing the file you are now reading), type: + ./configure + make install + + 5. In this directory, test the installation by typing: + make check + If there are any errors, look in the checkpkg directory for details. diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wave/annot.c wfdb-10.3.16/wave/annot.c --- wfdb-10.3.15/wave/annot.c 2004-03-05 10:57:31.000000000 -0500 +++ wfdb-10.3.16/wave/annot.c 2005-06-10 10:33:55.000000000 -0400 @@ -1,10 +1,10 @@ /* file: annot.c G. Moody 1 May 1990 - Last revised: 5 March 2004 + Last revised: 10 June 2005 Annotation list handling and display functions for WAVE ------------------------------------------------------------------------------- WAVE: Waveform analyzer, viewer, and editor -Copyright (C) 1990-2004 George B. Moody +Copyright (C) 1990-2005 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 @@ -388,7 +388,7 @@ int yy = y + annp->this.num*vscalea; if (xs >= 0) - XDrawLine(display, xid, draw_ann, xs, ys, x, yy); + XDrawLine(display, osb, draw_ann, xs, ys, x, yy); xs = x; ys = yy; } @@ -420,31 +420,31 @@ while (n > 3 && XTextWidth(font, p, n) > maxwidth) n--; } - XDrawString(display, xid, + XDrawString(display, osb, annp->this.anntyp == LINK ? draw_sig : draw_ann, x, y, p, n); if (annp->this.anntyp == LINK) { int xx = x + XTextWidth(font, p, n), yy = y + linesp/4; - XDrawLine(display, xid, draw_sig, x, yy, xx, yy); + XDrawLine(display, osb, draw_sig, x, yy, xx, yy); } if (show_subtype) { sprintf(buf, "%d", annp->this.subtyp); p = buf; y += linesp; - XDrawString(display, xid, draw_ann, x, y, p, strlen(p)); + XDrawString(display, osb, draw_ann, x, y, p, strlen(p)); } if (show_chan) { sprintf(buf, "%d", annp->this.chan); p = buf; y += linesp; - XDrawString(display, xid, draw_ann, x, y, p, strlen(p)); + XDrawString(display, osb, draw_ann, x, y, p, strlen(p)); } if (show_num) { sprintf(buf, "%d", annp->this.num); p = buf; y += linesp; - XDrawString(display, xid, draw_ann, x, y, p, strlen(p)); + XDrawString(display, osb, draw_ann, x, y, p, strlen(p)); } if (show_aux && annp->this.aux != NULL) { p = annp->this.aux + 1; y += linesp; - XDrawString(display, xid, draw_ann, x, y, p, strlen(p)); + XDrawString(display, osb, draw_ann, x, y, p, strlen(p)); } } if (show_marker && annp->this.anntyp != NOTQRS) { @@ -484,23 +484,24 @@ } marker[0].y2 = ytop - linesp; marker[1].y1 = y + mmy(2); - XDrawSegments(display, xid, draw_ann, marker, 2); + XDrawSegments(display, osb, draw_ann, marker, 2); } if (annp->next == NULL) break; annp = annp->next; + } } void clear_annotation_display() { if (ann_mode == 1 || (use_overlays && show_marker)) { - XFillRectangle(display, xid, clear_ann, + XFillRectangle(display, osb, clear_ann, 0, 0, canvas_width+mmx(10), canvas_height); if (!use_overlays) do_disp(); } else - XFillRectangle(display, xid, clear_ann, + XFillRectangle(display, osb, clear_ann, 0, abase-mmy(8), canvas_width+mmx(10), mmy(13)); } diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wave/edit.c wfdb-10.3.16/wave/edit.c --- wfdb-10.3.15/wave/edit.c 2003-07-24 03:16:45.000000000 -0400 +++ wfdb-10.3.16/wave/edit.c 2005-06-10 10:34:01.000000000 -0400 @@ -1,10 +1,10 @@ /* file: edit.c G. Moody 1 May 1990 - Last revised: 24 July 2003 + Last revised: 10 June 2005 Annotation-editing functions for WAVE ------------------------------------------------------------------------------- WAVE: Waveform analyzer, viewer, and editor -Copyright (C) 2003 George B. Moody +Copyright (C) 1990-2005 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 @@ -232,17 +232,17 @@ /* Erase any other bar and levels. */ if (bar_on) { - XDrawSegments(display, xid, clear_crs, bar, 2); + XDrawSegments(display, osb, clear_crs, bar, 2); bar_on = 0; } if (level_on) { - XDrawSegments(display, xid, clear_crs, level, level_on); + XDrawSegments(display, osb, clear_crs, level, level_on); level_on = 0; } if (do_bar && 0 <= x && x < canvas_width) { bar[0].x1 = bar[0].x2 = bar[1].x1 = bar[1].x2 = bar_x = x; bar[0].y1 = 0; bar[0].y2 = ya; bar[1].y1 = yb; bar[1].y2=canvas_height; - XDrawSegments(display, xid, draw_crs, bar, 2); + XDrawSegments(display, osb, draw_crs, bar, 2); bar_on = 1; bar_y = y; if (show_level) { @@ -256,7 +256,7 @@ level_on++; } if (level_on) { - XDrawSegments(display, xid, draw_crs, level, level_on); + XDrawSegments(display, osb, draw_crs, level, level_on); level_time = display_start_time + x/tscale; show_level_popup(TRUE); } @@ -273,7 +273,7 @@ /* Clear any other box. */ if (box_on) { - XDrawLines(display, xid, clear_crs, box, 5, CoordModeOrigin); + XDrawLines(display, osb, clear_crs, box, 5, CoordModeOrigin); box_on = 0; } if (do_box && 0 <= x && x < canvas_width) { @@ -282,7 +282,7 @@ box[2].x = box[3].x = box_right = x + mmx(2.5); box[0].y = box[3].y = box[4].y = box_bottom = y - mmy(7.5); box[1].y = box[2].y = box_top = y + mmy(4.5); - XDrawLines(display, xid, draw_crs, box, 5, CoordModeOrigin); + XDrawLines(display, osb, draw_crs, box, 5, CoordModeOrigin); box_on = 1; } } @@ -956,7 +956,7 @@ if (annp->this.time < display_start_time) { struct ap *a = annp; - XFillRectangle(display, xid, clear_all, + XFillRectangle(display, osb, clear_all, 0, 0, canvas_width+mmx(10), canvas_height); if ((tt = annp->this.time - (long)((nsamp-freq)/2)) < 0L) display_start_time = 0L; @@ -1189,7 +1189,7 @@ if (annp->this.time >= display_start_time + nsamp) { struct ap *a = annp; - XFillRectangle(display, xid, clear_all, + XFillRectangle(display, osb, clear_all, 0, 0, canvas_width+mmx(10), canvas_height); tt = annp->this.time - (long)((nsamp-freq)/2); display_start_time = strtim(timstr(tt)); @@ -1333,4 +1333,5 @@ #endif break; } + XClearWindow(display, xid); } diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wave/grid.c wfdb-10.3.16/wave/grid.c --- wfdb-10.3.15/wave/grid.c 2000-01-30 04:13:21.000000000 -0500 +++ wfdb-10.3.16/wave/grid.c 2005-06-10 10:32:53.000000000 -0400 @@ -1,10 +1,10 @@ /* file: grid.c G. Moody 1 May 1990 - Last revised: 29 April 1999 + Last revised: 10 June 2005 Grid drawing functions for WAVE ------------------------------------------------------------------------------- WAVE: Waveform analyzer, viewer, and editor -Copyright (C) 1999 George B. Moody +Copyright (C) 1990-2005 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 @@ -76,20 +76,20 @@ map. */ if (!grid_plotted || ghflag != oghf || gvflag != ogvf || (ghflag && dy != ody) || (gvflag && dx != odx) || !use_overlays) { - XFillRectangle(display, xid, clear_grd, + XFillRectangle(display, osb, clear_grd, 0, 0, canvas_width,canvas_height); /* If horizontal grid lines are enabled, draw them. */ if (ghflag) for (i = y = 0; y < canvas_height + dy; i++, y = i*dy) { if (0 < y && y < canvas_height) - XDrawLine(display, xid, + XDrawLine(display, osb, (ghflag > 1) ? draw_cgrd : draw_grd, 0, y, canvas_width, y); if (ghflag > 1) /* Draw fine horizontal grid lines. */ for (ii = 1; ii < 5; ii++) { yy = y + ii*dyfine; - XDrawLine(display, xid, draw_grd, + XDrawLine(display, osb, draw_grd, 0, yy, canvas_width, yy); } } @@ -98,13 +98,13 @@ if (gvflag) for (i = x = 0; x < canvas_width + dx; i++, x = i*dx) { if (0 < x && x < canvas_width) - XDrawLine(display, xid, + XDrawLine(display, osb, (gvflag > 1) ? draw_cgrd : draw_grd, x, 0, x, canvas_height); if (gvflag > 1) /* Draw fine vertical grid lines. */ for (ii = 1; ii < 5; ii++) { xx = x + ii*dxfine; - XDrawLine(display, xid, draw_grd, + XDrawLine(display, osb, draw_grd, xx, 0, xx, canvas_height); } } diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wave/mainpan.c wfdb-10.3.16/wave/mainpan.c --- wfdb-10.3.15/wave/mainpan.c 2002-12-18 14:21:37.000000000 -0500 +++ wfdb-10.3.16/wave/mainpan.c 2005-06-10 10:32:11.000000000 -0400 @@ -1,10 +1,10 @@ /* file: mainpan.c G. Moody 30 April 1990 - Last revised: 18 December 2002 + Last revised: 10 June 2005 Functions for the main control panel of WAVE ------------------------------------------------------------------------------- WAVE: Waveform analyzer, viewer, and editor -Copyright (C) 2002 George B. Moody +Copyright (C) 1990-2005 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 @@ -868,7 +868,7 @@ area, and we want to be sure to erase it if this has happened. */ bar(0,0,0); box(0,0,0); - XFillRectangle(display, xid, clear_all, + XFillRectangle(display, osb, clear_all, 0, 0, canvas_width+mmx(10), canvas_height); /* Reset the pointer for the scope display unless the scope is running or diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wave/Makefile.tpl wfdb-10.3.16/wave/Makefile.tpl --- wfdb-10.3.15/wave/Makefile.tpl 2003-02-23 22:58:25.000000000 -0500 +++ wfdb-10.3.16/wave/Makefile.tpl 2005-05-31 13:03:26.000000000 -0400 @@ -1,5 +1,5 @@ # file: Makefile.tpl G. Moody 31 May 2000 -# Last revised: 23 February 2003 +# Last revised: 31 May 2005 # Change the settings below as appropriate for your setup. # Choose directories in which to install WAVE and its ancillary files by @@ -63,7 +63,7 @@ ../uninstall.sh $(LIBDIR) wave: $(OFILES) - $(CC) -o wave $(OFILES) $(WLDFLAGS) + $(CC) $(WCFLAGS) -o wave $(OFILES) $(WLDFLAGS) # `make help': show help text help: @@ -85,10 +85,10 @@ @echo "*************************************************************" wave-static: $(OFILES) - $(CC) -o wave-static $(OFILES) -static $(LDFLAGS) + $(CC) $(WCFLAGS) -o wave-static $(OFILES) -static $(LDFLAGS) soelim: soelim.c - $(CC) -o soelim -O soelim.c + $(CC) $(CFLAGS) -o soelim -O soelim.c wave.hlp: soelim wave.hl0 $(HELPFILES) ./soelim wave.hl0 >wave.hlp diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wave/README wfdb-10.3.16/wave/README --- wfdb-10.3.15/wave/README 2001-11-26 17:58:40.000000000 -0500 +++ wfdb-10.3.16/wave/README 2005-06-08 17:38:34.000000000 -0400 @@ -1,9 +1,9 @@ file: README G. Moody 2 July 1991 - Last revised: 26 November 2001 + Last revised: 8 June 2005 ------------------------------------------------------------------------------- WAVE: Waveform analyzer, viewer, and editor -Copyright (C) 2001 George B. Moody +Copyright (C) 1991-2005 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 @@ -33,6 +33,12 @@ or see `wave.1' in '../doc'. Read `Makefile' in this directory for information about compiling and installing `wave'. +WAVE was originally developed under SunOS; since 1994, its development has +been continued under GNU/Linux. WAVE currently runs on FreeBSD, Mac OS X, +MS-Windows (with Cygwin), and Solaris, in addition to GNU/Linux. It has +proven very easy to port (typically just a recompile is required) to any +platform for which the XView toolkit is available. + The following files will be found in this directory: Makefile UNIX `make' description file for compiling WAVE diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wave/scope.c wfdb-10.3.16/wave/scope.c --- wfdb-10.3.15/wave/scope.c 2001-10-14 14:35:35.000000000 -0400 +++ wfdb-10.3.16/wave/scope.c 2005-06-10 06:28:30.000000000 -0400 @@ -1,10 +1,10 @@ /* file: scope.c G. Moody 31 July 1991 - Last revised: 14 October 2001 + Last revised: 10 June 2005 Scope window functions for WAVE ------------------------------------------------------------------------------- WAVE: Waveform analyzer, viewer, and editor -Copyright (C) 2001 George B. Moody +Copyright (C) 1991-2005 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 @@ -40,13 +40,14 @@ #define SQRTMAXSPEED (30) #define MAXSPEED (SQRTMAXSPEED*SQRTMAXSPEED) -static int use_overlays, use_color, grey; +static int scope_use_overlays, use_color, grey; static void scan(), create_scope_panel(), set_dt(); +static void scope_proc(Panel_item item, Event *event); void save_scope_params(a, b, c) int a, b, c; { - use_overlays = a; + scope_use_overlays = a; use_color = b; grey = c; } @@ -132,7 +133,7 @@ } if (scope_xid) { - if (use_overlays) { + if (scope_use_overlays) { static XPoint tbuf[2]; tbuf[0].y = 0; tbuf[1].y = scope_height-1; @@ -156,7 +157,6 @@ { int e, x, y; static int handling_event; - static void scope_proc(); e = (int)event_id(event); x = (int)event_x(event); @@ -210,12 +210,12 @@ extern Server_image cursor_image; #endif -void create_scope_popup(use_overlays, use_color, grey) -int use_overlays, use_color, grey; +void create_scope_popup(overlay_flag, use_color, grey) +int overlay_flag, use_color, grey; { char *bgcname, *fgcname; int i, ncolors; - static long mask[4]; + static unsigned long mask[4]; static XGCValues gcvalues; Icon icon; Xv_Cursor scope_c; @@ -244,7 +244,7 @@ CANVAS_AUTO_CLEAR, TRUE, WIN_X, 0, WIN_BELOW, scope_panel, - WIN_DYNAMIC_VISUAL, use_overlays, + WIN_DYNAMIC_VISUAL, overlay_flag, 0); scope_resize(canvas, (int)xv_get(canvas, CANVAS_WIDTH), @@ -317,11 +317,11 @@ require 16 GCs, however, which might pose a problem for the server. */ - if (use_overlays) { + if (overlay_flag) { /* Try to get read/write color cells if possible. */ if (!XAllocColorCells(scope_display, colormap, 0, mask, 4, pixel_table, 1)) - use_overlays = 0; /* impossible -- use plan B */ + overlay_flag = 0; /* impossible -- use plan B */ else { /* execute plan A */ /* Color 0: background */ @@ -386,7 +386,7 @@ } } - if (!use_overlays) { /* execute plan B */ + if (!overlay_flag) { /* execute plan B */ int j; unsigned int stipple_height, stipple_width; GC set_stipple, clear_stipple; @@ -483,7 +483,7 @@ int i, i0, tt, tt0 = 0, v0; long t; - if (first_frame && use_overlays) { + if (first_frame && scope_use_overlays) { first_frame = 0; scope_resize(canvas, (int)xv_get(canvas, CANVAS_WIDTH), (int)xv_get(canvas, CANVAS_HEIGHT)); @@ -675,9 +675,7 @@ } } -static void scope_proc(item, event) -Panel_item item; -Event *event; +static void scope_proc(Panel_item item, Event *event) { int client_data; long t0; @@ -877,7 +875,7 @@ void show_scope_window() { if (scope_popup_active < 0) - create_scope_popup(use_overlays, use_color, grey); + create_scope_popup(scope_use_overlays, use_color, grey); wmgr_top(scope_frame); xv_set(scope_frame, WIN_MAP, TRUE, 0); scope_popup_active = 1; diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wave/sig.c wfdb-10.3.16/wave/sig.c --- wfdb-10.3.15/wave/sig.c 2003-02-13 10:47:54.000000000 -0500 +++ wfdb-10.3.16/wave/sig.c 2005-06-10 10:31:41.000000000 -0400 @@ -1,10 +1,10 @@ /* file: sig.c G. Moody 27 April 1990 - Last revised: 13 February 2003 + Last revised: 10 June 2005 Signal display functions for WAVE ------------------------------------------------------------------------------- WAVE: Waveform analyzer, viewer, and editor -Copyright (C) 2003 George B. Moody +Copyright (C) 1990-2005 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 @@ -57,7 +57,7 @@ for (i = 0; i < nsig; i++) { if (lp->vlist[i]) { lp->vlist[i][0].y += base[i]; - XDrawLines(display, xid, draw_sig, lp->vlist[i], lp->ndpts, + XDrawLines(display, osb, draw_sig, lp->vlist[i], lp->ndpts, CoordModePrevious); lp->vlist[i][0].y -= base[i]; } @@ -66,7 +66,7 @@ for (i = 0; i < siglistlen; i++) { if (0 <= siglist[i] && siglist[i] < nsig && lp->vlist[siglist[i]]){ lp->vlist[siglist[i]][0].y += base[i]; - XDrawLines(display, xid, draw_sig, lp->vlist[siglist[i]], + XDrawLines(display, osb, draw_sig, lp->vlist[siglist[i]], lp->ndpts, CoordModePrevious); lp->vlist[siglist[i]][0].y -= base[i]; } @@ -81,10 +81,10 @@ if (0 <= highlighted && highlighted < lp_current->nsig) { if (sig_mode == 0) { lp_current->vlist[highlighted][0].y += base[highlighted]; - XDrawLines(display, xid, unhighlight_sig, + XDrawLines(display, osb, unhighlight_sig, lp_current->vlist[highlighted], lp_current->ndpts, CoordModePrevious); - XDrawLines(display, xid, draw_sig, + XDrawLines(display, osb, draw_sig, lp_current->vlist[highlighted], lp_current->ndpts, CoordModePrevious); lp_current->vlist[highlighted][0].y -= base[highlighted]; @@ -94,10 +94,10 @@ for (j = 0; j < siglistlen; j++) { if (siglist[j] == highlighted) { lp_current->vlist[highlighted][0].y += base[j]; - XDrawLines(display, xid, unhighlight_sig, + XDrawLines(display, osb, unhighlight_sig, lp_current->vlist[highlighted], lp_current->ndpts, CoordModePrevious); - XDrawLines(display, xid, draw_sig, + XDrawLines(display, osb, draw_sig, lp_current->vlist[highlighted], lp_current->ndpts, CoordModePrevious); lp_current->vlist[highlighted][0].y -= base[j]; @@ -109,10 +109,10 @@ if (0 <= highlighted && highlighted < lp_current->nsig) { if (sig_mode == 0) { lp_current->vlist[highlighted][0].y += base[highlighted]; - XDrawLines(display, xid, clear_sig, + XDrawLines(display, osb, clear_sig, lp_current->vlist[highlighted], lp_current->ndpts, CoordModePrevious); - XDrawLines(display, xid, highlight_sig, + XDrawLines(display, osb, highlight_sig, lp_current->vlist[highlighted], lp_current->ndpts, CoordModePrevious); lp_current->vlist[highlighted][0].y -= base[highlighted]; @@ -122,10 +122,10 @@ for (j = 0; j < siglistlen; j++) { if (siglist[j] == highlighted) { lp_current->vlist[highlighted][0].y += base[j]; - XDrawLines(display, xid, clear_sig, + XDrawLines(display, osb, clear_sig, lp_current->vlist[highlighted], lp_current->ndpts, CoordModePrevious); - XDrawLines(display, xid, highlight_sig, + XDrawLines(display, osb, highlight_sig, lp_current->vlist[highlighted], lp_current->ndpts, CoordModePrevious); lp_current->vlist[highlighted][0].y -= base[j]; @@ -159,13 +159,13 @@ while (*tp == ' ') tp++; y0 = canvas_height - mmy(2); x0 = mmx(2); - XDrawString(display, xid, time_mode == 1 ? draw_ann : draw_sig, + XDrawString(display, osb, time_mode == 1 ? draw_ann : draw_sig, x0, y0, tp, strlen(tp)); tp = wtimstr(display_start_time + nsamp); set_end_time(tp); while (*tp == ' ') tp++; x1 = canvas_width - XTextWidth(font, tp, strlen(tp)) - mmx(2); - XDrawString(display, xid, time_mode == 1 ? draw_ann : draw_sig, + XDrawString(display, osb, time_mode == 1 ? draw_ann : draw_sig, x1, y0, tp, strlen(tp)); /* Show the annotations, if available. */ @@ -182,6 +182,7 @@ if (show_baseline) show_signal_baselines(lp); xv_set(frame, FRAME_BUSY, FALSE, NULL); + XClearWindow(display, xid); } static int nlists; @@ -441,12 +442,12 @@ yoff = (nsig > 1) ? (base[1] - base[0])/3 : canvas_height/3; if (sig_mode == 0) for (i = 0; i < nsig; i++) - XDrawString(display, xid, draw_sig, xoff, base[i] - yoff, + XDrawString(display, osb, draw_sig, xoff, base[i] - yoff, signame[i], strlen(signame[i])); else for (i = 0; i < siglistlen; i++) if (0 <= siglist[i] && siglist[i] < nsig) - XDrawString(display, xid, draw_sig, xoff, base[i] - yoff, + XDrawString(display, osb, draw_sig, xoff, base[i] - yoff, signame[siglist[i]], strlen(signame[siglist[i]])); } @@ -458,12 +459,12 @@ yoff = mmy(2); for (i = 0; i < nsig; i++) { if (dc_coupled[i] && 0 <= lp->sb[i] && lp->sb[i] < canvas_height) { - XDrawLine(display, xid, draw_ann, + XDrawLine(display, osb, draw_ann, 0, lp->sb[i]+base[i], canvas_width, lp->sb[i]+base[i]); if (blabel[i]) { l = strlen(blabel[i]); xoff = canvas_width - XTextWidth(font, blabel[i], l) - mmx(2); - XDrawString(display, xid, draw_sig, + XDrawString(display, osb, draw_sig, xoff, lp->sb[i]+base[i] - yoff, blabel[i], l); } } diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wave/wave.c wfdb-10.3.16/wave/wave.c --- wfdb-10.3.15/wave/wave.c 2002-11-14 19:12:53.000000000 -0500 +++ wfdb-10.3.16/wave/wave.c 2005-06-10 10:30:40.000000000 -0400 @@ -1,10 +1,10 @@ -/* file: wave.c G. Moody 27 April 1990 - Last revised: 14 November 2002 +/* file: wave.c G. Moody 27 April 1990 + Last revised: 10 June 2005 main() function for WAVE ------------------------------------------------------------------------------- WAVE: Waveform analyzer, viewer, and editor -Copyright (C) 2002 George B. Moody +Copyright (C) 1990-2005 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 @@ -386,6 +386,10 @@ if (do_demo) start_demo(); + /* Do initial display */ + XFillRectangle(display, osb, clear_all, 0, 0, canvas_width+mmx(10), canvas_height); + do_disp(); + /* Enter the main loop. */ display_and_process_events(); diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wave/xvwave.c wfdb-10.3.16/wave/xvwave.c --- wfdb-10.3.15/wave/xvwave.c 2002-12-04 13:56:18.000000000 -0500 +++ wfdb-10.3.16/wave/xvwave.c 2005-06-10 10:27:55.000000000 -0400 @@ -1,10 +1,10 @@ -/* file: xvwave.c G. Moody 27 April 1990 - Last revised: 4 December 2002 +/* file: xvwave.c G. Moody 27 April 1990 + Last revised: 10 June 2005 XView support functions for WAVE ------------------------------------------------------------------------------- WAVE: Waveform analyzer, viewer, and editor -Copyright (C) 2002 George B. Moody +Copyright (C) 1990-2005 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 @@ -67,7 +67,7 @@ if (!in_xv_main_loop) return; if (restore_all) { restore_all = 0; - XFillRectangle(display, xid, bg_fill, + XFillRectangle(display, osb, bg_fill, 0, 0, canvas_width, canvas_height); } restore_grid(); @@ -81,7 +81,7 @@ int height; { int canvas_width_mm, u; - + Pixmap old_osb; /* The manipulations below are intended to select a canvas width that will allow a (reasonably) standard time interval to be displayed. If the canvas is at least 125 mm wide, its width is truncated to @@ -98,17 +98,21 @@ canvas_width_sec = u * 0.2; } canvas_width = mmx(canvas_width_mm); - if (width != canvas_width) { - if (clear_all) XFillRectangle(display, xid, clear_all, canvas_width, 0, - width - canvas_width, height); - xv_set(canvas, CANVAS_WIDTH, canvas_width, NULL); - } /* Similar code might be used to readjust the canvas height, but doing so seems unnecessary. */ canvas_height = height; canvas_height_mv = canvas_height / dmmy(10); - + + /* get a new off screen buffer */ + old_osb = osb; + osb = XCreatePixmap(display, xid, width, canvas_height, + DefaultDepth(display, DefaultScreen(display))); + XFillRectangle(display, osb, bg_fill, + 0, 0, width, canvas_height); + XSetWindowBackgroundPixmap(display, xid, osb); + if (old_osb) XFreePixmap(display, old_osb); + /* Recalibrate based on selected scales, clear the display list cache. */ if (*record) { set_baselines(); @@ -129,7 +133,11 @@ int width; int height; { - if (in_xv_main_loop) do_resize(canvas, width, height); + XEvent next_event; + if (in_xv_main_loop) { + XPeekEvent((Display *)xv_get(canvas, XV_DISPLAY), &next_event); + if (next_event.type != ConfigureNotify ) do_resize(canvas, width, height); + } } /* This function handles interpretation of XView options and initialization of @@ -489,7 +497,7 @@ int use_color = 0; /* if non-zero, there are >=4 colors */ int grey = 0; /* if non-zero, use grey shades only */ int ncolors; - static long mask[4]; + static unsigned long mask[4]; Canvas canvas; Icon icon; Panel main_panel; diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wave/xvwave.h wfdb-10.3.16/wave/xvwave.h --- wfdb-10.3.15/wave/xvwave.h 2001-10-13 15:54:01.000000000 -0400 +++ wfdb-10.3.16/wave/xvwave.h 2005-06-10 10:28:57.000000000 -0400 @@ -1,10 +1,10 @@ /* file: xvwave.h G. Moody 27 April 1990 - Last revised: 13 October 2001 + Last revised: 10 June 2005 XView constants, macros, function prototypes, and global variables for WAVE ------------------------------------------------------------------------------- WAVE: Waveform analyzer, viewer, and editor -Copyright (C) 2001 George B. Moody +Copyright (C) 1990-2005 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 @@ -77,6 +77,7 @@ COMMON Frame frame; /* base frame object */ COMMON Display *display;/* X server connection */ COMMON Server_image icon_image; /* Icon bitmap for base and other frames */ +COMMON Pixmap osb; /* the offscreen buffer for the canvas */ COMMON XID xid; /* Xlib "drawable" id for signal window */ COMMON XFontStruct *font; /* Font used for text in signal window */ diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/waverc/wave-remote.c wfdb-10.3.16/waverc/wave-remote.c --- wfdb-10.3.15/waverc/wave-remote.c 2002-06-19 13:54:27.000000000 -0400 +++ wfdb-10.3.16/waverc/wave-remote.c 2005-06-10 09:49:00.000000000 -0400 @@ -1,10 +1,10 @@ /* file: wave-remote.c G. Moody 10 October 1996 - Last revised: 19 June 2002 + Last revised: 10 June 2005 Remote control for WAVE ------------------------------------------------------------------------------- WAVE: Waveform analyzer, viewer, and editor -Copyright (C) 2002 George B. Moody +Copyright (C) 1996-2005 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 @@ -78,6 +78,19 @@ #include #include +#ifdef __STDC__ +#include +#else +extern void exit(); +#endif + +#ifndef BSD +# include +#else /* for Berkeley UNIX only */ +# include +# define strchr index +#endif + char *pname; void help() diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/waverc/wavescript.c wfdb-10.3.16/waverc/wavescript.c --- wfdb-10.3.15/waverc/wavescript.c 2002-06-19 21:58:08.000000000 -0400 +++ wfdb-10.3.16/waverc/wavescript.c 2005-06-10 09:43:48.000000000 -0400 @@ -1,10 +1,10 @@ /* file: wavescript.c G. Moody 10 October 1996 - Last revised: 19 June 2002 + Last revised: 10 June 2005 Remote control for WAVE via script ------------------------------------------------------------------------------- WAVE: Waveform analyzer, viewer, and editor -Copyright (C) 2002 George B. Moody +Copyright (C) 1996-2005 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 @@ -87,6 +87,24 @@ #include #include +#ifdef __STDC__ +#include +#else +extern void exit(); +# ifdef HAVE_MALLOC_H +# include +# else +extern char *malloc(), *calloc(), *realloc(); +# endif +#endif + +#ifndef BSD +# include +#else /* for Berkeley UNIX only */ +# include +# define strchr index +#endif + char *pname; void help() diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wfdb.spec wfdb-10.3.16/wfdb.spec --- wfdb-10.3.15/wfdb.spec 2004-12-23 21:34:43.000000000 -0500 +++ wfdb-10.3.16/wfdb.spec 2005-06-12 01:35:30.000000000 -0400 @@ -11,11 +11,14 @@ URL: http://www.physionet.org/physiotools/wfdb.shtml Vendor: PhysioNet Packager: George Moody -Requires: w3c-libwww >= 5.2 -Requires: w3c-libwww-devel >= 5.2 +Requires: curl >= 7.10 +Requires: curl-devel >= 7.10 BuildRoot: /var/tmp/%{name}-root %changelog +* Wed Jun 8 2005 George B Moody +- replaced libwww dependencies with libcurl + * Mon Mar 8 2004 George B Moody - added time2sec @@ -215,8 +218,7 @@ annotation projects. WAVE has been used to develop annotations for most of the PhysioBank databases (http://www.physionet.org/physiobank/). -WAVE uses the XView graphical user interface. A (beta) version of WAVE that -uses GTK+ is available at http://www.physionet.org/physiotools/beta/gtkwave/. +WAVE uses the XView graphical user interface. %files wave %defattr(-,root,root) diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wview/clean wfdb-10.3.16/wview/clean --- wfdb-10.3.15/wview/clean 2000-01-14 14:02:16.000000000 -0500 +++ wfdb-10.3.16/wview/clean 1969-12-31 19:00:00.000000000 -0500 @@ -1,6 +0,0 @@ -# file: clean -# Use this file to clean up this directory with UNIX make and rm -# (see the top-level Makefile in the directory above this one) - -cleanup: - rm -f *.obj *.res *.sym *.map *~ \ No newline at end of file diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wview/ecg.ico wfdb-10.3.16/wview/ecg.ico --- wfdb-10.3.15/wview/ecg.ico 1999-06-24 11:38:28.000000000 -0400 +++ wfdb-10.3.16/wview/ecg.ico 1969-12-31 19:00:00.000000000 -0500 @@ -1 +0,0 @@ - & 0( @|wwwwwwww|wwwwww|||ww|wwwwwww|wwwwwwwwwwwwww( @_UUUOog?ws<^TUU^~|yns'fUUUUuu{ \ No newline at end of file diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wview/html/addnft1.png wfdb-10.3.16/wview/html/addnft1.png --- wfdb-10.3.15/wview/html/addnft1.png 2000-01-14 14:20:32.000000000 -0500 +++ wfdb-10.3.16/wview/html/addnft1.png 1969-12-31 19:00:00.000000000 -0500 @@ -1,28 +0,0 @@ -PNG - - IHDR ny3PLTE-"tEXtSoftwaregif2png 2.2.59IDATx݋r0ifvF &vEK]M~Cx `#`#` 6666ؾMdcaed#lqLl9"8Il lؖlӮi6@6|'^bFmBnakRm.,[[*4B-6K/3dۜ->mtpرmBl+\tk [%1|==ݦUeIVDl lMlWN lll%1ۧڹƖG$L',$lil:k7 NJÕ,}`-V-#{A;-9FoBlvI>Ml8lʻ^f7kl>osbd@g<8*ɣ*Ikw< gm)tD&rǶ`.F qQiU`M6٦>`jI0f -[Cl]/tw~^r[3lJnt|ih$l MFZHz?ld[=f[_LxO>nv%ۚcg"Z;nd[kl!ͼlj}qwzU؆~8ݲfئRqaN[[ld[l>`#`-d+pst_9g+Fmtg%ZbG1nl؂e.B`Y׏m/9w3r@y2fU-6楽,`Ortm=͙EV srK KGf]^ٙI -Ϗ&ݮInF -I.[;l#=vo}\n?sMR9f[wva.?}A9iS~֓l6{U6m% -cY!F3i0Wɲ{Ͱ =OE6G -v0v{`kdb! [VIMwЇTI*a;ɶ.mNĦOٺio`T7tPl:_ioęR2x]lϵ!l{%zw)YͫSdn2Ix#l!)|۸&}XV̥JRIw 2rw Rp>e_ -RlS2=*nzf_OU+mMRfc/MXQobWaؼW|ȶ?}Ofqma[ߥewu -Lv$4lnﻍdj!D&6Ch -T>MpaJUĭd8UNCL&Jrr墥7&O=SRO`fŦۃSDTYիD̓JpE0#Ig -IZ`ubS[4F{[ U!=UvZeNT_qKMfR}(tmN+bd-&m96aM[m$v6k$z9ѼFRتgu#fT&asi6Juڻ\ wن6n` /m۸t]`;19%d[koE"/0\9mo=7N⺺Od[iZ}me$W"ΨtTtw?CTv }4  i -Il & ݰ=E&T_6 RH>LBR)$պL`JbtmJT1bUp6 'l~+鵞ؒ؆:< [iwȶ6؆Ӷ.0m -[klÊRWnc3UvZ%.7}*+Y()6n{QQ?nR$akMmȶ -VͶJ -[l[U͖znOUH5~@fҚn(Lzu;,)Lzz6uDWjR#2 MmN#S/Ez%GVyNX ]bKhMdcQoEp1kMemټ1>ldИ,v[7/%$dׇrn煉Բ|YW+oYz%*!VcfoC6v,w_bwfp=zxK6Kۆg0ֱm݋Bٶ 1 blcT,2餪u1)m#5 `V5lfzD.|롍Rmc[.?f[4bKd-6 IjŃ -6L'B?w.l+$7$ކ6oU]Bͤ}#y"ͤa\ WI`kؚdsIak&'Y-yz|C7E;-}*Q"`#` 6`-s9Pl([V7*2|?M%d[lNmǎFc}%)wǷdS=loBym 6 H?䭱r#Aah,6S_ٶ8l^o {ؚa߶Yh fdQ=m!*c HQ1[hk,Da6t5 -IE!Yn)g~HOCl]<ۈ٢6g*]6r6ldi%Bp㱍ukRMߓ -<8f$1.lj:woVILhxuضiz-%UZ.7[?wD/7ug<C%e/66<V6_{֥Ƨ-#c~v_/=ecRrEUB6`+ -)^l/ -x8lllFF^ųSnxHGqn퓂ï8d[Ԋ->J6akMɷ&)Hëe;M[c -G(3@blW-}lmIGetr*۔rR)`s*%|ٜs:{K[6 $mAs+EA;a{bwUa۞hr`6wEӀ-ۛ|7Mza 6` 6Izmde{~؜$y'LXs:%zl{!ph"ܐ!Όc"H+R3ZdElZ!u0`fͪ2TIT$äc.z͙Kl R:`!;"9$$$6wSݽ%9dkUv ;;ʪH1(&$ -$JRmbHX6[ݔV+ažBl]X%(~=slO]cH?-l >tq+ak {O -[Ӏ~[+lFllDklQ& Q*JlFFlllFFFlllFFllllO!IENDB` \ No newline at end of file diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wview/html/addnft2.png wfdb-10.3.16/wview/html/addnft2.png --- wfdb-10.3.15/wview/html/addnft2.png 2000-01-14 14:20:32.000000000 -0500 +++ wfdb-10.3.16/wview/html/addnft2.png 1969-12-31 19:00:00.000000000 -0500 @@ -1,17 +0,0 @@ -PNG - - IHDRV3PLTE-"tEXtSoftwaregif2png 2.2.59`IDATx݋*នRTx=EK5 \Lvvv-b ,X `A ,X,X `A CR KMA,x Ehs,F:XDԑXzeƅX:[,:OE{ X"8R.3޸O}cв:;ݭ'~g7Ģ7XX\>M[̳y(JD*=ǣWEOgqe,',`~*#.$XQ< E{,` X,` X*"_gE,W=E,5, Ⴘ5ѰEj)/cI?=(̭Z<Ey?¢dylѳPG0[E,=jBԓC'BuQEc 3tr~"|yC'ok.0+ϱ2H'R 2NPg]^r(%Hpe~c~ -Bs,u",` X8Ƈ?īYF,X ` ,*f]5- -0,,㊖C;Ka0MZ,`d96m<` ,"Ex׹E5Ak_=h-E ~`ƺZf X,,| Xx2i=` Xx17O+Y4YE,c Z³>,`h{ŷY}XbHle86yas"3&i9V sew2ρ9DwjI,T:trv<[0왭Ř?8:Cs" ,Yb~k`_̿Mt"8p-Ndm ,fq|6W,NȆ+uDcq|68oq|6Xl8(8:,cqB6{xXl8rxbodÁp`p`A6XlUF6X$X IdÁE<伷fuh뻒p-m`ſqxbL7nanC X,:mr=Z 7X±hiY<xGp%" XB~ͭM` Ǣpi; ;E,~vlђ[ XBOx3 qlDR `֢۬Xg4~p,X±0].牁,bck!Ŵ,E&7֛넽Đ3י̲^$g XWwt` Ztw٬hD7劔b+>b)q$?{.,Óڰ؉t}?#έ<"v"P>Jdyg_"2.*3X Gp>܇j ?͹G됖F,w÷QK>/ÙEKl&5~ aXb9nbSXZb˼E| W"t"DzлfDv"3,ye[L;9-C=Xc)Ozck2Z 9_' -eqYiP[o!/=S^{,ZfJ,Ḏ,މE!fHchś5.#g3v"ͣ,v48};`,ڑfB-2aqe^c+L EY4VF,'7E`Y&Xݏ(,[CŢI.E,lj,g14"XTNXԝȠgUX`A"mlp,**P7a,# seρEEV|"y ,j-~Uk\o!,dDhKOPAkѶnc);\pLHxHYHI*Yڃ*ɽmA/=:k]DNdaRp&{͘':ߌDƮVYX:37$ᤶ&bo"@È(Hfpn"щ+v"X0<*KCN5L 9$29$\f"\s:,`]^c!+ `Q:*pwz X, X,n]7uX,nΕL"ݢd5*"YN9',ЭEǢda>fI"[ %w~SݮHPt Yuo>zl< ö3/Q@Peܢ濄7`['b6=1 o<0XRu0ѣ V*ʺt%ï3~,!ScJ37"U[gYӞf1߉<_) ضkE55 -Zr[j+"iNϰ¦_ꚅzi9E*}BR,X Oy}A,[Mp$ܡڂ{^r) C  vrZ/Ñ+إ@c*pmCjYNX {". Pʮ'-ބŎ?K&Â߰E,6DE,!*bah-` X,` XbS@"X^$2E `(F tS7Gy%ہ![,Ne<6Y/ÛN[jg`q %+[-08B_ -j$QSQ[}O%,a1^Ouij]Ns$\Qna-!BK3/N;[D tsYw%l`qB̰Xn-9",sb>E +CNgG5@,[V[ld696~Ɗ%S)&L1l𯼛-A;8,>geڥjH.h-gySb6ւ,XŢD A,.`Ytl `A\EV_X\LGa獵VjIj%Q1;PTBװM,Y K^H1t"5<YU?*R(&ZH-T),,` Z X!*J"aau[ Sx7Xb҉[ :X|olQ!\3}Yeq,x]3iv2Y܉,=Υ:XDԑKֽyy[uiv3I,ƼŐwP`< kCHbv,I!b?ΉOW؉neO拭;pV~XB-ԑ/~;^pMXgt⚭E8XX yHރ"`qܕWY!gzL9aqX9r¢ vIEuo8HXdAdh,` X `A X,` Xk,( jb j¾XV'X.I"Y?JYMF+e5Y̔,Ђ,Jd! -KY*mﯰn?׃X4ﰰ5DbN87N,`EJZ -`1Q1J^#TKk1%Ϸb/կBDˡu(nEf5ba3j-,,D,6̤QcM5ŷ.P35.`,gD,`A'+7Xb}dYvAK|Sr{|% -b@dODuΰEЉ ,`Ǽ XՉ|o:G)y8Ť,3+7 XXdcXq3a>$ʊ^XT̂fs`QUkf簨)xղ؂+Yx{y ,-T'sɸoh?ԡ-!?aAk+ȇśim|D,/?2,6 -xŮո:Y;kW A}<~K` q[].]uN$zA"9%YM,ԸR,dXTyFM`I!q/QT"jYW})>,v7\EUobCsv>ʇa.a7v# TH|?=`ɩr݇E]F -X|_W8~Rp,|eҨr< z : DAaUU!$Z:Yte¸%Xׄ0a X}(GEѭI X,` X .ł“b4YE  `A ,X `A #NIENDB` \ No newline at end of file diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wview/html/addnft3.png wfdb-10.3.16/wview/html/addnft3.png --- wfdb-10.3.15/wview/html/addnft3.png 2000-01-14 14:20:32.000000000 -0500 +++ wfdb-10.3.16/wview/html/addnft3.png 1969-12-31 19:00:00.000000000 -0500 @@ -1,9 +0,0 @@ -PNG - - IHDRA{F|3PLTEstEXtSoftwaregif2png 2.2.59IDATx휋n0DGi%KHܦVM(fͮ -م6bx\iI&=K@j$<>HNP)>#+5ؤ ]\dEJsk׶_wo 0VR= Р f֕scq+ŏ!x=U~>yqH SI;i^TwPq]mv姑 HIi$H,4Bpٶam/or$"/v8}Z>$>/}B'$L[+K^^0g׮svV7kCW{ Z]{8W#E |9B!E0oJuZAs1Fukͽ!>aܻ:+dP?B"ӊ`7&xXa  4(Hjhɫ? h`P!Jx1N|</NDs<|.B };#I;sG()\t??c55#v@_F-A![e .f"xf(»7aAYо:&ANLtVW$$ 6t -7o3S= R=/o"!($=9 Vht_gKȶ1${~y]C"_C͂[_$؆P -L -2kowi`"NLm`Cp'aTސ  Pxd7@4@*ŗjbqRDbɳF]6Ypov1]"(ANQtJLx:8uy8 "X$x Ԋh<`6L*ȜHpċ{͋#^QITQ"40r8UI.AaC:s> & ~F$H$H#A$A HI?<{*}=z A  ϳ(]du[xfWdaGDž֝TCk1G'#9$T1iH9!B!B!B!$ |=%+0U!߄"W -l=,f0X!|8Ķ!|MJf!Q'sB1t'P%B!'\0gBCB ku|'_|V(ǿ‰ ]B=VqkN3iȯgaN8Hn2 ;olΆY _BcƳG6i<&u7)1fȾxAw'ɷ6I:EwB@!!O r-qFH5!#R<B!~>a;pFX ^#!wo'JTJIĹm~bFH+Y 푷f/eE8.V|AH q0!,BqBE.2ٸk.rpڷ w'o!?j !9 2\7 5Y8BҘ@p %4֖BnĄIB@mQ&"  Pkƅ̈́qFgl ln 0P+ח@ߝh0щ8݀!B 5 fCBƅ_G& =B!0ȳ>%@;,$u1^BAY.0e"\M$#NPy@qa -ϕ,E"ۿ?f7 JN:_NT!j[x$O84qU¤+r<.ƅQEܝD#d̚쮰SN8099 !Y!w.Ą~&7 B !BB!!\`0IENDB` \ No newline at end of file diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wview/html/addnft5.png wfdb-10.3.16/wview/html/addnft5.png --- wfdb-10.3.15/wview/html/addnft5.png 2000-01-14 14:20:32.000000000 -0500 +++ wfdb-10.3.16/wview/html/addnft5.png 1969-12-31 19:00:00.000000000 -0500 @@ -1,13 +0,0 @@ -PNG - - IHDR>pN0PLTEjdtEXtSoftwaregif2png 2.2.59IDATx흽ê8Btm,ʫl)վ"Ei+ 8fۘ̾m(G5f_] ){/˷m|Ѣ\XqpR}wNܗhವPʝ]}wqlݖˆ|;o,XqUu~/Puݲw ̾D8pZ}g8>9=Y&v>yp|*r$zݍ.H_.H#좁]{Cyvp?ouvws ;Xh Ggו`(pP(0t -%9J&C\,fD`^fgwc"JȞK#w bwm|`eRa_brvgU(=B˂NVL2SQxz@ge>dKQ&LEwîcu*(<kDE@K*SO)ʼ)_ZW{\ʂ{jbh8wuJ|N.QTsT/8Gm~='ʅ ǽf0n3K}&3;3;3;3;3;3;3;3; -PwgJ;Bٻ`>+篞Q+Sz;vlRadt)v?'+ʹ9tWBLB8ML#y0;vLF`J-;ooQd 6.0WϕyrRqNCx=([G'CBOyl\1ZCa:1{ںNLozur}Zκ 3;3;op &'}]Nى{_8c[ SԟbB~/ť޹5?4c7˗1eqćiљ*ٿ].\*ח}|+cK9U姥Ǵ/+*L]V+{2_n #=ח|WgB~4m.Y!\fY1f=Z!Ԟ!?˰.sl10;Ogc;۷*wϮ% Q`ׁAoawM>LRQ%iV+niGvVR  a'ˬ]"{,}vMacmɵu߸2͚ɶc٧hC]>Շ]1t,w;˝>]oW؍wvqU_'}= -QU׷¾A]cO]>Pe*/k}l M;vcV}r}>9J(Ctc4Mz] VAN_Ht` -}ޭ}4Ge!0Y.?m9n5 rvs}>NF!!ۼ}{86Jdn'wjL>yb- 鼪X>=m razR;>}e2xL'xm e޷R]ˢ)|hbc2s}6F1-I+6 NYY;X$e~ 迼4eٹ._uرܟg=rg>>a" wOz',r-g}RjkACYƻyTW@,6֓C-}=mFOuf4j.~@҇}9IIv?0;wHPeT=7e~]ߣ.o;.- MW33s8;˝O7OWqOEx.}BY[CGko)emݳAz̦Oa_AeՌ){(%{Uoߧut/opE7{`EwϳrgY$+_wc_uPOtm=w@}ad)|Gtn=[>𐆔wd/߃F{o>ut[g/"K1]?dףv5u3.m,4l&;Lj_|yc|l2wxbjЧyWϳrgYNoM^﫿񟗯ӘNρHAG{|yAo㽋FQCluXvQ]fqIJ(uQwd¯goϮhYOߑ]|#$^CϥmUy"{z;El$ =ޟc\9l7^휫znYTݥw 5.53lܟg=rg>{|ϿkܧV].#g篓>}ܟ roߡU篛&:]u \N3_7ņ?P;|ubooN=b|'=bOO9O^n܍Wye^Ϯ[ߧz3k3ߛS>USޠO8O;&2ͧ=Zpw* fn3;PPf;a`maKje3!9iT\䞡Rs#b:= žg]MMc -- l]t'.y *MkdJ<]S ^'w(~*뻅Sj7EGLiFF -6WlT*S;Ww$jt`H8~ -T_,wAe?;fb]vC7UA'v3nEfȸd+9<|  Ft8KW-Gt0e=vt|q ;>|"=:B`7&->{:OOoNF^ w;,Kv_q2a}OF{v 屃?WSRŦ$~}OG wCEC7jr{Ǟ?l6yuȮŏ屣וyg_uȿ=OfZ6{|ء+MN:c`v"55}Yȸ?̾[1 (;޵kmV<6A`!50;3;3ʷ@TM7$53nXU!Afgvfg}ˬgWaO`ڸi̦U}riVL{0;'6ޅ1W͔ܲkB>̇1 㶮|Tkf>]=lEy!e=ߩo[_vܧ3;2W9tX5bӐ֍6$yfgvfgvfgMw~`?g!IENDB` \ No newline at end of file diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wview/html/addnft6.png wfdb-10.3.16/wview/html/addnft6.png --- wfdb-10.3.15/wview/html/addnft6.png 2000-01-14 14:20:32.000000000 -0500 +++ wfdb-10.3.16/wview/html/addnft6.png 1969-12-31 19:00:00.000000000 -0500 @@ -1,15 +0,0 @@ -PNG - - IHDRb0PLTEjdtEXtSoftwaregif2png 2.2.59IDATx흽,ӀV>6@e)UNeH)H[13c_b{dc<0f۠awȖ#Gko{v6DPNٵҪa?Zv}u}㶹:jGs4כ1okNQgmWX;#)rƯ=i:pO<;$G] x}snoJalöavavava%aW;Ԃ/<=$?EU~ޗeJsq<*Eke{}Ta?a,H-a׽ G캀]{QƳ]狳+5=_<q5G]u/M/ Y(( 'F$F vJ }0O+cf`_,!diNRA8oLGw - 4y蔽BM(Ƚ],cO*cOعؑR.;/eߩ,TkL#Z=e {L.VG^麺"x5G{oP+uKΫu^u| -: -xkuubR]Gd}}NtkH?E _:Iu%MOp8;*v{>n?m&݅avavavavavavavava_ ;z?=QǠ:!hvcJϮF'R\]ZU](.N i*$#;hbk}*2 k#R1JNEvG^R꼪F:0 MRz,;]F:bGyCth>ʎUG9:0EN}>Ve[F؅]؅]7~n8Æù NN|Weyڝ |X=nnv"pɘ46-3@:ݸSߘ|o7vAe`{5M DZa0ߊt lx~¯|ct5Lq>;:|m{ο84e7Cu{EZOv{"y R_v{Z,3eoׅ,Ug^gd;]RqC -jtq0MmQ}vt]i>w^1g2OJzĖS ޞ9?Oa"w}?00p%;,$݌K}džc&~b}@>rj76M쒩!}ch])=GN*߇+{h&*Pu|>~]WfSr}ߘ^t}]"w].DEg1+͌rj~d߇3>n`gv}>~}> !v}H>b.yD"we;XkF C΢f͸*`Jw7n˶P4Lc7}@~9^yf=ӹw`@~sKx+o6}vxdyN>>7{|y~a]i%b>Xc7$Q/ KCq"w]QE_bUyh9^ߌr/{> {{a~3%r6s0F97{d]ߥ?/v].r_lwFF`Au];t:3 FD/+t7Uefcc4>w,IHWhgcqaSUyY1mG068$<97o}˒č.aro槷)~!Uč3 - ,׸crTiܔo٘n??/v].r-;gq~yXUތX)jr\e/ޏ$i+Af;)m oX=_rϷ:l'~d:q{{{gB}(/O}wg`)mX烎6ښC`Gr{vRp7{;@KGK46q^vrvWokC ezoJs!}InRT~-eG̍o #'r۾ayDnQBh#1wc?1 -}SǢ:y:*+뿣m7Cp Ӱ&uW/~E9g7bϳ$"J.}gnoLmk  D7zv=~ (@y {yOdC?8 54N vT+!]+ tjMP9Wh汫 /2]Rv{zbkȴmkl+Eq(Gv*Pf4;^\4Zb_{vl:=AdW5:8 aV؁ν"F"@^ɝtJ[rGvꜛEM&H ڻW+:Sݒ;o-ʮ:OmIl ^LMNiu5oGu!W u^7ug|K/ya{ZjRv]la64l}Ͼ= .¾kvIkdgSe>^{gvrq1E {t}uiVUcC㲯]`ehf_^/;y9YLi.X$a˯O?lQdy90a;ZW ;{U<4˼|&ubWNOEkDvvoڈsݕ_&e)N-=:^^2;F]NֶأadZr6{xK.%;UGg%eǨ5S} lm0L,=&*V  iɵpf+mqr^Zr- -ᾃtWAǼKB`KZq8O{Ouik;?Ӗn3&l5ˮ&]+IsbPlXavavae+c20[։I%_W76zd| -/5d7Pv`oq ^ Z2VnV[a\7(vAٗ]y!]׬Qfgs:{'Vn=n-SѕH_ܼf]?߶B :.6 @m{b?}`ae_^-Z+aͮ_-V<{k7v2W^g`a2u'ֲPjOpݧʯiOU@h!jZ#_nϡ=3+ʛ#S)bLt1xv:`97_|;Fٖq1iۻ|[-GTv:Ow$ĿsP,:1[Gor'c_YeQί '<X&]؅]؅]؅]؅]؅]؅]؅]؅]؅]Ww]P?_ {/A؅]؅]ؗYs9 /`>qQ]؅]?Ǯw{v -v읇l]כeuGI> -DbRȆ)q[{,硡S~GL 䓯 p;uj`4>/57("XxUcRIENDB` \ No newline at end of file diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wview/html/wvsetup.ht0 wfdb-10.3.16/wview/html/wvsetup.ht0 --- wfdb-10.3.15/wview/html/wvsetup.ht0 2002-08-08 12:24:30.000000000 -0400 +++ wfdb-10.3.16/wview/html/wvsetup.ht0 1969-12-31 19:00:00.000000000 -0500 @@ -1,266 +0,0 @@ - - -Setting up WVSCRIPT - - - -

    -Catalog of documents - -

    Setting up WVSCRIPT

    - -

    Contents

    - - -

    -This document describes how to set up wvscript, a ``wrapper'' for WVIEW that provides Windows -users with some of the functionality that wavescript and WAVE provide to Linux, Solaris, and -SunOS users. Specifically, wvscript can be installed as a -viewer for your Web browser and for Windows 95 Explorer by following the -steps outlined below. Once you have done so, you can follow links such as this -one:
    click here to view
-waveforms - -

    -If you are using Windows 95 and Netscape 3.x, you should be able to follow -the steps exactly as shown here. If you use another version of Windows or -another browser, you will need to adapt these instructions to your situation. -If you use Linux, Solaris, or SunOS, then use WAVE and -wavescript, not WVIEW and wvscript. - -

    -Before performing the steps here, please install the WFDB Software Package and -WVIEW as described in the Quick -start notes for MS-Windows. - - -

    Adding the xws file type to the Windows registry

    - -

    -Double-click on the My computer icon, and open the -Options dialog box (from the View menu). Click on the -File Types tab, and on the Add new type... button. The -Add New File Type dialog appears. - -
    - -
    -Fill in the text fields of this dialog box exactly as shown above. (Note that -the MIME type is application/x-wavescript, not -application/x-wvscript.) When you have finished, define an action by -clicking on New.... The New Action dialog appears. - -

    - -
    -Again, fill in the text fields as shown. If you did not install the WFDB -applications in c:\bin, provide the correct path to wvscript. -When you have done so, click on OK. - -

    -Optional: If you wish to set the icon for xws files, click on -Change Icon... in the Add New File Type dialog. A -warning message will appear when you do so: - -
    - -
    -Dismiss the message box by clicking on OK. The Change -Icon dialog appears. - -
    - -
    -Enter the path to the WVIEW executable file (normally as -shown above), then click on OK. - -

    -To record your changes, click on OK in the Add New File -Type dialog box. Once you have done so, try out wvscript -and WVIEW by opening the directory in which this page of -instructions is found using Windows Explorer. Within Explorer, double-click -on the file example.xws; this should cause an MS-DOS window to -appear briefly (when wvscript runs); WVIEW should -then display record 100s, with annotator atr, beginning at 0:22 (as -specified in example.xws). If this does not happen, check the -previous steps carefully and correct the problem before continuing. - - -

    Registering wvscript as a Netscape helper

    - -

    -Start Netscape. Open the Preferences dialog from the -Options menu, and click on the Helpers tab. - -

    - -
    -Click on Create New Type... to open the New Type -dialog. - -

    -In the New Type dialog, specify application as the -MIME type, and x-wavescript as the MIME subtype; then click on -OK. - -

    -In the Preferences dialog, select Launch the -Application as the action, and enter the correct path for the -wscript executable, as shown below. -

    - - -

    -When you have finished, click on OK to register your changes. You -may now test your setup by clicking on the icon below: -
    - -click here to view waveforms - -

    -The first time you do this, Netscape may open a message box to warn you that -running software from untrusted sources may compromise your system's security. -This warning may be safely ignored in this case. - -

    Note for Netscape Communicator 4.0 users

    - -

    -The procedure for adding a helper application is slightly different than shown -above if you are using Netscape Communicator 4.0, since the menus have been -reorganized. The Preferences dialog is now opened from the -Edit menu. Select Navigator/Applications from the -Preferences dialog to open the Helpers page, then click -on New Type to open the New Type dialog. - -

    -The New Type dialog for Netscape 4.0 contains these fields: -

    -
    Description of type
    -
    enter WAVEScript, or any other description of your -choice
    -
    File extension
    -
    enter xws
    -
    MIME Type
    -
    (rather than separate type and subtype fields) -enter application/x-wavescript
    -
    Application to use
    -
    enter c:/bin/wavescript.exe
    -
    -After filling in these fields, click on the OK buttons in the -New Type and Preferences dialogs to register your -changes. - - -

    How wvscript works

    - -

    -To embed a link such as those shown above in your own web pages, simply insert -HTML code such as: -

    -    <a href="example.xws">
    -    <img src="wave.png" alt="click here to view waveforms"></a>
    -
    - -The file example.xws, to which this link refers, is a text file that -looks like this: - -
    -    # file: example.xws
    -    #
    -    # Sample `wavescript' script.  Use this script by the command
    -    #    wavescript example.xws
    -    # (under UNIX), or
    -    #    wvscript example.xws
    -    # (under MS-Windows).
    -    #
    -    # The first character in each action line in a wavescript script begins with
    -    # a `-';  any other lines are ignored.  Only one action may appear on any line.
    -    -r 100s
    -    -a atr
    -    -f 0:22
    -
    - -The contents of example.xws specify the record to be opened (in this -case, 100s), the annotator to be opened (in this case, atr), -and the starting time of the segment to be displayed (in this case, -0:22). - -

    -When wvscript is invoked (whether by Netscape, Windows Explorer, or -from the command line) it reads the script file named by its first command-line -argument, extracts the record name, annotator name, and starting time, and -invokes WVIEW. If the annotator name is not specified in the -script, wvscript uses `-' as the annotator name passed to -wview; this special ``annotator'' is ignored by -WVIEW. The source for wvscript (wvscript.c) -may be found in the app directory of the WFDB Software Package, if you -wish to modify it. - -

    -Note that the syntax of wavescript scripts allows for more than one -record to be specified, using an action line of the form -

    -    -r 100+101+102
    -
    -Although WAVE (under UNIX) can open more than one record -(in this case, it would open records 100, 101, and 102 in separate windows), -WVIEW cannot do this. wvscript identifies the -first record name in such an action line, and invokes WVIEW -so as to open that record only. - - -

    Multiple instances of WVIEW: use with caution

    - -

    -Another difference between UNIX wavescript and Windows -wvscript is that wvscript will always launch a new -instance of WVIEW even if WVIEW is already -running, whereas wavescript starts a new WAVE -process only if WAVE is not already running. Multiple -instances of WVIEW running at the same time can interfere -with each other and should generally be avoided. - -

    -Only one instance of WVIEW can be run reliably at a time, -because of limitations in using 16-bit large memory model DLLs such as the -version of the WFDB library used by WVIEW. For this reason, -you should normally be careful to exit from WVIEW before -starting another copy of it, whether from Netscape, Windows Explorer, or -the command line. - -

    -It is possible, however, to run multiple copies of WVIEW, -provided that all copies have the same record and annotator (if -any) open. This can be useful if you wish to compare two or more segments -of a record side-by-side, and it is for this reason that multiple instances of -WVIEW are allowed. If you use this feature, close (iconify) -any instances that are no longer needed, rather than quitting (exiting). To -exit cleanly, make sure that all instances have been closed, then quit each -instance without reopening the window (this is necessary since repainting the -window requires rereading the signal and annotation files, which cannot be done -once they have been closed by the action of quitting any instance of -WVIEW). - -

    -If you encounter problems related to interference between simultaneous -instances of WVIEW, the only solution may be to use the -Windows Task Manager to quit from all instances of WVIEW. -If necessary, you can open the Task Manager window by pressing the Control, Alt, and Delete keys simultaneously (if your system has -become unresponsive, wait for up to 20 seconds, then press Control, -Alt, and Delete once again). - -


    -

    -George B. Moody (george@mit.edu)

    -7 May 1999 - - diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wview/makefile wfdb-10.3.16/wview/makefile --- wfdb-10.3.15/wview/makefile 2000-05-24 22:35:28.000000000 -0400 +++ wfdb-10.3.16/wview/makefile 1969-12-31 19:00:00.000000000 -0500 @@ -1,81 +0,0 @@ -# file: makefile G. Moody 9 March 1993 -# Last revised: 7 May 1999 -# MSDOS `make' description file template for compiling WVIEW -# -# Copyright (C) 1999 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 Library General Public License -# along with this library; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# You may contact the author by e-mail (george@mit.edu) or postal mail -# (MIT Room E25-505A, Cambridge, MA 02139 USA). For updates to this software, -# please visit PhysioNet (http://www.physionet.org/). -# _____________________________________________________________________________ - -# The value of INCDIR should match that in the makefile for the WFDB library. -INCDIR = c:\include - -# Uncomment the next line if you are using Microsoft C/C++. -#MSC = - -!ifdef MSC -CC = cl -CFLAGS = -nologo -G2sw -Zp -W3 -AL -Os -D_WINDOWS -I$(INCDIR) -LIBS = libw llibcew ldllcew wfdbdll -LINK = link /NOD /NOE -MAPFILE = wview.map -!endif - -# If you are using neither Microsoft nor Borland C/C++, insert appropriate -# definitions for CC, CFLAGS, LIBS, and LINK here. - -# Otherwise, this makefile assumes you are using Borland C/C++. -!ifndef LIBS -CC = bcc -CFLAGS = -2 -WE -w- -ml -Os -D_WINDOWS -I$(INCDIR) -LIBS = twfdbdll import mathwl cwl -LINK = tlink /Tw/c/x c0wl -MAPFILE = -!endif - -.c.obj: - $(CC) $(CFLAGS) -c $*.c - -.rc.res: - rc -r $*.rc - -wview.exe: wview.obj wview.def wview.res - $(LINK) wview, wview, $(MAPFILE), $(LIBS), wview.def - rc -T wview.res - -wview.obj: wview.h -wview.res: wview.rc - -wview.hlp: wview.hpj wview.rtf - hc31 wview - del wview.ph - -clean: - -del *.obj - -del *.res - -del *.sym - -del *.map - -del *.~ - -del *.c~ - -del *.de~ - -del *.h~ - -del *.hp~ - -del *.rc~ - -del *.rt~ - diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wview/wview.c wfdb-10.3.16/wview/wview.c --- wfdb-10.3.15/wview/wview.c 2003-07-16 11:10:39.000000000 -0400 +++ wfdb-10.3.16/wview/wview.c 1969-12-31 19:00:00.000000000 -0500 @@ -1,1825 +0,0 @@ -/* file: wview.c G. Moody 20 January 1993 - Last revised: 11 June 2000 (but see *** below) - -------------------------------------------------------------------------------- -wview: view WFDB-format signals and annotations under MS Windows -Copyright (C) 2000 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 -#include -#include -#include -#include -#include "wview.h" -extern int sprintf(); - -#define SIGNAL_COLOR RGB(0, 0, 255) /* blue */ -#define GRID_COLOR RGB(192, 192, 192) /* 25% grey */ -#define PGRID_COLOR RGB(0, 0, 0) /* black */ -#define MARKER_COLOR RGB(255, 0, 0) /* red */ - -/* Default scales and grid intervals. */ -#define TSI 9 /* index (within tsi[], see below) of default time - scale */ -#define VSI 3 /* index (within vsi[], see below) of default amplitude - scale */ -#define GTICKSPERSEC 5 /* grid ticks per second */ -#define GTICKSPERMV 2 /* grid ticks per millivolt */ - -/* Printing defaults. */ -#define MAXCOPIES 10 /* maximum number of copies to be printed by a single - request */ - -/* Convert mm coordinates (origin at lower left of window) to window - coordinates (origin at upper left of window).*/ -#define xtr(A) ((int)((A)*xppmm)) -#define ytr(A) ((int)(wheight - (A)*yppmm)) - -/* Convert signal coordinates (origin on left edge of window at baseline - level yb, units sample intervals and A/D units) to window coordinates. */ -#define xt(A) ((int)((A)*xppsi)) -#define yt(A) ((int)(yb - (A)*ysc)) - -/* Similarly for printer coordinates. */ -#define pxtr(A) ((int)((A)*pxppmm)) -#define pytr(A) ((int)(pheight - (A)*pyppmm)) -#define pxt(A) ((int)((A)*pxppsi)) -#define pyt(A) ((int)(yb - (A)*pysc)) - -HANDLE hInst, hLibrary; -HPEN signal_pen; -HPEN grid_pen; -HPEN pgrid_pen; -HPEN marker_pen; -TEXTMETRIC tm; -static int cheight; /* y-spacing between rows of text */ -static char record[20]; /* name of record to be browsed */ -static char annotator[20] = "atr"; /* name of annotator to be browsed */ -static char cfname[40]; /* name of calibration file */ -static char wfdbpath[200]; /* search path for WFDB files */ -static char title[80]; /* title of main window */ -static double sg[WFDB_MAXSIG]; /* signal gain * calibration scale */ -static double sps = WFDB_DEFFREQ; /* sampling frequency (Hz) */ -static WFDB_Time tf = 100000L; /* time of end of record */ -static WFDB_Time t0, t1; /* times of left, right window edges */ -static double tscale; /* time scale (units are mm/sec) */ -static double vscale; /* amplitude scale (units are mm/mV) */ -static WFDB_Siginfo si[WFDB_MAXSIG]; /* signal specifications */ -static int nsig; /* number of valid signals in si[] */ -static int nann; /* number of open annotation files */ -static int tmode; /* 0: show elapsed time; 1: show absolute time */ - -/* User-selectable time and amplitude scales. */ -static double tsc[] = { 0.25/60., 1./60., 5./60., 25./60., 50./60., 125./60., - 250./60., 500./60., 12.5, 25., 50., 125., 250. }; -static char *tst[] = { "0.25 mm/min", "1 mm/min", "5 mm/min", "25 mm/min", - "50 mm/min", "125 mm/min", "250 mm/min", - "500 mm/min", "12.5 mm/sec", "25 mm/sec", - "50 mm/sec", "125 mm/sec", "250 mm/sec" }; -static int tsi = TSI; /* index (within tsc[] and tst[]) of current tscale */ -#define MAXTSI (sizeof(tsc)/sizeof(double) - 1) - -static double vsc[] = { 1., 2.5, 5., 10., 20., 40., 100. }; -static char *vst[] = { "1 mm/mV", "2.5 mm/mV", "5 mm/mV", "10 mm/mV", - "20 mm/mV", "40 mm/mV", "100 mm/mV" }; -static int vsi = VSI; /* index (within vsc[] and vst[]) of current vscale */ -#define MAXVSI (sizeof(vsc)/sizeof(double) - 1) - -int find_next(); -int find_previous(); -int open_record(); -int open_annotation_file(); -void paint_main_window(); -void print_window(); -void set_title(); - -int PASCAL WinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow) -HANDLE hInstance; -HANDLE hPrevInstance; -LPSTR lpCmdLine; -int nCmdShow; -{ - static char *p, *q, rtemp[80], pstart[40], pdate[20]; - MSG msg; - extern int sscanf(); - - /* If specified, read the calibration file to get standard scales. */ - if (cfname[0] == '\0' && (p = getenv("WFDBCAL"))) { - strncpy(cfname, p, sizeof(cfname)-1); - calopen(cfname); - } - /* Set the default display scales. */ - tscale = tsc[TSI]; - vscale = vsc[VSI]; - - rtemp[0] = '\0'; - if (lpCmdLine) - sscanf(lpCmdLine, "%s%s%s%s", rtemp, annotator, pstart, pdate); - - /* Open the signal file(s) for the record to be browsed. */ - if (*rtemp) { - /* Convert upper case characters to lower case. */ - for (p = rtemp; *p; p++) - if ('A' <= *p && *p <= 'Z') *p += 'a' - 'A'; - /* Was the first argument actually a header file name? */ - if (strlen(rtemp) > 4 && - strcmp(rtemp+strlen(rtemp)-4, ".hea") == 0) { /* yes */ - /* Locate any drive/path prefix in the first argument. */ - for (p = rtemp, q = rtemp-1; *p != '.'; p++) - if (*p == ':' || *p == '\\') q = p; - /* Replace the '.' with a null to strip the '.hea' suffix. */ - *p = '\0'; - /* Extract the record name. */ - strncpy(record, q+1, sizeof(record)); - /* If there was a drive/path prefix, add it to the WFDB path. */ - if (q >= rtemp) { - size_t l = (size_t)(q-rtemp+1); - - strncpy(wfdbpath, rtemp, l); - wfdbpath[l] = ';'; - strncpy(wfdbpath+l+1, getwfdb(), sizeof(wfdbpath)-l); - setwfdb(wfdbpath); - } - } - else /* no */ - strncpy(record, rtemp, sizeof(record)); - open_record(); - } - - /* If specified, open the annotation file for the record. */ - if (*record && *annotator && *annotator != '-') - open_annotation_file(); - - /* If specified, set the start time. */ - if (*record && *pstart) { - if (*pstart == '[') { /* absolute time */ - tmode = 1; - if (*pdate) { - strcat(pstart, " "); - strcat(pstart, pdate); - } - if ((t0 = -strtim(pstart)) < 0L) - t0 = 0L; /* pstart precedes start of record; go to 0 */ - } - else - t0 = strtim(pstart); - } - - if (!hPrevInstance) - if (!InitApplication(hInstance)) - return (FALSE); - - if (!InitInstance(hInstance, nCmdShow)) - return (FALSE); - - while (GetMessage(&msg, NULL, NULL, NULL)) { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - - wfdbquit(); - return (msg.wParam); -} - -BOOL InitApplication(hInstance) -HANDLE hInstance; -{ - WNDCLASS wc; - - wc.style = CS_HREDRAW | CS_VREDRAW; - wc.lpfnWndProc = MainWndProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = hInstance; - wc.hIcon = LoadIcon(hInstance, "ecgicon"); - wc.hCursor = LoadCursor(NULL, IDC_ARROW); - wc.hbrBackground = GetStockObject(WHITE_BRUSH); - wc.lpszMenuName = "wviewmenu"; - wc.lpszClassName = "wviewclass"; - return (RegisterClass(&wc)); -} - -BOOL InitInstance(hInstance, nCmdShow) -HANDLE hInstance; -int nCmdShow; -{ - HWND hWnd; - - hInst = hInstance; - - set_title(); - hWnd = CreateWindow( - "wviewclass", - title, - WS_OVERLAPPEDWINDOW | WS_HSCROLL, - 0, - 0, - GetSystemMetrics(SM_CXSCREEN), - GetSystemMetrics(SM_CYSCREEN), - NULL, - NULL, - hInstance, - NULL - ); - if (!hWnd) - return (FALSE); - - if (*record == '\0') { - static FARPROC lpProcChoose; - - lpProcChoose = MakeProcInstance(Choose, hInst); - DialogBox(hInst, "ChooseBox", hWnd, lpProcChoose); - FreeProcInstance(lpProcChoose); - set_title(); - SetWindowText(hWnd, title); - } - - ShowWindow(hWnd, nCmdShow); - UpdateWindow(hWnd); - return (TRUE); -} - -static double xppmm, yppmm; /* display resolution */ -static double wwsec, whmv; /* window size in seconds (x) and mV (y) */ -static int bflag = 0; /* draw signal baselines if non-zero */ -static int gtflag = 1; /* draw time grid if non-zero */ -static int gvflag = 1; /* draw amplitude grid if non-zero */ -static int mflag = 0; /* draw marker bars if non-zero */ -static int nflag = 1; /* show signal names if non-zero */ -static int show_subtyp = 0, show_chan = 0, show_num = 0, show_aux = 0; -/* display respective fields of annotations if non-zero */ -static int wwidth, wheight; /* window size in pixels */ - -long FAR PASCAL MainWndProc(hWnd, message, wParam, lParam) -HWND hWnd; -UINT message; -WPARAM wParam; -LPARAM lParam; -{ - static FARPROC lpProcAbout; - static FARPROC lpProcChoose; - static FARPROC lpProcFind; - static FARPROC lpProcPrint; - static FARPROC lpProcPrintOptions; - static FARPROC lpProcViewOptions; - HDC hDC; - HMENU hMenu; - static int scrollpos = 0; /* scroll position (0 - 2048) */ - - switch (message) { - case WM_COMMAND: - hMenu = GetMenu(hWnd); - - switch (wParam) { - case IDM_OPEN: - lpProcChoose = MakeProcInstance(Choose, hInst); - if (DialogBox(hInst, "ChooseBox", hWnd, lpProcChoose)) - InvalidateRect(hWnd, NULL, TRUE); - FreeProcInstance(lpProcChoose); - set_title(); - SetWindowText(hWnd, title); - break; - case IDM_FIND: - lpProcFind = MakeProcInstance(Find, hInst); - if (DialogBox(hInst, "FindBox", hWnd, lpProcFind)) { - scrollpos = (int)(2048.*t0/tf); - SetScrollPos(hWnd, SB_HORZ, scrollpos, TRUE); - InvalidateRect(hWnd, NULL, TRUE); - } - FreeProcInstance(lpProcFind); - break; - case IDM_NEW: - case IDM_SAVE: - case IDM_SAVEAS: - case IDM_UNDO: - case IDM_CUT: - case IDM_COPY: - case IDM_PASTE: - case IDM_DEL: - MessageBox(hWnd, "Sorry, this command is not yet implemented!", - "WVIEW", MB_ICONEXCLAMATION | MB_OK); - break; - case IDM_EXIT: - SendMessage(hWnd, WM_CLOSE, 0, 0L); - break; - case IDM_HELP_INDEX: - WinHelp(hWnd, "wview.hlp", HELP_CONTENTS, 0L); - break; - case IDM_HELP_CHOOSING: - WinHelp(hWnd, "wview.hlp", HELP_CONTEXT, (long)Choosing_Topic); - break; - case IDM_HELP_BROWSING: - WinHelp(hWnd, "wview.hlp", HELP_CONTEXT, (long)Browsing_Topic); - break; - case IDM_HELP_OPTIONS: - WinHelp(hWnd, "wview.hlp", HELP_CONTEXT, (long)Options_Topic); - break; - case IDM_HELP_SEARCHING: - WinHelp(hWnd, "wview.hlp", HELP_CONTEXT, (long)Searching_Topic); - break; - case IDM_HELP_PRINTING: - WinHelp(hWnd, "wview.hlp", HELP_CONTEXT, (long)Printing_Topic); - break; - case IDM_ABOUT: - lpProcAbout = MakeProcInstance(About, hInst); - DialogBox(hInst, "AboutBox", hWnd, lpProcAbout); - FreeProcInstance(lpProcAbout); - break; - case IDM_PRINT: - lpProcPrint = MakeProcInstance(Print, hInst); - DialogBox(hInst, "PrintBox", hWnd, lpProcPrint); - FreeProcInstance(lpProcPrint); - break; - case IDM_VIEW: - lpProcViewOptions = MakeProcInstance(ViewOptions, hInst); - DialogBox(hInst, "ViewOptionsBox", hWnd, lpProcViewOptions); - FreeProcInstance(lpProcViewOptions); - InvalidateRect(hWnd, NULL, TRUE); - break; - case IDM_PROPT: - lpProcPrintOptions = MakeProcInstance(PrintOptions, hInst); - DialogBox(hInst, "PrintOptionsBox", hWnd, lpProcPrintOptions); - FreeProcInstance(lpProcPrintOptions); - break; - default: - return (DefWindowProc(hWnd, message, wParam, lParam)); - } - break; - - case WM_CREATE: - /* Create the pen objects. */ - signal_pen = CreatePen(PS_SOLID, 0, SIGNAL_COLOR); - grid_pen = CreatePen(PS_SOLID, 0, GRID_COLOR); - pgrid_pen = CreatePen(PS_DOT, 0, PGRID_COLOR); - marker_pen = CreatePen(PS_DOT, 0, MARKER_COLOR); - - hDC = GetDC(hWnd); - - /* Determine display resolution (pixels per millimeter in x and y). */ - xppmm = GetDeviceCaps(hDC,HORZRES)/(double)GetDeviceCaps(hDC,HORZSIZE); - yppmm = GetDeviceCaps(hDC,VERTRES)/(double)GetDeviceCaps(hDC,VERTSIZE); - - /* Get the size characteristics of the current font. */ - GetTextMetrics(hDC, &tm); - cheight = tm.tmExternalLeading + tm.tmHeight; - - ReleaseDC(hWnd, hDC); - break; - - case WM_SIZE: - wwidth = LOWORD(lParam); - wheight = HIWORD(lParam); - SetScrollRange(hWnd, SB_HORZ, 0, 2048, FALSE); - scrollpos = (int)(2048.*t0/tf); - SetScrollPos(hWnd, SB_HORZ, scrollpos, TRUE); - break; - - case WM_HSCROLL: - switch (wParam) { - case SB_TOP: - t0 = 0L; - break; - case SB_BOTTOM: - t0 = tf - (WFDB_Time)(wwsec*sps); - break; - case SB_LINEUP: - if ((t0 -= (WFDB_Time)sps) < 0L) t0 = 0L; - break; - case SB_LINEDOWN: - t0 += (WFDB_Time)sps; - break; - case SB_PAGEUP: - if ((t0 -= (WFDB_Time)(sps*(int)wwsec)) < 0L) t0 = 0L; - break; - case SB_PAGEDOWN: - t0 += (WFDB_Time)(sps*(int)wwsec); - break; - case SB_THUMBTRACK: /* events occur while dragging "thumb" */ - /* Show the time corresponding to the current thumb position. */ - { - char ts[30]; - int x, y; - - hDC = GetDC(hWnd); - SetBkMode(hDC, OPAQUE); - SetTextColor(hDC, MARKER_COLOR); - sprintf(ts, "<< %20s >>", - timstr(-(WFDB_Time)(tf*(LOWORD(lParam)/2048.)))); - x = 200; - y = ytr(5.) - tm.tmExternalLeading; - TextOut(hDC, x, y, ts, strlen(ts)); - ReleaseDC(hWnd, hDC); - } - return (NULL); /* do not redraw the entire window */ - case SB_THUMBPOSITION: /* event occurs when "thumb" is dropped */ - t0 = (WFDB_Time)(tf * (LOWORD(lParam)/2048.)); - if (t0 >= tf && tf > 0L) - t0 = tf - (WFDB_Time)(wwsec*sps); - break; - default: - return (NULL); - } - scrollpos = (int)(2048.*t0/tf); - SetScrollPos(hWnd, SB_HORZ, scrollpos, TRUE); - InvalidateRect(hWnd, NULL, TRUE); - break; - - case WM_KEYDOWN: - switch (wParam) { - case VK_HOME: /* key */ - SendMessage(hWnd, WM_HSCROLL, SB_TOP, 0L); - break; - case VK_END: /* key */ - SendMessage(hWnd, WM_HSCROLL, SB_BOTTOM, 0L); - break; - case VK_LEFT: /* */ - SendMessage(hWnd, WM_HSCROLL, SB_LINEUP, 0L); - break; - case VK_RIGHT: /* */ - SendMessage(hWnd, WM_HSCROLL, SB_LINEDOWN, 0L); - break; - case VK_PRIOR: /* */ - SendMessage(hWnd, WM_HSCROLL, SB_PAGEUP, 0L); - break; - case VK_NEXT: /* */ - SendMessage(hWnd, WM_HSCROLL, SB_PAGEDOWN, 0L); - break; - case VK_BACK: /* */ - switch (find_previous()) { - case 1: /* target found, reset scrollbar and redraw */ - scrollpos = (int)(2048.*t0/tf); - SetScrollPos(hWnd, SB_HORZ, scrollpos, TRUE); - InvalidateRect(hWnd, NULL, TRUE); - break; - case 0: /* not found, ignore */ - break; - case -1: /* no target defined, handle as for page up */ - SendMessage(hWnd, WM_HSCROLL, SB_PAGEUP, 0L); - break; - } - break; - case VK_RETURN: /* */ - switch (find_next()) { - case 1: /* target found, reset scrollbar and redraw */ - scrollpos = (int)(2048.*t0/tf); - SetScrollPos(hWnd, SB_HORZ, scrollpos, TRUE); - InvalidateRect(hWnd, NULL, TRUE); - break; - case 0: /* not found, ignore */ - break; - case -1: /* no target defined, handle as for page down */ - SendMessage(hWnd, WM_HSCROLL, SB_PAGEDOWN, 0L); - break; - } - break; - case VK_UP: /* : zoom in (increase time scale) */ - if (tsi < MAXTSI) { - tscale = tsc[++tsi]; - /* Adjust time of left edge such that the time of - the center of the window will be unchanged. */ - t0 += (WFDB_Time)(sps*wwidth/(2.*xppmm)* - (1./tsc[tsi-1] - 1./tscale)); - InvalidateRect(hWnd, NULL, TRUE); - } - break; - case VK_DOWN: /* : zoom out (decrease time scale) */ - if (tsi > 0) { - tscale = tsc[--tsi]; - /* Adjust time of left edge such that the time of - the center of the window will be unchanged. */ - t0 += (WFDB_Time)(sps*wwidth/(2.*xppmm)* - (1./tsc[tsi+1] - 1./tscale)); - if (t0 < 0L) t0 = 0L; - InvalidateRect(hWnd, NULL, TRUE); - } - break; - default: - break; - } - - case WM_CHAR: - switch (wParam) { - case '+': /* increase amplitude scale */ - if (vsi < MAXVSI) { - vscale = vsc[++vsi]; - InvalidateRect(hWnd, NULL, TRUE); - } - break; - case '-': /* decrease amplitude scale */ - if (vsi > 0) { - vscale = vsc[--vsi]; - InvalidateRect(hWnd, NULL, TRUE); - } - break; - default: - break; - } - break; - - case WM_PAINT: - paint_main_window(hWnd); - break; - - case WM_DESTROY: - DeleteObject(signal_pen); - DeleteObject(grid_pen); - DeleteObject(pgrid_pen); - DeleteObject(marker_pen); - if (hLibrary >= 32) FreeLibrary(hLibrary); - WinHelp(hWnd, "wview.hlp", HELP_QUIT, NULL); - PostQuitMessage(0); - break; - - default: - return (DefWindowProc(hWnd, message, wParam, lParam)); - } - return (NULL); -} - -BOOL FAR PASCAL Choose(hDlg, message, wParam, lParam) -HWND hDlg; -unsigned message; -WORD wParam; -LONG lParam; -{ - static char rtemp[200], *r, *s, *t; - - switch (message) { - case WM_INITDIALOG: - SetDlgItemText(hDlg, IDD_RECORD, record); - SetDlgItemText(hDlg, IDD_ANNOTATOR, annotator); - if ((t = getwfdb()) != wfdbpath) { - strncpy(wfdbpath, t, sizeof(wfdbpath)-1); - setwfdb(wfdbpath); /* *** 16 July 2003 (GBM). This call is - necessary for WFDB 10.3.9 and later, in - which setwfdb keeps its own copy of the - WFDB path. */ - } - SetDlgItemText(hDlg, IDD_WFDBPATH, wfdbpath); - SetDlgItemText(hDlg, IDD_WFDBCAL, cfname); - return (TRUE); - - case WM_COMMAND: - switch (wParam) { - case IDOK: - GetDlgItemText(hDlg, IDD_RECORD, rtemp, sizeof(rtemp)-1); - for (t = rtemp; t < rtemp+20 && *t == ' '; t++) ; - for (r = record; t < rtemp+20 && *t && *t != ' '; *r++ = *t++) ; - if (r > record) *r = '\0'; - GetDlgItemText(hDlg, IDD_ANNOTATOR, rtemp, sizeof(rtemp)-1); - for (t = rtemp; t < rtemp+20 && *t == ' '; t++) ; - for (s = annotator; t < rtemp+20 && *t && *t != ' '; *s++ = *t++) ; - if (s > annotator) *s = '\0'; - GetDlgItemText(hDlg, IDD_WFDBPATH, rtemp, sizeof(rtemp)-1); - for (t = rtemp; t < rtemp+200 && *t == ' '; t++) ; - if (strcmp(wfdbpath, t)) { - strcpy(wfdbpath, t); - setwfdb(wfdbpath); - } - GetDlgItemText(hDlg, IDD_WFDBCAL, rtemp, sizeof(rtemp)-1); - for (t = rtemp; t < rtemp+200 && *t == ' '; t++) ; - if (strcmp(cfname, t)) { - strcpy(cfname, t); - calopen(cfname); - } - if (r > record || s > annotator) { open_record(); nann = 0; } - if (s > annotator) open_annotation_file(); - EndDialog(hDlg, 1); - return (TRUE); - - case IDCANCEL: - EndDialog(hDlg, 0); - return (TRUE); - - default: - return (FALSE); - } - break; - } - return (FALSE); -} - -int strnsubtyp(s) -char *s; -{ - int i = 0; - - while (*s) { - i <<= 1; - switch (*s) { - case 'n': i |= 1; break; - case 'u': i |= 0x11; break; - case 'U': return (-1); - default: break; - } - s++; - } - return (i); -} - -static int match_anntyp, match_subtyp, match_chan, match_num, match_aux; - -void asparse(char *s, WFDB_Annotation *annp) -{ - match_anntyp = match_subtyp = match_chan = match_num = match_aux = FALSE; - if ((annp->anntyp = strann(s)) == NOTQRS) { - switch (*s) { - case 'c': /* search for a signal quality annotation */ - case 'n': - case 'u': - case 'U': - annp->anntyp = NOISE; - annp->subtyp = strnsubtyp(s); - match_anntyp = match_subtyp = TRUE; - break; - case '*': /* accept any annotation as a match */ - case '\0': - break; - default: /* match aux field only */ - *(s-1) = strlen(s); - annp->aux = s-1; - match_aux = TRUE; - break; - } - } - else - match_anntyp = TRUE; -} - -int match(WFDB_Annotation *annp, WFDB_Annotation*temp) -{ - return ((!match_anntyp || annp->anntyp == temp->anntyp) && - (!match_subtyp || annp->subtyp == temp->subtyp) && - /* (!match_chan || annp->chan == temp->chan ) && - (!match_num || annp->num == temp->num ) && */ - (!match_aux || (annp->aux && - strncmp(annp->aux+1,temp->aux+1,*(temp->aux)) == 0))); -} - -static char fns[20], fps[20]; - -int find_next() -{ - WFDB_Annotation annot, target; - - if (fns[1] == '\0') return (-1); - asparse(fns+1, &target); - while (getann(0, &annot) == 0) - if (match(&annot, &target) && annot.time > t1) { - t0 = annot.time - (t1-t0)/2L; - if (t0 < 0L) t0 = 0L; - return (1); - } - return (0); -} - -int find_previous() -{ - WFDB_Annotation annot, target; - WFDB_Time ts = -1L; - - if (fps[1] == '\0') return (-1); - asparse(fps+1, &target); - iannsettime(0L); - while (getann(0, &annot) == 0 && annot.time < t0) - if (match(&annot, &target)) - ts = annot.time; - if (ts >= 0L) { - t0 = ts - (t1-t0)/2L; - if (t0 < 0L) t0 = 0L; - return (1); - } - return (0); -} - -BOOL FAR PASCAL Find(hDlg, message, wParam, lParam) -HWND hDlg; -unsigned message; -WORD wParam; -LONG lParam; -{ - static char rcs[20]; - static WORD find_mode = IDD_RECENTER; - - switch (message) { - case WM_INITDIALOG: - CheckRadioButton(hDlg, IDD_FINDN, IDD_RECENTER, find_mode); - SetDlgItemText(hDlg, IDD_FNTYPE, fns+1); - SetDlgItemText(hDlg, IDD_FPTYPE, fps+1); - SetDlgItemText(hDlg, IDD_RCTIME, rcs); - return (TRUE); - - case WM_COMMAND: - switch (wParam) { - case IDD_FINDN: - case IDD_FINDP: - case IDD_RECENTER: - CheckRadioButton(hDlg, IDD_FINDN, IDD_RECENTER, find_mode=wParam); - break; - case IDOK: - switch (find_mode) { - case IDD_FINDN: - GetDlgItemText(hDlg, IDD_FNTYPE, fns+1, sizeof(fns)-2); - if (find_next() > 0) { - EndDialog(hDlg, 1); - return (TRUE); - } - return (FALSE); - - case IDD_FINDP: - GetDlgItemText(hDlg, IDD_FPTYPE, fps+1, sizeof(fps)-2); - if (find_previous() > 0) { - EndDialog(hDlg, 1); - return (TRUE); - } - return (FALSE); - - case IDD_RECENTER: - GetDlgItemText(hDlg, IDD_RCTIME, rcs, sizeof(rcs)-1); - t0 = strtim(rcs) - (t1-t0)/2L; - if (t0 < 0L) t0 = 0L; - EndDialog(hDlg, 1); - return (TRUE); - } - break; - case IDCANCEL: - EndDialog(hDlg, 0); - return (TRUE); - - default: - return (FALSE); - } - break; - } - return (FALSE); -} - -BOOL FAR PASCAL About(hDlg, message, wParam, lParam) -HWND hDlg; -unsigned message; -WORD wParam; -LONG lParam; -{ - switch (message) { - case WM_INITDIALOG: - return (TRUE); - - case WM_COMMAND: - if (wParam == IDOK || wParam == IDCANCEL) { - EndDialog(hDlg, TRUE); - return (TRUE); - } - break; - } - return (FALSE); -} - -HDC GetPrinterDC(char *device) -{ - char devspec[80], *driver, *output; - - GetProfileString("devices", device, "", devspec, sizeof(devspec)); - if ((driver = strtok(devspec, ", ")) && - (output = strtok(NULL, ", "))) - return (CreateDC(driver, device, output, NULL)); - else - return ((HDC)0); -} - -typedef VOID (FAR PASCAL *DEVMODEPROC) (HWND, HANDLE, LPSTR, LPSTR); - -void printer_setup(HWND hWnd, char *printer) -{ - static char driver[16], drivername[20], *output; - DEVMODEPROC devmodeproc; - - GetProfileString("devices", printer, "", driver, sizeof(driver)); - output = strtok(driver, ", "); - sprintf(drivername, "%s.DRV", driver); - if (hLibrary >= 32) FreeLibrary(hLibrary); - hLibrary = LoadLibrary(drivername); - if (hLibrary >= 32) { - devmodeproc = (DEVMODEPROC)GetProcAddress(hLibrary, "DEVICEMODE"); - devmodeproc(hWnd, hLibrary, printer, output); - } -} - -WFDB_Time pt0, pt1; -WORD collate = 1, ncopies = 1, print_to_file = 0; - -BOOL FAR PASCAL Print(hDlg, message, wParam, lParam) -HWND hDlg; -unsigned message; -WORD wParam; -LONG lParam; -{ - unsigned int i; - static char *adp, alldev[4096], curdev[80], *printer, prtst[40], - *driver, *output, cprdevstr[80], *tprinter; - static FARPROC lpProcPrintOptions; - static WORD print_range = IDD_PRWIN, tprint_range = IDD_PRWIN; - HWND hlist; - - switch (message) { - case WM_INITDIALOG: - CheckRadioButton(hDlg, IDD_PRREC, IDD_PRSEG, print_range); - EnableWindow(GetDlgItem(hDlg, IDD_PRFLABEL), print_range == IDD_PRSEG); - EnableWindow(GetDlgItem(hDlg, IDD_PRFROM), print_range == IDD_PRSEG); - EnableWindow(GetDlgItem(hDlg, IDD_PRTLABEL), print_range == IDD_PRSEG); - EnableWindow(GetDlgItem(hDlg, IDD_PRTO), print_range == IDD_PRSEG); - if (print_range == IDD_PRSEG) { - SetDlgItemText(hDlg, IDD_PRFROM, mstimstr(pt0)); - SetDlgItemText(hDlg, IDD_PRTO, mstimstr(pt1)); - } - CheckDlgButton(hDlg, IDD_PFILE, print_to_file); - CheckDlgButton(hDlg, IDD_PCOLLATE, collate); - SetDlgItemInt(hDlg, IDD_PCOPIES, ncopies, FALSE); - hlist = GetDlgItem(hDlg, IDD_PPRINTER); - if (printer == NULL) { - GetProfileString("windows", "device", "...", curdev, - sizeof(curdev)); - if ((printer = strtok(curdev, ",")) && - (driver = strtok(NULL, ", ")) && - (output = strtok(NULL, ", "))) - sprintf(cprdevstr, "%s on %s", printer, output); - } - if (*cprdevstr) { - SendMessage(hlist, CB_ADDSTRING, 0, (LONG)(LPSTR)cprdevstr); - SendMessage(hlist, CB_SETCURSEL, 0, 0L); - } - GetProfileString("devices", NULL, "", alldev, sizeof(alldev)); - for (adp = alldev; *adp; adp += strlen(adp) + 1) { - char devspec[80], prdevstr[80]; - - GetProfileString("devices", adp, "", devspec, sizeof(devspec)); - if ((driver = strtok(devspec, ", ")) && - (output = strtok(NULL, ", "))) { - sprintf(prdevstr, "%s on %s", adp, output); - if (strcmp(prdevstr, cprdevstr)) - SendMessage(hlist, CB_ADDSTRING, 0, (LONG)(LPSTR)prdevstr); - } - } - return (TRUE); - - case WM_COMMAND: - switch (wParam) { - case IDD_POPTIONS: - lpProcPrintOptions = MakeProcInstance(PrintOptions, hInst); - DialogBox(hInst, "PrintOptionsBox", hDlg, lpProcPrintOptions); - FreeProcInstance(lpProcPrintOptions); - break; - case IDD_PRSEG: - if (!IsWindowEnabled(GetDlgItem(hDlg, IDD_PRFROM))) { - EnableWindow(GetDlgItem(hDlg, IDD_PRFLABEL), TRUE); - EnableWindow(GetDlgItem(hDlg, IDD_PRFROM), TRUE); - EnableWindow(GetDlgItem(hDlg, IDD_PRTLABEL), TRUE); - EnableWindow(GetDlgItem(hDlg, IDD_PRTO), TRUE); - } - CheckRadioButton(hDlg, IDD_PRREC, IDD_PRSEG, tprint_range=wParam); - break; - case IDD_PRWIN: - case IDD_PRREC: - if (IsWindowEnabled(GetDlgItem(hDlg, IDD_PRFROM))) { - EnableWindow(GetDlgItem(hDlg, IDD_PRFLABEL), FALSE); - EnableWindow(GetDlgItem(hDlg, IDD_PRFROM), FALSE); - EnableWindow(GetDlgItem(hDlg, IDD_PRTLABEL), FALSE); - EnableWindow(GetDlgItem(hDlg, IDD_PRTO), FALSE); - } - CheckRadioButton(hDlg, IDD_PRREC, IDD_PRSEG, tprint_range=wParam); - break; - case IDD_PSETUP: - GetDlgItemText(hDlg, IDD_PPRINTER, curdev, sizeof(curdev)); - for (adp = alldev; *adp; adp += strlen(adp) + 1) - if (strncmp(curdev, adp, strlen(adp)) == 0) - tprinter = adp; - printer_setup(hDlg, tprinter); - break; - case IDOK: - GetDlgItemText(hDlg, IDD_PPRINTER, curdev, sizeof(curdev)); - if (curdev != cprdevstr) strcpy(cprdevstr, curdev); - for (adp = alldev; *adp; adp += strlen(adp) + 1) - if (strncmp(curdev, adp, strlen(adp)) == 0) - printer = adp; - print_to_file = IsDlgButtonChecked(hDlg, IDD_PFILE); - collate = IsDlgButtonChecked(hDlg, IDD_PCOLLATE); - switch (print_range = tprint_range) { - case IDD_PRREC: - pt0 = 0L; - pt1 = tf; - break; - case IDD_PRWIN: - default: - pt0 = t0; - pt1 = t1; - break; - case IDD_PRSEG: - GetDlgItemText(hDlg, IDD_PRFROM, prtst, sizeof(prtst)); - pt0 = strtim(prtst); - GetDlgItemText(hDlg, IDD_PRTO, prtst, sizeof(prtst)); - pt1 = strtim(prtst); - if (pt0 < 0L) pt0 = -pt0; - if (pt1 < 0L) pt1 = -pt1; - if (pt0 >= pt1) pt1 = pt0 + t1-t0; - break; - } - ncopies = GetDlgItemInt(hDlg, IDD_PCOPIES, NULL, FALSE); - if (ncopies > MAXCOPIES) ncopies = MAXCOPIES; - else if (ncopies < 1) ncopies = 1; - for (i = 0; i < ncopies; i++) - print_window(hDlg, printer); - EndDialog(hDlg, TRUE); - return (TRUE); - break; - case IDCANCEL: - EndDialog(hDlg, TRUE); - return (TRUE); - break; - } - } - return (FALSE); -} - -static char pcomments[80]; -static double ptscale = 25.0, pvscale = 10.0; -static int pbflag = 1, pgtflag = 1, pgvflag = 1, pmflag = 0, pnflag = 1, - pshow_subtyp = 0, pshow_chan = 0, pshow_num = 0, pshow_aux = 0, - ptsi = TSI, pvsi = VSI, ptmode = 0; - -void copy_display_options() -{ - ptscale = tsc[ptsi = tsi]; /* time scale */ - pvscale = vsc[pvsi = vsi]; /* amplitude scale */ - pbflag = bflag; /* signal baselines */ - pgtflag = gtflag; /* time grid */ - pgvflag = gvflag; /* amplitude grid */ - pmflag = mflag; /* markers */ - pnflag = nflag; /* signal names */ - pshow_subtyp = show_subtyp; /* annotation subtypes */ - pshow_chan = show_chan; /* annotation chan fields */ - pshow_num = show_num; /* annotation num fields */ - pshow_aux = show_aux; /* annotation aux fields */ - ptmode = tmode; /* time display mode */ -} - -BOOL FAR PASCAL PrintOptions(hDlg, message, wParam, lParam) -HWND hDlg; -unsigned message; -WORD wParam; -LONG lParam; -{ - int i; - static int use_display_options = 1; - HWND hlist; - - switch (message) { - case WM_INITDIALOG: - CheckDlgButton(hDlg, IDD_PODEF, use_display_options); - if (use_display_options) copy_display_options(); - hlist = GetDlgItem(hDlg, IDD_POSTIME); - for (i = 0; i <= MAXTSI; i++) - SendMessage(hlist, CB_ADDSTRING, 0, (LONG)(LPSTR)tst[i]); - SendMessage(hlist, CB_SETCURSEL, ptsi, 0L); - hlist = GetDlgItem(hDlg, IDD_POSAMP); - for (i = 0; i <= MAXVSI; i++) - SendMessage(hlist, CB_ADDSTRING, 0, (LONG)(LPSTR)vst[i]); - SendMessage(hlist, CB_SETCURSEL, pvsi, 0L); - CheckDlgButton(hDlg, IDD_POGTIME, pgtflag); - CheckDlgButton(hDlg, IDD_POGAMP, pgvflag); - CheckDlgButton(hDlg, IDD_POAMARK, pmflag); - CheckDlgButton(hDlg, IDD_POASUB, pshow_subtyp); - CheckDlgButton(hDlg, IDD_POACHAN, pshow_chan); - CheckDlgButton(hDlg, IDD_POANUM, pshow_num); - CheckDlgButton(hDlg, IDD_POAAUX, pshow_aux); - CheckDlgButton(hDlg, IDD_POOSB, pbflag); - CheckDlgButton(hDlg, IDD_POOSN, pnflag); - CheckDlgButton(hDlg, IDD_POTMODE, ptmode); - return (TRUE); - - case WM_COMMAND: - switch (wParam) { - case IDD_PODEF: - use_display_options = IsDlgButtonChecked(hDlg, IDD_PODEF); - if (use_display_options) { - copy_display_options(); - hlist = GetDlgItem(hDlg, IDD_POSTIME); - SendMessage(hlist, CB_SETCURSEL, ptsi, 0L); - hlist = GetDlgItem(hDlg, IDD_POSAMP); - SendMessage(hlist, CB_SETCURSEL, pvsi, 0L); - CheckDlgButton(hDlg, IDD_POGTIME, pgtflag); - CheckDlgButton(hDlg, IDD_POGAMP, pgvflag); - CheckDlgButton(hDlg, IDD_POAMARK, pmflag); - CheckDlgButton(hDlg, IDD_POASUB, pshow_subtyp); - CheckDlgButton(hDlg, IDD_POACHAN, pshow_chan); - CheckDlgButton(hDlg, IDD_POANUM, pshow_num); - CheckDlgButton(hDlg, IDD_POAAUX, pshow_aux); - CheckDlgButton(hDlg, IDD_POOSB, pbflag); - CheckDlgButton(hDlg, IDD_POOSN, pnflag); - CheckDlgButton(hDlg, IDD_POTMODE, ptmode); - } - break; - case IDD_POSTIME: - case IDD_POSAMP: - case IDD_POGTIME: - case IDD_POGAMP: - case IDD_POAMARK: - case IDD_POASUB: - case IDD_POACHAN: - case IDD_POANUM: - case IDD_POAAUX: - case IDD_POOSB: - case IDD_POOSN: - case IDD_POTMODE: - CheckDlgButton(hDlg, IDD_PODEF, use_display_options = 0); - break; - case IDD_POHELP: - WinHelp(hDlg, "wview.hlp", HELP_CONTEXT, (long)Options_Topic); - break; - case IDOK: - hlist = GetDlgItem(hDlg, IDD_POSTIME); - i = (int)SendMessage(hlist, CB_GETCURSEL, 0, 0L); - if (0 <= i && i <= MAXTSI) - ptscale = tsc[ptsi = i]; - hlist = GetDlgItem(hDlg, IDD_POSAMP); - i = (int)SendMessage(hlist, CB_GETCURSEL, 0, 0L); - if (0 <= i && i <= MAXVSI) - pvscale = vsc[pvsi = i]; - pgtflag = IsDlgButtonChecked(hDlg, IDD_POGTIME); - pgvflag = IsDlgButtonChecked(hDlg, IDD_POGAMP); - pmflag = IsDlgButtonChecked(hDlg, IDD_POAMARK); - pshow_subtyp = IsDlgButtonChecked(hDlg, IDD_POASUB); - pshow_chan = IsDlgButtonChecked(hDlg, IDD_POACHAN); - pshow_num = IsDlgButtonChecked(hDlg, IDD_POANUM); - pshow_aux = IsDlgButtonChecked(hDlg, IDD_POAAUX); - pbflag = IsDlgButtonChecked(hDlg, IDD_POOSB); - pnflag = IsDlgButtonChecked(hDlg, IDD_POOSN); - ptmode = IsDlgButtonChecked(hDlg, IDD_POTMODE); - EndDialog(hDlg, TRUE); - return (TRUE); - case IDCANCEL: - EndDialog(hDlg, TRUE); - return (TRUE); - } - break; - } - return (FALSE); -} - -void copy_default_options() -{ - tscale = tsc[tsi = TSI]; /* time scale */ - vscale = vsc[vsi = VSI]; /* amplitude scale */ - bflag = 0; /* signal baselines */ - gtflag = 1; /* time grid */ - gvflag = 1; /* amplitude grid */ - mflag = 0; /* markers */ - nflag = 1; /* signal names */ - show_subtyp = 0; /* annotation subtypes */ - show_chan = 0; /* annotation chan fields */ - show_num = 0; /* annotation num fields */ - show_aux = 0; /* annotation aux fields */ -} - -BOOL FAR PASCAL ViewOptions(hDlg, message, wParam, lParam) -HWND hDlg; -unsigned message; -WORD wParam; -LONG lParam; -{ - int i; - static int use_default_options = 1; - HWND hlist; - - switch (message) { - case WM_INITDIALOG: - CheckDlgButton(hDlg, IDD_VODEF, use_default_options); - if (use_default_options) copy_default_options(); - hlist = GetDlgItem(hDlg, IDD_VOSTIME); - for (i = 0; i <= MAXTSI; i++) - SendMessage(hlist, CB_ADDSTRING, 0, (LONG)(LPSTR)tst[i]); - SendMessage(hlist, CB_SETCURSEL, tsi, 0L); - hlist = GetDlgItem(hDlg, IDD_VOSAMP); - for (i = 0; i <= MAXVSI; i++) - SendMessage(hlist, CB_ADDSTRING, 0, (LONG)(LPSTR)vst[i]); - SendMessage(hlist, CB_SETCURSEL, vsi, 0L); - CheckDlgButton(hDlg, IDD_VOGTIME, gtflag); - CheckDlgButton(hDlg, IDD_VOGAMP, gvflag); - CheckDlgButton(hDlg, IDD_VOAMARK, mflag); - CheckDlgButton(hDlg, IDD_VOASUB, show_subtyp); - CheckDlgButton(hDlg, IDD_VOACHAN, show_chan); - CheckDlgButton(hDlg, IDD_VOANUM, show_num); - CheckDlgButton(hDlg, IDD_VOAAUX, show_aux); - CheckDlgButton(hDlg, IDD_VOOSB, bflag); - CheckDlgButton(hDlg, IDD_VOOSN, nflag); - CheckDlgButton(hDlg, IDD_VOTMODE, tmode); - return (TRUE); - - case WM_COMMAND: - switch (wParam) { - case IDD_VODEF: - use_default_options = IsDlgButtonChecked(hDlg, IDD_VODEF); - if (use_default_options) { - copy_default_options(); - hlist = GetDlgItem(hDlg, IDD_VOSTIME); - SendMessage(hlist, CB_SETCURSEL, tsi, 0L); - hlist = GetDlgItem(hDlg, IDD_VOSAMP); - SendMessage(hlist, CB_SETCURSEL, vsi, 0L); - CheckDlgButton(hDlg, IDD_VOGTIME, gtflag); - CheckDlgButton(hDlg, IDD_VOGAMP, gvflag); - CheckDlgButton(hDlg, IDD_VOAMARK, mflag); - CheckDlgButton(hDlg, IDD_VOASUB, show_subtyp); - CheckDlgButton(hDlg, IDD_VOACHAN, show_chan); - CheckDlgButton(hDlg, IDD_VOANUM, show_num); - CheckDlgButton(hDlg, IDD_VOAAUX, show_aux); - CheckDlgButton(hDlg, IDD_VOOSB, bflag); - CheckDlgButton(hDlg, IDD_VOOSN, nflag); - CheckDlgButton(hDlg, IDD_VOTMODE, tmode); - } - break; - case IDD_VOSTIME: - case IDD_VOSAMP: - case IDD_VOGTIME: - case IDD_VOGAMP: - case IDD_VOAMARK: - case IDD_VOASUB: - case IDD_VOACHAN: - case IDD_VOANUM: - case IDD_VOAAUX: - case IDD_VOOSB: - case IDD_VOOSN: - case IDD_VOTMODE: - CheckDlgButton(hDlg, IDD_VODEF, use_default_options = 0); - break; - case IDD_VOHELP: - WinHelp(hDlg, "wview.hlp", HELP_CONTEXT, (long)Options_Topic); - break; - case IDOK: - hlist = GetDlgItem(hDlg, IDD_VOSTIME); - i = (int)SendMessage(hlist, CB_GETCURSEL, 0, 0L); - if (0 <= i && i <= MAXTSI) - tscale = tsc[tsi = i]; - hlist = GetDlgItem(hDlg, IDD_VOSAMP); - i = (int)SendMessage(hlist, CB_GETCURSEL, 0, 0L); - if (0 <= i && i <= MAXVSI) - vscale = vsc[vsi = i]; - gtflag = IsDlgButtonChecked(hDlg, IDD_VOGTIME); - gvflag = IsDlgButtonChecked(hDlg, IDD_VOGAMP); - mflag = IsDlgButtonChecked(hDlg, IDD_VOAMARK); - show_subtyp = IsDlgButtonChecked(hDlg, IDD_VOASUB); - show_chan = IsDlgButtonChecked(hDlg, IDD_VOACHAN); - show_num = IsDlgButtonChecked(hDlg, IDD_VOANUM); - show_aux = IsDlgButtonChecked(hDlg, IDD_VOAAUX); - bflag = IsDlgButtonChecked(hDlg, IDD_VOOSB); - nflag = IsDlgButtonChecked(hDlg, IDD_VOOSN); - tmode = IsDlgButtonChecked(hDlg, IDD_VOTMODE); - EndDialog(hDlg, TRUE); - return (TRUE); - case IDCANCEL: - EndDialog(hDlg, TRUE); - return (TRUE); - } - break; - } - return (FALSE); -} - -open_record() -{ - char *s; - int i; - WFDB_Calinfo ci; - - /* Save the current time in string format. */ - if (t0 > 0L) s = timstr(t0); - wfdbquit(); - - /* Open the signal file(s) for the record to be browsed. */ - nsig = isigopen(record, si, WFDB_MAXSIG); - - /* Recalculate the current time (necessary if the sampling frequencies - of the new record and the old record differ). */ - if (t0 > 0L) t0 = strtim(s); - - /* Get the sampling frequency. */ - if ((sps = sampfreq(NULL)) <= 0.) sps = WFDB_DEFFREQ; - - /* Get the record length. Since the scrollbar units are determined - from the record length, this must be non-zero; if the length of - the chosen record is undefined or implausibly short, assume it is - 30 minutes. */ - if ((tf = strtim("e")) <= 0L && (tf = si[0].nsamp) < sps*10.) - tf = (long)(sps*1800.); - - for (i = 0; i < nsig; i++) { - sg[i] = (si[i].gain != 0.0) ? si[i].gain : WFDB_DEFGAIN; - if (getcal(si[i].desc, si[i].units, &ci) == 0 && ci.scale != 0.0) - sg[i] *= ci.scale; - } - - return (nsig); -} - -int open_annotation_file() -{ - static WFDB_Anninfo ai; - - ai.name = annotator; ai.stat = WFDB_READ; - return (nann = annopen(record, &ai, 1) + 1); -} - -void set_title() -{ - if (*record && nann > 0) - sprintf(title, "WVIEW -- Record %s, Annotator %s", - record, annotator); - else if (*record) - sprintf(title, "WVIEW -- Record %s", record); - else - sprintf(title, "WVIEW"); -} - -void paint_main_window(hWnd) -HWND hWnd; -{ - char *p, ts[30]; - double xppsi, yppadu[WFDB_MAXSIG], ysc; - DWORD dwextent; - HDC hDC; - HPEN hOldPen; - int base[WFDB_MAXSIG], compress = 0, j, s, slen, tbhigh, tblow, tbmid, - *v, *vp, vmax[WFDB_MAXSIG], vmin[WFDB_MAXSIG], v0, x, y, yb; - long i, trlen; - PAINTSTRUCT ps; - - /* Set up a display context to begin painting. */ - hDC = BeginPaint(hWnd, &ps); - - /* Determine the window size in sec and mV. */ - wwsec = wwidth/(tscale*xppmm); - whmv = wheight/(vscale*yppmm); - - /* Calculate the time scale in pixels per sample interval. */ - xppsi = xppmm * tscale / sps; - - /* Draw in transparent mode (do not clear spaces around letters, - etc., to white). */ - SetBkMode(hDC, TRANSPARENT); - - /* Draw the grid, if requested. */ - hOldPen = SelectObject(hDC, grid_pen); - if (gtflag) { - double gdx = xppmm*tscale/GTICKSPERSEC; - int i; - - for (i = 1, x = (int)gdx; x < wwidth; i++, x = (int)(i*gdx)) { - MoveTo(hDC, x, 0); - LineTo(hDC, x, wheight - 1); - } - } - if (gvflag) { - double gdy = yppmm*vscale/GTICKSPERMV; - int i; - - for (i = 1, y = (int)gdy; y < wheight; i++, y = (int)(i*gdy)){ - MoveTo(hDC, 0, y); - LineTo(hDC, wwidth - 1, y); - } - } - - if (nsig > 0 || nann > 0) { - /* Set color for time stamps and signal names. */ - SetTextColor(hDC, SIGNAL_COLOR); - - /* Show the starting time in the lower left corner. */ - slen = sprintf(ts, "%s", timstr(tmode ? -t0 : t0)); - for (p = ts; *p == ' '; p++, slen--) - ; /* discard initial spaces, if any */ - x = xtr(2.); - y = ytr(5.) - tm.tmExternalLeading; - TextOut(hDC, x, y, p, slen); - - /* Determine the ending time. */ - t1 = t0 + (WFDB_Time)(sps*(int)wwsec); - - /* Show the ending time in the lower right corner. */ - slen = sprintf(ts, "%s", timstr(tmode ? -t1 : t1)); - for (p = ts; *p == ' '; p++, slen--) - ; /* discard initial spaces, if any */ - dwextent = GetTextExtent(hDC, p, slen); - x = xt(sps*(int)wwsec) - LOWORD(dwextent) - xtr(2.); - TextOut(hDC, x, y, p, slen); - } - - if (nsig < 1) - tbmid = wheight/2; /* Set standard ordinate for annotations. */ - else { /* Draw signals. */ - /* Determine signal amplitude scales and baselines. */ - for (s = 0; s < nsig; s++) { - yppadu[s] = (yppmm * vscale) / sg[s]; - base[s] = ((2*s+1)*wheight)/(2*nsig); - vmin[s] = 9999; vmax[s] = -9999; - } - tbmid = (nsig==1)?(int)(0.75*wheight):(base[nsig/2-1]+base[nsig/2])/2; - - /* Allocate the signal buffer. */ - trlen = (long)(wwsec * sps); - if (xppsi < 0.75) { - compress = 1; - while ((v=malloc((unsigned)(1.5*wwidth*nsig*sizeof(int))))==NULL) - wwidth /= 2; - } - else while ((v = malloc((unsigned)(trlen*nsig*sizeof(int)))) == NULL) - trlen -= (long)(sps/5.); - - /* Skip to the starting time. */ - isigsettime(t0); - - if (compress) { - static int x0, vv0[WFDB_MAXSIG], vmn[WFDB_MAXSIG], - vmx[WFDB_MAXSIG], vv[WFDB_MAXSIG]; - - getvec(vp = v); - for (s = 0; s < nsig; s++) - vmax[s] = vmin[s] = vmn[s] = vmx[s] = vv0[s] = vp[s]; - for (i = 1, x0 = 0; i < trlen && getvec(vv) > 0; i++) { - int xx; - if ((xx = (int)(i*xppsi)) > x0) { - x0 = xx; - vp += nsig; - for (s = 0; s < nsig; s++) { - if (vv[s] > vmx[s]) vmx[s] = vv[s]; - else if (vv[s] < vmn[s]) vmn[s] = vv[s]; - if (vmx[s] - vv0[s] > vv0[s] - vmn[s]) - vv0[s] = vmn[s] = vmx[s]; - else - vv0[s] = vmx[s] = vmn[s]; - if ((vp[s] = vv0[s]) > vmax[s]) vmax[s] = vp[s]; - else if (vp[s] < vmin[s]) vmin[s] = vp[s]; - } - } - else { - for (s = 0; s < nsig; s++) { - if (vv[s] > vmx[s]) vmx[s] = vv[s]; - else if (vv[s] < vmn[s]) vmn[s] = vv[s]; - } - } - } - i = (vp - v)/nsig; - } - else { - for (i = 0, vp = v; i < trlen; i++, vp += nsig) { - if (getvec(vp) < nsig) break; - for (s = 0; s < nsig; s++) { - if (vp[s] < vmin[s]) vmin[s] = vp[s]; - else if (vp[s] > vmax[s]) vmax[s] = vp[s]; - } - } - } - - SelectObject(hDC, signal_pen); - for (s = 0; s < nsig; s++) { - yb = base[s]; - v0 = (vmax[s] + vmin[s])/2; - ysc = yppadu[s]; - if (nflag) - TextOut(hDC, xtr(1.), (int)(yb - yppmm*10), si[s].desc, - strlen(si[s].desc)); - vp = v+s; - MoveTo(hDC, 0, yt(*vp - v0)); - vp += nsig; - if (compress) - for (j = 1; j < i; j++, vp += nsig) - LineTo(hDC, j, yt(*vp - v0)); - else - for (j = 1; j < i; j++, vp += nsig) - LineTo(hDC, xt(j), yt(*vp - v0)); - vmax[s] = -9999; vmin[s] = 9999; - } - - /* Free the signal buffer. (This is not strictly necessary for a large - memory model Windows program, since the version of malloc used in - this case allocates memory from the automatic data segment.) */ - free(v); - } - - if (nann > 0) { /* Show annotations. */ - WFDB_Annotation annot; - - iannsettime(t0); - if (t0 == 0L) { /* skip modification labels */ - int i; - - while ((i = getann(0, &annot)) == 0 && - annot.time == 0L && annot.anntyp == NOTE) - ; - if (i == 0) ungetann(0, &annot); - } - if (mflag) SelectObject(hDC, marker_pen); - SetTextColor(hDC, MARKER_COLOR); - tbhigh = tbmid - cheight; - tblow = tbmid + cheight; - do { - if (getann(0, &annot) < 0) break; - switch (annot.anntyp) { - case RHYTHM: - y = tblow; - if (annot.aux && !show_aux) - p = annot.aux+1; - else - p = annstr(annot.anntyp); - break; - case STCH: - case TCH: - case NOTE: - y = tbhigh; - if (annot.aux && !show_aux) - p = annot.aux+1; - else - p = annstr(annot.anntyp); - break; - case LINK: - y = tbhigh; - if (annot.aux && !show_aux) { - char *p1 = annot.aux+1, *p2 = p1 + *(p1-1); - p = p1; - while (p1 < p2) { - if (*p1 == ' ' || *p1 == '\t') { - p = p1 + 1; - break; - } - p1++; - } - SetTextColor(hDC, SIGNAL_COLOR); - } - break; - case NOISE: - y = tbhigh; - if (annot.subtyp == -1) { p = "U"; break; } - /* The existing scheme is good for up to 4 signals; it can - be easily extended to 8 or 12 signals using the chan and - num fields, or to an arbitrary number of signals using - `aux'. */ - for (s = 0; s < nsig && s < 4; s++) { - if (annot.subtyp & (0x10 << s)) - ts[s] = 'u'; /* signal s is unreadable */ - else if (annot.subtyp & (0x01 << s)) - ts[s] = 'n'; /* signal s is noisy */ - else - ts[s] = 'c'; /* signal s is clean */ - } - ts[s] = '\0'; - p = ts; break; - default: - y = tbmid; p = annstr(annot.anntyp); break; - } - x = (int)((annot.time - t0) * xppsi); - if (mflag) { - MoveTo(hDC, x, 0); - LineTo(hDC, x, y - tm.tmExternalLeading); - } - TextOut(hDC, x, y, p, strlen(p)); - if (show_subtyp) { - y += cheight; - sprintf(ts, "%d", annot.subtyp); - TextOut(hDC, x, y, ts, strlen(ts)); - } - if (show_chan) { - y += cheight; - sprintf(ts, "%d", annot.chan); - TextOut(hDC, x, y, ts, strlen(ts)); - } - if (show_num) { - y += cheight; - sprintf(ts, "%d", annot.num); - TextOut(hDC, x, y, ts, strlen(ts)); - } - if (show_aux && annot.aux) { - y += cheight; - p = annot.aux+1; - TextOut(hDC, x, y, p, strlen(p)); - } - if (mflag) { - MoveTo(hDC, x, y + cheight); - LineTo(hDC, x, wheight); - } - if (annot.anntyp == LINK) - SetTextColor(hDC, MARKER_COLOR); - } while (annot.time < t1); - } - SelectObject(hDC, hOldPen); - EndPaint (hWnd, &ps); -} - -void print_window(hWnd, printer) -HWND hWnd; -char *printer; -{ - char *p, ts[80], *jobname = "WVIEW"; - double pwsec, phmv, pxppmm, pyppmm, pxppsi, pyppadu[WFDB_MAXSIG], pysc; - DWORD dwextent; - HDC hDC; - HPEN hOldPen; - int base[WFDB_MAXSIG], compress = 0, j, s, slen, tbhigh, tblow, tbmid, - *v, *vp, vmax[WFDB_MAXSIG], vmin[WFDB_MAXSIG], v0, x, y, yb, pwidth, - pheight, pcheight; - long i, trlen; - TEXTMETRIC ptm; - - /* Set up a device context for printing. */ - if ((hDC = GetPrinterDC(printer)) == NULL) return; - if (Escape(hDC, STARTDOC, strlen(jobname), jobname, NULL) <= 0) { - DeleteDC(hDC); - return; - } - /* Determine the printer resolution and paper size in sec and mV. */ - pwidth = GetDeviceCaps(hDC,HORZRES); - pheight = GetDeviceCaps(hDC,VERTRES); - pxppmm = pwidth/(double)GetDeviceCaps(hDC,HORZSIZE); - pyppmm = pheight/(double)GetDeviceCaps(hDC,VERTSIZE); - pwsec = pwidth/(ptscale*pxppmm); - phmv = pheight/(pvscale*pyppmm); - - GetTextMetrics(hDC, &ptm); - pcheight = ptm.tmExternalLeading + ptm.tmHeight; - - /* Calculate the time scale in pixels per sample interval. */ - pxppsi = pxppmm * ptscale / sps; - - /* Draw in transparent mode (do not clear spaces around letters, - etc., to white). */ - SetBkMode(hDC, TRANSPARENT); - - /* Draw the grid, if requested. */ - hOldPen = SelectObject(hDC, pgrid_pen); - if (pgtflag) { - double gdx = pxppmm*ptscale/GTICKSPERSEC; - int i; - - for (i = 1, x = (int)gdx; x < pwidth; i++, x = (int)(i*gdx)) { - MoveTo(hDC, x, 0); - LineTo(hDC, x, pheight - 1); - } - } - if (pgvflag) { - double gdy = pyppmm*pvscale/GTICKSPERMV; - int i; - - for (i = 1, y = (int)gdy; y < pheight; i++, y = (int)(i*gdy)){ - MoveTo(hDC, 0, y); - LineTo(hDC, pwidth - 1, y); - } - } - - if (nsig > 0 || nann > 0) { - /* Set color for time stamps and signal names. */ - SetTextColor(hDC, SIGNAL_COLOR); - - /* Show the starting time in the lower left corner. */ - slen = sprintf(ts, "%s", timstr(ptmode ? -pt0 : pt0)); - for (p = ts; *p == ' '; p++, slen--) - ; /* discard initial spaces, if any */ - x = pxtr(2.); - y = pytr(7.5) - ptm.tmExternalLeading; - TextOut(hDC, x, y, p, slen); - - /* Determine the ending time. */ - pt1 = pt0 + (WFDB_Time)(sps*(int)pwsec); - - /* Show the ending time in the lower right corner. */ - slen = sprintf(ts, "%s", timstr(ptmode ? -pt1 : pt1)); - for (p = ts; *p == ' '; p++, slen--) - ; /* discard initial spaces, if any */ - dwextent = GetTextExtent(hDC, p, slen); - x = pxt(sps*(int)pwsec) - LOWORD(dwextent) - pxtr(2.); - TextOut(hDC, x, y, p, slen); - } - - /* Show the record and annotator names centered at the top. */ - if (*record && nann > 0) - slen = sprintf(ts, "Record %s, Annotator %s", record, annotator); - else if (*record) - slen = sprintf(ts, "Record %s", record); - else - slen = 0; - if (slen > 0) { - dwextent = GetTextExtent(hDC, ts, slen); - x = pxt(sps*0.5*(int)pwsec) - LOWORD(dwextent)/2; - TextOut(hDC, x, pcheight, ts, slen); - } - - /* Show scales centered at the bottom. */ - slen = sprintf(ts, "%s %s", tst[ptsi], vst[pvsi]); - dwextent = GetTextExtent(hDC, ts, slen); - x = pxt(sps*0.5*(int)pwsec) - LOWORD(dwextent)/2; - TextOut(hDC, x, y - pcheight, ts, slen); - - /* Show the copyright notice centered at the bottom. */ - slen = sprintf(ts, "Printed by WVIEW %s Copyright \251 MIT 1997", - VERSION); - dwextent = GetTextExtent(hDC, ts, slen); - x = pxt(sps*0.5*(int)pwsec) - LOWORD(dwextent)/2; - TextOut(hDC, x, y, ts, slen); - - if (nsig < 1) - tbmid = pheight/2; /* Set standard ordinate for annotations. */ - else { /* Draw signals. */ - /* Determine signal amplitude scales and baselines. */ - for (s = 0; s < nsig; s++) { - pyppadu[s] = (pyppmm * pvscale) / sg[s]; - base[s] = ((2*s+1)*pheight)/(2*nsig); - vmin[s] = 9999; vmax[s] = -9999; - } - tbmid = (nsig==1)?(int)(0.75*pheight):(base[nsig/2-1]+base[nsig/2])/2; - - /* Allocate the signal buffer. */ - trlen = (long)(pwsec * sps); - if (pxppsi < 0.75) { - compress = 1; - while ((v=malloc((unsigned)(1.5*pwidth*nsig*sizeof(int))))==NULL) - pwidth /= 2; - } - else while ((v = malloc((unsigned)(trlen*nsig*sizeof(int)))) == NULL) - trlen -= (long)(sps/5.); - - /* Skip to the starting time. */ - isigsettime(pt0); - - if (compress) { - static int x0, vv0[WFDB_MAXSIG], vmn[WFDB_MAXSIG], - vmx[WFDB_MAXSIG], vv[WFDB_MAXSIG]; - - getvec(vp = v); - for (s = 0; s < nsig; s++) - vmax[s] = vmin[s] = vmn[s] = vmx[s] = vv0[s] = vp[s]; - for (i = 1, x0 = 0; i < trlen && getvec(vv) > 0; i++) { - int xx; - if ((xx = (int)(i*pxppsi)) > x0) { - x0 = xx; - vp += nsig; - for (s = 0; s < nsig; s++) { - if (vv[s] > vmx[s]) vmx[s] = vv[s]; - else if (vv[s] < vmn[s]) vmn[s] = vv[s]; - if (vmx[s] - vv0[s] > vv0[s] - vmn[s]) - vv0[s] = vmn[s] = vmx[s]; - else - vv0[s] = vmx[s] = vmn[s]; - if ((vp[s] = vv0[s]) > vmax[s]) vmax[s] = vp[s]; - else if (vp[s] < vmin[s]) vmin[s] = vp[s]; - } - } - else { - for (s = 0; s < nsig; s++) { - if (vv[s] > vmx[s]) vmx[s] = vv[s]; - else if (vv[s] < vmn[s]) vmn[s] = vv[s]; - } - } - } - i = (vp - v)/nsig; - } - else { - for (i = 0, vp = v; i < trlen; i++, vp += nsig) { - if (getvec(vp) < nsig) break; - for (s = 0; s < nsig; s++) { - if (vp[s] < vmin[s]) vmin[s] = vp[s]; - else if (vp[s] > vmax[s]) vmax[s] = vp[s]; - } - } - } - - SelectObject(hDC, signal_pen); - for (s = 0; s < nsig; s++) { - yb = base[s]; - v0 = (vmax[s] + vmin[s])/2; - pysc = pyppadu[s]; - if (nflag) - TextOut(hDC, pxtr(1.), (int)(yb + pyppmm*2), si[s].desc, - strlen(si[s].desc)); - vp = v+s; - MoveTo(hDC, 0, pyt(*vp - v0)); - vp += nsig; - if (compress) - for (j = 1; j < i; j++, vp += nsig) - LineTo(hDC, j, pyt(*vp - v0)); - else - for (j = 1; j < i; j++, vp += nsig) - LineTo(hDC, pxt(j), pyt(*vp - v0)); - vmax[s] = -9999; vmin[s] = 9999; - } - - /* Free the signal buffer. (This is not strictly necessary for a large - memory model Windows program, since the version of malloc used in - this case allocates memory from the automatic data segment.) */ - free(v); - } - - if (nann > 0) { /* Show annotations. */ - WFDB_Annotation annot; - - iannsettime(pt0); - if (pt0 == 0L) { /* skip modification labels */ - int i; - - while ((i = getann(0, &annot)) == 0 && - annot.time == 0L && annot.anntyp == NOTE) - ; - if (i == 0) ungetann(0, &annot); - } - if (pmflag) SelectObject(hDC, marker_pen); - SetTextColor(hDC, MARKER_COLOR); - tbhigh = tbmid - pcheight; - tblow = tbmid + pcheight; - do { - if (getann(0, &annot) < 0) break; - switch (annot.anntyp) { - case RHYTHM: - y = tblow; - if (annot.aux && !pshow_aux) - p = annot.aux+1; - else - p = annstr(annot.anntyp); - break; - case STCH: - case TCH: - case NOTE: - y = tbhigh; - if (annot.aux && !pshow_aux) - p = annot.aux+1; - else - p = annstr(annot.anntyp); - break; - case NOISE: - y = tbhigh; - if (annot.subtyp == -1) { p = "U"; break; } - /* The existing scheme is good for up to 4 signals; it can - be easily extended to 8 or 12 signals using the chan and - num fields, or to an arbitrary number of signals using - `aux'. */ - for (s = 0; s < nsig && s < 4; s++) { - if (annot.subtyp & (0x10 << s)) - ts[s] = 'u'; /* signal s is unreadable */ - else if (annot.subtyp & (0x01 << s)) - ts[s] = 'n'; /* signal s is noisy */ - else - ts[s] = 'c'; /* signal s is clean */ - } - ts[s] = '\0'; - p = ts; break; - default: - y = tbmid; p = annstr(annot.anntyp); break; - } - x = (int)((annot.time - pt0) * pxppsi); - if (pmflag) { - MoveTo(hDC, x, 0); - LineTo(hDC, x, y - ptm.tmExternalLeading); - } - TextOut(hDC, x, y, p, strlen(p)); - if (pshow_subtyp) { - y += pcheight; - sprintf(ts, "%d", annot.subtyp); - TextOut(hDC, x, y, ts, strlen(ts)); - } - if (pshow_chan) { - y += cheight; - sprintf(ts, "%d", annot.chan); - TextOut(hDC, x, y, ts, strlen(ts)); - } - if (pshow_num) { - y += pcheight; - sprintf(ts, "%d", annot.num); - TextOut(hDC, x, y, ts, strlen(ts)); - } - if (pshow_aux && annot.aux) { - y += pcheight; - p = annot.aux+1; - TextOut(hDC, x, y, p, strlen(p)); - } - if (pmflag) { - MoveTo(hDC, x, y + pcheight); - LineTo(hDC, x, pheight); - } - } while (annot.time < pt1); - } - SelectObject(hDC, hOldPen); - if (Escape(hDC, NEWFRAME, 0, NULL, NULL) > 0) - Escape(hDC, ENDDOC, 0, NULL, NULL); - DeleteDC(hDC); -} diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wview/wview.def wfdb-10.3.16/wview/wview.def --- wfdb-10.3.15/wview/wview.def 1999-06-24 11:38:28.000000000 -0400 +++ wfdb-10.3.16/wview/wview.def 1969-12-31 19:00:00.000000000 -0500 @@ -1,22 +0,0 @@ -NAME wview - -DESCRIPTION 'WFDB Browser -- Copyright (C) George B. Moody 1999.' - -EXETYPE WINDOWS - -STUB 'WINSTUB.EXE' - -CODE PRELOAD MOVEABLE DISCARDABLE -DATA PRELOAD MOVEABLE MULTIPLE - -HEAPSIZE 1024 -STACKSIZE 5120 - -EXPORTS - MainWndProc @1 - About @2 - Choose @3 - Find @4 - Print @5 - PrintOptions @6 - ViewOptions @7 diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wview/wview.h wfdb-10.3.16/wview/wview.h --- wfdb-10.3.15/wview/wview.h 2000-01-30 04:13:27.000000000 -0500 +++ wfdb-10.3.16/wview/wview.h 1969-12-31 19:00:00.000000000 -0500 @@ -1,148 +0,0 @@ -/* file: wview.h G. Moody 20 January 1993 - Last revised: 7 May 1999 - -------------------------------------------------------------------------------- -wview.h: Constants for wview -Copyright (C) 1999 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/). -_______________________________________________________________________________ - -*/ - -/* wview version string */ -#define VERSION "Version 1.04 alpha" - -/* The following set of topic definitions must match those in the [MAP] section - of wview.hpj -- keep them in agreement! */ -#define Choosing_Topic 101 -#define Browsing_Topic 102 -#define Options_Topic 103 -#define Searching_Topic 104 -#define Printing_Topic 105 - -#define IDM_NEW 1 -#define IDM_OPEN 2 -#define IDM_SAVE 3 -#define IDM_SAVEAS 4 -#define IDM_PRINT 5 -#define IDM_EXIT 6 - -#define IDM_UNDO 10 -#define IDM_CUT 11 -#define IDM_COPY 12 -#define IDM_PASTE 13 -#define IDM_DEL 14 -#define IDM_FIND 15 - -#define IDM_VIEW 20 -#define IDM_PROPT 21 - -#define IDM_HELP_INDEX 41 -#define IDM_HELP_CHOOSING 42 -#define IDM_HELP_BROWSING 43 -#define IDM_HELP_OPTIONS 44 -#define IDM_HELP_SEARCHING 45 -#define IDM_HELP_PRINTING 46 -#define IDM_ABOUT 47 - -#define IDD_RECORD 102 -#define IDD_ANNOTATOR 104 -#define IDD_WFDBPATH 106 -#define IDD_WFDBCAL 108 - -#define IDD_FINDN 201 -#define IDD_FINDP 202 -#define IDD_RECENTER 203 -#define IDD_FNTYPE 204 -#define IDD_FPTYPE 205 -#define IDD_RCTIME 206 - -#define IDD_PPRLABEL 300 -#define IDD_PPRINTER 301 -#define IDD_PRANGE 302 -#define IDD_PRREC 303 -#define IDD_PRWIN 304 -#define IDD_PRSEG 305 -#define IDD_PRFLABEL 306 -#define IDD_PRFROM 307 -#define IDD_PRTLABEL 308 -#define IDD_PRTO 309 -#define IDD_PFILE 310 -#define IDD_PCLABEL 311 -#define IDD_PCOPIES 312 -#define IDD_PCOLLATE 313 -#define IDD_PSETUP 314 -#define IDD_POPTIONS 315 - -#define IDD_PODEF 401 -#define IDD_POSCALES 402 -#define IDD_POSTLABEL 403 -#define IDD_POSTIME 404 -#define IDD_POSALABEL 405 -#define IDD_POSAMP 406 -#define IDD_POGRID 407 -#define IDD_POGTIME 408 -#define IDD_POGAMP 409 -#define IDD_POANN 410 -#define IDD_POAMARK 411 -#define IDD_POASUB 412 -#define IDD_POACHAN 413 -#define IDD_POANUM 414 -#define IDD_POAAUX 415 -#define IDD_POOTHER 416 -#define IDD_POOSB 417 -#define IDD_POOSN 418 -#define IDD_POOCLABEL 419 -#define IDD_POOCOM 420 -#define IDD_POCALIB 421 -#define IDD_POHELP 422 -#define IDD_POTMODE 423 - -#define IDD_VODEF 501 -#define IDD_VOSCALES 502 -#define IDD_VOSTLABEL 503 -#define IDD_VOSTIME 504 -#define IDD_VOSALABEL 505 -#define IDD_VOSAMP 506 -#define IDD_VOGRID 507 -#define IDD_VOGTIME 508 -#define IDD_VOGAMP 509 -#define IDD_VOANN 510 -#define IDD_VOAMARK 511 -#define IDD_VOASUB 512 -#define IDD_VOACHAN 513 -#define IDD_VOANUM 514 -#define IDD_VOAAUX 515 -#define IDD_VOOTHER 516 -#define IDD_VOOSB 517 -#define IDD_VOOSN 518 -#define IDD_VOCALIB 521 -#define IDD_VOHELP 522 -#define IDD_VOTMODE 523 - -int PASCAL WinMain(HANDLE, HANDLE, LPSTR, int); -BOOL InitApplication(HANDLE); -BOOL InitInstance(HANDLE, int); -long FAR PASCAL MainWndProc(HWND, UINT, WPARAM, LPARAM); -BOOL FAR PASCAL About(HWND, unsigned, WORD, LONG); -BOOL FAR PASCAL Choose(HWND, unsigned, WORD, LONG); -BOOL FAR PASCAL Find(HWND, unsigned, WORD, LONG); -BOOL FAR PASCAL Print(HWND, unsigned, WORD, LONG); -BOOL FAR PASCAL PrintOptions(HWND, unsigned, WORD, LONG); -BOOL FAR PASCAL ViewOptions(HWND, unsigned, WORD, LONG); diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wview/wview.hlp wfdb-10.3.16/wview/wview.hlp --- wfdb-10.3.15/wview/wview.hlp 1999-06-24 11:38:28.000000000 -0400 +++ wfdb-10.3.16/wview/wview.hlp 1969-12-31 19:00:00.000000000 -0500 @@ -1,197 +0,0 @@ -?_D_ BKNSZ_jq3FT[`jr36=CILO^dglqy %+14?BJNX^flqx  $*18=HPW\`eiorv}3;?CGLQVY`cgkt| &,29?FOVY`ekov|      # + 4 8 ? C H M S W ^ a e "thumb"(and(e.g.,(for(in any of the directories named (omittin g); ,0d, whereA binary fileXat contains a time-ord?d set|"A`strf (up toA textH AlthoughAnnotation @orApplic sArrhythmiaBrowser Ta RecxChoose Inputs+ rFsq ViewDB caplibrg environm pathDBCALDC-coupledDatabaseECG  P GuidProgram0mer'@Fi nd+ 0MIT-BIHMS-DOSOp @...PletP9t  ]RHYTHM1Search0p  XqsSeeSegSelSignalT`heUseaWowYouabouoveabsoluteaccessaddi1allalsoamtudeaa @orxapparopriaYrsedocdau rauxavailablewardbeebeginnbelon Atween2bottombut!canc"edTch hcscG"  senckcommfBsvn@orresPpond?u nXtdaE"s edefaultdescr:sOalogdiffӃ2ig`z3ŃSydispl&aPBoszdb.bMcheirelapsrNdrexe,feature`fieldsrffoVYm]vfrom_fun furmgighea 03$high-pifiw )cl6k $infvcis tlevellistlo!!4make1chhmayuby$uhemnem Qcm2most :%s;boneonl`yopen2ngo#3$%oj+~particularMQ>ncepr z'qu\tyB0.Hrawsc:,ts!se) sFfulOba5s3s#0is`emico4she&sut(uld -wn)~; Jt0spec0ysrtrdC%subtypsuuf(upps'tem"gqRnVChhSgh]amsReuntuu$usJly*uevaV0 ZvvisiDn&@whichw$withwithoutyouyour/&;)z4 ~u ~|CONTEXTZ<|CTXOMAP3|FONT2|Phrases|SYSTEM |TOPICw |TTLBTREE+4le (and optionally, a particular signal), that describes a feature of the signal(s) at that time. In ECG records, most annotations are beat (QRS) labels and indicate the QRS type (normal, PVC, SVPB, etc.). - -label, -associated -with -a -particular - -sample -(and -optionally, -a -particular - signal), -that - describes -a - feature -of -the - signal(s) -at -that - time. -In -ECG - records, -most -annotations -are -beat - (QRS) - -labels -and - indicate -the -QRS -type - (normal, -PVC, - SVPB, - -etc.). -Annotation file: - file: -6A binary file that contains a time-ordered set of - -binary -file -that - contains -a -time-ordered -set -of -annotations -wfor some or all of the signals belonging to a given record. Under MS-DOS, annotation files have names of the form -some -or -all -of -the - signals - belonging -to -a - ofl?3DB Browser Help&DB Browser Help Copyright MIT 1997.BrowseButtons(){&r& :F1FuFDB +Help/ u# $@,`FF /@B }?_ `2y`ThK!&`/b?3P  -# e0,0N 0`0Ting This 0an alpha release of *. A number0controls Syet $, wha -0already %encompasseaalityX0L x, many |a l sn Ssend @ments, suggestion bug!portt@he : George B. MoodyMIT Room 20A-113Cambridge, MA 02139 USAe-mail: gE @hstbme.mit.eduU!s?download!Irec vers7q+our World Wide Web site (http:/P/ecg[`)gSdo Sredistribua,copi@DxRefone int$ered - o btain a fre; އBw|@, or1QaaddBv.3uy1cC y0(F#222I$y|` ƀI+ T, 0@PKssJfB0 /D -o 4#k/ rIt sctAab |Bcview'f" 8p+'libRun...3Program Manager's BL@),E?ly}J I%YY0AK#y(w qcFuBZ l#}i8diatea(if i#vable) 0V0!.@0Ko_`attem2pu#fi(atr) AI0@pop upeP Ope $QA,cchanFP24P nE%W2y-B$,-Tvbf3A,` fill )]"(8H C% 37LeavCM9y 0unannotd#$wishsB UA!55?bg@ER(efnf/$+li5+5t$(o?r future 8+T edV)!F60%7eSV=1J.@2.@"+uDjati m6431.,(.#(l: ( uCrIm*%3`mos4 ú#0rrow#1 ,!\M"(d ]Cli\ckd"Otl4bes7.3NEwidth7;dra* ['8; while $do!so2dRpoft:h )X n,eaQ,Keyboar perform fsk. -S#v>@2 Fb9qn5" P^_" d -GP#^Djj0+4^^0O+]P& % Z! Mz^B%^:^Y ! l,+ GZXupbz (inc[ o/ ` G^mout (denf+ GZVZZڐ  +pf+` ,Gecegp-pe  : BA;6h%! -E|R,  <-D7 -(accM^ iu Ed + -,k)<$96i'Dn{8low:)Q :} hcs - min; )-s ( ,,-=1hW: - { los^*Cte. instruc.n-y@qk -adjust ( h% -w<1D @{ Ā9?); USMbars=ex 8@=Not[po i p|V!,?vaFE| -0.K)<, QRS& Tpd$ R-wpeak vAHA 0-PQ junp!Ne 2Oshl Y E OriP(ltyp#pExcep1'Z rhythmN)m&0vn)AZ LINK:pvRm%wp; d/iPsupShk - 1}elPɀ:Fseoq* @7D4 6 JI"ٟ"2}icperii -tDB +0 low3r -2q9Pc(jP|check AbsolutG rj!es) kYm|=+0available3%CjD1#jDDtH`(7DD#P 8\D3`;jDzG wd }!DgD EdibCE( En x aE`V)[$>_D4_QWClioradio t ށ.2T/+$OK;k&"F nex5?BwiSN3rviou[0%0unsuccful5nCtm0odif8cr1ria S}gtandarDlisDQ@)?b{bO0 NOIdSEs-%'+`!ZSTcge6T5@Dk0 LvZ#uspdraw8gW4heIoP, Bafix uffici "(S" /Up> (2adj$ac;%6zGH1qHHsLT+ tHH#??(HK@B[BN`r`2y( tshXg 3F 26-!~TC{$BU{4Chooidevi*"Ter6g[W(ne#valKir^\LCu` Conce pEl))dd"V  Fend'5From: TEP'' v -4Ca lreturc,U 5v S-p%QEZ(t4r-rGc" rk1tr8aC5PUNH -߈(alziX vi -N^@; MGy(J -T(w -w=!' LHsL. *U!QE0W 6[H 5+O* -E, gg doSk9mp -0{&-+T@ev n r6!Ha CEa$x ap* -t7eBrol Panel=1KL1LyNsLyN` 3Ly-‰ @PKs @!)%M3 3 L "i - Babel#   A8Qvary I' Kat(S4e! uth l  OUNIXIg]&-gO7V | k<t%o~* 6X| ! -JH ) x3tKx "2#?c HJ No6Ӎ-hea) xP<< gnon-annot=, 2M wel"1LN1dNP3xyNPZ ~>>12Ƽ&c,cs op py pl3&0pulO{ma"n #%`i}wis v~M;-3]ۄ"M`8'*KV<3(G h'::/ -!9cluddriKs=c Y 0'/W<OC7\A ` (c  db 0pr= d $UUnlY#7jconpfigu/8du] -llfN ' l??21NQ1Q^RPP^RB R]ic4@B$KD4 -:!s shazkgbu MITlibrH.5g-Fr/,izn/ -*p -typis!Ebatcj(3Abto;g/QofvTokutMPexec.UCF 6kbodms ;246=!1QR1 R>T^R>T_ AB+eq*}P) we6xJ%y(  s -foundcsT 7DB˿(+r5 :R1DB=;c:\database;d:\mitdb41$ѪP)e"d d ;%epa9e pair9. -j(1 k 2emptj -tor"jUrst-_c@ `s6`1RoT1 -oT=UZ>T=U? L\7LJHeadUdQ bޙGUn'L0 s  Q6 ."'}H`}nameQ ˱G`u_1oTnU1 nU\=U\* ",8"GA t( s8kX^lp 1 7(.nU\=U In ECG |s, Is beat (QRS) labels )QRS (normal, PVC, SVPB, etc.).1nU1 {\{H ^i vxg #: s  some or of a  Under L, have Qof  ~ann}0the }J, ann 0the name; g]s. c? +u.11K Ƃ{Ƃ? L } i: ed s of Wor Ga DB  A }?GW; a }Oin |'s . jre no restrictions on Qgthose imposed by ]. Commonly, Qof  |.dat}0the }J.11J^Ƃ< F B+eq*}\: ?', a , of original . Only 0mandatory. !|s sometimes called tapes  historical reasons, |s now Gcommonly maintained on optical or magnetic disks on tape.1A1{AJ>? L} T, y- ]M8 ) "ies a DB ~ ]Q K)=3-digit U1 or 2 100, 203; SUas }P, however). ]Q g . To get a 7of |s, t +60&^^]UNF - u ]F -PQPPvP-@]UWV^F u60&^+lFF~u%v -vPWF PVvC:\WINDOWS\TEMP\~hc8W .PVC:\WINDOWS\TEMP\~hc9uvߎFC:\WINDOWS\TEMP\~hc9PnjC:\WINDOWS\TEMP\~hc13Ft<ߎF^&?t.F+Fy+F;~PnjFRPv v -R]. -+vFt<ߎF^&?t.F+Fy+F;~PnjFRPv v -R/ -+vFt:ߎF^&?t,PW~F욺/VFVFRPv v -R. -F -V ^_ UVC:\WINDOWS\TEMP\~hc9F PVC:\WINDOWS\TEMP\~hc13UWV~vv#0F&5^&7+FF^ -&^&vvN -^Y*=\twL,.t t, t'>F&55FDF &FF&^&D^&F &F^8uQ+؃~u ^&7^ -&?.u FC:\WINDOWS\TEMP\~hc9 -); tht paC:\WINDOWS\TEMP\~hc10 "}{C:\WINDOWS\TEMP\~hc11 -" sC:\WINDOWS\TEMP\~hc12the C:\WINDOWS\TEMP\~hc13Wnamed in the DB path); the first part of the name (omitting the ".hea" suffix) of each such file is the name of the record with which it is associated.es a DB record. Record names for the MIT-BIH Arrhythmia Database are 3-digit numbers beginning with 1 or 2 (e.g., 100, 203; not all such numbers are assigned as record names, however). Record names for other databases follow different conventions. To get a list of available records, find files matching the pattern *.hea (in any of the directories s the name of the record with which it is associated. -suffix) -of -each -such -file -is -the -name -of -the -record -with -which -it -is -associated. -other -databases -follow -different -conventions. -To -get -a -list -of -ava -ilable records, find files matching the pattern -records, -find -files -ma \ No newline at end of file diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wview/wview.hpj wfdb-10.3.16/wview/wview.hpj --- wfdb-10.3.15/wview/wview.hpj 2000-01-30 04:13:27.000000000 -0500 +++ wfdb-10.3.16/wview/wview.hpj 1969-12-31 19:00:00.000000000 -0500 @@ -1,49 +0,0 @@ -; file: wview.hpj G. Moody 31 January 1993 -; Last revised: 7 May 1999 -; -; ----------------------------------------------------------------------------- -; wview help project file -; Copyright (C) 1999 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/). -; _____________________________________________________________________________ - -[OPTIONS] -COMPRESS=HIGH -CONTENTS=Help_Contents -COPYRIGHT=WVIEW Help Copyright George B. Moody 1999. -REPORT=ON -TITLE=WVIEW Help -WARNING=3 - -[FILES] -WVIEW.RTF - -; The topic definitions in the [MAP] section must match those in wview.h -- -; keep them in agreement! - -[MAP] -Choosing_Topic 101 -Browsing_Topic 102 -Options_Topic 103 -Searching_Topic 104 -Printing_Topic 105 - -[CONFIG] -BrowseButtons() diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wview/wview.rc wfdb-10.3.16/wview/wview.rc --- wfdb-10.3.15/wview/wview.rc 2000-01-30 04:13:27.000000000 -0500 +++ wfdb-10.3.16/wview/wview.rc 1969-12-31 19:00:00.000000000 -0500 @@ -1,238 +0,0 @@ -/* file: wview.rc G. Moody 20 January 1993 - Last revised: 7 May 1999 - -------------------------------------------------------------------------------- -Resources for wview -Copyright (C) 1999 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 "windows.h" -#include "wview.h" - -ecgicon ICON ecg.ico - -wviewmenu MENU -{ - POPUP "&File" { - MENUITEM "&New", IDM_NEW, GRAYED - MENUITEM "&Open...", IDM_OPEN - MENUITEM "&Save", IDM_SAVE, GRAYED - MENUITEM "Save &As...", IDM_SAVEAS, GRAYED - MENUITEM "&Print...", IDM_PRINT - MENUITEM SEPARATOR - MENUITEM "E&xit", IDM_EXIT - } - - POPUP "&Edit" { - MENUITEM "&Undo", IDM_UNDO, GRAYED - MENUITEM SEPARATOR - MENUITEM "Cu&t", IDM_CUT, GRAYED - MENUITEM "&Copy", IDM_COPY, GRAYED - MENUITEM "&Paste", IDM_PASTE, GRAYED - MENUITEM "De&lete", IDM_DEL, GRAYED - MENUITEM SEPARATOR - MENUITEM "&Find...", IDM_FIND - } - - POPUP "&Options" { - MENUITEM "&View Options...", IDM_VIEW - MENUITEM "&Print Options...", IDM_PROPT - } - - POPUP "&Help" - { - MENUITEM "&Index...", IDM_HELP_INDEX - MENUITEM "&Choosing Inputs...", IDM_HELP_CHOOSING - MENUITEM "&Browsing...", IDM_HELP_BROWSING - MENUITEM "&Options...", IDM_HELP_OPTIONS - MENUITEM "&Searching...", IDM_HELP_SEARCHING - MENUITEM "&Printing...", IDM_HELP_PRINTING - MENUITEM SEPARATOR - MENUITEM "&About WVIEW...", IDM_ABOUT - } -} - -AboutBox DIALOG 20, 20, 160, 80 -STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU -CAPTION "About WVIEW" -{ - CTEXT "WVIEW" -1, 0, 12, 160, 8 - ICON "ecgicon" -1, 8, 8, 0, 0 - CTEXT VERSION -1, 0, 36, 160, 8 - CTEXT "Copyright George B. Moody 1999." -1, 0, 48, 160, 8 - DEFPUSHBUTTON "OK" IDOK, 64, 60, 32, 14, WS_GROUP -} - -ChooseBox DIALOG 20, 20, 160, 114 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "WVIEW -- Choose Inputs" -FONT 8, "MS Sans Serif" -{ - LTEXT "Record name:", 101, 10, 6, 50, 8 - EDITTEXT IDD_RECORD, 80, 4, 70, 12, ES_AUTOHSCROLL - LTEXT "Annotator name:", 103, 10, 21, 60, 8 - EDITTEXT IDD_ANNOTATOR, 80, 19, 70, 12, ES_AUTOHSCROLL - LTEXT "WFDB path:", 105, 10, 56, 40, 8 - EDITTEXT IDD_WFDBPATH, 50, 54, 100, 12, ES_AUTOHSCROLL - LTEXT "WFDB calibration file:", 107, 10, 71, 70, 8 - EDITTEXT IDD_WFDBCAL, 80, 69, 70, 12, ES_AUTOHSCROLL - GROUPBOX "WFDB Environment", 109, 0, 40, 160, 49 - DEFPUSHBUTTON "OK", IDOK, 30, 95, 40, 14, WS_GROUP - PUSHBUTTON "Cancel", IDCANCEL, 90, 95, 40, 14 -} - -FindBox DIALOG 20, 20, 104, 85 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Find" -FONT 8, "MS Sans Serif" -{ - CONTROL "Find next", IDD_FINDN, "Button", BS_RADIOBUTTON | - WS_TABSTOP | WS_GROUP, 0, 9, 40, 10 - CONTROL "Find previous", IDD_FINDP, "Button", BS_RADIOBUTTON, - 0, 28, 60, 10 - CONTROL "Recenter at", IDD_RECENTER,"Button", BS_RADIOBUTTON, - 0, 47, 50, 10 - EDITTEXT IDD_FNTYPE, 60, 7, 40, 12, ES_AUTOHSCROLL | WS_TABSTOP - EDITTEXT IDD_FPTYPE, 60, 27, 40, 12, ES_AUTOHSCROLL | WS_TABSTOP - EDITTEXT IDD_RCTIME, 60, 46, 40, 12, ES_AUTOHSCROLL | WS_TABSTOP - DEFPUSHBUTTON "OK", IDOK, 10, 66, 30, 14, WS_GROUP - PUSHBUTTON "Cancel", IDCANCEL, 50, 66, 40, 14 -} - -PrintBox DIALOG 5, 25, 230, 115 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Print" -FONT 8, "MS Sans Serif" -{ - LTEXT "&Printer:", IDD_PPRLABEL, 2, 7, 26, 8 - COMBOBOX IDD_PPRINTER, 28, 5, 134, 45, CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - GROUPBOX "Range", IDD_PRANGE, 2, 19, 160, 72 - CONTROL "Entire &Record", IDD_PRREC, "Button", BS_AUTORADIOBUTTON, - 9, 30, 60, 10 - CONTROL "Current Contents of &Window", IDD_PRWIN, "Button", - BS_AUTORADIOBUTTON, 9, 45, 112, 10 - CONTROL "S&egment", IDD_PRSEG, "Button", BS_AUTORADIOBUTTON, 9, 60, - 39, 10 - LTEXT "&From:", IDD_PRFLABEL, 19, 75, 20, 8 - EDITTEXT IDD_PRFROM, 39, 74, 40, 12, ES_AUTOHSCROLL - LTEXT "&To:", IDD_PRTLABEL, 89, 76, 20, 8 - EDITTEXT IDD_PRTO, 109, 74, 40, 12, ES_AUTOHSCROLL - CONTROL "Print to Fi&le", IDD_PFILE, "Button", BS_AUTOCHECKBOX | - WS_TABSTOP, 4, 100, 50, 10 - RTEXT "&Copies:", IDD_PCLABEL, 106, 101, 30, 8 - EDITTEXT IDD_PCOPIES, 139, 99, 22, 12, ES_AUTOHSCROLL - CONTROL "Coll&ate Copies",IDD_PCOLLATE, "Button", BS_AUTOCHECKBOX | - WS_TABSTOP, 169, 100, 60, 10 - PUSHBUTTON "OK", IDOK, 179, 4, 40, 14 - PUSHBUTTON "Cancel", IDCANCEL, 179, 26, 40, 14 - PUSHBUTTON "&Setup...", IDD_PSETUP, 179, 48, 40, 14 - PUSHBUTTON "&Options...", IDD_POPTIONS, 179, 71, 40, 14 -} - -PrintOptionsBox DIALOG 2, 18, 226, 164 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Print Options" -FONT 8, "MS Sans Serif" -{ - CONTROL "&Use current display scales and options", IDD_PODEF, - "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 1, 3, 141, 10 - GROUPBOX "Scales", IDD_POSCALES, 1, 20, 109, 45 - LTEXT "&Time", IDD_POSTLABEL, 20, 32, 19, 8 - COMBOBOX IDD_POSTIME, 42, 30, 64, 85, CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Amplitude", IDD_POSALABEL, 4, 48, 35, 8 - COMBOBOX IDD_POSAMP, 42, 47, 64, 70, CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - GROUPBOX "Grid", IDD_POGRID, 118, 20, 60, 45 - CONTROL "T&ime", IDD_POGTIME, "Button", BS_AUTOCHECKBOX | - WS_TABSTOP, 126, 31, 40, 10 - CONTROL "Am&plitude", IDD_POGAMP, "Button", BS_AUTOCHECKBOX | - WS_TABSTOP, 126, 46, 44, 10 - GROUPBOX "Annotations", IDD_POANN, 1, 70, 179, 40 - CONTROL "&Markers", IDD_POAMARK, "Button", BS_AUTOCHECKBOX | - WS_TABSTOP, 10, 85, 40, 10 - CONTROL "&Subtypes", IDD_POASUB, "Button", BS_AUTOCHECKBOX | - WS_TABSTOP, 10, 95, 40, 10 - CONTROL "&Chan fields", IDD_POACHAN, "Button", BS_AUTOCHECKBOX | - WS_TABSTOP, 67, 85, 48, 10 - CONTROL "&Num fields", IDD_POANUM, "Button", BS_AUTOCHECKBOX | - WS_TABSTOP, 67, 95, 47, 10 - CONTROL "Au&x fields", IDD_POAAUX, "Button", BS_AUTOCHECKBOX | - WS_TABSTOP, 126, 85, 43, 10 - GROUPBOX "Other", IDD_POOTHER, 1, 116, 178, 46 - CONTROL "Signal &baselines", IDD_POOSB, "Button", - BS_AUTOCHECKBOX | WS_TABSTOP, 10, 127, 106, 10 - CONTROL "Si&gnal names", IDD_POOSN, "Button", BS_AUTOCHECKBOX | - WS_TABSTOP, 119, 127, 56, 10 - CONTROL "A&bsolute time", IDD_POTMODE, "Button", - BS_AUTOCHECKBOX | WS_TABSTOP, 10, 137, 69, 10 - LTEXT "C&omments:", IDD_POOCLABEL, 10, 147, 36, 8 - EDITTEXT IDD_POOCOM, 49, 147, 125, 12, ES_AUTOHSCROLL - DEFPUSHBUTTON "OK", IDOK, 185, 5, 40, 14 - PUSHBUTTON "Cancel", IDCANCEL, 185, 25, 40, 14 - PUSHBUTTON "Ca&librate...", IDD_POCALIB, 185, 45, 40, 14 - PUSHBUTTON "&Help...", IDD_POHELP, 185, 65, 40, 14 -} - -ViewOptionsBox DIALOG 2, 18, 226, 159 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "View Options" -FONT 8, "MS Sans Serif" -{ - CONTROL "&Use default display scales and options", IDD_VODEF, - "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 1, 3, 141, 10 - GROUPBOX "Scales", IDD_VOSCALES, 1, 20, 109, 45 - LTEXT "&Time", IDD_VOSTLABEL, 20, 32, 19, 8 - COMBOBOX IDD_VOSTIME, 42, 30, 64, 85, CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - LTEXT "&Amplitude", IDD_VOSALABEL, 4, 48, 35, 8 - COMBOBOX IDD_VOSAMP, 42, 47, 64, 70, CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - GROUPBOX "Grid", IDD_VOGRID, 118, 20, 60, 45 - CONTROL "T&ime", IDD_VOGTIME, "Button", BS_AUTOCHECKBOX | - WS_TABSTOP, 126, 31, 40, 10 - CONTROL "Am&plitude", IDD_VOGAMP, "Button", BS_AUTOCHECKBOX | - WS_TABSTOP, 126, 46, 44, 10 - GROUPBOX "Annotations", IDD_VOANN, 1, 70, 179, 40 - CONTROL "&Markers", IDD_VOAMARK, "Button", BS_AUTOCHECKBOX | - WS_TABSTOP, 10, 85, 40, 10 - CONTROL "&Subtypes", IDD_VOASUB, "Button", BS_AUTOCHECKBOX | - WS_TABSTOP, 10, 95, 40, 10 - CONTROL "&Chan fields", IDD_VOACHAN, "Button", BS_AUTOCHECKBOX | - WS_TABSTOP, 67, 85, 48, 10 - CONTROL "&Num fields", IDD_VOANUM, "Button", BS_AUTOCHECKBOX | - WS_TABSTOP, 67, 95, 47, 10 - CONTROL "Au&x fields", IDD_VOAAUX, "Button", BS_AUTOCHECKBOX | - WS_TABSTOP, 126, 85, 43, 10 - GROUPBOX "Other", IDD_VOOTHER, 1, 116, 178, 41 - CONTROL "Signal &baselines", IDD_VOOSB, "Button", - BS_AUTOCHECKBOX | WS_TABSTOP, 10, 127, 106, 10 - CONTROL "Si&gnal names", IDD_VOOSN, "Button", BS_AUTOCHECKBOX | - WS_TABSTOP, 119, 127, 56, 10 - CONTROL "A&bsolute time", IDD_VOTMODE, "Button", - BS_AUTOCHECKBOX | WS_TABSTOP, 10, 137, 69, 10 - DEFPUSHBUTTON "OK", IDOK, 185, 5, 40, 14 - PUSHBUTTON "Cancel", IDCANCEL, 185, 25, 40, 14 - PUSHBUTTON "Ca&librate...", IDD_VOCALIB, 185, 45, 40, 14 - PUSHBUTTON "&Help...", IDD_VOHELP, 185, 65, 40, 14 -} diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wview/wview.rtf wfdb-10.3.16/wview/wview.rtf --- wfdb-10.3.15/wview/wview.rtf 2000-01-30 04:13:27.000000000 -0500 +++ wfdb-10.3.16/wview/wview.rtf 1969-12-31 19:00:00.000000000 -0500 @@ -1,177 +0,0 @@ -{\rtf1\ansi \deff47\deflang1033{\fonttbl{\f5\fswiss\fcharset0\fprq2 Arial{\*\falt Helvetica};}{\f11\fmodern\fcharset0\fprq1 Courier New{\*\falt Courier};}{\f47\froman\fcharset238\fprq2 CG Times{\*\falt Times};}} -{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0; -\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\f47 \snext0 Normal;}{\*\cs10 \additive Default Paragraph Font;}{\*\cs15 \additive\f47\fs16\up6\lang1033 \sbasedon10 -footnote reference;}{\s16 \f47\fs20 \sbasedon0\snext16 footnote text;}{\*\cs17 \additive\super \sbasedon10 endnote reference;}}{\info{\author sdfgsdfg}{\operator sdfgsdfg}{\creatim\yr1991\mo10\dy6\hr19\min41}{\revtim\yr1991\mo10\dy6\hr20\min35}{\version1} -{\edmins0}{\nofpages0}{\nofwords0}{\nofchars0}{\vern49197}}\widowctrl\ftnbj\aenddoc\hyphcaps0 \fet0\sectd \linex0\headery709\footery709\colsx709\endnhere {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2 -\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6 -\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang -{\pntxtb (}{\pntxta )}}\pard\plain \keepn \f47 {\cs15\fs16\up6 #{\footnote \pard\plain \s16 \f47\fs20 {\cs15\fs16\up6 #} Help_Contents}${\footnote \pard\plain \s16 \f47\fs20 {\cs15\fs16\up6 $} WVIEW Help}}{\b\f5\fs28 WVIEW Help -\par }\pard -\par {\f5\uldb Choosing Files to View}{\v Choosing_Topic}{\f5\uldb -\par Browsing a Record}{\v Browsing_Topic}{\f5\uldb -\par Options}{\v Options_Topic}{\f5\uldb -\par Searching for Annotations}{\v Searching_Topic}{\f5\uldb -\par Printing}{\v Printing_Topic}{\f5\uldb -\par -\par }\pard \qj {\f5\fs20 This is an alpha release of WVIEW. A number of the controls are not yet implemented, but what is already implemented encompasses the functionality of the MS-DOS}{\f11\fs20 }{\b\f11\fs20 view }{\f5\fs20 -program, with many additional features. Please send your comments, suggestions, and bug reports to the author: -\par }{\fs20 -\par }{\f5\fs20 \tab George B. Moody -\par \tab MIT Room E25-505A -\par \tab Cambridge, MA 02139 USA -\par -\par \tab e-mail: }{\b\f11\fs20 george@mit.edu -\par }{\f11\fs20 -\par }{\f5\fs20 You may download the most recent version of WVIEW from PhysioNet (}{\b\f11\fs20 http://www.physionet.org/}{\f5\fs20 -). Please refer anyone interested in obtaining a free copy of WVIEW to PhysioNet, or to the author at the address above.}{\v MacroDemonstration_Topic}{\f5\uldb -\par }\pard \keepn \page {\cs15\fs16\up6 #{\footnote \pard\plain \s16 \f47\fs20 {\cs15\fs16\up6 #} Choosing_Topic}} {\cs15\fs16\up6 ${\footnote \pard\plain \s16 \f47\fs20 {\cs15\fs16\up6 $} Choosing Files to View}} {\cs15\fs16\up6 +{\footnote \pard\plain \s16 -\f47\fs20 {\cs15\fs16\up6 +} Major_Topics:005}} {\b\f5\fs28 Choosing Files to View -\par }\pard -\par \pard \qj {\f5\fs20 The }{\b\f5\fs20 Choose Inputs }{\f5\fs20 dialog usually appears when you start WVIEW. It allows you to select a WFDB }{\f5\fs20\ul record}{\v WFDB_record}{\f5\fs20 - to view. If you start WVIEW using a command line (for example, by choosing }{\b\f5\fs20 Run...}{\f5\fs20 from the Windows }{\b\f5\fs20 Start}{\f5\fs20 menu), you may supply a }{\f5\fs20\ul record name}{\v WFDB_record_name}{\f5\fs20 - and an }{\f5\fs20\ul annotator name}{\v WFDB_annotator_name}{\f5\fs20 on the command line following the name of the program (}{\b\f11\fs20 wview}{\f5\fs20 -); in this case, WVIEW opens the record immediately (if it is available) without showing the }{\b\f5\fs20 Choose Inputs }{\f5\fs20 dialog. If you supply a record name but omit the annotator name, WVIEW attempts to find the reference (}{ -\b\f11\fs20 atr}{\f5\fs20 ) annotations. At any time, you may pop up the }{\b\f5\fs20 Choose Inputs }{\f5\fs20 dialog by selecting }{\b\f5\fs20 Open...}{\f5\fs20 from the }{\b\f5\fs20 File}{\f5\fs20 - menu, in order to change the record or annotator names, or the }{\f5\fs20\ul WFDB environment}{\v WFDB_environment}{\f5\fs20\ul .}{\f5\fs20 -\par -\par To select sets of signals and annotations to view, fill in the }{\b\f5\fs20 Record name:}{\f5\fs20 field (up to 8 characters), and the }{\b\f5\fs20 Annotator name:}{\f5\fs20 field (up to 3 characters). Leave the }{\b\f5\fs20 Annotator name: }{\f5\fs20 -field empty if the record is unannotated, or if you do not wish to view annotations. Although the WFDB environment may be changed within the }{\b\f5\fs20 Choose Inputs }{\f5\fs20 -dialog, note that the effects of any such changes are limited to the current session of WVIEW (other WFDB applications and future WVIEW sessions are unaffected). -\par -\par The }{\f5\fs20\ul WFDB path}{\v WFDB_path}{\f5\fs20 is a list of directories that are searched when you specify a record or annotator name. -\par }\pard {\f5\fs20 -\par }\pard \qj {\f5\fs20 The }{\f5\fs20\ul WFDB calibration file}{\v WFDB_calibration_file}{\f5\fs20 is a text file containing information about the relative scales of many different types of signals.}{\f5 -\par }\pard \keepn \page {\cs15\fs16\up6 #{\footnote \pard\plain \s16 \f47\fs20 {\cs15\fs16\up6 #} Browsing_Topic}} {\cs15\fs16\up6 ${\footnote \pard\plain \s16 \f47\fs20 {\cs15\fs16\up6 $} Browsing a Record}} {\cs15\fs16\up6 +{\footnote \pard\plain \s16 -\f47\fs20 {\cs15\fs16\up6 +} Major_Topics:010}} {\b\f5\fs28 Browsing a Record -\par }\pard \qj {\f5\fs20 -\par Use the scrollbar at the bottom of the window to move in either direction through the record. If you click on the scrollbar arrows, the display scrolls by 1 second at a time in the indicated direction. Clicking in the rectangles beside the "thumb" of th -e scrollbar scrolls the display by the width of the window. You may also drag the "thumb" to move to any desired location; while doing so, the time corresponding to the current position of the \ldblquote thumb\rdblquote - appears in red near the bottom of the window. -\par -\par Keyboard commands can also perform these functions and others: -\par -\par }\trowd \trgaph108\trleft1332 \cellx3204\cellx6372 \pard \qj\intbl\box\brdrs\brdrw15\brsp20 {\f5\fs20 \cell back 1 second\cell }\pard \intbl {\f5\fs20 \row }\trowd \trgaph108\trleft1332 \cellx3204\cellx6372 \pard \qj\intbl\box -\brdrs\brdrw15\brsp20 {\f5\fs20 \cell forward 1 second\cell }\pard \intbl {\f5\fs20 \row }\pard \qj\intbl\box\brdrs\brdrw15\brsp20 {\f5\fs20 \cell back 1 screenful\cell }\pard \intbl {\f5\fs20 \row }\pard \qj\intbl\box -\brdrs\brdrw15\brsp20 {\f5\fs20 \cell forward 1 screenful\cell }\pard \intbl {\f5\fs20 \row }\pard \qj\intbl\box\brdrs\brdrw15\brsp20 {\f5\fs20 \cell back to beginning \cell }\pard \intbl {\f5\fs20 \row }\pard \qj\intbl\box -\brdrs\brdrw15\brsp20 {\f5\fs20 \cell forward to end\cell }\pard \intbl {\f5\fs20 \row }\pard \qj\intbl\box\brdrs\brdrw15\brsp20 {\f5\fs20 \cell }{\f5\fs20\uldb search forward}{\v Searching_Topic}{\f5\fs20 \cell }\pard \intbl {\f5\fs20 \row -}\pard \qj\intbl\box\brdrs\brdrw15\brsp20 {\f5\fs20 \cell }{\f5\fs20\uldb search backward}{\v Searching_Topic}{\f5\fs20 \cell }\pard \intbl {\f5\fs20 \row }\pard \qj\intbl\box\brdrs\brdrw15\brsp20 {\f5\fs20 \cell -zoom in (increase time scale)\cell }\pard \intbl {\f5\fs20 \row }\pard \qj\intbl\box\brdrs\brdrw15\brsp20 {\f5\fs20 \cell zoom out (decrease time scale)\cell }\pard \intbl {\f5\fs20 \row }\pard \qj\intbl\box\brdrs\brdrw15\brsp20 {\f5\fs20 - +\cell increase signal amplitude\cell }\pard \intbl {\f5\fs20 \row }\trowd \trgaph108\trleft1332 \cellx3204\cellx6372 \pard \qj\intbl\box\brdrs\brdrw15\brsp20 {\f5\fs20 -\cell decrease signal amplitude\cell }\pard \intbl {\f5\fs20 -\row }\pard \qj {\f5\fs20 -\par You may also enter a desired time in the }{\b\f5\fs20 Recenter at }{\f5\fs20 field of the }{\b\f5\fs20 Find}{\f5\fs20 window (accessible from the }{\b\f5\fs20 Edit }{\f5\fs20 menu). WVIEW redraws the display centered on the specified time. - -\par -\par The times shown in the lower corners of the signal window usually indicate elapsed time from the beg -inning of the record in hours, minutes, and seconds (hours are omitted if the elapsed time is less than one hour). If the times are shown enclosed in square brackets, they indicate the actual time of day (and possibly the date) when the signals shown we -re recorded, determined by reference to the base time and date recorded in the header file for the record. -\par -\par }\pard \keepn \page {\cs15\fs16\up6 #{\footnote \pard\plain \s16 \f47\fs20 {\cs15\fs16\up6 #} Options_Topic}} {\cs15\fs16\up6 ${\footnote \pard\plain \s16 \f47\fs20 {\cs15\fs16\up6 $} Options}} {\cs15\fs16\up6 +{\footnote \pard\plain \s16 \f47\fs20 { -\cs15\fs16\up6 +} Major_Topics:015}} {\b\f5\fs28 Options -\par }\pard \qj {\f5\fs20 -\par Use the }{\b\f5\fs20 Options}{\f5\fs20 menu to set display and printing options. The }{\b\f5\fs20 View Options...}{\f5\fs20 - dialog allows you to choose display scales, turn the grid on and off, and select options for annotation and signal display. The }{\b\f5\fs20 Print Options...}{\f5\fs20 dialog is very similar, but its options apply to printed output only. (The }{ -\b\f5\fs20 Print Options... }{\f5\fs20 dialog may also be accessed via the }{\b\f5\fs20 Options...}{\f5\fs20 button in the }{\b\f5\fs20\uldb Print...}{\v Printing_Topic}{\f5\fs20 dialog, which may be opened from the }{\b\f5\fs20 File}{\f5\fs20 menu.) - -\par -\par Select }{\b\f5\fs20 Use default scales and options}{\f5\fs20 from }{\b\f5\fs20 View Options...}{\f5\fs20 to reset all display options to their initial values. In }{\b\f5\fs20 Print Options...}{\f5\fs20 , select }{\b\f5\fs20 -Use display scales and options}{\f5\fs20 to set the printing options to match those you have chosen for display. -\par }\pard -\par \pard \qj {\f5\fs20 If displayed or printed, the }{\b\f5\fs20 grid }{\f5\fs20 marks 200 ms intervals horizontally, and 0.5 mV intervals vertically. (For signals not dimensioned in units of mV, the }{\f5\fs20\ul WFDB calibration file}{\v WFDB_calibration_file -}{\f5\fs20 specifies the scaling factor between the physical units of the signal and mV.) At the default scales, the grid intervals should measure 5 mm on your screen or printed output, corresponding to the standard ECG d -isplay scales of 25 mm/s and 10 mm/mV. (If this is not the case, click on }{\b\f5\fs20 Calibrate...}{\f5\fs20 and follow the instructions on-screen to make appropriate adjustments for your hardware.) -\par -\par }{\b\f5\fs20 Marker bars}{\f5\fs20 -, if displayed or printed, show the exact locations of each annotation. Note that policies for placement of ECG annotations may vary between records (for example, in the MIT-BIH Arrhythmia Database, QRS annotations are placed at the R-wave peak, but in - the AHA Database, these annotations are placed at the PQ junction). -\par -\par Normally, WVIEW shows only the mnemonic corresponding to the primary annotation type (the }{\b\f11\fs20 anntyp}{\f5\fs20 field) of each annotation. Exceptions include }{\b\f11\fs20 RHYTHM}{\f5\fs20 - annotations (for which the rhythm, encoded in the }{\b\f11\fs20 aux}{\f5\fs20 field of the annotation, is shown); }{\b\f11\fs20 LINK}{\f5\fs20 annotations (for which descriptive data encoded in the }{\b\f11\fs20 aux}{\f5\fs20 field are shown);}{ -\b\f11\fs20 NOISE }{\f5\fs20 annotations (for which signal quality data encoded in the }{\b\f11\fs20 subtyp }{\f5\fs20 field is shown); and }{\b\f11\fs20 STCH}{\f5\fs20 ,}{\b\f11\fs20 TCH}{\f5\fs20 , and}{\b\f11\fs20 NOTE}{\f5\fs20 - annotations (for which the contents of the }{\b\f11\fs20 aux }{\f5\fs20 field are shown). To make it easier to identify these exceptions, }{\b\f11\fs20 RHYTHM }{\f5\fs20 -annotations appear below the level of ordinary annotations, and the others appear above the level of ordinary annotations. The representation matches that used in the }{\i\f5\fs20 MIT-BIH Arrhythmia Database Directory}{\f5\fs20 - and other directories, which contain complete lists of the mnemonics used in each database. -\par -\par By selecting the appropriate items from }{\b\f5\fs20 View options... }{\f5\fs20 or }{\b\f5\fs20 Print options...}{\f5\fs20 , you can view or print the contents of the optional annotation fields (}{\b\f11\fs20 subtyp}{\f5\fs20 ,}{\b\f11\fs20 chan}{ -\f5\fs20 ,}{\b\f11\fs20 num}{\f5\fs20 , and }{\b\f11\fs20 aux}{\f5\fs20 , shown from top to bottom in that order if more than one is selected). See the }{\i\f5\fs20 ECG Database Programmer's Guide }{\f5\fs20 -for further information about optional annotation fields. -\par -\par }{\b\f5\fs20 Signal baselines}{\i\f5\fs20 , }{\f5\fs20 -if selected, are displayed or printed only for signals for which absolute levels are significant, such as blood pressure. Such signals are referred to as DC-coupled signals, since they must be digitized without being passed through high-pass filters in o -rder to preserve absolute levels. - In signals such as ECGs, only variations in level, rather than absolute levels, are significant. These AC-coupled signals are high-pass filtered before digitization, in order to remove any DC component, so that the gain can be chosen optimally for the -range of variation in the signal. By default, }{\b\f5\fs20 signal names }{\f5\fs20 appear at the left margin slightly above each signal; deselect }{\b\f5\fs20 Signal names}{\f5\fs20 to suppress this output. The }{\f5\fs20\ul header file}{\v -WFDB_header_file}{\f5\fs20 for each record specifies signal names, and which signals are DC-coupled; see the }{\i\f5\fs20 ECG Database Programmer's Guide }{\f5\fs20 for further information. -\par -\par If the time of the beginning of the record is specified in its header file, WVIEW can display }{\b\f5\fs20 absolute times}{\f5\fs20 - at the lower left and right corners of the window. By default, WVIEW displays elapsed times from the beginning of the record; check }{\b\f5\fs20 Absolute time}{\f5\fs20 - if you prefer to see absolute times (and dates) when looking at records for which this information is available.} -\par \pard \keepn \page {\cs15\fs16\up6 #{\footnote \pard\plain \s16 \f47\fs20 {\cs15\fs16\up6 #} Searching_Topic}} {\cs15\fs16\up6 ${\footnote \pard\plain \s16\sb240 \f47\fs20 {\cs15\fs16\up6 $} Searching for Annotations}} {\cs15\fs16\up6 +{\footnote -\pard\plain \s16 \f47\fs20 {\cs15\fs16\up6 +} Major_Topics:020}} {\b\f5\fs28 Searching for Annotations -\par }\pard \qj {\f5\fs20 Select }{\b\f5\fs20 Find...}{\f5\fs20 from the }{\b\f5\fs20 Edit }{\f5\fs20 menu to bring up the }{\b\f5\fs20 Find }{\f5\fs20 dialog. Enter an annotation mnemonic (e.g., }{\b\f5\fs20 V}{\f5\fs20 ) in the }{\b\f5\fs20 -Search forward }{\f5\fs20 or }{\b\f5\fs20 Search backward}{\f5\fs20 field. Click on the radio button to the left of the chosen search direction, then click on }{\b\f5\fs20 OK}{\f5\fs20 -. WVIEW redraws the signals, centered on the next annotation of the specified type that was not visible in the previous screenful. If the search is unsuccessful, the }{\b\f5\fs20 Find}{\f5\fs20 window remains visible, so that you can - modify the search criteria. -\par -\par In addition to standard annotation mnemonics (listed in the }{\i\f5\fs20 ECG Database Programmer's Guide}{\f5\fs20 ), you may enter signal quality strings (as displayed by WVIEW for }{\b\f11\fs20 NOISE}{\f5\fs20 annotations), or }{\b\f11\fs20 -aux}{\f5\fs20 strings (as displayed for }{\b\f11\fs20 RHYTHM}{\f5\fs20 , ST and T change, and }{\b\f11\fs20 NOTE}{\f5\fs20 annotations). In short, you may search for any string that WVIEW uses when drawing annotations. When specifying }{ -\b\f11\fs20 aux}{\f5\fs20 strings, a prefix is sufficient as a search target (for example, "}{\b\f11\fs20 (S}{\f5\fs20 " matches any annotation with an }{\b\f11\fs20 aux}{\f5\fs20 string beginning with these characters, such as "}{\b\f11\fs20 (SVTA}{ -\f5\fs20 " or "}{\b\f11\fs20 (ST0+}{\f5\fs20 "). -\par -\par To repeat a search forward, press the key; to repeat a search backward, press the key. If you use these keyboard shortcuts without having defined a search target, behaves in the same way as , and in the - same way as (moving to the adjacent screenful in the appropriate direction).} -\par \pard \keepn \page {\cs15\fs16\up6 #{\footnote \pard\plain \s16 \f47\fs20 {\cs15\fs16\up6 #} Printing_Topic}} {\cs15\fs16\up6 ${\footnote \pard\plain \s16\sb240 \f47\fs20 {\cs15\fs16\up6 $} Printing}} {\cs15\fs16\up6 +{\footnote \pard\plain \s16 -\f47\fs20 {\cs15\fs16\up6 +} Major_Topics:025}} {\b\f5\fs28 Printing -\par }\pard \qj {\f5\fs20 You can print the current contents of the WVIEW window or any selected segment of the current record by selecting }{\b\f5\fs20 Print...}{\f5\fs20 from the }{\b\f5\fs20 File }{\f5\fs20 menu to bring up the }{\b\f5\fs20 -Print }{\f5\fs20 dialog. Choose the output device from the }{\b\f5\fs20 Printer}{\f5\fs20 list. Select the range (time interval) to be printed by choosing either }{\b\f5\fs20 Entire Record}{\f5\fs20 , }{\b\f5\fs20 Current Contents of Window}{\f5\fs20 - (the default)}{\b\f5\fs20 , }{\f5\fs20 or }{\b\f5\fs20 Segment}{\f5\fs20 . If you choose }{\b\f5\fs20 Segment}{\f5\fs20 , enter the times of the beginning and end of the desired segment in the }{\b\f5\fs20 From:}{\f5\fs20 and }{\b\f5\fs20 To:}{ -\f5\fs20 fields. Press }{\b\f5\fs20 OK}{\f5\fs20 to begin printing, or }{\b\f5\fs20 Cancel}{\f5\fs20 to return to WVIEW without printing. -\par -\par The }{\b\f5\fs20 Setup...}{\f5\fs20 button opens the printer-specific setup dialog for the selected printer. The }{\b\f5\fs20 Options... }{\f5\fs20 button opens the }{\b\f5\fs20\uldb Print Options}{\b\v\f5\fs20\uldb Options_Topic}{\f5\fs20 - dialog (also accessible via the }{\b\f5\fs20 Options}{\f5\fs20 menu), which allows you to select scales and grid, annotation, and signal printing options. By default, these match the current display scales and options. -\par -\par Although your }{\b\f5\fs20 Printer}{\f5\fs20 selection is retained for the current session of WVIEW, changing it does not - change the Windows default printer, which is the initial printer selection whenever a new WVIEW session begins. To choose a different Windows default printer, use the Printer applet in the Windows Control Panel.} -\par \pard \page {\cs15\fs16\up6 #{\footnote \pard\plain \s16 \f47\fs20 {\cs15\fs16\up6 #}{\lang1024 WFDB_annotator_name}}}{\i\f5\fs20 Annotator name: }{\f5\fs20 - A string (of up to 3 characters under MS-DOS) that identifies a set of annotations (labels) associated with a given record. Annotator names vary, but most standard databases include reference annotation files with the annotator name }{\b\f11\fs20 atr}{ -\f5\fs20 (a shortened form of }{\b\f11\fs20 atruth}{\f5\fs20 , as these files are named on UNIX and most other operating systems). To get a list of available annotators for a given record, find files matching the pattern }{\b\i\f5\fs20 record.*}{ -\f5\fs20 (in any of the directories named in the }{\f5\fs20\ul WFDB path}{\v WFDB_path}{\f5\fs20 , where }{\b\i\f5\fs20 record}{\f5\fs20 is the }{\f5\fs20\ul record name}{\v WFDB_record_name}{\f5\fs20 ); the suffix of the name (omitting the "}{\b\i\f5\fs20 -record.}{\f5\fs20 ") of each such file may be an annotator name. Note that files with }{\b\f11\fs20 dat }{\f5\fs20 or }{\b\f11\fs20 hea }{\f5\fs20 suffixes are not annotation files; there may be other non-annotation files associated with records -as well.} -\par \page {\cs15\fs16\up6 #{\footnote \pard\plain \s16 \f47\fs20 {\cs15\fs16\up6 #}{\lang1024 WFDB_calibration_file}}}{\i\f5\fs20 WFDB calibration file:}{\f5\fs20 - A text file containing specifications for customary plotting scales and calibration pulses of many different types of signals. If the record you wish to view contains signals other than ECGs, make sure that the WFDB calibration file is available to the WFDB - Browser, by setting the MS-DOS environment variable }{\b\f11\fs20 WFDBCAL}{\f5\fs20 to the name of the WFDB calibration file (or by filling in the corresponding field in the } {\b\f5\fs20 Choose Inputs }{\f5\fs20 dialog). Include the drive letter and dir -ectory name in the value of }{\b\f11\fs20 WFDBCAL}{\f5\fs20 only if the file is not in one of the directories named in the WFDB path. A sample WFDB calibration file (called }{\b\f11\fs20 wfdbcal}{\f5\fs20 -) is provided with WVIEW. Unless a non-standard configuration was chosen during installation, }{\b\f11\fs20 setwfdb.bat}{\f5\fs20 sets }{\b\f11\fs20 WFDBCAL}{\b\f5\fs20 }{\f5\fs20 appropriately. See the }{\i\f5\fs20 -WFDB Applications Guide }{\f5\fs20 for further information about the WFDB calibration file.} -\par \page {\cs15\fs16\up6 #{\footnote \pard\plain \s16 \f47\fs20 {\cs15\fs16\up6 #}{\lang1024 WFDB_environment}}}{\i\f5\fs20 WFDB environment: }{\f5\fs20 -A set of MS-DOS environment variables shared by WVIEW and other applications built using the WFDB library. The WFDB environment should generally be initialized before starting Windows, typically using the batch file }{\b\f11\fs20 setwfdb.bat}{ -\f5\fs20 (installed together with WVIEW, and often invoked automatically from }{\b\f11\fs20 autoexec.bat}{\f5\fs20 whenever your system is rebooted). The WFDB environment consists of the }{\f5\fs20\ul WFDB path}{\v WFDB_path}{\f5\fs20 and the }{ -\f5\fs20\ul WFDB calibration file.}{\v WFDB_calibration_file} -\par \page {\cs15\fs16\up6 #{\footnote \pard\plain \s16 \f47\fs20 {\cs15\fs16\up6 #}{\lang1024 WFDB_path}}}{\i\f5\fs20 WFDB path:}{\f5\fs20 A list of directories where WFDB files (}{\f5\fs20\ul signal files}{\v WFDB_signal_file}{\f5\fs20 , }{\f5\fs20\ul -annotation files}{\v WFDB_annotation_file}{\f5\fs20 , and }{\f5\fs20\ul header files}{\v WFDB_header_file}{\f5\fs20 ) may be found. You may initialize the WFDB path before starting Windows, by setting the MS-DOS environment variable }{\b\f11\fs20 WFDB}{\f5\fs20 -, either using }{\b\f11\fs20 setwfdb.bat}{\f5\fs20 , or a command of the form: -\par }{\f11\fs20 }{\b\f11\fs20 set WFDB=;c:\\database;d:\\mitdb -\par }{\f5\fs20 where the value assigned contains the list of directories to be searched, with semicolons (}{\b\f11\fs20 ;}{\f5\fs20 ) used to separate pairs of directories. In the example, the initial semic -olon specifies that the current directory (represented by an empty string) is to be searched first. See the }{\i\f5\fs20 ECG Database Programmer's Guide}{\f5\fs20 for further information about the WFDB path.} -\par \page {\cs15\fs16\up6 #{\footnote \pard\plain \s16 \f47\fs20 {\cs15\fs16\up6 #}{\lang1024 WFDB_header_file}}}{\i\f5\fs20 Header file: }{\f5\fs20 -A text file that names and describes the signals belonging to a given record. Under MS-DOS, header files have names of the form }{\b\i\f5\fs20 record}{\b\f11\fs20 .hea}{\f5\fs20 , where }{\b\i\f5\fs20 record }{\f5\fs20 -is the record name; different conventions are used under other operating systems. See the }{\i\f5\fs20 ECG Database Applications Guide }{\f5\fs20 for further information about header files.} -\par \page {\cs15\fs16\up6 #{\footnote \pard\plain \s16 \f47\fs20 {\cs15\fs16\up6 #}{\lang1024 WFDB_annotation}}}{\i\f5\fs20 Annotation: }{\f5\fs20 -A label, associated with a particular sample (and optionally, a particular signal), that describes a feature of the signal(s) at that time. In ECG records, most annotations are beat (QRS) labels and indicate the QRS type (normal, PVC, SVPB, etc.).} -\par \page {\cs15\fs16\up6 #{\footnote \pard\plain \s16 \f47\fs20 {\cs15\fs16\up6 #}{\lang1024 WFDB_annotation_file}}}{\i\f5\fs20 Annotation file: }{\f5\fs20 A binary file that contains a time-ordered set of }{\f5\fs20\ul annotations}{\v WFDB_annotation}{ -\f5\fs20 for some or all of the signals belonging to a given record. Under MS-DOS, annotation files have names of the form }{\b\i\f5\fs20 record.ann}{\f5\fs20 , where }{\b\i\f5\fs20 record }{\f5\fs20 is the record name, and }{\b\i\f5\fs20 ann }{ -\f5\fs20 is the annotator name; different conventions are used under other operating systems. See the }{\i\f5\fs20 ECG Database Applications Guide }{\f5\fs20 for further information about annotation files.} -\par \page {\cs15\fs16\up6 #{\footnote \pard\plain \s16 \f47\fs20 {\cs15\fs16\up6 #}{\lang1024 WFDB_signal_file}}}{\i\f5\fs20 Signal file: }{\f5\fs20 -A binary file that contains a time-ordered set of digitized samples of one or more signals belonging to a WFDB record. A record may contain more than one signal file; all signal files belonging to a given record are named in the record's }{\f5\fs20\ul -header file}{\v WFDB_header_file}{\f5\fs20 . There are no restrictions on signal file names other than those imposed by the operating system. Commonly, signal files are given names of the form }{\b\i\f5\fs20 record}{\b\f11\fs20 .dat}{\f5\fs20 , where }{ -\b\i\f5\fs20 record }{\f5\fs20 is the record name.} -\par \page {\cs15\fs16\up6 #{\footnote \pard\plain \s16 \f47\fs20 {\cs15\fs16\up6 #}{\lang1024 WFDB_record}}}{\i\f5\fs20 Record: }{\f5\fs20 A set of files that may include }{\f5\fs20\ul signal files}{\v WFDB_signal_file}{\f5\fs20 , }{\f5\fs20\ul annotation files} -{\v WFDB_annotation_file}{\f5\fs20 , and a }{\f5\fs20\ul header file}{\v WFDB_header_file}{\f5\fs20 -, all of which are associated with the same original signals. Only the header file is mandatory. Although records are sometimes called tapes for historical reasons, records are now more commonly maintained on optical or magnetic disks than on tape.} - -\par \page {\cs15\fs16\up6 #{\footnote \pard\plain \s16 \f47\fs20 {\cs15\fs16\up6 #}{\lang1024 WFDB_record_name}}}{\i\f5\fs20 Record name: }{\f5\fs20 A string (of up to 8 characters) that identifies a WFDB }{\f5\fs20\ul record.}{\v WFDB_record}{\f5\fs20 - Record names for the MIT-BIH Arrhythmia Database are 3-digit -numbers beginning with 1 or 2 (e.g., 100, 203; not all such numbers are assigned as record names, however). Record names for other databases follow different conventions. To get a list of available records, find files matching the pattern }{\b\f11\fs20 -*.hea}{\f5\fs20 (in any of the directories named in the }{\f5\fs20\ul WFDB path}{\v WFDB_path}{\f5\fs20 ); the first part of the name (omitting the "}{\b\f11\fs20 .hea}{\f5\fs20 -" suffix) of each such file is the name of the record with which it is associated. -\par }} \ No newline at end of file diff -Naur --exclude Makefile --exclude info wfdb-10.3.15/wview/wvscript.c wfdb-10.3.16/wview/wvscript.c --- wfdb-10.3.15/wview/wvscript.c 2000-01-30 04:13:27.000000000 -0500 +++ wfdb-10.3.16/wview/wvscript.c 1969-12-31 19:00:00.000000000 -0500 @@ -1,68 +0,0 @@ -/* file: wvscript.c G. Moody 21 May 1997 - Last revised: 7 May 1999 - -------------------------------------------------------------------------------- -wvscript: remote control of 'wview' (e.g., from a web browser) -Copyright (C) 1999 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 - -main(argc, argv) -int argc; -char **argv; -{ - FILE *script; - static char record[20], annot[20] = "-", pstart[40]; - static char script_line[128], command_line[128]; - - if (argc < 2) { - fprintf(stderr, "usage: wvscript script-file\n"); - exit(1); - } - if ((script = fopen(argv[1], "rb")) == NULL) { - fprintf(stderr, "wvscript: can't open %s\n", argv[1]); - exit(2); - } - while (fgets(script_line, sizeof(script_line), script)) { - char *p, *q; - - if (strncmp(script_line, "-r", 2) == 0) { - for (p = script_line+3, q = record; *p != '+' && *p != '\n'; ) - *q++ = *p++; - *q = '\0'; - } - else if (strncmp(script_line, "-a", 2) == 0) { - for (p = script_line+3, q = annot; *p != '\n'; ) - *q++ = *p++; - *q = '\0'; - } - else if (strncmp(script_line, "-f", 2) == 0) { - for (p = script_line+3, q = pstart; *p != '\n'; ) - *q++ = *p++; - *q = '\0'; - } - } - sprintf(command_line, "wview %s %s %s\n", record, annot, pstart); - system(command_line); - return (0); -} -