Date: Wed, 13 Dec 2000 15:20:12 +0100 (CET) From: Marius Bendiksen <mbendiks@eunet.no> To: Poul-Henning Kamp <phk@critter.freebsd.dk> Cc: Dag-Erling Smorgrav <des@ofug.org>, Hajimu UMEMOTO <ume@mahoroba.org>, arch@FreeBSD.ORG Subject: Re: %a and %A formats Message-ID: <Pine.BSF.4.05.10012131515050.37018-100000@login-1.eunet.no> In-Reply-To: <99149.976465929@critter>
next in thread | previous in thread | raw e-mail | index | archive | help
> What we *really* need is a %{type} construct with dynmically
> loadable renderes for different types.
>
> Then you could printf("Deny %{proto} from ${ip} to ${ip}", ...)
An alternate, though undoubtedly more cumbersome way to do this might be to
use vectors of a sort:
vector *v;
v_create(&v, 3 /*initial*/, 0 /*maxgrow*/);
v_append(v, vdesc_ipfw_proto, myproto);
v_append(v, vdesc_ipfw_ip, myfromip);
v_append(v, vdesc_ipfw_ip, mytoip);
say("Deny \1 from \2 to \3", v);
v_destroy(v);
This mechanism might, however, be reused later, somewhat similar to the va
functions, except that we attach arbitrary descriptors to the data that can
be used for various forms of rendring and special handling.
I have used things like this in my code before, and could supply the code
used there if it is desireable.
Marius
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.10012131515050.37018-100000>
