Path: utzoo!mnetor!uunet!husc6!purdue!i.cc.purdue.edu!j.cc.purdue.edu!ain From: ain@j.cc.purdue.edu (Patrick White) Newsgroups: comp.sources.amiga Subject: MRBackup (part 1 of 4) Message-ID: <6290@j.cc.purdue.edu> Date: 28 Jan 88 16:24:58 GMT Organization: PUCC Land, USA Lines: 1236 Keywords: MRBackup, untested, source, part 1 of 4. Approved: ain@j.cc.purdue.edu (Pat White) Program Name: MRBackup Submitted By: uiucdcs!amanpt1.ZONE1.COM!mrr@ee.ecn.purdue.edu (Mark Rinfret) Summary: A hard disk backup utility. Poster Boy: Pat White (ain@j.cc.purdue.edu) Untested. NOTES: I reshar'ed all of the source to get rid of some explicit path references in where the files get put. Now it will unshar on unix and the Amiga into the current directory. I did *not* change the explicit path references to include files in the .c files. I also included the docs that were sent with the binary version, so these 4 parts are complete source with docs. -- Pat White (co-moderator comp.sources/binaries.amiga) UUCP: j.cc.purdue.edu!ain BITNET: PATWHITE@PURCCVM PHONE: (317) 743-8421 U.S. Mail: 320 Brown St. apt. 406, West Lafayette, IN 47906 ======================================== # This is a shell archive. # Remove everything above and including the cut line. # Then run the rest of the file through sh. #----cut here-----cut here-----cut here-----cut here----# #!/bin/sh # shar: Shell Archiver # Run the following text with /bin/sh to create: # MRBackup.TXT # ReadMe # AboutTheSource # ToDo # MRBackup.init # MRBackup.xcld # Makefile # AmigaFunctions.h # Console.h # ConsoleStuff.h # DiskMisc.h # Gadget.h # MRBackup.h # MRDates.h # Menu.h # Timer.h # This archive created: Thu Jan 28 10:58:52 1988 # By: Patrick White (PUCC Land, USA) echo shar: extracting MRBackup.TXT '(16232 characters)' cat << \SHAR_EOF > MRBackup.TXT MRBackup Version 2.0 A Hard Disk Backup Utility for the Commodore Amiga 2 January 1988 Author: Mark R. Rinfret Introduction This document describes a program, named MRBackup (pronounced M R Backup, not Mister Backup :-), which will allow you to backup an Amiga hard disk drive to floppy disk media. I wrote MRBackup primarily out of my own need. I also saw it as a means for learning more about programming the Amiga. If you are already familiar with this program, you may want to jump to the "Changes" section at the end of this document. Otherwise, read on. MRBackup is reasonably flexible, allowing you to back up individual directories, directory trees or a whole disk. You can backup from one directory hierarchy and restore to another. Incremental backups can be performed based on file modification dates. Just for fun, MRBackup also talks. Though this is mostly frivolous, the speech capability provides a method for alerting you that a new output disk is required for formatting. MRBackup is not fast. When choosing a method for packing the backup data, a fast-scan approach with specialized backup directory structure was considered. However, there is an inherent danger in committing multiple files to a specialized file system which can only be accessed through a solitary piece of software. I decided to maintain the AmigaDOS file system structure which has a great deal of integrity and allows the backup media to be accessed by standard software. When I do it again, I'll probably go with the specialized approach - the current method is just too darned slow. The user should take a serious and organized approach to his backup methods, however. I highly recommend that backup listings be kept in a safe place (I use a 3-ring binder) and backup floppies be stored safe from magnetic damage or other hazards (like spilled coffee - argh!). A truly committed individual will backup his entire disk once a month, once a week and "areas of interest" once a day (default). MRBackup attempts to economize on output media usage by using data compression/decompression (at the cost of time). This is an option which can be enabled/disabled via menu selection. The compression routine used was lifted from the Un*x "compress" program but has been adapted to employ buffering and AmigaDOS I/O. Operation To use MRBackup, click on the program icon or type MRBackup at the CLI prompt. A new window will open in which you will see a STOP sign, some other gadgetry, and a couple of embedded windows. If you click with the right mouse button and drag from left to right across the menu bar, you'll see the various program menus which control MRBackup's operation. The "Pathname Specifications" window is where you tell MRBackup where data is coming from and going to. It is important to note that the meanings of "Home Path" and "Backup Path" remain the same for a backup or a restore operation. That is, the "Home Path" always refers to the files' normal "home" and "Backup Path" always refers to the location where the copies are kept. The "Listing Path" refers to the destination of a detailed listing of the contents of the backup floppies and may specify the printer (default) or a file on the hard disk. The listing is an option which may be enabled/disabled via menu selection. The "Exclude Path", if specified, is the name of a file which contains lines describing files which should not be backed up. Any filename matching an entry in this list will be excluded from the backup. The exclude file consists of file specifications, one per line, or comments (a line with a number sign - # - in column 1). Blank lines are ignored. Also, the specifications are case-insensitive. That is, "SYSTEM" and "system" are equivalent. Examples: # Exclude all object files *.o # Exclude all files beginning with "System": system* # Exclude all ".info" files: *.info # Exlude the "include" directory and all subdirectories: include You can customize the operation of MRBackup through the use of an initialization file. This file must be named S:MRBackup.init. With it, you may set your desired defaults and Flags. Each line in the file consists of an option setting, of the form: OPTION = VALUE or a comment. Comment lines begin with a number sign (#). A sample initialization file is included which illustrates the use of all possible parameter settings. Backing Up a Disk To back up your hard disk, or a section of it, first get an indication of the size of the area with the Info command, "ls" (if you have it), List, etc. If you multiply the total number of bytes (blocks * 512) by 0.65, then divide by 800000, you should get a very rough estimate (probably high) of the number of floppy disks required to back up that area. The floppies selected for backup need not be preformatted, as MRBackup will format them as needed. You should be sure, however, that no valuable data exists on them since it will be destroyed by the formatting process, if formatting is enabled. Once your floppies are ready and stacked neatly within reach, the fun begins. First, modify the pathname specifications according to your requirements. Normally, the "Home Path" would be the device name of your hard disk or a directory on it (e.g. DH0:src) while the "Backup Path" would specify the device name of one of your floppy drives (e.g. DF0:). While earlier versions of MRBackup were pretty rigid in this regard, this version will allow you to specify ANY disk device name in either specification. PLEASE BE CAREFUL! Many users asked for this increased flexibility. Just be aware that it carries with it an increased risk that you now have more "opportunity" to burn yourself with improper pathname specifications. Finally, the listing path may be set to the printer device (PRT:) or to the name of a file on a hard drive or any available floppy drive not being used by the backup. The listing path will be ignored if you disable the Generate Listing option in the Flags menu. Make sure that you have set the desired options in the Flags menu, then select Backup from the Project menu. You will be prompted with a date requester. The default date value that appears is one day earlier than the current date. If that is satisfactory, simply depress the RETURN key and the backup will commence. If you desire to change the date, edit the date value as necessary, using the standard Amiga conventions. Remember that to clear the gadget you may press right-Amiga-x. A null date value (all blanks) is allowed, should you want to backup all files in the home path, regardless of their creation dates. Otherwise, the required date and time format is MM/DD/YY HH:MM:SS (24 hour clock), the time specification being optional. You will notice upward and downward pointing "arrows" above each date component. Clicking on the appropriate arrow will increment or decrement the respective portion of the date. Though the values normally will wrap around, not affecting adjacent date components, certain situations will arise where incrementing a day value may cause the month to increment (incrementing February 28 in a non-leap-year will yield March 31). I just didn't feel the extra logic was worth it (I got lazy). Once the date has been entered, the rest is fairly automatic. You will be prompted immediately for a floppy disk. Insert it into the floppy drive that you specified in the backup path and the disk requester will be satisfied. Should you want to abort, simply hit the CANCEL gadget in the requester. Also, you may abort the backup process at any time by hitting the STOP gadget which appears in the top left area of the screen. This gadget is only checked prior to the start of the next file copy operation, so be patient if it does not respond immediately. As each floppy disk is filled, you should promptly label it. If formatting is enabled, MRBackup automatically generates volume names of the form: Backup MM-DD-YY. Also to be noted is the fact that the files on the backup media retain the creation/modification date (I wish they were distinct) of their counterparts on the home device. You will find that the Amiga's multitasking environment shines when using this program. For those long-haul backups, get everything started, then shove MRBackup's screen to the back and go start something useful. MRBackup will carry on without your watchful eye. When it needs a disk, the disk requester will pop out in front of everything and MRBackup will ask (out loud, if speech is enabled ) for another disk. Having something else to do will make the time pass faster. Restoring the Backups No, this isn't always the bad part. Backup and restore can also be useful when your hard disk is crowded and you have to "juggle" data around. The restoration process is quite similar, mechanically, to the backup process - it's just reversed. In addition, the meanings of the pathname specifications are altered somewhat. The "Home path" describes the destination for the restored files and, as with the backup process, may specify the hard drive only or a directory specification. The "Backup path" describes the file or files to be restored and thus may be defined down to the file level (1 file). Note that on a restore operation, the file creation date of the backup file is compared to its matching file (if it exists) on the home device. If the file on the home device is newer, the file will not be replaced. If this is desired, the file on the home device must be deleted first. A later version of this program will probably offer a "force" or "force with prompt" option. Warranties There are no warranties, either expressed or implied, with regard to the use of this program. You didn't pay for it (did you?), so how you gonna' get you money back? Seriously, folk, I've tested this beastie fairly thoroughly (I intend to USE it!), but you know how things go...there may be a bugaboo or two lurking in there. Please exercise it a little before committing your life (your precious data) to its care. Permissions This program is contributed to the public domain, as a token of gratitude for the many wonderful programs I have received through the same channels. Feel free to enhance, destroy, sell, distribute or otherwise benefit from the legal use of this program. I would love to hear from those of you who find this either useful or useless (with specific criticisms in the latter case). If you make any enhancements (there's room for PLENTY), please share them with me and the rest of the world. I can be reached as: mrr@amanpt1.ZONE1.COM ...rayssd!galaxia!amanpt1!mrr or Mark R. Rinfret 348 Indian Avenue Portsmouth, RI 02871 401-846-7639 (home) 401-849-8900 (work) Changes Since the Last Release This section lists changes that have been introduced in version 2.0. Though I will attempt to be thorough, some things may slip through the cracks. Please forgive any oversights. New User Interface MRBackup has undergone a major facelift. It now has its own screen and color palette and newly designed menus and gadgetry. All of this is due to my use of PowerWindows 2.0 from Inovatronics, a very worthwhile tool for Intuition programming. You will notice some new gadgetry on the screen. I've added a "fuel gauge" which indicates the "fullness" of the output floppy. There's a new error count gadget which tracks total errors encountered and a "Current Backup Volume Name" gadget which keeps you informed as to which disk you're currently archiving to or restoring from. The Pathname Specifications window has a close box which will make the window go away. A new menu, Windows, has an item Pathnames which will reopen the window for you. A new command, Save Preferences, allows you to save your current pathname specs and flags to the preferences file (S:MRBackup.init). The Flags menu has been totally redone. This menu previously consisted of item pairs (/No - pretty dumb, I must admit - I think I was intrigued by mutual exclusion at the time). The new Flags menu just consists of check-marked items. If an item is checked, the feature is enabled. Improved Error Handling This is usually the hardest task in any programming chore and usually gets the least attention. Previous versions of MRBackup were no exception. Version 2.0, however, has come a long way in this direction, especially in the area of recoverability. A new requester has been introduced which lists your recovery (or abort) options when certain errors have been detected. Most significantly, new context-saving code has been added which will allow you to restart a backup disk from its beginning, should a non-recoverable output error occur. Currently, this context information is saved in memory. I would like to save it to a file on the system disk. This, coupled with a new command (Resume Backup), would allow recovery even from a power failure. Increased Flexibility Previous versions of MRBackup were fairly rigid with regard to home and backup path specifications. Version 2.0 allows ANY disk device to be referenced in either location. On systems with dual floppy disks, you can even backup from floppy to floppy! MRBackup now allows you to suppress formatting of the backup disk. This allows you to "freshen" a previously created backup set. Though this option should be used with care, it does speed things up and enhances MRBackup's partial backup capability. Big File Handling This is truly a last-minute item! I personally don't have a file big enough to require this, so I didn't address the problem. However, enough users have requested this that I took a stab at it. "Big" files, according to MRBackup, are files which are larger than the formatted capacity of the output media. Iff (sic) you enable the "Do Big Files" and "Format Destination" Flag menu items, MRBackup will split big files across multiple floppy disks. If these options are not enabled, MRBackup will just complain that the file is too big to back up and go on. Some of you will probably think that the method used to do this is somewhat kludgy, but it's consistent with my approach to total AmigaDOS compatibility. When backing up a big file, a special information file, MRBackup.bigfile, is written to the output disk. The information file contains stuff like the file name, the "chunk number" (which piece of the file is this?), the chunk size, and a flag which indicates whether this is the last chunk. This information is used by the restore operation to insure that the file chunks get reassembled in the correct order. In order to test this, I had to write a program to create a big file (slightly larger than 1 floppy disk), archive it and restore it, then compare the two files. To do all this, I had to first clean house on my 20 MB hard drive! The big file backup appears to work OK. I think it could use some more testing, however, and would encourage you to test drive it before you commit to it. SHAR_EOF if test 16232 -ne "`wc -c MRBackup.TXT`" then echo shar: error transmitting MRBackup.TXT '(should have been 16232 characters)' fi echo shar: extracting ReadMe '(3242 characters)' cat << \SHAR_EOF > ReadMe This is MRBackup, version 2.0. This program was written under Manx Aztec C, version 3.40b, to run under KickStart 1.2. The source was written with 4 character tab settings, using Z, a vi-like editor packaged with the Aztec C compiler. If you would like a copy of my file retab utility to remove or alter the tabs, just ask. Also, if you did not receive source with this distribution, it is available for the asking. See the instructions in the About menu. Be sure to copy the files MRBackup.init and MRBackup.xcld to the S: directory. Mark R. Rinfret mrr@amanpt1.ZONE1.COM --------------------------------------------------------------------- About the program... MRBackup evolved from a simple-minded program with a tty-style interface to the version you see here. Though I'm a true believer in structured programming techniques, good design and consistent style, you'll see plenty of "holes" in the program where expedience won out over good design (design == time, time == scarce_resource). This version has been groomed significantly and should be much more robust. The code is much more consistent and readable, though there is probably a significant amount of "fat" that could be trimmed, especially in the realm of error handling and reporting. I also am a true believer in "using someone else's wheel" (if it's free) rather than inventing my own. I've incorporated several public domain sources into MRBackup, each having its own particular style. I've made every effort to give credit where credit is due. If I've slighted anyone, please help me to correct the problem. The evolution of MRBackup from version 1.3 to 2.0 was a continuing learning experience for me. The Intuition programming was made a whole lot easier through the use of the improved PowerWindows 2.0 (no affiliation - just a satisfied customer). There is nothing particularly clever about any of the disk-related stuff. I've adhered to vanilla AmigaDOS throughout. As I mentioned in the ToDo file, I'll probably abandon this approach in a new version (different name, not free, but cheap) that I'm considering. The ability to handle files larger than the capacity of a floppy was a last-minute addition. I was going to cop out again and not do it, but I just couldn't. Don't go getting all excited, now. You may not find my implementation to your liking (that will make two of us). However, it seems to work (if you are careful) and you get what you pay for :-). I also added the ability to back up without formatting. This could get messy, if not judiciously used. Please feel free to modify this program and re-release it. If you make substantial changes, I'd like to hear about them. I'd also like you to change the name of the program, perhaps to Backup, as I've done. Funny how many people call it "Mister Backup"... 'Nuff yak. I've received a surprising number of long distance phone calls regarding MRBackup and have mailed a lot of diskettes to people requesting the source. Thanks to all who took the time (and expense) to give me encouragement. Thanks, also, to the UseNet "heavies" and CATS for their technical support. Mark SHAR_EOF if test 3242 -ne "`wc -c ReadMe`" then echo shar: error transmitting ReadMe '(should have been 3242 characters)' fi echo shar: extracting AboutTheSource '(811 characters)' cat << \SHAR_EOF > AboutTheSource MRBackup consists of two source libraries - the main source and a set of support packages. The original file structure during development looked like: main source - :src/utility/mrbackpu support - :src/lib There are specific include references to :src/lib, so you should either maintain this structure or edit all references as appropriate. I've made a conscious effort to get everything to compile relative to the current disk, so you should be able to stuff this all onto a floppy, CD to the directory containing the main source and "make mrbackup". This program was created for Aztec C, and I've done little to insure its portability to Lattice (wish I could afford Lattice 4.0). If anyone makes the necessary modifications, please send me the sources or the diffs to your changes. Thanks. SHAR_EOF if test 811 -ne "`wc -c AboutTheSource`" then echo shar: error transmitting AboutTheSource '(should have been 811 characters)' fi echo shar: extracting ToDo '(529 characters)' cat << \SHAR_EOF > ToDo "To do" list for MRBackup: MRBackup has gone about as far as I intend to take it in its public domain form (greed rears its ugly head!). Alas, though I would like to stay with the "native" filesystem format, the performance of the program suffers too much. I have some ideas for a very fast version which, if I pursue, I'll probably try to sell. I'll continue to support MRBackup in its current form and might even be pursuaded to add some trivial features and ALWAYS will accept bug reports and try to get them fixed. SHAR_EOF if test 529 -ne "`wc -c ToDo`" then echo shar: error transmitting ToDo '(should have been 529 characters)' fi echo shar: extracting MRBackup.init '(806 characters)' cat << \SHAR_EOF > MRBackup.init # This is the user preferences file for MRBackup. This file MUST be # copied to "S:MRBackup.init" in order to be successfully used. # This file should serve as an example for all possible preference # settings. Any line starting with "#" is assumed to be a comment and # is ignored. Note that if you use "Save Preferences", you will lose # these comments. # # Note: No provision is currently made for quoted parameters, so it is # not currently possible to do things like # LIST = "A name with embedded spaces". # If the outcry is great, I'll add that capability. # # This file is compatible with version 2.0. # home = DH0: backup = DF1: list = s:MRBackup.list exclude = S:MRBackup.xcld compression = YES listing = NO speech = YES format = YES bigfiles = YES SHAR_EOF if test 806 -ne "`wc -c MRBackup.init`" then echo shar: error transmitting MRBackup.init '(should have been 806 characters)' fi echo shar: extracting MRBackup.xcld '(140 characters)' cat << \SHAR_EOF > MRBackup.xcld # The terminating asterisk in some names supresses the ".info" files. AmigaBasic* c devs Empty* l lib libs Preferences* System* t Trashcan* SHAR_EOF if test 140 -ne "`wc -c MRBackup.xcld`" then echo shar: error transmitting MRBackup.xcld '(should have been 140 characters)' fi echo shar: extracting Makefile '(3176 characters)' cat << \SHAR_EOF > Makefile CFLAGS = -b +IMRbackup.dmp MFLAGS = -b # Select one of the following definitions. Select the first one if # you want debugging code added. # DEBUG = -DDEBUG DEBUG = SRC = About.c Backup.c BigFiles.c Compress.c Console.c CopyFile.c Error.c \ IntuiHandler.c List.c MiscRequest.c Restore.c UserPrefs.c OBJ = About.o Backup.o BigFiles.o Compress.o Console.o CopyFile.o Error.o \ IntuiHandler.o List.o MiscRequest.o Restore.o UserPrefs.o # Designate the directory which holds the source and object for the # miscellaneous support routines. Actually, it would be nice to # collect these into a library...real soon now... LIB = :src/lib LIBSRC = $(LIB)/DateRequest.c $(LIB)/MRDates.c \ $(LIB)/DiskMisc.c $(LIB)/FileMisc.c $(LIB)/FormatDisk.c \ $(LIB)/sendpkt.c $(LIB)/Speech.c $(LIB)/Timer.c $(LIB)/unixwild.c LIBOBJ = $(LIB)/DateRequest.o $(LIB)/MRDates.o \ $(LIB)/DiskMisc.o $(LIB)/FileMisc.o $(LIB)/FormatDisk.o \ $(LIB)/sendpkt.o $(LIB)/Speech.o $(LIB)/Timer.o $(LIB)/unixwild.o $(LIB)/DateRequest.o: $(LIB)/DateRequest.c cc $(MFLAGS) -o $(LIB)/DateRequest.o $(LIB)/DateRequest.c $(LIB)/MRDates.o: $(LIB)/MRDates.c cc $(MFLAGS) -o $(LIB)/MRDates.o $(LIB)/MRDates.c $(LIB)/DiskMisc.o: $(LIB)/DiskMisc.c cc $(MFLAGS) -o $(LIB)/DiskMisc.o $(LIB)/DiskMisc.c $(LIB)/FileMisc.o: $(LIB)/FileMisc.c cc $(MFLAGS) -o $(LIB)/FileMisc.o $(LIB)/FileMisc.c $(LIB)/FormatDisk.o: $(LIB)/FormatDisk.c cc $(MFLAGS) -o $(LIB)/FormatDisk.o $(LIB)/FormatDisk.c $(LIB)/sendpkt.o: $(LIB)/sendpkt.c cc $(MFLAGS) -o $(LIB)/sendpkt.o $(LIB)/sendpkt.c $(LIB)/Speech.o: $(LIB)/Speech.c cc $(MFLAGS) -o $(LIB)/Speech.o $(LIB)/Speech.c $(LIB)/Timer.o: $(LIB)/Timer.h $(LIB)/Timer.c cc $(MFLAGS) -o $(LIB)/Timer.o $(LIB)/Timer.c $(LIB)/UnixWild.o: $(LIB)/UnixWild.c cc $(MFLAGS) -o $(LIB)/UnixWild.o $(LIB)/UnixWild.c Main.o: MRBackup.h Console.h cc $(DEBUG) -b Main.c IntuiHandler.o: MRBackup.dmp Menu.h Screen.c $(OBJ): MRBackup.dmp MRBackup.dmp: MRBackup.h Gadget.h Console.h Menu.h cc $(DEBUG) +HMRBackup.dmp MRBackup.h MRBackup: Main.o $(OBJ) $(LIBOBJ) ln -w -o MRBackUp +CDB Main.o $(OBJ) $(LIBOBJ) -lc MRBackup.TXT: MRBackup.DOC zoo: MRBackup MRBackup.TXT README ToDo MRBackup.init MRBackup.xcld \ zoo -add MRBackup MRBackup MRBackup.TXT README ToDo S:MRBackup.init MRBackup.xcld MRBackup.uue: MRBackup uuencode > MRBackup.uue MRBackup MRBackup MRBackup.info.uue: MRBackup.info uuencode > MRBackup.info.uue MRBackup.info MRBackup.info EXECFILES = ReadMe MRBackup.info.uue MRBackup.TXT MRBackup.init \ MRBackup.xcld ToDo execshar: $(EXECFILES) MRBackup.uue echo "Making shar of executables." uusplit MRBackup.uue delete MRBackup.uue makekit -n EXEC $(EXECFILES) MRBackup.uue* delete MRBackup.uue#? date > execshar SRCFILES = AboutTheSource $(SRC) Makefile srcshar: $(SRCFILES) echo "Making shar of sources." makekit -n SRC *.h $(SRCFILES) date > srcshar libshar: $(LIBSRC) echo "Making shar of library sources." makekit -n LIB $(LIB)/*.h $(LIBSRC) date > libshar shar: execshar srcshar libshar echo "Archives have been built" date > shar > libshar shar: execshar srcshar libshar echo "Archives have been built" date > shar SHAR_EOF if test 3176 -ne "`wc -c Makefile`" then echo shar: error transmitting Makefile '(should have been 3176 characters)' fi echo shar: extracting AmigaFunctions.h '(104 characters)' cat << \SHAR_EOF > AmigaFunctions.h #ifdef AZTEC_C # ifndef AMIGAFUNCTIONS # include # define AMIGAFUNCTIONS # endif #endif SHAR_EOF if test 104 -ne "`wc -c AmigaFunctions.h`" then echo shar: error transmitting AmigaFunctions.h '(should have been 104 characters)' fi echo shar: extracting Console.h '(568 characters)' cat << \SHAR_EOF > Console.h /* Console I/O Routines Header File * Filename: ConsoleStuff.h * * This header file defines information used by routines supplied in * Rob Peck's "Programmer's Guide to the Amiga", 1987. */ #include typedef struct ConIOBlocks { struct IOStdReq *writeReq; /* I/O write request */ struct IOStdReq *readReq; /* I/O read request */ struct MsgPort *tpr; /* pointer to ReplyPort */ /* for the console read */ } ConIOBlocks; void ConWrite(); ConIOBlocks *CreateConsole(); int DeleteConsole(); void EnqueueRead(); int CGetCharacter(); SHAR_EOF if test 568 -ne "`wc -c Console.h`" then echo shar: error transmitting Console.h '(should have been 568 characters)' fi echo shar: extracting ConsoleStuff.h '(572 characters)' cat << \SHAR_EOF > ConsoleStuff.h /* Console I/O Routines Header File * Filename: ConsoleStuff.h * * This header file defines information used by routines supplied in * Rob Peck's "Programmer's Guide to the Amiga", 1987. */ #include typedef struct ConIOBlocks { struct IOStdReq *writeReq; /* I/O write request */ struct IOStdReq *readReq; /* I/O read request */ struct MsgPort *tpr; /* pointer to ReplyPort */ /* for the console read */ } ConIOBlocks; ConIOBlocks *CreateConsole(); int DeleteConsole(); void EnqueueRead(); void WriteConsole(); int CGetCharacter(); SHAR_EOF if test 572 -ne "`wc -c ConsoleStuff.h`" then echo shar: error transmitting ConsoleStuff.h '(should have been 572 characters)' fi echo shar: extracting DiskMisc.h '(201 characters)' cat << \SHAR_EOF > DiskMisc.h /* Declarations for the DiskMisc package. * Filename: DiskMisc.h * Date: 11/24/87 */ LONG DiskBlocksLeft(); struct InfoData *GetDiskInfo(); char *GetVolumeName(); LONG TotalDiskBlocks(); SHAR_EOF if test 201 -ne "`wc -c DiskMisc.h`" then echo shar: error transmitting DiskMisc.h '(should have been 201 characters)' fi echo shar: extracting Gadget.h '(257 characters)' cat << \SHAR_EOF > Gadget.h /* Definitions for Gadget ID numbers */ #define HOMEPATH 0 #define BACKPATH 1 #define LISTPATH 2 #define XCLDPATH 3 #define STOP 4 #define GAUGE 5 #define CURVOLUME 6 #define ABORT 7 #define FILERETRY 8 #define DISKRESTART 9 #define FILESKIP 10 SHAR_EOF if test 257 -ne "`wc -c Gadget.h`" then echo shar: error transmitting Gadget.h '(should have been 257 characters)' fi echo shar: extracting MRBackup.h '(5265 characters)' cat << \SHAR_EOF > MRBackup.h /* MRBackup - include file for global data and definitions. * Filename: MRBackup.h * Date: 08/22/87 * * History: (most recent change first) * * 11/19/87 -MRR- V2.0: Changed window version and date. */ /* Main.c defines MAIN. It should not defined elsewhere. */ #ifdef MAIN #define EXTERN #else #define EXTERN extern #endif #include #include #include #include #include #include #include #include #include #include #include "gadget.h" #include "menu.h" #include "Console.h" /* Constants */ #define false 0 /* for short parameter requirements */ #define true 1 /* for short parameter requirements */ #define BUFMAX (32L * 1024L) /* max size for copy/compress buffer */ #define LINES_PER_PAGE 60 #define VOLUME_MAX 32 /* max characters in volume name */ #define PATH_MAX 256 /* max characters in pathname (very arbitrary) */ /* Define error recovery constants. Note that these are all powers * of 2 to allow creating 'sets' of allowable options during the * recovery prompt. */ #define NERRCODE 5 /* number of error recovery codes */ #define ERR_NONE 0 /* what we want ALL the time :-) */ #define ERR_ABORT 1 /* give up the ship */ #define ERR_RETRY_FILE 2 /* let's try that file one more time */ #define ERR_RESTART_VOLUME 4 /* for media errors on output floppy */ #define ERR_IGNORE 8 /* ignore this error and trudge on */ /* Macros */ /* determine if a menu item is "checked" */ #define GadgetString(g) ((struct StringInfo *) g->SpecialInfo)->Buffer #define IsChecked(item) ((item->Flags & CHECKED) == CHECKED) typedef struct t_pattern { struct t_pattern * next_pattern; char *pattern; } T_PATTERN; /* The following structure is used to link file and directory node * information into a doubly-linked list. This provides a way to * defer processing of sub-directory nodes until all files in a * current directory are processed. As nodes are "consumed", they * are returned to free memory. */ typedef struct t_file { struct t_file *previous,*next; char *filename; USHORT blocks; BOOL is_dir; /* TRUE => it's a directory */ } T_FILE; /* The following structure links lists of T_FILE nodes. */ typedef struct t_file_list { T_FILE *first_file; T_FILE *last_file; } T_FILE_LIST; /* External and forward function declarations */ extern char *calloc(), *index(), *rindex(); extern long DiskBlocks(); extern int errno; T_FILE *FindFile(); /* External data */ extern struct Gadget stopGadget; /* Global data */ #ifdef DEBUG EXTERN ConIOBlocks *debugConsole; EXTERN struct Window *debugWindow; EXTERN char debugMsg[512]; #endif EXTERN UBYTE *buffer; /* file copy/cmprs buffer (AllocMem) */ EXTERN ULONG bufSize; /* size of buffer allocated */ EXTERN ConIOBlocks *progressConsole;/* for informative messages */ EXTERN struct Window *progressWindow; EXTERN char conmsg[512]; EXTERN T_FILE *currentDir = NULL; /* current directory node */ EXTERN char destPath[PATH_MAX+1]; EXTERN char destVol[VOLUME_MAX+1]; EXTERN short diskNumber; /* backup disk serial number */ EXTERN USHORT errorCount; /* count of errors on backup/restore */ EXTERN char *errName; /* file name associated with error */ EXTERN BOOL excludeHasChanged; /* true when new path specified */ EXTERN T_PATTERN *excludeList, *lastExclude; EXTERN char excludePath[81]; /* list of file patterns to exclude */ EXTERN struct FileInfoBlock *fibWork; /* working file info block */ EXTERN struct GfxBase *GfxBase; /* graphics library handle */ EXTERN struct IntuitionBase *IntuitionBase; EXTERN USHORT level; /* file nesting level */ EXTERN USHORT lineCount; /* number of lines in listing */ EXTERN FILE *listing; EXTERN T_FILE_LIST mainList; EXTERN struct Screen *mainScreen; EXTERN struct Window *mainWindow; EXTERN struct DateStamp *now, *since; /* for date comparisons */ EXTERN struct Window *pathWindow; /* pathname specification window */ EXTERN LONG sizeLeft; /* floppy blocks remaining */ EXTERN char srcPath[PATH_MAX]; EXTERN char srcVol[VOLUME_MAX+1]; /* source volume name */ EXTERN char temp[256]; EXTERN LONG totalSize; /* capacity of output device */ /* The following flags suppress repetition of spoken * messages. After all, let's not over-do it. */ EXTERN UBYTE atYourService; /* Preset data */ #ifdef MAIN char backPath[81] = "DF0:"; /* where backups go and restores come from. */ char destDrive[5] = "DF0:"; USHORT doBigFiles = 1; /* Allow big file backups. */ USHORT doCompress = 1; /* Perform file compression. */ USHORT doFormat = 1; /* Format output disks */ USHORT doListing = 1; /* Generate listing. */ USHORT doSpeech = 1; /* Talk to the user. */ char homePath[81] = "DH0:"; /* Backup/Restore from/to here. */ char listPath[81] = "PRT:"; /* Listings go here. */ #else /* Declare preset external data without the presets. */ extern char backPath[81]; extern char destDrive[5]; extern USHORT doBigFiles; extern USHORT doCompress; extern USHORT doFormat; extern USHORT doListing; extern USHORT doSpeech; extern char homePath[81]; extern char listPath[81]; #endif SHAR_EOF if test 5265 -ne "`wc -c MRBackup.h`" then echo shar: error transmitting MRBackup.h '(should have been 5265 characters)' fi echo shar: extracting MRDates.h '(663 characters)' cat << \SHAR_EOF > MRDates.h /* Filename: MRDates.h * Various definitions used to support the MRDates package. * * Important note: * If the preprocessor symbol MRDATES is undefined, certain * useful structures will be declared for use by the module * including this file. */ #include typedef struct { short year,month,day,hour,minute,second; } UnpackedDS; #ifndef MRDATES /* This is not MRDates.c? */ extern char *daynames[7]; /* day name strings, [0] = "Sunday" */ extern USHORT monthdays[12];/* Number of days preceding each month, * requires diddling for leap years. */ extern char *monthnames[12];/* [0] = January */ #endif SHAR_EOF if test 663 -ne "`wc -c MRDates.h`" then echo shar: error transmitting MRDates.h '(should have been 663 characters)' fi echo shar: extracting Menu.h '(406 characters)' cat << \SHAR_EOF > Menu.h /* Menu constant definitions */ #define MENU_PROJECT 0 #define ITEM_ABOUT 0 #define ITEM_BACKUP 1 #define ITEM_RESTORE 2 #define ITEM_LOADPREFS 3 #define ITEM_SAVEPREFS 4 #define ITEM_QUIT 5 #define MENU_FLAGS 1 #define ITEM_COMPRESS 0 #define ITEM_BIGFILES 1 #define ITEM_LIST 2 #define ITEM_SPEECH 3 #define ITEM_FORMAT 4 #define MENU_WINDOWS 2 #define ITEM_PATHS 0 SHAR_EOF if test 406 -ne "`wc -c Menu.h`" then echo shar: error transmitting Menu.h '(should have been 406 characters)' fi echo shar: extracting Timer.h '(267 characters)' cat << \SHAR_EOF > Timer.h /* Timer support routine declarations. * Filename: Timer.h */ #include #include #include #include ":src/lib/AmigaFunctions.h" struct timerequest *CreateTimer(); void DeleteTimer(); void StartTimer(); void StopTimer(); SHAR_EOF if test 267 -ne "`wc -c Timer.h`" then echo shar: error transmitting Timer.h '(should have been 267 characters)' fi # End of shell archive exit 0