fprint.c 665 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. /*FORMAT1v $
  10. %s = char *
  11. %l = long
  12. %c = int
  13. %[uxbo] = unsigned int
  14. %d = int
  15. $ */
  16. /*VARARGS*/
  17. void
  18. fprint
  19. #if __STDC__
  20. (File *fp, char *fmt, ...)
  21. {
  22. #else
  23. (va_alist)
  24. va_dcl
  25. {
  26. File *fp;
  27. char *fmt;
  28. #endif
  29. va_list args;
  30. char buf[SSIZE];
  31. #if __STDC__
  32. va_start(args, fmt);
  33. #else
  34. va_start(args);
  35. fp = va_arg(args, File *);
  36. fmt = va_arg(args, char *);
  37. #endif
  38. sys_write(fp, buf, _format(buf, fmt, args));
  39. va_end(args);
  40. }