9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] listen the sender name from mail
@ 1999-05-17  2:24 okamoto
  0 siblings, 0 replies; only message in thread
From: okamoto @ 1999-05-17  2:24 UTC (permalink / raw)


I finally made a small change to /acme/mail/src/box.l (and
fns.h if neccessary), and now it appears to work fine.
However, this is my first time to write Alef program, and
am not still have confidence that i'm on the right way.

The changes are as follows, and please make coments on this.

Thanks

Kenji

----------cut here--------
/acme/mail/src/box.l

in Box.readmore() function:

add an declaration of
chan(byte*) speak;

and add lines i if(new) block like:

	b->wshow();
	alloc speak;
	proc say(speak);
	speak <-=buf;
  }

and add a function called from the line say() like:

void
say(chan(byte*)speak)
{
	byte *mesg[6], *user, *subj, *msg;

	if(strcmp(getenv("cputype"), "sparc") != 0) {
		rfork(RFFDG|RFNOTEG);
		msg = <-speak;
		if(!strchr(msg, '!'))
			user = strchr(msg, '\t') + 1;
		else
			user = strchr(msg, '!') + 1;
		subj = strchr(msg, '\n') + 2;
		mesg[0] = "Say";
		mesg[1] = "a New mail arrived from";
		mesg[2] = strdup(user);
		*strchr(mesg[2], '\t') = '\0';
		mesg[3] = "with subject line as";
		mesg[4] = strdup(subj);
		mesg[5] = "";
		exec("/rc/bin/Say", mesg);
	}
	terminate(nil);
}

------end of lines------




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-05-17  2:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-05-17  2:24 [9fans] listen the sender name from mail okamoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).