xref: /csrg-svn/usr.bin/cksum/print.c (revision 51820)
147799Sbostic /*-
247799Sbostic  * Copyright (c) 1991 The Regents of the University of California.
347799Sbostic  * All rights reserved.
447799Sbostic  *
547799Sbostic  * %sccs.include.redist.c%
647799Sbostic  */
747799Sbostic 
847799Sbostic #ifndef lint
9*51820Sbostic static char sccsid[] = "@(#)print.c	5.2 (Berkeley) 11/27/91";
1047799Sbostic #endif /* not lint */
1147799Sbostic 
1247799Sbostic #include <sys/types.h>
1347799Sbostic #include <stdio.h>
1447799Sbostic #include "extern.h"
1547799Sbostic 
1647799Sbostic void
1747799Sbostic pcrc(fn, val, len)
1847799Sbostic 	char *fn;
1947799Sbostic 	u_long val, len;
2047799Sbostic {
21*51820Sbostic 	(void)printf("%lu %lu", val, len);
22*51820Sbostic 	if (fn)
23*51820Sbostic 		(void)printf(" %s", fn);
24*51820Sbostic 	(void)printf("\n");
2547799Sbostic }
2647799Sbostic 
2747799Sbostic void
2847799Sbostic psum1(fn, val, len)
2947799Sbostic 	char *fn;
3047799Sbostic 	u_long val, len;
3147799Sbostic {
32*51820Sbostic 	(void)printf("%lu %lu", val, (len + 1023) / 1024);
33*51820Sbostic 	if (fn)
34*51820Sbostic 		(void)printf(" %s", fn);
35*51820Sbostic 	(void)printf("\n");
3647799Sbostic }
3747799Sbostic 
3847799Sbostic void
3947799Sbostic psum2(fn, val, len)
4047799Sbostic 	char *fn;
4147799Sbostic 	u_long val, len;
4247799Sbostic {
43*51820Sbostic 	(void)printf("%lu %lu", val, (len + 511) / 512);
44*51820Sbostic 	if (fn)
45*51820Sbostic 		(void)printf(" %s", fn);
46*51820Sbostic 	(void)printf("\n");
4747799Sbostic }
48