From owner-freebsd-hackers Mon Jul 21 00:19:11 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id AAA27275 for hackers-outgoing; Mon, 21 Jul 1997 00:19:11 -0700 (PDT) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id AAA27267 for ; Mon, 21 Jul 1997 00:19:07 -0700 (PDT) Received: (from msmith@localhost) by genesis.atrad.adelaide.edu.au (8.8.5/8.7.3) id QAA22125; Mon, 21 Jul 1997 16:48:12 +0930 (CST) From: Michael Smith Message-Id: <199707210718.QAA22125@genesis.atrad.adelaide.edu.au> Subject: Re: suggested enhancement: linux_ioctl.c diagnostic output In-Reply-To: from Chris Timmons at "Jul 21, 97 00:08:52 am" To: skynyrd@opus.cts.cwu.edu Date: Mon, 21 Jul 1997 16:48:11 +0930 (CST) Cc: msmith@atrad.adelaide.edu.au, freebsd-hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Chris Timmons stands accused of saying: > > Thanks for the response. No sweat; like I (should have) said, sorry I was so slow with it. > Much easier to understand. I wish I'd thought of your simplification :) > As for the is_printable test, would it be also prudent to make sure that > the value is < 0x7f as well? I'm pretty naive about character set issues > and don't know what some of the values with the 8th bit set might produce. > Some of the newer ioctl number assignments start in a range beginning at > 0x89 (and beyond.) I think its reasonable to assume that any value >= 0x20 is printable. The only exception I can think of is 0x7f, which may result in only one ' being visible on a serial console. > > The other implementation of the IO[WR] decoding I would consider would > > use a small lookup table and a large shift to generate an index. The > > massively nested ? set you used makes for very difficult reading. > > Maybe a lookup table would be the best way to do this neatly in terms of > the printf statement. I'll think about that for a while. Not using a lookup makes the printf self-contained. I can't think of any other advantages. -- ]] Mike Smith, Software Engineer msmith@gsoft.com.au [[ ]] Genesis Software genesis@gsoft.com.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control. (ph) +61-8-8267-3493 [[ ]] Unix hardware collector. "Where are your PEZ?" The Tick [[