mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-25 17:34:06 +00:00
Upload
Digital Research
This commit is contained in:
35
CPM OPERATING SYSTEMS/CPM 68K/1.2 SOURCE/6/FPUTS.C
Normal file
35
CPM OPERATING SYSTEMS/CPM 68K/1.2 SOURCE/6/FPUTS.C
Normal file
@@ -0,0 +1,35 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* f p u t s F u n c t i o n
|
||||
* ---------------------------
|
||||
* Copyright 1982 by Digital Research Inc. All rights reserved.
|
||||
*
|
||||
* "fputs" copies a null terminated string to a stream file.
|
||||
* To be compatible with Unix, it does NOT append a newline.
|
||||
*
|
||||
* Calling sequence:
|
||||
* ret = fputs(s,stream)
|
||||
* Where:
|
||||
* ret = last char out, on error FAILURE
|
||||
* s = string to put
|
||||
* stream -> stream (FILE *)
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include "stdio.h"
|
||||
|
||||
WORD fputs(str,sp) /* CLEAR FUNCTION ***********/
|
||||
REG BYTE *str; /* null term string */
|
||||
REG FILE *sp; /* stream file pointer */
|
||||
{ /****************************/
|
||||
REG WORD rv; /* return val */
|
||||
rv = NULL; /* init for *s==NULL */
|
||||
while(*str) /* for all chars in s */
|
||||
if((rv=putc(*str++,sp))==FAILURE) /* if putc fouls up */
|
||||
return(FAILURE); /* give up */
|
||||
return(rv); /* it worked */
|
||||
} /****************************/
|
||||
return(rv); /* it worked */
|
||||
} /****************************/
|
||||
return(rv); /* it worked */
|
||||
} /****************************/
|
||||
Reference in New Issue
Block a user