From owner-freebsd-arch Mon Jun 26 14:49:21 2000 Delivered-To: freebsd-arch@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 3647F37B8B7; Mon, 26 Jun 2000 14:49:14 -0700 (PDT) (envelope-from bright@fw.wintelcom.net) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id e5QLnCJ03164; Mon, 26 Jun 2000 14:49:12 -0700 (PDT) Date: Mon, 26 Jun 2000 14:49:12 -0700 From: Alfred Perlstein To: Adrian Chadd Cc: arch@freebsd.org Subject: Re: dynamic filetypes. please comment. Message-ID: <20000626144912.D275@fw.wintelcom.net> References: <20000626142428.A275@fw.wintelcom.net> <20000626233203.Y36017@zoe.bastard.co.uk> <20000626143555.C275@fw.wintelcom.net> <20000626233809.A36017@zoe.bastard.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20000626233809.A36017@zoe.bastard.co.uk>; from adrian@freebsd.org on Mon, Jun 26, 2000 at 11:38:09PM +0200 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Adrian Chadd [000626 14:38] wrote: > On Mon, Jun 26, 2000, Alfred Perlstein wrote: > > > > the api would look something like: > > > > > > > > (void)sequence_register("filetypes", starting_number); > > > > mynum = sequence_next("filetypes"); /* to be used for f_type */ > > > > > > The debug gods might like: > > > > > > mynum = sequence_next("filetypes", "DTYPE_FOO", "A foo-type file"); > > > > Yes, the only problem is that it requires storage for each number. > > > > I think that the correct thing to do is provide both APIs, one > > requiring storage but providing nicer debugging capabilities along > > with number recycling and another with just a straight-up sequence > > which fails once a wrap needs to happen. > > You could always just give the one API, and some options BLAH magic > to say whether to compile in the strings or not .. > > "storage for each number" - how many filetypes are you going to > register? :-) Heh, one never knows. One more thing I'll be needing to add is a DTYPE_MAX equal to DTYPE_KQUEUE, any objections? -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message