From owner-freebsd-stable Sat Feb 2 3:30:39 2002 Delivered-To: freebsd-stable@freebsd.org Received: from albatross.prod.itd.earthlink.net (albatross.mail.pas.earthlink.net [207.217.120.120]) by hub.freebsd.org (Postfix) with ESMTP id 7C9A037B404; Sat, 2 Feb 2002 03:30:11 -0800 (PST) Received: from pool0015.cvx40-bradley.dialup.earthlink.net ([216.244.42.15] helo=mindspring.com) by albatross.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16WyMm-0000TD-00; Sat, 02 Feb 2002 03:29:57 -0800 Message-ID: <3C5BCDAE.22E25BAA@mindspring.com> Date: Sat, 02 Feb 2002 03:29:50 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Miguel Mendez Cc: Paul Fardy , current@freebsd.org, stable@freebsd.org Subject: Re: Junior Annoying Hacker Task References: <5F46C986-16DB-11D6-8CEC-00039359034A@mac.com> <3C5B3225.F04B9B18@mindspring.com> <20020202120725.A32535@energyhq.homeip.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Miguel Mendez wrote: > Are you really serious about this? :) I've thought about that many > times, well, not with the registry paradigm, but some sort of graphical > admin tool based on GTK. I'm doing exams this week but may take a go at > it after I finish them. Let me know the form you want the hierarchy to take, so you can stick it into the GTK hierarchy thingy; I'll be happy to crank out some quick yacc and lex code to do the parsing of the file into that format for you. A structure definition, with links, and how you want it linked, would be ideal. 8-). Something like: typedef enum _nodekind { NK_VALUE, /* Path component */ NK_KEY, /* Key */ NK_DATA_INT, /* 32 bit integer */ NK_DATA_STRING, /* String */ NK_DATA_BINARY /* Word count prefix bytestream */ } nodekind_t; struct wcval { int16_t count; /* howw many bytes in "bytes" */ char bytes[ 1]; /* actually longer */ }; struct node { struct node *parent; struct node *sibling; nodekind_t kind; union { struct node *child; int intval; char *strval; struct wcval *wcval; } u; }; But I could arrange something else, if it would be more useful for it to be some other data structure. ;-). -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message