plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

Clog.c (665B)


      1 #include "stdinc.h"
      2 #include "9.h"
      3 
      4 /*
      5  * To do: This will become something else ('vprint'?).
      6  */
      7 int
      8 consVPrint(char* fmt, va_list args)
      9 {
     10 	int len, ret;
     11 	char buf[256];
     12 
     13 	len = vsnprint(buf, sizeof(buf), fmt, args);
     14 	ret = consWrite(buf, len);
     15 
     16 	while (len-- > 0 && buf[len] == '\n')
     17 		buf[len] = '\0';
     18 	/*
     19 	 * if we do this, checking the root fossil (if /sys/log/fossil is there)
     20 	 * will spew all over the console.
     21 	 */
     22 	if (0)
     23 		syslog(0, "fossil", "%s", buf);
     24 	return ret;
     25 }
     26 
     27 /*
     28  * To do: This will become 'print'.
     29  */
     30 int
     31 consPrint(char* fmt, ...)
     32 {
     33 	int ret;
     34 	va_list args;
     35 
     36 	va_start(args, fmt);
     37 	ret = consVPrint(fmt, args);
     38 	va_end(args);
     39 	return ret;
     40 }