BCODE/UNBCODE DOCUMENTATION for Version 2.02 [February 28, 1995] 1. INTRODUCTION This is the documentation for the bcode and unbcode C programs. These programs allow you to encode binary data into a text format that can be e-mailed or posted to USENET newsgroups. Functionally, they are quite similar to the uuencode/uudecode standard Unix utilities, except that these programs can use three different encoding formats (including "uucode") and allow for the automatic splitting, reordering, and incremental reassembly of multiple file segments for long files, and provide CRC-32 and size error checking on each encoded segment. In other words, these are "better-mousetrap" versions of the uucode utilities. Other Unix utilities give you some combination of these features for uuencoded data, but, as far as I am personally able to determine, all other approaches (including the "e" feature of "rn") are fundamentally flawed. Other approaches attempt to parse the natural language of the subject lines and the text file contents to figure out the file/segment information, but this is an AI-complete problem and the results are hit-and-miss. The approach used here alters the standard uucode format a little to give filename and segment number data in a simple and consistent manner. There is a catch, however. You can only extract multi-segment data that was encoded using the encoding formats defined herein. Until the people on the other end use the encoding formats these programs give (dare to dream), the decoding program here is fundamentally no more powerful than the standard Unix uudecode program (though better-done, IMHO). The C code is in ANSI-C format. Both the "bcode.c" and "unbcode.c" source files contain complete programs, so there is no need for a Makefile. Just compile and run. The programs make no major system-specific assumptions, with the exception that the decoder uses the system calls "rename" and "remove" for files. On some systems, these will be "link" and "unlink". I also found that the C++ compiler I tried wanted to have "" included in order to use its "link" and "unlink" calls. 2. ENCODING/DECODING FORMATS 2.1. NUCODE and UUCODE The bcode and unbcode programs support four encoding formats: NUCODE, UUCODE, BCODE, and HEXCODE. The NUCODE format is both upward and downward compatible with the old, problematic, and incomplete UUCODE format that is very popular out here in cyberspace. Here is what the NUCODE format looks like: -nucode-begin 2 quote2 >+3$I)W,@:6YT;R!I="XB("T@0W)A:6<@0G)U8V4* ` end -nucode-end 2 30 efb8f0c5 dum de dum... random separation between the segments... -nucode-begin 1 quote2 begin 640 quote2 M(DEF+"!A9G1E'1E;G-I=F4@='=E86MI;F