home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <time.h>
- #include <stdlib.h>
- #include <string.h>
- #include <libp.h>
-
- int fwrite(char *buf, size_t size, size_t count, FILE *stream)
- {
- int len = size * count,i;
- if (stream->token != FILTOK)
- return 0;
- if (!(stream->flags & _F_WRIT)) {
- stream->flags |= _F_ERR;
- return 0;
- }
- for (i=0; i < len; i++)
- if (_baseputc(*(unsigned char *)buf++,stream) == EOF)
- return i / size;
- return count;
- }