Last change
on this file since 57425b6 was b28a12e, checked in by Thomas Lopatic <thomas@…>, 7 years ago |
Zero redundant declarations.
|
-
Property mode
set to
100644
|
File size:
638 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 "ram.h"
|
---|
9 |
|
---|
10 | int16_t puts(int8_t *str)
|
---|
11 | {
|
---|
12 | while (*str)
|
---|
13 | if (putchar(*str++) EQ EOF)
|
---|
14 | return(EOF);
|
---|
15 |
|
---|
16 | return(putchar('\n'));
|
---|
17 | }
|
---|
18 |
|
---|
19 | int16_t aputc(int16_t c, FILE *ptr)
|
---|
20 | {
|
---|
21 | c &= 127;
|
---|
22 |
|
---|
23 | if (c EQ '\n')
|
---|
24 | if (putc('\r', ptr) EQ EOF)
|
---|
25 | return(EOF);
|
---|
26 |
|
---|
27 | return(putc(c, ptr));
|
---|
28 | }
|
---|
29 |
|
---|
30 | int16_t fputs(int8_t *s, FILE *fp)
|
---|
31 | {
|
---|
32 | while ( *s )
|
---|
33 | if (aputc(*s++, fp) EQ EOF)
|
---|
34 | return(EOF);
|
---|
35 | return(0);
|
---|
36 | }
|
---|
37 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.