home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / COMPRESS / IDC40.ZIP / NARC.DOC < prev    next >
Encoding:
Text File  |  1990-04-27  |  85.2 KB  |  2,165 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                  NARC (tm) zip - A STAND-ALONE DE-ZIP UTILITY
  11.                            (no other files required)
  12.  
  13.  
  14.                             NETWORK COMPATIBLE
  15.  
  16.  
  17.  
  18.                          Documentation for NARC.EXE
  19.  
  20.  
  21.                    Written by Gary Conway and Shawn Merrick
  22.  
  23.  
  24.                         Infinity Design Concepts, Inc.
  25.  
  26.  
  27.                             Louisville, Kentucky
  28.  
  29.  
  30.                    Copyright (c) 1987-90, All rights reserved
  31.  
  32.  
  33.                                 Version 4.0
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                NARC.EXE is a shareware program. NARC.EXE is and will remain 
  71.                the property of the author. This program may not be used in 
  72.                any connection with commercial ventures, nor as a sales aid, 
  73.                without the expressed written consent of the author. All 
  74.                rights are reserved.
  75.  
  76.  
  77.                          Infinity Design Concepts, Inc.
  78.                          1052 Parkway Drive
  79.                          Louisville, Kentucky 40217-2333
  80.                          Voice: (502) 636-1234 
  81.                          BBS: (502) 635-5471
  82.                          CIS: 72657,3006
  83.  
  84.                  Member  IEEE AOPA
  85.                          PCCL WINGS
  86.                          KKUG
  87.                          NSPE
  88.  
  89.  
  90.                A very special thanks to Curt Edwards, for running the 
  91.                SoftStone BBS system for many years. Curt has decided to 
  92.                retire from SYSOPing after a long time of helping others, we 
  93.                at IDC would like to thank Curt for his endurance, his 
  94.                patience, his help and most of all, for the Stone..
  95.  
  96.  
  97.  
  98.                 NARC is a trademark of Infinity Design Concepts Inc.
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.                                        REGISTRATION
  133.  
  134.  
  135.                If you find yourself using NARC, please take the time to do 
  136.                the right thing and that is register your copy. You have been 
  137.                provided the opportunity to freely test the program before 
  138.                even thinking about registering. This is only fair, so, in 
  139.                fairness, you should reciprocate and register your copy, if 
  140.                you continue using the program.
  141.  
  142.                 Why register ?
  143.  
  144.                 1) You get the NARCCFG.EXE program for customizing NARC.
  145.                 2) You get notification of updates to all IDC software.
  146.                 3) You get patch table information.
  147.                 4) You get online phone support.
  148.  
  149.                Customers residing outside of the United States of America
  150.                should send a check or money order drawn on a U.S. bank or
  151.                in U.S. funds or use a credit card.
  152.  
  153.                You will find the registration form in the archive with this 
  154.                document under the name REGISTER.FRM. Please use this form 
  155.                for registration.
  156.  
  157.  
  158.                               Infinity Design Concepts, Inc.
  159.                                     1052 Parkway Drive
  160.                                 Louisville, Kentucky  40217-2333
  161.                                       (502)-636-1234
  162.  
  163.                 The user is granted the right to make unlimited copies of
  164.                 the SHAREWARE versions of the program (except NARCCFG.EXE 
  165.                 and NARCCFG.DOC) and to distribute these copies as desired
  166.                 without profit, EXCEPT that Infinity Design Concepts, Inc.
  167.                 reserves the SOLE right to distribute the program(s) for
  168.                 profit.
  169.  
  170.                 NOTE: The word ZIP is used throughout this document and
  171.                       almost all functions that apply to ZIP files, can
  172.                       be applied to ARC and ARK files as well.
  173.  
  174.  
  175.                 NOTE: NARCCFG.EXE is NOT a shareware program and may not
  176.                       be released to the general public in any form 
  177.                       under any circumstances whatsoever.
  178.  
  179.  
  180.  
  181.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  182.  
  183.   .............................................................................
  184.   ........................                         ............................
  185.   ........................    TABLE OF CONTENTS    ............................
  186.   .............................................................................
  187.  
  188.                                                                Page
  189.            FEATURES UNIQUE TO NARC..............................1
  190.            WHAT IS SHAREWARE..................................  2
  191.            NARC ? WHAT IS IT ANYWAY...........................  3
  192.            ACKNOWLEDGEMENTS...................................  3
  193.            ABOUT ZIP FILES....................................  4
  194.            COMPATIBILITY......................................  5
  195.                Archive Storage Methods Supported By NARC......  5
  196.                    Packing
  197.                    Squeezing
  198.                    Crunching
  199.                    Squashing
  200.                ZIP Storage Methods Supported By NARC..........  5
  201.                   Storing
  202.                   Reducing
  203.                   Shrinking
  204.                   Imploding
  205.            OVERVIEW...........................................  6
  206.                Video Modes ...................................  6
  207.                Mouse Support .................................  6
  208.                Sound .........................................  7
  209.                Environment Variables..........................  7
  210.            HELP...............................................  9
  211.            COMMANDS...........................................  9
  212.                Extract Command................................  9
  213.                View Command...................................  10
  214.                Print Command..................................  11
  215.                ZIP-wind Command...............................  12
  216.                DRV-wind Command...............................  12
  217.                DirTree  Command...............................  12
  218.                Quit Command...................................  12
  219.            ALTERNATE COMMANDS.................................  13
  220.                Function keys..................................  13
  221.                Find Command...................................  14
  222.                Kill File Command..............................  14
  223.                Page UP, DOWN, HOME,END........................  14
  224.                Using extensions besides ZIP and ARC...........  14
  225.                Calling IDCshell.EXE...........................  14
  226.                Command Line Processor..(new)..................  15
  227.                Trivia status screen...........................  15
  228.            OPERATING HINTS AND SHORTCUTS......................  16
  229.            ERROR MESSAGES.....................................  17
  230.            ARCHIVE FILE FORMATS AND GENERAL INFORMATION.......  19
  231.                Packing (RLE)..................................  19
  232.                Imploding......................................  20
  233.                Huffman coding (SQUEEZING).....................  21
  234.                LZW Compression.......... .....................  25
  235.            DETAILS OF STORAGE VERSIONS (ARC)..................  27
  236.                Archive file Header Structure..................  29
  237.            HASHING............................................  30
  238.                CRC - calculations.............................  31
  239.  
  240.  
  241.  
  242.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  243.  
  244.  
  245.                                   ═══════════════════════
  246.                                   FEATURES UNIQUE TO NARC
  247.                                   ═══════════════════════
  248.  
  249.  
  250.                1) allows random access to ZIPfiles. ALL of the other archive
  251.                   utilities allow ONLY serial access.
  252.                2) allows viewing DOC files before extraction. This feature
  253.                   allows you to determine which, if any of the subfiles that
  254.                   you want to extract. This can save considerable time and
  255.                   disk clutter when you extract only the necessary files.
  256.                3) has a view feature that allows page up, page down, home
  257.                   end and arrow key movement through a file. Binary files 
  258.                   can also be viewed in HEX mode. Also includes a text 
  259.                   search function.
  260.                4) allows printing files from an archive without extracting 
  261.                   the file first. Supports many printing options.
  262.                5) allows users with floppy systems to load NARC once and
  263.                   examine many archives from all floppy drives. Other
  264.                   archive utilities must reload (and reread the arc) for 
  265.                   each command.
  266.                6) directory tree allows one to easily move from directory
  267.                   to directory or drive to drive.
  268.                7) large archives are much easier to deal with in NARC since
  269.                   you may page through the subfiles.
  270.                8) mouse support for all functions.
  271.               10) First and still the ONLY menu driven decompression package
  272.                   with all data compression routines built in !
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  303.           
  304.                                      Page 1
  305.  
  306.                                      ═════════════════
  307.                                      WHAT IS SHAREWARE
  308.                                      ═════════════════
  309.  
  310.                Shareware is a concept for marketing software, whereby the 
  311.                author takes the only risks. The purchaser is allowed to take 
  312.                the software home without spending a dime and trying it out. 
  313.                If the software is found to be useful and is used, then the 
  314.                author expects the end user to buy it. From the author's 
  315.                standpoint, he is so confident that you will like his 
  316.                package, that he is willing to GIVE you a copy on the chance 
  317.                that you will take it home and find it useful and want to buy 
  318.                it. There are many advantages to registering shareware 
  319.                software. First and foremost is the fact that unless 
  320.                shareware authors are supported, they cannot maintain the 
  321.                high standards in software that they do, and the prices 
  322.                cannot be maintained at low levels. It takes financial 
  323.                support for any company to continue to develop quality 
  324.                software. The benefit to the author is that he can distribute 
  325.                his software very economically, thus allowing low prices on 
  326.                the software. Another benefit of shareware, is that shareware 
  327.                authors are much more accessible than commercial authors and 
  328.                that means better, more informative support to you. When was 
  329.                the last time you called Micropro and got to speak to the 
  330.                author of WordStar ?
  331.  
  332.                How many times has Microsoft sent a nice piece of software to 
  333.                your local BBS and asked you to try it out ? Shareware is a 
  334.                vital and benefical concept, but it requires your support. 
  335.                Look at it this way, when you send in a shareware 
  336.                registration for $20, ask yourself just how many hours of 
  337.                that authors time are you buying with that money, and where 
  338.                else could you get such a bargain ?
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  365.           
  366.                                      Page 2
  367.  
  368.                                     ═══════════════════
  369.                                     WHAT IS IT ANYWAY ?
  370.                                     ═══════════════════
  371.  
  372.  
  373.                NARC is a menu driven de-archive facility, written entirely 
  374.                in assembler. NARC allows you to easily move from ZIP file to 
  375.                ZIP file, with the option of viewing, printing, extracting or 
  376.                deleting the subfiles from the archive. The program may be 
  377.                operated from the mouse or the keyboard. Menus are of the 
  378.                musical popup variety to add a little "TechNoFlash" to the 
  379.                proceedings. NARC is the culmination of about 18 months of 
  380.                frustrating effort and 13000 + lines of 8088 source code. 
  381.                NARC was developed using the Norton Editor and the Microsoft 
  382.                Macro assembler on a Kaypro PC and an ALR 386/20.
  383.  
  384.                Why....
  385.  
  386.  
  387.                Because I use a lot of ZIP files and PKzip and the clones are 
  388.                reminiscent of the early Ward Christensen CP/M days in user 
  389.                interface etiquette,I wanted something a little more flexible 
  390.                and friendly to use. I would like to pause here for a second 
  391.                and give a little credit to Mr. Christensen ( the Don Garlits 
  392.                of CP/M ) for the fine FREE utilities he has given to ALL of 
  393.                us over the years. The next time you do a modem transfer, you 
  394.                can thank him and Keith Petersen for the original XMODEM from 
  395.                which all others have transpired.
  396.  
  397.            Why NARC...
  398.  
  399.                It  seemed like a good idea. Short for uN-ARC. The  idea  was 
  400.                originally Bob Freed's.
  401.  
  402.            Acknowledgments..
  403.  
  404.                I would like to thank my parents for not killing me at any 
  405.                early age and my wife for not killing me at a later age...
  406.  
  407.                I would like to thank Bob Freed for his allowing me to 
  408.                examine his Z80 code before writing NARC. Bob wrote UNARC for 
  409.                the CP/M world. A special thanks to the following kind folks.
  410.  
  411.  
  412.                      Curt Edwards        Jerry Taylor
  413.                      Chuck Crumpton      Frank Roemer
  414.                      Paul Bowling        Dr. Matthew Witten 
  415.                      Paul Clarke         Sherman Able
  416.                      Carlisle Crutcher   H.W. Straley
  417.                      John R. Gernert     Dudley Hoffman
  418.                      Dr. Melvin Maron    Bob Fergus
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  427.           
  428.                                      Page 3
  429.  
  430.                                       ═══════════════
  431.                                       ABOUT ZIP FILES
  432.                                       ═══════════════
  433.  
  434.  
  435.                The ZIP file format was developed as the natural extension of 
  436.                the older LBR and ARC files. This new format allows much 
  437.                greater data integrity than we have ever had before with 
  438.                archive utilities. The 32 bit CRC implemented plus the use of 
  439.                both a central directory and a distributed directory, offers 
  440.                the very best archive integrity.
  441.  
  442.                NARC ZIP 3.0 AND ABOVE SUPPORTS BOTH ARC AND ZIP FILES
  443.  
  444.                The compression algorithms used in ZIP files are shrinking 
  445.                and reducing. The shrinking algorithm is basically the same 
  446.                as squashing and crunching used in ARC files, except, that 
  447.                the algorithm has been fine tuned to eliminate the wasted 
  448.                bytes in earlier implementations. The code length 
  449.                responsibility has been shifted from the decompressor to the 
  450.                compressor, which again offers an increase in compression 
  451.                ratios. The total string table clearing encountered in ARC 
  452.                files, has been replaced with a much more intelligent partial 
  453.                clear, which, instead of eliminating all strings that have 
  454.                been learned in the table, only parts of strings are 
  455.                eliminated and used again.
  456.  
  457.                The reducing algorithm is really a combination of two 
  458.                distinct algorithms, statistical compression and run length 
  459.                encoding (packing), just as crunching was a combination of 
  460.                LZW and packing. The statistical compression method takes 
  461.                advantage of certain statistical character pair occurences 
  462.                common in the English language, but the algorithm also fairs 
  463.                well with other languages and binary files.
  464.  
  465.                The ZIP file format was developed by IDC and PKware and 
  466.                several other individuals after much discussion. The LZW 
  467.                algorithm improvements were readily visualized by all 
  468.                parties, but the reducing and imploding algorithms were 
  469.                developed by Phil Katz and PK-friends and has shown 
  470.                themselves to be very powerful, as we have seen files 
  471.                compressed as much as 99%.
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  489.           
  490.                                      Page 4
  491.  
  492.                                        ═════════════
  493.                                        COMPATIBILITY
  494.                                        ═════════════
  495.  
  496.  
  497.                NARC is compatible with all known "skrunching" algorithms, 
  498.                that is up to and including Squashing. NARC is compatible 
  499.                with PKarc, PKpak and PKzip. NARC supports both .ARC and .ZIP 
  500.                files and recognizes the .ARK extension soon to be prevalent 
  501.                in the CP/M world via Bob Freed's CP/M archive facility, 
  502.                NOAH.
  503.  
  504.  
  505.                          ═════════════════════════════════════════
  506.                          ARCHIVE STORAGE METHODS SUPPORTED BY NARC
  507.                          ═════════════════════════════════════════
  508.  
  509.  
  510.  
  511.                          Packing         - all versions
  512.                          Squeezing       - Huffman Coding
  513.                          Crunching       - all versions (LZW encoding)
  514.                          Squashing       - one version
  515.  
  516.  
  517.                            ═════════════════════════════════════
  518.                            ZIP STORAGE METHODS SUPPORTED BY NARC
  519.                            ═════════════════════════════════════
  520.  
  521.  
  522.  
  523.                       Reducing          - statistical compression + packing
  524.                       Shrinking         - very intelligent LZW algorithm
  525.                       Imploding         - Shannon-Fano coding of sliding
  526.                                           dictionary length and distance 
  527.                                           pairs
  528.  
  529.  
  530.                            Note: LZW stands for Lempel-Ziv-Welch
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  551.           
  552.                                      Page 5
  553.  
  554.            OverView...
  555.  
  556.                NARC first searches the default path for ZIP, ARC and ARK 
  557.                files and if any are found they are displayed in the ZIP-
  558.                window on the left side of the screen. The arrow keys (or the 
  559.                mouse), PgUP,PgDN, Home and End may be used to move the 
  560.                cursor bar up and down the window, there are two ways to 
  561.                select the highlighted ZIP file.
  562.  
  563.                  (1) Hit the ENTER key
  564.                  (2) Press the left mouse button
  565.  
  566.  
  567.                After selecting the sub-file of interest, NARC displays all 
  568.                of the ZIP sub-files and their statistics on the screen. You 
  569.                are also given a menu bar at the bottom of the screen. You 
  570.                may use the arrow keys or the mouse to move the cursor bar to 
  571.                the desired selection and then select with the  ENTER key or 
  572.                the left mouse button. As the cursor bar is moved, you are 
  573.                also given a brief description of the highlighted command. A 
  574.                file may be located in the list by the now common ALT-letter 
  575.                key combination. This applies to all menus in NARC. The 
  576.                commands will now be discussed individually.
  577.  
  578.                Note: You may also select any option from the command bar by
  579.                entering the first letter of the command.
  580.  
  581.  
  582.                     The ESCape key will abort any operation or window.
  583.  
  584.  
  585.                                         Video Modes
  586.  
  587.  
  588.                NARC will determine whether a monochrome or color video 
  589.                adapter is being used and act accordingly. If a CGA or EGA 
  590.                card is detected, then NARC will select 80 x 25 color mode, 
  591.                unless color has been turned off with NARCCFG. The users 
  592.                video mode and cursor shape is saved when NARC is invoked and 
  593.                restored upon exit or shell. On EGA/VGA equipped systems, the 
  594.                F2 key may be used to toggle NARC into and out of 25 and 43 
  595.                line modes.
  596.  
  597.                                        Mouse Support
  598.  
  599.                NARC will determine if a mouse driver is present. If so, then 
  600.                NARC's mouse support routines are enabled and working at all 
  601.                times within the program. The left mouse button ALWAYS 
  602.                emulates the ENTER key (for selecting highlighted items) and 
  603.                the right mouse button ALWAYS emulated the ESC key (for 
  604.                aborting operations). Highlight bar movement can always be 
  605.                accomplished with mouse motion. The sensitivity of mouse 
  606.                motion can be changed with NARCCFG. The mouse routines were 
  607.                written with the Microsoft mouse in mind and any mouse that 
  608.                is compatible with the Microsoft mouse should work.
  609.  
  610.  
  611.  
  612.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  613.           
  614.                                      Page 6
  615.  
  616.                                            Sound
  617.  
  618.                NARC makes use of the 8253 programmable interval timer chip 
  619.                and speaker port to create some gurgles,bleeps,whistles and 
  620.                burps in general, that some folks like and some don't. The 
  621.                chip is programmed for square wave output in mode 3. The 
  622.                sound may be permanently disabled with NARCCFG. NARC 
  623.                determines microprocessor speed and adjusts the sound 
  624.                routines accordingly so that the sounds are pretty much the 
  625.                same on all machines.
  626.  
  627.  
  628.                                    ENVIRONMENT VARIABLES
  629.  
  630.  
  631.                If you don't know what an environment variable is, then 
  632.                continue reading. If you DO know, then skip to "The Goods" 
  633.                section below.
  634.  
  635.                Note that all of the environment information can be 
  636.                configured directly into NARC zip 3.0 and above with NARCCFG. 
  637.                However, this information can be overridden with the 
  638.                environment variables. The environment variables are given 
  639.                precedence so that if you take your NARCCFG'd version to 
  640.                another machine, you can do a quick temporary set up with the 
  641.                environment variables.
  642.  
  643.  
  644.                                       What are they ?
  645.  
  646.                An environment variable is a convenient way for programs to 
  647.                communicate with DOS or with each other through a commonly 
  648.                shared spot(s) in memory. If you type "SET" <ENTER> at the 
  649.                DOS prompt, DOS will respond by showing you the current spot 
  650.                of shared memory which we call the environment. These text 
  651.                strings can be created,read, modified and deleted at any time 
  652.                by any program. Each variable has a certain format that must 
  653.                be adhered to. The format is as follows,
  654.  
  655.                                   variable_name = string
  656.  
  657.                          An example would be  IDCED=C:\UTILITY\WS
  658.  
  659.                Spaces are allowed before and after the equal sign. This 
  660.                variable will mean absolutely nothing to DOS, but, to NARC, 
  661.                it will show the way to your editor. The variable name here 
  662.                is IDCED and the string is C:\UTILITY\WS which is the 
  663.                pathname for finding WordStar on the disk. You can change 
  664.                this string to anything you want by simply typing --- SET 
  665.                IDCED= (and type your pathname for your editor). NARC uses 
  666.                several of these environment variables to communicate with 
  667.                you and you should set them up in your AUTOEXEC.BAT file.
  668.  
  669.                What do I do if DOS says, "Out of Environment Space" ?
  670.  
  671.                DOS reserves only so much space for the environment strings, 
  672.                and if you have a long search path or a lot of strings, then 
  673.  
  674.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  675.           
  676.                                      Page 7
  677.  
  678.                you may run out of space. I can offer two suggestions, one 
  679.                for DOS 3.1 and one for DOS 3.2. There is a "switch" that you 
  680.                can add to your CONFIG.SYS file (If you don't have one, then 
  681.                you should !). One of the lines in your config.sys file 
  682.                should read Shell=C:\COMMAND.COM or something similar. You 
  683.                can add the following to the end of this line to increase 
  684.                your environment space.
  685.  
  686.                      DOS 3.1 -      /E:nn    where nn = 10 up to 62. This
  687.                                              number times 16 is the length
  688.                                              of your environment.
  689.  
  690.                           example:  Shell=c:\command.com c:\ /P/E:10
  691.  
  692.                                     This would reserve 160 bytes.
  693.  
  694.                      DOS 3.2 - add  /E:nnnn  where nnnn is the actual
  695.                                              number of bytes to reserve.
  696.  
  697.                           example: Shell=c:\command.com c:\ /P /E:160
  698.  
  699.                                     This would reserve 160 bytes.
  700.  
  701.  
  702.                Environment variables can be set up in your Autoexec.bat file 
  703.                as follows.
  704.  
  705.  
  706.                           Set IDCARCPATH=c:\utility\idcshell.exe
  707.                              Set IDCED=c:\wordproc\editor.ext
  708.  
  709.  
  710.  
  711.                 The Goods ..
  712.  
  713.                      IDCED=c:\editors\ws.exe
  714.  
  715.                          Use this variable to tell NARC where your 
  716.                          editor is located, so that when the F9 key is 
  717.                          pressed to invoke the editor, NARC will know 
  718.                          where to locate it. The drive and path and 
  719.                          editors name must be given (in upper or lower 
  720.                          case). The file extension (.COM or .EXE) MUST 
  721.                          be given.
  722.                
  723.                      IDCARCPATH=c:\utility\idcshell.exe
  724.  
  725.                          Use this variable to tell IDCshell where to 
  726.                          find IDCshell when the "I" key is pressed. As 
  727.                          with IDCED, the drive and path and filename 
  728.                          and extension must be given.
  729.  
  730.                      NARCHELP=c:\utility\narchelp.hlp
  731.  
  732.                          Use this variable to tell NARC where to find 
  733.                          the NARC help file when the F1 key is pressed.
  734.  
  735.  
  736.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  737.           
  738.                                      Page 8
  739.  
  740.                      IDCTEMP=e:\ramdisk
  741.  
  742.                          Use this variable to tell NARC where it can 
  743.                          place temporary work files. If you have a 
  744.                          ramdisk set up, then this would be a good use 
  745.                          for it since all file operations will be MUCH 
  746.                          faster from the ramdisk.
  747.                                THE HELP SCREEN
  748.  
  749.  
  750.                From the files screen, it is always possible to get a context 
  751.                sensitive help screen. Hitting the F1 or F10 key will cause a 
  752.                full screen of help to pop up that has information specific 
  753.                to the command that the cursor bar was pointing to.
  754.  
  755.                Once the help window is opened up, it is then possible to get 
  756.                help on any of the commands. The Home key will take you to 
  757.                the help index (as will the "I" key). The window may be  put 
  758.                at any time with the ESC key.
  759.  
  760.                NOTE: There are several commands that are listed under
  761.                      miscellaneous commands in the INDEX section of the
  762.                      help screens, so be sure to check them out.
  763.  
  764.  
  765.                                     ════════
  766.                                     COMMANDS
  767.                                     ════════
  768.  
  769.  
  770.            ═══════════════
  771.            Extract Command
  772.            ═══════════════
  773.  
  774.                Selecting this option will cause another prompt to be 
  775.                displayed, asking whether you wish to extract the highlighted 
  776.                file or tagged files. (Files are tagged with the space bar). 
  777.                "Point and shoot" here again as before. The ESC key or the 
  778.                right mouse button will abort the operation. If the disk 
  779.                becomes full, you will be informed and have the option of 
  780.                aborting or continuing.
  781.  
  782.  
  783.            Highlighted File
  784.  
  785.                When EXTRACT is selected, you will be asked for a drive/path 
  786.                to extract the file to. If you simply hit ENTER or the left 
  787.                mouse button, the file will be extracted to the default 
  788.                drive/path. You may also enter any valid DOS drive/path. The 
  789.                ESC key or the right mouse button will abort the operation.
  790.          
  791.                 NOTE: Control-R can be used to recall the last path that
  792.                       files were extracted to.
  793.  
  794.  
  795.  
  796.  
  797.  
  798.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  799.           
  800.                                      Page 9
  801.  
  802.            Tagged Files
  803.  
  804.                The Space bar (or F3 key) is used to TAG the current file. 
  805.                When a file is tagged, a diamond will be displayed on the 
  806.                line with the current file in column 80.  The space bar will 
  807.                also unTAG a file, thus it is a "toggle". When the space bar 
  808.                is pressed, a diamond will appear as described above and  the 
  809.                cursor bar will move to the next file. When the "TAGGED" 
  810.                option is selected from the command line, all files that have 
  811.                been tagged, will be extracted to the SAME drive/path.
  812.  
  813.                After the file is extracted, it's date and time are set to 
  814.                those contained in the ZIP file. The file is also checked for 
  815.                size and CRC, if both of these do not match exactly what was 
  816.                contained in the ZIP file header, then an error has occurred 
  817.                and the user is notified. The files will also remain tagged 
  818.                after the extraction.
  819.  
  820.                If a zipfile contains stored subdirectory names, each 
  821.                file will be displayed with the INFINITY symbol 
  822.                (sideways 8) next to it. When you wish to extract a file 
  823.                that has this "tag", NARC will ask you how you wish to 
  824.                handle the stored subdirectory names. You have several 
  825.                options..
  826.  
  827.  
  828.                      (A)bort  - aborts the extraction
  829.                      (P)rompt - prompt and ask before creating any
  830.                                 subdirectories
  831.                      (C)reate - create subdirectories as needed
  832.                      (I)gnore - ignore the stored pathnames
  833.  
  834.  
  835.                If the (C) or (P) options are chosen, then directories 
  836.                that are created, will be created starting with the 
  837.                extract path that you have selected as the top 
  838.                directory.
  839.  
  840.  
  841.            ════════════
  842.            View Command
  843.            ════════════
  844.  
  845.                This option will display the currently highlighted file on 
  846.                the screen. The PgUP, PGDN, Home and End keys, as well as the 
  847.                cursor keys allow movement through the file. The file to be 
  848.                viewed is first extracted to the default drive (or to 
  849.                whereever the IDCTEMP variable points) to a file called 
  850.                NARC.TMP. This file is deleted when the view is ended. The 
  851.                extraction is performed due to the sequential nature of ZIP 
  852.                files, which makes it nearly impossible to perform the page 
  853.                up,down operations on the compressed file itself. If NARC 
  854.                finds that there is not enough disk space or directory space 
  855.                to create NARC.TMP, you will be asked for another drive where 
  856.                the temporary file can be created.
  857.  
  858.  
  859.  
  860.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  861.           
  862.                                      Page 10
  863.  
  864.                The newest addition to the view command in NARC 2.1 is the 
  865.                text search command. Simply hit "S" and you will be prompted 
  866.                for a string to find. When located, the text will be 
  867.                highlighted on the screen, otherwise a message is issued 
  868.                stating that the text was not found. The search is case 
  869.                insensitive, that is you may enter upper or lower case 
  870.                letters and NARC will find a match.
  871.  
  872.                 The mouse is also supported now in the view function.
  873.  
  874.            ═════════════
  875.            Print Command
  876.            ═════════════
  877.  
  878.                The print option will print the currently highlighted file. 
  879.                After selecting the print option, you will be asked which 
  880.                character pitch you want to print in. Enter the number that 
  881.                you wish (or 0 for the default pitch) and the printer will be 
  882.                set to that pitch.
  883.  
  884.  
  885.          NOTE: The printer strings that come installed with NARC are compatible
  886.                with EPSON printer strings. If you wish to install NARC with
  887.                your own strings, see NARCCFG.DOC for complete instructions.
  888.  
  889.                After selecting selected the printer pitch, you will be shown 
  890.                three more options for formatting the printout. Use the arrow 
  891.                keys to move left and right. The space bar is used to toggle 
  892.                the options ON or OFF. When you have finished and are ready 
  893.                to print, hit ENTER (or left mouse button). The ESC key or 
  894.                the right mouse button will abort at any time. The options 
  895.                are;
  896.  
  897.                  Format -        YES - This option causes NARC to format the
  898.                                        output with page breaks and page numbers.
  899.                                  NO  - NARC does not format the file.
  900.  
  901.          The following two options work independently of the Format option.
  902.  
  903.                  Strip High -    YES - NARC will strip the high bit off each
  904.                                        character before it is sent to the
  905.                                        printer. Some word processors set this
  906.                                        high bit on some characters as a means of
  907.                                        text formatting. These characters will
  908.                                        print as garbage usually.
  909.                                  NO  - NARC will not strip the high bit.
  910.  
  911.                  Strip Control - YES - NARC will strip all control characters
  912.                                        from the file before it is printed. This
  913.                                        is useful on files that have embedded
  914.                                        formatting characters, and you wish to
  915.                                        have NARC provide the formatting.
  916.                                  NO  - NARC will not strip the control chars.
  917.  
  918.                NOTE: On all of the following windows, the PG UP, PG DN,
  919.                      HOME and END keys in addition to the cursor keys
  920.                      allow movement through the window.
  921.  
  922.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  923.           
  924.                                      Page 11
  925.  
  926.  
  927.            ════════════════
  928.            ZIP-wind Command   
  929.            ════════════════
  930.                This option will display the window containing all of 
  931.                the ZIP, ARC or ARK files in the current sub-directory. 
  932.                Move the cursor bar up and down with the mouse or arrow 
  933.                keys and select with the  ENTER key or left mouse 
  934.                button.
  935.  
  936.            ════════════════
  937.            DRV-wind Command
  938.            ════════════════
  939.  
  940.                This option will pop up a window that contains all of 
  941.                the logical drives that DOS reports to NARC. Select as 
  942.                before and the ZIP-window will be popped up so that you 
  943.                can then choose a ZIP file to examine.
  944.  
  945.  
  946.            ═══════════════
  947.            DirTree Command
  948.            ═══════════════
  949.  
  950.                This command is totally new with release 2.1. The old 
  951.                window approach won a lot of criticism and rightfully 
  952.                so. I had a tree routine that I wrote some time ago, 
  953.                that I just wasn't happy with speed-wise and didn't want 
  954.                to stick that thing in NARC. I did have some nice ideas 
  955.                for a new routine that would be much faster and slicker 
  956.                all around and finally found the time to write it and 
  957.                NARC  release 2.1 has it, you may judge for yourself.
  958.  
  959.                A visual tree is presented that displays all 
  960.                subdirectories on the disk. Once the tree has been read, 
  961.                NARC will not read it again, unless you have changed 
  962.                drives.
  963.  
  964.                From the tree, you can create and delete subdirectories, 
  965.                select a new drive or subdirectory or return with no 
  966.                action at all. The ESC key will abort the tree 
  967.                operations.
  968.  
  969.            ════════════
  970.            Quit Command
  971.            ════════════
  972.  
  973.                The exit options have been changed so that now you will 
  974.                be prompted for where you wish to exit the program. You 
  975.                have the choice of exiting to the current directory or 
  976.                the original directory where NARC was invoked from. This 
  977.                can be made totally automatic with the NARCCFG program 
  978.                in the registered version.
  979.  
  980.  
  981.  
  982.  
  983.  
  984.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  985.           
  986.                                      Page 12
  987.  
  988.            ══════════════════
  989.            ALTERNATE COMMANDS
  990.            ══════════════════
  991.  
  992.                The extra commands can be located on the help screens, 
  993.                which are invoked by the F1,F10 or ? keys.
  994.  
  995.            F1 - key
  996.                           Invokes the context sensitive help system.
  997.  
  998.            F2 - key
  999.                          This key allows toggling between 25 and 43 
  1000.                          line modes on EGA/VGA systems. On CGA/MONO 
  1001.                          systems, it will have no effect.
  1002.  
  1003.            F3 - key
  1004.                          This key will tag a subfile and move the 
  1005.                          cursor bar on to the next subfile. This key 
  1006.                          also has other functions, and they are also 
  1007.                          shown on the screen when necessary.
  1008.            F4 - key
  1009.                          The F4 key will print an image of the screen 
  1010.                          less the advertisement and command lines. 
  1011.  
  1012.            F5 - key
  1013.                          Invokes the NARC-DOS command processor. You 
  1014.                          may then enter any valid DOS command. When 
  1015.                          finished, simply hit ENTER by itself and you 
  1016.                          will be returned to NARC. You may also enter 
  1017.                          "COMMAND" which will invoke a second copy of 
  1018.                          COMMAND.COM, if the file COMMAND.COM is in 
  1019.                          your search path. To return to NARC, you would 
  1020.                          then type "EXIT". 
  1021.  
  1022.            F6 - key
  1023.                          This key will tag all of the subfiles in the 
  1024.                          archive for subsequent extraction.
  1025.  
  1026.            F7 - key
  1027.                          This key will invert all of the tags on the 
  1028.                          subfiles, that is all files that were tagged 
  1029.                          will become untagged and vice-versa.
  1030.  
  1031.            F9  - key
  1032.                          This key will call your editor. Note that you 
  1033.                          MUST have first set up the environment 
  1034.                          variable IDCED before this function can be 
  1035.                          used -OR- in NARC 3.0 and above, you may also 
  1036.                          set the path to the editor permanently into 
  1037.                          NARC with NARCCFG in the registered version. 
  1038.                          See the section on environment variables.
  1039.  
  1040.            F10 - key
  1041.                          This key will call up the context sensitive 
  1042.                          help system.
  1043.  
  1044.  
  1045.  
  1046.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  1047.           
  1048.                                      Page 13
  1049.  
  1050.        ALT-F10  - key
  1051.                          This sequence displays the trivia screen, 
  1052.                          where your serial number and other information 
  1053.                          is located.
  1054.  
  1055.  
  1056.            (F)ind command.
  1057.                          Will prompt for a wildcard filename to find in 
  1058.                          the sub-file list. Any number of characters 
  1059.                          may be used, for example, you may enter a 
  1060.                          single character and NARC will find the first 
  1061.                          file whose name begins with that character. 
  1062.                          Alternatively, you may enter a complete 
  1063.                          wildcard specification and NARC will attempt 
  1064.                          to find a match.
  1065.  
  1066.            (K)ill file command.
  1067.                          Will remove the currently highlighted sub-file 
  1068.                          from the archive. No additional disk space is 
  1069.                          required for temporary files.
  1070.  
  1071.          PgUP,PgDN,Home and End
  1072.                          These keys do what you might expect.  These 
  1073.                          functions work in all windows.
  1074.  
  1075.             (S)et search spec command.
  1076.                          When NARC searches the current directory for 
  1077.                          archive files, it normally searches for ZIP, 
  1078.                          ARC or ARK files. The .ARK may be changed to 
  1079.                          another extension (or wildcard extension) with 
  1080.                          this command. All subsequent searches will use 
  1081.                          the .ZIP and .ARC extension and the newly 
  1082.                          defined mask. This command may be used from 
  1083.                          the ZIP file window or from the subfile 
  1084.                          screen.
  1085.  
  1086.                          The extension may also be passed from the 
  1087.                          command line. Enter NARC /h for complete 
  1088.                          information.
  1089.  
  1090.             (I)DCshell command.
  1091.                          This command will run IDCshell.EXE.  Note 
  1092.                          that the environment variable IDCARCPATH must 
  1093.                          be set up before this command will work, 
  1094.                          unless IDCshell is in the current directory. 
  1095.                          IDCshell is the companion program to NARC and 
  1096.                          was be released in Aug - 88. This command 
  1097.                          provides a simple link between the arcing 
  1098.                          functions of IDCshell (and its copy / rename / 
  1099.                          delete/print/view etc...) functions. Note that 
  1100.                          NARC can also be called from IDCshell via its 
  1101.                          "N" command along with a filename. Note that 
  1102.                          in NARC zip 3.0 and above, the path for 
  1103.                          IDCshell can be permanently configured into 
  1104.                          NARC with NARCCFG in the registered version 
  1105.                          instead of using the environment variables.
  1106.  
  1107.  
  1108.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  1109.           
  1110.                                      Page 14
  1111.  
  1112.  
  1113.                          Command line syntax:
  1114.  
  1115.                               NARC [drive:\path\subfilemask]
  1116.                If the drive:path\subfilemask is given, then NARC will 
  1117.                display all files that match the given specification in 
  1118.                the zipfile window when NARC is first invoked. If no 
  1119.                subfilemask is given, then NARC defaults to displaying 
  1120.                all ZIP/ARC/ARK files if no subfilemask is not given.
  1121.  
  1122.                If the drive and/or path is given, then NARC will search 
  1123.                the given drive or path for files that match the 
  1124.                subfilemask.
  1125.  
  1126.  
  1127.                                  TRIVIA STATUS SCREEN
  1128.  
  1129.                This screen shows some useful information about the 
  1130.                current NARC environment. It is invoked with the ALT-F10 
  1131.                command sequence from the subfiles screen.
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  1171.           
  1172.                                      Page 15
  1173.  
  1174.  
  1175.                             Operating Hints and Shortcuts
  1176.  
  1177.  
  1178.  
  1179.                When NARC is first invoked, it pops up the ZIP-window 
  1180.                showing all of the ZIP/ARC files in the current directory. 
  1181.  
  1182.                NOTE: When the ZIP file window is onscreen, you may also 
  1183.                choose another file extension beside .ARK with the "S" 
  1184.                command. See the section entitled "Using extensions 
  1185.                besides .ZIP and .ARC".
  1186.  
  1187.                When there are no windows popped up, the "A" key or the 
  1188.                "Z" key  will pop up the ZIP file window, regardless of 
  1189.                where the command line cursor bar is. This is handy when 
  1190.                you have a lot of ZIP's that you want to thumb through, 
  1191.                with just the 2  mouse buttons or ENTER and F2 keys, you 
  1192.                can look through a whole directory of ZIP files in 
  1193.                nothing flat ! Also along  these lines, when the ZIP 
  1194.                window is on the screen, the right mouse button or the 
  1195.                ESCape key will exit the program.
  1196.  
  1197.                NARC buffers 64k of the input file at one time, thus 
  1198.                speeding up file operations. The output buffer is 32k 
  1199.                and should be larger in the next version. NARC requires 
  1200.                about 220K of RAM to operate.
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.                        (This prime advertising space for rent)
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  1233.           
  1234.                                      Page 16
  1235.  
  1236.  
  1237.                Note that the arrows keys may be used to move the error 
  1238.                message box up and down the screen. This feature is provided 
  1239.                so that if the message covers up something on the screen that 
  1240.                you would like to see, you may move the box.
  1241.  
  1242.  
  1243.                                 ══════════════════════
  1244.                                    Error Messages.
  1245.                                 ══════════════════════
  1246.  
  1247.          Memory Allocation Error.
  1248.                          - NARC allocates memory when it is invoked, 
  1249.                          this says that DOS told NARC that there was 
  1250.                          not enough memory left to run the program
  1251.  
  1252.          ERROR: Extraction Failed due to CRC error, Hit ENTER
  1253.                          - After a file is extracted, the CRC contained 
  1254.                          in the ZIP header is compared to the CRC that 
  1255.                          NARC calculates, this message says  that the 
  1256.                          two were different. This is the CRC-16 
  1257.                          polynomial in ARC/ARK files and CRC-32 in ZIP 
  1258.                          files.
  1259.  
  1260.          ERROR: Extraction Failed due to FileSize error
  1261.                          - Same as above, except with filesize
  1262.  
  1263.          ERROR: Disk File Inconsistency.  Hit ENTER
  1264.                          - This will usually mean that the user has 
  1265.                          swapped disks just after telling NARC to 
  1266.                          View,Print or Extract and NARC does not 
  1267.                          recognize the file, or it may also be 
  1268.                          displayed as the result of reading/extracting 
  1269.                          a damaged ZIP file.
  1270.  
  1271.          ERROR: Incompatible Crunch Format
  1272.                          - Says that either the stowage code for this 
  1273.                          file is not supported by NARC -OR- there is an 
  1274.                          error in the ZIP header
  1275.  
  1276.          ERROR: Extraction Failed due to Lack of Disk Space
  1277.                          - Abort will stop tagged extraction, continue 
  1278.                          will try to fit next file. 
  1279.  
  1280.          Squeezed File Has a Diseased Decode Tree.
  1281.                          - When unsqueezing a file, NARC has found a 
  1282.                          bad entry in the decode table.
  1283.  
  1284.          ERROR: No directory space on destination!
  1285.                          - Self explanatory
  1286.  
  1287.          Bad Path Name, Hit ENTER
  1288.                          - The destination path that the user entered 
  1289.                          for extraction is not a valid DOS pathname, 
  1290.                          re-enter.
  1291.  
  1292.  
  1293.  
  1294.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  1295.           
  1296.                                      Page 17
  1297.  
  1298.          Requires DOS version 2.0 or above.
  1299.                          - NARC requires DOS 2.0 or above to operate.
  1300.  
  1301.          Invalid archive file format
  1302.                          - NARC could not find any ZIP headers, this is 
  1303.                          probably not a ZIP or ARC file.
  1304.  
  1305.          Warning: Bad archive file header, bytes  skipped = xxxxx
  1306.                          - If an entry has a bad header, NARC will 
  1307.                          examine the next 64k bytes looking for a good 
  1308.                          header.  This is to maintain compatibility 
  1309.                          with self-unpacking ARC files.
  1310.  
  1311.          Unexpected end of  archive file
  1312.                          - Says that NARC couldn't find the last ZIP 
  1313.                          header
  1314.  
  1315.          No matching file(s) in archive
  1316.                          - ZIP file is empty
  1317.  
  1318.  
  1319.          Cannot create work file, enter drive for temporary file
  1320.                          -there was not enough directory space or disk 
  1321.                          space to create NARC.TMP for viewing. Enter a 
  1322.                          drive letter where NARC can create the 
  1323.                          necessary work file. The file will be deleted 
  1324.                          when the view has ended.
  1325.   
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  1357.           
  1358.                                      Page 18
  1359.  
  1360.                      ════════════════════════════════════════════
  1361.                      ARCHIVE FILE FORMATS AND GENERAL INFORMATION
  1362.                      ════════════════════════════════════════════
  1363.  
  1364.  
  1365.                 For Those With a Little More Curiosity...
  1366.  
  1367.  
  1368.                The following are the currently supported stowage methods.
  1369.  
  1370.                 1    unpacked (obsolete)
  1371.                 2    unpacked
  1372.                 3    packed
  1373.                 4    squeezed (after packing)
  1374.                 5    crunched (obsolete)
  1375.                 6    crunched (after packing) (obsolete)
  1376.                 7    crunched (after packing, using faster hash algorithm)
  1377.                 8    crunched (after packing, using dynamic LZW variations)
  1378.                 9    Squashed c/o Phil Katz (no packing) (var. on crunching)
  1379.  
  1380.                 NOTE:    LZW is Lempel-Ziv-Welch compression algorithm
  1381.  
  1382.                          A little about the stowage methods.
  1383.  
  1384.                          ══════════════════════════════════
  1385.                          Packing   (or run length encoding)
  1386.                          ══════════════════════════════════
  1387.  
  1388.                This is the simplest of the storage methods. Suppose 
  1389.                that you  have a line of text and at the end of the 
  1390.                line, you have 40 spaces. These 40 spaces are compressed 
  1391.                into 3 bytes in the ZIP file by the "packer". The first 
  1392.                byte is the actual character to be expanded (in our case 
  1393.                a space). The second  byte is a special "flag" byte that 
  1394.                indicates that we need to expand these bytes when we 
  1395.                extract the file. The third byte is the count byte (in 
  1396.                our case it would be 40). So you can see that any time 
  1397.                the compressor finds repeated bytes like this, it can 
  1398.                compress them into 3 bytes. The anomalous case to watch 
  1399.                out for here is when the count byte is the same 
  1400.                character as the "flag" byte, this proved to be a 
  1401.                difficult roach to kill !
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  1419.           
  1420.                                      Page 19
  1421.  
  1422.                                       ═════════
  1423.                                       IMPLODING
  1424.                                       ═════════
  1425.  
  1426.  
  1427.                The imploding algorithm scans the input file for string 
  1428.                matches. As the algorithm proceeds through the input 
  1429.                file, it looks "backward" toward the start of the file 
  1430.                to see if any character strings can be found to match 
  1431.                the string it is currently examining. If a match is 
  1432.                found, then the LENGTH of the match, as well as the 
  1433.                DISTANCE "backwards" in the file can be sent to the 
  1434.                output file, rather than the string itself. For example, 
  1435.                if our input file looked like this;
  1436.  
  1437.  
  1438.                 "This is the input file. This is the last sentence."
  1439.  
  1440.  
  1441.                We note there are 50 characters in our input file. As 
  1442.                the algorithm scans this file, it notices that the 
  1443.                phrase "This is the " is repeated, so we need not send 
  1444.                this string to the output file, but instead we send the  
  1445.                LENGTH and DISTANCE values. When the algorithm is 
  1446.                looking at the second "This is the " string, it finds a 
  1447.                match at 24 characters backwards in the file (e.g. the 
  1448.                first string), this is the DISTANCE value; and the match 
  1449.                LENGTH is 12. The output file would now look like this;
  1450.  
  1451.  
  1452.                 "This is the input file. LENGTH,DISTANCE "last sentence."
  1453.  
  1454.  
  1455.                The imploding algorithm, however, takes this "sliding 
  1456.                dictionary" output (LENGTH,DISTANCE pairs) and further 
  1457.                encodes them using a Shannon-Fano tree. Just as the 
  1458.                Huffman algorithm translates one character set into 
  1459.                another based upon frequency of occurrence, so the 
  1460.                imploding algorithm does with the LENGTH,DISTANCE pairs. 
  1461.                A table of values is built determined by the frequency 
  1462.                of occurrence of the LENGTH,DISTANCE pairs, that is the 
  1463.                number of times each LENGTH,DISTANCE pair is used in the 
  1464.                encoding process. The table is then sorted by frequency 
  1465.                of occurrence and unique variable bit length codes are 
  1466.                assigned to the table entries. The net result is that 
  1467.                the more frequently used pairs will be assigned the 
  1468.                shortest codes (measured in bits). There are up to three 
  1469.                tables used in the encoding process, one for LENGTH, one 
  1470.                for DISTANCE and one for literal characters. These 
  1471.                tables are stored in the zipfile in BCD compressed 
  1472.                format. For a complete description of Shannon-Fano 
  1473.                coding, see "DATA COMPRESSION", Held, Wiley Pub.
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  1481.           
  1482.                                      Page 20
  1483.  
  1484.                               ══════════════════════════
  1485.                               HUFFMAN CODING (SQUEEZING)
  1486.                               ══════════════════════════
  1487.  
  1488.  
  1489.  
  1490.                It does, at first, seem that making a file smaller would 
  1491.                be an impossible task. I will make an attempt here to 
  1492.                shed a little light on this subject since that is a 
  1493.                question that I hear pretty frequently and it is not a 
  1494.                two minute discussion question. It does require some 
  1495.                thought.
  1496.  
  1497.                To compress a file with the Huffman algorithm, commonly 
  1498.                called squeezing, the first thing that must be done is 
  1499.                to read the file completely and count the occurrences of 
  1500.                each character. That is you count the "A" 's and the "B" 
  1501.                's and so forth. There are 256 characters in the 
  1502.                extended ASCII character set, of which approximately 90 
  1503.                are "printable", that is you can see them on the screen. 
  1504.                The IBM set has more "printables", but that is of no 
  1505.                consequence, since the squeezer deals only with the 
  1506.                numbers and doesn't care whether or not the file is an 
  1507.                ASCII text file or an EXE file. Once the squeezer has 
  1508.                counted the occurrences of each character, thus the 
  1509.                frequency of occurrence, it scans the table for the 
  1510.                characters that appear the least number of times and 
  1511.                forms an imaginary link between them, called a node. 
  1512.                Somewhere else in the tree, we will later develop a 
  1513.                pointer that points to this node. When you start putting 
  1514.                all of these things together, you will form a binary 
  1515.                tree in memory. Confused enough ? Let us try an example.
  1516.  
  1517.                We have a file that is 100 bytes long and has 6 
  1518.                different characters in it. We have counted the 
  1519.                occurrence of each of the characters and found the 
  1520.                following.
  1521.  
  1522.  
  1523.                  quantity        character
  1524.  
  1525.                           5 -    D
  1526.                          10 -    A
  1527.                          10 -    F
  1528.                          20 -    B
  1529.                          25 -    E
  1530.                          30 -    C
  1531.  
  1532.                The spelling in the file wasn't very good, but we don't care. 
  1533.                Now we take these numbers and will call them the  
  1534.                frequency of each character. We then arrange the table 
  1535.                as below. This is an arbitrary arrangement, but it is 
  1536.                useful here so as to make our tree readable on the 
  1537.                screen. The arrangement makes no difference.
  1538.  
  1539.  
  1540.  
  1541.  
  1542.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  1543.           
  1544.                                      Page 21
  1545.  
  1546.                 Frequency        20      10      5       10      30      25
  1547.  
  1548.                 Character        B       A       D       F       C       E
  1549.  
  1550.  
  1551.                We then examine the table to find the two characters 
  1552.                with the smallest frequency of occurrence. In our case, 
  1553.                it is obvious that one of them is 5,but which 10 do we 
  1554.                choose. As it turns out, it doesn't matter which one you 
  1555.                choose, we will arbitrarily choose the F. We draw lines 
  1556.                from the D and the F to form our node (the box below).
  1557.  
  1558.  
  1559.                 Frequency        30      10     5        10      20      25
  1560.  
  1561.                 Character        C       A      D         F       B       E
  1562.                                                 \        /
  1563.                                                  \      /
  1564.                                                    ╔══╗
  1565.                                                    ║15║ = 5 + 10
  1566.                                                    ╚══╝
  1567.  
  1568.  
  1569.                The number in the box is the sum of the frequencies of 
  1570.                the D and F characters. Now we again look for the lowest 
  1571.                two frequencies, except, this time we do not consider 
  1572.                the D and F characters individually, we instead consider 
  1573.                the node. The lowest two now are the A and the node, 
  1574.                that is 10 and 15. We again do some artwork.
  1575.  
  1576.  
  1577.                Frequency      30      10         5        10      20      25
  1578.  
  1579.                Character       C      A          D         F       B      E
  1580.                                       \          \       /               
  1581.                                        \          \     /
  1582.                                         \          ╔══╗
  1583.                                          \         ║15║ = 5 + 10
  1584.                                           \        ╚══╝
  1585.                                            \      /
  1586.                                             \    / 
  1587.                                              ╔══╗
  1588.                                              ║25║ = 10 + 15
  1589.                                              ╚══╝
  1590.  
  1591.  
  1592.                We look at the table again for the next two lowest 
  1593.                frequencies and now find B and E. We continue in this  
  1594.                fashion until the entire "tree" is built, that is until 
  1595.                it all condenses to one node. The leaves are the actual  
  1596.                characters at the top of the tree and the nodes 
  1597.                represent branch joints with the root at the bottom.
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  1605.           
  1606.                                      Page 22
  1607.  
  1608.                 Frequency    30        10        5        10    20        25
  1609.  
  1610.                 Character    C         A        D         F     B        E
  1611.                               \         \       \         /      \       /
  1612.                                \         \       \       /        \     /
  1613.                                 \         \         ╔══╗            ╔══╗
  1614.                                  \         \        ║15║            ║45║
  1615.                                   \         \       ╚══╝            ╚══╝
  1616.                                    \         \      /              /
  1617.                                     \         \    /              /
  1618.                                      \         ╔══╗              /
  1619.                                       \        ║25║             /
  1620.                                        \       ╚══╝            /
  1621.                                         \       /             /
  1622.                                          \     /             /
  1623.                                           ╔══╗              /
  1624.                                           ║55║             /
  1625.                                           ╚══╝            /
  1626.                                             \            /
  1627.                                              \          /
  1628.                                                 ╔════╗
  1629.                                                 ║ROOT║
  1630.                                                 ╚════╝
  1631.  
  1632.  
  1633.                Now that our tree is made up, we can encode the file. We 
  1634.                start at the root (always). To encode the first 
  1635.                character (leaf) of the tree (the letter C), we trace up 
  1636.                the tree until we hit the letter C at the top. Along our 
  1637.                journey, if we make a left turn, we record a 0 bit, and 
  1638.                a 1 for a right turn. So for the C, we would go left to 
  1639.                55 (and record a 0) and then left again to the letter C 
  1640.                (and record another 0),so the Huffman code for our 
  1641.                letter C is 00. For A we go left to 55, right to 25 and 
  1642.                left to A and it becomes 010. By doing all of the 
  1643.                letters this way, we find the following.
  1644.  
  1645.  
  1646.                          C = 00          ( 2 bits )
  1647.                          A = 010         ( 3 bits )
  1648.                          D = 0110        ( 4 bits )
  1649.                          F = 0111        ( 4 bits )
  1650.                          B = 10          ( 2 bits )
  1651.                          E = 11          ( 2 bits )
  1652.  
  1653.                Mind that the zeroes and ones above are bits and not 
  1654.                bytes. Each character was represented in the original 
  1655.                file by 8 bits (one byte) and since we have reduced the 
  1656.                number of bits needed to represent each character, we 
  1657.                therefore reduce the size of the file. The savings add 
  1658.                up as follows,
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  1667.           
  1668.                                      Page 23
  1669.  
  1670.                 character  frequency     original bits    squeezed bits  savings
  1671.  
  1672.                 C            30           30 x 8 = 240      30 x 2 = 60    180
  1673.                 A            10           10 x 8 = 80       10 x 3 = 30     50
  1674.                 D             5            5 x 8 = 40        5 x 4 = 20     20
  1675.                 F            10           10 x 8 = 80       10 x 4 = 40     40
  1676.                 B            20           20 x 8 = 160      20 x 2 = 40    120
  1677.                 E            25           25 x 8 = 200      25 x 2 = 50    150
  1678.                          ══════════               ══════            ═════  ═════
  1679.                 Totals      100                    800              240    560
  1680.                                                     │                │
  1681.                            original file size ──────┘                │
  1682.                            squeezed file size ───────────────────────┘
  1683.  
  1684.  
  1685.                240 is 30% of 800, so we have compressed this file by 
  1686.                70%. Golly Wally, that seems pretty good. The rub lies 
  1687.                in the fact that in order to reconstruct the original 
  1688.                file, we must have access to the decode tree and since 
  1689.                each tree will be different for each file, we must 
  1690.                therefore save the tree with the file. It turns out that 
  1691.                the tree can have only 256 nodes in a bytewise 
  1692.                compression technique and each node will hold 4 bytes as 
  1693.                pointers,a full table will be about 1k long. The table 
  1694.                in our example has 5 nodes plus the 6 leaf nodes (where 
  1695.                our characters are), totaling 11. 4 times 11 is 44 and 
  1696.                if we add a few bytes for storing the node count and 
  1697.                some other statistics, our table is about 50 bytes long. 
  1698.                If we look at the 240 in the above table this gives the 
  1699.                total number  of bits that it will take to encode the 
  1700.                file, divide 240 by 8 to get the number of bytes (30) 
  1701.                and add it to our 50, we get a  compressed file size of 
  1702.                80 bytes. Since our original file was 100 bytes, we have 
  1703.                achieved a 20% reduction in file size. Not bad. What we 
  1704.                have really accomplished is a translation of character 
  1705.                sets, with our new set requiring less space than the 
  1706.                original ASCII set.
  1707.  
  1708.                 How far can we go ?
  1709.  
  1710.                If we look at the maximums that we can obtain for the 
  1711.                different bit combinations in a optimally skewed tree, that 
  1712.                is a tree that is not exactly symmetrical, we find that we 
  1713.                can have only 4 - 2 bit codes, 8 - 3 bit codes, 16 - 4 bit 
  1714.                codes, 32 - 5 bit codes, 64 - 6 bit codes, 128 - 7 bit codes, 
  1715.                the remaining 4 will be 8 bit codes.
  1716.  
  1717.  
  1718.                                  2       - 1 bit codes
  1719.                                  4       - 2 bit codes
  1720.                                  8       - 3 bit codes
  1721.                                  16      - 4 bit codes
  1722.                                  32      - 5 bit codes
  1723.                                  64      - 6 bit codes
  1724.                                  128     - 7 bit codes
  1725.                               --------
  1726.                                  254
  1727.  
  1728.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  1729.           
  1730.                                      Page 24
  1731.  
  1732.                And since we have a total of 256 different bytes to 
  1733.                encode, the remaining 2 characters  must have 8 bit 
  1734.                codes. If we add the number of bits that this 
  1735.                represents,we find a total of 1554 bits or 195 bytes. So 
  1736.                at maximum, we have compressed the 256 bytes to 195 or 
  1737.                33%, thus the idealistic  maximum that can be  achieved 
  1738.                with the Huffman algorithm is 33% when using a byte 
  1739.                level implementation.
  1740.  
  1741.                One final note; The Huffman scheme requires the input 
  1742.                file to be read twice, once to count characters and 
  1743.                frequencies and then again to do the  actual encoding. 
  1744.                The major differences in Huffman coding and  crunching 
  1745.                lie in the fact  that crunching is a one pass operation 
  1746.                and does not require the table to be stored with the 
  1747.                file. Both, however, are extremely vulnerable to errors, 
  1748.                for example, imagine what would happen if you skipped 
  1749.                one bit when squeezing the file, all of the remaining 
  1750.                characters in the file would  become the proverbial 
  1751.                garbage, since we are looking at the file on a bit 
  1752.                level.
  1753.  
  1754.  
  1755.                NARC uses the method described in K. & R. pp. 130 for 
  1756.                setting up the binary tree with several modifications. 
  1757.                The simple binary tree is acceptable for this, since the 
  1758.                tree never grows and therefore will never become 
  1759.                unbalanced.
  1760.  
  1761.                If you followed that, now go back and read the second 
  1762.                paragraph again, maybe it will make sense this time.
  1763.  
  1764.                             ═════════════════════════════
  1765.                             CRUNCHING/SQUASHING/SHRINKING
  1766.                             ═════════════════════════════
  1767.  
  1768.  
  1769.                Crunching began with an article by J. Ziv and A. Lempel 
  1770.                in IEEE Trans. Information Theory, May 1977, where the 
  1771.                method was originally described. Terry A. Welch wrote a 
  1772.                definitive application article in IEEE Computer, June 
  1773.                1984 which described in detail how to apply the 
  1774.                algorithm and some  common problems encountered. Thus 
  1775.                the name LZW compression.
  1776.  
  1777.                Crunching takes the Huffman coding method a step further 
  1778.                as it does not include a table with the crunched file. 
  1779.                The crunching algorithm also "learns" as it proceeds 
  1780.                through the file. If it finds repeated strings in the 
  1781.                file, they will be encoded into a table. This table is 
  1782.                set up (in NARC's implementation) as a 4096 by 3 table. 
  1783.                Each entry is formatted as <PREF>,<SUFFIX>, where PREF 
  1784.                is a 2 byte pointer to another entry. SUFFIX is the byte 
  1785.                for this entry. Representing the PREF's as pointers 
  1786.                rather than values speeds up most operations in NARC. 
  1787.                This idea came from Bob Freed and is very trick.
  1788.  
  1789.  
  1790.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  1791.           
  1792.                                      Page 25
  1793.  
  1794.                One obvious benefit of crunched files is the fact that 
  1795.                there is no need to  include the encoding table in the 
  1796.                compressed file as was the case with squeezing. Another 
  1797.                great benefit is the fact that    crunching is a one 
  1798.                pass operation as opposed to the two pass situation in 
  1799.                squeezed files.
  1800.  
  1801.                Crunching begins by creating an "atomic" table, that is 
  1802.                a table in RAM that contains 256 entries, one for each 
  1803.                character in the extended  ASCII set. The values range 
  1804.                sequentially from 0 to 255. The table entries are 
  1805.                arranged as follows.
  1806.  
  1807.                  Prefix Pointer (2 bytes) and Suffix byte (1 byte)
  1808.  
  1809.                In this initial table setup, the Suffix bytes are the 0 
  1810.                through 255 mentioned above. These are the "atomic"  
  1811.                characters, in that they must be in the table  before  
  1812.                crunching or uncrunching can begin, since all files 
  1813.                contain  some portion of this character set. We do not 
  1814.                know which characters will be included in any given file 
  1815.                and which ones will be excluded,so we must include them 
  1816.                all in our initial table. Once this table is set up, we 
  1817.                can begin crunching.
  1818.  
  1819.                The Prefix pointer will contain a value that is a 
  1820.                pointer to another string. When the table is initially 
  1821.                set up, there are no other strings, so this Prefix 
  1822.                pointer is set to a special "Null" string, that is it 
  1823.                points nowhere. We must be careful when crunching the 
  1824.                file, to look for this special pointer and act 
  1825.                accordingly when we encounter it.
  1826.  
  1827.                This Prefix and Suffix business is used to "build" long 
  1828.                strings. If we read the input file and found that the 
  1829.                first character was the letter "I", we would look this 
  1830.                letter up in the string table by hashing (computing an 
  1831.                address). If we found the letter in the table (which we 
  1832.                certainly will on the first character), then we output 
  1833.                it's "hashed" address as a code to the output file (the 
  1834.                crunched file). Suppose then, that the next character 
  1835.                input from the file was the letter "D", the cruncher 
  1836.                would then look at the I and the D together to see if 
  1837.                they exist as a string in the table. Well of course, 
  1838.                since this is the second character of the file, we know 
  1839.                that it doesn't, so the cruncher forms a new entry in 
  1840.                the string table. This entry has  as its' Prefix 
  1841.                pointer, a value that "points" to the letter "I" entry 
  1842.                in the table, that we made a minute ago. The suffix byte 
  1843.                in this case would be the letter "D". Now another code 
  1844.                is output to the crunched file, representing the letter 
  1845.                "D". Well this is great,  we  have  now turned 2 bytes 
  1846.                from the input file (16 bits) into 3 bytes in the output 
  1847.                file (24 bits). You are correct, crunching begins by  
  1848.                "not crunching" , but it is a crazy world ! The real 
  1849.                value becomes apparent when we  run into this same 
  1850.                sequence "ID" in the input file again. Now we will find 
  1851.  
  1852.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  1853.           
  1854.                                      Page 26
  1855.  
  1856.                an entry for it in the string table and we can  output a 
  1857.                single 12 bit code that stands for "ID", thus saving 4 
  1858.                bits. The cruncher continues "learning" strings like 
  1859.                this until the file is crunched. It should be noted that 
  1860.                the string table is dynamically changing as the input 
  1861.                file is processed.
  1862.  
  1863.                The early versions of crunching implemented, stopped 
  1864.                "learning" once the string table was full. This gave a 
  1865.                very poor compression ratio in some files. Versions 8 
  1866.                and 9 have an additional feature called adaptive reset, 
  1867.                where the string table is cleared and crunching begins 
  1868.                all over again ! This capability really helps the larger 
  1869.                files more than smaller files.
  1870.  
  1871.  
  1872.  
  1873.  
  1874.                              Details of Storage Versions
  1875.  
  1876.  
  1877.                NARC supports all of the current "skrunching" 
  1878.                algorithms. A brief description of each follows.
  1879.  
  1880.                                       Version    1
  1881.  
  1882.                 - "STORED" File is simply stored (obsolete now, 25 byte 
  1883.                header)
  1884.  
  1885.                  NOTE: Files stored with this version are rare.
  1886.  
  1887.                                       Version    2
  1888.                
  1889.                - "STORED" Current version of simple storage. This  
  1890.                version was implemented with the implementation of file 
  1891.                compression. The main difference in version 1 and 2 is 
  1892.                the ZIP header  (see header section below), version 1 
  1893.                has a header length 4 bytes smaller than any of the rest 
  1894.                of the storage  methods since in  version 1 there was no 
  1895.                need to  store the  original file length separately from 
  1896.                the stored file length since they were the same.
  1897.  
  1898.                                       Version 3
  1899.  
  1900.                - "PACKED" Repeated bytes are packed into a three byte 
  1901.                string (see Packing above)
  1902.  
  1903.                                       Version    4
  1904.                
  1905.                - "SQUEEZED" after packing. The file is first packed as 
  1906.                described above and then squeezed
  1907.  
  1908.                                       Version    5
  1909.  
  1910.                - "CRUNCHED" This is the first implementation of LZW 
  1911.                released. Uses fixed length codes and a complex hashing 
  1912.                function. (obsolete now) (See hashing below)
  1913.  
  1914.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  1915.           
  1916.                                      Page 27
  1917.  
  1918.  
  1919.                NOTE: Files compressed with this version are hard to 
  1920.                find. Version was released only one month when next 
  1921.                version came out.
  1922.  
  1923.  
  1924.                                       Version    6
  1925.  
  1926.                - "CRUNCHED" after packing. The file is first packed and 
  1927.                then crunched. Uses fixed length codes and the same 
  1928.                hashing function as version 5.
  1929.  
  1930.                                       Version    7
  1931.  
  1932.                - "CRUNCHED" after packing. Same as version 6 except a 
  1933.                faster hashing function is used.
  1934.  
  1935.  
  1936.                                       Version    8
  1937.  
  1938.                - "CRUNCHED" after packing. Uses variable length codes 
  1939.                in the crunched file (9 to 12 bits) and has a faster 
  1940.                hash function (actually not hashing at all, but for the 
  1941.                sake of consistency, we will call it that). This version 
  1942.                also resets the string table when it becomes full which 
  1943.                benefits the compression ratio of larger files. This 
  1944.                resetting is commonly called an adaptive reset.
  1945.  
  1946.  
  1947.                                       Version    9
  1948.  
  1949.                - "SQUASHED" (variation on crunching scheme). This 
  1950.                version uses the same hashing function as version 8 but 
  1951.                varies the crunching codes from 9 to 13 bits. There is 
  1952.                also no packing, which affords the string table the 
  1953.                opportunity to "learn" longer codes and thus improve the 
  1954.                compression ratio (benefits "real large" files).
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  1977.           
  1978.                                      Page 28
  1979.  
  1980.  
  1981.                ARC file header structure is same for both DOS and CP/M
  1982.  
  1983.                 Byte number      Value(s)        Meaning
  1984.                 ══════════════════════════════════════════════════════════════
  1985.                  1       1Ah             Header Flag
  1986.                  2       0-9             Compression Version
  1987.                  3-15    ---             ASCIIZ compressed filename
  1988.                  16-19   ---             Compressed file size in bytes
  1989.                                          Low Word, High Word with each word
  1990.                                          in LoHi format
  1991.                  20-21   bits            DOS date format
  1992.                          15-9            Year
  1993.                           8-5            Month
  1994.                           4-0            Day        (all zeroes means no date)
  1995.                  22-23   bits            DOS time format
  1996.                          15-11           Hours (military)
  1997.                          10-5            Minutes
  1998.                           4-0            Seconds
  1999.                  24-25   ---             CRC-16 in LoHi format of uncompressed
  2000.                                          file. ------- This is important.
  2001.                  26-29   ---             Original uncompressed  file size
  2002.                                  NOTE:   Version 1 files are not compressed
  2003.                                          so the length can be  found with
  2004.                                          bytes 16-19, also the header len
  2005.                                          for version 1 files is 25 bytes.
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  2039.           
  2040.                                      Page 29
  2041.  
  2042.                 Hashing.....
  2043.  
  2044.                Hashing is simply an arithmetic way of coming up with an 
  2045.                address in a table. You have a set of input numbers 
  2046.                (codes) that will map one-to-one with the output codes 
  2047.                in an ideal situation. That is, each time you input a 
  2048.                certain number, you can rest assured that the output 
  2049.                will always return the same output number. This is not 
  2050.                quite the case in the current versions of .ARC files. 
  2051.                The reason is that the algorithm would require a MEG or 
  2052.                so of RAM for implementation. The utilization of a 
  2053.                smaller string table in all of the ARC programs 
  2054.                introduces the possibility of producing the same  output 
  2055.                number for 2 or more input numbers. This is called a 
  2056.                hash collision. This is handled separately in .ARC files 
  2057.                with what is called a "collision table", which helps to 
  2058.                locate the correct table entry.
  2059.  
  2060.  
  2061.                There are three versions of "hashing" used in ARC files.
  2062.  
  2063.            Hash1 - Key = upper 12 bits of lower 18 bits of unsigned square of
  2064.                  (prefix code + suffix byte) OR 800h
  2065.  
  2066.                  Used in stowage versions 5 and 6
  2067.  
  2068.            Hash2 - Key = lower 12 bits of unsigned product of
  2069.                  (prefix code + suffix byte) * 15073
  2070.  
  2071.                  Used in stowage version 7
  2072.  
  2073.            Hash3 - Key = next available address in table.
  2074.  
  2075.                  Used in stowage versions 8 and 9
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.      NARC.DOC   Copyright (c) 1987-90   Infinity Design Concepts, Inc.
  2101.           
  2102.                                      Page 30
  2103.  
  2104.          CRC calculations - ARC files
  2105.  
  2106.                NARC does not use the traditional table lookup method 
  2107.                for calculating the CRC of the file. The table approach 
  2108.                requires the table to be in RAM and takes up more space. 
  2109.                NARC calculates the CRC on the fly, which  requires no 
  2110.                table and saves space. The algorithm is taken from the 
  2111.                definitive article by Aram Perez in IEEE Micro, June 
  2112.                '83. The polynomial is X^16 + X^15 + X^2 + X^1 which is 
  2113.                not compatible with the Xmodem CRC.
  2114.  
  2115.  
  2116.                           - ZIP files
  2117.  
  2118.                The CRC calculated in ZIP files is a 32 bit CRC value, 
  2119.                which offers much greater error detection capabilties. 
  2120.                NARC builds a table and uses a table lookup method of 
  2121.                calculating the CRC values.
  2122.  
  2123.                Note that when NARC displays the CRC-32 used in ZIP 
  2124.                files, only the lower two bytes are displayed, but the 
  2125.                full 32 bits are used in all crc calculations.
  2126.  
  2127.  
  2128.  
  2129.  
  2130.  
  2131.  
  2132.  
  2133.  
  2134.  
  2135.  
  2136.  
  2137.  
  2138.  
  2139.  
  2140.  
  2141.  
  2142.  
  2143.  
  2144.  
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.  
  2154.  
  2155.  
  2156.  
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  End of NARC.DOC   Copyright (c) 1987-90    Infinity Design Concepts, Inc.
  2163.           
  2164.                                      Page 31
  2165.