home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / clipper / cacode.zip / CAENCODE.DOC (.txt) < prev    next >
WordStar Document  |  1993-07-14  |  14KB  |  197 lines

  1. THIS IS A WORDSTAR 5.0 DOCUMENT - SEE CAENCODE.TXT FOR TEXT VERSION
  2. *************************************************************************
  3.  
  4. IMPORTANT NOTE:
  5.  
  6. If you do not have the MS C compiler, version 5.0 or higher, then *DO NOT* delete the .OBJ files:
  7.  
  8.     INT2B.OBJ
  9.     B2INT.OBJ
  10.     BYTESOUT.OBJ.  
  11.  
  12. They are needed for linking and you will be unable to recreate them without the MS C compiler.
  13.  
  14. *************************************************************************
  15.  
  16. CA-ENCODE and CA-DECODE HISTORY
  17.  
  18. 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).  
  19.  
  20. 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.  
  21.  
  22. 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!
  23.  
  24. 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.)
  25.  
  26. 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."
  27.  
  28. 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.)
  29.  
  30. 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.
  31.  
  32. 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.
  33.  
  34. 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.
  35.  
  36. PURPOSE & USAGE
  37.  
  38. CAENCODE Syntax: CAENCODE <inputfilename.ext> <outputfilename.ext>
  39.  
  40. CADECODE Syntax: CADECODE <inputfilename.ext>
  41.  
  42.     where <inputfilename.ext> is the CAENCODE <outputfilename.ext>
  43.  
  44. 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.
  45.  
  46. 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").
  47.  
  48. This resulting file can be readily transferred across almost any network / mail system as a typical message.
  49.  
  50. Example:
  51.  
  52.         MYLIB.LIB   23,456  09-12-91  03:40a
  53.  
  54. 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:
  55.  
  56.     CAENCODE MYLIB.LIB MYLIB.CAE
  57.  
  58. Here is what the output file MYLIB.CAE might look like:
  59.  
  60. +++CAFile: mylib.lib
  61. +++CABegin+++
  62. P0X024=1ADi3CdA5?9Kd0008@d55CT=?A4D4@dm4A@E9E4m2D`A3CdA5149DCdT4@dm4A@QCE45DBD=C90A3CdA51d=OAEA5F5@7ADi4@dm4A@UODeU=DeA1DU@8DeU=DeA1DU@7
  63. DeU=@Tm<D`MCFDe2CdaC1emCFDe5CT@6DeU=ADi414iEC4`7@TE7A45D@@EOA45D@@A4
  64. @EA11UmCFDe@@PA4@EA11EmCFDe@14A1E446Ge=ICE1514A1E446Gd=?CU=D1D=?CU=D
  65. 15m=DdL3CE=71em2ADM2De<6@TE7@U=C15m2De<3@U=C1em5CTA2De<6ADi4@U=C1TA7
  66. DTmED7bH1`10W@D20`5iV0L0@8l010D1R9P7042500H70HjH1`10:0082@7WV0L0B000
  67. 06DK4@0Z_@0C100g0@0k0P1LZbL102[003T205\`0P0Z`P0i0P1l7`d0:\@0>@40;`80
  68. LC0102[703L207TN001PRi`50<@1E094W0D0b0AD1cRL1@3425@7>9`50<`>EPdRX8T0
  69. 0`00^1H0^`00Dk\005<>D9X00000Pl@8bbX002P10b[>07`_0`1l;`@0:]00=`40[G9Z
  70. ;`807P\0HcL203KoogD_0P0g0P1lJB0a02[B03L406L_100Ze00g0@0g101b_P41<@1N
  71. 0000000000000000BEA?@U<000000000000004I9C4D00000000000000016Ce15CP00
  72. 000000000000AT=BAD5DA@000000000004IGDTUDA@00000000000016DTE1A0000000
  73. 00000000@E=3@Dh0000000000000049DCdT00000000000000011C5A4000000000000
  74. 0000AT=<Ce=500000000000005=D@EA9@e<T00000P00003=W0L0c1a@0@0099`50<`\
  75. EP8?W0D0c3aF0ojL1`3<C502003cW0D0c5aF1=fL1@3<K5H5c9`50<alEPJkW0D0c8aF
  76. 1jZL1@3<W5H8VI`50<b\EPV8W0L0c;a@0`00PY`50<c<EPYWW0D0c=aF2eJL1`3<k504
  77. 001AX0`0300000000?00001HW0D0c01D1cR@3`000@Q3@DE>@dm4A@0002J@30000PE9
  78. E4m2D`000=b@2`000`A2E4m90000<8X2001d
  79. +++CAEnd+++
  80.  
  81.  
  82. 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.
  83.  
  84. The token +++CABegin+++ informs the decoder that the encoded data begins on the very next line. 
  85.  
  86. The token +++CAEnd+++ informs the decoder that it has processed the last line of encoded text.
  87.  
  88. 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:
  89.  
  90. +++CAFile: mylib.lib
  91.  
  92. ********************************************************************
  93.  
  94.     John,
  95.  
  96.     Try this library out and let me know if it works for you!
  97.     I hope this fixes the problem.  If it does not, call me at
  98.     (918) 481-5715
  99.  
  100.                                              Dave
  101. ********************************************************************
  102.  
  103. +++CABegin+++
  104. P0X024=1ADi3CdA5?9Kd0008@d55CT=?A4D4@dm4A@E9E4m2D`A3CdA5149DCdT4@dm4
  105. A@QCE45DBD=C90A3CdA51d=OAEA5F5@7ADi4@dm4A@UODeU=DeA1DU@8DeU=DeA1DU@7
  106. DeU=@Tm<D`MCFDe2CdaC1emCFDe5CT@6DeU=ADi414iEC4`7@TE7A45D@@EOA45D@@A4
  107. @EA11UmCFDe@@PA4@EA11EmCFDe@14A1E446Ge=ICE1514A1E446Gd=?CU=D1D=?CU=D
  108. 15m=DdL3CE=71em2ADM2De<6@TE7@U=C15m2De<3@U=C1em5CTA2De<6ADi4@U=C1TA7DTmED7bH1`10W@D20`5iV0L0@8l010D1R9P7042500H70HjH1`10:0082@7WV0L0B000
  109. 06DK4@0Z_@0C100g0@0k0P1LZbL102[003T205\`0P0Z`P0i0P1l7`d0:\@0>@40;`80
  110. LC0102[703L207TN001PRi`50<@1E094W0D0b0AD1cRL1@3425@7>9`50<`>EPdRX8T0
  111. 0`00^1H0^`00Dk\005<>D9X00000Pl@8bbX002P10b[>07`_0`1l;`@0:]00=`40[G9Z
  112. ;`807P\0HcL203KoogD_0P0g0P1lJB0a02[B03L406L_100Ze00g0@0g101b_P41<@1N
  113. 0000000000000000BEA?@U<000000000000004I9C4D00000000000000016Ce15CP00
  114. 000000000000AT=BAD5DA@000000000004IGDTUDA@00000000000016DTE1A0000000
  115. 00000000@E=3@Dh0000000000000049DCdT00000000000000011C5A4000000000000
  116. 0000AT=<Ce=500000000000005=D@EA9@e<T00000P00003=W0L0c1a@0@0099`50<`\
  117. EP8?W0D0c3aF0ojL1`3<C502003cW0D0c5aF1=fL1@3<K5H5c9`50<alEPJkW0D0c8aF
  118. 1jZL1@3<W5H8VI`50<b\EPV8W0L0c;a@0`00PY`50<c<EPYWW0D0c=aF2eJL1`3<k504
  119. 001AX0`0300000000?00001HW0D0c01D1cR@3`000@Q3@DE>@dm4A@0002J@30000PE9
  120. E4m2D`000=b@2`000`A2E4m90000<8X2001d
  121. +++CAEnd+++
  122.  
  123.  
  124. 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).
  125.  
  126. To decode the file:
  127.  
  128.     CADECODE mylib.cax
  129.  
  130.  
  131. MYLIB.CAX will be decoded into MYLIB.LIB *OVERWRITING* any MYLIB.LIB that happens to be in the current directory.  BE CAREFUL.
  132.  
  133.  
  134. DEVIATIONS
  135.  
  136. 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.
  137.  
  138. Also, the tags/tokens are obviously different (+++CABegin+++ is plainly specific to CA-Clipper).
  139.  
  140. 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.
  141.  
  142.  
  143. COMPILING
  144.  
  145. 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.
  146.  
  147. IMPROVEMENTS
  148.  
  149. 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.
  150.  
  151. DISTRIBUTION
  152.  
  153. 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!
  154.  
  155.  
  156. NOTICE
  157. -------------------------------------------------------------------------
  158.  
  159. 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.
  160.  
  161. 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.
  162.  
  163. Comments are welcome, as are suggestions for improvements/features. The source code is included for those of you who want to "roll-your-own."
  164.  
  165. ***********************************************************************
  166.  
  167. 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.
  168.  
  169. The only restriction is that you may not modify and then redistribute
  170. 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)
  171.  
  172. ***********************************************************************
  173.  
  174. Oh, By the way!
  175.  
  176. 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.
  177. 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?
  178.  
  179. Kirby L. Wallace
  180.  
  181. CIS: 70262,524
  182.  
  183. I frequent these addresses:
  184.  
  185. FidoNet 1:170/110
  186. OS2Net  1:202/201
  187. ibmNet  40:4372/0
  188.  
  189. AT&T Net: (918) 835-7109 (Data - well, sometimes)
  190.  
  191. And, least likely of all, since I move often:
  192.  
  193. US SnailNet : 120 N. Sandusky Ave.
  194.               Tulsa, OK.  74115
  195.               USA
  196.  
  197.