source: buchla-68k/libcio/fputs.c@ 0580615

Last change on this file since 0580615 was 0580615, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Point of no return.

  • Property mode set to 100644
File size: 640 bytes
Line 
1/*
2 =============================================================================
3 fputs.c -- output a string to a stream
4 Version 3 -- 1987-07-09 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "stdio.h"
9#include "stddefs.h"
10
11int puts(char *str)
12{
13 while (*str)
14 if (putchar(*str++) EQ EOF)
15 return(EOF);
16
17 return(putchar('\n'));
18}
19
20int aputc(int c, FILE *ptr)
21{
22 c &= 127;
23
24 if (c EQ '\n')
25 if (putc('\r', ptr) EQ EOF)
26 return(EOF);
27
28 return(putc(c, ptr));
29}
30
31int fputs(char *s, FILE *fp)
32{
33 while ( *s )
34 if (aputc(*s++, fp) EQ EOF)
35 return(EOF);
36 return(0);
37}
Note: See TracBrowser for help on using the repository browser.