home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / C / DLIBSSRC.ZIP / FWRITE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1987-10-05  |  516 b   |  22 lines

  1. #include <osbind.h>
  2. #include <stdio.h>
  3.  
  4. int fwrite(data, size, count, fp)
  5. register char *data;
  6. int size;
  7. int count;
  8. register FILE *fp;
  9. /*
  10.  *    Write <count> items of <size> characters each to stream <fp>.
  11.  *    Data is read from the buffer pointed to by <data>.  The number of
  12.  *    full items actually written is returned, or a negative error code.
  13.  */
  14. {
  15.     register long n, lsiz;
  16.  
  17.     lsiz = ((long) size);
  18.     n = ((long) count) * lsiz;
  19.     n = Fwrite(fileno(fp), n, data);
  20.     return((n > 0) ? (n / lsiz) : n);
  21. }
  22.