Date: Thu, 29 Oct 1998 14:54:14 -0800 From: Mike Smith <mike@smith.net.au> To: John Hay <jhay@mikom.csir.co.za> Cc: yokota@zodiac.mech.utsunomiya-u.ac.jp (Kazutaka YOKOTA), dfr@nlsystems.com, hackers@FreeBSD.ORG (FreeBSD-hackers) Subject: Re: kld screensavers Message-ID: <199810292254.OAA00440@dingo.cdrom.com> In-Reply-To: Your message of "Sat, 29 Oct 1998 21:22:00 %2B0200." <199810291922.VAA27010@zibbi.mikom.csir.co.za>
next in thread | previous in thread | raw e-mail | index | archive | help
>
> Is this really usefull? The simplest one is the star_saver and its
> modevent function will look like this:
>
> ---------
> static int
> star_saver_modevent(module_t mod, modeventtype_t type, void *unused)
> {
> switch (type) {
> case MOD_LOAD:
> return add_scrn_saver(star_saver);
> case MOD_UNLOAD:
> return remove_scrn_saver(star_saver);
> default:
> printf("star_saver module unknown event: 0x%x\n", type);
> }
> return 0;
> }
> ---------
>
> It looks silly to me to put this somewhere generic and call it from each
> saver.
>
> What might be usefull is a macro to define the moduledata_t structure
> and do the DECLARE_MODULE() thingy like what is done with CDEV_MODULE,
> but even there I'm not sure if you are saving that much.
>
> But maybe I'm missing something.
Actually, I'd put it the other way around and have the
screensaver-specific functions call through the module generic handler,
so you'd just add extra cases to the switch, and still only have one
entrypoint per module.
--
\\ Sometimes you're ahead, \\ Mike Smith
\\ sometimes you're behind. \\ mike@smith.net.au
\\ The race is long, and in the \\ msmith@freebsd.org
\\ end it's only with yourself. \\ msmith@cdrom.com
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810292254.OAA00440>
