/* ARC - Archive utility - ARCLST (C) COPYRIGHT 1985 by System Enhancement Associates; ALL RIGHTS RESERVED By: Thom Henderson Description: This file contains the routines used to list the contents of an archive. Language: Computer Innovations Optimizing C86 */ #include #include "arc.h" lstarc(num,arg) /* list files in archive */ int num; /* number of arguments */ char *arg[]; /* pointers to arguments */ { struct heads hdr; /* header data */ int list; /* true to list a file */ int did[MAXARG]; /* true when argument was used */ long tnum, tlen, tsize; /* totals */ int n; /* index */ tnum = tlen = tsize = 0; /* reset totals */ for(n=0; ndate >> 9) & 0x7f; /* dissect the date */ mo = (hdr->date >> 5) & 0x0f; dy = hdr->date & 0x1f; hh = (hdr->time >> 11) & 0x1f; /* dissect the time */ mm = (hdr->time >> 5) & 0x3f; ss = (hdr->time & 0x1f) * 2; printf("%-12s %8ld ",hdr->name,hdr->length); if(bose) { switch(hdrver) { case 1: case 2: printf(" -- "); break; case 3: printf(" Packed "); break; case 4: printf("Squeezed"); break; case 5: case 6: case 7: printf("crunched"); break; case 8: printf("Crunched"); break; default: printf("Unknown!"); } printf(" %3d%%",100L - (100L*hdr->size)/hdr->length); printf(" %8ld ",hdr->size); } printf("%2d %3s %02d", dy, mon[mo-1], (yr+80)%100); if(bose) printf(" %2d:%02d%c %04x", (hh>12?hh-12:hh), mm, (hh>12?'p':'a'), hdr->crc); printf("\n"); }