Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!CORNELLC.CCS.CORNELL.EDU.BITNET!ewilts%Ins.MRC.AdhocNet.CA%Stasis.MRC.AdhocNet.CA%UNCAEDU.
From: ewilts%Ins.MRC.AdhocNet.CA%Stasis.MRC.AdhocNet.CA%UNCAEDU.@CORNELLC.CCS.CORNELL.EDU.BITNET (Ed Wilts)
Newsgroups: comp.os.vms
Subject: ARC_C.SHAR06_OF_19
Message-ID: <880624092430.026@Ins.MRC.AdhocNet.CA>
Date: 24 Jun 88 15:24:28 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Organization: The Internet
Lines: 211

$Part06:
$ File_is="ARCLST.C"
$ Check_Sum_is=2032959550
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
Xstatic char *RCSid = "$Header: arclst.c,v 1.2 86/07/15 07:53:15 turner Exp $";
X
X/*
X * $Log:`009arclst.c,v $
X * Hack-attack 1.3  86/12/20  01:23:45  wilhite@usceast.uucp
X * `009Bludgeoned into submission for VAX 11/780 BSD4.2
X *`009(ugly code, but fewer core dumps)
X *
X * Revision 1.2  86/07/15  07:53:15  turner
X *
X *
X * Revision 1.1  86/06/26  15:00:23  turner
X * initial version
X *
X *
X */
X
X/*  ARC - Archive utility - ARCLST
X
X$define(tag,$$segment(@1,$$index(@1,=)+1))#
X$define(version,Version $tag(
XTED_VERSION DB =2.34), created on $tag(
XTED_DATE DB =02/03/86) at $tag(
XTED_TIME DB =22:56:57))#
X$undefine(tag)#
X    $version
X
X(C) COPYRIGHT 1985 by System Enhancement Associates; ALL RIGHTS RESERVED
X
X    By:  Thom Henderson
X
X    Description:
X         This file contains the routines used to list the contents
X         of an archive.
X
X    Language:
X         Computer Innovations Optimizing C86
X*/
X#include 
X#include "arc.h"
X
XINT lstarc(num,arg)                        /* list files in archive */
XINT num;                               /* number of arguments */
Xchar *arg[];                           /* pointers to arguments */
X{
X    struct heads hdr;                  /* header data */
X INT list;                          /* true to list a file */
X INT did[MAXARG];                  /* true when argument was used */
X    long tnum, tlen, tsize;            /* totals */
X INT n;                             /* index */
X    INT lstfile();
X
X    tnum = tlen = tsize = 0;           /* reset totals */
X
X    for(n=0; ndate >> 9) & 0x7f;      /* dissect the date */
X    mo = (hdr->date >> 5) & 0x0f;
X    dy = hdr->date & 0x1f;
X
X    hh = (hdr->time >> 11) & 0x1f;     /* dissect the time */
X    mm = (hdr->time >> 5) & 0x3f;
X    ss = (hdr->time & 0x1f) * 2;
X
X    printf("%-12s  %8ld  ",hdr->name,hdr->length);
X
X    if(bose)
X    {    switch(hdrver)
X         {
X         case 1:
X         case 2:
X              printf("   --   ");
X              break;
X         case 3:
X              printf(" Packed ");
X              break;
X         case 4:
X              printf("Squeezed");
X              break;
X         case 5:
X         case 6:
X         case 7:
X              printf("crunched");
X              break;
X         case 8:
X              printf("Crunched");
X              break;
X`009 case 9:
X`009      printf("Squashed");
X`009      break;
X         default:
X              printf("Unknown!");
X         }
X
X         printf("  %3d%%",100L - (100L*hdr->size)/hdr->length);
X         printf("  %8ld  ",hdr->size);
X    }
X
X    printf("%2d %3s %02d", dy, mon[mo-1], (yr+80)%100);
X
X    if(bose)
X         printf("  %2d:%02d%c  %04x",
X              (hh>12?hh-12:hh), mm, (hh>12?'p':'a'),
X              (unsigned INT)hdr->crc);
X
X    printf("\n");
X}
X
$ GoSub Convert_File
$ Goto Part08