Plan 9 from Bell Labs’s /usr/web/sources/contrib/steve/root/sys/src/cmd/cvsfs/util.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#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;
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.