*************************************************************************

                              IMPORTANT NOTE:

If you do not have the MS C compiler, version 5.0 or higher, then *DO NOT* 
delete the .OBJ files:

     INT2B.OBJ
     B2INT.OBJ
     BYTESOUT.OBJ.  

They are needed for linking and you will be unable to recreate them without 
the MS C compiler.

*************************************************************************

CA-ENCODE and CA-DECODE HISTORY

CAEncode() and CADecode() are Clipper counterparts for the Unix utilities: 
uuencode and uudecode.  The CA in the place of UU means, naturally, 
Computer Associates (our new and adopted parents).  

They differ slightly in convention and application.  The most notable 
difference is that they are written in Clipper and can be directly 
incorporated in any Clipper application.  

Version 1 of these utilities was written in 100% Clipper, which was my 
original goal in doing them.  The programs' functionality and performance 
were not the main concern.  I simply wanted 100% Clipper code that I could 
use in any Clipper application.  I simply wanted to do it and say it was 
"pure Clipper!"  well, been there, done that!

I actually had more response that I had anticipated, and a number of people 
from all over North America and Europe have asked me about them, and for 
permission to use them (something I apparently forgot to mention in the 
original documentation.)

Since there was more than academic interest in Version 1, several people 
commented on the speed, or rather lack of it.  This is something that I did 
not neglect to mention in the original documentation.  I was aware that on 
a 486-33, it took Version 1.0 almost one full minute to encode a 30K binary 
file, and almost three minutes to decode it.  But the stated purpose of 
that early version was strictly an exercise in "doing it all in Clipper."

So, with a stated interest in actually using the programs, and with the 
adoption of the programs as the "official" encoder of the FidoNet CLIPPER 
echo, I thought it might be worthwhile to divorce myself from the "100% 
Clipper" ideology, and rewrite the time intensive portions in "C" (which is 
still, after all, linkable to Clipper and therefore of use embedded in 
Clipper applications.)



The gains were fairly decent, and short of rewriting it completely in "C",
I have finagled a fair amount of performance out of them.  The encoder and 
decoder both take between 10 and 15 seconds to encode/decode what used to 
take about 1-3 minutes.  It is still largely a Clipper effort, and so it is 
still not going to be as fast as a "100% C" program.  The largest gains 
came from rewriting in "C" those routines that performed character to 
binary and binary to character translations.

A later version may incorporate even greater performance benefits by 
working on more than three bytes at a time.  Let's just wait and see how 
this version goes, first.

The real benefit of CAENCODE and CADECODE is that they are completely free, 
come with complete Clipper and "C" source and are user modifiable with no 
restrictions on modifications or use.  Basically, do with them what you 
will (except redistribute them with your name on them).  For use in 
commercial or corporate applications, feel free to remove my name and 
whatnot from the screen output sections.



PURPOSE & USAGE

CAENCODE Syntax: CAENCODE <inputfilename.ext> <outputfilename.ext>

CADECODE Syntax: CADECODE <inputfilename.ext>

     where <inputfilename.ext> is the CAENCODE <outputfilename.ext>

Some e-mail networks do not support the full ASCII character set and so 
cannot be used to transmit any file containing these characters across 
those networks.  And almost ALL mail systems cannot handle high-order or 
low-order ASCII characters (usually referred to collectively as the non-
printable character set).  Any attempt to do so will invariably end up in 
mayhem.

These programs together allow you to take any DOS file, whether EXE, COM, 
LIB, OBJ, TXT, WRI, DLL, whatever, and encode them into a file that 
contains only the transmittable/printable characters in the ASCII ranges of 
48-111 (or, "0" - "o").

This resulting file can be readily transferred across almost any network / 
mail system as a typical message.



Example:

        MYLIB.LIB   23,456  09-12-91  03:40a

This file cannot be transmitted as a message in a mail echo.  The high / 
low order ASCII characters in it will completely throw any mailer / reader 
that comes across it.  But you can encode it so that all the characters are 
sure to be transmittable:

    CAENCODE MYLIB.LIB MYLIB.CAE

Here is what the output file MYLIB.CAE might look like:

