Clog.c 665 B

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