From owner-freebsd-hackers Wed Jan 1 15:20:26 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 86F5C37B401 for ; Wed, 1 Jan 2003 15:20:25 -0800 (PST) Received: from apotheosis.org.za (apotheosis.org.za [137.158.128.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id B5BD543E4A for ; Wed, 1 Jan 2003 15:20:24 -0800 (PST) (envelope-from mwest@uct.ac.za) Date: Thu, 2 Jan 2003 01:20:42 +0200 From: Matthew West To: Tim Kientzle Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Reading rc.conf from C programs? Message-ID: <20030102012042.A16965@apotheosis.org.za> References: <3E1362FD.6070001@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3E1362FD.6070001@acm.org>; from "Tim Kientzle" on Wed, Jan 01, 2003 at 01:51:57PM Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Jan 01, 2003 at 01:51:57PM -0800, Tim Kientzle wrote: > I'm trying to figure out how to read and use /etc/rc.conf > configuration variables from within a C program. You could perhaps copy the way that "The Fish" does it? Take a look at "ports/sysutils/thefish". The "parser.c" code appears to read /etc/{,defaults/}rc.conf and place all the options into a linked list. -- mwest@uct.ac.za To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message