From owner-freebsd-hackers Thu Oct 29 14:56:11 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA06890 for freebsd-hackers-outgoing; Thu, 29 Oct 1998 14:56:11 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from dingo.cdrom.com (dingo.cdrom.com [204.216.28.145]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA06876 for ; Thu, 29 Oct 1998 14:56:09 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (localhost.cdrom.com [127.0.0.1]) by dingo.cdrom.com (8.9.1/8.8.8) with ESMTP id OAA00440; Thu, 29 Oct 1998 14:54:15 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Message-Id: <199810292254.OAA00440@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: John Hay cc: yokota@zodiac.mech.utsunomiya-u.ac.jp (Kazutaka YOKOTA), dfr@nlsystems.com, hackers@FreeBSD.ORG (FreeBSD-hackers) Subject: Re: kld screensavers In-reply-to: Your message of "Sat, 29 Oct 1998 21:22:00 +0200." <199810291922.VAA27010@zibbi.mikom.csir.co.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 29 Oct 1998 14:54:14 -0800 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > 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