Re: [PATCH 6/7] Register a callback for graph output.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bo Yang wrote:
> +static struct strbuf *diff_output_prefix_callback(FILE *file, int print, void *data)
> +{
> +	struct git_graph *graph = data;
> +	static struct strbuf msgbuf = STRBUF_INIT;
> +
> +	assert(graph);
> +
> +	strbuf_reset(&msgbuf);
> +	graph_padding_line(graph, &msgbuf);
> +	if (print) {
> +		fwrite(msgbuf.buf, sizeof(char), msgbuf.len, stdout);
> +	}
> +	return &msgbuf;
> +}
> +

Ok, this partially answers my last mail and means that a simple string
would be too tedious, so a callback is needed.

It leaks the 'msgbuf' in the 'printing' case though.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]