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

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

Unix line breaks.

  • Property mode set to 100644
File size: 694 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
12puts(str)
13register char *str;
14{
15 while (*str)
16 if (putchar(*str++) EQ EOF)
17 return(EOF);
18
19 return(putchar('\n'));
20}
21
22int
23aputc(c,ptr)
24register int c;
25register FILE *ptr;
26{
27 c &= 127;
28
29 if (c EQ '\n')
30 if (putc('\r', ptr) EQ EOF)
31 return(EOF);
32
33 return(putc(c, ptr));
34}
35
36int
37fputs(s,fp)
38register char *s;
39FILE *fp;
40{
41 while ( *s )
42 if (aputc(*s++, fp) EQ EOF)
43 return(EOF);
44 return(0);
45}
Note: See TracBrowser for help on using the repository browser.