1 #include <u.h> 2 #include <libc.h> 3 #include "fmtdef.h" 4 5 int fmtrune(Fmt * f,int r)6fmtrune(Fmt *f, int r) 7 { 8 Rune *rt; 9 char *t; 10 int n; 11 12 if(f->runes){ 13 rt = (Rune*)f->to; 14 FMTRCHAR(f, rt, f->stop, r); 15 f->to = rt; 16 n = 1; 17 }else{ 18 t = (char*)f->to; 19 FMTRUNE(f, t, f->stop, r); 20 n = t - (char*)f->to; 21 f->to = t; 22 } 23 f->nfmt += n; 24 return 0; 25 } 26