home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / m / me_cd25.zip / ME2MUTT.ZIP / CLOCK.MUT < prev    next >
Text File  |  1992-11-09  |  931b  |  33 lines

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;;;;;;;;;;;;;;;; Clock ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  4.  
  5. (int clock-process-id)
  6. (bool clock-running)
  7.  
  8. (defun
  9.   MAIN { (register-hook PROCESS-HOOK "process-time-hook") }
  10.   clock
  11.   {
  12.     (if (clock-running) { (msg "Clock already running!")(done) })
  13.  
  14.     (clock-process-id (create-process "ticker"))
  15.     (if (== -1 clock-process-id) (done))        ;; some kind of error
  16.  
  17.     (clock-running TRUE)
  18.   }
  19.   process-time-hook (int pid event-type)(message)
  20.   {
  21. (if (== PERROR event-type)
  22.   { (clock-running FALSE)(modeline-message "")(done) })
  23. (if (not (clock-running)) (done))
  24. (if (!= clock-process-id pid) (done))
  25.  
  26.     (switch event-type
  27.       PROCESS-DONE (clock-running FALSE)
  28.       OUTPUT-STDOUT (modeline-message message)
  29.     )
  30. (update)    ;; ??
  31.   }
  32. )
  33.