From owner-freebsd-arch Wed Dec 13 6:20:16 2000 From owner-freebsd-arch@FreeBSD.ORG Wed Dec 13 06:20:14 2000 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mail-relay.eunet.no (mail-relay.eunet.no [193.71.71.242]) by hub.freebsd.org (Postfix) with ESMTP id 847F537B400 for ; Wed, 13 Dec 2000 06:20:13 -0800 (PST) Received: from login-1.eunet.no (login-1.eunet.no [193.75.110.2]) by mail-relay.eunet.no (8.9.3/8.9.3/GN) with ESMTP id PAA80746; Wed, 13 Dec 2000 15:20:12 +0100 (CET) (envelope-from mbendiks@eunet.no) Received: from localhost (mbendiks@localhost) by login-1.eunet.no (8.9.3/8.8.8) with ESMTP id PAA37220; Wed, 13 Dec 2000 15:20:12 +0100 (CET) (envelope-from mbendiks@eunet.no) X-Authentication-Warning: login-1.eunet.no: mbendiks owned process doing -bs Date: Wed, 13 Dec 2000 15:20:12 +0100 (CET) From: Marius Bendiksen To: Poul-Henning Kamp Cc: Dag-Erling Smorgrav , Hajimu UMEMOTO , arch@FreeBSD.ORG Subject: Re: %a and %A formats In-Reply-To: <99149.976465929@critter> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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