From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 17 May 1999 11:24:18 +0900 From: okamoto@granite.cias.osakafu-u.ac.jp okamoto@granite.cias.osakafu-u.ac.jp Subject: [9fans] listen the sender name from mail Topicbox-Message-UUID: 967e0a06-eac8-11e9-9e20-41e7f4b1d025 Message-ID: <19990517022418.Xo-jBm7qOGOYW3nav_hsYiJv0eJqq4wNOtJ67HmwdUs@z> 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------