Chris Lattner | c1e20ac | 2002-03-08 23:20:52 +0000 | [diff] [blame] | 1 | //===-- io.c - IO routines for LLVM libc Library ------------------*- C -*-===// |
| 2 | // |
| 3 | // A lot of this code is ripped gratuitously from glibc and libiberty. |
| 4 | // |
| 5 | //===----------------------------------------------------------------------===// |
| 6 | |
| 7 | int putchar(int); |
| 8 | |
| 9 | // The puts() function writes the string pointed to by s, followed by a |
| 10 | // NEWLINE character, to the standard output stream stdout. On success the |
| 11 | // number of characters written is returned; otherwise they return EOF. |
| 12 | // |
| 13 | int puts(const char *S) { |
| 14 | const char *Str = S; |
| 15 | while (*Str) putchar(*Str++); |
| 16 | putchar('\n'); |
| 17 | return Str+1-S; |
| 18 | } |