Digital Research
This commit is contained in:
2020-11-06 18:50:37 +01:00
parent 621ed8ccaf
commit 31738079c4
8481 changed files with 1888323 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
/**************************************************************************
*
* f w r i t e F u n c t i o n
* -----------------------------
* Copyright 1982 by Digital Research Inc. All rights reserved.
*
* "fwrite" writes NI items of size SZ from memory at BUFF into stream
* SP.
*
* Calling sequence:
* nitems = fwrite(buff,size,nitems,stream)
* Where:
* buff -> where to write from
* size = number bytes in each item
* nitems = number bytes written/to write
* stream -> file
*
* nitems is set to 0 if an error occurs (including EOF).
*
*****************************************************************************/
#include <stdio.h>
WORD fwrite(buff,sz,ni,sp)
REG BYTE *buff;
WORD sz,
ni;
REG FILE *sp;
{
REG WORD jj, kk;
for( jj=0; jj<ni; jj++ )
for( kk=0; kk<sz; kk++ )
if( fputc(*buff++,sp) == FAILURE ) /* used for side effects */
return(ZERO);
return(ni);
}