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

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

Use standard integer types.

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