From owner-freebsd-sysinstall@FreeBSD.ORG Mon Jun 28 10:55:50 2010 Return-Path: Delivered-To: freebsd-sysinstall@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7CB71065674 for ; Mon, 28 Jun 2010 10:55:50 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [204.109.60.94]) by mx1.freebsd.org (Postfix) with ESMTP id 9D27F8FC14 for ; Mon, 28 Jun 2010 10:55:50 +0000 (UTC) Received: from unknown (client-86-31-67-88.midd.adsl.virginmedia.com [86.31.67.88]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id 01A2F5C03; Mon, 28 Jun 2010 10:55:56 +0000 (UTC) Date: Mon, 28 Jun 2010 11:55:41 +0100 From: Bruce Cran To: Karsten Behrmann Message-ID: <20100628115541.00002945@unknown> In-Reply-To: <3B0E67D1-95E7-421C-A506-744C86BC1E6C@gmx.net> References: <3B0E67D1-95E7-421C-A506-744C86BC1E6C@gmx.net> X-Mailer: Claws Mail 3.7.4cvs1 (GTK+ 2.16.0; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-sysinstall@freebsd.org Subject: Re: Some design suggestions X-BeenThere: freebsd-sysinstall@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Sysinstall Work List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jun 2010 10:55:50 -0000 On Sun, 27 Jun 2010 00:23:34 +0200 Karsten Behrmann wrote: > [TL;DR: Sysinstall is old and grown, and we should make some > adjustments to modules/headers/functions to fit the bigger size] sysinstall is a prototype, so keeping that in mind we should feel free to restructure it as needed. > I suggest having each typed as > int configFoo(void) > where appropriate, with the following return codes: > * 0 - success > * 1 - unspecified error (to catch returns of a && b) > * 2 - user initiated abort (by pressing cancel or something) > * 3 - operation failed (no disk found, I/O error, ...) I'd prefer something like: struct foo* initFoo(void); Then, pass the foo* around each of the functions. I think that having fewer globals is a good thing. Also, we should typedef the return type to make it clear what it refers to. > ----- avoid libdialog in API ----- > [TL;DR: libdialog return codes suck. Don't use them. Don't use > libdialog arguments unnecessarily either] I agree - we should be aiming towards a UI-agnostic API so that in the future a text or GUI frontend can be plugged in if pc-sysinstall ends up not taking over. > ----- use more static data ----- > [TL;DR: Don't use environment variables to store config info, use > static globals inside the modules instead] I disagree: globals are almost as bad as environment variables. I think we should instead use context structures that we pass around, like geom does. -- Bruce Cran brucec