diff options
author | rsc <devnull@localhost> | 2003-09-30 17:47:41 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2003-09-30 17:47:41 +0000 |
commit | b2cfc4e2e71d0f0a5113ddfbd93c8285cc4d74e4 (patch) | |
tree | f382987fec33cf639d75b1fe1b5d76b8f155d074 /src/libbio/bputrune.c | |
parent | 5f7d5e8d1899f41b0e5366c0251530ea1dc753d0 (diff) | |
download | plan9port-b2cfc4e2e71d0f0a5113ddfbd93c8285cc4d74e4.tar.gz plan9port-b2cfc4e2e71d0f0a5113ddfbd93c8285cc4d74e4.tar.bz2 plan9port-b2cfc4e2e71d0f0a5113ddfbd93c8285cc4d74e4.zip |
Initial revision
Diffstat (limited to 'src/libbio/bputrune.c')
-rw-r--r-- | src/libbio/bputrune.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/libbio/bputrune.c b/src/libbio/bputrune.c new file mode 100644 index 00000000..a2eaa83e --- /dev/null +++ b/src/libbio/bputrune.c @@ -0,0 +1,23 @@ +#include "lib9.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; +} |