source: buchla-68k/orig/IOLIB/FPUTS.C@ 06ccda2

Last change on this file since 06ccda2 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 8 years ago

Imported original source code.

  • Property mode set to 100755
File size: 739 bytes
RevLine 
[3ae31e9]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.