diff options
Diffstat (limited to 'libbio/bputrune.c')
| -rw-r--r-- | libbio/bputrune.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libbio/bputrune.c b/libbio/bputrune.c new file mode 100644 index 00000000..a864541d --- /dev/null +++ b/libbio/bputrune.c @@ -0,0 +1,22 @@ +#include "lib9.h" +#include <bio.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; +} |
