Initial commit

This commit is contained in:
Bahadir Balban
2008-01-13 13:53:52 +00:00
commit e2b791a3d8
789 changed files with 95825 additions and 0 deletions

19
libs/c/src/fputc.c Normal file
View File

@@ -0,0 +1,19 @@
#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;
}
}