fmtrune.c (452B)
1 /* Copyright (c) 2002-2006 Lucent Technologies; see LICENSE */ 2 #include "fmt.h" 3 #include "fmtdef.h" 4 #include "plan9.h" 5 6 #include <stdarg.h> 7 #include <string.h> 8 9 int fmtrune(Fmt* f, int r) { 10 Rune* rt; 11 char* t; 12 int n; 13 14 if (f->runes) { 15 rt = (Rune*) f->to; 16 FMTRCHAR(f, rt, f->stop, r); 17 f->to = rt; 18 n = 1; 19 } else { 20 t = (char*) f->to; 21 FMTRUNE(f, t, f->stop, r); 22 n = t - (char*) f->to; 23 f->to = t; 24 } 25 f->nfmt += n; 26 return 0; 27 }