From owner-freebsd-hackers Sun May 28 20:11:49 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from relay.butya.kz (butya-gw.butya.kz [212.154.129.94]) by hub.freebsd.org (Postfix) with ESMTP id F225437BC2B for ; Sun, 28 May 2000 20:11:40 -0700 (PDT) (envelope-from bp@butya.kz) Received: from bp (helo=localhost) by relay.butya.kz with local-esmtp (Exim 3.13 #1) id 12wFxm-0005uX-00; Mon, 29 May 2000 10:11:34 +0700 Date: Mon, 29 May 2000 10:11:34 +0700 (ALMST) From: Boris Popov To: A G F Keahan Cc: freebsd-hackers@freebsd.org Subject: Re: Generic config file parser? In-Reply-To: <3931B325.BB166270@freenet.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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). The only big problem is the name of the library file - last time it was discussed there was no consensus on this topic. -- Boris Popov http://www.butya.kz/~bp/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message