home *** CD-ROM | disk | FTP | other *** search
- /* LCRCK - version 1.2
- Checks the "crc" of a library member.
- The crc value computed by this program is compatible with the
- one generated by CRCK44.
- USE: LCRCK <library> <member>
- COMPILE/LINK: cc1 lcrck
- nl2 lcrck libacc crc
- By S. Kluger 01-10-83
- Modified 03-20-83 by Gary Novosielski
- Changed do{}while to while{}
- to properly handle null members.
- Removed improper call to erxit.
- */
-
- #include <bdscio.h>
-
- char curdsk, crc, fcb[36];
- char fnam[12], libnam[16], dirbuf[128], *dirp;
- int fd, j, seccnt, lpc, dirsiz, filsiz;
-
- main(argc,argv)
- int argc;
- char **argv;
- {
- if (argc != 3)
- {
- printf("\nLCRCK crck check program for LBR file members.\n");
- printf("Compatible with CRCK44.\n");
- printf("USAGE: LCRCK <lbrname> <member>\n");
- printf("Where: <lbrname> = name of .LBR file and\n");
- printf(" <member> = full name of member file.\n");
- printf("(Find <member> with LDIR.\n\n");
- exit();
- }
- printf("\nLCRCK vers 1.2 03-20-83\n\n");
- opnlib(argv[1]);
- if (fndmem(argv[2]) == ERROR)
- {
- printf("\n%s not in LBR file!\n",argv[2]);
- exit();
- }
- printf("\nMember %s\t\t- ",argv[2]);
- doit();
- }
-
- doit()
-
- {
- unsigned sum;
-
- sum = 0;
- dirsiz = filsiz;
- while(dirsiz)
- {
- reload();
- j = 127;
- for (j=0; j<128; j++)
- {
- sum = updcrc(dirbuf[j],sum);
- dirp++;
- }
- }
- printf("CRC = %04x\n",sum);
- }