blob: 87523b433befcbff36a907913f96b852fc9d3732 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#include <stdio.h>
#include <string.h>
#include "_stdio.h"
/** write a string to a file stream **/
int fputs(const char * restrict s, FILE * restrict stream)
{
SIGNAL_SAFE(0);
ASSERT_STREAM(stream, ORIENT_BYTE, OP_OUTPUT);
ASSERT_NOOVERLAP(s, strlen(s), stream, sizeof(*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)
*/
|