Article View: news.software.readers
Article #59977Re: [slrn/ s-lang] multiple post-hooks addind custom-headers
From: John E. Davis
Date: Sun, 02 Apr 2000 00:00
Date: Sun, 02 Apr 2000 00:00
46 lines
1915 bytes
1915 bytes
On 2 Apr 2000 01:26:39 +0200, Rejo Zenger <rejo@sisterray.xs4all.nl>
wrote:
>So, what i have now are two separate files, but only one gets executed,
>although both are sourced. Any idea's what's the best way to deal with
>this?
There are several possibilites. You could always create a ``master''
followup hook that does:
#v+
static variable Followup_Hooks = NULL;
define add_followup_hook (hook)
{
variable h = struct {
hook, next
}
h.hook = hook;
h.next = Followup_Hooks;
Followup_Hooks = h;
}
define followup_hook ()
{
variable h = Followup_Hooks;
while (h != NULL)
{
@h.hook ();
h = h.next;
}
}
#v-
Then you can add a hook such as:
#v+
static define spamtraps_followup_hook ()
{
% whatever
}
add_followup_hook (&spamtraps_followup_hook);
#v-
--
John E. Davis Center for Space Research/AXAF Science Center
617-258-8119 One Hampshire St., Building NE80-6019
http://space.mit.edu/~davis Cambridge, MA 02139-4307
Technical Details
Message-ID:
<slrn8ed5rk.2hf.davis@aluche.mit.edu>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mailReferences:
<rejo.954595435m@sisterray.xs4all.nl> <slrn8eciau.bg3.bluemoon@ux6.cso.uiuc.edu> <rejo.954628360m@sisterray.xs4all.nl>Show Full Headers
Complete Article Headers
Message-ID: <slrn8ed5rk.2hf.davis@aluche.mit.edu> Subject: Re: [slrn/ s-lang] multiple post-hooks addind custom-headers Date: Sun, 02 Apr 2000 00:00:00 +0000 From: davis@space.mit.edu (John E. Davis) References: <rejo.954595435m@sisterray.xs4all.nl> <slrn8eciau.bg3.bluemoon@ux6.cso.uiuc.edu> <rejo.954628360m@sisterray.xs4all.nl> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail X-Deja-AN: 605467764 X-Trace: dreaderd 954636152 5692 18.75.2.45 Organization: Center for Space Research User-Agent: slrn/0.9.6.3 (Linux) Reply-To: davis@space.mit.edu Newsgroups: news.software.readers