Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Jun 2010 11:55:41 +0100
From:      Bruce Cran <bruce@cran.org.uk>
To:        Karsten Behrmann <BearPerson@gmx.net>
Cc:        freebsd-sysinstall@freebsd.org
Subject:   Re: Some design suggestions
Message-ID:  <20100628115541.00002945@unknown>
In-Reply-To: <3B0E67D1-95E7-421C-A506-744C86BC1E6C@gmx.net>
References:  <3B0E67D1-95E7-421C-A506-744C86BC1E6C@gmx.net>

next in thread | previous in thread | raw e-mail | index | archive | help

On Sun, 27 Jun 2010 00:23:34 +0200
Karsten Behrmann <BearPerson@gmx.net> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100628115541.00002945>