diff options
Diffstat (limited to 'src/stdio/puts.c')
-rw-r--r-- | src/stdio/puts.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/stdio/puts.c b/src/stdio/puts.c new file mode 100644 index 00000000..7aeb8d83 --- /dev/null +++ b/src/stdio/puts.c @@ -0,0 +1,27 @@ +#include <stdio.h> + +/** write a string to stoud **/ +int puts(const char *s) +{ + if (fputs(s, stdout) == EOF) { + return EOF; + } + + if (putc('\n', stdout) == EOF) { + return EOF; + } + + /* + RETURN_SUCCESS(NONNEGATIVE()); + RETURN_FAILURE(CONSTANT(EOF)); + */ + return 1; +} + +/*** +function writes the string pointed to by ARGUMENT(s) to IDENTIFIER(stdout), +followed by a newline. The terminated CHAR(\0) is not written. +***/ +/* +STDC(1) +*/ |