From owner-freebsd-questions@FreeBSD.ORG Mon Jan 12 10:40:09 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 544E216A4CE for ; Mon, 12 Jan 2004 10:40:09 -0800 (PST) Received: from pi.codefab.com (pi.codefab.com [66.234.138.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B02043D3F for ; Mon, 12 Jan 2004 10:40:03 -0800 (PST) (envelope-from cswiger@mac.com) Received: from [10.1.1.193] (nfw2.codefab.com [66.234.138.66]) by pi.codefab.com (8.12.10/8.12.10) with ESMTP id i0CIdp00054745; Mon, 12 Jan 2004 13:39:51 -0500 (EST) In-Reply-To: <21321.1073904325@www46.gmx.net> References: <21321.1073904325@www46.gmx.net> Mime-Version: 1.0 (Apple Message framework v609) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Charles Swiger Date: Mon, 12 Jan 2004 13:39:51 -0500 To: Philip Schulz X-Mailer: Apple Mail (2.609) X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.61 X-Spam-Checker-Version: SpamAssassin 2.61 (1.212.2.1-2003-12-09-exp) on pi.codefab.com cc: questions@freebsd.org Subject: Re: [OT] Configuration file parsing X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2004 18:40:09 -0000 On Jan 12, 2004, at 5:45 AM, Philip Schulz wrote: > I'm currently working on a program which will be used in a closed > company > environment. The programm is written in C. For this program, I need to > find > a way of parsing a configuration file. I found a library which can do > exactly what I need, it's GLib's lexical scanner [1]. What are your requirements for this configuation file? Something that deals with "classic" Unix config files (ie, along the lines of /etc/rc.conf and the like), with #-style comments and simple key-value assignment should only take a few hours to whip up, if you can't use GLib or other GPL'ed code for your circumstances. If you need something fancier, consider lex and yacc (or flex & bison), but XML property lists are another alternative that might be more flexible. -- -Chuck