155714Skris/*- 255714Skris * Copyright (c) 1991, 1993 355714Skris * The Regents of the University of California. All rights reserved. 455714Skris * 555714Skris * Redistribution and use in source and binary forms, with or without 655714Skris * modification, are permitted provided that the following conditions 755714Skris * are met: 8296341Sdelphij * 1. Redistributions of source code must retain the above copyright 955714Skris * notice, this list of conditions and the following disclaimer. 1055714Skris * 2. Redistributions in binary form must reproduce the above copyright 1155714Skris * notice, this list of conditions and the following disclaimer in the 1255714Skris * documentation and/or other materials provided with the distribution. 1355714Skris * 4. Neither the name of the University nor the names of its contributors 1455714Skris * may be used to endorse or promote products derived from this software 15296341Sdelphij * without specific prior written permission. 1655714Skris * 1755714Skris * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1855714Skris * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1955714Skris * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2055714Skris * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2155714Skris * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22296341Sdelphij * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2355714Skris * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2455714Skris * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2555714Skris * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2655714Skris * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2755714Skris * SUCH DAMAGE. 2855714Skris */ 2955714Skris 3055714Skris#ifndef lint 3155714Skris#if 0 3255714Skrisstatic char sccsid[] = "@(#)print.c 8.1 (Berkeley) 6/6/93"; 3355714Skris#endif 3455714Skris#endif /* not lint */ 3555714Skris 3655714Skris#include <sys/cdefs.h> 37296341Sdelphij__FBSDID("$FreeBSD$"); 3855714Skris 3955714Skris#include <sys/types.h> 40296341Sdelphij 4155714Skris#include <stdio.h> 4255714Skris#include <stdint.h> 4355714Skris 4455714Skris#include "extern.h" 4555714Skris 4655714Skrisvoid 4755714Skrispcrc(char *fn, uint32_t val, off_t len) 4855714Skris{ 4955714Skris (void)printf("%lu %jd", (u_long)val, (intmax_t)len); 5055714Skris if (fn != NULL) 5155714Skris (void)printf(" %s", fn); 52296341Sdelphij (void)printf("\n"); 5355714Skris} 5455714Skris 5555714Skrisvoid 5655714Skrispsum1(char *fn, uint32_t val, off_t len) 5755714Skris{ 5855714Skris (void)printf("%lu %jd", (u_long)val, (intmax_t)(len + 1023) / 1024); 5955714Skris if (fn != NULL) 6055714Skris (void)printf(" %s", fn); 6155714Skris (void)printf("\n"); 6255714Skris} 6355714Skris 6455714Skrisvoid 6555714Skrispsum2(char *fn, uint32_t val, off_t len) 66111147Snectar{ 67296341Sdelphij (void)printf("%lu %jd", (u_long)val, (intmax_t)(len + 511) / 512); 68111147Snectar if (fn != NULL) 69160814Ssimon (void)printf(" %s", fn); 70296341Sdelphij (void)printf("\n"); 71160814Ssimon} 7255714Skris