mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-24 08:54:17 +00:00
Upload
Digital Research
This commit is contained in:
27
CPM OPERATING SYSTEMS/CPM 68K/1.0X SOURCES/v102a/clib/puts.c
Normal file
27
CPM OPERATING SYSTEMS/CPM 68K/1.0X SOURCES/v102a/clib/puts.c
Normal file
@@ -0,0 +1,27 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* p u t s F u n c t i o n
|
||||
* -------------------------
|
||||
* Copyright 1982 by Digital Research Inc. All rights reserved.
|
||||
*
|
||||
* "puts" copies a null terminated string to the standard output.
|
||||
* It copies a newline char after the end of the string.
|
||||
*
|
||||
* Calling sequence:
|
||||
* ret = puts(s)
|
||||
* Where:
|
||||
* s = string to put
|
||||
* ret = last char output
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include "stdio.h"
|
||||
|
||||
WORD puts(str) /* CLEAR FUNCTION ***********/
|
||||
REG BYTE *str; /* null term string */
|
||||
{ /****************************/
|
||||
while(*str) /* for all chars in s */
|
||||
if(putc(*str++,stdout) == FAILURE) /* if putc fouls up */
|
||||
return(FAILURE); /* give up */
|
||||
return( putc('\n',stdout) ); /* append newline & return */
|
||||
} /****************************/
|
||||
Reference in New Issue
Block a user