+++CAFile: mylib.lib
+++CABegin+++
P0X024=1ADi3CdA5?9Kd0008@d55CT=?A4D4@dm4A@E9E4m2D`A3CdA5149DCdT4@dm4
A@QCE45DBD=C90A3CdA51d=OAEA5F5@7ADi4@dm4A@UODeU=DeA1DU@8DeU=DeA1DU@7
DeU=@Tm<D`MCFDe2CdaC1emCFDe5CT@6DeU=ADi414iEC4`7@TE7A45D@@EOA45D@@A4
@EA11UmCFDe@@PA4@EA11EmCFDe@14A1E446Ge=ICE1514A1E446Gd=?CU=D1D=?CU=D
15m=DdL3CE=71em2ADM2De<6@TE7@U=C15m2De<3@U=C1em5CTA2De<6ADi4@U=C1TA7
DTmED7bH1`10W@D20`5iV0L0@8l010D1R9P7042500H70HjH1`10:0082@7WV0L0B000
06DK4@0Z_@0C100g0@0k0P1LZbL102[003T205\`0P0Z`P0i0P1l7`d0:\@0>@40;`80
LC0102[703L207TN001PRi`50<@1E094W0D0b0AD1cRL1@3425@7>9`50<`>EPdRX8T0
0`00^1H0^`00Dk\005<>D9X00000Pl@8bbX002P10b[>07`_0`1l;`@0:]00=`40[G9Z
;`807P\0HcL203KoogD_0P0g0P1lJB0a02[B03L406L_100Ze00g0@0g101b_P41<@1N
0000000000000000BEA?@U<000000000000004I9C4D00000000000000016Ce15CP00
000000000000AT=BAD5DA@000000000004IGDTUDA@00000000000016DTE1A0000000
00000000@E=3@Dh0000000000000049DCdT00000000000000011C5A4000000000000
0000AT=<Ce=500000000000005=D@EA9@e<T00000P00003=W0L0c1a@0@0099`50<`\
EP8?W0D0c3aF0ojL1`3<C502003cW0D0c5aF1=fL1@3<K5H5c9`50<alEPJkW0D0c8aF
1jZL1@3<W5H8VI`50<b\EPV8W0L0c;a@0`00PY`50<c<EPYWW0D0c=aF2eJL1`3<k504
001AX0`0300000000?00001HW0D0c01D1cR@3`000@Q3@DE>@dm4A@0002J@30000PE9
E4m2D`000=b@2`000`A2E4m90000<8X2001d
+++CAEnd+++


The token +++CAFile: informs the decoder of the file name of the original 
file.  CADECODE will be recreate it with it's original name without you 
having to know it.

The token +++CABegin+++ informs the decoder that the encoded data begins on 
the very next line. 

The token +++CAEnd+++ informs the decoder that it has processed the last 
line of encoded text.



You can annotate your encoded file by including text (for humans) in 
between the +++CAFile and +++CABegin+++ tokens.  Anything in this area is 
ignored by the CADECODE decoder.  Simply create the encoded file as shown 
above, then use an ASCII text editor to insert lines of text in between the 
+++CAFile: token and the +++CABegin+++ token. Example:

+++CAFile: mylib.lib

********************************************************************

    John,

    Try this library out and let me know if it works for you!
    I hope this fixes the problem.  If it does not, call me at
    (918) 481-5715

                                             Dave
********************************************************************

+++CABegin+++
P0X024=1ADi3CdA5?9Kd0008@d55CT=?A4D4@dm4A@E9E4m2D`A3CdA5149DCdT4@dm4
A@QCE45DBD=C90A3CdA51d=OAEA5F5@7ADi4@dm4A@UODeU=DeA1DU@8DeU=DeA1DU@7
DeU=@Tm<D`MCFDe2CdaC1emCFDe5CT@6DeU=ADi414iEC4`7@TE7A45D@@EOA45D@@A4
@EA11UmCFDe@@PA4@EA11EmCFDe@14A1E446Ge=ICE1514A1E446Gd=?CU=D1D=?CU=D
15m=DdL3CE=71em2ADM2De<6@TE7@U=C15m2De<3@U=C1em5CTA2De<6ADi4@U=C1TA7
DTmED7bH1`10W@D20`5iV0L0@8l010D1R9P7042500H70HjH1`10:0082@7WV0L0B000
06DK4@0Z_@0C100g0@0k0P1LZbL102[003T205\`0P0Z`P0i0P1l7`d0:\@0>@40;`80
LC0102[703L207TN001PRi`50<@1E094W0D0b0AD1cRL1@3425@7>9`50<`>EPdRX8T0
0`00^1H0^`00Dk\005<>D9X00000Pl@8bbX002P10b[>07`_0`1l;`@0:]00=`40[G9Z
;`807P\0HcL203KoogD_0P0g0P1lJB0a02[B03L406L_100Ze00g0@0g101b_P41<@1N
0000000000000000BEA?@U<000000000000004I9C4D00000000000000016Ce15CP00
000000000000AT=BAD5DA@000000000004IGDTUDA@00000000000016DTE1A0000000
00000000@E=3@Dh0000000000000049DCdT00000000000000011C5A4000000000000
0000AT=<Ce=500000000000005=D@EA9@e<T00000P00003=W0L0c1a@0@0099`50<`\
EP8?W0D0c3aF0ojL1`3<C502003cW0D0c5aF1=fL1@3<K5H5c9`50<alEPJkW0D0c8aF
1jZL1@3<W5H8VI`50<b\EPV8W0L0c;a@0`00PY`50<c<EPYWW0D0c=aF2eJL1`3<k504
001AX0`0300000000?00001HW0D0c01D1cR@3`000@Q3@DE>@dm4A@0002J@30000PE9
E4m2D`000=b@2`000`A2E4m90000<8X2001d
+++CAEnd+++


To send an .OBJ or .COM file to another user in another part of the world, 
simply encode the file, send the encoded file as an e-mail.  He may then 
download your text message, cut it out with a word processor of his choice, 
and decode it.  Naturally, both sides must have the same encoder/decoder 
set (CAEncode/CADecode).

To decode the file:

    CADECODE mylib.cax


MYLIB.CAX will be decoded into MYLIB.LIB *OVERWRITING* any MYLIB.LIB that 
happens to be in the current directory.  BE CAREFUL.



DEVIATIONS

I forget what all of them are.  I disposed of individual line checksums.  
Most mail handlers and e-mail networks are reliable enough today that lost 
data is rare.  Besides, most off-line readers and other mail tossers work 
with entire message bases that are ZIPPED, so any damage to the file is not 
going to be recoverable even with a checksum.  The result is a few 
percentage points of smaller encoded file.

Also, the tags/tokens are obviously different (+++CABegin+++ is plainly 
specific to CA-Clipper).

Additionally, the ability to embed unrelated text in the encoded file is a 
big plus (in my opinion) since I can then document, in plain text (as much 
of it as I need), the encoded file.  After all, several pages of "garbage" 
isn't very descriptive.  The text area between +++CAFile: and +++CABegin+++ 
are very useful for notes and descriptive messages to the recipient of the 
file and can contain, for instance, a description and even decoding 
instructions!  It is all ignored by the decoder.


COMPILING

The batch file COMPILE.BAT contains all the necessary compile and link 
scripts that you will need to compile and link with either Blinker or 
RTLink.

IMPROVEMENTS

There are some planned.  If you have improvements and would like them 
incorporated, send them my way (with a description - I am not a mind 
reader), and I will incorporate them (if it is as good as you say it is) 
and give you full credit in the source code and documentation.  I have 
established a list of distribution points both in North America and Europe 
and these people are expecting updates to come from me directly.

DISTRIBUTION

Please distribute this product all over the world.  Try to do so in an 
unmodified manner.  Keeping track of multiple "different copies" can be a 
nightmare.  Something I'd like to avoid.  LONG LIVE CLIPPER!  Death to the 
Bourgeois Imperialistic MicroSoft software dictatorship!



NOTICE
-------------------------------------------------------------------------

Please make sure that the echo, network, or other e-mail system that you 
participate in allows the use of such products as this.  Many sysops will 
become quite irate (myself included) if an echo turns into nothing but a 
file transfer channel.  Echoes are meant to carry meaningful discussions 
and conversations; not meaningless CAEncode codes.

The CLIPPER echo DOES allow the use of this product within reasonable 
limits.  The Moderator is j_mag guthrie, or sometimes just j_mag.  Ask if 
you are in doubt.

Comments are welcome, as are suggestions for improvements/features. The 
source code is included for those of you who want to "roll-your-own."

***********************************************************************

These programs may be distributed/used freely with no charge and with no 
royalty.  It may be modified and used in any manner you see fit.

The only restriction is that you may not modify and then redistribute
the product.  This is FreeWare.  Thank me in whatever way you see fit 
(money is not necessarily the answer... - I have other products for that)

***********************************************************************

Oh, By the way!

One interesting application of it that I have seen is program storage on 
paper!  Really.  I'm not kidding.  A friend here in Tulsa actually scanned 
a print of an encoded file into a document imaging system, then used OCR 
software to recreate it, then ran CADECODE against it and got his original 
program back.  Other programs are simply stored as plain disk documents in 
the weirdest program archive I have ever seen.

There are various ways to reach me.  Any FidoNet node that carries either 
the Clipper or Mensa echoes can be used to get e-mail to me I use the name 
KIRBY WALLACE - I wonder why?

Kirby L. Wallace

CIS: 70262,524

I frequent these addresses:

FidoNet 1:170/110
OS2Net  1:202/201
ibmNet  40:4372/0

AT&T Net: (918) 835-7109 (Data - well, sometimes)

And, least likely of all, since I move often:

US SnailNet : 120 N. Sandusky Ave.
              Tulsa, OK.  74115
              USA

