Last change
on this file since a838f5b was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 8 years ago |
Imported original source code.
|
-
Property mode
set to
100755
|
File size:
739 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 |
|
---|
11 | int
|
---|
12 | puts(str)
|
---|
13 | register char *str;
|
---|
14 | {
|
---|
15 | while (*str)
|
---|
16 | if (putchar(*str++) EQ EOF)
|
---|
17 | return(EOF);
|
---|
18 |
|
---|
19 | return(putchar('\n'));
|
---|
20 | }
|
---|
21 |
|
---|
22 | int
|
---|
23 | aputc(c,ptr)
|
---|
24 | register int c;
|
---|
25 | register 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 |
|
---|
36 | int
|
---|
37 | fputs(s,fp)
|
---|
38 | register char *s;
|
---|
39 | FILE *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.