Exemple #1
0
int
bufWrBuffer(Buffer buf, Buffer b)
{
	int cc = bufPosition(b);

	bufPutSInt(buf, cc);
	bufPutChars(buf, bufChars(b), cc);

	return SINT_BYTES + cc;
}
Exemple #2
0
local String
inclGetLine(FILE *file)
{
	int     c;
	String	s;

	bufStart(inclBuffer);
	while ((c = osGetc(file)) != EOF) {
		bufAdd1(inclBuffer, c);
		if (c == '\n') break;
	}
	bufAdd1(inclBuffer, char0);

	s = bufChars(inclBuffer);
	if (c == EOF && *s == 0) return 0;
	return s;
}