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

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

Use standard integer types.

  • Property mode set to 100644
File size: 660 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
11int16_t puts(int8_t *str)
12{
13 while (*str)
14 if (putchar(*str++) EQ EOF)
15 return(EOF);
16
17 return(putchar('\n'));
18}
19
20int16_t aputc(int16_t 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
31int16_t fputs(int8_t *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.