Google
 

Trailing-Edge - PDP-10 Archives - -
There are no other files named in the archive.
(FILECREATED "15-MAY-79 16:57:59" <LISPUSERS>MAIL.;21 6057   

     changes to:  SETMAILFILE1

     previous date: "12-JUL-78 18:16:23" <LISPUSERS>MAIL.;18)


(PRETTYCOMPRINT MAILCOMS)

(RPAQQ MAILCOMS [(* check periodically if you have new mail)
		 (DECLARE: FIRST (ADDVARS (NOSWAPFNS MAILWATCHER)))
		 (FNS MAILWATCHER MAILCHECK PRINTUSERNAME MSGSTUB)
		 (FNS SETMAILFILE1)
		 (VARS MAILINTERVAL (MAILTIME -1)
		       (LASTKNOWNMAIL -1)
		       (MAILEVENTCOUNT -20)
		       (MAILFILE)
		       (MAILFILESTR)
		       (MSGFORK))
		 (P (MOVD? (QUOTE SETMAILFILE1)
			   (QUOTE SETMAILFILE))
		    (SETMAILFILE T)
		    (MOVD? (QUOTE MSGSTUB)
			   (QUOTE MSG)))
		 (ADDVARS (AFTERSYSOUTFORMS (SETMAILFILE)))
		 [DECLARE: EVAL@LOADWHEN (CCODEP (QUOTE MAILWATCHER))
			   (ADDVARS (PROMPTCHARFORMS (MAILWATCHER]
		 (LOCALVARS . T)
		 (GLOBALVARS MAILTIME MAILINTERVAL MAILFILESTR LASTKNOWNMAIL MAILEVENTCOUNT)
		 (DECLARE: EVAL@COMPILE DONTCOPY (P (OR (GETD (QUOTE CJSYS))
							(LOAD (QUOTE <LISPUSERS>CJSYS.COM])





(* check periodically if you have new mail)

(DECLARE: FIRST 

(ADDTOVAR NOSWAPFNS MAILWATCHER)
)
(DEFINEQ

(MAILWATCHER
  (LAMBDA NIL                           (* lmm "12-JUL-78 18:15")

          (* MAILFILESTR is the flag that controls this facility -
	  it is intended that the user set MAILFILESTR in his INIT.LISP 
	  to a string "<username>MESSAGE.TXT;1 " 
	  (the space MUST be at the end))


    (COND
      (MAILFILESTR (ASSEMBLE NIL
			     (VAR (AOS 1 , MAILEVENTCOUNT))
			     (MOVEI 1 , 0 (1))
			     (CAIGE 1 , ASZ)
			     (JRST OUT)
                                        (* only every 12Q events;
					i.e. when MAILEVENTCOUNT 
					incremented to 0)
			     (MOVEI 1 , ASZ -12Q)
			     (SETQ MAILEVENTCOUNT)
			     (JS GTAD)
			     (PUSHN)
			     (CV MAILTIME)
			     (NREF (CAMLE 1 , 0))
			     (JRST OUTN)
			     (CV MAILINTERVAL)
			     (NREF (ADD 1 , 0))
			     (FASTCALL MKN)
			     (SETQ MAILTIME)
			     (CQ (MAILCHECK NIL T))
			 OUTN(POPNN 1)
			 OUT)))
    NIL))

(MAILCHECK
  (LAMBDA (USER FLG)                    (* lmm "12-JUL-78 18:06")
    (PROG (JFN THISDATE X)
          (ASSEMBLE NIL
		    (CQ (COND
			  (USER (CONCAT "<" USER ">MESSAGE.TXT;1 "))
			  (T MAILFILESTR)))
		    (PUSHJ CP , UPATM)
		    (MOVE 2 , 3)
		    (HRLZI 1 , 100001Q)
                                        (* OLD FILE)
		    (JSYS 20Q)

          (* This is a GTJFN; done in line just to make it run faster)


		    (JRST NOMSG)
		    (SETQ JFN)
		    (MOVE 2 , = 2000014Q)
		    (MOVEI 3 , 2)
		    (JSYS 63Q)          (* GTFDB get words 14q and 15q 
					of FDB into 3 and 4)
		    (CAMG 2 , 3)        (* Write (16q) greater than read
					(17q) ?)
		    (JRST NOMSG)
		    (MOVE 1 , 2)
		    (CQ
		      (COND
			((OR (IGREATERP (SETQ THISDATE (LOC (AC)))
					LASTKNOWNMAIL)
			     (NULL FLG)
			     USER)
			  (PRIN1 "[Mail waiting - " T)
			  (PRIN1 (GDATE THISDATE -377477000000Q
					(CONSTANT (CONCAT)))
				 T)     (* prints the time the mail was 
					recieved as nn:nnPM or nn:nnAM)
			  (COND
			    ((AND
				(NOT (ZEROP (SETQ X
					      (LRSH (JSYS 63Q
							  (LOC JFN)
							  1000006Q 2 2)
						    22Q))))
				(NEQ X 1))
                                        (* don't include SYSTEM or from 
					jobs not-logged in 
					(arpa mail server))
			      (PRIN1 " from " T)
			      (PRINTUSERNAME X)))
			  (PRIN1 "]
" T)))
		      (OR USER (SETQ LASTKNOWNMAIL THISDATE)))
		NOMSG)
          (AND JFN (RLJFN (LOC JFN)))
          (RETURN X))))

(PRINTUSERNAME
  [LAMBDA (N)                           (* lmm: "15-FEB-77 21:49:38")
    (ASSEMBLE NIL
	      (CQ MACSCRATCHSTRING)
	      (PUSHJ CP , UPATM)
	      (MOVE 1 , 3)
	      (CQ2 N)
	      (SUBI 2 , ASZ)
	      (JSYS 41Q)
	      (JUMPA NONE)
	      (MOVEI 4 , 0)             (* 4 is a flag to lowercase)
	      (MOVEI FX , 1)
	  LP  (ILDB 1 , 3)
	      (JUMPE 1 , DONE)
	      (CAIN 4 , 0)
	      (AOJA 4 , BOUT)           (* Set flag and output)
	      (CAIG 1 , 132Q)
	      (CAIGE 1 , 101Q)
	      (TDZA 4 , 4)
	      (ADDI 1 , 40Q)
	  BOUT(PUSHJ CP , FOUT)
	      (JUMPA LP)
	  NONE(CQ (PRIN1 "unknown" T))
	  DONE])

(MSGSTUB
  (LAMBDA NIL                           (* edited: " 5-JAN-78 16:15")
    (COND
      ((AND MSGFORK (NLSETQ (SUBSYS MSGFORK)))
	MSGFORK)
      (T (CLEARBUF T)
	 (BKSYSBUF " ")
	 (BKSYSBUF MAILFILE)
	 (BKSYSBUF "

")
	 (RESETFORM (CONTROL T)
		    (PROGN (READC T)
			   (SETQ MSGFORK
			     (SUBSYS (QUOTE <SUBSYS>MSG.SAV)))))
	 MSGFORK))))
)
(DEFINEQ

(SETMAILFILE1
  [LAMBDA (FLG)                                        (* rmk: "15-MAY-79 16:57")
    (COND
      ((OR [NEQ MAILFILE (SETQ MAILFILE (SELECTQ (SYSTEMTYPE)
						 (TENEX (PACK* "<" (DIRECTORYNAME NIL T)
							       ">MESSAGE.TXT;1"))
						 (TOPS20 (PACK* "<" (DIRECTORYNAME NIL T)
								">MAIL.TXT.1"))
						 (SHOULDNT]
	   FLG)
	(SETQ MAILFILESTR (CONCAT MAILFILE " "))
	(SETQ LASTKNOWNMAIL -1])
)

(RPAQQ MAILINTERVAL 300)

(RPAQ MAILTIME -1)

(RPAQ LASTKNOWNMAIL -1)

(RPAQ MAILEVENTCOUNT -20)

(RPAQ MAILFILE NIL)

(RPAQ MAILFILESTR NIL)

(RPAQ MSGFORK NIL)
(MOVD? (QUOTE SETMAILFILE1)
       (QUOTE SETMAILFILE))
(SETMAILFILE T)
(MOVD? (QUOTE MSGSTUB)
       (QUOTE MSG))

(ADDTOVAR AFTERSYSOUTFORMS (SETMAILFILE))
(DECLARE: EVAL@LOADWHEN (CCODEP (QUOTE MAILWATCHER)) 

(ADDTOVAR PROMPTCHARFORMS (MAILWATCHER))
)
(DECLARE: DOEVAL@COMPILE DONTCOPY

(LOCALVARS . T)
)
(DECLARE: DOEVAL@COMPILE DONTCOPY

(ADDTOVAR GLOBALVARS MAILTIME MAILINTERVAL MAILFILESTR LASTKNOWNMAIL MAILEVENTCOUNT)
)
(DECLARE: EVAL@COMPILE DONTCOPY 
(OR (GETD (QUOTE CJSYS))
    (LOAD (QUOTE <LISPUSERS>CJSYS.COM)))
)
(DECLARE: DONTCOPY
  (FILEMAP (NIL (1178 4815 (MAILWATCHER 1190 . 2159) (MAILCHECK 2163 . 3761) (PRINTUSERNAME 3765 . 4435)
 (MSGSTUB 4439 . 4812)) (4817 5265 (SETMAILFILE1 4829 . 5262)))))
STOP