#include <u.h>
#include <libc.h>
#include <bio.h>
#include "cvsfs.h"
int
Bprnt(Biobufhdr *bp, char *fmt, ...)
{
va_list arg;
int n;
va_start(arg, fmt);
n = Bvprint(bp, fmt, arg);
if (Debug){
fprint(2, "tx: ");
vfprint(2, fmt, arg);
}
va_end(arg);
return n;
}
char *
Bgetline(Biobuf *bp)
{
char *p;
alarm(10000);
if ((p = Brdline(bp, '\n')) == nil){
werrstr("Bread %r");
return nil;
}
alarm(0);
p[Blinelen(bp) -1] = 0;
if (Debug)
fprint(2, "rx: %s\n", p);
return p;
}
|