file: MAC.TXT G. Moody 17 July 1992 Last revised: 18 February 1997 DB software installation notes for Macintosh users These notes, based on user reports, may be helpful if you intend to use the DB software under the Macintosh OS. If you are using A/UX, MkLinux, or another UNIX variant on your Macintosh, refer to the file named `UNIX', in this directory. Note that `sample', `view', and `vsetup' are MS-DOS-specific, and that `dbtool' and `dbplot' are UNIX-specific. Users have reported that the remainder of the software in this package can be compiled with minor modifications as noted below, using THINK C 5.0 (Symantec Corp., 10201 Torre Ave., Cupertino, CA 95014 USA; telephone +1 408 253 9600) or using Apple's MPW C. Begin by building the DB library (from the sources in the `lib' folder). Before beginning the compilation, uncomment the line that defines the symbol MAC at the beginning of `dblib.h'. You may also wish to redefine the default DB path (DEFDBP, also in `dblib.h'). See the note for CD-ROM users, and the step-by-step instructions below. The `contrib' folder contains `macview.c', a program for viewing DB records on a Macintosh, kindly contributed by Patrick Hamilton. Copy `db.h' from the `lib' folder into the `contrib' folder before compiling `macview'. `macview' also requires a resource file (not included in this package). Please get in touch with Pat (his address is in the macview.c source file) for further information if necessary. Before compiling programs from the `app', `convert', and `examples' folders, modify all statements of the form #include #include #include to statements of the form #include "db.h" #include "ecgcodes.h" #include "ecgmap.h" and copy the necessary `.h' files from the `lib' folder into the folders containing the programs to be compiled. These programs are all command-line oriented, and you may want to modify them to provide alternate methods for selecting inputs, outputs, and options. Note for CD-ROM users: ---------------------- Almost all CD-ROMs produced after 1991 (other than those specifically made for the Macintosh) are written in ISO 9660 format. The second and later editions of the MIT-BIH Arrhythmia Database and the MIT-BIH Polysomnographic Database, as well as the MGH/MF Waveform Database are ISO 9660 CD-ROMs. If your Macintosh system software has not been updated for a long time, it may get confused by `version numbers' attached to filenames on these CD-ROMs. In this case, all filenames will appear to end with the characters `;1'. (Older High Sierra format CD-ROMs, including the European ST-T Database CD-ROM, do not present this problem.) To solve this problem, update your system software so that `ISO 9660 File Access' in the `System:Extensions' folder is version 5.0 or later. If you cannot do so, uncomment the line that defines the symbol FIXISOCD at the beginning of `dblib.h' to get a work-around for this problem. If you need to read both High Sierra and ISO 9660 CD-ROMs, and you cannot update your system software, define FIXISOCD as above, and also replace the the definition of `sprintdbf' in `dbio.c' (immediately above the `#ifdef MAC' statement) with: #define sprintdbf(S, TYPE, RECORD) (void)sprintf(S, "%s.%.3s", RECORD, TYPE) Since `sprintdbf' also generates DB output file names, this change means that any DB files that you create will have MS-DOS-style names (i.e., with file types encoded as suffixes, and restricted to 3 characters). Step-by-step instructions for creating the DB library using Think C ------------------------------------------------------------------- I have freely adapted Pat Hamilton's detailed notes for Think C users to reflect recent changes in the DB library and in the Macintosh system software. Any errors in the following are mine and not Pat's; please help me fix them! 1. If file names on the CD-ROM all appear to end with `;1', your system software needs to be updated; do so first (see the previous section). 2. Copy a set of DB library sources (annot.c, calib.c, dbinit.c, dbio.c, signal.c, db.h, dblib.h, ecgcodes.h, and ecgmap.h) into your development folder. The most recent versions can be downloaded by anonymous FTP from ecg.mit.edu, or using your Web browser (point it to http://ecg.mit.edu). If you obtain the sources in this way, your FTP or browser software converts them from UNIX to Macintosh text format automatically. Alternatively: 2a. Copy the sources from the software:db:lib folder of the CD-ROM. (If your system software isn't up-to-date, these appear on the CD-ROM as `annot.c;1', etc.; in this case rename them, removing the `;1' in each case.) 2b. If you open these files with a standard editor they will look a little odd because lines end with ASCII line feed characters (UNIX newlines) rather than ASCII carriage-return characters (Macintosh newlines). With Microsoft Word, the newline character will look like a "]". Use the replace function to replace all "]" with carriage returns. You will have to use copy and paste to get the "]" and carriage return into the replace boxes, because you can't type these control characters. (Most C compilers accept either line-feed or carriage-return characters, or both, as line separators, so this step may be unnecessary. Even if it is necessary, an automated solution to this problem would be preferable. Suggestions are welcome!) 3. Create a project that includes annot.c, calib.c, dbinit.c, dbio.c, and signal.c. 4. Uncomment "#define MAC" in dblib.h. If your system software is old and cannot be updated, also uncomment "#define FIXISOCD" in dblib.h. 5. By default, the database path (the list of folders where the DB library searches for input files) is defined in udb:dbpath.mac on the CD-ROM. For flexibility, you may copy this file to a writable disk and edit it. If you do so, change the definition of DEFDBP in dblib.h so that it names the edited file following the initial `@' character. (Be sure to change the appropriate definition: the first one is for use if you defined FIXISOCD above, the second one is for up-to-date Macs, and the third one is for non-Mac users.) 6. Select "OPTIONS..." in the edit menu. In the "Language Settings window" check the #define __STDC__ box. (Since __STDC__ is defined in dblib.h once you perform step 4, is this necessary? Does checking this box also change the behavior of the compiler? Please let me know if you can answer these questions!) 7. Compile and link the library using the build library function in the project menu. Your comments are requested --------------------------- I would greatly appreciate a report of any problems you encounter in installing or using this software, if possible by e-mail to george@hstbme.mit.edu, or to: George B. Moody MIT Room 20A-113 Cambridge, MA 02139 USA I would be particularly interested in hearing from anyone who has solved the problem of reading UNIX-format text files on the Mac Since I don't have a Macintosh myself, support for Mac-specific problems is limited to what I have learned from users. For this reason, I am especially grateful for reports of problems that you are able to fix. Any such fixes are made available to others who may encounter the same problems. If I can't answer your questions, I will try to forward them to someone who can do so.