runevseprint.c 362 B

12345678910111213141516171819202122232425
  1. #include <u.h>
  2. #include <libc.h>
  3. #include "fmtdef.h"
  4. Rune*
  5. runevseprint(Rune *buf, Rune *e, char *fmt, va_list args)
  6. {
  7. Fmt f;
  8. if(e <= buf)
  9. return nil;
  10. f.runes = 1;
  11. f.start = buf;
  12. f.to = buf;
  13. f.stop = e - 1;
  14. f.flush = 0;
  15. f.farg = nil;
  16. f.nfmt = 0;
  17. VA_COPY(f.args,args);
  18. dofmt(&f, fmt);
  19. VA_END(f.args);
  20. *(Rune*)f.to = '\0';
  21. return (Rune*)f.to;
  22. }