aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/fossil/Clog.c
blob: 95755345399d0a306465493e8f33bc84f9fbff1d (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
#include "stdinc.h"
#include "9.h"

/*
 * To do: This will become something else ('vprint'?).
 */
int
consVPrint(char* fmt, va_list args)
{
	int len, ret;
	char buf[256];

	len = vsnprint(buf, sizeof(buf), fmt, args);
	ret = consWrite(buf, len);

	while (len-- > 0 && buf[len] == '\n')
		buf[len] = '\0';
	/*
	 * if we do this, checking the root fossil (if /sys/log/fossil is there)
	 * will spew all over the console.
	 */
	if (0)
		syslog(0, "fossil", "%s", buf);
	return ret;
}

/*
 * To do: This will become 'print'.
 */
int
consPrint(char* fmt, ...)
{
	int ret;
	va_list args;

	va_start(args, fmt);
	ret = consVPrint(fmt, args);
	va_end(args);
	return ret;
}