1: /*
   2:  * Copyright (c) 1983 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  */
   6: 
   7: #ifndef lint
   8: static char sccsid[] = "@(#)msgs.c	5.1 (Berkeley) 6/6/85";
   9: #endif not lint
  10: 
  11: /*
  12:  * A package to display what is happening every MSG_INTERVAL seconds
  13:  * if we are slow connecting.
  14:  */
  15: 
  16: #include <signal.h>
  17: #include <stdio.h>
  18: #include <sys/time.h>
  19: #include "talk.h"
  20: 
  21: #define MSG_INTERVAL 4
  22: #define LONG_TIME 100000
  23: 
  24: char    *current_state;
  25: int current_line = 0;
  26: 
  27: static  struct itimerval itimer;
  28: static  struct timeval wait = { MSG_INTERVAL , 0};
  29: static  struct timeval undo = { LONG_TIME, 0};
  30: 
  31: disp_msg()
  32: {
  33: 
  34:     message(current_state);
  35: }
  36: 
  37: start_msgs()
  38: {
  39: 
  40:     message(current_state);
  41:     signal(SIGALRM, disp_msg);
  42:     itimer.it_value = itimer.it_interval = wait;
  43:     setitimer(ITIMER_REAL, &itimer, (struct timerval *)0);
  44: }
  45: 
  46: end_msgs()
  47: {
  48: 
  49:     signal(SIGALRM, SIG_IGN);
  50:     timerclear(&itimer.it_value);
  51:     timerclear(&itimer.it_interval);
  52:     setitimer(ITIMER_REAL, &itimer, (struct timerval *)0);
  53: }

Defined functions

disp_msg defined in line 31; used 1 times
  • in line 41
end_msgs defined in line 46; used 2 times
start_msgs defined in line 37; used 2 times

Defined variables

current_line defined in line 25; never used
current_state defined in line 24; used 2 times
itimer defined in line 27; used 6 times
sccsid defined in line 8; never used
undo defined in line 29; never used
wait defined in line 28; used 1 times
  • in line 42

Defined macros

LONG_TIME defined in line 22; used 1 times
  • in line 29
MSG_INTERVAL defined in line 21; used 1 times
  • in line 28
Last modified: 1986-03-16
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1029
Valid CSS Valid XHTML 1.0 Strict