summaryrefslogtreecommitdiff
path: root/sys/src/cmd/fossil/Clog.c
diff options
context:
space:
mode:
authorTaru Karttunen <taruti@taruti.net>2011-03-30 15:46:40 +0300
committerTaru Karttunen <taruti@taruti.net>2011-03-30 15:46:40 +0300
commite5888a1ffdae813d7575f5fb02275c6bb07e5199 (patch)
treed8d51eac403f07814b9e936eed0c9a79195e2450 /sys/src/cmd/fossil/Clog.c
Import sources from 2011-03-30 iso image
Diffstat (limited to 'sys/src/cmd/fossil/Clog.c')
-rwxr-xr-xsys/src/cmd/fossil/Clog.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/sys/src/cmd/fossil/Clog.c b/sys/src/cmd/fossil/Clog.c
new file mode 100755
index 000000000..957553453
--- /dev/null
+++ b/sys/src/cmd/fossil/Clog.c
@@ -0,0 +1,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;
+}