--------
In message
<cantn4cpdvxyimmkh9mchfrazshx-sxcouvyfqcldq77pbf5...@mail.gmail.com>, Martin
Blix Grydeland writes:
>Now that we expose the panic functions also to vmods, I believe we need to
>define a somewhat cleaner way for different parts to produce the panic
>output.
Yes, it's getting unwieldy.
A very similar situation exists in VCC with respect to the C code output.
I've been pondering extending the VSB api so that it would automatically
indent after \n.
Something like:
VSB_indent(struct vsb *, int more);
VSB_printf(vsb, "{\n");
VSB_indent(vsb, 2);
VSB_printf(vsb, "Foo = bla;\n");
VSB_indent(vsb, -2);
VSB_printf(vsb, "}\n");
As you can see from that example, the indentation needs to happen on first char
*after* then \n
rather than the \n itself. I think that is the most logical and useful
semantics.
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
[email protected] | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
_______________________________________________
varnish-dev mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev