;
                                     CL.COM                                   

             Size (recs) CRC   Version    Author/Latest Issue      Disk
               4k (31)   FA0E  1.0        Bruce Morgen 5/91        Z3COM3

  1- Syntax/Options  2- Usage  3- Notes  4- Examples of Use                   

   CL has one purpose:  to Compact a Library.   CL compresses  a library over-
writing deleted entries and other unused  sectors of the  LBR file with active 
members.   It then de-allocates the remaining blocks and/or extents of the LBR 
file.   

   [Note:  CL may not be compatible with all systems,  so caution is  advised.
CL does not create a new library.  It overwrites the existing library.   Also,
CL cannot currently Krunch a file (ala NULU) to  make a larger directory.   An
enhanced LPUT might well be better  equipped to do  this  than CL,  since LPUT
already has the code to build a new LBR and to add members.]
:1
    Syntax   CL [DU:]filename[.LBR]                    compact filename
             CL [DU:]filename[.LBR] ?                  report free space
             CL [DU:]filename[.LBR] Z                  force compact
             CL [DU:]filename[.LBR] -afn1[,afn2,...]   delete members

   "filename" is assumed to have the extension LBR
:2
 Usage 

   CL compresses an LBR,  overwriting deleted entries and other unused sectors
of the LBR file with active  members.   It  then  de-allocates  the  remaining
blocks and/or extents of the LBR file.  CL will 1) compact an LBR in place, 2)
report the amount of free space remaining in an LBR, 3) force a compaction, or
4) delete members from an LBR.   Compacting is not done if  none is  required,
even if the "Z" option is selected.   Directory sorting is done any time there
is a compacting operation,  whether forced via the "Z" option or decided on by
CL itself.   Only the sort is  done if  there's no need for compacting and the
"Z" option is selected.
:3
 CL Notes - 1/3 

   a. Vs 1.0 updates (Release version, 5/7/91, Bruce Morgen):
      - Eliminated warm boot when an RSX is detected.
      - Fixed a stack imbalance bug when zero-length member files are present.
      - Saved a few bytes through more double register SBC!ADD sequences.
      - Shortened DosDisk test.

   b. Vs 0.09 updates (4/19/91, Bruce Morgen):
      - Added "-afn,afn,afn" delete  member  function.   File is  compacted in
        this mode to avoid  weird  "ghost" spaces  unless the  deleted members
        were all zero-length.

   c. Vs 0.08 updates (4/18/91, Bruce Morgen):
      - If there is no "waste" and the "Z" option is selected, no compact is
        done, but the LBR's directory is sorted and rewritten.  
      - LBR's active, deleted, and open member statistics are displayed.
      - Deleted FRESET inclusion in favor of linked module and external.

   d. Vs 0.06 updates (10/23/90, Bruce Morgen):
      - LBR directory now sorted.  Suggested by Bob Dean.
 CL Notes - 2/3 

   e. Vs 0.05 updates (10/20/90, Bruce Morgen):
      - Z80 and CP/M 2.2 tests performed earlier.
      - Stack-hungry EPRINT not called until local stack established.

   f. Vs 0.04 updates (10/19.90, Bruce Morgen):
      - Fixed nasty problem caused by Michal's  assumption that  DS directives
        zero-fill.  When CL's buffers were put in DSEG, CL would unpredictably 
        hang the system.   Used brute force  solution of  zero-filling  entire
        buffer space immediately (also makes CL re-executable via GO).
      - Somehow stayed within 25 records through dogged code-cutting.

   g. Vs 0.03 updates (10/17/90, Bruce Morgen):
      - Size reduced by four records, (through use of DSEG and proper linker).
      - Michal's assumption about  ZPRSFN working in  a non-Z3  environment is 
        simply not true.   CL would have to include  an  internal  environment 
        descriptor for ZPRSFN (and GETCCP or GETZRUN, for that matter) to work 
        predictably.   Since CL does not need to  parse the command line under
        Z-System, SYSLIB's FNAME is used to simulate ZPRSFN.  
      - Uses SYSLIB's table-driven CRC routines (modest increase in speed).
      - Now displays the DU: of the LBR being analyzed and/or processed.
 CL Notes - 3/3 

   h. Vs 0.02 updates (4/9/89, Michal Carson):
      - minor change  concerning  the  location  of  the  first  token  by the 
        parsing routine (zprsfn).  
      - code had been commented  out  which  loaded  the address of the sector 
        translation table into DE before the call to the BIOS.  
      - the low bit of E before the call to  SETDSK was being reset instead of 
        set.  Resetting tells the  BIOS  that the disk has  not  been accessed 
        previously, while setting indicates that the disk has been used.
      - @fncmp (inserted from syslib for the last  revision) was being misused 
        and consequently the program failed to find some directory entries for 
        the library.  
      - Converted fully to syslib  for  all  the  routines  which may be found 
        there.

   i. Vs 0.01 updates (3/17/89, Michal Carson):
      - most changes aim  to  ensure  predictable  performance  under  varying
        systems. 
      - now insists on  a Z80 and  a BDOS which returns 2. 2 as version number
        (CP/M+ and Z3PLUS are not yet supported).
:4
 Examples of Usage - 1/3 

   1) NULU is used to delete one of 3 member files from SCATV208.LBR.   CL
      is run to show that 25 records of free space (4k) exist, represented 
      by the deleted member.

B0:WORK>cl d3:scatv208 ?

CL (Compact Library), Version 1.0
25 records of free space in D3:SCATV208.LBR      24K         not compacted
Contents: 2 active members, 1 deleted member, 4 open member slots.

   2) CL is run again to compact the library and reclaim the 4k.  The 
      far right column (20k) indicates the resulting size of the LBR.

B0:WORK>cl d3:scatv208 

CL (Compact Library), Version 1.0
25 records of free space in D3:SCATV208.LBR      24K         20K
Contents: 2 active members, no deleted members, 5 open member slots.
 Examples of Use - 2/3 

   3) CL is run again and shows that no free space remains to be claimed.

B0:WORK>cl d3:scatv208 ?

CL (Compact Library), Version 1.0
0 records of free space in D3:SCATV208.LBR      20K         not compacted
Contents: 2 active members, no deleted members, 5 open member slots.

   4) The deleted member file is replaced using LPUT, and CL is used 
      this time to delete it.

B0:WORK>cl d3:scatv208 -zsusv208.czt

CL (Compact Library), Version 1.0
ZSUSV208.CZT deleted.
25 records of free space in D3:SCATV208.LBR      24K         20K
Contents: 2 active members, no deleted members, 5 open member slots.
 Examples of Use - 3/3 

   5) CL is then run with the "Z" option to force a compaction.  Since
      a compaction is not required, the directory is simply sorted and
      checked.

B0:WORK>cl d3:scatv208 z

CL (Compact Library), Version 1.0
0 records of free space in D3:SCATV208.LBR      20K         sorted & checked
Contents: 2 active members, no deleted members, 5 open member slots.
