mirror of
https://github.com/0intro/conterm
synced 2024-11-22 05:41:28 +03:00
26 lines
328 B
C
26 lines
328 B
C
#include <u.h>
|
|
#include <libc.h>
|
|
#include "fmtdef.h"
|
|
|
|
int
|
|
fmtrune(Fmt *f, int r)
|
|
{
|
|
Rune *rt;
|
|
char *t;
|
|
int n;
|
|
|
|
if(f->runes){
|
|
rt = (Rune*)f->to;
|
|
FMTRCHAR(f, rt, f->stop, r);
|
|
f->to = rt;
|
|
n = 1;
|
|
}else{
|
|
t = (char*)f->to;
|
|
FMTRUNE(f, t, f->stop, r);
|
|
n = t - (char*)f->to;
|
|
f->to = t;
|
|
}
|
|
f->nfmt += n;
|
|
return 0;
|
|
}
|