From owner-freebsd-hackers Sun May 28 23:51:13 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from obie.softweyr.com (obie.softweyr.com [204.68.178.33]) by hub.freebsd.org (Postfix) with ESMTP id EF77C37B871 for ; Sun, 28 May 2000 23:51:07 -0700 (PDT) (envelope-from wes@softweyr.com) Received: from softweyr.com (Foolstrustident!@homer.softweyr.com [204.68.178.39]) by obie.softweyr.com (8.8.8/8.8.8) with ESMTP id AAA16399; Mon, 29 May 2000 00:50:46 -0600 (MDT) (envelope-from wes@softweyr.com) Message-ID: <39321407.40926B57@softweyr.com> Date: Mon, 29 May 2000 00:53:59 -0600 From: Wes Peters Organization: Softweyr LLC X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 4.0-STABLE i386) X-Accept-Language: en MIME-Version: 1.0 To: Boris Popov Cc: A G F Keahan , freebsd-hackers@FreeBSD.ORG Subject: Re: Generic config file parser? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Boris Popov wrote: > > On Mon, 29 May 2000, A G F Keahan wrote: > > > This may be a silly question, but is there such a thing? Almost every > > program that I know uses configuration files, often in different, > > incompatible formats. I personally prefer Samba/Wine-style config > > files which are split into "sections" like this: > > Yes, there is such thing. I've used this format for nwfs/smbfs > configuration files. You may look at old version of this parser in > src/lib/libncp/ncpl_rcfile.c or download smbfs sources > (ftp://ftp.butya.kz/pub/smbfs/smbfs.tar.gz) and look in the > lib/smb/rcfile.c for more generalized interface. > > I'm really want to make this thing generic and unite it with > others config file parsers (if memory serves me right, Daniel Sobral wrote > RW version for rc.conf style files). Not needed, there is such a parser library included in OpenSSL, which is included in FreeBSD by default as of 4.0. The documenation is non-existent, but I suspect it will show up sooner than yet another development effort would produce. See /usr/src/crypto/openssl/crypto/conf for more info: UTSL. A better choice might be found in XML. Exploring the port of libxml (in ports/textproc) might be enlightening. -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC wes@softweyr.com http://softweyr.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message