summaryrefslogtreecommitdiff
path: root/src/stdio/puts.c
blob: 1e73158c248f67ddd74608a94a50009d210e9d6d (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
36
37
38
39
40
41
42
43
44
45
46
#if 0

#include <stdio.h>
#include "_stdio.h"

/** write a string to stoud **/

int puts(const char *s)
{
	int ret = 1;

	flockfile(stdout);

	while (*s) {
		if (putc_unlocked(*s, stdout) == EOF) {
			ret = EOF;
			break;
		}
		s++;
	}

	if (putc_unlocked('\n', stdout) == EOF) {
		ret = EOF;
	}

	funlockfile(stdout);

	/*
	RETURN_SUCCESS(NONNEGATIVE());
	RETURN_FAILURE(CONSTANT(EOF));
	*/

	return ret;
}

/***
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)
*/


#endif