2006-01-17 14:22:03 +01:00
|
|
|
#include <u.h>
|
|
|
|
#include <libc.h>
|
2005-08-08 14:50:13 +02:00
|
|
|
#include "fmtdef.h"
|
|
|
|
|
|
|
|
int
|
|
|
|
fmtrune(Fmt *f, int r)
|
|
|
|
{
|
|
|
|
Rune *rt;
|
|
|
|
char *t;
|
|
|
|
int n;
|
|
|
|
|
|
|
|
if(f->runes){
|
2006-01-17 13:37:52 +01:00
|
|
|
rt = (Rune*)f->to;
|
2005-08-08 14:50:13 +02:00
|
|
|
FMTRCHAR(f, rt, f->stop, r);
|
|
|
|
f->to = rt;
|
|
|
|
n = 1;
|
|
|
|
}else{
|
2006-01-17 13:37:52 +01:00
|
|
|
t = (char*)f->to;
|
2005-08-08 14:50:13 +02:00
|
|
|
FMTRUNE(f, t, f->stop, r);
|
|
|
|
n = t - (char*)f->to;
|
|
|
|
f->to = t;
|
|
|
|
}
|
|
|
|
f->nfmt += n;
|
|
|
|
return 0;
|
|
|
|
}
|