Google
 

Trailing-Edge - PDP-10 Archives - SRI_NIC_PERM_FS_1_19910112 - kcc-6/lib/stdio/fwrite.c
There are 7 other files named fwrite.c in the archive. Click here to see a list.
/*
 *	FWRITE - binary write
 *
 *	Copyright (C) 1986 by Ian Macky, SRI International
 */

#include <stdio.h>

#if __STDC__
#define VCHAR void
#define CONST const
#else
#define VCHAR char
#define CONST
#endif

size_t fwrite(ptr, size_of_ptr, count, f)
CONST VCHAR *ptr;
size_t size_of_ptr, count;
FILE *f;
{
    register CONST char *cp = ptr;	/* Cannot manipulate (void *) */
    int number_of_bytes;

    if (!_writeable(f) || size_of_ptr < 1 || count < 1)
	return 0;
    else {
	number_of_bytes = count * size_of_ptr;
	while (number_of_bytes--)
	    putc(*cp++, f);
	return count;
    }
}