print.c 619 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  3. * See the copyright notice in the ACK home directory, in the file "Copyright".
  4. */
  5. /* $Id$ */
  6. #include <system.h>
  7. #include "print.h"
  8. #include "param.h"
  9. /*FORMAT0v $
  10. %s = char *
  11. %l = long
  12. %c = int
  13. %[uxbo] = unsigned int
  14. %d = int
  15. $ */
  16. /*VARARGS*/
  17. void
  18. print
  19. #if __STDC__
  20. (char *fmt, ...)
  21. {
  22. #else
  23. (va_alist)
  24. va_dcl
  25. {
  26. char *fmt;
  27. #endif
  28. va_list args;
  29. char buf[SSIZE];
  30. #if __STDC__
  31. va_start(args, fmt);
  32. #else
  33. va_start(args);
  34. fmt = va_arg(args, char *);
  35. #endif
  36. sys_write(STDOUT, buf, _format(buf, fmt, args));
  37. va_end(args);
  38. }