summaryrefslogtreecommitdiff
path: root/src/stdio/setbuf.c
blob: 1efa8ea121ae59e3244812ed8363e7a39ec0861b (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
#include <stdio.h>

/** specify file stream buffer **/

void setbuf(FILE * restrict stream, char * restrict buf)
{
	if (buf) {
		setvbuf(stream, buf, _IOFBF, BUFSIZ);
	} else {
		setvbuf(stream, NULL, _IONBF, 0);
	}
}

/***
sets the buffer for ARGUMENT(stream) to ARGUMENT(buf). The buffer must hold
at least CONSTANT(BUFSIZ) characters. It is the equivalent of:
	LITERAL(setvbuf(stream, buf, _IOFBF, BUFSIZ);)

If ARGUMENT(buf) is CONSTANT(NULL), ARGUMENT(stream) will become unbuffered. It is the
equivalent of:
	LITERAL(setvbuf(stream, NULL, _IONBF, 0);)
***/

/*
STDC(1)
*/