9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: okamoto@granite.cias.osakafu-u.ac.jp okamoto@granite.cias.osakafu-u.ac.jp
Subject: [9fans] listen the sender name from mail
Date: Mon, 17 May 1999 11:24:18 +0900	[thread overview]
Message-ID: <19990517022418.Xo-jBm7qOGOYW3nav_hsYiJv0eJqq4wNOtJ67HmwdUs@z> (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------




                 reply	other threads:[~1999-05-17  2:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19990517022418.Xo-jBm7qOGOYW3nav_hsYiJv0eJqq4wNOtJ67HmwdUs@z \
    --to=okamoto@granite.cias.osakafu-u.ac.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).