OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [loader/] [libs/] [c/] [src/] [fputc.c] - Rev 2

Compare with Previous | Blame | View Log

#include <stdio.h>
 
int
fputc(int c, FILE *stream)
{
	unsigned char ch = (unsigned char) c;
	/* This is where we should do output buffering */
 
	lock_stream(stream);
	if (stream->write_fn(&ch, stream->current_pos, 1, stream->handle) == 1) {
		/* Success */
		stream->current_pos++;
		unlock_stream(stream);
		return c;
	} else {
		unlock_stream(stream);
		return EOF;
	}
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.