mirror of
https://github.com/0intro/wmii
synced 2024-11-29 00:53:09 +03:00
24 lines
305 B
C
24 lines
305 B
C
|
#include "plan9.h"
|
||
|
#include <bio.h>
|
||
|
#include <utf.h>
|
||
|
|
||
|
int
|
||
|
Bputrune(Biobuf *bp, long c)
|
||
|
{
|
||
|
Rune rune;
|
||
|
char str[4];
|
||
|
int n;
|
||
|
|
||
|
rune = c;
|
||
|
if(rune < Runeself) {
|
||
|
Bputc(bp, rune);
|
||
|
return 1;
|
||
|
}
|
||
|
n = runetochar(str, &rune);
|
||
|
if(n == 0)
|
||
|
return Bbad;
|
||
|
if(Bwrite(bp, str, n) != n)
|
||
|
return Beof;
|
||
|
return n;
|
||
|
}
|