From 37da2899f40661e3e9631e497da8dc59b971cbd0 Mon Sep 17 00:00:00 2001 From: "Charles.Forsyth" Date: Fri, 22 Dec 2006 17:07:39 +0000 Subject: 20060303a --- libbio/bputrune.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 libbio/bputrune.c (limited to 'libbio/bputrune.c') 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 + +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; +} -- cgit v1.2.3