runevseprint.c 343 B

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