diff options
Diffstat (limited to 'src/stdio/fputs.c')
| -rw-r--r-- | src/stdio/fputs.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/stdio/fputs.c b/src/stdio/fputs.c new file mode 100644 index 00000000..b33d3b59 --- /dev/null +++ b/src/stdio/fputs.c @@ -0,0 +1,28 @@ +#include <stdio.h> +#include "nonstd/io.h" + +/** write a string to a file stream **/ +int fputs(const char * restrict s, FILE * restrict stream) +{ + flockfile(stream); + while (*s) { + if (fputc(*s++, stream) == EOF) { + return EOF; + } + } + funlockfile(stream); + + /* + RETURN_SUCCESS(NONNEGATIVE()); + RETURN_FAILURE(CONSTANT(EOF)); + */ + return 1; +} + +/*** +writes the string ARGUMENT(s) to ARGUMENT(stream), not including +the terminating CHAR(\0) character. +***/ +/* +STDC(1) +*/ |
