"Unsea 1.0 Release Version" All parts of this package Copyright 1992 David W. Rankin, Jr. DESCRIPTION: Unsea is a "charityware" (see "CHARITYWARE" below) routine for removing the self-expanding code from MacBinary coded self-expanding archives ("SEAs"). It works with most SEAs created by Compact Pro(TM) 1.33 and compatable versions and with StuffIt Classic(TM) 1.6, StuffIt Deluxe(TM) 1.0-3.0 and StuffIt Lite(TM) 3.0 SEAs. (see "Non-Compatable SEAs" below.) WARNING: This program uses techniques which remove all code from the resource fork of the file converted. Therefore, you should not attempt to use it on any file that requires data to remain in the resource fork. This is especially important with StuffIt(TM) SEAs with encrypted files. (See below.) LEGAL STUFF: Unsea is NOT in the public domain; the copyright remains the property of David W. Rankin, Jr. (hereafter "I" or "me"). I hereby grant permission to any group wishing to distribute the unsea package in a completly unmodified form for no cost (not including on-line services that only charge per hour connection charges). Any group wishing to distribute unsea while charging any fee not covered under the above exceptions for said distribution, especially "media" or "handling" charges, must obtain written permission from me before so distributing this package. This package contains material covered by a registered Copyright on "Unsea 1.0", as well as all copyrights on this version and copyrights on any earlier versions of unsea. I have made every effort to ensure that this package works and is safe to use under normal operating conditions. However, I cannot and do not warrant this product to be free from defects, or that it will operate as advertised. Use at your own risk. Any use of the names of any individuals, groups or companies within this text is for informational purposes only, and does not represent an endorsement of unsea by any party so mentioned. All trademarks presented are the property of their respective owners. CHARITYWARE: Unsea is "charityware." If you like and use unsea, I ask that you make a contribution of $15 US or more to the Christian Appalachian Project (CAP) in lieu of any payments to me. CAP is an inter-denominational Christian group dedicated to helping the people of Appalachia help themselves out of the cycle of poverty that has such a strong grip on that region. CAP's address is: Christian Appalachian Project 322 Crab Orchard Road Lancaster, KY 40446 US Phone Number: (606)792-3051 Whether or not you chose to donate to CAP, I also ask that you contact me, so that I may add your name to my mailing lists for unsea. I will try to contact unsea users about new versions, bugs, etc. directly, in addition to posting to Usenet. My addresses are at the end of this file. COMPILING UNSEA: Unsea uses parts of the ANSI standard that are not covered under the original Kernighan and Ritchie (K&R) standard of C. Therefore, you will have to compile this program with an ANSI compliant compiler. If your system's "cc" compiler is not ANSI C compliant and you are on a UNIX machine, I suggest that you obtain GNU's C compiler, gcc. If you are on a UNIX machine, you may simply use the command "make unsea" to create the unsea program. (See the instructions inside "Makefile" for more information in that regard.) If you do not have the "make" program, then you will need to compile each .c file in this package into a program named "unsea", following the instructions that come with your compiler. One problem that has come to my attention already is that some compiler libraries do not support the remove() function, which deletes files. If you encounter an error mentioning _remove failing to link, then this is the case. To correct this, you can change "#undef UNIX_DELETE" in unsea.h to "#define UNIX_DELETE." This changes the remove() command to unlink(), a library function common to UNIX compilers and often in other libraries, but not in the ANSI C standard libraries. USE OF UNSEA: Syntax for calling unsea: unsea [-bcnos] oldfile1.sea.bin [newfile1.name.bin] [oldfile2.sea.bin ... ] Command Line Syntax: Starting with the second word of the command line (unsea assumes the first is its own name), unsea searches the command line for option flags starting with '-', up to either a file name not starting with '-', or the string "--" (for when you have a file name with '-' in it). If unsea encounters an option flag it does not know [see below for a list of legitimate option flags], it will report an error to the user and abort. Once unsea has reached the end of the flags, it begins converting each file name given. If the n option has been selected (see below), it processes the filenames in the command line as pairs, with the first of the pair as the name of the SEA file and the latter as the name of the unSEAed output file. It continues processing these names until the end of the command line is reached. Therefore, unsea is capable of converting multiple files during one run. Option Flags: b: Normally unsea gives detailed information about a SEA as it is being converted. However, this option places unsea into its "brief descriptions" mode, in which only a small amount of information is printed to the screen. c: This flag will cause any Compact Pro SEAs to be ignored by unsea during its conversion of the named files. It is good for aliases where you have a reason to not unSEA a Compact Pro file. The default is to unSEA Compact Pro SEAs n: When this option is selected, unsea uses the string coming after the SEA file name as the output for the unSEAed file. If the file name already exists, it will NOT be overwritten, unless the "o" option is selected. When this option is not selected, unsea creates a name for the new file using an internal name generator. o: unsea will overwrite any file named the same as the new file it will generate (either through the n option or its internal name generator.) This option is not recommended except for use with the n option, since the internal name generator might produce a name that you did not anticipate. Unsea will not overwrite a file by default. s: This option causes unsea to ignore StuffIt Deluxe SEAs that it encounters. This option too is good for an alias to unsea. By default, unsea converts StuffIt Deluxe SEAs. Note on Options: While unsea does not presently use option flag 'd', it also will not report its use as an error. The code recognizing d as the option flag for surpressing unseaing of DiskDoubler SEAs was added when I added other code to unsea, even though DiskDoubler SEAs are not yet supported. NON-COMPATABLE SEAs There are several types of self-expanding archives that unsea is presently incapable of converting. The main one among these is SEAs generated by DiskDoubler(TM). I will attempt to correct this in the future, but, as I do not own DiskDoubler, this will take time. (Anyone want to buy me a copy of DiskDoubler so I can try it?? ;). On the other hand, unsea does not and will not support SEAs made by more esoteric compressors, such as More Disk Space(TM). I am a college student with a GPA that has to stay up, so I only have so much spare time. Also, encrypted StuffIt SEAs use information in the resource fork to define the encryption, so when unsea removes the resource fork, it corrupts the encryption in the process. Unsea is not capable of detecting such encryption, so it will blindly proceed to corrupt the archive. There is no practical way that I know of to fix this either, since even a checker would have to do a lot of manipulations of the resource fork, something rather hard for MacBinary but almost impossible for BinHex. ACKNOWLEDGEMENTS: There are several people I want to thank for their help with unsea. First, Marco Gonzalez of Aladdin Systems, Inc. for the information about encrypted StuffIt SEAs, Bill Goodman for pointing out that the BNDL bit had to be cleared and confirming my data on Compact Pro SEAs, Ken Hancock, for warning me about funny things inside DiskDoubler SEAs and for help straightening out my #define statements, Justin Sullivan, for the original push to start unsea and beta testing above and beyond the call of duty, and Greg Rabanes for alpha testing and encouragement. Next, the beta testers who took some of their valuable time to make unsea better. It comforts a programmer to know there are always people out there willing to show you all of your stupid mistakes. ;) Seriously, I appreciate the help of all the testers. [A full list of all of unsea's beta testers is in the file "unsea.testers".] Finally, I want to thank the Lord for giving me this knack called programming. If I left anyone out, feel free to complain to me, and I'll put in a special mention in the next version. CONTACTING THE AUTHOR: The best way to contact me is through Electronic Mail, since I check it often. Please use the backup addresses only if you cannot get to reach the primary address for each net mentioned. Here are the addresses: INTERNET: rankin=unsea@ms.uky.edu Backup: rankin@mik.uky.edu, djrank00@ukpr.uky.edu BITNET: rankin=unsea@ukma.BITNET Backup: rankin%ms.uky.edu@ukcc.BITNET, djrank00@ukpr.BITNET UUCP: rankin=unsea@ukma.UUCP or {uunet, gatech}!ukma!rankin=unsea Backup: uunet!mik.uky.edu!rankin, uunet!ukpr.uky.edu!djrank00 US Postal Service: As an absolute last resort, you may write to: David W. Rankin, Jr. Boyd Hall University of Kentucky Lexington, KY 40526-0008 However, please consider that this is not a complete address, so the post office will have to process it. That means it will take a while to get to me. I hope to have a permanent mailing address by the time I have finished unsea 1.1, at which time I will put it in this document. COMING ATTRACTIONS I am presently working on unsea 1.1, which will have any necessary bug fixes for 1.0 (hopefully none :) and support for BinHex archives. Also, I will make unsea's CRC generator work right, so that it makes correct MacBinary 2 files (it will now only make MacBinary 1 files.) DiskDoubler support is likely to take a while longer, especially since I have other irons REFERENCES: MacBinary Standard, Dennis F. Brothers. This is the original proposal outlining the MacBinary format, and was the working document created by the original MacBinary Working Group. "MacBinary II Standard", MacBinary II Conference. This document reflects the concensus of the MacBinary II Conference, as to extending the MacBinary standard to cover changes in the Macintosh Finder data and to add CRC protection to the header of the file. mcvert 1.65 and mcvert 1.70, Doug Moore et al. UNIX program that converts MacBinary to BinHex and vice versa, in addition to UnPacking PackIt files and neato conversions of text files. A prime example of durable code at it's best. (Better than mine, that's for sure. :) BinHex 4.0 Definition, Peter N. Lewis. This document was created by Mr. Lewis during the creation of DeHQX, and is a clear definition of the BinHex 4.0 standard, as far as I can tell. Unsea will be 100% compatable with the BinHex format as described in this document and mcvert. The C Programming Language, Second Edition, Kernighan and Ritchie. This is the main code reference that I have used for unsea, especially for being ANSI C compliant. I do reccomend this book. THINK C(tm) 5.0, Symantec. During the development and early beta stages, all of my programming for unsea was on THINK C. Also, I used the Standard Libraries Reference included with the compiler as an additional reference for the ANSI C library functions.